aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-04-24 09:12:09 -0400
committerPaul Gilbert2014-04-24 09:12:09 -0400
commit1098246f2be705de82dd3077dd25323380c32dd1 (patch)
tree3e6cd9dca45428adff0d53dd665c2803a57060f1
parentf330106be2368df453fec7799a2d061c829f525d (diff)
downloadscummvm-rg350-1098246f2be705de82dd3077dd25323380c32dd1.tar.gz
scummvm-rg350-1098246f2be705de82dd3077dd25323380c32dd1.tar.bz2
scummvm-rg350-1098246f2be705de82dd3077dd25323380c32dd1.zip
MADS: Added methods for can save/load currently
-rw-r--r--engines/mads/mads.cpp11
-rw-r--r--engines/mads/mads.h10
2 files changed, 21 insertions, 0 deletions
diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp
index c40d4bfa1b..6f57b1df60 100644
--- a/engines/mads/mads.cpp
+++ b/engines/mads/mads.cpp
@@ -26,6 +26,7 @@
#include "common/events.h"
#include "engines/util.h"
#include "mads/mads.h"
+#include "mads/game.h"
#include "mads/screen.h"
#include "mads/msurface.h"
#include "mads/resources.h"
@@ -119,4 +120,14 @@ int MADSEngine::hypotenuse(int xv, int yv) {
return (int)sqrt((double)(xv * xv + yv * yv));
}
+bool MADSEngine::canLoadGameStateCurrently() {
+ return !_game->_winStatus && !_game->globals()[5]
+ && _dialogs->_pendingDialog == DIALOG_NONE;
+}
+
+bool MADSEngine::canSaveGameStateCurrently() {
+ return !_game->_winStatus && !_game->globals()[5]
+ && _dialogs->_pendingDialog == DIALOG_NONE;
+}
+
} // End of namespace MADS
diff --git a/engines/mads/mads.h b/engines/mads/mads.h
index 4ea0758f88..f13b3b9008 100644
--- a/engines/mads/mads.h
+++ b/engines/mads/mads.h
@@ -119,6 +119,16 @@ public:
int getRandomNumber(int maxNumber);
int getRandomNumber(int minNumber, int maxNumber);
int hypotenuse(int xv, int yv);
+
+ /**
+ * Returns true if it is currently okay to restore a game
+ */
+ bool canLoadGameStateCurrently();
+
+ /**
+ * Returns true if it is currently okay to save the game
+ */
+ bool canSaveGameStateCurrently();
};
} // End of namespace MADS