diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-19 15:09:27 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-19 15:09:27 +0000 |
commit | 3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (patch) | |
tree | 5084eaa47d4874a3a573de226f19c4be072e4888 /src/engine.cpp | |
parent | 19d5cc3a6bbbd911361b7e8b956840d0189d4c2b (diff) | |
download | mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.tar.gz mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.tar.bz2 mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.tar.xz mana-3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6.zip |
Reverted changeset r2269 (toString) as requested by ElvenProgrammer.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 8d78a078..3be152bd 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -24,6 +24,7 @@ #include "engine.h" #include <list> +#include <sstream> #include "being.h" #include "beingmanager.h" @@ -50,7 +51,6 @@ #include "resources/resourcemanager.h" #include "utils/dtor.h" -#include "utils/tostring.h" extern Minimap *minimap; @@ -80,8 +80,10 @@ 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( - "graphics/sprites/weapon" + toString(i) + ".png", 64, 64); + filename.str(), 64, 64); if (!tmp) { logger->error("Unable to load weaponset"); } else { @@ -216,12 +218,15 @@ 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)); - graphics->drawText( - toString(mCurrentMap->getMetaTile(i->x, i->y)->Gcost), - squareX + 4, squareY + 12, gcn::Graphics::CENTER); + + 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); } } |