Skip to content

Commit

Permalink
GLK: Disable unstable subengines by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 committed Sep 9, 2020
1 parent 1df182a commit b599728
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 76 deletions.
5 changes: 4 additions & 1 deletion engines/glk/configure.engine
@@ -1,3 +1,6 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
add_engine glk "Glk Interactive Fiction games" yes "" "" "16bit freetype2 jpeg png"
add_engine glk "Glk Interactive Fiction games" yes "comprehend glulx tads" "" "16bit freetype2 jpeg png"
add_engine comprehend "Comprehend" no
add_engine glulx "Glulx" no
add_engine tads "TADS" no
82 changes: 62 additions & 20 deletions engines/glk/detection.cpp
Expand Up @@ -35,12 +35,8 @@
#include "glk/alan3/alan3.h"
#include "glk/archetype/archetype.h"
#include "glk/archetype/detection.h"
#include "glk/comprehend/comprehend.h"
#include "glk/comprehend/detection.h"
#include "glk/zcode/detection.h"
#include "glk/zcode/zcode.h"
#include "glk/glulx/detection.h"
#include "glk/glulx/glulx.h"
#include "glk/hugo/detection.h"
#include "glk/hugo/hugo.h"
#include "glk/jacl/detection.h"
Expand All @@ -53,9 +49,22 @@
#include "glk/quest/quest.h"
#include "glk/scott/detection.h"
#include "glk/scott/scott.h"

#ifdef ENABLE_COMPREHEND
#include "glk/comprehend/comprehend.h"
#include "glk/comprehend/detection.h"
#endif

#ifdef ENABLE_GLULX
#include "glk/glulx/detection.h"
#include "glk/glulx/glulx.h"
#endif

#ifdef ENABLE_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"
Expand Down Expand Up @@ -169,7 +178,9 @@ template<class META, class ENG>bool create(OSystem *syst,
}

Common::Error GlkMetaEngine::createInstance(OSystem *syst, Engine **engine) const {
#ifdef ENABLE_TADS
Glk::GameDescriptor td = Glk::GameDescriptor::empty();
#endif
assert(engine);

// Populate the game description
Expand Down Expand Up @@ -208,23 +219,30 @@ Common::Error GlkMetaEngine::createInstance(OSystem *syst, Engine **engine) cons
else if ((create<Glk::Alan2::Alan2MetaEngine, Glk::Alan2::Alan2>(syst, gameDesc, *engine))) {}
else if ((create<Glk::Alan3::Alan3MetaEngine, Glk::Alan3::Alan3>(syst, gameDesc, *engine))) {}
else if ((create<Glk::Archetype::ArchetypeMetaEngine, Glk::Archetype::Archetype>(syst, gameDesc, *engine))) {}
else if ((create<Glk::Comprehend::ComprehendMetaEngine, Glk::Comprehend::Comprehend>(syst, gameDesc, *engine))) {}
else if ((create<Glk::Glulx::GlulxMetaEngine, Glk::Glulx::Glulx>(syst, gameDesc, *engine))) {}
else if ((create<Glk::Hugo::HugoMetaEngine, Glk::Hugo::Hugo>(syst, gameDesc, *engine))) {}
else if ((create<Glk::JACL::JACLMetaEngine, Glk::JACL::JACL>(syst, gameDesc, *engine))) {}
else if ((create<Glk::Level9::Level9MetaEngine, Glk::Level9::Level9>(syst, gameDesc, *engine))) {}
else if ((create<Glk::Magnetic::MagneticMetaEngine, Glk::Magnetic::Magnetic>(syst, gameDesc, *engine))) {}
else if ((create<Glk::Quest::QuestMetaEngine, Glk::Quest::Quest>(syst, gameDesc, *engine))) {}
else if ((create<Glk::Scott::ScottMetaEngine, Glk::Scott::Scott>(syst, gameDesc, *engine))) {}
else if ((create<Glk::ZCode::ZCodeMetaEngine, Glk::ZCode::ZCode>(syst, gameDesc, *engine))) {}
#ifdef ENABLE_COMPREHEND
else if ((create<Glk::Comprehend::ComprehendMetaEngine, Glk::Comprehend::Comprehend>(syst, gameDesc, *engine))) {}
#endif
#ifdef ENABLE_GLULX
else if ((create<Glk::Glulx::GlulxMetaEngine, Glk::Glulx::Glulx>(syst, gameDesc, *engine))) {}
#endif
#ifdef ENABLE_TADS
else if ((td = Glk::TADS::TADSMetaEngine::findGame(gameDesc._gameId.c_str()))._description) {
if (!isGameAllowed(td._supportLevel))
return Common::kUserCanceled;
else if (td._options & Glk::TADS::OPTION_TADS3)
new Glk::TADS::TADS3::TADS3(syst, gameDesc);
else
new Glk::TADS::TADS2::TADS2(syst, gameDesc);
} else if ((create<Glk::ZCode::ZCodeMetaEngine, Glk::ZCode::ZCode>(syst, gameDesc, *engine))) {
} else {
}
#endif
else {
return Common::kNoGameDataFoundError;
}

Expand Down Expand Up @@ -261,16 +279,22 @@ PlainGameList GlkMetaEngine::getSupportedGames() const {
Glk::Alan2::Alan2MetaEngine::getSupportedGames(list);
Glk::Alan3::Alan3MetaEngine::getSupportedGames(list);
Glk::Archetype::ArchetypeMetaEngine::getSupportedGames(list);
Glk::Comprehend::ComprehendMetaEngine::getSupportedGames(list);
Glk::Glulx::GlulxMetaEngine::getSupportedGames(list);
Glk::Hugo::HugoMetaEngine::getSupportedGames(list);
Glk::JACL::JACLMetaEngine::getSupportedGames(list);
Glk::Level9::Level9MetaEngine::getSupportedGames(list);
Glk::Magnetic::MagneticMetaEngine::getSupportedGames(list);
Glk::Quest::QuestMetaEngine::getSupportedGames(list);
Glk::Scott::ScottMetaEngine::getSupportedGames(list);
Glk::TADS::TADSMetaEngine::getSupportedGames(list);
Glk::ZCode::ZCodeMetaEngine::getSupportedGames(list);
#ifdef ENABLE_COMPREHEND
Glk::Comprehend::ComprehendMetaEngine::getSupportedGames(list);
#endif
#ifdef ENABLE_GLULX
Glk::Glulx::GlulxMetaEngine::getSupportedGames(list);
#endif
#ifdef ENABLE_TADS
Glk::TADS::TADSMetaEngine::getSupportedGames(list);
#endif

return list;
}
Expand All @@ -286,16 +310,22 @@ PlainGameDescriptor GlkMetaEngine::findGame(const char *gameId) const {
FIND_GAME(AGT);
FIND_GAME(Alan3);
FIND_GAME(Archetype);
FIND_GAME(Comprehend);
FIND_GAME(Glulx);
FIND_GAME(Hugo);
FIND_GAME(JACL);
FIND_GAME(Level9);
FIND_GAME(Magnetic);
FIND_GAME(Quest);
FIND_GAME(Scott);
FIND_GAME(TADS);
FIND_GAME(ZCode);
#ifdef ENABLE_COMPREHEND
FIND_GAME(Comprehend);
#endif
#ifdef ENABLE_GLULX
FIND_GAME(Glulx);
#endif
#ifdef ENABLE_TADS
FIND_GAME(TADS);
#endif

return PlainGameDescriptor();
}
Expand All @@ -313,16 +343,22 @@ DetectedGames GlkMetaEngine::detectGames(const Common::FSList &fslist) const {
Glk::Alan2::Alan2MetaEngine::detectGames(fslist, detectedGames);
Glk::Alan3::Alan3MetaEngine::detectGames(fslist, detectedGames);
Glk::Archetype::ArchetypeMetaEngine::detectGames(fslist, detectedGames);
Glk::Comprehend::ComprehendMetaEngine::detectGames(fslist, detectedGames);
Glk::Glulx::GlulxMetaEngine::detectGames(fslist, detectedGames);
Glk::Hugo::HugoMetaEngine::detectGames(fslist, detectedGames);
Glk::JACL::JACLMetaEngine::detectGames(fslist, detectedGames);
Glk::Level9::Level9MetaEngine::detectGames(fslist, detectedGames);
Glk::Magnetic::MagneticMetaEngine::detectGames(fslist, detectedGames);
Glk::Quest::QuestMetaEngine::detectGames(fslist, detectedGames);
Glk::Scott::ScottMetaEngine::detectGames(fslist, detectedGames);
Glk::TADS::TADSMetaEngine::detectGames(fslist, detectedGames);
Glk::ZCode::ZCodeMetaEngine::detectGames(fslist, detectedGames);
#ifdef ENABLE_COMPREHEND
Glk::Comprehend::ComprehendMetaEngine::detectGames(fslist, detectedGames);
#endif
#ifdef ENABLE_GLULX
Glk::Glulx::GlulxMetaEngine::detectGames(fslist, detectedGames);
#endif
#ifdef ENABLE_TADS
Glk::TADS::TADSMetaEngine::detectGames(fslist, detectedGames);
#endif

return detectedGames;
}
Expand All @@ -335,16 +371,22 @@ void GlkMetaEngine::detectClashes() const {
Glk::Alan2::Alan2MetaEngine::detectClashes(map);
Glk::Alan3::Alan3MetaEngine::detectClashes(map);
Glk::Archetype::ArchetypeMetaEngine::detectClashes(map);
Glk::Comprehend::ComprehendMetaEngine::detectClashes(map);
Glk::Glulx::GlulxMetaEngine::detectClashes(map);
Glk::Hugo::HugoMetaEngine::detectClashes(map);
Glk::JACL::JACLMetaEngine::detectClashes(map);
Glk::Level9::Level9MetaEngine::detectClashes(map);
Glk::Magnetic::MagneticMetaEngine::detectClashes(map);
Glk::Quest::QuestMetaEngine::detectClashes(map);
Glk::Scott::ScottMetaEngine::detectClashes(map);
Glk::TADS::TADSMetaEngine::detectClashes(map);
Glk::ZCode::ZCodeMetaEngine::detectClashes(map);
#ifdef ENABLE_COMPREHEND
Glk::Comprehend::ComprehendMetaEngine::detectClashes(map);
#endif
#ifdef ENABLE_GLULX
Glk::Glulx::GlulxMetaEngine::detectClashes(map);
#endif
#ifdef ENABLE_TADS
Glk::TADS::TADSMetaEngine::detectClashes(map);
#endif
}

const ExtraGuiOptions GlkMetaEngine::getExtraGuiOptions(const Common::String &) const {
Expand Down
122 changes: 67 additions & 55 deletions engines/glk/module.mk
Expand Up @@ -167,36 +167,6 @@ MODULE_OBJS := \
archetype/sys_object.o \
archetype/timestamp.o \
archetype/token.o \
comprehend/charset.o \
comprehend/comprehend.o \
comprehend/debugger.o \
comprehend/debugger_dumper.o \
comprehend/detection.o \
comprehend/dictionary.o \
comprehend/draw_surface.o \
comprehend/file_buf.o \
comprehend/game.o \
comprehend/game_cc.o \
comprehend/game_data.o \
comprehend/game_oo.o \
comprehend/game_tm.o \
comprehend/game_tr.o \
comprehend/opcode_map.o \
comprehend/pics.o \
glulx/accel.o \
glulx/detection.o \
glulx/exec.o \
glulx/float.o \
glulx/funcs.o \
glulx/gestalt.o \
glulx/glkop.o \
glulx/glulx.o \
glulx/heap.o \
glulx/operand.o \
glulx/search.o \
glulx/serial.o \
glulx/string.o \
glulx/vm.o \
hugo/detection.o \
hugo/heexpr.o \
hugo/heglk.o \
Expand Down Expand Up @@ -248,6 +218,71 @@ MODULE_OBJS := \
quest/streams.o \
scott/detection.o \
scott/scott.o \
zcode/bitmap_font.o \
zcode/config.o \
zcode/detection.o \
zcode/zcode.o \
zcode/glk_interface.o \
zcode/mem.o \
zcode/pics.o \
zcode/pics_decoder.o \
zcode/processor.o \
zcode/processor_buffer.o \
zcode/processor_input.o \
zcode/processor_maths.o \
zcode/processor_mem.o \
zcode/processor_objects.o \
zcode/processor_screen.o \
zcode/processor_streams.o \
zcode/processor_table.o \
zcode/processor_text.o \
zcode/processor_variables.o \
zcode/processor_windows.o \
zcode/quetzal.o \
zcode/screen.o \
zcode/sound_folder.o \
zcode/windows.o

ifdef ENABLE_COMPREHEND
MODULE_OBJS += \
comprehend/charset.o \
comprehend/comprehend.o \
comprehend/debugger.o \
comprehend/debugger_dumper.o \
comprehend/detection.o \
comprehend/dictionary.o \
comprehend/draw_surface.o \
comprehend/file_buf.o \
comprehend/game.o \
comprehend/game_cc.o \
comprehend/game_data.o \
comprehend/game_oo.o \
comprehend/game_tm.o \
comprehend/game_tr.o \
comprehend/opcode_map.o \
comprehend/pics.o
endif

ifdef ENABLE_GLULX
MODULE_OBJS += \
glulx/accel.o \
glulx/detection.o \
glulx/exec.o \
glulx/float.o \
glulx/funcs.o \
glulx/gestalt.o \
glulx/glkop.o \
glulx/glulx.o \
glulx/heap.o \
glulx/operand.o \
glulx/search.o \
glulx/serial.o \
glulx/string.o \
glulx/vm.o
endif

ifdef ENABLE_TADS
MODULE_OBJS += \
tads/detection.o \
tads/os_banners.o \
tads/os_buffer.o \
Expand Down Expand Up @@ -288,31 +323,8 @@ MODULE_OBJS := \
tads/tads2/tokenizer_hash.o \
tads/tads2/vocabulary.o \
tads/tads2/vocabulary_parser.o \
tads/tads3/tads3.o \
zcode/bitmap_font.o \
zcode/config.o \
zcode/detection.o \
zcode/zcode.o \
zcode/glk_interface.o \
zcode/mem.o \
zcode/pics.o \
zcode/pics_decoder.o \
zcode/processor.o \
zcode/processor_buffer.o \
zcode/processor_input.o \
zcode/processor_maths.o \
zcode/processor_mem.o \
zcode/processor_objects.o \
zcode/processor_screen.o \
zcode/processor_streams.o \
zcode/processor_table.o \
zcode/processor_text.o \
zcode/processor_variables.o \
zcode/processor_windows.o \
zcode/quetzal.o \
zcode/screen.o \
zcode/sound_folder.o \
zcode/windows.o
tads/tads3/tads3.o
endif

# This module can be built as a plugin
ifeq ($(ENABLE_GLK), DYNAMIC_PLUGIN)
Expand Down

0 comments on commit b599728

Please sign in to comment.