diff options
author | Paul Gilbert | 2018-11-11 21:44:15 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-08 19:05:59 -0800 |
commit | ad95130e4f3ad9b0eb0f1ab976dd157a0e7a2dbf (patch) | |
tree | 95310da96f0102a77749745e0127d6f379ec2e3f | |
parent | 9fadd84b37ff4e9fa76cb2efc3464d5b958a7ed3 (diff) | |
download | scummvm-rg350-ad95130e4f3ad9b0eb0f1ab976dd157a0e7a2dbf.tar.gz scummvm-rg350-ad95130e4f3ad9b0eb0f1ab976dd157a0e7a2dbf.tar.bz2 scummvm-rg350-ad95130e4f3ad9b0eb0f1ab976dd157a0e7a2dbf.zip |
GLK: FROTZ: Added user options initialization from configuration
-rw-r--r-- | engines/gargoyle/frotz/frotz.cpp | 38 | ||||
-rw-r--r-- | engines/gargoyle/frotz/frotz.h | 5 |
2 files changed, 43 insertions, 0 deletions
diff --git a/engines/gargoyle/frotz/frotz.cpp b/engines/gargoyle/frotz/frotz.cpp index c0a9442ad4..df6d7364ac 100644 --- a/engines/gargoyle/frotz/frotz.cpp +++ b/engines/gargoyle/frotz/frotz.cpp @@ -22,6 +22,7 @@ #include "gargoyle/frotz/frotz.h" #include "gargoyle/frotz/frotz_types.h" +#include "common/config-manager.h" namespace Gargoyle { namespace Frotz { @@ -40,11 +41,48 @@ void Frotz::runGame(Common::SeekableReadStream *gameFile) { // TODO } +void Frotz::initialize() { + if (ConfMan.hasKey("attribute_assignment") && ConfMan.getBool("attribute_assignment")) + _attribute_assignment = true; + if (ConfMan.hasKey("attribute_testing") && ConfMan.getBool("attribute_testing")) + _attribute_testing = true; + if (ConfMan.hasKey("ignore_errors") && ConfMan.getBool("ignore_errors")) + _ignore_errors = true; + if (ConfMan.hasKey("object_movement") && ConfMan.getBool("object_movement")) + _object_movement = true; + if (ConfMan.hasKey("object_locating") && ConfMan.getBool("object_locating")) + _object_locating = true; + if (ConfMan.hasKey("piracy") && ConfMan.getBool("piracy")) + _piracy = true; + if (ConfMan.hasKey("save_quetzal") && ConfMan.getBool("save_quetzal")) + _save_quetzal = true; + if (ConfMan.hasKey("random_seed")) + _random.setSeed(ConfMan.getInt("random_seed")); + if (ConfMan.hasKey("script_cols")) + _script_cols = ConfMan.getInt("script_cols"); + if (ConfMan.hasKey("tandy_bit") && ConfMan.getBool("tandy_bit")) + _user_tandy_bit = true; + if (ConfMan.hasKey("undo_slots")) + _undo_slots = ConfMan.getInt("undo_slots"); + if (ConfMan.hasKey("expand_abbreviations") && ConfMan.getBool("expand_abbreviations")) + _expand_abbreviations = true; + if (ConfMan.hasKey("err_report_mode")) { + _err_report_mode = ConfMan.getInt("err_report_mode"); + if ((_err_report_mode < ERR_REPORT_NEVER) || (_err_report_mode > ERR_REPORT_FATAL)) + _err_report_mode = ERR_DEFAULT_REPORT_MODE; + } + + // Call process initialization + Processor::initialize(); +} + Common::Error Frotz::loadGameState(int slot) { + // TODO return Common::kNoError; } Common::Error Frotz::saveGameState(int slot, const Common::String &desc) { + // TODO return Common::kNoError; } diff --git a/engines/gargoyle/frotz/frotz.h b/engines/gargoyle/frotz/frotz.h index c032265453..78272f05f0 100644 --- a/engines/gargoyle/frotz/frotz.h +++ b/engines/gargoyle/frotz/frotz.h @@ -39,6 +39,11 @@ public: Frotz(OSystem *syst, const GargoyleGameDescription *gameDesc); /** + * Initialization + */ + void initialize(); + + /** * Execute the game */ virtual void runGame(Common::SeekableReadStream *gameFile) override; |