summaryrefslogtreecommitdiff
path: root/src/gui/debugwindow.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2006-03-19 20:43:10 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2006-03-19 20:43:10 +0000
commit654d24e74c56d240b8d622840c135e22a029636d (patch)
tree5eb8b94f7832bdbb6d21c7ded6e6da6b5f8f3464 /src/gui/debugwindow.cpp
parent3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (diff)
downloadmana-client-654d24e74c56d240b8d622840c135e22a029636d.tar.gz
mana-client-654d24e74c56d240b8d622840c135e22a029636d.tar.bz2
mana-client-654d24e74c56d240b8d622840c135e22a029636d.tar.xz
mana-client-654d24e74c56d240b8d622840c135e22a029636d.zip
Unreverted latest change by Doener due to my lack of proper communication abilities.
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();
}
}