aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-08-15 23:06:07 +0200
committerEugene Sandulenko2019-09-03 17:17:33 +0200
commiteaa972347f42d4e6a5e0e47974ab7d360cdfe44b (patch)
tree53f6c3f665c9b1e981d4ca0b930bf899ee67135b
parentf14edf90d4f7ecc2b869274aeaad3aeed06ad524 (diff)
downloadscummvm-rg350-eaa972347f42d4e6a5e0e47974ab7d360cdfe44b.tar.gz
scummvm-rg350-eaa972347f42d4e6a5e0e47974ab7d360cdfe44b.tar.bz2
scummvm-rg350-eaa972347f42d4e6a5e0e47974ab7d360cdfe44b.zip
HDB: Increase number of slots to 99 and support saveload from the GMM
-rw-r--r--engines/hdb/detection.cpp2
-rw-r--r--engines/hdb/hdb.h6
-rw-r--r--engines/hdb/saveload.cpp8
3 files changed, 13 insertions, 3 deletions
diff --git a/engines/hdb/detection.cpp b/engines/hdb/detection.cpp
index 974d831568..5637bf08a5 100644
--- a/engines/hdb/detection.cpp
+++ b/engines/hdb/detection.cpp
@@ -188,7 +188,7 @@ void HDBMetaEngine::removeSaveState(const char *target, int slot) const {
g_system->getSavefileManager()->removeSavefile(fileName);
}
-int HDBMetaEngine::getMaximumSaveSlot() const { return 9; }
+int HDBMetaEngine::getMaximumSaveSlot() const { return 99; }
SaveStateList HDBMetaEngine::listSaves(const char *target) const {
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
diff --git a/engines/hdb/hdb.h b/engines/hdb/hdb.h
index 3535d452fc..eb3a81886a 100644
--- a/engines/hdb/hdb.h
+++ b/engines/hdb/hdb.h
@@ -195,8 +195,10 @@ public:
_changeLevel = true;
}
- Common::Error saveGameState(int slot, const Common::String &desc);
- Common::Error loadGameState(int slot);
+ virtual Common::Error saveGameState(int slot, const Common::String &desc);
+ virtual Common::Error loadGameState(int slot);
+ virtual bool canLoadGameStateCurrently();
+ virtual bool canSaveGameStateCurrently();
void saveGame(Common::OutSaveFile *out);
void loadGame(Common::InSaveFile *in);
diff --git a/engines/hdb/saveload.cpp b/engines/hdb/saveload.cpp
index d53404b075..618d9a9be4 100644
--- a/engines/hdb/saveload.cpp
+++ b/engines/hdb/saveload.cpp
@@ -32,6 +32,10 @@
namespace HDB {
+bool HDBGame::canSaveGameStateCurrently() {
+ return (_gameState == GAME_PLAY && !_ai->cinematicsActive());
+}
+
Common::Error HDBGame::saveGameState(int slot, const Common::String &desc) {
// If no map is loaded, don't try to save
@@ -79,6 +83,10 @@ Common::Error HDBGame::saveGameState(int slot, const Common::String &desc) {
return Common::kNoError;
}
+bool HDBGame::canLoadGameStateCurrently() {
+ return _gameState == GAME_PLAY;
+}
+
Common::Error HDBGame::loadGameState(int slot) {
Common::InSaveFile *in;