From 1ffc3a7cdaa6c54dceb18bfdc56032335b2cfcd9 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Sun, 15 May 2005 18:06:32 +0000 Subject: better monsterset management --- src/being.cpp | 3 ++- src/engine.cpp | 10 +--------- src/engine.h | 2 +- src/gui/setup.cpp | 4 ++-- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/being.cpp b/src/being.cpp index c63c2bb2..00d06a15 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -47,7 +47,8 @@ void add_node(Being *being) WFIFOSET(6); } // If the being is a monster then load the monsterset - else if (being->job >= 1002 && monsterset[being->job - 1002] == NULL) { + else if (being->job >= 1002 && monsterset.find( + being->job - 1002) == monsterset.end()) { std::stringstream filename; filename << "graphics/sprites/monster" << (being->job - 1002) << ".png"; logger->log("%s",filename.str().c_str()); diff --git a/src/engine.cpp b/src/engine.cpp index e189558d..f01a19ed 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -36,8 +36,6 @@ #include "floor_item.h" #include "gui/requesttrade.h" -#define MONSTERS_NUMBER 8 - char itemCurrenyQ[10] = "0"; int map_x, map_y, camera_x, camera_y; char npc_text[1000] = ""; @@ -69,7 +67,7 @@ TradeWindow *tradeWindow; RequestTradeDialog *requestTradeDialog; ConfirmDialog *quitDialog; BuddyWindow *buddyWindow; -std::vector monsterset; +std::map monsterset; /** * Listener used for exitting handling. @@ -252,12 +250,6 @@ Engine::Engine() emotionset = new Spriteset(emotionbmp, 19, 19); weaponset = new Spriteset(weaponbitmap, 160, 120); itemset = new Spriteset(itembitmap, 20, 20); - - // Loads all the monsters - for (int i = 0; i < MONSTERS_NUMBER; i++) - { - monsterset.push_back(NULL); - } } Engine::~Engine() diff --git a/src/engine.h b/src/engine.h index 4cb90f6f..548a3453 100644 --- a/src/engine.h +++ b/src/engine.h @@ -76,7 +76,7 @@ extern RequestTradeDialog *requestTradeDialog; extern TradeWindow *tradeWindow; extern BuddyWindow *buddyWindow; extern ConfirmDialog *quitDialog; -extern std::vector monsterset; +extern std::map monsterset; char get_x_offset(char, char); char get_y_offset(char, char); diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp index e6987766..629c0c86 100644 --- a/src/gui/setup.cpp +++ b/src/gui/setup.cpp @@ -52,13 +52,13 @@ ModeListModel::ModeListModel() } else{ /* Print valid modes */ - logger->log("Available Modes"); + /*logger->log("Available Modes"); for (int i = 0; modes[i]; ++i) { logger->log(" %dx%d", modes[i]->w, modes[i]->h); std::stringstream mode; mode << (int)modes[i]->w << "x" << (int)modes[i]->h; videoModes.push_back(mode.str()); - } + }*/ } } -- cgit v1.2.3-70-g09d2