summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-06 15:26:12 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-06 15:26:12 +0300
commitfdbd1a4c521c537597b63cd4f2262517cab1f81a (patch)
treea873f6567942bfc8241703eb34a00abc671a2999 /src/resources
parent4fb8f9f0905038f3180f108ec56b2a326ceb3483 (diff)
downloadplus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.tar.gz
plus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.tar.bz2
plus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.tar.xz
plus-fdbd1a4c521c537597b63cd4f2262517cab1f81a.zip
Improve map draw speed in fast opengl.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/image.cpp10
-rw-r--r--src/resources/image.h5
2 files changed, 6 insertions, 9 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp
index 0e2423bf9..6fa0b5bf5 100644
--- a/src/resources/image.cpp
+++ b/src/resources/image.cpp
@@ -46,6 +46,9 @@
Image::Image(SDL_Surface *const image, const bool hasAlphaChannel0,
uint8_t *const alphaChannel) :
Resource(),
+#ifdef USE_OPENGL
+ mGLImage(0),
+#endif
mLoaded(false),
mAlpha(1.0f),
mHasAlphaChannel(hasAlphaChannel0),
@@ -53,12 +56,7 @@ Image::Image(SDL_Surface *const image, const bool hasAlphaChannel0,
mAlphaChannel(alphaChannel),
mUseAlphaCache(SDLImageHelper::mEnableAlphaCache),
mIsAlphaVisible(hasAlphaChannel0),
-#ifdef USE_OPENGL
- mIsAlphaCalculated(false),
- mGLImage(0)
-#else
mIsAlphaCalculated(false)
-#endif
{
mBounds.x = 0;
mBounds.y = 0;
@@ -83,6 +81,7 @@ Image::Image(SDL_Surface *const image, const bool hasAlphaChannel0,
Image::Image(const GLuint glimage, const int width, const int height,
const int texWidth, const int texHeight) :
Resource(),
+ mGLImage(glimage),
mLoaded(false),
mAlpha(1.0f),
mHasAlphaChannel(true),
@@ -91,7 +90,6 @@ Image::Image(const GLuint glimage, const int width, const int height,
mUseAlphaCache(false),
mIsAlphaVisible(true),
mIsAlphaCalculated(false),
- mGLImage(glimage),
mTexWidth(texWidth),
mTexHeight(texHeight)
{
diff --git a/src/resources/image.h b/src/resources/image.h
index 8fafc87aa..26498e988 100644
--- a/src/resources/image.h
+++ b/src/resources/image.h
@@ -143,8 +143,6 @@ class Image : public Resource
void SDLTerminateAlphaCache();
#ifdef USE_OPENGL
- // OpenGL only public functions
-
int getTextureWidth() const
{ return mTexWidth; }
@@ -153,6 +151,8 @@ class Image : public Resource
GLuint getGLImage() const
{ return mGLImage; }
+
+ GLuint mGLImage;
#endif
bool isHasAlphaChannel() const
@@ -213,7 +213,6 @@ class Image : public Resource
Image(const GLuint glimage, const int width, const int height,
const int texWidth, const int texHeight);
- GLuint mGLImage;
int mTexWidth, mTexHeight;
#endif
};