[Scummvm-cvs-logs] CVS: scummvm/queen resource.h,1.4,1.5 resource.cpp,1.4,1.5 logic.cpp,1.9,1.10

David Eriksson twogood at users.sourceforge.net
Thu Oct 2 07:56:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv22854

Modified Files:
	resource.h resource.cpp logic.cpp 
Log Message:
Handle _sfxName table properly

Index: resource.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/resource.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- resource.h	29 Sep 2003 23:03:54 -0000	1.4
+++ resource.h	2 Oct 2003 14:55:28 -0000	1.5
@@ -47,6 +47,7 @@
 	~QueenResource(void);
 	uint8 *loadFile(const char *filename, uint32 skipBytes = 0);
 	bool exists(const char *filename);
+	bool isDemo();
 
 protected:
 	File *_resourceFile;

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/resource.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- resource.cpp	29 Sep 2003 22:27:08 -0000	1.4
+++ resource.cpp	2 Oct 2003 14:55:28 -0000	1.5
@@ -138,3 +138,7 @@
 	return versionStr;
 }
 
+bool QueenResource::isDemo() {
+	return _gameVersion->isDemo;
+}
+

Index: logic.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/logic.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- logic.cpp	2 Oct 2003 14:44:50 -0000	1.9
+++ logic.cpp	2 Oct 2003 14:55:28 -0000	1.10
@@ -102,13 +102,18 @@
 	_roomData[_numRooms + 1] = _numObjects;
 
 	//SFX Name
-	// FIXME: the following table isn't available in demo version
-	_sfxName = new uint16[_numRooms + 1];
+	// the following table isn't available in demo version
+	if (_resource->isDemo()) {
+		_sfxName = NULL;
+	}
+	else {
+		_sfxName = new uint16[_numRooms + 1];
 
-	for (i = 0; i < (_numRooms + 1); i++) {
-		_sfxName[i] = READ_BE_UINT16(ptr);
-		ptr += 2;
-	}	
+		for (i = 0; i < (_numRooms + 1); i++) {
+			_sfxName[i] = READ_BE_UINT16(ptr);
+			ptr += 2;
+		}	
+	}
 
 	//Item information
 	_numItems = READ_BE_UINT16(ptr);





More information about the Scummvm-git-logs mailing list