diff options
| -rw-r--r-- | engines/saga/animation.cpp | 5 | ||||
| -rw-r--r-- | engines/saga/rscfile.cpp | 14 | ||||
| -rw-r--r-- | engines/saga/saveload.cpp | 13 | ||||
| -rw-r--r-- | engines/saga/sfuncs.cpp | 17 | 
4 files changed, 17 insertions, 32 deletions
| diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp index b01f0b9492..4a4ad404ce 100644 --- a/engines/saga/animation.cpp +++ b/engines/saga/animation.cpp @@ -651,11 +651,12 @@ void Anim::decodeFrame(AnimationData *anim, size_t frameOffset, byte *buf, size_  	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 diff --git a/engines/saga/rscfile.cpp b/engines/saga/rscfile.cpp index bfc506b474..74b0406982 100644 --- a/engines/saga/rscfile.cpp +++ b/engines/saga/rscfile.cpp @@ -610,7 +610,11 @@ void Resource::loadResource(ResourceContext *context, uint32 resourceId, byte*&r  	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 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) {  	_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) { diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp index 3179095705..96242d497a 100644 --- a/engines/saga/saveload.cpp +++ b/engines/saga/saveload.cpp @@ -273,18 +273,7 @@ void SagaEngine::load(const char *fileName) {  		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);  		} diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp index 6ab643e03b..01b54e7aaf 100644 --- a/engines/saga/sfuncs.cpp +++ b/engines/saga/sfuncs.cpp @@ -1676,14 +1676,6 @@ void Script::sfPlayMusic(SCRIPTFUNC_PARAMS) {  			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 @@ void Script::sfQueueMusic(SCRIPTFUNC_PARAMS) {  		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 { | 
