diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-13 23:38:31 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-01-13 23:38:31 +0000 |
commit | 65c1d2b0b022de1340509738e65314474e2eb141 (patch) | |
tree | 2bbda5306b2a03d1e68455456fe1e65edd4e157e /src/graphic/image.cpp | |
parent | 0b6e2b1e4a256da0c2418af63df1c90e9a120690 (diff) | |
download | mana-65c1d2b0b022de1340509738e65314474e2eb141.tar.gz mana-65c1d2b0b022de1340509738e65314474e2eb141.tar.bz2 mana-65c1d2b0b022de1340509738e65314474e2eb141.tar.xz mana-65c1d2b0b022de1340509738e65314474e2eb141.zip |
Added heavily modified resource manager by zenogais that is currently using
Allegro to load/draw images. Only the login wallpaper is currently loaded
using the resource manager and the resource manager still waits with searching
for available files until they are asked for instead of indexing what is
available.
Diffstat (limited to 'src/graphic/image.cpp')
-rw-r--r-- | src/graphic/image.cpp | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/src/graphic/image.cpp b/src/graphic/image.cpp index 9d0d3cac..008c4017 100644 --- a/src/graphic/image.cpp +++ b/src/graphic/image.cpp @@ -24,37 +24,13 @@ #include "image.h" -// Image - -Image::Image(int offset_x, int offset_y) { - this->offset_x = offset_x; - this->offset_y = offset_y; -} - - -// RleImage - -RleImage::RleImage(RLE_SPRITE *src, int offset_x, int offset_y): - Image(offset_x, offset_y) -{ - this->src = src; -} - -RleImage::~RleImage() { - destroy_rle_sprite(src); -} - -void RleImage::draw(BITMAP *dest, int x, int y) { - draw_rle_sprite(dest, src, x + offset_x, y + offset_y); -} - - // VideoImage VideoImage::VideoImage(BITMAP *src, int offset_x, int offset_y): - Image(offset_x, offset_y) + src(src), + offset_x(offset_x), + offset_y(offset_y) { - this->src = src; } VideoImage::~VideoImage() { @@ -73,22 +49,6 @@ void VideoImage::draw(BITMAP *dst, int x, int y) { // Spriteset -Spriteset::Spriteset(std::string filename) -{ - DATAFILE *datafile = load_datafile(filename.c_str()); - if (!datafile)error("Unable to load graphic file: " + filename); - int i = 0; - while (datafile[i].type != DAT_END) { - Image *temp_image; - temp_image = new RleImage( - (RLE_SPRITE*)datafile[i].dat, - getProperty(&datafile[i], DAT_ID('X','C','R','P')), - getProperty(&datafile[i], DAT_ID('Y','C','R','P'))); - spriteset.push_back(temp_image); - i++; - } -} - Spriteset::Spriteset(BITMAP *bmp, int width, int height, int offx, int offy) { /* |