diff options
| author | Robert Göffringmann | 2003-07-02 01:46:25 +0000 |
|---|---|---|
| committer | Robert Göffringmann | 2003-07-02 01:46:25 +0000 |
| commit | 1b5ea45887d4c853603fd5dedb02b8cf56eeb458 (patch) | |
| tree | d4451fb5da7b59546ecdd6e32f1f4d2dc71fbe98 | |
| parent | 14cfa71ab76024941b0bfd99171045a07a6f018a (diff) | |
| download | scummvm-rg350-1b5ea45887d4c853603fd5dedb02b8cf56eeb458.tar.gz scummvm-rg350-1b5ea45887d4c853603fd5dedb02b8cf56eeb458.tar.bz2 scummvm-rg350-1b5ea45887d4c853603fd5dedb02b8cf56eeb458.zip | |
fixed save/restore grid problems
svn-id: r8703
| -rw-r--r-- | sky/cd_intro.cpp | 5 | ||||
| -rw-r--r-- | sky/control.cpp | 12 | ||||
| -rw-r--r-- | sky/control.h | 2 | ||||
| -rw-r--r-- | sky/intro.cpp | 9 | ||||
| -rw-r--r-- | sky/logic.cpp | 9 | ||||
| -rw-r--r-- | sky/sky.cpp | 14 | ||||
| -rw-r--r-- | sky/sky.h | 5 |
7 files changed, 44 insertions, 12 deletions
diff --git a/sky/cd_intro.cpp b/sky/cd_intro.cpp index c38e8a036b..cab9422e72 100644 --- a/sky/cd_intro.cpp +++ b/sky/cd_intro.cpp @@ -195,13 +195,13 @@ #define LOAD_NEW_VOICE(num) ( free (vocBuffer), vocBuffer = _skyDisk->loadFile(num, NULL), loadedVocSize = _skyDisk->_lastLoadedFileSize ) #define LOAD_NEW_BG(num) ( free (bgVocBuffer), bgVocBuffer = _skyDisk->loadFile(num, NULL), bgVocSize = _skyDisk->_lastLoadedFileSize ) #define WAIT_VOICE while (_skySound->_voiceHandle != 0) { delay(50); CHECK_ESC } -#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); _mixer->stopAll(); return; } +#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); _mixer->stopAll(); return false; } #define WAIT_SEQUENCE while (_skyScreen->sequenceRunning()) { delay(50); CHECK_ESC } #define WAIT_RELATIVE(x) ( delay(20 * (x)) ) #define NORMAL_CD_INTRO -void SkyState::doCDIntro() { +bool SkyState::doCDIntro() { uint32 loadedVocSize, bgVocSize; byte *vocBuffer, *bgVocBuffer; @@ -794,4 +794,5 @@ void SkyState::doCDIntro() { WAIT_SEQUENCE; //104 _skyScreen->startSequence(cd_105); WAIT_SEQUENCE; //105 + return true; } diff --git a/sky/control.cpp b/sky/control.cpp index c772baa685..74ba6e403a 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -292,6 +292,18 @@ void SkyControl::drawMainPanel(void) { _bodge->drawToScreen(WITH_MASK); } +void SkyControl::restartGame(void) { + if (SkyState::isDemo() && (!SkyState::isCDVersion())) + return; // I don't think this can happen + + /*parseSaveData(_restartData); + + _skyScreen->forceRefresh(); + _skyScreen->setPalette((uint8*)SkyState::fetchCompact(SkyState::_systemVars.currentPalette)); + _skyMouse->spriteMouse(_savedMouse, 0, 0); + SkyState::_systemVars.pastIntro = true;*/ +} + void SkyControl::doLoadSavePanel(void) { if (SkyState::isDemo()) return; // I don't think this can even happen diff --git a/sky/control.h b/sky/control.h index f7b02ced37..44a9d44a04 100644 --- a/sky/control.h +++ b/sky/control.h @@ -148,6 +148,7 @@ public: SkyControl(SkyScreen *screen, SkyDisk *disk, SkyMouse *mouse, SkyText *text, SkyMusicBase *music, SkyLogic *logic, OSystem *system, const char *savePath); void doControlPanel(void); void doLoadSavePanel(void); + void restartGame(void); void showGameQuitMsg(bool useScreen = true); private: @@ -191,6 +192,7 @@ private: uint16 parseSaveData(uint8 *srcBuf); static Compact *_saveLoadCpts[833]; // moved to sky/compacts/savedata.cpp + //static uint8 _restartData[0xCC10]; const char *_savePath; AllocedMem *_memListRoot; diff --git a/sky/intro.cpp b/sky/intro.cpp index a71ab84a82..d4fb32ebcc 100644 --- a/sky/intro.cpp +++ b/sky/intro.cpp @@ -30,7 +30,7 @@ FREE_IF_NOT_0(_introTextSpace) \ FREE_IF_NOT_0(_introTextSave) \ _mixer->stopAll(); -#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); REMOVE_INTRO return; } +#define CHECK_ESC if (_key_pressed == 27) { _skyScreen->stopSequence(); REMOVE_INTRO return false; } #define WAIT_SEQUENCE while (_skyScreen->sequenceRunning()) { checkCommands(commandPtr); delay(50); CHECK_ESC } #define INTRO_TEXT_WIDTH 128 @@ -201,7 +201,7 @@ void SkyState::escDelay(uint32 pDelay) { } } -void SkyState::intro(void) { +bool SkyState::intro(void) { uint32 *commandPtr = (uint32 *)zeroCommands; @@ -243,7 +243,7 @@ void SkyState::intro(void) { if (isCDVersion()) { - doCDIntro(); + return doCDIntro(); } else { _skyDisk->prefetchFile(FN_A_PAL); _skyDisk->prefetchFile(FN_1A_LOG); @@ -303,7 +303,7 @@ void SkyState::intro(void) { delay(40); if (_key_pressed == 27) { REMOVE_INTRO; - return; + return false; } //non-scrolling frame update @@ -366,6 +366,7 @@ void SkyState::intro(void) { commandPtr = (uint32 *)anim6bCommands; WAIT_SEQUENCE; //6b } + return true; } void SkyState::introFrame(uint8 **diffPtr, uint8 **vgaPtr, uint8 *screenData) { diff --git a/sky/logic.cpp b/sky/logic.cpp index 24eb2d6a91..dc4c5446e2 100644 --- a/sky/logic.cpp +++ b/sky/logic.cpp @@ -2156,6 +2156,8 @@ bool SkyLogic::fnLeaveSection(uint32 sectionNo, uint32 b, uint32 c) { if (sectionNo == 5) //linc section - has different mouse icons _skyMouse->replaceMouseCursors(60302); + _currentSection = 0xFF; // force music-, sound- and gridreload + return true; } @@ -2191,7 +2193,10 @@ bool SkyLogic::fnRestoreGame(uint32 a, uint32 b, uint32 c) { } bool SkyLogic::fnRestartGame(uint32 a, uint32 b, uint32 c) { - error("Stub: fnRestartGame"); + + error("Stub: fnRestartGame()"); + //_skyControl->restartGame(); + return false; } bool SkyLogic::fnNewSwingSeq(uint32 a, uint32 b, uint32 c) { @@ -2210,7 +2215,7 @@ bool SkyLogic::fnWaitSwingEnd(uint32 a, uint32 b, uint32 c) { } bool SkyLogic::fnSkipIntroCode(uint32 a, uint32 b, uint32 c) { - warning("Stub: fnSkipIntroCode"); + SkyState::_systemVars.pastIntro = true; return true; } diff --git a/sky/sky.cpp b/sky/sky.cpp index a1278a5492..e9445ee76b 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -54,7 +54,7 @@ Engine *Engine_SKY_create(GameDetector *detector, OSystem *syst) { void **SkyState::_itemList[300]; -SystemVars SkyState::_systemVars = {0, 0, 0, 0, 4316, 0}; +SystemVars SkyState::_systemVars = {0, 0, 0, 0, 4316, 0, false}; SkyState::SkyState(GameDetector *detector, OSystem *syst) : Engine(detector, syst) { @@ -96,8 +96,10 @@ void SkyState::go() { initialise(); + bool introSkipped; if (!isDemo() || isCDVersion()) - intro(); + introSkipped = !intro(); + else introSkipped = false; _skyDisk->flushPrefetched(); @@ -105,6 +107,9 @@ void SkyState::go() { _paintGrid = false; + /*if (introSkipped) + _skyControl->restartGame();*/ + while (1) { delay(_systemVars.gameSpeed); if (_key_pressed == 'r') { @@ -119,10 +124,15 @@ void SkyState::go() { _skyScreen->forceRefresh(); _key_pressed = 0; } + if (_key_pressed == 63) { _key_pressed = 0; _skyControl->doControlPanel(); } + + /*if ((_key_pressed == 27) && (!_systemVars.pastIntro)) + _skyControl->restartGame();*/ + _skyMouse->mouseEngine((uint16)_sdl_mouse_x, (uint16)_sdl_mouse_y); _skyLogic->engine(); if (!_skyLogic->checkProtection()) { // don't let copy prot. screen flash up @@ -47,6 +47,7 @@ struct SystemVars { uint16 language; uint32 currentPalette; uint16 gameSpeed; + bool pastIntro; }; class SkyLogic; @@ -127,8 +128,8 @@ protected: void initItemList(); void initVirgin(); - void intro(); - void doCDIntro(); + bool intro(); + bool doCDIntro(); void startTimerSequence(byte *sequence); static void timerHandler(void *ptr); void gotTimerTick(); |
