[Scummvm-cvs-logs] SF.net SVN: scummvm:[46547] scummvm/trunk/engines/sci/sfx

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri Dec 25 14:13:42 CET 2009


Revision: 46547
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46547&view=rev
Author:   m_kiewitz
Date:     2009-12-25 13:13:42 +0000 (Fri, 25 Dec 2009)

Log Message:
-----------
SCI/newmusic: ignore vol selector for games prior sci1late, fixes amiga music in sq3

Modified Paths:
--------------
    scummvm/trunk/engines/sci/sfx/soundcmd.cpp
    scummvm/trunk/engines/sci/sfx/soundcmd.h

Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2009-12-25 11:08:12 UTC (rev 46546)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2009-12-25 13:13:42 UTC (rev 46547)
@@ -101,18 +101,21 @@
 		case SI_RELATIVE_CUE:
 			debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x received relative cue %d\n",
 			          PRINT_REG(obj), cue);
+			printf("rel-signal %04X\n", cue + 0x7f);
 			PUT_SEL32V(segMan, obj, signal, cue + 0x7f);
 			break;
 
 		case SI_ABSOLUTE_CUE:
 			debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x received absolute cue %d\n",
 			          PRINT_REG(obj), cue);
+			printf("abs-signal %04X\n", cue);
 			PUT_SEL32V(segMan, obj, signal, cue);
 			break;
 
 		case SI_FINISHED:
 			debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x finished\n",
 			          PRINT_REG(obj));
+			printf("signal 0xFFFF\n");
 			PUT_SEL32V(segMan, obj, signal, SIGNAL_OFFSET);
 			PUT_SEL32V(segMan, obj, state, kSndStatusStopped);
 			break;
@@ -125,8 +128,8 @@
 }
 
 #endif
-SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, AudioPlayer *audio, SciVersion doSoundVersion) : 
-	_resMan(resMan), _segMan(segMan), _audio(audio), _doSoundVersion(doSoundVersion) {
+SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segMan, AudioPlayer *audio, SciVersion soundVersion) : 
+	_resMan(resMan), _segMan(segMan), _audio(audio), _soundVersion(soundVersion) {
 
 #ifdef USE_OLD_MUSIC_FUNCTIONS
 	// The following hack is needed to ease the change from old to new sound code (because the new sound code does not use SfxState)
@@ -136,11 +139,11 @@
 	_hasNodePtr = (((SciEngine*)g_engine)->getKernel()->_selectorCache.nodePtr != -1);
 
 	#ifndef USE_OLD_MUSIC_FUNCTIONS
-		_music = new SciMusic(_doSoundVersion);
+		_music = new SciMusic(_soundVersion);
 		_music->init();
 	#endif
 
-	switch (doSoundVersion) {
+	switch (_soundVersion) {
 	case SCI_VERSION_0_EARLY:
 		SOUNDCOMMAND(cmdInitHandle);
 		SOUNDCOMMAND(cmdPlayHandle);
@@ -197,7 +200,7 @@
 		SOUNDCOMMAND(cmdUpdateHandle);
 		break;
 	default:
-		warning("Sound command parser: unknown DoSound type %d", doSoundVersion);
+		warning("Sound command parser: unknown sound version %d", _soundVersion);
 		break;
 	}
 }
@@ -280,7 +283,7 @@
 	newSound->soundRes = 0;
 	newSound->resnum = number;
 	if (number && _resMan->testResource(ResourceId(kResourceTypeSound, number)))
-		newSound->soundRes = new SoundResource(number, _resMan, _doSoundVersion);
+		newSound->soundRes = new SoundResource(number, _resMan, _soundVersion);
 	newSound->soundObj = obj;
 	newSound->loop = GET_SEL32V(_segMan, obj, loop) == 0xFFFF ? 1 : 0;
 	newSound->prio = GET_SEL32V(_segMan, obj, pri) & 0xFF;
@@ -409,7 +412,16 @@
 
 	_music->_playList[slot]->loop = GET_SEL32V(_segMan, obj, loop) == 0xFFFF ? 1 : 0;
 	_music->_playList[slot]->prio = GET_SEL32V(_segMan, obj, priority);
-	_music->_playList[slot]->volume = GET_SEL32V(_segMan, obj, vol);
+	// vol selector doesnt get used before sci1late
+	switch (_soundVersion) {
+	case SCI_VERSION_0_EARLY:
+	case SCI_VERSION_1_EARLY:
+		_music->_playList[slot]->volume = 100;
+		break;
+	case SCI_VERSION_1_LATE:
+		_music->_playList[slot]->volume = GET_SEL32V(_segMan, obj, vol);
+		break;
+	}
 	_music->soundPlay(_music->_playList[slot]);
 
 #endif

Modified: scummvm/trunk/engines/sci/sfx/soundcmd.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.h	2009-12-25 11:08:12 UTC (rev 46546)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.h	2009-12-25 13:13:42 UTC (rev 46547)
@@ -45,7 +45,7 @@
 
 class SoundCommandParser {
 public:
-	SoundCommandParser(ResourceManager *resMan, SegManager *segMan, AudioPlayer *audio, SciVersion doSoundVersion);
+	SoundCommandParser(ResourceManager *resMan, SegManager *segMan, AudioPlayer *audio, SciVersion soundVersion);
 	~SoundCommandParser();
 
 #ifdef USE_OLD_MUSIC_FUNCTIONS
@@ -64,7 +64,7 @@
 #endif
 	AudioPlayer *_audio;
 	bool _hasNodePtr;
-	SciVersion _doSoundVersion;
+	SciVersion _soundVersion;
 	int _argc;
 	reg_t *_argv;
 	reg_t _acc;


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