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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Aug 27 11:30:23 CEST 2007


Revision: 28753
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28753&view=rev
Author:   thebluegr
Date:     2007-08-27 02:30:23 -0700 (Mon, 27 Aug 2007)

Log Message:
-----------
IHNM's ending is shown correctly now (but the credits still aren't). Slight update on the music of chapter 6

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

Modified: scummvm/trunk/engines/saga/animation.cpp
===================================================================
--- scummvm/trunk/engines/saga/animation.cpp	2007-08-26 19:14:18 UTC (rev 28752)
+++ scummvm/trunk/engines/saga/animation.cpp	2007-08-27 09:30:23 UTC (rev 28753)
@@ -651,11 +651,12 @@
 
 	MemoryReadStream readS(anim->resourceData + frameOffset, anim->resourceLength - frameOffset);
 
-
+// FIXME: This is thrown when the first video of the IHNM end sequence is shown (the "turn off screen"
+// video), however the video is played correctly and the rest of the end sequence continues normally
 #if 1
 #define VALIDATE_WRITE_POINTER \
 	if ((writePointer < buf) || (writePointer >= (buf + screenWidth * screenHeight))) { \
-		error("VALIDATE_WRITE_POINTER: writePointer=%p buf=%p", (void *)writePointer, (void *)buf); \
+		warning("VALIDATE_WRITE_POINTER: writePointer=%p buf=%p", (void *)writePointer, (void *)buf); \
 	}
 #else
 #define VALIDATE_WRITE_POINTER

Modified: scummvm/trunk/engines/saga/rscfile.cpp
===================================================================
--- scummvm/trunk/engines/saga/rscfile.cpp	2007-08-26 19:14:18 UTC (rev 28752)
+++ scummvm/trunk/engines/saga/rscfile.cpp	2007-08-27 09:30:23 UTC (rev 28753)
@@ -610,7 +610,11 @@
 	if (file->read(resourceBuffer, resourceSize) != resourceSize) {
 		error("Resource::loadResource() failed to read");
 	}
-	if (resourceData->patchData != NULL)
+
+	// ITE uses several patch files which are loaded and then not needed
+	// anymore (as they're in memory), so close them here. IHNM uses only
+	// 1 patch file, which is reused, so don't close it
+	if (resourceData->patchData != NULL && _vm->getGameType() == GType_ITE)
 		file->close();
 }
 
@@ -744,6 +748,14 @@
 	_vm->_anim->loadCutawayList(resourcePointer, resourceLength);
 
 	if (_metaResource.songTableID > 0) {
+		// FIXME: HACK for chapter 6 (last chapter) of IHNM. For some reason, the songtable with songTableID
+		// 1028 can't be loaded properly, so it's substituted here with Gorrister's songtable (ID 116)
+		// The strange thing is that the song invoked when each character enters the final chapter is
+		// supposed to be different, but the song numbers called by sfPlayMusic/sfQueueMusic are the 
+		// same every time, which leads me to believe that a different meta resource is loaded depending
+		// on the character selected
+		if (_vm->getGameType() == GType_IHNM && _metaResource.songTableID == 1028)
+			_metaResource.songTableID = 116;
 		_vm->_resource->loadResource(resourceContext, _metaResource.songTableID, resourcePointer, resourceLength);
 
 		if (resourceLength == 0) {

Modified: scummvm/trunk/engines/saga/saveload.cpp
===================================================================
--- scummvm/trunk/engines/saga/saveload.cpp	2007-08-26 19:14:18 UTC (rev 28752)
+++ scummvm/trunk/engines/saga/saveload.cpp	2007-08-27 09:30:23 UTC (rev 28753)
@@ -273,18 +273,7 @@
 		if (_scene->currentChapterNumber() == 8)
 			_interface->setMode(kPanelChapterSelection);
 		if (getGameId() != GID_IHNM_DEMO) {
-			// HACK for chapter 6 (last chapter) in IHNM. For some reason, the songtable loaded is
-			// incorrect, and the game crashes here when trying to load a music track there. For now,
-			// just don't change the music track for chapter 6
-			// FIXME: Figure out what's wrong with the loaded music track and remove this hack
-			// Note that when this hack is removed, remove it from Script::sfPlayMusic and 
-			// Script::sfQueueMusic as well
-			if (getGameType() == GType_IHNM && _scene->currentChapterNumber() == 6) {
-				// do nothing
-			} else {
-				_music->play(_music->_songTable[_scene->getCurrentMusicTrack()], _scene->getCurrentMusicRepeat() ? MUSIC_LOOP : MUSIC_NORMAL);			
-			}
-			//_music->play(_music->_songTable[_scene->getCurrentMusicTrack()], _scene->getCurrentMusicRepeat() ? MUSIC_LOOP : MUSIC_NORMAL);			
+			_music->play(_music->_songTable[_scene->getCurrentMusicTrack()], _scene->getCurrentMusicRepeat() ? MUSIC_LOOP : MUSIC_NORMAL);			
 		} else {
 			_music->play(3, MUSIC_LOOP);
 		}

Modified: scummvm/trunk/engines/saga/sfuncs.cpp
===================================================================
--- scummvm/trunk/engines/saga/sfuncs.cpp	2007-08-26 19:14:18 UTC (rev 28752)
+++ scummvm/trunk/engines/saga/sfuncs.cpp	2007-08-27 09:30:23 UTC (rev 28753)
@@ -1676,14 +1676,6 @@
 			warning("sfPlayMusic: Wrong song number (%d > %d)", param1, _vm->_music->_songTableLen - 1);
 		} else {
 			_vm->_music->setVolume(_vm->_musicVolume == 10 ? -1 : _vm->_musicVolume * 25, 1);
-			// HACK for chapter 6 (last chapter) in IHNM. For some reason, the songtable loaded is
-			// incorrect, and the game crashes here when trying to load a music track there. For now,
-			// just don't change the music track for chapter 6
-			// FIXME: Figure out what's wrong with the loaded music track and remove this hack
-			// Note that when this hack is removed, remove it from SagaEngine::load and 
-			// Script::sfQueueMusic as well
-			if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 6)
-				return;
 			_vm->_music->play(_vm->_music->_songTable[param1], param2 ? MUSIC_LOOP : MUSIC_NORMAL);
 			if (!_vm->_scene->haveChapterPointsChanged()) {
 				_vm->_scene->setCurrentMusicTrack(param1);
@@ -2150,15 +2142,6 @@
 		return;
 	}
 
-	// HACK for chapter 6 (last chapter) in IHNM. For some reason, the songtable loaded is
-	// incorrect, and the game crashes here when trying to load a music track there. For now,
-	// just don't change the music track for chapter 6
-	// FIXME: Figure out what's wrong with the loaded music track and remove this hack
-	// Note that when this hack is removed, remove it from SagaEngine::load and 
-	// Script::sfPlayMusic as well
-	if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 6)
-		return;
-
 	if (param1 >= _vm->_music->_songTableLen) {
 		warning("sfQueueMusic: Wrong song number (%d > %d)", param1, _vm->_music->_songTableLen - 1);
 	} else {


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