diff options
author | Paul Gilbert | 2019-10-22 19:24:19 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-10-22 19:25:58 -0700 |
commit | 56191eded6893a83edf1f01d01f23c50d43d7f92 (patch) | |
tree | 784cf4da8ce0479730b8a9f384d5eaee3936d5d7 /engines/glk | |
parent | bc81faa701f88a4d76dddb460bf8ad35518f8a22 (diff) | |
download | scummvm-rg350-56191eded6893a83edf1f01d01f23c50d43d7f92.tar.gz scummvm-rg350-56191eded6893a83edf1f01d01f23c50d43d7f92.tar.bz2 scummvm-rg350-56191eded6893a83edf1f01d01f23c50d43d7f92.zip |
GLK: Squash of GLK sub-engines pull request, unused variable fix
See ccawley2011's pull at https://github.com/scummvm/scummvm/pull/1900
Diffstat (limited to 'engines/glk')
-rw-r--r-- | engines/glk/configure.engine | 14 | ||||
-rw-r--r-- | engines/glk/detection.cpp | 257 | ||||
-rw-r--r-- | engines/glk/module.mk | 72 |
3 files changed, 271 insertions, 72 deletions
diff --git a/engines/glk/configure.engine b/engines/glk/configure.engine index c6e096c899..e964787e3c 100644 --- a/engines/glk/configure.engine +++ b/engines/glk/configure.engine @@ -1,3 +1,15 @@ # This file is included from the main "configure" script # add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] -add_engine glk "ScummGlk Interactive Fiction games" no "" "" "freetype2 jpeg png" +add_engine glk "Glk Interactive Fiction games" no "glk_adrift glk_advsys glk_alan2 glk_alan3 glk_frotz glk_glulxe glk_hugo glk_jacl glk_magnetic glk_quest glk_scott glk_tads" "Base" "16bit freetype2 jpeg png" +add_engine glk_adrift "ADRIFT" no +add_engine glk_advsys "AdvSys" no +add_engine glk_alan2 "Alan2" no +add_engine glk_alan3 "Alan3" no +add_engine glk_frotz "Frotz" no +add_engine glk_glulxe "Glulxe" no +add_engine glk_hugo "Hugo" no +add_engine glk_jacl "JACL" no +add_engine glk_magnetic "Magnetic" no +add_engine glk_quest "Quest" no +add_engine glk_scott "Scott" no +add_engine glk_tads "TADS" no diff --git a/engines/glk/detection.cpp b/engines/glk/detection.cpp index 325e15be6a..6de2a6f145 100644 --- a/engines/glk/detection.cpp +++ b/engines/glk/detection.cpp @@ -23,31 +23,67 @@ #include "glk/glk.h" #include "glk/detection.h" #include "glk/quetzal.h" + +#ifdef ENABLE_GLK_ADRIFT #include "glk/adrift/detection.h" #include "glk/adrift/adrift.h" +#endif + +#ifdef ENABLE_GLK_ADVSYS #include "glk/advsys/detection.h" #include "glk/advsys/advsys.h" +#endif + +#ifdef ENABLE_GLK_ALAN2 #include "glk/alan2/detection.h" #include "glk/alan2/alan2.h" +#endif + +#ifdef ENABLE_GLK_ALAN3 #include "glk/alan3/detection.h" #include "glk/alan3/alan3.h" +#endif + +#ifdef ENABLE_GLK_FROTZ #include "glk/frotz/detection.h" #include "glk/frotz/frotz.h" +#endif + +#ifdef ENABLE_GLK_GLULXE #include "glk/glulxe/detection.h" #include "glk/glulxe/glulxe.h" +#endif + +#ifdef ENABLE_GLK_HUGO #include "glk/hugo/detection.h" #include "glk/hugo/hugo.h" +#endif + +#ifdef ENABLE_GLK_JACL #include "glk/jacl/detection.h" #include "glk/jacl/jacl.h" +#endif + +#ifdef ENABLE_GLK_MAGNETIC #include "glk/magnetic/detection.h" #include "glk/magnetic/magnetic.h" +#endif + +#ifdef ENABLE_GLK_QUEST #include "glk/quest/detection.h" #include "glk/quest/quest.h" +#endif + +#ifdef ENABLE_GLK_SCOTT #include "glk/scott/detection.h" #include "glk/scott/scott.h" +#endif + +#ifdef ENABLE_GLK_TADS #include "glk/tads/detection.h" #include "glk/tads/tads2/tads2.h" #include "glk/tads/tads3/tads3.h" +#endif #include "base/plugins.h" #include "common/md5.h" @@ -160,26 +196,59 @@ Common::Error GlkMetaEngine::createInstance(OSystem *syst, Engine **engine) cons // Create the correct engine *engine = nullptr; +#ifdef ENABLE_GLK_ADRIFT if ((*engine = create<Glk::Adrift::AdriftMetaEngine, Glk::Adrift::Adrift>(syst, gameDesc)) != nullptr) {} - else if ((*engine = create<Glk::AdvSys::AdvSysMetaEngine, Glk::AdvSys::AdvSys>(syst, gameDesc)) != nullptr) {} - else if ((*engine = create<Glk::Alan2::Alan2MetaEngine, Glk::Alan2::Alan2>(syst, gameDesc)) != nullptr) {} - else if ((*engine = create<Glk::Alan3::Alan3MetaEngine, Glk::Alan3::Alan3>(syst, gameDesc)) != nullptr) {} - else if ((*engine = create<Glk::Frotz::FrotzMetaEngine, Glk::Frotz::Frotz>(syst, gameDesc)) != nullptr) {} - else if ((*engine = create<Glk::Glulxe::GlulxeMetaEngine, Glk::Glulxe::Glulxe>(syst, gameDesc)) != nullptr) {} - else if ((*engine = create<Glk::Hugo::HugoMetaEngine, Glk::Hugo::Hugo>(syst, gameDesc)) != nullptr) {} - else if ((*engine = create<Glk::JACL::JACLMetaEngine, Glk::JACL::JACL>(syst, gameDesc)) != nullptr) {} - else if ((*engine = create<Glk::Quest::QuestMetaEngine, Glk::Quest::Quest>(syst, gameDesc)) != nullptr) {} - else if ((*engine = create<Glk::Scott::ScottMetaEngine, Glk::Scott::Scott>(syst, gameDesc)) != nullptr) {} -#ifndef RELEASE_BUILD - else if ((*engine = create<Glk::Magnetic::MagneticMetaEngine, Glk::Magnetic::Magnetic>(syst, gameDesc)) != nullptr) {} - else if ((td = Glk::TADS::TADSMetaEngine::findGame(gameDesc._gameId.c_str()))._description) { + else +#endif +#ifdef ENABLE_GLK_ADVSYS + if ((*engine = create<Glk::AdvSys::AdvSysMetaEngine, Glk::AdvSys::AdvSys>(syst, gameDesc)) != nullptr) {} + else +#endif +#ifdef ENABLE_GLK_ALAN2 + if ((*engine = create<Glk::Alan2::Alan2MetaEngine, Glk::Alan2::Alan2>(syst, gameDesc)) != nullptr) {} + else +#endif +#ifdef ENABLE_GLK_ALAN3 + if ((*engine = create<Glk::Alan3::Alan3MetaEngine, Glk::Alan3::Alan3>(syst, gameDesc)) != nullptr) {} + else +#endif +#ifdef ENABLE_GLK_FROTZ + if ((*engine = create<Glk::Frotz::FrotzMetaEngine, Glk::Frotz::Frotz>(syst, gameDesc)) != nullptr) {} + else +#endif +#ifdef ENABLE_GLK_GLULXE + if ((*engine = create<Glk::Glulxe::GlulxeMetaEngine, Glk::Glulxe::Glulxe>(syst, gameDesc)) != nullptr) {} + else +#endif +#ifdef ENABLE_GLK_HUGO + if ((*engine = create<Glk::Hugo::HugoMetaEngine, Glk::Hugo::Hugo>(syst, gameDesc)) != nullptr) {} + else +#endif +#ifdef ENABLE_GLK_JACL + if ((*engine = create<Glk::JACL::JACLMetaEngine, Glk::JACL::JACL>(syst, gameDesc)) != nullptr) {} + else +#endif +#ifdef ENABLE_GLK_MAGNETIC + if ((*engine = create<Glk::Magnetic::MagneticMetaEngine, Glk::Magnetic::Magnetic>(syst, gameDesc)) != nullptr) {} + else +#endif +#ifdef ENABLE_GLK_QUEST + if ((*engine = create<Glk::Quest::QuestMetaEngine, Glk::Quest::Quest>(syst, gameDesc)) != nullptr) {} + else +#endif +#ifdef ENABLE_GLK_SCOTT + if ((*engine = create<Glk::Scott::ScottMetaEngine, Glk::Scott::Scott>(syst, gameDesc)) != nullptr) {} + else +#endif +#ifdef ENABLE_GLK_TADS + if ((td = Glk::TADS::TADSMetaEngine::findGame(gameDesc._gameId.c_str()))._description) { if (td._options & Glk::TADS::OPTION_TADS3) *engine = new Glk::TADS::TADS3::TADS3(syst, gameDesc); else *engine = new Glk::TADS::TADS2::TADS2(syst, gameDesc); - } -#endif - else { + } else +#endif + { return Common::kNoGameDataFoundError; } @@ -210,83 +279,132 @@ Common::String GlkMetaEngine::findFileByGameId(const Common::String &gameId) con PlainGameList GlkMetaEngine::getSupportedGames() const { PlainGameList list; +#ifdef ENABLE_GLK_ADRIFT Glk::Adrift::AdriftMetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_ADVSYS Glk::AdvSys::AdvSysMetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_ALAN2 Glk::Alan2::Alan2MetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_ALAN3 Glk::Alan3::Alan3MetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_FROTZ Glk::Frotz::FrotzMetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_GLULXE Glk::Glulxe::GlulxeMetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_HUGO Glk::Hugo::HugoMetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_JACL Glk::JACL::JACLMetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_MAGNETIC + Glk::Magnetic::MagneticMetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_QUEST Glk::Quest::QuestMetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_SCOTT Glk::Scott::ScottMetaEngine::getSupportedGames(list); -#ifndef RELEASE_BUILD - Glk::Magnetic::MagneticMetaEngine::getSupportedGames(list); +#endif +#ifdef ENABLE_GLK_TADS Glk::TADS::TADSMetaEngine::getSupportedGames(list); #endif return list; } -PlainGameDescriptor GlkMetaEngine::findGame(const char *gameId) const { - Glk::GameDescriptor gd = Glk::Adrift::AdriftMetaEngine::findGame(gameId); - if (gd._description) return gd; - - gd = Glk::AdvSys::AdvSysMetaEngine::findGame(gameId); - if (gd._description) return gd; +#define FIND_GAME(SUBENGINE) \ + Glk::GameDescriptor gd##SUBENGINE = Glk::SUBENGINE::SUBENGINE##MetaEngine::findGame(gameId); \ + if (gd##SUBENGINE._description) return gd##SUBENGINE - gd = Glk::Alan2::Alan2MetaEngine::findGame(gameId); - if (gd._description) return gd; - - gd = Glk::Alan3::Alan3MetaEngine::findGame(gameId); - if (gd._description) return gd; - - gd = Glk::Frotz::FrotzMetaEngine::findGame(gameId); - if (gd._description) return gd; - - gd = Glk::Glulxe::GlulxeMetaEngine::findGame(gameId); - if (gd._description) return gd; - - gd = Glk::Hugo::HugoMetaEngine::findGame(gameId); - if (gd._description) return gd; - - gd = Glk::JACL::JACLMetaEngine::findGame(gameId); - if (gd._description) return gd; - - gd = Glk::Quest::QuestMetaEngine::findGame(gameId); - if (gd._description) return gd; - - gd = Glk::Scott::ScottMetaEngine::findGame(gameId); - if (gd._description) return gd; - -#ifndef RELEASE_BUILD - gd = Glk::Magnetic::MagneticMetaEngine::findGame(gameId); - if (gd._description) return gd; - - gd = Glk::TADS::TADSMetaEngine::findGame(gameId); - if (gd._description) return gd; +PlainGameDescriptor GlkMetaEngine::findGame(const char *gameId) const { +#ifdef ENABLE_GLK_ADRIFT + FIND_GAME(Adrift); +#endif +#ifdef ENABLE_GLK_ADVSYS + FIND_GAME(AdvSys); +#endif +#ifdef ENABLE_GLK_ALAN2 + FIND_GAME(Alan2); +#endif +#ifdef ENABLE_GLK_ALAN3 + FIND_GAME(Alan3); #endif +#ifdef ENABLE_GLK_FROTZ + FIND_GAME(Frotz); +#endif +#ifdef ENABLE_GLK_GLULXE + FIND_GAME(Glulxe); +#endif +#ifdef ENABLE_GLK_HUGO + FIND_GAME(Hugo); +#endif +#ifdef ENABLE_GLK_JACL + FIND_GAME(JACL); +#endif +#ifdef ENABLE_GLK_MAGNETIC + FIND_GAME(Magnetic); +#endif +#ifdef ENABLE_GLK_QUEST + FIND_GAME(Quest); +#endif +#ifdef ENABLE_GLK_SCOTT + FIND_GAME(Scott); +#endif +#ifdef ENABLE_GLK_TADS + FIND_GAME(TADS); +#endif + return PlainGameDescriptor(); } +#undef FIND_GAME + DetectedGames GlkMetaEngine::detectGames(const Common::FSList &fslist) const { // This is as good a place as any to detect multiple sub-engines using the same Ids detectClashes(); DetectedGames detectedGames; +#ifdef ENABLE_GLK_ADRIFT Glk::Adrift::AdriftMetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_ADVSYS Glk::AdvSys::AdvSysMetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_ALAN2 Glk::Alan2::Alan2MetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_ALAN3 Glk::Alan3::Alan3MetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_FROTZ Glk::Frotz::FrotzMetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_GLULXE Glk::Glulxe::GlulxeMetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_HUGO Glk::Hugo::HugoMetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_JACL Glk::JACL::JACLMetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_MAGNETIC + Glk::Magnetic::MagneticMetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_QUEST Glk::Quest::QuestMetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_SCOTT Glk::Scott::ScottMetaEngine::detectGames(fslist, detectedGames); - -#ifndef RELEASE_BUILD - Glk::Magnetic::MagneticMetaEngine::detectGames(fslist, detectedGames); +#endif +#ifdef ENABLE_GLK_TADS Glk::TADS::TADSMetaEngine::detectGames(fslist, detectedGames); #endif @@ -295,19 +413,40 @@ DetectedGames GlkMetaEngine::detectGames(const Common::FSList &fslist) const { void GlkMetaEngine::detectClashes() const { Common::StringMap map; +#ifdef ENABLE_GLK_ADRIFT Glk::Adrift::AdriftMetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_ADVSYS Glk::AdvSys::AdvSysMetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_ALAN2 Glk::Alan2::Alan2MetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_ALAN3 Glk::Alan3::Alan3MetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_FROTZ Glk::Frotz::FrotzMetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_GLULXE Glk::Glulxe::GlulxeMetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_HUGO Glk::Hugo::HugoMetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_JACL Glk::JACL::JACLMetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_MAGNETIC + Glk::Magnetic::MagneticMetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_QUEST Glk::Quest::QuestMetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_SCOTT Glk::Scott::ScottMetaEngine::detectClashes(map); - -#ifndef RELEASE_BUILD - Glk::Magnetic::MagneticMetaEngine::detectClashes(map); +#endif +#ifdef ENABLE_GLK_TADS Glk::TADS::TADSMetaEngine::detectClashes(map); #endif } diff --git a/engines/glk/module.mk b/engines/glk/module.mk index b9deea33bf..4da10029d3 100644 --- a/engines/glk/module.mk +++ b/engines/glk/module.mk @@ -26,7 +26,10 @@ MODULE_OBJS := \ window_graphics.o \ window_pair.o \ window_text_buffer.o \ - window_text_grid.o \ + window_text_grid.o + +ifdef ENABLE_GLK_ADRIFT +MODULE_OBJS += \ adrift/adrift.o \ adrift/detection.o \ adrift/os_glk.o \ @@ -54,12 +57,20 @@ MODULE_OBJS := \ adrift/serialization.o \ adrift/sxfile.o \ adrift/sxglob.o \ - adrift/sxutils.o \ + adrift/sxutils.o +endif + +ifdef ENABLE_GLK_ADVSYS +MODULE_OBJS += \ advsys/advsys.o \ advsys/detection.o \ advsys/game.o \ advsys/glk_interface.o \ - advsys/vm.o \ + advsys/vm.o +endif + +ifdef ENABLE_GLK_ALAN2 +MODULE_OBJS += \ alan2/alan2.o \ alan2/detection.o \ alan2/alan_version.o \ @@ -77,7 +88,11 @@ MODULE_OBJS := \ alan2/stack.o \ alan2/sysdep.o \ alan2/term.o \ - alan2/types.o \ + alan2/types.o +endif + +ifdef ENABLE_GLK_ALAN3 +MODULE_OBJS += \ alan3/acode.o \ alan3/act.o \ alan3/actor.o \ @@ -125,7 +140,11 @@ MODULE_OBJS := \ alan3/syserr.o \ alan3/types.o \ alan3/utils.o \ - alan3/word.o \ + alan3/word.o +endif + +ifdef ENABLE_GLK_FROTZ +MODULE_OBJS += \ frotz/bitmap_font.o \ frotz/config.o \ frotz/detection.o \ @@ -149,7 +168,11 @@ MODULE_OBJS := \ frotz/quetzal.o \ frotz/screen.o \ frotz/sound_folder.o \ - frotz/windows.o \ + frotz/windows.o +endif + +ifdef ENABLE_GLK_GLULXE +MODULE_OBJS += \ glulxe/accel.o \ glulxe/detection.o \ glulxe/exec.o \ @@ -163,7 +186,11 @@ MODULE_OBJS := \ glulxe/search.o \ glulxe/serial.o \ glulxe/string.o \ - glulxe/vm.o \ + glulxe/vm.o +endif + +ifdef ENABLE_GLK_HUGO +MODULE_OBJS += \ hugo/detection.o \ hugo/heexpr.o \ hugo/heglk.o \ @@ -176,7 +203,11 @@ MODULE_OBJS := \ hugo/heset.o \ hugo/htokens.o \ hugo/hugo.o \ - hugo/stringfn.o \ + hugo/stringfn.o +endif + +ifdef ENABLE_GLK_JACL +MODULE_OBJS += \ jacl/detection.o \ jacl/display.o \ jacl/encapsulate.o \ @@ -192,12 +223,20 @@ MODULE_OBJS := \ jacl/logging.o \ jacl/parser.o \ jacl/resolvers.o \ - jacl/utils.o \ + jacl/utils.o +endif + +ifdef ENABLE_GLK_MAGNETIC +MODULE_OBJS += \ magnetic/detection.o \ magnetic/emu.o \ magnetic/graphics.o \ magnetic/magnetic.o \ - magnetic/sound.o \ + magnetic/sound.o +endif + +ifdef ENABLE_GLK_QUEST +MODULE_OBJS += \ quest/detection.o \ quest/geas_file.o \ quest/geas_glk.o \ @@ -207,9 +246,17 @@ MODULE_OBJS := \ quest/quest.o \ quest/read_file.o \ quest/string.o \ - quest/streams.o \ + quest/streams.o +endif + +ifdef ENABLE_GLK_SCOTT +MODULE_OBJS += \ scott/detection.o \ - scott/scott.o \ + scott/scott.o +endif + +ifdef ENABLE_GLK_TADS +MODULE_OBJS += \ tads/detection.o \ tads/os_banners.o \ tads/os_buffer.o \ @@ -251,6 +298,7 @@ MODULE_OBJS := \ tads/tads2/vocabulary.o \ tads/tads2/vocabulary_parser.o \ tads/tads3/tads3.o +endif # This module can be built as a plugin ifeq ($(ENABLE_GLK), DYNAMIC_PLUGIN) |