aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision/render_table.cpp
diff options
context:
space:
mode:
authorMarisa-Chan2014-01-07 18:39:16 +0700
committerMarisa-Chan2014-01-07 18:39:16 +0700
commit1428cb8950e5bdcfad9d15d0fb2e32ff1dbc0bae (patch)
tree5baeb94cd7e5249f5416c9af9a0e5e59443bfafa /engines/zvision/render_table.cpp
parent48156debaf148b50acd3eb6e3de7020498016a5f (diff)
downloadscummvm-rg350-1428cb8950e5bdcfad9d15d0fb2e32ff1dbc0bae.tar.gz
scummvm-rg350-1428cb8950e5bdcfad9d15d0fb2e32ff1dbc0bae.tar.bz2
scummvm-rg350-1428cb8950e5bdcfad9d15d0fb2e32ff1dbc0bae.zip
ZVISION: Refactoring of renderManager.
Diffstat (limited to 'engines/zvision/render_table.cpp')
-rw-r--r--engines/zvision/render_table.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/engines/zvision/render_table.cpp b/engines/zvision/render_table.cpp
index 5a0bae7c22..210c4fc1fb 100644
--- a/engines/zvision/render_table.cpp
+++ b/engines/zvision/render_table.cpp
@@ -123,6 +123,28 @@ void RenderTable::mutateImage(uint16 *sourceBuffer, uint16 *destBuffer, uint32 d
}
}
+void RenderTable::mutateImage(Graphics::Surface *dstBuf, Graphics::Surface *srcBuf) {
+ uint32 destOffset = 0;
+
+ uint16 *sourceBuffer = (uint16 *)srcBuf->getPixels();
+ uint16 *destBuffer = (uint16 *)dstBuf->getPixels();
+
+ for (int16 y = 0; y < srcBuf->h; ++y) {
+ uint32 sourceOffset = y * _numColumns;
+
+ for (int16 x = 0; x < srcBuf->w; ++x) {
+ uint32 index = sourceOffset + x;
+
+ // RenderTable only stores offsets from the original coordinates
+ uint32 sourceYIndex = y + _internalBuffer[index].y;
+ uint32 sourceXIndex = x + _internalBuffer[index].x;
+
+ destBuffer[destOffset] = sourceBuffer[sourceYIndex * _numColumns + sourceXIndex];
+ destOffset++;
+ }
+ }
+}
+
void RenderTable::generateRenderTable() {
switch (_renderState) {
case ZVision::RenderTable::PANORAMA: