SCI: make scroll transitions work in upscaled hires mode

svn-id: r48667
This commit is contained in:
Martin Kiewitz 2010-04-16 11:22:37 +00:00
parent ae3962ce36
commit 1410f3c65a

View File

@ -407,15 +407,25 @@ void GfxTransitions::scroll(int16 number) {
screenWidth = _screen->getDisplayWidth(); screenHeight = _screen->getDisplayHeight(); screenWidth = _screen->getDisplayWidth(); screenHeight = _screen->getDisplayHeight();
oldScreenPtr = _oldScreen + _picRect.left + _picRect.top * screenWidth; oldScreenPtr = _oldScreen + _picRect.left + _picRect.top * screenWidth;
if (_screen->getUpscaledHires()) {
oldScreenPtr += _picRect.left + _picRect.top * screenWidth;
}
switch (number) { switch (number) {
case SCI_TRANSITIONS_SCROLL_LEFT: case SCI_TRANSITIONS_SCROLL_LEFT:
newScreenRect.right = newScreenRect.left; newScreenRect.right = newScreenRect.left;
newMoveRect.left = newMoveRect.right; newMoveRect.left = newMoveRect.right;
while (oldMoveRect.left < oldMoveRect.right) { while (oldMoveRect.left < oldMoveRect.right) {
oldScreenPtr++; oldMoveRect.right--; oldScreenPtr++;
if (oldMoveRect.right > oldMoveRect.left) if (_screen->getUpscaledHires())
g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height()); 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--; newScreenRect.right++; newMoveRect.left--;
_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top); _screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
if ((stepNr & 1) == 0) { if ((stepNr & 1) == 0) {
@ -431,8 +441,12 @@ void GfxTransitions::scroll(int16 number) {
newScreenRect.left = newScreenRect.right; newScreenRect.left = newScreenRect.right;
while (oldMoveRect.left < oldMoveRect.right) { while (oldMoveRect.left < oldMoveRect.right) {
oldMoveRect.left++; oldMoveRect.left++;
if (oldMoveRect.right > oldMoveRect.left) if (oldMoveRect.right > oldMoveRect.left) {
g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height()); 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--; newScreenRect.left--;
_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top); _screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
if ((stepNr & 1) == 0) { if ((stepNr & 1) == 0) {
@ -448,9 +462,16 @@ void GfxTransitions::scroll(int16 number) {
newScreenRect.bottom = newScreenRect.top; newScreenRect.bottom = newScreenRect.top;
newMoveRect.top = newMoveRect.bottom; newMoveRect.top = newMoveRect.bottom;
while (oldMoveRect.top < oldMoveRect.bottom) { while (oldMoveRect.top < oldMoveRect.bottom) {
oldScreenPtr += screenWidth; oldMoveRect.top++; oldScreenPtr += screenWidth;
if (oldMoveRect.top < oldMoveRect.bottom) if (_screen->getUpscaledHires())
g_system->copyRectToScreen(oldScreenPtr, screenWidth, _picRect.left, _picRect.top, oldMoveRect.width(), oldMoveRect.height()); 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--; newScreenRect.bottom++; newMoveRect.top--;
_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top); _screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
updateScreenAndWait(3); updateScreenAndWait(3);
@ -461,8 +482,12 @@ void GfxTransitions::scroll(int16 number) {
newScreenRect.top = newScreenRect.bottom; newScreenRect.top = newScreenRect.bottom;
while (oldMoveRect.top < oldMoveRect.bottom) { while (oldMoveRect.top < oldMoveRect.bottom) {
oldMoveRect.top++; oldMoveRect.top++;
if (oldMoveRect.top < oldMoveRect.bottom) if (oldMoveRect.top < oldMoveRect.bottom) {
g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height()); 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--; newScreenRect.top--;
_screen->copyRectToScreen(newScreenRect, _picRect.left, _picRect.top); _screen->copyRectToScreen(newScreenRect, _picRect.left, _picRect.top);
updateScreenAndWait(3); updateScreenAndWait(3);