diff options
author | uruk | 2014-07-04 18:39:03 +0200 |
---|---|---|
committer | uruk | 2014-07-04 18:39:03 +0200 |
commit | 8b8216bf2cfbaa016aa20a15eb7ac9069d8f9f21 (patch) | |
tree | 2113c8730bbf3b2af67c84c1fada65433fa3409d /engines/cge2/cge2_main.cpp | |
parent | 07fa4831426142a6ec0bede7af979a0628e53ea4 (diff) | |
download | scummvm-rg350-8b8216bf2cfbaa016aa20a15eb7ac9069d8f9f21.tar.gz scummvm-rg350-8b8216bf2cfbaa016aa20a15eb7ac9069d8f9f21.tar.bz2 scummvm-rg350-8b8216bf2cfbaa016aa20a15eb7ac9069d8f9f21.zip |
CGE2: Fully implement the save/load system.
Now the toolbar is working too after loading.
Diffstat (limited to 'engines/cge2/cge2_main.cpp')
-rw-r--r-- | engines/cge2/cge2_main.cpp | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 804294d478..935a3c94e3 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -672,40 +672,11 @@ void CGE2Engine::runGame() { if (_quitFlag) return; - selectPocket(-1); - loadUser(); - _commandHandlerTurbo->addCommand(kCmdSeq, kMusicRef, _music, nullptr); - if (!_music) - _midiPlayer->killMidi(); - - checkSaySwitch(); - - _infoLine->gotoxyz(V3D(kInfoX, kInfoY, 0)); - _infoLine->setText(nullptr); - _vga->_showQ->insert(_infoLine); + initToolbar(); sceneUp(_now); - _startupMode = 0; - _mouse->center(); - _mouse->off(); - _mouse->on(); - - _keyboard->setClient(_sys); - _commandHandler->addCommand(kCmdSeq, kPowerRef, 1, nullptr); - - _busyPtr = _vga->_showQ->locate(kBusyRef); - - _vol[0] = _vga->_showQ->locate(kDvolRef); - _vol[1] = _vga->_showQ->locate(kMvolRef); - - // these sprites are loaded with SeqPtr==0 (why?!) - if (_vol[0]) - _vol[0]->step((/*(int)SNDDrvInfo.VOL4.DL * */ _vol[0]->_seqCnt + _vol[0]->_seqCnt / 2) >> 4); - if (_vol[1]) - _vol[1]->step((/*(int)SNDDrvInfo.VOL4.ML * */ _vol[1]->_seqCnt + _vol[1]->_seqCnt / 2) >> 4); - // TODO: Recheck these! ^ // main loop while (!_endGame && !_quitFlag) { @@ -795,6 +766,40 @@ void CGE2Engine::loadPos() { error("Missing file: CGE.HXY"); } +void CGE2Engine::initToolbar() { + selectPocket(-1); + + _commandHandlerTurbo->addCommand(kCmdSeq, kMusicRef, _music, nullptr); + if (!_music) + _midiPlayer->killMidi(); + + checkSaySwitch(); + + _infoLine->gotoxyz(V3D(kInfoX, kInfoY, 0)); + _infoLine->setText(nullptr); + _vga->_showQ->insert(_infoLine); + + _startupMode = 0; + _mouse->center(); + _mouse->off(); + _mouse->on(); + + _keyboard->setClient(_sys); + _commandHandler->addCommand(kCmdSeq, kPowerRef, 1, nullptr); + + _busyPtr = _vga->_showQ->locate(kBusyRef); + + _vol[0] = _vga->_showQ->locate(kDvolRef); + _vol[1] = _vga->_showQ->locate(kMvolRef); + + // these sprites are loaded with SeqPtr==0 (why?!) + if (_vol[0]) + _vol[0]->step((/*(int)SNDDrvInfo.VOL4.DL * */ _vol[0]->_seqCnt + _vol[0]->_seqCnt / 2) >> 4); + if (_vol[1]) + _vol[1]->step((/*(int)SNDDrvInfo.VOL4.ML * */ _vol[1]->_seqCnt + _vol[1]->_seqCnt / 2) >> 4); + // TODO: Recheck these! ^ +} + void CGE2Engine::releasePocket(Sprite *spr) { for (int i = 0; i < 2; i++) { for (int j = 0; j < kPocketMax; j++) { |