diff options
author | Bertram <bertram@cegetel.net> | 2009-08-14 00:00:57 +0200 |
---|---|---|
committer | Bertram <bertram@cegetel.net> | 2009-08-14 00:00:57 +0200 |
commit | 1f2a31c0a97ee2ff858fe142e778c49011b93f71 (patch) | |
tree | 614c29443cfe4e0ba66f829349ee07af5681b967 | |
parent | 35979e4ee13898d99f16b2777292d257e91f8bf2 (diff) | |
download | mana-client-1f2a31c0a97ee2ff858fe142e778c49011b93f71.tar.gz mana-client-1f2a31c0a97ee2ff858fe142e778c49011b93f71.tar.bz2 mana-client-1f2a31c0a97ee2ff858fe142e778c49011b93f71.tar.xz mana-client-1f2a31c0a97ee2ff858fe142e778c49011b93f71.zip |
Made the mLoaded member working again.
-rw-r--r-- | src/resources/image.cpp | 24 | ||||
-rw-r--r-- | src/resources/image.h | 6 |
2 files changed, 28 insertions, 2 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 408668eb..b3f7140d 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -43,8 +43,19 @@ Image::Image(SDL_Surface *image): { mBounds.x = 0; mBounds.y = 0; - mBounds.w = mSDLSurface->w; - mBounds.h = mSDLSurface->h; + + if (mSDLSurface) + { + mBounds.w = mSDLSurface->w; + mBounds.h = mSDLSurface->h; + mLoaded = true; + } + else + { + logger->log( + "Image::Image(SDL_Surface*): Couldn't load invalid Surface!"); + mLoaded = false; + } } #ifdef USE_OPENGL @@ -59,6 +70,15 @@ Image::Image(GLuint glimage, int width, int height, int texWidth, int texHeight) mBounds.y = 0; mBounds.w = width; mBounds.h = height; + + if (mGLImage) + mLoaded = true; + else + { + logger->log( + "Image::Image(GLuint*, ...): Couldn't load invalid Surface!"); + mLoaded = false; + } } #endif diff --git a/src/resources/image.h b/src/resources/image.h index 91ecbb54..c97523a9 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -93,6 +93,12 @@ class Image : public Resource virtual void unload(); /** + * Tells is the image is loaded + */ + bool isLoaded() + { return mLoaded; } + + /** * Returns the width of the image. */ virtual int getWidth() const |