diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-07-07 02:12:24 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-07-07 03:17:16 +0300 |
commit | 7d151c8fc05cd7feaf1e1cee33fd8289208fa18d (patch) | |
tree | cc246201d9aafb94087efbe85cd13b4b18eacaaf /src/resources/image.cpp | |
parent | 95c8a3c0b4d2f0d39c81a6671452e1aa34a626f9 (diff) | |
download | manaverse-7d151c8fc05cd7feaf1e1cee33fd8289208fa18d.tar.gz manaverse-7d151c8fc05cd7feaf1e1cee33fd8289208fa18d.tar.bz2 manaverse-7d151c8fc05cd7feaf1e1cee33fd8289208fa18d.tar.xz manaverse-7d151c8fc05cd7feaf1e1cee33fd8289208fa18d.zip |
Add map reduce feature for software drawing.
Now invisible tiles will be removed if this mode enabled.
Diffstat (limited to 'src/resources/image.cpp')
-rw-r--r-- | src/resources/image.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 2d3676304..fdcf210c3 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -53,7 +53,8 @@ Image::Image(SDL_Surface *image, bool hasAlphaChannel, Uint8 *alphaChannel): mAlpha(1.0f), mHasAlphaChannel(hasAlphaChannel), mSDLSurface(image), - mAlphaChannel(alphaChannel) + mAlphaChannel(alphaChannel), + mIsAlphaVisible(hasAlphaChannel) { #ifdef USE_OPENGL mGLImage = 0; @@ -88,6 +89,7 @@ Image::Image(GLuint glimage, int width, int height, mSDLSurface(0), mAlphaChannel(0), mUseAlphaCache(false), + mIsAlphaVisible(true), mGLImage(glimage), mTexWidth(texWidth), mTexHeight(texHeight) @@ -792,11 +794,13 @@ SubImage::SubImage(Image *parent, SDL_Surface *image, mParent->incRef(); mParent->SDLTerminateAlphaCache(); mHasAlphaChannel = mParent->hasAlphaChannel(); + mIsAlphaVisible = mHasAlphaChannel; mAlphaChannel = mParent->SDLgetAlphaChannel(); } else { mHasAlphaChannel = false; + mIsAlphaVisible = false; mAlphaChannel = 0; } @@ -805,6 +809,10 @@ SubImage::SubImage(Image *parent, SDL_Surface *image, mBounds.y = static_cast<short>(y); mBounds.w = static_cast<Uint16>(width); mBounds.h = static_cast<Uint16>(height); + mInternalBounds.x = mParent->mBounds.x; + mInternalBounds.y = mParent->mBounds.y; + mInternalBounds.w = mParent->mBounds.w; + mInternalBounds.h = mParent->mBounds.h; mUseAlphaCache = false; } @@ -823,6 +831,11 @@ SubImage::SubImage(Image *parent, GLuint image, mBounds.y = static_cast<short>(y); mBounds.w = static_cast<Uint16>(width); mBounds.h = static_cast<Uint16>(height); + mInternalBounds.x = mParent->mBounds.x; + mInternalBounds.y = mParent->mBounds.y; + mInternalBounds.w = mParent->mBounds.w; + mInternalBounds.h = mParent->mBounds.h; + mIsAlphaVisible = mHasAlphaChannel; } #endif |