aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support/video_surface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/support/video_surface.cpp')
-rw-r--r--engines/titanic/support/video_surface.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/engines/titanic/support/video_surface.cpp b/engines/titanic/support/video_surface.cpp
index e71b25184b..85a1aa1c58 100644
--- a/engines/titanic/support/video_surface.cpp
+++ b/engines/titanic/support/video_surface.cpp
@@ -476,6 +476,34 @@ bool OSVideoSurface::loadIfReady() {
}
}
+void OSVideoSurface::transPixelate() {
+ if (!loadIfReady())
+ return;
+
+ lock();
+ Graphics::ManagedSurface *surface = _rawSurface;
+ uint transColor = getTransparencyColor();
+ // TODO: Check whether color is correct
+ uint pixelColor = surface->format.RGBToColor(0x50, 0, 0);
+
+ for (int yp = 0; yp < surface->h; ++yp) {
+ uint16 *pixelsP = (uint16 *)surface->getBasePtr(0, yp);
+ bool bitFlag = (yp % 2) == 0;
+ int replaceCtr = yp & 3;
+
+ for (int xp = 0; xp < surface->w; ++xp, ++pixelsP) {
+ if (bitFlag && *pixelsP == transColor && replaceCtr == 0)
+ *pixelsP = pixelColor;
+
+ bitFlag = !bitFlag;
+ replaceCtr = (replaceCtr + 1) & 3;
+ }
+ }
+
+ surface->markAllDirty();
+ unlock();
+}
+
int OSVideoSurface::freeSurface() {
if (!_ddSurface)
return 0;