diff options
author | Filippos Karapetis | 2015-02-19 19:03:45 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-15 00:05:02 +0100 |
commit | 5bc37fd878e89dbcf3312dedcb0b4cfcd89cda7f (patch) | |
tree | da2a342b5a0909f3766221ab050aa2a6764486ca /engines | |
parent | 95461c91616eda80b33cfec3597f8c3243748a89 (diff) | |
download | scummvm-rg350-5bc37fd878e89dbcf3312dedcb0b4cfcd89cda7f.tar.gz scummvm-rg350-5bc37fd878e89dbcf3312dedcb0b4cfcd89cda7f.tar.bz2 scummvm-rg350-5bc37fd878e89dbcf3312dedcb0b4cfcd89cda7f.zip |
LAB: Fix loading of saved games
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lab/savegame.cpp | 6 | ||||
-rw-r--r-- | engines/lab/special.cpp | 24 |
2 files changed, 9 insertions, 21 deletions
diff --git a/engines/lab/savegame.cpp b/engines/lab/savegame.cpp index 5cf0674852..4d40540ce4 100644 --- a/engines/lab/savegame.cpp +++ b/engines/lab/savegame.cpp @@ -219,7 +219,7 @@ bool loadGame(uint16 *RoomNum, uint16 *Direction, uint16 *Quarters, int slot) { CurTile[i][j] = file->readUint16LE(); // Breadcrumbs - for (i = 0; i < sizeof(BreadCrumbs); i++) { + for (i = 0; i < 128; i++) { BreadCrumbs[i].RoomNum = file->readUint16LE(); BreadCrumbs[i].Direction = file->readUint16LE(); } @@ -227,10 +227,10 @@ bool loadGame(uint16 *RoomNum, uint16 *Direction, uint16 *Quarters, int slot) { DroppingCrumbs = (BreadCrumbs[0].RoomNum != 0); FollowingCrumbs = false; - for (i = 0; i < sizeof(BreadCrumbs); i++) { + for (i = 0; i < 128; i++) { if (BreadCrumbs[i].RoomNum == 0) break; - NumCrumbs++; + NumCrumbs = i; } delete file; diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp index 3909d974b0..ae9eb02a37 100644 --- a/engines/lab/special.cpp +++ b/engines/lab/special.cpp @@ -972,28 +972,16 @@ bool saveRestoreGame(void) { // Restore GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false); int slot = dialog->runModalWithCurrentTarget(); - if (slot >= 0) + if (slot >= 0) { isOK = loadGame(&RoomNum, &Direction, &(Inventory[QUARTERNUM].Many), slot); + if (isOK) + g_music->resetMusic(); + } } - if (!isOK) - return false; - - g_music->resetMusic(); - - eatMessages(); - - mouseHide(); - memset(diffcmap, 0, 3 * 256); - VGASetPal(diffcmap, 256); - setAPen(0); - rectFill(0, 0, VGAScreenWidth - 1, VGAScreenHeight - 1); - blackScreen(); WSDL_UpdateScreen(); - - freeAllStolenMem(); - - return true; + + return isOK; } /*---------------------------------------------------------------------------*/ |