From b31990246ee1b5c60dbca24cc9539d372a195aba Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 16 Feb 2016 05:36:53 +0100 Subject: AGI: Added console command to disable automatic saves Helps creating various saved games for Mixed Up Mother Goose --- engines/agi/console.cpp | 55 ++++++++++++++++++++++++++++++------------------- engines/agi/console.h | 1 + 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); -- cgit v1.2.3