summaryrefslogtreecommitdiff
path: root/src/graphic/graphic.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-14 15:43:26 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-14 15:43:26 +0000
commitb7170d13fd71fb624c06c4536974a7cd3f77591b (patch)
tree7f7583407e79423b08f98a50d897f6e30ac886dd /src/graphic/graphic.cpp
parenta120ea5cb0a57c9d3bd8677269bd65cf79dad933 (diff)
downloadmana-b7170d13fd71fb624c06c4536974a7cd3f77591b.tar.gz
mana-b7170d13fd71fb624c06c4536974a7cd3f77591b.tar.bz2
mana-b7170d13fd71fb624c06c4536974a7cd3f77591b.tar.xz
mana-b7170d13fd71fb624c06c4536974a7cd3f77591b.zip
Rewrote Spriteset to work with Image* instead of BITMAP*
Diffstat (limited to 'src/graphic/graphic.cpp')
-rw-r--r--src/graphic/graphic.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp
index 0e5b9a32..7678506b 100644
--- a/src/graphic/graphic.cpp
+++ b/src/graphic/graphic.cpp
@@ -196,20 +196,21 @@ GraphicEngine::GraphicEngine() {
gui_bitmap = this->buffer;
// Load the sprite sets
- BITMAP *npcbmp = load_bitmap("data/graphic/npcset.bmp", NULL);
- BITMAP *emotionbmp = load_bitmap("data/graphic/emotionset.bmp", NULL);
- BITMAP *tilesetbmp = load_bitmap("data/graphic/tileset.bmp", NULL);
- BITMAP *monsterbitmap = load_bitmap("data/graphic/monsterset.bmp", NULL);
+ ResourceManager *resman = ResourceManager::getInstance();
+ Image *npcbmp = resman->getImage("graphic/npcset.bmp");
+ Image *emotionbmp = resman->getImage("graphic/emotionset.bmp");
+ Image *tilesetbmp = resman->getImage("graphic/tileset.bmp");
+ Image *monsterbitmap = resman->getImage("graphic/monsterset.bmp");
if (!npcbmp) error("Unable to load npcset.bmp");
if (!emotionbmp) error("Unable to load emotionset.bmp");
if (!tilesetbmp) error("Unable to load tileset.bmp");
if (!monsterbitmap) error("Unable to load monsterset.bmp");
- npcset = new Spriteset(npcbmp, 50, 80, 0, 0);
- emotionset = new Spriteset(emotionbmp, 19, 19, 0, 0);
- tileset = new Spriteset(tilesetbmp, 32, 32, 0, 0);
- monsterset = new Spriteset(monsterbitmap, 60, 60, 30, 40);
+ npcset = new Spriteset(npcbmp, 50, 80);
+ emotionset = new Spriteset(emotionbmp, 19, 19);
+ tileset = new Spriteset(tilesetbmp, 32, 32);
+ monsterset = new Spriteset(monsterbitmap, 60, 60);
}
GraphicEngine::~GraphicEngine() {
@@ -341,12 +342,12 @@ void GraphicEngine::refresh() {
int mf = node->frame + node->action;
if (node->action == MONSTER_DEAD) {
- monsterset->spriteset[sprnum + 8 * MONSTER_DEAD]->draw(
- buffer, node->text_x, node->text_y);
+ monsterset->spriteset[sprnum + 8 * MONSTER_DEAD]->draw(buffer,
+ node->text_x + 30, node->text_y + 40);
}
else {
monsterset->spriteset[sprnum + 8 * mf]->draw(buffer,
- node->text_x, node->text_y);
+ node->text_x + 30, node->text_y + 40);
}
if (node->action != STAND) {