From aafaace942f6291682d4d2fb2d0af944844bb906 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 2 Nov 2018 20:39:01 -0700 Subject: GLK: SCOTT: Switch command line options setup to use ConfigMan --- engines/gargoyle/scott/scott.cpp | 82 +++++++--------------------------------- engines/gargoyle/scott/scott.h | 2 +- 2 files changed, 14 insertions(+), 70 deletions(-) diff --git a/engines/gargoyle/scott/scott.cpp b/engines/gargoyle/scott/scott.cpp index ef2549505a..a19fb00693 100644 --- a/engines/gargoyle/scott/scott.cpp +++ b/engines/gargoyle/scott/scott.cpp @@ -21,26 +21,11 @@ */ #include "gargoyle/scott/scott.h" +#include "common/config-manager.h" namespace Gargoyle { namespace Scott { -/* -glkunix_argumentlist_t glkunix_arguments[] = -{ - { "-y", glkunix_arg_NoValue, "-y Generate 'You are', 'You are carrying' type messages for games that use these instead (eg Robin Of Sherwood)" }, - { "-i", glkunix_arg_NoValue, "-i Generate 'I am' type messages (default)" }, - { "-d", glkunix_arg_NoValue, "-d Debugging info on load " }, - { "-s", glkunix_arg_NoValue, "-s Generate authentic Scott Adams driver light messages rather than other driver style ones (Light goes out in n turns..)" }, - { "-t", glkunix_arg_NoValue, "-t Generate TRS80 style display (terminal width is 64 characters; a line <-----------------> is displayed after the top stuff; objects have periods after them instead of hyphens" }, - { "-p", glkunix_arg_NoValue, "-p Use for prehistoric databases which don't use bit 16" }, - { "-w", glkunix_arg_NoValue, "-w Disable upper window" }, - { "", glkunix_arg_ValueFollows, "filename file to load" }, - - { nullptr, glkunix_arg_End, nullptr } -}; -*/ - Scott::Scott(OSystem *syst, const GargoyleGameDescription *gameDesc) : Glk(syst, gameDesc), Items(nullptr), Rooms(nullptr), Verbs(nullptr), Nouns(nullptr), Messages(nullptr), Actions(nullptr), CurrentCounter(0), SavedRoom(0), Options(0), Width(0), TopHeight(0), @@ -139,61 +124,20 @@ Distributed under the GNU software license\n\n"); } void Scott::initialize() { - /* - int argc = data->argc; - char **argv = data->argv; - - if (argc < 1) - return 0; - - while (argv[1]) - { - if (*argv[1] != '-') - break; - switch (argv[1][1]) - { - case 'y': + if (ConfMan.hasKey("YOUARE")) { + if (ConfMan.getBool("YOUARE")) Options |= YOUARE; - break; - case 'i': - Options &= ~YOUARE; - break; - case 'd': - Options |= DEBUGGING; - break; - case 's': - Options |= SCOTTLIGHT; - break; - case 't': - Options |= TRS80_STYLE; - break; - case 'p': - Options |= PREHISTORIC_LAMP; - break; - case 'w': - split_screen = 0; - break; - } - argv++; - argc--; - } - - if (argc == 2) - { - game_file = argv[1]; -#ifdef GARGLK - const char *s; - if ((s = strrchr(game_file, '/')) != nullptr || (s = strrchr(game_file, '\\')) != nullptr) - { - garglk_set_story_name(s + 1); - } else - { - garglk_set_story_name(game_file); - } -#endif + Options &= ~YOUARE; } - */ + if (gDebugLevel > 0) + Options |= DEBUGGING; + if (ConfMan.hasKey("SCOTTLIGHT") && ConfMan.getBool("SCOTTLIGHT")) + Options |= SCOTTLIGHT; + if (ConfMan.hasKey("TRS80_STYLE") && ConfMan.getBool("TRS80_STYLE")) + Options |= TRS80_STYLE; + if (ConfMan.hasKey("PREHISTORIC_LAMP") && ConfMan.getBool("PREHISTORIC_LAMP")) + Options |= PREHISTORIC_LAMP; } void Scott::display(winid_t w, const char *fmt, ...) { @@ -336,7 +280,7 @@ char *Scott::readString(Common::SeekableReadStream *f) { return t; } -void Scott::loadDatabase(Common::SeekableReadStream *f, int loud) { +void Scott::loadDatabase(Common::SeekableReadStream *f, bool loud) { int unused, ni, na, nw, nr, mc, pr, tr, wl, lt, mn, trm; int ct; int lo; diff --git a/engines/gargoyle/scott/scott.h b/engines/gargoyle/scott/scott.h index 35a84fa2ea..f2fe7699be 100644 --- a/engines/gargoyle/scott/scott.h +++ b/engines/gargoyle/scott/scott.h @@ -147,7 +147,7 @@ private: const char *mapSynonym(const char *word); int matchUpItem(const char *text, int loc); char *readString(Common::SeekableReadStream *f); - void loadDatabase(Common::SeekableReadStream *f, int loud); + void loadDatabase(Common::SeekableReadStream *f, bool loud); void output(const char *a); void outputNumber(int a); void look(void); -- cgit v1.2.3