summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-08 19:10:44 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-08 19:10:44 +0000
commite645ad2a139c332937813dd2a1e5424ded182e26 (patch)
tree2301eaaf164b73af148078d2ee70591cb357a6a6
parent61536d859c62518718d17e82e21b3a2459de3410 (diff)
downloadmana-e645ad2a139c332937813dd2a1e5424ded182e26.tar.gz
mana-e645ad2a139c332937813dd2a1e5424ded182e26.tar.bz2
mana-e645ad2a139c332937813dd2a1e5424ded182e26.tar.xz
mana-e645ad2a139c332937813dd2a1e5424ded182e26.zip
Removed some conditional code.
-rw-r--r--ChangeLog1
-rw-r--r--src/resources/image.cpp20
2 files changed, 5 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 0f638d7b..e4748ca1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
2006-03-08 Björn Steinbrink <B.Steinbrink@gmx.de>
+ * src/resources/image.cpp: Removed some conditional code.
* src/localplayer.cpp, src/gui/gui.cpp: Reverted changes from r2225,
it broke walking code as I missed the differences between tile and
being collisions.
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index 3b860c01..5176ec7a 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -48,7 +48,8 @@ Image::Image(const std::string &idPath, GLuint glimage, int width, int height,
mGLImage(glimage),
mTexWidth(texWidth),
mTexHeight(texHeight),
- mAlpha(1.0f)
+ mImage(0),
+ mAlpha(1.0)
{
bounds.x = 0;
bounds.y = 0;
@@ -259,10 +260,6 @@ void Image::unload()
{
loaded = false;
-#ifdef USE_OPENGL
- if (mUseOpenGL) return;
-#endif
-
if (!mImage) return;
// Free the image surface.
@@ -287,11 +284,9 @@ void Image::setAlpha(float a)
{
mAlpha = a;
-#ifdef USE_OPENGL
- if (mUseOpenGL) {
+ if (!mImage) {
return;
}
-#endif
// Set the alpha value this image is drawn at
SDL_SetAlpha(mImage, SDL_SRCALPHA | SDL_RLEACCEL, (int)(255 * mAlpha));
@@ -344,14 +339,7 @@ SubImage::SubImage(Image *parent, GLuint image,
SubImage::~SubImage()
{
-#ifdef USE_OPENGL
- if (!mUseOpenGL) {
- mImage = NULL;
- }
-#else
- mImage = NULL;
-#endif
-
+ mImage = 0; // Avoid destruction of the image
mParent->decRef();
}