aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorMartin Kiewitz2016-02-16 05:36:53 +0100
committerMartin Kiewitz2016-02-16 05:36:53 +0100
commitb31990246ee1b5c60dbca24cc9539d372a195aba (patch)
tree2576bfea70dd9ed3f787b6886c6f7c0ca82051bc /engines/agi
parent562649c7c03a25fc2ea64cb9d1aa4e3f4938d9ea (diff)
downloadscummvm-rg350-b31990246ee1b5c60dbca24cc9539d372a195aba.tar.gz
scummvm-rg350-b31990246ee1b5c60dbca24cc9539d372a195aba.tar.bz2
scummvm-rg350-b31990246ee1b5c60dbca24cc9539d372a195aba.zip
AGI: Added console command to disable automatic saves
Helps creating various saved games for Mixed Up Mother Goose
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/console.cpp55
-rw-r--r--engines/agi/console.h1
2 files changed, 35 insertions, 21 deletions
diff --git a/engines/agi/console.cpp b/engines/agi/console.cpp
index 6419e60219..9a4a357b44 100644
--- a/engines/agi/console.cpp
+++ b/engines/agi/console.cpp
@@ -33,27 +33,28 @@ namespace Agi {
Console::Console(AgiEngine *vm) : GUI::Debugger() {
_vm = vm;
- registerCmd("debug", WRAP_METHOD(Console, Cmd_Debug));
- registerCmd("cont", WRAP_METHOD(Console, Cmd_Cont));
- registerCmd("agiver", WRAP_METHOD(Console, Cmd_Agiver));
- registerCmd("version", WRAP_METHOD(Console, Cmd_Version));
- registerCmd("flags", WRAP_METHOD(Console, Cmd_Flags));
- registerCmd("logic0", WRAP_METHOD(Console, Cmd_Logic0));
- registerCmd("objs", WRAP_METHOD(Console, Cmd_Objs));
- registerCmd("runopcode", WRAP_METHOD(Console, Cmd_RunOpcode));
- registerCmd("opcode", WRAP_METHOD(Console, Cmd_Opcode));
- registerCmd("step", WRAP_METHOD(Console, Cmd_Step));
- registerCmd("trigger", WRAP_METHOD(Console, Cmd_Trigger));
- registerCmd("vars", WRAP_METHOD(Console, Cmd_Vars));
- registerCmd("setvar", WRAP_METHOD(Console, Cmd_SetVar));
- registerCmd("setflag", WRAP_METHOD(Console, Cmd_SetFlag));
- registerCmd("setobj", WRAP_METHOD(Console, Cmd_SetObj));
- registerCmd("room", WRAP_METHOD(Console, Cmd_Room));
- registerCmd("bt", WRAP_METHOD(Console, Cmd_BT));
- registerCmd("show_map", WRAP_METHOD(Console, Cmd_ShowMap));
- registerCmd("screenobj", WRAP_METHOD(Console, Cmd_ScreenObj));
- registerCmd("vmvars", WRAP_METHOD(Console, Cmd_VmVars));
- registerCmd("vmflags", WRAP_METHOD(Console, Cmd_VmFlags));
+ registerCmd("debug", WRAP_METHOD(Console, Cmd_Debug));
+ registerCmd("cont", WRAP_METHOD(Console, Cmd_Cont));
+ registerCmd("agiver", WRAP_METHOD(Console, Cmd_Agiver));
+ registerCmd("version", WRAP_METHOD(Console, Cmd_Version));
+ registerCmd("flags", WRAP_METHOD(Console, Cmd_Flags));
+ registerCmd("logic0", WRAP_METHOD(Console, Cmd_Logic0));
+ registerCmd("objs", WRAP_METHOD(Console, Cmd_Objs));
+ registerCmd("runopcode", WRAP_METHOD(Console, Cmd_RunOpcode));
+ registerCmd("opcode", WRAP_METHOD(Console, Cmd_Opcode));
+ registerCmd("step", WRAP_METHOD(Console, Cmd_Step));
+ registerCmd("trigger", WRAP_METHOD(Console, Cmd_Trigger));
+ registerCmd("vars", WRAP_METHOD(Console, Cmd_Vars));
+ registerCmd("setvar", WRAP_METHOD(Console, Cmd_SetVar));
+ registerCmd("setflag", WRAP_METHOD(Console, Cmd_SetFlag));
+ registerCmd("setobj", WRAP_METHOD(Console, Cmd_SetObj));
+ registerCmd("room", WRAP_METHOD(Console, Cmd_Room));
+ registerCmd("bt", WRAP_METHOD(Console, Cmd_BT));
+ registerCmd("show_map", WRAP_METHOD(Console, Cmd_ShowMap));
+ registerCmd("screenobj", WRAP_METHOD(Console, Cmd_ScreenObj));
+ registerCmd("vmvars", WRAP_METHOD(Console, Cmd_VmVars));
+ registerCmd("vmflags", WRAP_METHOD(Console, Cmd_VmFlags));
+ registerCmd("disableautosave", WRAP_METHOD(Console, Cmd_DisableAutomaticSave));
}
bool Console::Cmd_SetVar(int argc, const char **argv) {
@@ -609,6 +610,18 @@ bool Console::Cmd_VmFlags(int argc, const char **argv) {
return true;
}
+bool Console::Cmd_DisableAutomaticSave(int argc, const char **argv) {
+ if (!_vm->_game.automaticSave) {
+ debugPrintf("Automatic saving is currently not enabled\n");
+ return true;
+ }
+
+ _vm->_game.automaticSave = false;
+
+ debugPrintf("Automatic saving DISABLED!\n");
+ return true;
+}
+
bool Console::parseInteger(const char *argument, int &result) {
char *endPtr = 0;
int idxLen = strlen(argument);
diff --git a/engines/agi/console.h b/engines/agi/console.h
index 41dc9ddabc..ccc17b31de 100644
--- a/engines/agi/console.h
+++ b/engines/agi/console.h
@@ -66,6 +66,7 @@ private:
bool Cmd_ScreenObj(int argc, const char **argv);
bool Cmd_VmVars(int argc, const char **argv);
bool Cmd_VmFlags(int argc, const char **argv);
+ bool Cmd_DisableAutomaticSave(int argc, const char **argv);
bool parseInteger(const char *argument, int &result);