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.cpp27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index 42f2f110..99b36fe4 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -19,8 +19,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <SDL_mouse.h>
-
#include <guichan/widgets/label.hpp>
#include "debugwindow.h"
@@ -54,28 +52,27 @@ DebugWindow::DebugWindow():
place(0, 0, mFPSLabel);
place(3, 0, mTileMouseLabel);
- place(0, 1, mMusicFileLabel, 2);
+ place(0, 1, mMusicFileLabel, 3);
place(3, 1, mParticleCountLabel);
- place(0, 2, mMapLabel, 2);
- place(0, 3, mMiniMapLabel, 2);
+ place(0, 2, mMapLabel, 4);
+ place(0, 3, mMiniMapLabel, 4);
reflowLayout(375, 0);
}
void DebugWindow::logic()
{
+ if (!isVisible())
+ return;
+
// Get the current mouse position
- int mouseX, mouseY;
- SDL_GetMouseState(&mouseX, &mouseY);
- int mouseTileX = (mouseX + viewport->getCameraX()) / 32;
- int mouseTileY = (mouseY + viewport->getCameraY()) / 32;
+ int mouseTileX = (viewport->getMouseX() + viewport->getCameraX()) / 32;
+ int mouseTileY = (viewport->getMouseY() + viewport->getCameraY()) / 32;
mFPSLabel->setCaption(toString(fps) + " FPS");
- mFPSLabel->adjustSize();
- mTileMouseLabel->setCaption("Mouse: " +
- toString(mouseTileX) + ", " + toString(mouseTileY));
- mTileMouseLabel->adjustSize();
+ mTileMouseLabel->setCaption("Tile: (" + toString(mouseTileX) + ", " +
+ toString(mouseTileY) + ")");
Map *currentMap = engine->getCurrentMap();
if (currentMap)
@@ -83,20 +80,16 @@ void DebugWindow::logic()
const std::string music =
"Music: " + currentMap->getProperty("music");
mMusicFileLabel->setCaption(music);
- mMusicFileLabel->adjustSize();
const std::string minimap =
"MiniMap: " + currentMap->getProperty("minimap");
mMiniMapLabel->setCaption(minimap);
- mMiniMapLabel->adjustSize();
const std::string map =
"Map: " + currentMap->getProperty("_filename");
mMapLabel->setCaption(map);
- mMapLabel->adjustSize();
}
mParticleCountLabel->setCaption("Particle count: " +
toString(Particle::particleCount));
- mParticleCountLabel->adjustSize();
}