diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-04-27 23:03:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-04-27 23:39:57 +0300 |
commit | caf62e4d1c039f8d4d33bfd05f476890fdc79fcf (patch) | |
tree | 0d3e455994185ffdf04212f3284797a899931744 /src/gui/viewport.h | |
parent | 7f0fa9b82fc4deb28d61fc0d2fc503f0e48747c1 (diff) | |
download | plus-caf62e4d1c039f8d4d33bfd05f476890fdc79fcf.tar.gz plus-caf62e4d1c039f8d4d33bfd05f476890fdc79fcf.tar.bz2 plus-caf62e4d1c039f8d4d33bfd05f476890fdc79fcf.tar.xz plus-caf62e4d1c039f8d4d33bfd05f476890fdc79fcf.zip |
Improve screen position calculation.
Diffstat (limited to 'src/gui/viewport.h')
-rw-r--r-- | src/gui/viewport.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/viewport.h b/src/gui/viewport.h index 43f61bcfc..3031a181e 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -190,13 +190,13 @@ class Viewport : public WindowContainer, public gcn::MouseListener, * Returns camera x offset in pixels. */ int getCameraX() const - { return static_cast<int>(mPixelViewX); } + { return mPixelViewX; } /** * Returns camera y offset in pixels. */ int getCameraY() const - { return static_cast<int>(mPixelViewY); } + { return mPixelViewY; } /** * Returns mouse x in pixels. @@ -213,7 +213,7 @@ class Viewport : public WindowContainer, public gcn::MouseListener, /** * Changes viewpoint by relative pixel coordinates. */ - void scrollBy(float x, float y) + void scrollBy(int x, int y) { mPixelViewX += x; mPixelViewY += y; } /** @@ -305,8 +305,8 @@ class Viewport : public WindowContainer, public gcn::MouseListener, int mScrollCenterOffsetY; int mMouseX; /**< Current mouse position in pixels. */ int mMouseY; /**< Current mouse position in pixels. */ - float mPixelViewX; /**< Current viewpoint in pixels. */ - float mPixelViewY; /**< Current viewpoint in pixels. */ + int mPixelViewX; /**< Current viewpoint in pixels. */ + int mPixelViewY; /**< Current viewpoint in pixels. */ int mShowDebugPath; /**< Show a path from player to pointer. */ int mCameraMode; /**< Camera mode. */ |