aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/transitions.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-04-16 11:22:37 +0000
committerMartin Kiewitz2010-04-16 11:22:37 +0000
commit1410f3c65a4cea2121b33f8eef94503ddbc5ae2b (patch)
tree8ad46cbcd71e3b3fffe89a86c202992106b5b11f /engines/sci/graphics/transitions.cpp
parentae3962ce36cf558bf3fa5147fb4ec18f24686811 (diff)
downloadscummvm-rg350-1410f3c65a4cea2121b33f8eef94503ddbc5ae2b.tar.gz
scummvm-rg350-1410f3c65a4cea2121b33f8eef94503ddbc5ae2b.tar.bz2
scummvm-rg350-1410f3c65a4cea2121b33f8eef94503ddbc5ae2b.zip
SCI: make scroll transitions work in upscaled hires mode
svn-id: r48667
Diffstat (limited to 'engines/sci/graphics/transitions.cpp')
-rw-r--r--engines/sci/graphics/transitions.cpp45
1 files changed, 35 insertions, 10 deletions
diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp
index 0a2bd067a7..787e39cef0 100644
--- a/engines/sci/graphics/transitions.cpp
+++ b/engines/sci/graphics/transitions.cpp
@@ -407,15 +407,25 @@ void GfxTransitions::scroll(int16 number) {
screenWidth = _screen->getDisplayWidth(); screenHeight = _screen->getDisplayHeight();
oldScreenPtr = _oldScreen + _picRect.left + _picRect.top * screenWidth;
+ if (_screen->getUpscaledHires()) {
+ oldScreenPtr += _picRect.left + _picRect.top * screenWidth;
+ }
switch (number) {
case SCI_TRANSITIONS_SCROLL_LEFT:
newScreenRect.right = newScreenRect.left;
newMoveRect.left = newMoveRect.right;
while (oldMoveRect.left < oldMoveRect.right) {
- oldScreenPtr++; oldMoveRect.right--;
- if (oldMoveRect.right > oldMoveRect.left)
- g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
+ oldScreenPtr++;
+ if (_screen->getUpscaledHires())
+ oldScreenPtr++;
+ oldMoveRect.right--;
+ if (oldMoveRect.right > oldMoveRect.left) {
+ if (!_screen->getUpscaledHires())
+ g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
+ else
+ g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left * 2, oldMoveRect.top * 2, oldMoveRect.width() * 2, oldMoveRect.height() * 2);
+ }
newScreenRect.right++; newMoveRect.left--;
_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
if ((stepNr & 1) == 0) {
@@ -431,8 +441,12 @@ void GfxTransitions::scroll(int16 number) {
newScreenRect.left = newScreenRect.right;
while (oldMoveRect.left < oldMoveRect.right) {
oldMoveRect.left++;
- if (oldMoveRect.right > oldMoveRect.left)
- g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
+ if (oldMoveRect.right > oldMoveRect.left) {
+ if (!_screen->getUpscaledHires())
+ g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
+ else
+ g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left * 2, oldMoveRect.top * 2, oldMoveRect.width() * 2, oldMoveRect.height() * 2);
+ }
newScreenRect.left--;
_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
if ((stepNr & 1) == 0) {
@@ -448,9 +462,16 @@ void GfxTransitions::scroll(int16 number) {
newScreenRect.bottom = newScreenRect.top;
newMoveRect.top = newMoveRect.bottom;
while (oldMoveRect.top < oldMoveRect.bottom) {
- oldScreenPtr += screenWidth; oldMoveRect.top++;
- if (oldMoveRect.top < oldMoveRect.bottom)
- g_system->copyRectToScreen(oldScreenPtr, screenWidth, _picRect.left, _picRect.top, oldMoveRect.width(), oldMoveRect.height());
+ oldScreenPtr += screenWidth;
+ if (_screen->getUpscaledHires())
+ oldScreenPtr += screenWidth;
+ oldMoveRect.top++;
+ if (oldMoveRect.top < oldMoveRect.bottom) {
+ if (!_screen->getUpscaledHires())
+ g_system->copyRectToScreen(oldScreenPtr, screenWidth, _picRect.left, _picRect.top, oldMoveRect.width(), oldMoveRect.height());
+ else
+ g_system->copyRectToScreen(oldScreenPtr, screenWidth, _picRect.left * 2, _picRect.top * 2, oldMoveRect.width() * 2, oldMoveRect.height() * 2);
+ }
newScreenRect.bottom++; newMoveRect.top--;
_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
updateScreenAndWait(3);
@@ -461,8 +482,12 @@ void GfxTransitions::scroll(int16 number) {
newScreenRect.top = newScreenRect.bottom;
while (oldMoveRect.top < oldMoveRect.bottom) {
oldMoveRect.top++;
- if (oldMoveRect.top < oldMoveRect.bottom)
- g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
+ if (oldMoveRect.top < oldMoveRect.bottom) {
+ if (!_screen->getUpscaledHires())
+ g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
+ else
+ g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left * 2, oldMoveRect.top * 2, oldMoveRect.width() * 2, oldMoveRect.height() * 2);
+ }
newScreenRect.top--;
_screen->copyRectToScreen(newScreenRect, _picRect.left, _picRect.top);
updateScreenAndWait(3);