summaryrefslogtreecommitdiff
path: root/src/graphic
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-02 16:31:19 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-02 16:31:19 +0000
commite76a6e3d2cc40e382e2ca1c7348e36a4082a221b (patch)
tree5608d032613e083d86923ad7b339352e9f157498 /src/graphic
parent40b4ecacd44bd3040d9600d6304422bdd7e2e4c4 (diff)
downloadmana-client-e76a6e3d2cc40e382e2ca1c7348e36a4082a221b.tar.gz
mana-client-e76a6e3d2cc40e382e2ca1c7348e36a4082a221b.tar.bz2
mana-client-e76a6e3d2cc40e382e2ca1c7348e36a4082a221b.tar.xz
mana-client-e76a6e3d2cc40e382e2ca1c7348e36a4082a221b.zip
Got rid of hairset.dat and playerset.dat.
Diffstat (limited to 'src/graphic')
-rw-r--r--src/graphic/graphic.cpp16
-rw-r--r--src/graphic/graphic.h3
-rw-r--r--src/graphic/image.cpp4
-rw-r--r--src/graphic/image.h2
4 files changed, 11 insertions, 14 deletions
diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp
index 40a00aa4..20649d3c 100644
--- a/src/graphic/graphic.cpp
+++ b/src/graphic/graphic.cpp
@@ -203,14 +203,12 @@ GraphicEngine::GraphicEngine() {
gui_bitmap = this->buffer;
emotionset = new Spriteset("./data/graphic/emotionset.dat");
- hairset = new Spriteset("./data/graphic/hairset.dat");
npcset = new Spriteset("./data/graphic/npcset.dat");
- playerset = new Spriteset("./data/graphic/playerset.dat");
tileset = new Spriteset("./data/graphic/tileset.dat");
BITMAP *monsterbitmap = load_bitmap("data/graphic/monsterset.bmp", NULL);
if (!monsterbitmap) error("Unable to load monsterset.bmp");
- monsterset = new Spriteset(monsterbitmap, 60, 60);
+ monsterset = new Spriteset(monsterbitmap, 60, 60, 30, 40);
}
GraphicEngine::~GraphicEngine() {
@@ -291,18 +289,18 @@ void GraphicEngine::refresh() {
playerset->spriteset[4 * pf + dir]->draw(buffer,
node->text_x - 64, node->text_y - 80);
- hairset->spriteset[hf]->draw(
- buffer, node->text_x - 2 + 2 * hairtable[pf][dir][0],
- node->text_y - 50 + 2 * hairtable[pf][dir][1]);
+ hairset->spriteset[hf]->draw(buffer,
+ node->text_x - 2 + 2 * hairtable[pf][dir][0],
+ node->text_y - 50 + 2 * hairtable[pf][dir][1]);
}
else {
int pf = node->frame + node->action;
playerset->spriteset[4 * pf + dir]->draw(buffer,
node->text_x - 64, node->text_y - 80);
- hairset->spriteset[hf]->draw(
- buffer, node->text_x - 2 + 2 * hairtable[pf][dir][0],
- node->text_y - 50 + 2 * hairtable[pf][dir][1]);
+ hairset->spriteset[hf]->draw(buffer,
+ node->text_x - 2 + 2 * hairtable[pf][dir][0],
+ node->text_y - 50 + 2 * hairtable[pf][dir][1]);
}
if (node->emotion != 0) {
emotionset->spriteset[node->emotion - 1]->draw(buffer,
diff --git a/src/graphic/graphic.h b/src/graphic/graphic.h
index 05b92acb..c87cf3ca 100644
--- a/src/graphic/graphic.h
+++ b/src/graphic/graphic.h
@@ -52,7 +52,6 @@ extern Chat chatlog;
extern bool show_skill_dialog, show_skill_list_dialog;
extern int show_npc_dialog;
extern int map_x, map_y, camera_x, camera_y;
-extern BITMAP *hairset;
extern char npc_button[10];
extern StatusWindow *statusWindow;
@@ -77,7 +76,7 @@ class BuySellListener : public gcn::ActionListener {
class GraphicEngine {
private:
- Spriteset *tileset, *emotionset, *npcset, *playerset, *monsterset, *hairset;
+ Spriteset *tileset, *emotionset, *npcset, *monsterset;
BITMAP *buffer;
public:
diff --git a/src/graphic/image.cpp b/src/graphic/image.cpp
index c5e28bfb..7bbf6a68 100644
--- a/src/graphic/image.cpp
+++ b/src/graphic/image.cpp
@@ -104,7 +104,7 @@ Spriteset::Spriteset(std::string filename)
}
}
-Spriteset::Spriteset(BITMAP *bmp, int width, int height)
+Spriteset::Spriteset(BITMAP *bmp, int width, int height, int offx, int offy)
{
/*
* We're creating sub bitmaps here for plain convenience. With SDL this'll
@@ -118,7 +118,7 @@ Spriteset::Spriteset(BITMAP *bmp, int width, int height)
{
spriteset.push_back(new VideoImage(
create_sub_bitmap(bmp, x, y, width, height),
- 30, 40));
+ offx, offy));
}
}
}
diff --git a/src/graphic/image.h b/src/graphic/image.h
index 41d94a2d..fd3000f6 100644
--- a/src/graphic/image.h
+++ b/src/graphic/image.h
@@ -130,7 +130,7 @@ class Spriteset {
/*
* Cuts the passed bitmap in a grid of sub bitmaps.
*/
- Spriteset::Spriteset(BITMAP *bmp, int width, int height);
+ Spriteset::Spriteset(BITMAP *bmp, int w, int h, int offx, int offy);
/**
* Destructor