summaryrefslogtreecommitdiff
path: root/src/resources/image.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-09-08 00:17:45 +0300
committerAndrei Karas <akaras@inbox.ru>2012-09-08 00:17:45 +0300
commit593cccb16074fe9269dd2f278bd79859769eb1fd (patch)
treed8b3d93001021c59622ea88140dbbef8aee05013 /src/resources/image.cpp
parentb7e35a7bbd41c39fa675e77b2af6a11bb4d86dd2 (diff)
downloadmanaverse-593cccb16074fe9269dd2f278bd79859769eb1fd.tar.gz
manaverse-593cccb16074fe9269dd2f278bd79859769eb1fd.tar.bz2
manaverse-593cccb16074fe9269dd2f278bd79859769eb1fd.tar.xz
manaverse-593cccb16074fe9269dd2f278bd79859769eb1fd.zip
Improve constructors in some classes.
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r--src/resources/image.cpp11
1 files changed, 6 insertions, 5 deletions
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<uint16_t>(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