From ab678324e3d73e2354cef331624ecef7cfc03203 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Sat, 18 Mar 2006 14:47:14 +0000 Subject: Added a toString conversion function. --- src/monster.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/monster.cpp') diff --git a/src/monster.cpp b/src/monster.cpp index 6416c716..af84b25e 100644 --- a/src/monster.cpp +++ b/src/monster.cpp @@ -23,13 +23,13 @@ #include "monster.h" -#include - #include "game.h" #include "log.h" #include "resources/resourcemanager.h" +#include "utils/tostring.h" + class Spriteset; extern std::map monsterset; @@ -39,13 +39,9 @@ Monster::Monster(Uint32 id, Uint16 job, Map *map): // Load monster spriteset, if necessary if (monsterset.find(job - 1002) == monsterset.end()) { - std::stringstream filename; - - filename << "graphics/sprites/monster" << (job - 1002) << ".png"; - logger->log("%s",filename.str().c_str()); - Spriteset *tmp = ResourceManager::getInstance()->createSpriteset( - filename.str(), 60, 60); + "graphics/sprites/monster" + toString(job - 1002) + ".png", + 60, 60); if (!tmp) { logger->error("Unable to load monster spriteset!"); } else { -- cgit v1.2.3-70-g09d2