From e5be4847ac25bab8ad74aca1db298f321ec4f682 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 1 Jun 2008 11:44:45 +0000 Subject: 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 --- engines/drascula/drascula.cpp | 17 +++++++++-------- engines/drascula/drascula.h | 3 +++ 2 files changed, 12 insertions(+), 8 deletions(-) (limited to 'engines') 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; -- cgit v1.2.3