diff options
author | Martin Kiewitz | 2009-10-16 09:44:00 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-16 09:44:00 +0000 |
commit | af60e6761d5c581bd3ede7eac9c0dff8fd4095de (patch) | |
tree | 61d4a88776ffe5161cf8eebdf4a9317ca72efd85 /engines/sci | |
parent | 1c6e0e1cf96b502958a63624ed4a150806f454a2 (diff) | |
download | scummvm-rg350-af60e6761d5c581bd3ede7eac9c0dff8fd4095de.tar.gz scummvm-rg350-af60e6761d5c581bd3ede7eac9c0dff8fd4095de.tar.bz2 scummvm-rg350-af60e6761d5c581bd3ede7eac9c0dff8fd4095de.zip |
SCI/newgui: SciGuiTransitions now supports vertical roll from/to center (e.g. qfg1ega)
svn-id: r45156
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/gui/gui_transitions.cpp | 38 | ||||
-rw-r--r-- | engines/sci/gui/gui_transitions.h | 6 |
2 files changed, 43 insertions, 1 deletions
diff --git a/engines/sci/gui/gui_transitions.cpp b/engines/sci/gui/gui_transitions.cpp index aabb838a61..5445572b4a 100644 --- a/engines/sci/gui/gui_transitions.cpp +++ b/engines/sci/gui/gui_transitions.cpp @@ -48,8 +48,10 @@ SciGuiTransitions::~SciGuiTransitions() { // This table contains a mapping between oldIDs (prior SCI1LATE) and newIDs static const GuiTransitionTranslateEntry oldTransitionIDs[] = { + { 0, SCI_TRANSITIONS_VERTICALROLLFROMCENTER, false }, { 1, SCI_TRANSITIONS_HORIZONTALROLLFROMCENTER, false }, { 8, SCI_TRANSITIONS_BLOCKS, false }, + { 9, SCI_TRANSITIONS_VERTICALROLLTOCENTER, false }, { 10, SCI_TRANSITIONS_HORIZONTALROLLTOCENTER, false }, { 17, SCI_TRANSITIONS_BLOCKS, true }, { 18, SCI_TRANSITIONS_PIXELATION, false }, @@ -104,6 +106,12 @@ void SciGuiTransitions::doit(Common::Rect picRect) { warning("SciGuiTransitions: blackout flag currently not supported"); switch (_number) { + case SCI_TRANSITIONS_VERTICALROLLFROMCENTER: + setNewPalette(); verticalRollFromCenter(); + break; + case SCI_TRANSITIONS_VERTICALROLLTOCENTER: + setNewPalette(); verticalRollFromCenter(); + break; case SCI_TRANSITIONS_HORIZONTALROLLFROMCENTER: setNewPalette(); horizontalRollFromCenter(); break; @@ -300,6 +308,36 @@ void SciGuiTransitions::scroll() { } } +// vertically displays new screen starting from center - works on _picRect area only +void SciGuiTransitions::verticalRollFromCenter() { + Common::Rect leftRect = Common::Rect(_picRect.left + (_picRect.width() / 2) -1, _picRect.top, _picRect.left + (_picRect.width() / 2), _picRect.bottom); + Common::Rect rightRect = Common::Rect(leftRect.right, _picRect.top, leftRect.right + 1, _picRect.bottom); + + while ((leftRect.left > _picRect.left) && (rightRect.right < _picRect.right)) { + if (leftRect.left < _picRect.left) + leftRect.translate(1, 0); + if (rightRect.right > _picRect.right) + rightRect.translate(-1, 0); + _screen->copyRectToScreen(leftRect); leftRect.translate(-1, 0); + _screen->copyRectToScreen(rightRect); rightRect.translate(1, 0); + g_system->updateScreen(); + g_system->delayMillis(2); + } +} + +// vertically displays new screen starting from edges - works on _picRect area only +void SciGuiTransitions::verticalRollToCenter() { + Common::Rect leftRect = Common::Rect(_picRect.left, _picRect.top, _picRect.left + 1, _picRect.bottom); + Common::Rect rightRect = Common::Rect(leftRect.right - 1, _picRect.top, leftRect.right, _picRect.bottom); + + while (leftRect.left < rightRect.right) { + _screen->copyRectToScreen(leftRect); leftRect.translate(1, 0); + _screen->copyRectToScreen(rightRect); rightRect.translate(-1, 0); + g_system->updateScreen(); + g_system->delayMillis(2); + } +} + // horizontally displays new screen starting from center - works on _picRect area only void SciGuiTransitions::horizontalRollFromCenter() { Common::Rect upperRect = Common::Rect(_picRect.left, _picRect.top + (_picRect.height() / 2) - 1, _picRect.right, _picRect.top + (_picRect.height() / 2)); diff --git a/engines/sci/gui/gui_transitions.h b/engines/sci/gui/gui_transitions.h index 411d94b5ea..684d635a08 100644 --- a/engines/sci/gui/gui_transitions.h +++ b/engines/sci/gui/gui_transitions.h @@ -37,6 +37,7 @@ struct GuiTransitionTranslateEntry { }; enum { + SCI_TRANSITIONS_VERTICALROLLFROMCENTER = 0, SCI_TRANSITIONS_HORIZONTALROLLFROMCENTER = 1, SCI_TRANSITIONS_BLOCKS = 8, SCI_TRANSITIONS_PIXELATION = 9, @@ -47,7 +48,8 @@ enum { SCI_TRANSITIONS_SCROLLDOWN = 14, SCI_TRANSITIONS_NONE = 100, // here are transitions that are used by the old tableset, but are not included anymore in the new tableset - SCI_TRANSITIONS_HORIZONTALROLLTOCENTER = 300 + SCI_TRANSITIONS_VERTICALROLLTOCENTER = 300, + SCI_TRANSITIONS_HORIZONTALROLLTOCENTER = 301 }; class SciGuiScreen; @@ -68,6 +70,8 @@ private: void pixelation(); void blocks(); void scroll(); + void verticalRollFromCenter(); + void verticalRollToCenter(); void horizontalRollFromCenter(); void horizontalRollToCenter(); |