diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-18 14:47:14 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-18 14:47:14 +0000 |
commit | ab678324e3d73e2354cef331624ecef7cfc03203 (patch) | |
tree | 29394a5aca6e59f817f7cfa3b9281891a273d259 /src/engine.cpp | |
parent | 32badd4b6f843cb74fdc3238fe92119518c8c0ab (diff) | |
download | mana-ab678324e3d73e2354cef331624ecef7cfc03203.tar.gz mana-ab678324e3d73e2354cef331624ecef7cfc03203.tar.bz2 mana-ab678324e3d73e2354cef331624ecef7cfc03203.tar.xz mana-ab678324e3d73e2354cef331624ecef7cfc03203.zip |
Added a toString conversion function.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 3be152bd..8d78a078 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -24,7 +24,6 @@ #include "engine.h" #include <list> -#include <sstream> #include "being.h" #include "beingmanager.h" @@ -51,6 +50,7 @@ #include "resources/resourcemanager.h" #include "utils/dtor.h" +#include "utils/tostring.h" extern Minimap *minimap; @@ -80,10 +80,8 @@ Engine::Engine(Network *network): 30, 32); for (int i = 0; i < 2; i++) { - std::stringstream filename; - filename << "graphics/sprites/weapon" << i << ".png"; Spriteset *tmp = ResourceManager::getInstance()->createSpriteset( - filename.str(), 64, 64); + "graphics/sprites/weapon" + toString(i) + ".png", 64, 64); if (!tmp) { logger->error("Unable to load weaponset"); } else { @@ -218,15 +216,12 @@ void Engine::draw(Graphics *graphics) { int squareX = i->x * 32 - map_x + 12; int squareY = i->y * 32 - map_y + 12; + graphics->setColor(gcn::Color(255, 0, 0)); graphics->fillRectangle(gcn::Rectangle(squareX, squareY, 8, 8)); - - MetaTile *tile = mCurrentMap->getMetaTile(i->x, i->y); - - std::stringstream cost; - cost << tile->Gcost; - graphics->drawText(cost.str(), squareX + 4, squareY + 12, - gcn::Graphics::CENTER); + graphics->drawText( + toString(mCurrentMap->getMetaTile(i->x, i->y)->Gcost), + squareX + 4, squareY + 12, gcn::Graphics::CENTER); } } |