diff options
author | Matthew Hoops | 2012-05-28 16:56:31 -0400 |
---|---|---|
committer | Matthew Hoops | 2012-05-28 16:56:31 -0400 |
commit | 6e104f0883eaf060e66dadc07cf546b5f1dee1b7 (patch) | |
tree | 98a537ab1d6feb45a6bc2bc6c3c2b4e8980cd4af /engines | |
parent | ab45e72e67c7effae9a9fecbaf5a77f9427d8df4 (diff) | |
download | scummvm-rg350-6e104f0883eaf060e66dadc07cf546b5f1dee1b7.tar.gz scummvm-rg350-6e104f0883eaf060e66dadc07cf546b5f1dee1b7.tar.bz2 scummvm-rg350-6e104f0883eaf060e66dadc07cf546b5f1dee1b7.zip |
TONY: Add support for using the compressed version of the demo
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tony/detection.cpp | 9 | ||||
-rw-r--r-- | engines/tony/detection_tables.h | 17 | ||||
-rw-r--r-- | engines/tony/tony.cpp | 13 | ||||
-rw-r--r-- | engines/tony/tony.h | 1 |
4 files changed, 39 insertions, 1 deletions
diff --git a/engines/tony/detection.cpp b/engines/tony/detection.cpp index a87dd9bd07..1de1b70968 100644 --- a/engines/tony/detection.cpp +++ b/engines/tony/detection.cpp @@ -32,9 +32,12 @@ #include "tony/tony.h" #include "tony/game.h" - namespace Tony { +enum { + GF_COMPRESSED = (1 << 0) +}; + struct TonyGameDescription { ADGameDescription desc; }; @@ -51,8 +54,12 @@ bool TonyEngine::getIsDemo() const { return _gameDescription->desc.flags & ADGF_DEMO; } +bool TonyEngine::isCompressed() const { + return _gameDescription->desc.flags & GF_COMPRESSED; } +} // End of namespace Tony + static const PlainGameDescriptor tonyGames[] = { {"tony", "Tony Tough and the Night of Roasted Moths"}, {0, 0} diff --git a/engines/tony/detection_tables.h b/engines/tony/detection_tables.h index afcf787ca1..3510178474 100644 --- a/engines/tony/detection_tables.h +++ b/engines/tony/detection_tables.h @@ -41,6 +41,23 @@ static const TonyGameDescription gameDescriptions[] = { }, }, + { + // Tony Tough English Demo (Compressed) + { + "tony", + "Demo", + AD_ENTRY1s("data1.cab", "7d8b6d308f96aee3968ad7910fb11e6d", 58660608), + Common::EN_ANY, + Common::kPlatformPC, +#ifdef TEMPORARY_DISABLED + ADGF_DEMO | GF_COMPRESSED, +#else + ADGF_NO_FLAGS | GF_COMPRESSED, +#endif + GUIO1(GUIO_NONE) + }, + }, + { AD_TABLE_END_MARKER } }; diff --git a/engines/tony/tony.cpp b/engines/tony/tony.cpp index e5c30ffcec..da63c23bab 100644 --- a/engines/tony/tony.cpp +++ b/engines/tony/tony.cpp @@ -26,6 +26,7 @@ #include "common/debug-channels.h" #include "common/events.h" #include "common/file.h" +#include "common/installshield_cab.h" #include "tony/tony.h" #include "tony/custom.h" #include "tony/debugger.h" @@ -84,6 +85,18 @@ Common::Error TonyEngine::run() { * Initialise the game */ Common::ErrorCode TonyEngine::Init() { + if (isCompressed()) { + Common::SeekableReadStream *stream = SearchMan.createReadStreamForMember("data1.cab"); + if (!stream) + error("Failed to open data1.cab"); + + Common::Archive *cabinet = Common::makeInstallShieldArchive(stream); + if (!cabinet) + error("Failed to parse data1.cab"); + + SearchMan.add("data1.cab", cabinet); + } + m_hEndOfFrame = CoroScheduler.createEvent(false, false); m_bPaused = false; diff --git a/engines/tony/tony.h b/engines/tony/tony.h index f4d9d83674..78e9abd476 100644 --- a/engines/tony/tony.h +++ b/engines/tony/tony.h @@ -143,6 +143,7 @@ public: Common::Language getLanguage() const; uint16 getVersion() const; bool getIsDemo() const; + bool isCompressed() const; RMGfxEngine *GetEngine() { return &_theEngine; } |