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.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp
index 66681a8b..cf30df93 100644
--- a/src/gui/debugwindow.cpp
+++ b/src/gui/debugwindow.cpp
@@ -23,9 +23,9 @@
#include "debugwindow.h"
-#include <SDL_mouse.h>
-
#include <guichan/widgets/label.hpp>
+#include <sstream>
+#include <SDL_mouse.h>
#include "button.h"
@@ -33,8 +33,6 @@
#include "../engine.h"
#include "../map.h"
-#include "../utils/tostring.h"
-
DebugWindow::DebugWindow():
Window("Debug")
{
@@ -75,24 +73,29 @@ DebugWindow::logic()
int mouseTileX = mouseX / 32 + camera_x;
int mouseTileY = mouseY / 32 + camera_y;
- mFPSLabel->setCaption("[" + toString(fps) + " FPS");
+ std::stringstream updatedText;
+ updatedText << "[" << fps << " FPS]";
+ mFPSLabel->setCaption(updatedText.str());
mFPSLabel->adjustSize();
- mTileMouseLabel->setCaption("[Mouse: " +
- toString(mouseTileX) + ", " + toString(mouseTileY) + "]");
+ updatedText.str("");
+ updatedText << "[Mouse: " << mouseTileX << ", " << mouseTileY << "]";
+ mTileMouseLabel->setCaption(updatedText.str());
mTileMouseLabel->adjustSize();
- Map *currentMap = engine->getCurrentMap();
- if (currentMap != NULL)
+ updatedText.str("");
+ mCurrentMap = engine->getCurrentMap();
+
+ if (mCurrentMap != NULL)
{
- const std::string music =
- " [Music File: " + currentMap->getProperty("music") + "]";
- mMusicFileLabel->setCaption(music);
+ updatedText << " [Music File: "
+ << mCurrentMap->getProperty("music") << "]";
+ mMusicFileLabel->setCaption(updatedText.str());
mMusicFileLabel->adjustSize();
-
- const std::string minimap =
- " [MiniMap File: " + currentMap->getProperty("minimap") + "]";
- mMapFileLabel->setCaption(minimap);
+ updatedText.str("");
+ updatedText << " [MiniMap File: "
+ << mCurrentMap->getProperty("minimap") << "]";
+ mMapFileLabel->setCaption(updatedText.str());
mMapFileLabel->adjustSize();
}
}