diff options
author | Robert Göffringmann | 2003-06-01 22:53:44 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-06-01 22:53:44 +0000 |
commit | f8ead8a776cbb7326092820e21442d87feedb648 (patch) | |
tree | cd8b3349b58497145d59d6630ebb2d1423976d66 | |
parent | 17e6779b65dc864e6e239ff3c1d2cec90674ba3d (diff) | |
download | scummvm-rg350-f8ead8a776cbb7326092820e21442d87feedb648.tar.gz scummvm-rg350-f8ead8a776cbb7326092820e21442d87feedb648.tar.bz2 scummvm-rg350-f8ead8a776cbb7326092820e21442d87feedb648.zip |
remove useless screen updates, make non-seq intro parts escapable.
svn-id: r8255
-rw-r--r-- | sky/cd_intro.cpp | 2 | ||||
-rw-r--r-- | sky/intro.cpp | 18 | ||||
-rw-r--r-- | sky/screen.cpp | 24 | ||||
-rw-r--r-- | sky/sky.cpp | 2 | ||||
-rw-r--r-- | sky/sky.h | 1 |
5 files changed, 37 insertions, 10 deletions
diff --git a/sky/cd_intro.cpp b/sky/cd_intro.cpp index 01b7ba2424..c38e8a036b 100644 --- a/sky/cd_intro.cpp +++ b/sky/cd_intro.cpp @@ -217,7 +217,7 @@ void SkyState::doCDIntro() { bgVocBuffer = _skyDisk->loadFile(59499, NULL); bgVocSize = _skyDisk->_lastLoadedFileSize; - delay(2000); //keep gibbons screen up for 2 seconds + escDelay(2000); //keep gibbons screen up for 2 seconds _skyScreen->fnFadeDown(0); //and fade out START_VOICE; diff --git a/sky/intro.cpp b/sky/intro.cpp index 270e620127..77ff99db2e 100644 --- a/sky/intro.cpp +++ b/sky/intro.cpp @@ -191,6 +191,16 @@ void SkyState::initVirgin() { _skyScreen->showScreen(60110); } +void SkyState::escDelay(uint32 pDelay) { + + pDelay /= 50; + while (pDelay) { + delay(50); + if (_key_pressed == 27) pDelay = 0; + else pDelay--; + } +} + void SkyState::intro(void) { uint32 *commandPtr = (uint32 *)zeroCommands; @@ -201,13 +211,13 @@ void SkyState::intro(void) { _skyMusic->loadSection(0); _skySound->loadSection(0); - delay(3000); //keep virgin screen up for 3 seconds + escDelay(3000); //keep virgin screen up for 3 seconds CHECK_ESC if (!isCDVersion()) _skyMusic->startMusic(1); - delay(3000); //and another 3 seconds. + escDelay(3000); //and another 3 seconds. CHECK_ESC _skyScreen->fnFadeDown(0); //remove virgin screen @@ -224,7 +234,7 @@ void SkyState::intro(void) { _skyText->getText(77); - delay(8000); // keep revolution up for 8 seconds + escDelay(8000); // keep revolution up for 8 seconds CHECK_ESC _skyScreen->fnFadeDown(0); @@ -240,7 +250,7 @@ void SkyState::intro(void) { _skyDisk->prefetchFile(FN_1A); //keep gibbo up for 2 seconds - delay(2000); + escDelay(2000); CHECK_ESC _skyScreen->fnFadeDown(0); diff --git a/sky/screen.cpp b/sky/screen.cpp index 0fbf89da82..6e60a0f88a 100644 --- a/sky/screen.cpp +++ b/sky/screen.cpp @@ -190,6 +190,7 @@ void SkyScreen::flip(void) { copySrc += GAME_SCREEN_WIDTH; copyDest += GAME_SCREEN_WIDTH; } + _system->copy_rect(screenPos, GAME_SCREEN_WIDTH, cntx * GRID_W, cnty * GRID_H, GRID_W, GRID_H); } backPos += GRID_W; screenPos += GRID_W; @@ -209,7 +210,7 @@ void SkyScreen::fnDrawScreen(uint32 palette, uint32 scroll) { recreate(); spriteEngine(); flip(); - showScreen(_currentScreen); + _system->update_screen(); fnFadeUp(palette, scroll); } @@ -227,7 +228,7 @@ void SkyScreen::fnFadeDown(uint32 scroll) { palette_fadedown_helper((uint32 *)_palette, GAME_COLOURS); _system->set_palette(_palette, 0, GAME_COLOURS); _system->update_screen(); - waitForTimer(); + _system->delay_msecs(20); } } } @@ -275,7 +276,7 @@ void SkyScreen::paletteFadeUp(uint8 *pal) { } _system->set_palette(_palette, 0, GAME_COLOURS); _system->update_screen(); - waitForTimer(); + _system->delay_msecs(20); } } @@ -371,6 +372,7 @@ void SkyScreen::stopSequence() { void SkyScreen::processSequence(void) { uint32 screenPos = 0; + uint32 rectX, rectY, oldScreenPos; _seqInfo.delay--; if (_seqInfo.delay == 0) { @@ -386,14 +388,28 @@ void SkyScreen::processSequence(void) { do { nrToDo = _seqInfo.seqDataPos[0]; _seqInfo.seqDataPos++; + + rectX = screenPos % GAME_SCREEN_WIDTH; + rectY = screenPos / GAME_SCREEN_WIDTH; + oldScreenPos = screenPos; + for (cnt = 0; cnt < nrToDo; cnt++) { _currentScreen[screenPos] = _seqInfo.seqDataPos[0]; _seqInfo.seqDataPos++; screenPos++; } + if (nrToDo > 0) { + if (rectX + nrToDo <= GAME_SCREEN_WIDTH) + _system->copy_rect(_currentScreen + oldScreenPos, GAME_SCREEN_WIDTH, rectX, rectY, nrToDo, 1); + else { + _system->copy_rect(_currentScreen + oldScreenPos, GAME_SCREEN_WIDTH, rectX, rectY, 320 - rectX, 1); + oldScreenPos += 320 - rectX; + _system->copy_rect(_currentScreen + oldScreenPos, GAME_SCREEN_WIDTH, 0, rectY + 1, nrToDo - (320 - rectX), 1); + } + } } while (nrToDo == 0xFF); } while (screenPos < (GAME_SCREEN_WIDTH * GAME_SCREEN_HEIGHT)); - showScreen(_currentScreen); + _system->update_screen(); _seqInfo.framesLeft--; } if (_seqInfo.framesLeft == 0) { diff --git a/sky/sky.cpp b/sky/sky.cpp index 88f18bba98..4c5f5bf17e 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -152,7 +152,7 @@ void SkyState::go() { _skyScreen->recreate(); _skyScreen->spriteEngine(); _skyScreen->flip(); - _skyScreen->showScreen(_skyScreen->giveCurrent()); + _system->update_screen(); } } @@ -127,6 +127,7 @@ protected: static uint8 fosterPal[256 * 3]; void checkCommands(uint32 *&cmdPtr); void introFrame(uint8 **diffPtr, uint8 **vgaPtr, uint8 *screenData); + void escDelay(uint32 pDelay); SkyText *getSkyText(); void initialise(); |