aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorrichiesams2013-08-16 10:45:31 -0500
committerrichiesams2013-08-16 10:45:31 -0500
commitaf0a58ecda26f12c630db759667d7adc79e733d6 (patch)
tree2aa7ef02ff51e9be6395a63b6768580060a41750 /engines
parent26159e6ea52cab35eeba425c066e2faaa0540c2f (diff)
downloadscummvm-rg350-af0a58ecda26f12c630db759667d7adc79e733d6.tar.gz
scummvm-rg350-af0a58ecda26f12c630db759667d7adc79e733d6.tar.bz2
scummvm-rg350-af0a58ecda26f12c630db759667d7adc79e733d6.zip
ZVISION: Fix copyTransposedRectToBackBuffer
Diffstat (limited to 'engines')
-rw-r--r--engines/zvision/render_manager.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp
index 5bc709553b..bfafd7fe19 100644
--- a/engines/zvision/render_manager.cpp
+++ b/engines/zvision/render_manager.cpp
@@ -152,21 +152,23 @@ void RenderManager::renderSubRectToBackbuffer(Graphics::Surface &surface, uint32
return;
if (isTransposed) {
- copyTransposedRectToBackbuffer((uint16 *)surface.getBasePtr(subRectangle.left, subRectangle.right), surface.w, destRect.left, destRect.top, destRect.width(), destRect.height());
+ copyTransposedRectToBackbuffer((uint16 *)surface.getBasePtr(subRectangle.left, subRectangle.top), surface.h, destRect.left, destRect.top, destRect.width(), destRect.height());
} else {
_backbuffer.copyRectToSurface(surface.getBasePtr(subRectangle.left, subRectangle.top), surface.pitch, destRect.left, destRect.top, destRect.width(), destRect.height());
}
}
-void RenderManager::copyTransposedRectToBackbuffer(const uint16 *buffer, int imageHeight, int x, int y, int width, int height) {
+void RenderManager::copyTransposedRectToBackbuffer(const uint16 *buffer, int imageWidth, int x, int y, int width, int height) {
uint16 *dest = (uint16 *)_backbuffer.getBasePtr(x, y);
- for (int x = 0; x < width; x++) {
- int columnOffset = x * imageHeight;
- for (int y = 0; y < height; y++) {
- *dest = buffer[columnOffset + y];
+ for (int i = 0; i < width; i++) {
+ int columnOffset = i * imageWidth;
+ for (int j = 0; j < height; j++) {
+ *dest = buffer[columnOffset + j];
dest++;
}
+
+ dest += _backbuffer.w;
}
}