[Scummvm-cvs-logs] CVS: scummvm/scumm/imuse_digi dimuse_bndmgr.cpp,1.14,1.14.2.1 dimuse_bndmgr.h,1.5,1.5.2.1

Pawel Kolodziejski aquadran at users.sourceforge.net
Sat Mar 13 09:40:03 CET 2004


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

Modified Files:
      Tag: branch-0-6-0
	dimuse_bndmgr.cpp dimuse_bndmgr.h 
Log Message:
fix for voice bundle bug in german version comi

Index: dimuse_bndmgr.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse_bndmgr.cpp,v
retrieving revision 1.14
retrieving revision 1.14.2.1
diff -u -d -r1.14 -r1.14.2.1
--- dimuse_bndmgr.cpp	14 Jan 2004 21:46:58 -0000	1.14
+++ dimuse_bndmgr.cpp	13 Mar 2004 17:31:02 -0000	1.14.2.1
@@ -117,6 +117,7 @@
 	_bundleTable = NULL;
 	_compTable = NULL;
 	_numFiles = 0;
+	_numCompItems = 0;
 	_curSample = -1;
 	_fileBundleId = -1;
 }
@@ -150,6 +151,7 @@
 		_file.close();
 		_bundleTable = NULL;
 		_numFiles = 0;
+		_numCompItems = 0;
 		_compTableLoaded = false;
 		_lastBlock = -1;
 		_lastCacheOutputSize = 0;
@@ -179,7 +181,7 @@
 	if (!_compTableLoaded) {
 		_file.seek(_bundleTable[index].offset, SEEK_SET);
 		tag = _file.readUint32BE();
-		num = _file.readUint32BE();
+		_numCompItems = num = _file.readUint32BE();
 		_file.readUint32BE();
 		_file.readUint32BE();
 
@@ -201,6 +203,10 @@
 	first_block = (offset + header_size) / 0x2000;
 	last_block = (offset + size + header_size - 1) / 0x2000;
 
+	// workaround for bug when (offset + size + header_size - 1) is more one byte after sound resource
+	if ((last_block >= _numCompItems) && (_numCompItems > 0))
+		last_block = _numCompItems - 1;
+
 	comp_output = (byte *)malloc(0x2000);
 	int32 blocks_final_size = 0x2000 * (1 + last_block - first_block);
 	*comp_final = (byte *)malloc(blocks_final_size);

Index: dimuse_bndmgr.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse_bndmgr.h,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- dimuse_bndmgr.h	9 Jan 2004 13:16:06 -0000	1.5
+++ dimuse_bndmgr.h	13 Mar 2004 17:31:02 -0000	1.5.2.1
@@ -64,6 +64,7 @@
 	BundleDirCache::AudioTable *_bundleTable;
 	CompTable *_compTable;
 	int32 _numFiles;
+	int32 _numCompItems;
 	int32 _curSample;
 	File _file;
 	bool _compTableLoaded;





More information about the Scummvm-git-logs mailing list