summaryrefslogtreecommitdiff
path: root/src/gui/debugwindow.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-18 14:47:14 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-18 14:47:14 +0000
commitab678324e3d73e2354cef331624ecef7cfc03203 (patch)
tree29394a5aca6e59f817f7cfa3b9281891a273d259 /src/gui/debugwindow.cpp
parent32badd4b6f843cb74fdc3238fe92119518c8c0ab (diff)
downloadmana-client-ab678324e3d73e2354cef331624ecef7cfc03203.tar.gz
mana-client-ab678324e3d73e2354cef331624ecef7cfc03203.tar.bz2
mana-client-ab678324e3d73e2354cef331624ecef7cfc03203.tar.xz
mana-client-ab678324e3d73e2354cef331624ecef7cfc03203.zip
Added a toString conversion function.
Diffstat (limited to 'src/gui/debugwindow.cpp')
-rw-r--r--src/gui/debugwindow.cpp35
1 files changed, 16 insertions, 19 deletions
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 <guichan/widgets/label.hpp>
-#include <sstream>
#include <SDL_mouse.h>
+#include <guichan/widgets/label.hpp>
+
#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();
}
}