diff options
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); } } |