Skip to content

Commit

Permalink
PETKA: Add support for compressed Red Comrades 1-2 (#4581)
Browse files Browse the repository at this point in the history
PETKA: Add support for compressed Red Comrades 1-2
  • Loading branch information
tag2015 committed Jan 1, 2023
1 parent 91965e6 commit d8aca21
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
24 changes: 23 additions & 1 deletion engines/petka/detection_tables.h
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
};

Expand Down
7 changes: 7 additions & 0 deletions engines/petka/petka.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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<Common::File> file(new Common::File);
Expand Down
4 changes: 4 additions & 0 deletions engines/petka/petka.h
Expand Up @@ -76,6 +76,10 @@ enum {
kPetkaDebugDialogs = 1 << 3
};

enum {
GF_COMPRESSED = (1 << 0),
};

class PetkaEngine : public Engine {
public:
PetkaEngine(OSystem *syst, const ADGameDescription *desc);
Expand Down

0 comments on commit d8aca21

Please sign in to comment.