summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-06-17 16:46:06 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-06-17 16:46:06 +0200
commit914d3de7c324cb1ec456892702689718352a7842 (patch)
treeeb05c251adb6f012a40f3d7de4eb42ab854b7d94 /src/game.cpp
parentfaf0a45d6b8b85acd2836cf5e8e7f7c5b161931d (diff)
downloadmana-914d3de7c324cb1ec456892702689718352a7842.tar.gz
mana-914d3de7c324cb1ec456892702689718352a7842.tar.bz2
mana-914d3de7c324cb1ec456892702689718352a7842.tar.xz
mana-914d3de7c324cb1ec456892702689718352a7842.zip
First pass on removing tile hard coded values.
Every files has been checked against the hard coded 32 values except the map.cpp file. I also added convenience functions in the Game class, centralized the default item icon size, and removed two unused defines in being.cpp.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 5bbe2d07..af9c2c39 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -979,3 +979,19 @@ void Game::changeMap(const std::string &mapPath)
event.setString("mapPath", mapPath);
event.trigger(Event::GameChannel);
}
+
+int Game::getCurrentTileWidth() const
+{
+ if (mCurrentMap)
+ return mCurrentMap->getTileWidth();
+
+ return DEFAULT_TILE_LENGTH;
+}
+
+int Game::getCurrentTileHeight() const
+{
+ if (mCurrentMap)
+ return mCurrentMap->getTileHeight();
+
+ return DEFAULT_TILE_LENGTH;
+}