[Scummvm-cvs-logs] SF.net SVN: scummvm:[45985] scummvm/trunk/engines/sci/sfx/soundcmd.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Thu Nov 19 09:56:05 CET 2009
Revision: 45985
http://scummvm.svn.sourceforge.net/scummvm/?rev=45985&view=rev
Author: thebluegr
Date: 2009-11-19 08:56:05 +0000 (Thu, 19 Nov 2009)
Log Message:
-----------
Fixed regression from commit #45862
Modified Paths:
--------------
scummvm/trunk/engines/sci/sfx/soundcmd.cpp
Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2009-11-18 23:36:12 UTC (rev 45984)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp 2009-11-19 08:56:05 UTC (rev 45985)
@@ -219,7 +219,7 @@
}
if (command < _soundCommands.size()) {
- printf("%s\n", _soundCommands[command]->desc);
+ // printf("%s\n", _soundCommands[command]->desc); // debug
debugC(2, kDebugLevelSound, "%s", _soundCommands[command]->desc);
(this->*(_soundCommands[command]->sndCmd))(obj, handle, value);
} else {
@@ -230,12 +230,15 @@
}
void SoundCommandParser::cmdInitHandle(reg_t obj, SongHandle handle, int value) {
- if (!obj.segment)
- return;
+#ifdef USE_OLD_MUSIC_FUNCTIONS
-#ifdef USE_OLD_MUSIC_FUNCTIONS
+ if (_doSoundVersion != SCI_VERSION_1_LATE) {
+ if (!obj.segment)
+ return;
+ }
+
SongIteratorType type = (_doSoundVersion == SCI_VERSION_0_EARLY) ? SCI_SONG_ITERATOR_TYPE_SCI0 : SCI_SONG_ITERATOR_TYPE_SCI1;
- int number = GET_SEL32V(_segMan, obj, number);
+ int number = obj.segment ? GET_SEL32V(_segMan, obj, number) : -1;
if (_hasNodePtr) {
if (GET_SEL32V(_segMan, obj, nodePtr)) {
@@ -246,7 +249,7 @@
// Some games try to init non-existing sounds (e.g. KQ6)
if (_doSoundVersion == SCI_VERSION_1_LATE) {
- if (!_resMan->testResource(ResourceId(kResourceTypeSound, value)))
+ if (!obj.segment || !_resMan->testResource(ResourceId(kResourceTypeSound, number)))
return;
}
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