diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/simon/items.cpp | 19 | ||||
-rw-r--r-- | engines/simon/simon.cpp | 59 | ||||
-rw-r--r-- | engines/simon/simon.h | 1 | ||||
-rw-r--r-- | engines/simon/vga.cpp | 38 |
4 files changed, 56 insertions, 61 deletions
diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp index 8aa4b74e4a..e2ad70f774 100644 --- a/engines/simon/items.cpp +++ b/engines/simon/items.cpp @@ -1618,7 +1618,24 @@ void SimonEngine::o1_loadStrings() { void SimonEngine::o1_specialFade() { // 187: fade to black - fadeToBlack(); + uint i; + + memcpy(_videoBuf1, _paletteBackup, 1024); + + i = NUM_PALETTE_FADEOUT; + do { + palette_fadeout((uint32 *)_videoBuf1, 32); + palette_fadeout((uint32 *)_videoBuf1 + 32 + 16, 144); + palette_fadeout((uint32 *)_videoBuf1 + 32 + 16 + 144 + 16, 48); + + _system->setPalette(_videoBuf1, 0, 256); + if (_fade) + _system->updateScreen(); + delay(5); + } while (--i); + + memcpy(_paletteBackup, _videoBuf1, 1024); + memcpy(_palette, _videoBuf1, 1024); } // ----------------------------------------------------------------------- diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp index 7514f1cb3c..af5292382d 100644 --- a/engines/simon/simon.cpp +++ b/engines/simon/simon.cpp @@ -2337,27 +2337,6 @@ void SimonEngine::set_video_mode_internal(uint16 mode, uint16 vga_res_id) { } } -void SimonEngine::fadeToBlack() { - uint i; - - memcpy(_videoBuf1, _paletteBackup, 1024); - - i = NUM_PALETTE_FADEOUT; - do { - palette_fadeout((uint32 *)_videoBuf1, 32); - palette_fadeout((uint32 *)_videoBuf1 + 32 + 16, 144); - palette_fadeout((uint32 *)_videoBuf1 + 32 + 16 + 144 + 16, 48); - - _system->setPalette(_videoBuf1, 0, 256); - if (_fade) - _system->updateScreen(); - delay(5); - } while (--i); - - memcpy(_paletteBackup, _videoBuf1, 1024); - memcpy(_palette, _videoBuf1, 1024); -} - void SimonEngine::addVgaEvent(uint16 num, const byte *code_ptr, uint16 cur_sprite, uint16 curZoneNum, int32 param) { VgaTimerEntry *vte; @@ -2863,44 +2842,6 @@ void SimonEngine::timer_callback() { } } -bool SimonEngine::itemIsSiblingOf(uint16 a) { - Item *item; - - CHECK_BOUNDS(a, _objectArray); - - item = _objectArray[a]; - if (item == NULL) - return true; - - return me()->parent == item->parent; -} - -bool SimonEngine::itemIsParentOf(uint16 a, uint16 b) { - Item *item_a, *item_b; - - CHECK_BOUNDS(a, _objectArray); - CHECK_BOUNDS(b, _objectArray); - - item_a = _objectArray[a]; - item_b = _objectArray[b]; - - if (item_a == NULL || item_b == NULL) - return true; - - return derefItem(item_a->parent) == item_b; -} - -bool SimonEngine::vc_maybe_skip_proc_1(uint16 a, int16 b) { - Item *item; - - CHECK_BOUNDS(a, _objectArray); - - item = _objectArray[a]; - if (item == NULL) - return true; - return item->state == b; -} - void SimonEngine::closeWindow(uint a) { if (_windowArray[a] == NULL) return; diff --git a/engines/simon/simon.h b/engines/simon/simon.h index 501e6801e4..0bb6df5144 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -602,7 +602,6 @@ protected: void scriptMouseOn(); void scriptMouseOff(); void unfreezeBottom(); - void fadeToBlack(); TextLocation *getTextLocation(uint a); void setup_cond_c_helper(); diff --git a/engines/simon/vga.cpp b/engines/simon/vga.cpp index effa74bb06..03faf53f1b 100644 --- a/engines/simon/vga.cpp +++ b/engines/simon/vga.cpp @@ -152,6 +152,44 @@ void SimonEngine::runVgaScript() { } } +bool SimonEngine::itemIsSiblingOf(uint16 a) { + Item *item; + + CHECK_BOUNDS(a, _objectArray); + + item = _objectArray[a]; + if (item == NULL) + return true; + + return me()->parent == item->parent; +} + +bool SimonEngine::itemIsParentOf(uint16 a, uint16 b) { + Item *item_a, *item_b; + + CHECK_BOUNDS(a, _objectArray); + CHECK_BOUNDS(b, _objectArray); + + item_a = _objectArray[a]; + item_b = _objectArray[b]; + + if (item_a == NULL || item_b == NULL) + return true; + + return derefItem(item_a->parent) == item_b; +} + +bool SimonEngine::vc_maybe_skip_proc_1(uint16 a, int16 b) { + Item *item; + + CHECK_BOUNDS(a, _objectArray); + + item = _objectArray[a]; + if (item == NULL) + return true; + return item->state == b; +} + int SimonEngine::vcReadVarOrWord() { int16 var = vcReadNextWord(); if (var < 0) |