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 /src/resources/image.cpp | |
parent | 35979e4ee13898d99f16b2777292d257e91f8bf2 (diff) | |
download | mana-1f2a31c0a97ee2ff858fe142e778c49011b93f71.tar.gz mana-1f2a31c0a97ee2ff858fe142e778c49011b93f71.tar.bz2 mana-1f2a31c0a97ee2ff858fe142e778c49011b93f71.tar.xz mana-1f2a31c0a97ee2ff858fe142e778c49011b93f71.zip |
Made the mLoaded member working again.
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r-- | src/resources/image.cpp | 24 |
1 files changed, 22 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 |