1
/* ScummVM - Graphic Adventure Engine
3
* ScummVM is the legal property of its developers, whose names
4
* are too numerous to list here. Please refer to the COPYRIGHT
5
* file distributed with this source distribution.
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
* $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/scummvm/tags/release-1-1-1/engines/sci/graphics/transitions.cpp $
22
* $Id: transitions.cpp 48084 2010-02-17 23:37:32Z fingolfin $
26
#include "common/events.h"
27
#include "common/util.h"
28
#include "common/stack.h"
29
#include "common/system.h"
30
#include "graphics/surface.h"
33
#include "sci/engine/state.h"
34
#include "sci/graphics/gui.h"
35
#include "sci/graphics/screen.h"
36
#include "sci/graphics/palette.h"
37
#include "sci/graphics/transitions.h"
41
GfxTransitions::GfxTransitions(SciGui *gui, GfxScreen *screen, GfxPalette *palette, bool isVGA)
42
: _gui(gui), _screen(screen), _palette(palette), _isVGA(isVGA) {
46
GfxTransitions::~GfxTransitions() {
50
// This table contains a mapping between oldIDs (prior SCI1LATE) and newIDs
51
static const GfxTransitionTranslateEntry oldTransitionIDs[] = {
52
{ 0, SCI_TRANSITIONS_VERTICALROLL_FROMCENTER, false },
53
{ 1, SCI_TRANSITIONS_HORIZONTALROLL_FROMCENTER, false },
54
{ 2, SCI_TRANSITIONS_STRAIGHT_FROM_RIGHT, false },
55
{ 3, SCI_TRANSITIONS_STRAIGHT_FROM_LEFT, false },
56
{ 4, SCI_TRANSITIONS_STRAIGHT_FROM_BOTTOM, false },
57
{ 5, SCI_TRANSITIONS_STRAIGHT_FROM_TOP, false },
58
{ 6, SCI_TRANSITIONS_DIAGONALROLL_FROMCENTER, false },
59
{ 7, SCI_TRANSITIONS_DIAGONALROLL_TOCENTER, false },
60
{ 8, SCI_TRANSITIONS_BLOCKS, false },
61
{ 9, SCI_TRANSITIONS_VERTICALROLL_TOCENTER, false },
62
{ 10, SCI_TRANSITIONS_HORIZONTALROLL_TOCENTER, false },
63
{ 11, SCI_TRANSITIONS_STRAIGHT_FROM_RIGHT, true },
64
{ 12, SCI_TRANSITIONS_STRAIGHT_FROM_LEFT, true },
65
{ 13, SCI_TRANSITIONS_STRAIGHT_FROM_BOTTOM, true },
66
{ 14, SCI_TRANSITIONS_STRAIGHT_FROM_TOP, true },
67
{ 15, SCI_TRANSITIONS_DIAGONALROLL_FROMCENTER, true },
68
{ 16, SCI_TRANSITIONS_DIAGONALROLL_TOCENTER, true },
69
{ 17, SCI_TRANSITIONS_BLOCKS, true },
70
{ 18, SCI_TRANSITIONS_PIXELATION, false },
71
{ 27, SCI_TRANSITIONS_PIXELATION , true },
72
{ 30, SCI_TRANSITIONS_FADEPALETTE, false },
73
{ 40, SCI_TRANSITIONS_SCROLL_RIGHT, false },
74
{ 41, SCI_TRANSITIONS_SCROLL_LEFT, false },
75
{ 42, SCI_TRANSITIONS_SCROLL_UP, false },
76
{ 43, SCI_TRANSITIONS_SCROLL_DOWN, false },
77
{ 100, SCI_TRANSITIONS_NONE, false },
81
// this table defines the blackout-transition that needs to be done prior doing the actual transition
82
static const GfxTransitionTranslateEntry blackoutTransitionIDs[] = {
83
{ SCI_TRANSITIONS_VERTICALROLL_FROMCENTER, SCI_TRANSITIONS_VERTICALROLL_TOCENTER, true },
84
{ SCI_TRANSITIONS_HORIZONTALROLL_FROMCENTER, SCI_TRANSITIONS_HORIZONTALROLL_TOCENTER, true },
85
{ SCI_TRANSITIONS_STRAIGHT_FROM_RIGHT, SCI_TRANSITIONS_STRAIGHT_FROM_LEFT, true },
86
{ SCI_TRANSITIONS_STRAIGHT_FROM_LEFT, SCI_TRANSITIONS_STRAIGHT_FROM_RIGHT, true },
87
{ SCI_TRANSITIONS_STRAIGHT_FROM_BOTTOM, SCI_TRANSITIONS_STRAIGHT_FROM_TOP, true },
88
{ SCI_TRANSITIONS_STRAIGHT_FROM_TOP, SCI_TRANSITIONS_STRAIGHT_FROM_BOTTOM, true },
89
{ SCI_TRANSITIONS_DIAGONALROLL_FROMCENTER, SCI_TRANSITIONS_DIAGONALROLL_TOCENTER, true },
90
{ SCI_TRANSITIONS_DIAGONALROLL_TOCENTER, SCI_TRANSITIONS_DIAGONALROLL_FROMCENTER, true },
91
{ SCI_TRANSITIONS_BLOCKS, SCI_TRANSITIONS_BLOCKS, true },
92
{ SCI_TRANSITIONS_PIXELATION, SCI_TRANSITIONS_PIXELATION, true },
93
{ SCI_TRANSITIONS_FADEPALETTE, SCI_TRANSITIONS_NONE, true },
94
{ SCI_TRANSITIONS_SCROLL_RIGHT, SCI_TRANSITIONS_NONE, true },
95
{ SCI_TRANSITIONS_SCROLL_LEFT, SCI_TRANSITIONS_NONE, true },
96
{ SCI_TRANSITIONS_SCROLL_UP, SCI_TRANSITIONS_NONE, true },
97
{ SCI_TRANSITIONS_SCROLL_DOWN, SCI_TRANSITIONS_NONE, true },
98
{ SCI_TRANSITIONS_NONE_LONGBOW, SCI_TRANSITIONS_NONE, true },
99
{ SCI_TRANSITIONS_NONE, SCI_TRANSITIONS_NONE, true },
100
{ SCI_TRANSITIONS_VERTICALROLL_TOCENTER, SCI_TRANSITIONS_NONE, true },
101
{ SCI_TRANSITIONS_HORIZONTALROLL_TOCENTER, SCI_TRANSITIONS_NONE, true },
105
void GfxTransitions::init() {
106
_oldScreen = new byte[_screen->getDisplayHeight() * _screen->getDisplayWidth()];
108
if (getSciVersion() >= SCI_VERSION_1_LATE)
109
_translationTable = NULL;
111
_translationTable = oldTransitionIDs;
113
// setup default transition
114
_number = SCI_TRANSITIONS_HORIZONTALROLL_FROMCENTER;
115
_blackoutFlag = false;
118
void GfxTransitions::setup(int16 number, bool blackoutFlag) {
121
_blackoutFlag = blackoutFlag;
125
void GfxTransitions::updateScreenAndWait(int msec) {
127
g_system->updateScreen();
128
g_system->delayMillis(msec);
129
while (g_system->getEventManager()->pollEvent(ev)) {} // discard all events
132
// will translate a number and return corresponding translationEntry
133
const GfxTransitionTranslateEntry *GfxTransitions::translateNumber (int16 number, const GfxTransitionTranslateEntry *tablePtr) {
135
if (tablePtr->orgId == 255)
137
if (tablePtr->orgId == number)
143
void GfxTransitions::doit(Common::Rect picRect) {
144
const GfxTransitionTranslateEntry *translationEntry = _translationTable;
148
if (_translationTable) {
149
// We need to translate the ID
150
translationEntry = translateNumber(_number, _translationTable);
151
if (translationEntry) {
152
_number = translationEntry->newId;
153
_blackoutFlag = translationEntry->blackoutFlag;
155
warning("Transitions: old ID %d not supported", _number);
156
_number = SCI_TRANSITIONS_NONE;
157
_blackoutFlag = false;
162
// We need to find out what transition we are supposed to use for blackout
163
translationEntry = translateNumber(_number, blackoutTransitionIDs);
164
if (translationEntry) {
165
doTransition(translationEntry->newId, true);
167
warning("Transitions: ID %d not listed in blackoutTransitionIDs", _number);
171
// Now we do the actual transition to the new screen
172
doTransition(_number, false);
174
if (picRect.bottom != _screen->getHeight()) {
175
// TODO: this is a workaround for lsl6 not showing menubar when playing
176
// There is some new code in the sierra sci in ShowPic that seems to do something similar to this
177
_screen->copyToScreen();
178
g_system->updateScreen();
181
_screen->_picNotValid = 0;
184
// This may get called twice, if blackoutFlag is set. It will get once called with blackoutFlag set and another time
185
// with no blackoutFlag.
186
void GfxTransitions::doTransition(int16 number, bool blackoutFlag) {
187
if (number != SCI_TRANSITIONS_FADEPALETTE) {
188
setNewPalette(blackoutFlag);
192
case SCI_TRANSITIONS_VERTICALROLL_FROMCENTER:
193
verticalRollFromCenter(blackoutFlag);
195
case SCI_TRANSITIONS_VERTICALROLL_TOCENTER:
196
verticalRollFromCenter(blackoutFlag);
198
case SCI_TRANSITIONS_HORIZONTALROLL_FROMCENTER:
199
horizontalRollFromCenter(blackoutFlag);
201
case SCI_TRANSITIONS_HORIZONTALROLL_TOCENTER:
202
horizontalRollToCenter(blackoutFlag);
204
case SCI_TRANSITIONS_DIAGONALROLL_TOCENTER:
205
diagonalRollToCenter(blackoutFlag);
207
case SCI_TRANSITIONS_DIAGONALROLL_FROMCENTER:
208
diagonalRollFromCenter(blackoutFlag);
211
case SCI_TRANSITIONS_STRAIGHT_FROM_RIGHT:
212
case SCI_TRANSITIONS_STRAIGHT_FROM_LEFT:
213
case SCI_TRANSITIONS_STRAIGHT_FROM_BOTTOM:
214
case SCI_TRANSITIONS_STRAIGHT_FROM_TOP:
215
straight(number, blackoutFlag);
218
case SCI_TRANSITIONS_PIXELATION:
219
pixelation(blackoutFlag);
222
case SCI_TRANSITIONS_BLOCKS:
223
blocks(blackoutFlag);
226
case SCI_TRANSITIONS_FADEPALETTE:
228
fadeOut(); setNewScreen(blackoutFlag); fadeIn();
232
case SCI_TRANSITIONS_SCROLL_RIGHT:
233
case SCI_TRANSITIONS_SCROLL_LEFT:
234
case SCI_TRANSITIONS_SCROLL_UP:
235
case SCI_TRANSITIONS_SCROLL_DOWN:
239
case SCI_TRANSITIONS_NONE_LONGBOW:
240
case SCI_TRANSITIONS_NONE:
241
setNewScreen(blackoutFlag);
245
warning("Transitions: ID %d not implemented", number);
246
setNewScreen(blackoutFlag);
250
void GfxTransitions::setNewPalette(bool blackoutFlag) {
253
_palette->setOnScreen();
256
void GfxTransitions::setNewScreen(bool blackoutFlag) {
258
_screen->copyRectToScreen(_picRect);
259
g_system->updateScreen();
263
void GfxTransitions::copyRectToScreen(const Common::Rect rect, bool blackoutFlag) {
265
_screen->copyRectToScreen(rect);
267
Graphics::Surface *surface = g_system->lockScreen();
268
surface->fillRect(rect, 0);
269
g_system->unlockScreen();
273
// Note: dont do too many steps in here, otherwise cpu will crap out because of the load
274
void GfxTransitions::fadeOut() {
275
byte oldPalette[4 * 256], workPalette[4 * 256];
276
int16 stepNr, colorNr;
278
g_system->grabPalette(oldPalette, 0, 256);
280
for (stepNr = 100; stepNr >= 0; stepNr -= 10) {
281
for (colorNr = 1; colorNr < 255; colorNr++){
282
workPalette[colorNr * 4 + 0] = oldPalette[colorNr * 4] * stepNr / 100;
283
workPalette[colorNr * 4 + 1] = oldPalette[colorNr * 4 + 1] * stepNr / 100;
284
workPalette[colorNr * 4 + 2] = oldPalette[colorNr * 4 + 2] * stepNr / 100;
286
g_system->setPalette(workPalette + 4, 1, 254);
291
// Note: dont do too many steps in here, otherwise cpu will crap out because of the load
292
void GfxTransitions::fadeIn() {
295
for (stepNr = 0; stepNr <= 100; stepNr += 10) {
296
_palette->kernelSetIntensity(1, 255, stepNr, true);
301
// pixelates the new picture over the old one - works against the whole screen
302
// TODO: it seems this needs to get applied on _picRect only if possible
303
void GfxTransitions::pixelation (bool blackoutFlag) {
304
uint16 mask = 0x40, stepNr = 0;
305
Common::Rect pixelRect;
308
mask = (mask & 1) ? (mask >> 1) ^ 0xB400 : mask >> 1;
309
if (mask >= _screen->getWidth() * _screen->getHeight())
311
pixelRect.left = mask % _screen->getWidth(); pixelRect.right = pixelRect.left + 1;
312
pixelRect.top = mask / _screen->getWidth(); pixelRect.bottom = pixelRect.top + 1;
313
pixelRect.clip(_picRect);
314
if (!pixelRect.isEmpty())
315
copyRectToScreen(pixelRect, blackoutFlag);
316
if ((stepNr & 0x3FF) == 0) {
317
updateScreenAndWait(5);
320
} while (mask != 0x40);
323
// like pixelation but uses 8x8 blocks - works against the whole screen
324
// TODO: it seems this needs to get applied on _picRect only if possible
325
void GfxTransitions::blocks(bool blackoutFlag) {
326
uint16 mask = 0x40, stepNr = 0;
327
Common::Rect blockRect;
330
mask = (mask & 1) ? (mask >> 1) ^ 0x240 : mask >> 1;
333
blockRect.left = (mask % 40) << 3; blockRect.right = blockRect.left + 8;
334
blockRect.top = (mask / 40) << 3; blockRect.bottom = blockRect.top + 8;
335
blockRect.clip(_picRect);
336
if (!blockRect.isEmpty())
337
copyRectToScreen(blockRect, blackoutFlag);
338
if ((stepNr & 7) == 0) {
339
updateScreenAndWait(4);
342
} while (mask != 0x40);
345
// directly shows new screen starting up/down/left/right and going to the opposite direction - works on _picRect area only
346
void GfxTransitions::straight(int16 number, bool blackoutFlag) {
348
Common::Rect newScreenRect = _picRect;
351
case SCI_TRANSITIONS_STRAIGHT_FROM_RIGHT:
352
newScreenRect.left = newScreenRect.right - 1;
353
while (newScreenRect.left >= _picRect.left) {
354
copyRectToScreen(newScreenRect, blackoutFlag);
355
if ((stepNr & 1) == 0) {
356
updateScreenAndWait(1);
359
newScreenRect.translate(-1, 0);
363
case SCI_TRANSITIONS_STRAIGHT_FROM_LEFT:
364
newScreenRect.right = newScreenRect.left + 1;
365
while (newScreenRect.right <= _picRect.right) {
366
copyRectToScreen(newScreenRect, blackoutFlag);
367
if ((stepNr & 1) == 0) {
368
updateScreenAndWait(1);
371
newScreenRect.translate(1, 0);
375
case SCI_TRANSITIONS_STRAIGHT_FROM_BOTTOM:
376
newScreenRect.top = newScreenRect.bottom - 1;
377
while (newScreenRect.top >= _picRect.top) {
378
copyRectToScreen(newScreenRect, blackoutFlag);
379
updateScreenAndWait(3);
381
newScreenRect.translate(0, -1);
385
case SCI_TRANSITIONS_STRAIGHT_FROM_TOP:
386
newScreenRect.bottom = newScreenRect.top + 1;
387
while (newScreenRect.bottom <= _picRect.bottom) {
388
copyRectToScreen(newScreenRect, blackoutFlag);
389
updateScreenAndWait(3);
391
newScreenRect.translate(0, 1);
397
// scroll old screen (up/down/left/right) and insert new screen that way - works on _picRect area only
398
void GfxTransitions::scroll(int16 number) {
399
int16 screenWidth, screenHeight;
402
Common::Rect oldMoveRect = _picRect;
403
Common::Rect newMoveRect = _picRect;
404
Common::Rect newScreenRect = _picRect;
406
_screen->copyFromScreen(_oldScreen);
407
screenWidth = _screen->getDisplayWidth(); screenHeight = _screen->getDisplayHeight();
409
oldScreenPtr = _oldScreen + _picRect.left + _picRect.top * screenWidth;
412
case SCI_TRANSITIONS_SCROLL_LEFT:
413
newScreenRect.right = newScreenRect.left;
414
newMoveRect.left = newMoveRect.right;
415
while (oldMoveRect.left < oldMoveRect.right) {
416
oldScreenPtr++; oldMoveRect.right--;
417
if (oldMoveRect.right > oldMoveRect.left)
418
g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
419
newScreenRect.right++; newMoveRect.left--;
420
_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
421
if ((stepNr & 1) == 0) {
422
updateScreenAndWait(1);
426
if ((stepNr & 1) == 0)
427
g_system->updateScreen();
430
case SCI_TRANSITIONS_SCROLL_RIGHT:
431
newScreenRect.left = newScreenRect.right;
432
while (oldMoveRect.left < oldMoveRect.right) {
434
if (oldMoveRect.right > oldMoveRect.left)
435
g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
436
newScreenRect.left--;
437
_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
438
if ((stepNr & 1) == 0) {
439
updateScreenAndWait(1);
443
if ((stepNr & 1) == 0)
444
g_system->updateScreen();
447
case SCI_TRANSITIONS_SCROLL_UP:
448
newScreenRect.bottom = newScreenRect.top;
449
newMoveRect.top = newMoveRect.bottom;
450
while (oldMoveRect.top < oldMoveRect.bottom) {
451
oldScreenPtr += screenWidth; oldMoveRect.top++;
452
if (oldMoveRect.top < oldMoveRect.bottom)
453
g_system->copyRectToScreen(oldScreenPtr, screenWidth, _picRect.left, _picRect.top, oldMoveRect.width(), oldMoveRect.height());
454
newScreenRect.bottom++; newMoveRect.top--;
455
_screen->copyRectToScreen(newScreenRect, newMoveRect.left, newMoveRect.top);
456
updateScreenAndWait(3);
460
case SCI_TRANSITIONS_SCROLL_DOWN:
461
newScreenRect.top = newScreenRect.bottom;
462
while (oldMoveRect.top < oldMoveRect.bottom) {
464
if (oldMoveRect.top < oldMoveRect.bottom)
465
g_system->copyRectToScreen(oldScreenPtr, screenWidth, oldMoveRect.left, oldMoveRect.top, oldMoveRect.width(), oldMoveRect.height());
467
_screen->copyRectToScreen(newScreenRect, _picRect.left, _picRect.top);
468
updateScreenAndWait(3);
474
// vertically displays new screen starting from center - works on _picRect area only
475
void GfxTransitions::verticalRollFromCenter(bool blackoutFlag) {
476
Common::Rect leftRect = Common::Rect(_picRect.left + (_picRect.width() / 2) -1, _picRect.top, _picRect.left + (_picRect.width() / 2), _picRect.bottom);
477
Common::Rect rightRect = Common::Rect(leftRect.right, _picRect.top, leftRect.right + 1, _picRect.bottom);
479
while ((leftRect.left >= _picRect.left) || (rightRect.right <= _picRect.right)) {
480
if (leftRect.left < _picRect.left)
481
leftRect.translate(1, 0);
482
if (rightRect.right > _picRect.right)
483
rightRect.translate(-1, 0);
484
copyRectToScreen(leftRect, blackoutFlag); leftRect.translate(-1, 0);
485
copyRectToScreen(rightRect, blackoutFlag); rightRect.translate(1, 0);
486
updateScreenAndWait(2);
490
// vertically displays new screen starting from edges - works on _picRect area only
491
void GfxTransitions::verticalRollToCenter(bool blackoutFlag) {
492
Common::Rect leftRect = Common::Rect(_picRect.left, _picRect.top, _picRect.left + 1, _picRect.bottom);
493
Common::Rect rightRect = Common::Rect(leftRect.right - 1, _picRect.top, leftRect.right, _picRect.bottom);
495
while (leftRect.left < rightRect.right) {
496
copyRectToScreen(leftRect, blackoutFlag); leftRect.translate(1, 0);
497
copyRectToScreen(rightRect, blackoutFlag); rightRect.translate(-1, 0);
498
updateScreenAndWait(2);
502
// horizontally displays new screen starting from center - works on _picRect area only
503
void GfxTransitions::horizontalRollFromCenter(bool blackoutFlag) {
504
Common::Rect upperRect = Common::Rect(_picRect.left, _picRect.top + (_picRect.height() / 2) - 1, _picRect.right, _picRect.top + (_picRect.height() / 2));
505
Common::Rect lowerRect = Common::Rect(upperRect.left, upperRect.bottom, upperRect.right, upperRect.bottom + 1);
507
while ((upperRect.top >= _picRect.top) || (lowerRect.bottom <= _picRect.bottom)) {
508
if (upperRect.top < _picRect.top)
509
upperRect.translate(0, 1);
510
if (lowerRect.bottom > _picRect.bottom)
511
lowerRect.translate(0, -1);
512
copyRectToScreen(upperRect, blackoutFlag); upperRect.translate(0, -1);
513
copyRectToScreen(lowerRect, blackoutFlag); lowerRect.translate(0, 1);
514
updateScreenAndWait(3);
518
// horizontally displays new screen starting from upper and lower edge - works on _picRect area only
519
void GfxTransitions::horizontalRollToCenter(bool blackoutFlag) {
520
Common::Rect upperRect = Common::Rect(_picRect.left, _picRect.top, _picRect.right, _picRect.top + 1);
521
Common::Rect lowerRect = Common::Rect(upperRect.left, _picRect.bottom - 1, upperRect.right, _picRect.bottom);
523
while (upperRect.top < lowerRect.bottom) {
524
copyRectToScreen(upperRect, blackoutFlag); upperRect.translate(0, 1);
525
copyRectToScreen(lowerRect, blackoutFlag); lowerRect.translate(0, -1);
526
updateScreenAndWait(3);
530
// diagonally displays new screen starting from center - works on _picRect area only
531
// assumes that height of rect is larger than width
532
void GfxTransitions::diagonalRollFromCenter(bool blackoutFlag) {
533
int16 halfHeight = _picRect.height() / 2;
534
Common::Rect upperRect(_picRect.left + halfHeight - 2, _picRect.top + halfHeight, _picRect.right - halfHeight + 1, _picRect.top + halfHeight + 1);
535
Common::Rect lowerRect(upperRect.left, upperRect.top, upperRect.right, upperRect.bottom);
536
Common::Rect leftRect(upperRect.left, upperRect.top, upperRect.left + 1, lowerRect.bottom);
537
Common::Rect rightRect(upperRect.right, upperRect.top, upperRect.right + 1, lowerRect.bottom);
539
while ((upperRect.top >= _picRect.top) || (lowerRect.bottom <= _picRect.bottom)) {
540
if (upperRect.top < _picRect.top) {
541
upperRect.translate(0, 1); leftRect.top++; rightRect.top++;
543
if (lowerRect.bottom > _picRect.bottom) {
544
lowerRect.translate(0, -1); leftRect.bottom--; rightRect.bottom--;
546
if (leftRect.left < _picRect.left) {
547
leftRect.translate(1, 0); upperRect.left++; lowerRect.left++;
549
if (rightRect.right > _picRect.right) {
550
rightRect.translate(-1, 0); upperRect.right--; lowerRect.right--;
552
copyRectToScreen(upperRect, blackoutFlag); upperRect.translate(0, -1); upperRect.left--; upperRect.right++;
553
copyRectToScreen(lowerRect, blackoutFlag); lowerRect.translate(0, 1); lowerRect.left--; lowerRect.right++;
554
copyRectToScreen(leftRect, blackoutFlag); leftRect.translate(-1, 0); leftRect.top--; leftRect.bottom++;
555
copyRectToScreen(rightRect, blackoutFlag); rightRect.translate(1, 0); rightRect.top--; rightRect.bottom++;
556
updateScreenAndWait(3);
560
// diagonally displays new screen starting from edges - works on _picRect area only
561
// assumes that height of rect is larger than width
562
void GfxTransitions::diagonalRollToCenter(bool blackoutFlag) {
563
Common::Rect upperRect(_picRect.left, _picRect.top, _picRect.right, _picRect.top + 1);
564
Common::Rect lowerRect(_picRect.left, _picRect.bottom - 1, _picRect.right, _picRect.bottom);
565
Common::Rect leftRect(_picRect.left, _picRect.top, _picRect.left + 1, _picRect.bottom);
566
Common::Rect rightRect(_picRect.right - 1, _picRect.top, _picRect.right, _picRect.bottom);
568
while (upperRect.top < lowerRect.bottom) {
569
copyRectToScreen(upperRect, blackoutFlag); upperRect.translate(0, 1); upperRect.left++; upperRect.right--;
570
copyRectToScreen(lowerRect, blackoutFlag); lowerRect.translate(0, -1); lowerRect.left++; lowerRect.right--;
571
copyRectToScreen(leftRect, blackoutFlag); leftRect.translate(1, 0);
572
copyRectToScreen(rightRect, blackoutFlag); rightRect.translate(-1, 0);
573
updateScreenAndWait(3);
577
} // End of namespace Sci