From d8aca2185f82d56fbc2effac1d11b56f4ed0a995 Mon Sep 17 00:00:00 2001 From: Walter Agazzi Date: Sun, 1 Jan 2023 01:33:37 +0100 Subject: [PATCH] PETKA: Add support for compressed Red Comrades 1-2 (#4581) PETKA: Add support for compressed Red Comrades 1-2 --- engines/petka/detection_tables.h | 24 +++++++++++++++++++++++- engines/petka/petka.cpp | 7 +++++++ engines/petka/petka.h | 4 ++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/engines/petka/detection_tables.h b/engines/petka/detection_tables.h index 10d8f899308f..3755c0d87d17 100644 --- a/engines/petka/detection_tables.h +++ b/engines/petka/detection_tables.h @@ -36,7 +36,6 @@ static const ADGameDescription gameDescriptions[] = { Common::kPlatformWindows, ADGF_DROPPLATFORM | ADGF_DROPLANGUAGE | ADGF_DEMO, GUIO1(GUIO_NOMIDI) - }, // Red Comrades 1: Save the Galaxy @@ -48,7 +47,18 @@ static const ADGameDescription gameDescriptions[] = { Common::kPlatformWindows, ADGF_DROPPLATFORM | ADGF_DROPLANGUAGE, GUIO1(GUIO_NOMIDI) + }, + // Red Comrades 1: Save the Galaxy (3 CD) + { + "petka1", + "Compressed", + AD_ENTRY2s("BGS1.STR", "99832accda859e2e1daeaae0a8561aeb", 20280804, + "data1.cab", "7e73a644d8b15d2fd3781de5edce0c18", 228838940), + Common::RU_RUS, + Common::kPlatformWindows, + ADGF_DROPPLATFORM | ADGF_DROPLANGUAGE | GF_COMPRESSED, + GUIO1(GUIO_NOMIDI) }, // Red Comrades 2: For the Great Justice @@ -62,6 +72,18 @@ static const ADGameDescription gameDescriptions[] = { GUIO1(GUIO_NOMIDI) }, + // Red Comrades 2: For the Great Justice (CD) + { + "petka2", + "Compressed", + AD_ENTRY2s("main.str", "4e515669c343609518277cab6e7d8c8f", 18992879, + "data1.cab", "ac9ee2e481ee5a6389a6cd58faf5a358", 23287376), + Common::RU_RUS, + Common::kPlatformWindows, + ADGF_DROPPLATFORM | ADGF_DROPLANGUAGE | GF_COMPRESSED, + GUIO1(GUIO_NOMIDI) + }, + AD_TABLE_END_MARKER }; diff --git a/engines/petka/petka.cpp b/engines/petka/petka.cpp index 3569eea99ece..14a901aa2156 100644 --- a/engines/petka/petka.cpp +++ b/engines/petka/petka.cpp @@ -27,6 +27,7 @@ #include "common/formats/ini-file.h" #include "common/system.h" #include "common/file.h" +#include "common/compression/installshield_cab.h" #include "engines/advancedDetector.h" #include "engines/util.h" @@ -75,6 +76,12 @@ Common::Error PetkaEngine::run() { initGraphics(640, 480, &format); syncSoundSettings(); + if (_desc->flags & GF_COMPRESSED) { + Common::Archive *cabinet = Common::makeInstallShieldArchive("data"); + if (cabinet) + SearchMan.add("data1.cab", cabinet); + } + const char *const videos[] = {"buka.avi", "skif.avi", "adv.avi"}; for (uint i = 0; i < sizeof(videos) / sizeof(char *); ++i) { Common::ScopedPtr file(new Common::File); diff --git a/engines/petka/petka.h b/engines/petka/petka.h index 0dae7899223e..592e5e6c3032 100644 --- a/engines/petka/petka.h +++ b/engines/petka/petka.h @@ -76,6 +76,10 @@ enum { kPetkaDebugDialogs = 1 << 3 }; +enum { + GF_COMPRESSED = (1 << 0), +}; + class PetkaEngine : public Engine { public: PetkaEngine(OSystem *syst, const ADGameDescription *desc);