[Scummvm-cvs-logs] CVS: scummvm/scumm script_v100he.cpp,2.128,2.129 script_v72he.cpp,2.264,2.265 script_v80he.cpp,2.96,2.97

kirben kirben at users.sourceforge.net
Mon Apr 18 04:20:52 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11536/scumm

Modified Files:
	script_v100he.cpp script_v72he.cpp script_v80he.cpp 
Log Message:

Sound size should only include sound data.


Index: script_v100he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v100he.cpp,v
retrieving revision 2.128
retrieving revision 2.129
diff -u -d -r2.128 -r2.129
--- script_v100he.cpp	18 Apr 2005 07:18:32 -0000	2.128
+++ script_v100he.cpp	18 Apr 2005 11:19:54 -0000	2.129
@@ -2191,6 +2191,7 @@
 }
 
 void ScummEngine_v100he::o100_getResourceSize() {
+	const byte *ptr;
 	int size, type;
 
 	int resid = pop();
@@ -2214,15 +2215,18 @@
 			int offs;
 			_sound->getHEMusicDetails(resid, offs, size);
 			push(size);
-			return;
+		} else {
+			ptr = getResourceAddress(rtSound, resid);
+			assert(ptr);
+			size = READ_BE_UINT32(ptr + 4) - 40;
+			push(size);
 		}
-		type = rtSound;
-		break;
+		return;
 	default:
 		error("o100_getResourceSize: default type %d", subOp);
 	}
 
-	const byte *ptr = getResourceAddress(type, resid);
+	ptr = getResourceAddress(type, resid);
 	assert(ptr);
 	size = READ_BE_UINT32(ptr + 4) - 8;
 	push(size);

Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.264
retrieving revision 2.265
diff -u -d -r2.264 -r2.265
--- script_v72he.cpp	18 Apr 2005 07:18:32 -0000	2.264
+++ script_v72he.cpp	18 Apr 2005 11:19:54 -0000	2.265
@@ -2163,13 +2163,12 @@
 		int offs;
 		_sound->getHEMusicDetails(resid, offs, size);
 		push(size);
-		return;
+	} else {
+		const byte *ptr = getResourceAddress(rtSound, resid);
+		assert(ptr);
+		size = READ_BE_UINT32(ptr + 4) - 40;
+		push(size);
 	}
-
-	const byte *ptr = getResourceAddress(rtSound, resid);
-	assert(ptr);
-	size = getResourceDataSize(ptr);
-	push(size);
 }
 
 void ScummEngine_v72he::o72_setFilePath() {

Index: script_v80he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v80he.cpp,v
retrieving revision 2.96
retrieving revision 2.97
diff -u -d -r2.96 -r2.97
--- script_v80he.cpp	18 Apr 2005 07:18:32 -0000	2.96
+++ script_v80he.cpp	18 Apr 2005 11:19:54 -0000	2.97
@@ -806,6 +806,7 @@
 }
 
 void ScummEngine_v80he::o80_getResourceSize() {
+	const byte *ptr;
 	int size, type;
 
 	int resid = pop();
@@ -817,10 +818,13 @@
 			int offs;
 			_sound->getHEMusicDetails(resid, offs, size);
 			push(size);
-			return;
+		} else {
+			ptr = getResourceAddress(rtSound, resid);
+			assert(ptr);
+			size = READ_BE_UINT32(ptr + 4) - 40;
+			push(size);
 		}
-		type = rtSound;
-		break;
+		return;
 	case 14:
 		type = rtRoomImage;
 		break;
@@ -837,14 +841,9 @@
 		error("o80_getResourceSize: default type %d", subOp);
 	}
 
-	const byte *ptr = getResourceAddress(type, resid);
-	if (ptr) {
-		size = getResourceDataSize(ptr);
-	} else {
-		debug(0, "o80_getResourceSize: invalid resource type %d id %d", type, resid);
-		size = 0;
-	}
-
+	ptr = getResourceAddress(type, resid);
+	assert(ptr);
+	size = READ_BE_UINT32(ptr + 4) - 8;
 	push(size);
 }
 





More information about the Scummvm-git-logs mailing list