aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2009-10-15 12:55:12 +0000
committerMartin Kiewitz2009-10-15 12:55:12 +0000
commitf1a981cb4931e69b99b94677f272ac1a3053ccd8 (patch)
treedfbd4f30ca4afe0de9900e3da99053a1b283ff61 /engines
parentf351295ebe115a0517eb9d43c8c050f59d5cd76f (diff)
downloadscummvm-rg350-f1a981cb4931e69b99b94677f272ac1a3053ccd8.tar.gz
scummvm-rg350-f1a981cb4931e69b99b94677f272ac1a3053ccd8.tar.bz2
scummvm-rg350-f1a981cb4931e69b99b94677f272ac1a3053ccd8.zip
SCI/newgui: SciGuiTransitions now also supports scrolling down (e.g. lsl1 intro), cleanup
svn-id: r45116
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gui/gui_transitions.cpp32
-rw-r--r--engines/sci/gui/gui_transitions.h8
2 files changed, 22 insertions, 18 deletions
diff --git a/engines/sci/gui/gui_transitions.cpp b/engines/sci/gui/gui_transitions.cpp
index 480a6dd97e..34029c001c 100644
--- a/engines/sci/gui/gui_transitions.cpp
+++ b/engines/sci/gui/gui_transitions.cpp
@@ -48,7 +48,7 @@ SciGuiTransitions::~SciGuiTransitions() {
// This table contains a mapping between oldIDs (prior SCI1LATE) and newIDs
byte oldTransitionIDs[256][2] = {
- { 8, SCI_TRANSITIONS_BLOCKS },
+ { 8, SCI_TRANSITIONS_BLOCKS },
{ 18, SCI_TRANSITIONS_PIXELATION },
{ 30, SCI_TRANSITIONS_FADEPALETTE },
{ 40, SCI_TRANSITIONS_SCROLLRIGHT },
@@ -105,13 +105,10 @@ void SciGuiTransitions::doit(Common::Rect picRect) {
break;
case SCI_TRANSITIONS_SCROLLRIGHT:
- setNewPalette(); scroll(SCI_TRANSITIONS_SCROLL_RIGHT);
- break;
case SCI_TRANSITIONS_SCROLLLEFT:
- setNewPalette(); scroll(SCI_TRANSITIONS_SCROLL_LEFT);
- break;
case SCI_TRANSITIONS_SCROLLUP:
- setNewPalette(); scroll(SCI_TRANSITIONS_SCROLL_UP);
+ case SCI_TRANSITIONS_SCROLLDOWN:
+ setNewPalette(); scroll();
break;
default:
@@ -202,7 +199,7 @@ void SciGuiTransitions::blocks() {
}
// scroll old screen (up/down/left/right) and insert new screen that way - works on _picRect area
-void SciGuiTransitions::scroll(int16 direction) {
+void SciGuiTransitions::scroll() {
int16 screenWidth, screenHeight;
byte *oldScreenPtr;
int16 stepNr = 0;
@@ -215,8 +212,8 @@ void SciGuiTransitions::scroll(int16 direction) {
oldScreenPtr = _oldScreen + _picRect.left + _picRect.top * screenWidth;
- switch (direction) {
- case SCI_TRANSITIONS_SCROLL_LEFT:
+ switch (_number) {
+ case SCI_TRANSITIONS_SCROLLLEFT:
newScreenRect.right = newScreenRect.left;
newMoveRect.left = newMoveRect.right;
while (oldMoveRect.left < oldMoveRect.right) {
@@ -235,7 +232,7 @@ void SciGuiTransitions::scroll(int16 direction) {
g_system->updateScreen();
break;
- case SCI_TRANSITIONS_SCROLL_RIGHT:
+ case SCI_TRANSITIONS_SCROLLRIGHT:
newScreenRect.left = newScreenRect.right;
while (oldMoveRect.left < oldMoveRect.right) {
oldMoveRect.left++;
@@ -253,7 +250,7 @@ void SciGuiTransitions::scroll(int16 direction) {
g_system->updateScreen();
break;
- case SCI_TRANSITIONS_SCROLL_UP:
+ case SCI_TRANSITIONS_SCROLLUP:
newScreenRect.bottom = newScreenRect.top;
newMoveRect.top = newMoveRect.bottom;
while (oldMoveRect.top < oldMoveRect.bottom) {
@@ -266,6 +263,19 @@ void SciGuiTransitions::scroll(int16 direction) {
g_system->delayMillis(3);
}
break;
+
+ case SCI_TRANSITIONS_SCROLLDOWN:
+ 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());
+ newScreenRect.top--;
+ _screen->copyRectToScreen(newScreenRect, _picRect.left, _picRect.top);
+ g_system->updateScreen();
+ g_system->delayMillis(3);
+ }
+ break;
}
}
diff --git a/engines/sci/gui/gui_transitions.h b/engines/sci/gui/gui_transitions.h
index 6c0594ff7c..35095e8153 100644
--- a/engines/sci/gui/gui_transitions.h
+++ b/engines/sci/gui/gui_transitions.h
@@ -40,12 +40,6 @@ enum {
SCI_TRANSITIONS_SCROLLDOWN = 14
};
-enum {
- SCI_TRANSITIONS_SCROLL_RIGHT = 1,
- SCI_TRANSITIONS_SCROLL_LEFT = 2,
- SCI_TRANSITIONS_SCROLL_UP = 3
-};
-
class SciGuiScreen;
class SciGuiTransitions {
public:
@@ -63,7 +57,7 @@ private:
void fadeIn();
void pixelation();
void blocks();
- void scroll(int16 direction);
+ void scroll();
SciGui *_gui;
SciGuiScreen *_screen;