From 593cccb16074fe9269dd2f278bd79859769eb1fd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 8 Sep 2012 00:17:45 +0300 Subject: Improve constructors in some classes. --- src/resources/image.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/resources/image.cpp') diff --git a/src/resources/image.cpp b/src/resources/image.cpp index e70ee3de5..0e2423bf9 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -45,6 +45,8 @@ Image::Image(SDL_Surface *const image, const bool hasAlphaChannel0, uint8_t *const alphaChannel) : + Resource(), + mLoaded(false), mAlpha(1.0f), mHasAlphaChannel(hasAlphaChannel0), mSDLSurface(image), @@ -61,8 +63,6 @@ Image::Image(SDL_Surface *const image, const bool hasAlphaChannel0, mBounds.x = 0; mBounds.y = 0; - mLoaded = false; - if (mSDLSurface) { mBounds.w = static_cast(mSDLSurface->w); @@ -82,6 +82,8 @@ Image::Image(SDL_Surface *const image, const bool hasAlphaChannel0, #ifdef USE_OPENGL Image::Image(const GLuint glimage, const int width, const int height, const int texWidth, const int texHeight) : + Resource(), + mLoaded(false), mAlpha(1.0f), mHasAlphaChannel(true), mSDLSurface(nullptr), @@ -104,9 +106,8 @@ Image::Image(const GLuint glimage, const int width, const int height, } else { - logger->log( - "Image::Image(GLuint*, ...): Couldn't load invalid Surface!"); - mLoaded = false; + logger->log("Image::Image(GLuint*, ...):" + " Couldn't load invalid Surface!"); } } #endif -- cgit v1.2.3-60-g2f50