[Scummvm-cvs-logs] SF.net SVN: scummvm: [32461] scummvm/trunk/engines/drascula

sev at users.sourceforge.net sev at users.sourceforge.net
Sun Jun 1 13:44:45 CEST 2008


Revision: 32461
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32461&view=rev
Author:   sev
Date:     2008-06-01 04:44:45 -0700 (Sun, 01 Jun 2008)

Log Message:
-----------
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

Modified Paths:
--------------
    scummvm/trunk/engines/drascula/drascula.cpp
    scummvm/trunk/engines/drascula/drascula.h

Modified: scummvm/trunk/engines/drascula/drascula.cpp
===================================================================
--- scummvm/trunk/engines/drascula/drascula.cpp	2008-06-01 11:43:20 UTC (rev 32460)
+++ scummvm/trunk/engines/drascula/drascula.cpp	2008-06-01 11:44:45 UTC (rev 32461)
@@ -107,6 +107,8 @@
 		_lang = 0;
 	}
 
+	_arj.registerArchive("packet.001");
+
 	return 0;
 }
 
@@ -264,22 +266,21 @@
 	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 @@
 		}
 	}
 
-	file.read(cPal, 768);
-	file.close();
+	_arj.read(cPal, 768);
+	_arj.close();
 }
 
 void DrasculaEngine::decompressPic(byte *targetSurface, int colorCount) {

Modified: scummvm/trunk/engines/drascula/drascula.h
===================================================================
--- scummvm/trunk/engines/drascula/drascula.h	2008-06-01 11:43:20 UTC (rev 32460)
+++ scummvm/trunk/engines/drascula/drascula.h	2008-06-01 11:44:45 UTC (rev 32461)
@@ -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 @@
 
 	Common::File *ald, *sku;
 
+	Common::ArjFile _arj;
+
 	int hay_sb;
 	int nivel_osc, previousMusic, roomMusic;
 	int roomNumber;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list