[Scummvm-cvs-logs] CVS: scummex scummex.cpp,1.26,1.27

Adrien Mercier yoshizf at users.sourceforge.net
Mon Sep 29 03:21:03 CEST 2003


Update of /cvsroot/scummvm/scummex
In directory sc8-pr-cvs1:/tmp/cvs-serv21346

Modified Files:
	scummex.cpp 
Log Message:
Look for any known block at the beginning of the file

Index: scummex.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/scummex.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- scummex.cpp	27 Sep 2003 14:56:11 -0000	1.26
+++ scummex.cpp	29 Sep 2003 09:21:13 -0000	1.27
@@ -42,7 +42,7 @@
 }
 
 void ScummEX::loadFile(const char *filename) {
-	uint32 tag;
+	char tag[5];
 	_encbyte = 0;
 	char buf[256];
 	_scummVersion = 0;
@@ -61,32 +61,19 @@
 		_encbyte = encBytesTable[i];
 		_input.open(filename, 1, _encbyte);
 
-		tag = 0;
 		_input.read(&tag, 4);
-		switch (tag) {
-			case MKID('LB83'):
-			case MKID('LABN'):
-			case MKID('RNAM'):
-			case MKID('LECF'):
-			case MKID('ANIM'):
-			case MKID('SOU '):
-				_input.seek(0, SEEK_SET);
-				_resource->searchBlocks(_blockTable, _input);
-				return;
-
+		if (_resource->getBlockType(tag) != -1) {
+			_input.seek(0, SEEK_SET);
+			_resource->searchBlocks(_blockTable, _input);
+			return;
 		}
 
-		tag = 0;
-		_input.read(&tag, 2);
-		switch(tag) {
-			case 21040: // OR
-			case 20306: // RO
-			case 20050: // RN
-			case 17740: // LE
-				_input.seek(0, SEEK_SET);
-				_resource->searchOldBlocks(_blockTable, _input);
-				return;
 
+		_input.read(&tag, 2);
+		if (_resource->getOldBlockType(tag) != -1) {
+			_input.seek(0, SEEK_SET);
+			_resource->searchOldBlocks(_blockTable, _input);
+			return;
 		}
 	
 		_input.close();





More information about the Scummvm-git-logs mailing list