diff options
author | Strangerke | 2013-03-29 00:59:16 +0100 |
---|---|---|
committer | Strangerke | 2013-03-29 07:34:34 +0100 |
commit | 1100216f86ff6fd8d63c3080d9d8926d9697115e (patch) | |
tree | cdd3e36625f42efb6eeba44b6d1f44ce40f7187e /engines | |
parent | 668d991efb9b6cc84c9888ac4781f94d6c9381ee (diff) | |
download | scummvm-rg350-1100216f86ff6fd8d63c3080d9d8926d9697115e.tar.gz scummvm-rg350-1100216f86ff6fd8d63c3080d9d8926d9697115e.tar.bz2 scummvm-rg350-1100216f86ff6fd8d63c3080d9d8926d9697115e.zip |
HOPKINS: Implement Load from GUI
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hopkins/hopkins.cpp | 106 | ||||
-rw-r--r-- | engines/hopkins/hopkins.h | 2 |
2 files changed, 66 insertions, 42 deletions
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 72c59a76ab..0f52608afb 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -56,6 +56,8 @@ HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDe _scriptManager = new ScriptManager(this); _soundManager = new SoundManager(this); _talkManager = new TalkManager(this); + + _startGameSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1; } HopkinsEngine::~HopkinsEngine() { @@ -143,11 +145,13 @@ bool HopkinsEngine::runWin95Demo() { _graphicsManager->unlockScreen(); _graphicsManager->clearPalette(); - _graphicsManager->loadImage("H2"); - _graphicsManager->fadeInLong(); + if (_startGameSlot == -1) { + _graphicsManager->loadImage("H2"); + _graphicsManager->fadeInLong(); - if (!_eventsManager->_escKeyFl) - playIntro(); + if (!_eventsManager->_escKeyFl) + playIntro(); + } _eventsManager->_rateCounter = 0; _globals->iRegul = 1; @@ -163,14 +167,21 @@ bool HopkinsEngine::runWin95Demo() { _globals->_speed = 2; if (_eventsManager->_rateCounter > 700) _globals->_speed = 3; - _graphicsManager->fadeOutLong(); - _globals->iRegul = 1; - _globals->_characterSpriteBuf = _fileManager->loadFile("PERSO.SPR"); + + if (_startGameSlot == -1) { + _graphicsManager->fadeOutLong(); + _globals->iRegul = 1; + _globals->_characterSpriteBuf = _fileManager->loadFile("PERSO.SPR"); + } + _globals->_characterType = 0; _objectsManager->_mapCarPosX = _objectsManager->_mapCarPosY = 0; memset(_globals->_saveData, 0, 2000); _globals->_exitId = 0; + if (_startGameSlot != -1) + _saveLoadManager->loadGame(_startGameSlot); + if (getLanguage() != Common::PL_POL) if (!displayAdultDisclaimer()) return Common::kNoError; @@ -441,18 +452,20 @@ bool HopkinsEngine::runLinuxDemo() { _graphicsManager->clearScreen(); _graphicsManager->unlockScreen(); - _graphicsManager->loadImage("LINUX"); - _graphicsManager->fadeInLong(); - _eventsManager->delay(1500); - _graphicsManager->fadeOutLong(); + if (_startGameSlot == -1) { + _graphicsManager->loadImage("LINUX"); + _graphicsManager->fadeInLong(); + _eventsManager->delay(1500); + _graphicsManager->fadeOutLong(); - _graphicsManager->loadImage("H2"); - _graphicsManager->fadeInLong(); - _eventsManager->delay(500); - _graphicsManager->fadeOutLong(); + _graphicsManager->loadImage("H2"); + _graphicsManager->fadeInLong(); + _eventsManager->delay(500); + _graphicsManager->fadeOutLong(); - if (!_eventsManager->_escKeyFl) - playIntro(); + if (!_eventsManager->_escKeyFl) + playIntro(); + } _globals->iRegul = 0; _globals->_characterSpriteBuf = _fileManager->loadFile("PERSO.SPR"); @@ -461,6 +474,9 @@ bool HopkinsEngine::runLinuxDemo() { memset(_globals->_saveData, 0, 2000); _globals->_exitId = 0; + if (_startGameSlot != -1) + _saveLoadManager->loadGame(_startGameSlot); + for (;;) { if (_globals->_exitId == 300) _globals->_exitId = 0; @@ -751,7 +767,7 @@ bool HopkinsEngine::runLinuxDemo() { } bool HopkinsEngine::runFull() { - if (getPlatform() == Common::kPlatformLinux) + if (_startGameSlot == -1 && getPlatform() == Common::kPlatformLinux) _soundManager->playSound(16); _objectsManager->loadObjects(); @@ -769,18 +785,22 @@ bool HopkinsEngine::runFull() { // This code displays the game version. // It wasn't present in the original and could be put in the debugger // It has been added there for debug purposes - _graphicsManager->loadImage("VERSW"); - _graphicsManager->fadeInLong(); - _eventsManager->delay(500); - _graphicsManager->fadeOutLong(); + if (_startGameSlot == -1) { + _graphicsManager->loadImage("VERSW"); + _graphicsManager->fadeInLong(); + _eventsManager->delay(500); + _graphicsManager->fadeOutLong(); + } _graphicsManager->clearVesaScreen(); } else { // This piece of code, though named "display_version" in the original, // displays a "loading please wait" screen. - _graphicsManager->loadImage("VERSW"); - _graphicsManager->fadeInLong(); - _eventsManager->delay(500); - _graphicsManager->fadeOutLong(); + if (_startGameSlot == -1) { + _graphicsManager->loadImage("VERSW"); + _graphicsManager->fadeInLong(); + _eventsManager->delay(500); + _graphicsManager->fadeOutLong(); + } _graphicsManager->clearVesaScreen(); _globals->iRegul = 1; @@ -791,27 +811,28 @@ bool HopkinsEngine::runFull() { _graphicsManager->unlockScreen(); _graphicsManager->clearPalette(); - if (getPlatform() == Common::kPlatformLinux) { - _graphicsManager->loadImage("H2"); - _graphicsManager->fadeInLong(); - _eventsManager->delay(500); - _graphicsManager->fadeOutLong(); - - _globals->_speed = 2; - _globals->iRegul = 1; - _graphicsManager->_fadingFl = true; - _animationManager->playAnim("MP.ANM", 10, 16, 200); - } else { - _animationManager->playAnim("MP.ANM", 10, 16, 200); - _graphicsManager->fadeOutLong(); + if (_startGameSlot == -1) { + if (getPlatform() == Common::kPlatformLinux) { + _graphicsManager->loadImage("H2"); + _graphicsManager->fadeInLong(); + _eventsManager->delay(500); + _graphicsManager->fadeOutLong(); + _globals->_speed = 2; + _globals->iRegul = 1; + _graphicsManager->_fadingFl = true; + _animationManager->playAnim("MP.ANM", 10, 16, 200); + } else { + _animationManager->playAnim("MP.ANM", 10, 16, 200); + _graphicsManager->fadeOutLong(); + } } - if (!_eventsManager->_escKeyFl) { + if (!_eventsManager->_escKeyFl && _startGameSlot == -1) { playIntro(); if (shouldQuit()) return false; } - if (getPlatform() != Common::kPlatformLinux) { + if (getPlatform() != Common::kPlatformLinux && _startGameSlot == -1) { _graphicsManager->fadeOutShort(); _graphicsManager->loadImage("H2"); _graphicsManager->fadeInLong(); @@ -826,6 +847,9 @@ bool HopkinsEngine::runFull() { _globals->_exitId = 0; + if (_startGameSlot != -1) + _saveLoadManager->loadGame(_startGameSlot); + for (;;) { if (_globals->_exitId == 300) _globals->_exitId = 0; diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index c6e2224e3e..629633e99f 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -177,7 +177,7 @@ public: virtual bool canSaveGameStateCurrently(); virtual Common::Error loadGameState(int slot); virtual Common::Error saveGameState(int slot, const Common::String &desc); - + int _startGameSlot; /** * Run the introduction sequence */ |