summaryrefslogtreecommitdiff
path: root/src/being/compoundsprite.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-09-23 22:01:44 +0300
committerAndrei Karas <akaras@inbox.ru>2016-09-23 22:01:44 +0300
commit3c404128c4669a1f4f190e20a89553677717fc50 (patch)
tree2db4e5031089c800c4e00fd6244e578f44a7c910 /src/being/compoundsprite.cpp
parent89b267d6d73bbc59f7c313b8a22b97fbb27f99a8 (diff)
downloadplus-3c404128c4669a1f4f190e20a89553677717fc50.tar.gz
plus-3c404128c4669a1f4f190e20a89553677717fc50.tar.bz2
plus-3c404128c4669a1f4f190e20a89553677717fc50.tar.xz
plus-3c404128c4669a1f4f190e20a89553677717fc50.zip
Add missing comments into defines.
Diffstat (limited to 'src/being/compoundsprite.cpp')
-rw-r--r--src/being/compoundsprite.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp
index 7f0066fd8..e1349e0ef 100644
--- a/src/being/compoundsprite.cpp
+++ b/src/being/compoundsprite.cpp
@@ -54,14 +54,14 @@
#ifndef SDL_BYTEORDER
#error missing SDL_endian.h
-#endif
+#endif // SDL_BYTEORDER
#ifndef USE_SDL2
static const int BUFFER_WIDTH = 100;
static const int BUFFER_HEIGHT = 100;
static const unsigned cache_max_size = 10;
static const unsigned cache_clean_part = 3;
-#endif
+#endif // USE_SDL2
bool CompoundSprite::mEnableDelay = true;
@@ -78,7 +78,7 @@ CompoundSprite::CompoundSprite() :
mLastTime(0),
#ifndef USE_SDL2
mNextRedrawTime(0),
-#endif
+#endif // USE_SDL2
mNeedsRedraw(false),
mEnableAlphaFix(config.getBoolValue("enableAlphaFix")),
mDisableAdvBeingCaching(config.getBoolValue("disableAdvBeingCaching")),
@@ -326,12 +326,12 @@ void CompoundSprite::redraw() const
const int gmask = 0x00ff0000;
const int bmask = 0x0000ff00;
const int amask = 0x000000ff;
-#else
+#else // SDL_BYTEORDER == SDL_BIG_ENDIAN
const int rmask = 0x000000ff;
const int gmask = 0x0000ff00;
const int bmask = 0x00ff0000;
const int amask = 0xff000000;
-#endif
+#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
SDL_Surface *const surface = MSDL_CreateRGBSurface(SDL_HWSURFACE,
BUFFER_WIDTH, BUFFER_HEIGHT, 32, rmask, gmask, bmask, amask);
@@ -371,11 +371,7 @@ void CompoundSprite::redraw() const
SDL_Surface *const surfaceA = MSDL_CreateRGBSurface(SDL_HWSURFACE,
BUFFER_WIDTH, BUFFER_HEIGHT, 32, rmask, gmask, bmask, amask);
-#ifdef USE_SDL2
- SDL_SetSurfaceAlphaMod(surface, 255);
-#else
SDL_SetAlpha(surface, 0, SDL_ALPHA_OPAQUE);
-#endif
SDL_BlitSurface(surface, nullptr, surfaceA, nullptr);
delete mImage;
@@ -393,7 +389,7 @@ void CompoundSprite::redraw() const
{
mAlphaImage = nullptr;
}
-#endif
+#endif // USE_SDL2
}
void CompoundSprite::setAlpha(float alpha)
@@ -403,7 +399,7 @@ void CompoundSprite::setAlpha(float alpha)
if (mEnableAlphaFix &&
#ifdef USE_OPENGL
imageHelper->useOpenGL() == RENDER_SOFTWARE &&
-#endif
+#endif // USE_OPENGL
mSprites.size() > 3U)
{
FOR_EACH (SpriteConstIterator, it, mSprites)
@@ -422,7 +418,7 @@ void CompoundSprite::updateImages() const
#ifdef USE_OPENGL
if (imageHelper->useOpenGL() != RENDER_SOFTWARE)
return;
-#endif
+#endif // USE_OPENGL
if (mEnableDelay)
{
@@ -452,7 +448,7 @@ void CompoundSprite::updateImages() const
redraw();
}
}
-#endif
+#endif // USE_SDL2
}
bool CompoundSprite::updateFromCache() const
@@ -520,7 +516,7 @@ bool CompoundSprite::updateFromCache() const
mImage = nullptr;
mAlphaImage = nullptr;
// miss++;
-#endif
+#endif // USE_SDL2
return false;
}