diff options
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 |