From 654d24e74c56d240b8d622840c135e22a029636d Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Sun, 19 Mar 2006 20:43:10 +0000 Subject: Unreverted latest change by Doener due to my lack of proper communication abilities. --- src/gui/debugwindow.cpp | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'src/gui/debugwindow.cpp') diff --git a/src/gui/debugwindow.cpp b/src/gui/debugwindow.cpp index cf30df93..66681a8b 100644 --- a/src/gui/debugwindow.cpp +++ b/src/gui/debugwindow.cpp @@ -23,16 +23,18 @@ #include "debugwindow.h" -#include -#include #include +#include + #include "button.h" #include "../game.h" #include "../engine.h" #include "../map.h" +#include "../utils/tostring.h" + DebugWindow::DebugWindow(): Window("Debug") { @@ -73,29 +75,24 @@ DebugWindow::logic() int mouseTileX = mouseX / 32 + camera_x; int mouseTileY = mouseY / 32 + camera_y; - std::stringstream updatedText; - updatedText << "[" << fps << " FPS]"; - mFPSLabel->setCaption(updatedText.str()); + mFPSLabel->setCaption("[" + toString(fps) + " FPS"); mFPSLabel->adjustSize(); - updatedText.str(""); - updatedText << "[Mouse: " << mouseTileX << ", " << mouseTileY << "]"; - mTileMouseLabel->setCaption(updatedText.str()); + mTileMouseLabel->setCaption("[Mouse: " + + toString(mouseTileX) + ", " + toString(mouseTileY) + "]"); mTileMouseLabel->adjustSize(); - updatedText.str(""); - mCurrentMap = engine->getCurrentMap(); - - if (mCurrentMap != NULL) + Map *currentMap = engine->getCurrentMap(); + if (currentMap != NULL) { - updatedText << " [Music File: " - << mCurrentMap->getProperty("music") << "]"; - mMusicFileLabel->setCaption(updatedText.str()); + const std::string music = + " [Music File: " + currentMap->getProperty("music") + "]"; + mMusicFileLabel->setCaption(music); mMusicFileLabel->adjustSize(); - updatedText.str(""); - updatedText << " [MiniMap File: " - << mCurrentMap->getProperty("minimap") << "]"; - mMapFileLabel->setCaption(updatedText.str()); + + const std::string minimap = + " [MiniMap File: " + currentMap->getProperty("minimap") + "]"; + mMapFileLabel->setCaption(minimap); mMapFileLabel->adjustSize(); } } -- cgit v1.2.3-70-g09d2