summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/gui/viewport.cpp20
-rw-r--r--src/gui/viewport.h7
-rw-r--r--src/localplayer.cpp5
-rw-r--r--src/localplayer.h13
4 files changed, 7 insertions, 38 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
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 750c8c45..8c918a97 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -103,11 +103,6 @@ LocalPlayer::LocalPlayer(int id, int job):
mLocalWalkTime(-1),
mMessageTime(0)
{
- // Variable to keep the local player from doing certain actions before a map
- // is initialized. e.g. drawing a player's name using the TextManager, since
- // it appears to be dependant upon map coordinates for updating drawing.
- mMapInitialized = false;
-
mUpdateName = true;
mTextColor = &guiPalette->getColor(Palette::PLAYER);
diff --git a/src/localplayer.h b/src/localplayer.h
index 919b5540..69fd4d0f 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -391,17 +391,6 @@ class LocalPlayer : public Player
*/
bool getCheckNameSetting() const { return mUpdateName; }
- /**
- * Set if the current map is initialized.
- */
- void setMapInitialized(bool initialized)
- { mMapInitialized = initialized; }
-
- /**
- * Tells if the current map is initialized.
- */
- bool isMapInitialized() const { return mMapInitialized; }
-
/** Keeps the Equipment related values */
const std::auto_ptr<Equipment> mEquipment;
@@ -410,8 +399,6 @@ class LocalPlayer : public Player
/** Whether or not the name settings have changed */
bool mUpdateName;
- bool mMapInitialized; /**< Whether or not the map is available yet */
-
virtual void handleStatusEffect(StatusEffect *effect, int effectId);
// Colors don't change for local player