aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Crozat2017-11-17 21:04:22 +0000
committerThierry Crozat2018-01-23 02:15:40 +0000
commit1759d1ffdda4427e9e958fef0fc7ee99d610b2e9 (patch)
tree13aa893b7a81e13081564d3d852372c8f4f74998
parentca1acaf5ea76ef3c59f60e2307681b666dfd6264 (diff)
downloadscummvm-rg350-1759d1ffdda4427e9e958fef0fc7ee99d610b2e9.tar.gz
scummvm-rg350-1759d1ffdda4427e9e958fef0fc7ee99d610b2e9.tar.bz2
scummvm-rg350-1759d1ffdda4427e9e958fef0fc7ee99d610b2e9.zip
SUPERNOVA: Implement autosave used for dream sequence
-rw-r--r--engines/supernova/msn_def.h2
-rw-r--r--engines/supernova/rooms.cpp10
-rw-r--r--engines/supernova/state.cpp9
-rw-r--r--engines/supernova/state.h2
-rw-r--r--engines/supernova/supernova.cpp8
-rw-r--r--engines/supernova/supernova.h1
6 files changed, 15 insertions, 17 deletions
diff --git a/engines/supernova/msn_def.h b/engines/supernova/msn_def.h
index 19a4417352..4a5cdbf46f 100644
--- a/engines/supernova/msn_def.h
+++ b/engines/supernova/msn_def.h
@@ -37,6 +37,8 @@ const int kMaxDialog = 2;
const int kMaxObject = 25;
const int kMaxCarry = 30;
+const int kSleepAutosaveSlot = 999;
+
//const int kRoomsChap0 = 1;
//const int kRoomsChap1 = 16;
//const int kRoomsChap2 = 9;
diff --git a/engines/supernova/rooms.cpp b/engines/supernova/rooms.cpp
index 92d216af43..d660739238 100644
--- a/engines/supernova/rooms.cpp
+++ b/engines/supernova/rooms.cpp
@@ -698,8 +698,8 @@ bool ShipSleepCabin::interact(Action verb, Object &obj1, Object &obj2) {
}
if (_gm->_state._arrivalDaysLeft == 0) {
_gm->saveTime();
- if (!_gm->saveGame(-2))
- _gm->errorTemp();
+ if (!_vm->saveGame(kSleepAutosaveSlot, "Sleep autosave"))
+ _vm->errorTempSave(true);
_gm->_state._dream = true;
_gm->loadTime();
}
@@ -2238,10 +2238,8 @@ bool ArsanoMeetup2::interact(Action verb, Object &obj1, Object &obj2) {
_vm->paletteFadeOut();
g_system->fillScreen(kColorBlack);
_gm->_state._dream = false;
- // TODO:
- // The original at this points loads a savegame from "MSN.TMP"
- // which is provided with the data file.
-// if (!load_game(-2)) error_temp();
+ if (!_vm->loadGame(kSleepAutosaveSlot))
+ _vm->errorTempSave(false);
_gm->loadTime();
_gm->_rooms[CAVE]->getObject(1)->_exitRoom = MEETUP3;
_gm->_state._dream = true;
diff --git a/engines/supernova/state.cpp b/engines/supernova/state.cpp
index 3450cdf476..7cf4294c20 100644
--- a/engines/supernova/state.cpp
+++ b/engines/supernova/state.cpp
@@ -1197,19 +1197,10 @@ void GameManager::roomBrightness() {
_vm->paletteBrightness();
}
-bool GameManager::saveGame(int number) {
- warning("STUB: savegame %d", number);
- return false;
-}
-
void GameManager::changeRoom(RoomID id) {
_currentRoom = _rooms[id];
}
-void GameManager::errorTemp() {
- warning("STUB: errorTemp");
-}
-
void GameManager::wait2(int ticks) {
int32 end = _state._time + ticksToMsec(ticks);
do {
diff --git a/engines/supernova/state.h b/engines/supernova/state.h
index 8a3e6bf02b..bd08371372 100644
--- a/engines/supernova/state.h
+++ b/engines/supernova/state.h
@@ -163,8 +163,6 @@ public:
void turnOff();
void turnOn();
void screenShake();
- bool saveGame(int number);
- void errorTemp();
void roomBrightness();
void showMenu();
void animationOff();
diff --git a/engines/supernova/supernova.cpp b/engines/supernova/supernova.cpp
index 64a06c2ce2..6a2327acf7 100644
--- a/engines/supernova/supernova.cpp
+++ b/engines/supernova/supernova.cpp
@@ -1060,6 +1060,14 @@ bool SupernovaEngine::saveGame(int slot, const Common::String &description) {
return true;
}
+void SupernovaEngine::errorTempSave(bool saving) {
+ // TODO: At this point the engine should terminate with the error
+ // "Failed to save temporary game state. Make sure your save game directory "
+ // "is set in scummvm and that you can write to it."
+ // or
+ // "Failed to load temporary game state."
+ warning("STUB: errorTempSave");
+}
ScreenBufferStack::ScreenBufferStack()
: _last(_buffer) {
diff --git a/engines/supernova/supernova.h b/engines/supernova/supernova.h
index 6cc7b0c0fb..eeb518efd1 100644
--- a/engines/supernova/supernova.h
+++ b/engines/supernova/supernova.h
@@ -145,6 +145,7 @@ public:
void command_print();
bool loadGame(int slot);
bool saveGame(int slot, const Common::String &description);
+ void errorTempSave(bool saving);
void setTextSpeed();
const Common::String &getGameString(int idx) const {