summaryrefslogtreecommitdiff
path: root/src/resources/image.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-29 22:00:35 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-29 22:00:35 +0000
commit5352c44d1ab542c64c421afcc690b200f7231a9d (patch)
tree4695c79a788c3ab9daeaf2972052a6ea9821bf13 /src/resources/image.cpp
parent52a7af6227d0b2ff94ff2c8fecd708d4d6a71466 (diff)
downloadmana-client-5352c44d1ab542c64c421afcc690b200f7231a9d.tar.gz
mana-client-5352c44d1ab542c64c421afcc690b200f7231a9d.tar.bz2
mana-client-5352c44d1ab542c64c421afcc690b200f7231a9d.tar.xz
mana-client-5352c44d1ab542c64c421afcc690b200f7231a9d.zip
Clean up of the ConfigListener and Resource interfaces.
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r--src/resources/image.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index 5ea45842..6910bd55 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -31,8 +31,8 @@
bool Image::useOpenGL = false;
#endif
-Image::Image(SDL_Surface *image):
- image(image)
+Image::Image(const std::string &idPath, SDL_Surface *image):
+ Resource(idPath), image(image)
{
// Default to opaque
alpha = 1.0f;
@@ -44,7 +44,9 @@ Image::Image(SDL_Surface *image):
}
#ifdef USE_OPENGL
-Image::Image(GLuint glimage, int width, int height, int texWidth, int texHeight):
+Image::Image(const std::string &idPath, GLuint glimage, int width, int height,
+ int texWidth, int texHeight):
+ Resource(idPath),
glimage(glimage),
texWidth(texWidth),
texHeight(texHeight)
@@ -64,7 +66,7 @@ Image::~Image()
unload();
}
-Image* Image::load(void* buffer, unsigned int bufferSize)
+Image* Image::load(void* buffer, unsigned int bufferSize, const std::string &idPath)
{
// Load the raw file data from the buffer in an RWops structure
SDL_RWops *rw = SDL_RWFromMem(buffer, bufferSize);
@@ -234,7 +236,7 @@ Image* Image::load(void* buffer, unsigned int bufferSize)
return NULL;
}
- return new Image(texture, width, height, realWidth, realHeight);
+ return new Image(idPath, texture, width, height, realWidth, realHeight);
}
#endif
@@ -254,7 +256,7 @@ Image* Image::load(void* buffer, unsigned int bufferSize)
return NULL;
}
- return new Image(image);
+ return new Image(idPath, image);
}
void Image::unload()
@@ -330,7 +332,7 @@ void Image::setLoadAsOpenGL(bool useOpenGL)
SubImage::SubImage(Image *parent, SDL_Surface *image,
int x, int y, int width, int height):
- Image(image), parent(parent)
+ Image("", image), parent(parent)
{
parent->incRef();
@@ -344,7 +346,7 @@ SubImage::SubImage(Image *parent, SDL_Surface *image,
#ifdef USE_OPENGL
SubImage::SubImage(Image *parent, GLuint image,
int x, int y, int width, int height, int texWidth, int texHeight):
- Image(image, width, height, texWidth, texHeight), parent(parent)
+ Image("", image, width, height, texWidth, texHeight), parent(parent)
{
parent->incRef();