summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-03-02 14:02:27 +0000
committerJared Adams <jaxad0127@gmail.com>2010-03-02 14:03:26 +0000
commitaa676123c375096043721487088bda40ce7653fe (patch)
tree73a472790c7e9e8c358f8d8f81ec5fb51def1394 /src/gui
parent0c8c8cf7ea63def0d454f30227584a5f3062c013 (diff)
downloadmana-aa676123c375096043721487088bda40ce7653fe.tar.gz
mana-aa676123c375096043721487088bda40ce7653fe.tar.bz2
mana-aa676123c375096043721487088bda40ce7653fe.tar.xz
mana-aa676123c375096043721487088bda40ce7653fe.zip
Remove some unused members
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/viewport.cpp20
-rw-r--r--src/gui/viewport.h7
2 files changed, 7 insertions, 20 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 73dee40b..a5212e81 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -53,10 +53,7 @@ Viewport::Viewport():
mMouseY(0),
mPixelViewX(0.0f),
mPixelViewY(0.0f),
- mTileViewX(0),
- mTileViewY(0),
mShowDebugPath(false),
- mVisibleNames(false),
mPlayerFollowMouse(false),
mLocalWalkTime(-1)
{
@@ -67,11 +64,9 @@ Viewport::Viewport():
mScrollRadius = (int) config.getValue("ScrollRadius", 0);
mScrollCenterOffsetX = (int) config.getValue("ScrollCenterOffsetX", 0);
mScrollCenterOffsetY = (int) config.getValue("ScrollCenterOffsetY", 0);
- mVisibleNames = config.getValue("visiblenames", 1);
config.addListener("ScrollLaziness", this);
config.addListener("ScrollRadius", this);
- config.addListener("visiblenames", this);
mPopupMenu = new PopupMenu;
mBeingPopup = new BeingPopup;
@@ -82,8 +77,7 @@ Viewport::Viewport():
Viewport::~Viewport()
{
delete mPopupMenu;
-
- config.removeListener("visiblenames", this);
+ delete mBeingPopup;
}
void Viewport::setMap(Map *map)
@@ -186,9 +180,6 @@ void Viewport::draw(gcn::Graphics *gcnGraphics)
mPixelViewY = viewYmax;
}
- mTileViewX = (int) (mPixelViewX + 16) / 32;
- mTileViewY = (int) (mPixelViewY + 16) / 32;
-
// Draw tiles and sprites
if (mMap)
{
@@ -425,8 +416,10 @@ void Viewport::mouseDragged(gcn::MouseEvent &event)
if (mLocalWalkTime != player_node->getWalkTime())
{
mLocalWalkTime = player_node->getWalkTime();
- int destX = event.getX() / 32 + mTileViewX;
- int destY = event.getY() / 32 + mTileViewY;
+ int destX = (event.getX() + mPixelViewX + 16) /
+ mMap->getTileWidth();
+ int destY = (event.getY() + mPixelViewY + 16) /
+ mMap->getTileHeight();
player_node->setDestination(destX, destY);
}
}
@@ -456,9 +449,6 @@ void Viewport::optionChanged(const std::string &name)
{
mScrollLaziness = (int) config.getValue("ScrollLaziness", 32);
mScrollRadius = (int) config.getValue("ScrollRadius", 32);
-
- if (name == "visiblenames")
- mVisibleNames = config.getValue("visiblenames", 1);
}
void Viewport::mouseMoved(gcn::MouseEvent &event)
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index 3fab607d..e4944cd6 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -184,10 +184,7 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
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. */
int mShowDebugPath; /**< Show a path from player to pointer. */
- bool mVisibleNames; /**< Show target names. */
bool mPlayerFollowMouse;
@@ -196,9 +193,9 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
PopupMenu *mPopupMenu; /**< Popup menu. */
Being *mHoverBeing; /**< Being mouse is currently over. */
FloorItem *mHoverItem; /**< FloorItem mouse is currently over. */
- BeingPopup *mBeingPopup;
+ BeingPopup *mBeingPopup; /**< Being information popup. */
};
-extern Viewport *viewport; /**< The viewport */
+extern Viewport *viewport; /**< The viewport. */
#endif