diff --git a/engines/prisoner/detection_tables.h b/engines/prisoner/detection_tables.h index 7c8fa965ab16..5e0d81d51cce 100644 --- a/engines/prisoner/detection_tables.h +++ b/engines/prisoner/detection_tables.h @@ -27,6 +27,16 @@ const PlainGameDescriptor prisonerGames[] = { }; const ADGameDescription gameDescriptions[] = { + // Prisoner GOG version + { + "prisoner", + 0, + AD_ENTRY1s("a_klang.bin", "f20001d885aee4e6320052a4368bf8cf", 561), + Common::EN_ANY, + Common::kPlatformDOS, + ADGF_NO_FLAGS, + GUIO1(GUIO_NONE)}, + // Prisoner English version { "prisoner", diff --git a/engines/prisoner/prisoner.cpp b/engines/prisoner/prisoner.cpp index 689a47494fa2..02fcb0bb654b 100644 --- a/engines/prisoner/prisoner.cpp +++ b/engines/prisoner/prisoner.cpp @@ -59,6 +59,7 @@ namespace Prisoner { PrisonerEngine::PrisonerEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) { const Common::FSNode gameDataDir(ConfMan.getPath("path")); SearchMan.addSubDirectoryMatching(gameDataDir, "e_video"); + SearchMan.addSubDirectoryMatching(gameDataDir, "video"); // Setup mixer if (!_mixer->isReady()) { @@ -79,7 +80,13 @@ PrisonerEngine::~PrisonerEngine() { Common::Error PrisonerEngine::run() { initGraphics(640, 480); - _languageChar = 'E'; + // TODO: try to find a better way of doing this maybe after implementing loading of other + // languages (which I currently don't have access to) + _languageChar = 'A'; + if (Common::File::exists("e_klang.bin")) { + _languageChar = 'E'; + } + _currModuleIndex = 2; _isSaveAllowed = true; @@ -88,7 +95,7 @@ Common::Error PrisonerEngine::run() { _cameraY = 0; _screen = new Screen(this); - _resLoader = new PrisonerResourceLoader(); + _resLoader = new PrisonerResourceLoader(_languageChar); _res = new ResourceManager(_resLoader); _scriptOpcodes = new ScriptOpcodes(this); _scriptOpcodes->setupOpcodes(); diff --git a/engines/prisoner/resourcemgr.cpp b/engines/prisoner/resourcemgr.cpp index fd33f00fa8ce..4af14175d45f 100644 --- a/engines/prisoner/resourcemgr.cpp +++ b/engines/prisoner/resourcemgr.cpp @@ -36,7 +36,7 @@ namespace Prisoner { /* PrisonerResourceLoader */ -PrisonerResourceLoader::PrisonerResourceLoader() { +PrisonerResourceLoader::PrisonerResourceLoader(char languageChar) { // NOTE: An alternative to hardcoding the data would be to load it from the game Exe // (The file-based loadDirectory supports this already.) @@ -132,7 +132,11 @@ PrisonerResourceLoader::PrisonerResourceLoader() { addArchive("KSVGA.KRO", kPrisonerKSVGADirectory, kPrisonerKSVGAResourceTypes); addArchive("KSOUND.KRO", kPrisonerDOSKSOUNDDirectory, kPrisonerKSOUNDResourceTypes); - addArchive("E_KLANG.KRO", "E_KLANG.BIN", 0, true, kPrisonerKLANGResourceTypes); + + Common::String kroName = Common::String::format("%c_KLANG.KRO", languageChar); + Common::String binName = Common::String::format("%c_KLANG.BIN", languageChar); + + addArchive(kroName.c_str(), binName.c_str(), 0, true, kPrisonerKLANGResourceTypes); } diff --git a/engines/prisoner/resourcemgr.h b/engines/prisoner/resourcemgr.h index 2f9a729cb95d..6b67a59cfeb7 100644 --- a/engines/prisoner/resourcemgr.h +++ b/engines/prisoner/resourcemgr.h @@ -61,7 +61,7 @@ class ResourceLoader { class PrisonerResourceLoader : public ResourceLoader { public: - PrisonerResourceLoader(); + PrisonerResourceLoader(char languageChar); ~PrisonerResourceLoader(); byte *load(Common::String &pakName, int16 pakSlot, int16 type, uint32 &dataSize); KroArchive *getArchiveForType(int16 type);