diff options
author | Paul Gilbert | 2012-10-28 11:01:30 +1100 |
---|---|---|
committer | Paul Gilbert | 2012-10-28 11:01:30 +1100 |
commit | 0930151e21b8fadb98569c17dee4615007618772 (patch) | |
tree | 20c19f4836c564de7857c4a8eb13d865dc4c62df /engines | |
parent | 7a5a60028c041deed49bb2005c4cec39672d9091 (diff) | |
download | scummvm-rg350-0930151e21b8fadb98569c17dee4615007618772.tar.gz scummvm-rg350-0930151e21b8fadb98569c17dee4615007618772.tar.bz2 scummvm-rg350-0930151e21b8fadb98569c17dee4615007618772.zip |
HOPKINS: Implemented save restore functionality
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hopkins/dialogs.cpp | 51 | ||||
-rw-r--r-- | engines/hopkins/saveload.cpp | 10 |
2 files changed, 16 insertions, 45 deletions
diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp index 5e6452214e..7e4dc16d11 100644 --- a/engines/hopkins/dialogs.cpp +++ b/engines/hopkins/dialogs.cpp @@ -537,29 +537,16 @@ void DialogsManager::TEST_INVENT() { // Load Game void DialogsManager::CHARGE_PARTIE() { - int v1; - char slotNumber; - Common::String s; - Common::String v8; - char v9; - char v10; - char v11; - Common::String v12; - char v13; - char v14; - char v15; - char v16; - char v17; - Common::File f; + int slotNumber; _vm->_eventsManager.VBL(); LOAD_SAUVE(2); do { do { - v1 = CHERCHE_PARTIE(); + slotNumber = CHERCHE_PARTIE(); _vm->_eventsManager.VBL(); } while (_vm->_eventsManager.BMOUSE() != 1); - } while (!v1); + } while (!slotNumber); _vm->_objectsManager.SL_FLAG = 0; _vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x + 183, 60, 274, 353, _vm->_graphicsManager.VESA_BUFFER, _vm->_eventsManager.start_x + 183, 60); _vm->_graphicsManager.Ajoute_Segment_Vesa(_vm->_eventsManager.start_x + 183, 60, 457, 413); @@ -568,35 +555,9 @@ void DialogsManager::CHARGE_PARTIE() { _vm->_objectsManager.SL_SPR2 = _vm->_globals.dos_free2(_vm->_objectsManager.SL_SPR2); _vm->_objectsManager.SL_X = 0; _vm->_objectsManager.SL_Y = 0; - if (v1 != 7) { - s = Common::String::format("%d", v1); - v8 = 80; - v9 = 65; - v10 = 82; - v11 = 84; - v12 = s; - v13 = 46; - v14 = 68; - v15 = 65; - v16 = 84; - v17 = 0; - _vm->_fileManager.CONSTRUIT_LINUX(v8); - if (f.open(_vm->_globals.NFICHIER)) { - f.close(); - - slotNumber = _vm->_globals.SAUVEGARDE->data[svField10]; - _vm->_fileManager.CONSTRUIT_LINUX(v8); - _vm->_fileManager.bload(_vm->_globals.NFICHIER, &_vm->_globals.SAUVEGARDE->data[0]); - - // Load the inventory - for (int i = 0; i < 35; ++i) - _vm->_globals.INVENTAIRE[i] = _vm->_globals.SAUVEGARDE->inventory[i]; - - _vm->_globals.SAUVEGARDE->data[svField10] = slotNumber; - _vm->_globals.SORTIE = _vm->_globals.SAUVEGARDE->data[svField5]; - _vm->_globals.SAUVEGARDE->data[svField6] = 0; - _vm->_globals.ECRAN = 0; - } + + if (slotNumber != 7) { + _vm->_saveLoadManager.restore(slotNumber); } _vm->_objectsManager.CHANGE_OBJET(14); diff --git a/engines/hopkins/saveload.cpp b/engines/hopkins/saveload.cpp index 04cb2b3169..023257ede0 100644 --- a/engines/hopkins/saveload.cpp +++ b/engines/hopkins/saveload.cpp @@ -186,6 +186,16 @@ Common::Error SaveLoadManager::restore(int slot) { // Loading save file complete delete saveFile; + // Unpack the inventory + for (int i = 0; i < 35; ++i) + _vm->_globals.INVENTAIRE[i] = _vm->_globals.SAUVEGARDE->inventory[i]; + + // Set variables from loaded data as necessary + _vm->_globals.SAUVEGARDE->data[svField10] = slot; + _vm->_globals.SORTIE = _vm->_globals.SAUVEGARDE->data[svField5]; + _vm->_globals.SAUVEGARDE->data[svField6] = 0; + _vm->_globals.ECRAN = 0; + return Common::kNoError; } |