summaryrefslogtreecommitdiff
path: root/src/graphic/image.h
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/image.h
parenta120ea5cb0a57c9d3bd8677269bd65cf79dad933 (diff)
downloadmana-client-b7170d13fd71fb624c06c4536974a7cd3f77591b.tar.gz
mana-client-b7170d13fd71fb624c06c4536974a7cd3f77591b.tar.bz2
mana-client-b7170d13fd71fb624c06c4536974a7cd3f77591b.tar.xz
mana-client-b7170d13fd71fb624c06c4536974a7cd3f77591b.zip
Rewrote Spriteset to work with Image* instead of BITMAP*
Diffstat (limited to 'src/graphic/image.h')
-rw-r--r--src/graphic/image.h49
1 files changed, 7 insertions, 42 deletions
diff --git a/src/graphic/image.h b/src/graphic/image.h
index 1bc43ef4..b732d4cf 100644
--- a/src/graphic/image.h
+++ b/src/graphic/image.h
@@ -21,42 +21,15 @@
* $Id$
*/
-#ifndef _IMAGE_H
-#define _IMAGE_H
+#ifndef _TMW_SPRITESET_H
+#define _TMW_SPRITESET_H
#include <allegro.h>
#include <string>
#include <vector>
#include <iostream>
#include "../log.h"
-
-/**
- * A video image stored in memory.
- */
-class VideoImage {
- private:
- BITMAP *src;
- int offset_x, offset_y;
-
- public:
- /**
- * Creates a VideoImage
- * @param src is a reference to a BITMAP
- * @param offset_x is the x offset from where to start drawing
- * @param offset_y is the y offset from where to start drawing
- */
- VideoImage(BITMAP *src, int offset_x, int offset_y);
-
- /**
- * Destructor
- */
- virtual ~VideoImage();
-
- /**
- * Draws a sprite
- */
- void draw(BITMAP *dest, int x, int y);
-};
+#include "../resources/image.h"
/**
* Stores a complete set of sprites.
@@ -64,25 +37,17 @@ class VideoImage {
class Spriteset {
public:
// Vector storing the whole spriteset.
- std::vector<VideoImage*> spriteset;
+ std::vector<Image*> spriteset;
/*
- * Cuts the passed bitmap in a grid of sub bitmaps.
+ * Cuts the passed image in a grid of sub images.
*/
- Spriteset::Spriteset(BITMAP *bmp, int w, int h, int offx, int offy);
+ Spriteset::Spriteset(Image *img, int w, int h);
/**
- * Destructor
+ * Destructor.
*/
~Spriteset();
-
- private:
- /**
- * Helper function to get offset
- * @param datafile is a reference to the whole spriteset
- * @param type is the property of the datafile object
- */
- int getProperty(DATAFILE *datafile, int type);
};
#endif