diff options
author | Eugene Sandulenko | 2008-06-01 11:44:45 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2008-06-01 11:44:45 +0000 |
commit | e5be4847ac25bab8ad74aca1db298f321ec4f682 (patch) | |
tree | 10204a175466fa2631799c70e708d97cb994e055 | |
parent | cc74ec5c39a233c05ad9e8b3eba96649ceb8490b (diff) | |
download | scummvm-rg350-e5be4847ac25bab8ad74aca1db298f321ec4f682.tar.gz scummvm-rg350-e5be4847ac25bab8ad74aca1db298f321ec4f682.tar.bz2 scummvm-rg350-e5be4847ac25bab8ad74aca1db298f321ec4f682.zip |
WIP for hooking unarj in order to play unmodified files from CD.
Will break your game unless you put packet.001 into game directory.
Not everything has been hooked and files fallback and detection is not
yet implemented
svn-id: r32461
-rw-r--r-- | engines/drascula/drascula.cpp | 17 | ||||
-rw-r--r-- | engines/drascula/drascula.h | 3 |
2 files changed, 12 insertions, 8 deletions
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp index 7e041ce4c7..0b6b618487 100644 --- a/engines/drascula/drascula.cpp +++ b/engines/drascula/drascula.cpp @@ -107,6 +107,8 @@ int DrasculaEngine::init() { _lang = 0; } + _arj.registerArchive("packet.001"); + return 0; } @@ -264,22 +266,21 @@ void DrasculaEngine::loadPic(const char *NamePcc) { unsigned int con, x = 0; unsigned int fExit = 0; byte ch, rep; - Common::File file; byte *auxPun; - file.open(NamePcc); - if (!file.isOpen()) + _arj.open(NamePcc); + if (!_arj.isOpen()) error("missing game data %s %c", NamePcc, 7); pcxBuffer = (byte *)malloc(65000); auxPun = pcxBuffer; - file.seek(128); + _arj.seek(128); while (!fExit) { - ch = file.readByte(); + ch = _arj.readByte(); rep = 1; if ((ch & 192) == 192) { rep = (ch & 63); - ch = file.readByte(); + ch = _arj.readByte(); } for (con = 0; con < rep; con++) { *auxPun++ = ch; @@ -289,8 +290,8 @@ void DrasculaEngine::loadPic(const char *NamePcc) { } } - file.read(cPal, 768); - file.close(); + _arj.read(cPal, 768); + _arj.close(); } void DrasculaEngine::decompressPic(byte *targetSurface, int colorCount) { diff --git a/engines/drascula/drascula.h b/engines/drascula/drascula.h index 2ddc006e71..4e8a43c6dc 100644 --- a/engines/drascula/drascula.h +++ b/engines/drascula/drascula.h @@ -35,6 +35,7 @@ #include "common/hash-str.h" #include "common/events.h" #include "common/keyboard.h" +#include "common/unarj.h" #include "sound/audiostream.h" #include "sound/mixer.h" @@ -230,6 +231,8 @@ public: Common::File *ald, *sku; + Common::ArjFile _arj; + int hay_sb; int nivel_osc, previousMusic, roomMusic; int roomNumber; |