From 3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Sun, 19 Mar 2006 15:09:27 +0000 Subject: Reverted changeset r2269 (toString) as requested by ElvenProgrammer. --- src/gui/debugwindow.cpp | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'src/gui/debugwindow.cpp') 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 - #include +#include +#include #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(); } } -- cgit v1.2.3-70-g09d2