summaryrefslogtreecommitdiff
path: root/src/gui/viewport.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/viewport.h')
-rw-r--r--src/gui/viewport.h24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index 522ea734..6e7a2370 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -115,29 +115,41 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
int getCameraY() const { return (int) mPixelViewY; }
/**
+ * Returns mouse x in pixels.
+ */
+ int getMouseX() const { return mMouseX; }
+
+ /**
+ * Returns mouse y in pixels.
+ */
+ int getMouseY() const { return mMouseY; }
+
+ /**
* Changes viewpoint by relative pixel coordinates.
*/
void scrollBy(float x, float y) { mPixelViewX += x; mPixelViewY += y; }
private:
- Map *mMap; /**< The current map. */
+ Map *mMap; /**< The current map. */
int mScrollRadius;
int mScrollLaziness;
int mScrollCenterOffsetX;
int mScrollCenterOffsetY;
- float mPixelViewX; /**< Current viewpoint in pixels. */
- float mPixelViewY; /**< Current viewpoint in pixels. */
+ 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 mTileViewX; /**< Current viewpoint in tiles. */
int mTileViewY; /**< Current viewpoint in tiles. */
- bool mShowDebugPath; /**< Show a path from player to pointer. */
+ bool mShowDebugPath; /**< Show a path from player to pointer. */
bool mPlayerFollowMouse;
int mWalkTime;
- PopupMenu *mPopupMenu; /**< Popup menu. */
+ PopupMenu *mPopupMenu; /**< Popup menu. */
};
-extern Viewport *viewport; /**< The viewport */
+extern Viewport *viewport; /**< The viewport */
#endif