summaryrefslogtreecommitdiff
path: root/src/gui/debugwindow.cpp
diff options
context:
space:
mode:
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)