summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
Diffstat (limited to 'src/being')
-rw-r--r--src/being/compoundsprite.cpp24
-rw-r--r--src/being/compoundsprite.h3
-rw-r--r--src/being/localplayer.cpp8
-rw-r--r--src/being/localplayer.h4
4 files changed, 18 insertions, 21 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;
}
diff --git a/src/being/compoundsprite.h b/src/being/compoundsprite.h
index 71a77e87e..3c4002569 100644
--- a/src/being/compoundsprite.h
+++ b/src/being/compoundsprite.h
@@ -130,7 +130,8 @@ class CompoundSprite notfinal : public Sprite
int mLastTime;
#ifndef USE_SDL2
mutable int mNextRedrawTime;
-#endif
+#endif // USE_SDL2
+
static bool mEnableDelay;
mutable bool mNeedsRedraw;
bool mEnableAlphaFix;
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 007a3d88e..a385cf0f7 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -94,7 +94,7 @@
#ifdef USE_MUMBLE
#include "mumblemanager.h"
-#endif
+#endif // USE_MUMBLE
#include <climits>
@@ -246,7 +246,7 @@ void LocalPlayer::logic()
#ifdef USE_MUMBLE
if (mumbleManager)
mumbleManager->setPos(mX, mY, mDirection);
-#endif
+#endif // USE_MUMBLE
// Actions are allowed once per second
if (get_elapsed_time(mLastAction) >= 1000)
@@ -409,7 +409,7 @@ void LocalPlayer::setAction(const BeingActionT &action,
#ifdef USE_MUMBLE
if (mumbleManager)
mumbleManager->setAction(CAST_S32(action));
-#endif
+#endif // USE_MUMBLE
}
void LocalPlayer::setGMLevel(const int level)
@@ -1694,7 +1694,7 @@ void LocalPlayer::tryMagic(const std::string &spell, const int baseMagic,
}
}
}
-#endif
+#endif // TMWA_SUPPORT
void LocalPlayer::loadHomes()
{
diff --git a/src/being/localplayer.h b/src/being/localplayer.h
index d74481298..72c4d7258 100644
--- a/src/being/localplayer.h
+++ b/src/being/localplayer.h
@@ -206,7 +206,7 @@ class LocalPlayer final : public Being,
#ifdef TMWA_SUPPORT
void magicAttack() const;
-#endif
+#endif // TMWA_SUPPORT
void specialMove(const unsigned char direction);
@@ -448,7 +448,7 @@ class LocalPlayer final : public Being,
const int baseMagic,
const int schoolMagic,
const int mana);
-#endif
+#endif // TMWA_SUPPORT
void loadHomes();