summaryrefslogtreecommitdiff
path: root/src/gui/viewport.h
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-03-05 23:13:55 -0700
committerIra Rice <irarice@gmail.com>2009-03-05 23:13:55 -0700
commitaa4229cbb9f2b264ca96c3beedc66b1c79ccc1f5 (patch)
tree19c5a75a766b7df51ae468fb6b8fdbcfd2c6cc72 /src/gui/viewport.h
parent93e45964f3b7a0735984616f622ec32b40a21781 (diff)
downloadmana-aa4229cbb9f2b264ca96c3beedc66b1c79ccc1f5.tar.gz
mana-aa4229cbb9f2b264ca96c3beedc66b1c79ccc1f5.tar.bz2
mana-aa4229cbb9f2b264ca96c3beedc66b1c79ccc1f5.tar.xz
mana-aa4229cbb9f2b264ca96c3beedc66b1c79ccc1f5.zip
Made some optimizations based on some profiling done by Octalot, as well
as some other optimizations that I could see that cut down on some unneeded redraws, which in turn improved frame rates slightly. Signed-off-by: Ira Rice <irarice@gmail.com>
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 a131d162..12fdb187 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -116,29 +116,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