aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support/transparency_surface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/support/transparency_surface.cpp')
-rw-r--r--engines/titanic/support/transparency_surface.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/engines/titanic/support/transparency_surface.cpp b/engines/titanic/support/transparency_surface.cpp
index eb3fc28b52..8b5cbecc5f 100644
--- a/engines/titanic/support/transparency_surface.cpp
+++ b/engines/titanic/support/transparency_surface.cpp
@@ -66,8 +66,17 @@ int CTransparencySurface::moveX() {
}
uint CTransparencySurface::getPixel() const {
- const byte *pixelP = (const byte *)_surface->getBasePtr(_pos.x, _pos.y);
- return *pixelP;
+ byte pixel = *(const byte *)_surface->getBasePtr(_pos.x, _pos.y);
+ return pixel;
+}
+
+uint CTransparencySurface::getAlpha() const {
+ byte pixel = getPixel();
+ return _flag1 ? 0xFF - pixel : pixel;
+}
+
+bool CTransparencySurface::isPixelTransparent() {
+ return getAlpha() == 0xff;
}
} // End of namespace Titanic