summaryrefslogtreecommitdiff
path: root/src/graphic/image.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-02 15:23:31 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-02 15:23:31 +0000
commit40b4ecacd44bd3040d9600d6304422bdd7e2e4c4 (patch)
tree4df4181bd7f0bab6187f1f173cb94cd962eda912 /src/graphic/image.cpp
parente25b9848449f109487fdbab53f4e99c28b8d3214 (diff)
downloadmana-40b4ecacd44bd3040d9600d6304422bdd7e2e4c4.tar.gz
mana-40b4ecacd44bd3040d9600d6304422bdd7e2e4c4.tar.bz2
mana-40b4ecacd44bd3040d9600d6304422bdd7e2e4c4.tar.xz
mana-40b4ecacd44bd3040d9600d6304422bdd7e2e4c4.zip
Got rid of monsterset.dat. Oh and the monsters have a more realistic size now. ;)
Diffstat (limited to 'src/graphic/image.cpp')
-rw-r--r--src/graphic/image.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/graphic/image.cpp b/src/graphic/image.cpp
index da9bb1d5..c5e28bfb 100644
--- a/src/graphic/image.cpp
+++ b/src/graphic/image.cpp
@@ -104,9 +104,28 @@ Spriteset::Spriteset(std::string filename)
}
}
+Spriteset::Spriteset(BITMAP *bmp, int width, int height)
+{
+ /*
+ * We're creating sub bitmaps here for plain convenience. With SDL this'll
+ * probably need to be done different.
+ */
+ int x, y;
+
+ for (y = 0; y + height <= bmp->h; y += height)
+ {
+ for (x = 0; x + width <= bmp->w; x += width)
+ {
+ spriteset.push_back(new VideoImage(
+ create_sub_bitmap(bmp, x, y, width, height),
+ 30, 40));
+ }
+ }
+}
+
Spriteset::~Spriteset()
{
- for (int i = 0; i < spriteset.size(); i++) {
+ for (unsigned int i = 0; i < spriteset.size(); i++) {
delete spriteset[i];
}
}