aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/zvision/render_manager.cpp20
-rw-r--r--engines/zvision/render_manager.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp
index 3793ea8cf9..3f19cae6fe 100644
--- a/engines/zvision/render_manager.cpp
+++ b/engines/zvision/render_manager.cpp
@@ -291,6 +291,26 @@ void RenderManager::copyRectToWorkingWindow(const uint16 *buffer, int32 destX, i
_workingWindowDirtyRect.extend(Common::Rect(destX, destY, destX + width, destY + height));
}
+void RenderManager::copyRectToWorkingWindow(const uint16 *buffer, int32 destX, int32 destY, int32 imageWidth, int32 width, int32 height, int16 alphaColor) {
+ uint32 destOffset = 0;
+ uint32 sourceOffset = 0;
+ uint16 *workingWindowBufferPtr = (uint16 *)_workingWindowBuffer.getBasePtr(destX, destY);
+
+ for (int32 y = 0; y < height; y++) {
+ for (int32 x = 0; x < width; x++) {
+ uint16 color = buffer[sourceOffset + x];
+ if (color != alphaColor) {
+ workingWindowBufferPtr[destOffset + x] = color;
+ }
+ }
+
+ destOffset += _workingWidth;
+ sourceOffset += imageWidth;
+ }
+
+ _workingWindowDirtyRect.extend(Common::Rect(destX, destY, destX + width, destY + height));
+}
+
const Common::Point RenderManager::screenSpaceToImageSpace(const Common::Point &point) {
// Convert from screen space to working window space
Common::Point newPoint(point - Common::Point(_workingWindow.left, _workingWindow.top));
diff --git a/engines/zvision/render_manager.h b/engines/zvision/render_manager.h
index 9881676583..41a11bd113 100644
--- a/engines/zvision/render_manager.h
+++ b/engines/zvision/render_manager.h
@@ -109,6 +109,7 @@ public:
void renderBackbufferToScreen();
void copyRectToWorkingWindow(const uint16 *buffer, int32 destX, int32 destY, int32 imageWidth, int32 width, int32 height);
+ void copyRectToWorkingWindow(const uint16 *buffer, int32 destX, int32 destY, int32 imageWidth, int32 width, int32 height, int16 alphaColor);
/**
* Fills the entire workingWindow with the specified color