summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-04 18:24:40 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-04 18:24:40 +0000
commita8d207e6889cd353dd11736b5690aa54ac6de993 (patch)
tree1979e3fbfcafebc4426ea72ed055e2db072800e8
parentae4e9076051a736e2bbbce91e7fd58cb27448f24 (diff)
downloadmana-client-a8d207e6889cd353dd11736b5690aa54ac6de993.tar.gz
mana-client-a8d207e6889cd353dd11736b5690aa54ac6de993.tar.bz2
mana-client-a8d207e6889cd353dd11736b5690aa54ac6de993.tar.xz
mana-client-a8d207e6889cd353dd11736b5690aa54ac6de993.zip
Got rid of last 5 Allegro datafiles.
-rw-r--r--data/graphic/items.bmpbin0 -> 13254 bytes
-rw-r--r--src/graphic/graphic.cpp19
-rw-r--r--src/graphic/image.h4
-rw-r--r--src/gui/inventory.cpp11
-rw-r--r--src/gui/inventory.h3
5 files changed, 23 insertions, 14 deletions
diff --git a/data/graphic/items.bmp b/data/graphic/items.bmp
new file mode 100644
index 00000000..e7f86399
--- /dev/null
+++ b/data/graphic/items.bmp
Binary files differ
diff --git a/src/graphic/graphic.cpp b/src/graphic/graphic.cpp
index 4537ee12..dd5df45b 100644
--- a/src/graphic/graphic.cpp
+++ b/src/graphic/graphic.cpp
@@ -195,9 +195,17 @@ GraphicEngine::GraphicEngine() {
// Initialize the gui bitmap to the page that will be drawn first
gui_bitmap = this->buffer;
- emotionset = new Spriteset("./data/graphic/emotionset.dat");
- npcset = new Spriteset("./data/graphic/npcset.dat");
- tileset = new Spriteset("./data/graphic/tileset.dat");
+ BITMAP *npcbmp = load_bitmap("data/graphic/npcset.bmp", NULL);
+ if (!npcbmp) error("Unable to load npcset.bmp");
+ npcset = new Spriteset(npcbmp, 80, 50, 0, 0);
+
+ BITMAP *emotionbmp = load_bitmap("data/graphic/emotionset.bmp", NULL);
+ if (!emotionbmp) error("Unable to load emotionset.bmp");
+ emotionset = new Spriteset(emotionbmp, 19, 19, 0, 0);
+
+ BITMAP *tilesetbmp = load_bitmap("data/graphic/tileset.bmp", NULL);
+ if (!tilesetbmp) error("Unable to load tileset.bmp");
+ tileset = new Spriteset(tilesetbmp, 32, 32, 0, 0);
BITMAP *monsterbitmap = load_bitmap("data/graphic/monsterset.bmp", NULL);
if (!monsterbitmap) error("Unable to load monsterset.bmp");
@@ -213,7 +221,10 @@ GraphicEngine::~GraphicEngine() {
delete npcTextDialog;
delete skillDialog;
- //delete tileset;
+ delete tileset;
+ delete monsterset;
+ delete npcset;
+ delete emotionset;
}
void GraphicEngine::refresh() {
diff --git a/src/graphic/image.h b/src/graphic/image.h
index fd3000f6..60e04eac 100644
--- a/src/graphic/image.h
+++ b/src/graphic/image.h
@@ -18,7 +18,7 @@
* along with The Mana World; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * By ElvenProgrammer aka Eugenio Favalli (umperio@users.sourceforge.net)
+ * $Id$
*/
#ifndef _IMAGE_H
@@ -119,7 +119,7 @@ class VideoImage : public Image {
class Spriteset {
public:
// Vector storing the whole spriteset.
- std::vector<Image *> spriteset;
+ std::vector<Image*> spriteset;
/**
* Load a datafile containing the spriteset
diff --git a/src/gui/inventory.cpp b/src/gui/inventory.cpp
index 1a8f59d7..8d75f34e 100644
--- a/src/gui/inventory.cpp
+++ b/src/gui/inventory.cpp
@@ -29,7 +29,9 @@ InventoryWindow::InventoryWindow(gcn::Container *parent):
{
setSize(322, 60);
- itemset = load_datafile("./data/graphic/items.dat");
+ BITMAP *itembmp = load_bitmap("data/graphic/items.bmp", NULL);
+ if (!itembmp) error("Unable to load items.bmp");
+ itemset = new Spriteset(itembmp, 20, 20, 0, 0);
for (int i = 0; i < INVENTORY_SIZE; i++) {
items[i].id = -1;
@@ -55,15 +57,10 @@ void InventoryWindow::draw(gcn::Graphics *graphics)
for (int i = 0; i < INVENTORY_SIZE; i++) {
if (items[i].quantity > 0) {
if (items[i].id >= 501 && items[i].id <= 511) {
- draw_rle_sprite(target,
- (RLE_SPRITE *)itemset[items[i].id - 501].dat,
+ itemset->spriteset[items[i].id - 501]->draw(target,
x + 24 * i,
y + 26);
}
- //else {
- // masked_blit((BITMAP *)itemset[0].dat, gui_bitmap, 0, 0,
- // x + 24 * i, y + 26, 22, 22);
- //}
std::stringstream ss;
ss << items[i].quantity;
diff --git a/src/gui/inventory.h b/src/gui/inventory.h
index a89578a3..21ffe6bc 100644
--- a/src/gui/inventory.h
+++ b/src/gui/inventory.h
@@ -33,6 +33,7 @@
#include "../game.h"
#include "../log.h"
#include "../net/network.h"
+#include "../graphic/image.h"
#include "gui.h"
#include "window.h"
@@ -86,7 +87,7 @@ class InventoryWindow : public Window {
int useItem(int index, int id);
int dropItem(int index, int amunt);
- DATAFILE *itemset;
+ Spriteset *itemset;
int itemMeny, itemMeny_x, itemMeny_y, itemMeny_i;
};