diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-03 22:39:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-03 22:39:35 +0300 |
commit | f0f135493b2951af8661c8d7e7396c713164a723 (patch) | |
tree | 5fa4af6eb22cae8650cbd96d7dd7211223950414 /src/gui/viewport.h | |
parent | 4039ef116901d4513c3535cc119dc40abd8e14df (diff) | |
download | manaverse-f0f135493b2951af8661c8d7e7396c713164a723.tar.gz manaverse-f0f135493b2951af8661c8d7e7396c713164a723.tar.bz2 manaverse-f0f135493b2951af8661c8d7e7396c713164a723.tar.xz manaverse-f0f135493b2951af8661c8d7e7396c713164a723.zip |
Improve a bit calculations in viewport.
Diffstat (limited to 'src/gui/viewport.h')
-rw-r--r-- | src/gui/viewport.h | 10 |
1 files changed, 8 insertions, 2 deletions
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. */ |