summaryrefslogtreecommitdiff
path: root/src/gui/debugwindow.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2007-01-13 11:25:11 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2007-01-13 11:25:11 +0000
commita732939da33ce9b5ae71cc0f37587a28ec1f0eaf (patch)
tree522a6c6b0cc83ac5c80b217942fda353bae504aa /src/gui/debugwindow.cpp
parent43280f620282f15789660d0b93687714d9ebc2fd (diff)
downloadmana-a732939da33ce9b5ae71cc0f37587a28ec1f0eaf.tar.gz
mana-a732939da33ce9b5ae71cc0f37587a28ec1f0eaf.tar.bz2
mana-a732939da33ce9b5ae71cc0f37587a28ec1f0eaf.tar.xz
mana-a732939da33ce9b5ae71cc0f37587a28ec1f0eaf.zip
Fixed mouse coordinates display in debug window
Diffstat (limited to 'src/gui/debugwindow.cpp')
-rw-r--r--src/gui/debugwindow.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index c44ac1d1..24bd779c 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -28,6 +28,8 @@
#include <guichan/widgets/label.hpp>
#include "button.h"
+#include "gui.h"
+#include "viewport.h"
#include "../game.h"
#include "../engine.h"
@@ -72,15 +74,15 @@ DebugWindow::logic()
// Get the current mouse position
int mouseX, mouseY;
SDL_GetMouseState(&mouseX, &mouseY);
- //int mouseTileX = mouseX / 32 + camera_x;
- //int mouseTileY = mouseY / 32 + camera_y;
+ int mouseTileX = mouseX / 32 + viewport->getCameraX();
+ int mouseTileY = mouseY / 32 + viewport->getCameraY();
mFPSLabel->setCaption("[" + toString(fps) + " FPS");
mFPSLabel->adjustSize();
- //mTileMouseLabel->setCaption("[Mouse: " +
- // toString(mouseTileX) + ", " + toString(mouseTileY) + "]");
- //mTileMouseLabel->adjustSize();
+ mTileMouseLabel->setCaption("[Mouse: " +
+ toString(mouseTileX) + ", " + toString(mouseTileY) + "]");
+ mTileMouseLabel->adjustSize();
Map *currentMap = engine->getCurrentMap();
if (currentMap != NULL)