From f0f135493b2951af8661c8d7e7396c713164a723 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 3 Mar 2016 22:39:35 +0300 Subject: Improve a bit calculations in viewport. --- src/gui/viewport.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gui/viewport.h') diff --git a/src/gui/viewport.h b/src/gui/viewport.h index a03137761..fa02f244b 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -154,10 +154,10 @@ class Viewport final : public WindowContainer, { return mCameraRelativeY; } void setCameraRelativeX(const int n) - { mCameraRelativeX = n; } + { mCameraRelativeX = n; updateMidVars(); } void setCameraRelativeY(const int n) - { mCameraRelativeY = n; } + { mCameraRelativeY = n; updateMidVars(); } void moveCameraToActor(const BeingId actorId, const int x = 0, @@ -171,6 +171,8 @@ class Viewport final : public WindowContainer, void getMouseTile(int &destX, int &destY) const; + void videoResized(); + int mMouseX; /**< Current mouse position in pixels. */ int mMouseY; /**< Current mouse position in pixels. */ @@ -180,6 +182,8 @@ class Viewport final : public WindowContainer, /// Clears any matching hovers void clearHover(const ActorSprite *const actor); + void updateMidVars(); + static void validateSpeed(); private: @@ -227,6 +231,8 @@ class Viewport final : public WindowContainer, int mMousePressY; int mPixelViewX; /**< Current viewpoint in pixels. */ int mPixelViewY; /**< Current viewpoint in pixels. */ + int mMidTileX; + int mMidTileY; int mLocalWalkTime; /**< Timestamp before the next walk can be sent. */ -- cgit v1.2.3-70-g09d2