[Scummvm-cvs-logs] SF.net SVN: scummvm: [28245] scummvm/trunk/engines/saga/rscfile.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Jul 27 20:36:51 CEST 2007


Revision: 28245
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28245&view=rev
Author:   thebluegr
Date:     2007-07-27 11:36:50 -0700 (Fri, 27 Jul 2007)

Log Message:
-----------
Do not try to load music if the music resource id is 0. Also, the voice LUT resource ID and the voice bank are now set correctly for the IHNM demo. 
The IHNM demo starts now, showing some scenes, but the main panel is not loaded correctly, the status line is shown incorrectly and the demo crashes after a cutaway is shown

Modified Paths:
--------------
    scummvm/trunk/engines/saga/rscfile.cpp

Modified: scummvm/trunk/engines/saga/rscfile.cpp
===================================================================
--- scummvm/trunk/engines/saga/rscfile.cpp	2007-07-27 18:32:00 UTC (rev 28244)
+++ scummvm/trunk/engines/saga/rscfile.cpp	2007-07-27 18:36:50 UTC (rev 28245)
@@ -683,22 +683,24 @@
 
 	_vm->_anim->loadCutawayList(resourcePointer, resourceLength);
 
-	_vm->_resource->loadResource(resourceContext, _metaResource.songTableID, resourcePointer, resourceLength);
+	if (_metaResource.songTableID > 0) {
+		_vm->_resource->loadResource(resourceContext, _metaResource.songTableID, resourcePointer, resourceLength);
 
-	if (resourceLength == 0) {
-		error("Resource::loadGlobalResources Can't load songs list for current track");
-	}
+		if (resourceLength == 0) {
+			error("Resource::loadGlobalResources Can't load songs list for current track");
+		}
 
-	free(_vm->_music->_songTable);
-	
-	_vm->_music->_songTableLen = resourceLength / 4;
-	_vm->_music->_songTable = (int32 *)malloc(sizeof(int32) * _vm->_music->_songTableLen);
+		free(_vm->_music->_songTable);
+		
+		_vm->_music->_songTableLen = resourceLength / 4;
+		_vm->_music->_songTable = (int32 *)malloc(sizeof(int32) * _vm->_music->_songTableLen);
 
-	MemoryReadStream songS(resourcePointer, resourceLength);
+		MemoryReadStream songS(resourcePointer, resourceLength);
 
-	for (i = 0; i < _vm->_music->_songTableLen; i++)
-		_vm->_music->_songTable[i] = songS.readSint32LE();
-	free(resourcePointer);
+		for (i = 0; i < _vm->_music->_songTableLen; i++)
+			_vm->_music->_songTable[i] = songS.readSint32LE();
+		free(resourcePointer);
+	}
 
 	int voiceLUTResourceID = 0;
 
@@ -730,6 +732,9 @@
 		voiceLUTResourceID = 28;
 		break;
 	case 7:
+		// IHNM demo
+		_vm->_sndRes->setVoiceBank(0);
+		voiceLUTResourceID = 17;
 		break;
 	case 8:
 		_vm->_sndRes->setVoiceBank(0);


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