summaryrefslogtreecommitdiff
path: root/src/engine.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/engine.cpp
parent3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 (diff)
downloadmana-654d24e74c56d240b8d622840c135e22a029636d.tar.gz
mana-654d24e74c56d240b8d622840c135e22a029636d.tar.bz2
mana-654d24e74c56d240b8d622840c135e22a029636d.tar.xz
mana-654d24e74c56d240b8d622840c135e22a029636d.zip
Unreverted latest change by Doener due to my lack of proper communication abilities.
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp17
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);
}
}