[Scummvm-cvs-logs] SF.net SVN: scummvm: [31424] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Sun Apr 6 15:57:29 CEST 2008


Revision: 31424
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31424&view=rev
Author:   lordhoto
Date:     2008-04-06 06:57:28 -0700 (Sun, 06 Apr 2008)

Log Message:
-----------
Implemented fadeout waiting in KyraEngine_v2::enterNewScene for AdLib.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/scene_v2.cpp
    scummvm/trunk/engines/kyra/sound.h
    scummvm/trunk/engines/kyra/sound_adlib.cpp

Modified: scummvm/trunk/engines/kyra/scene_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_v2.cpp	2008-04-06 13:32:41 UTC (rev 31423)
+++ scummvm/trunk/engines/kyra/scene_v2.cpp	2008-04-06 13:57:28 UTC (rev 31424)
@@ -115,7 +115,7 @@
 
 	if (newSoundFile) {
 		if (_sound->getMusicType() == Sound::kAdlib) {
-			while (0/*snd_isPlaying()*/)
+			while (((SoundAdlibPC*)_sound)->isPlaying())
 				_system->delayMillis(10);
 		} else {
 			while (waitTime > _system->getMillis())

Modified: scummvm/trunk/engines/kyra/sound.h
===================================================================
--- scummvm/trunk/engines/kyra/sound.h	2008-04-06 13:32:41 UTC (rev 31423)
+++ scummvm/trunk/engines/kyra/sound.h	2008-04-06 13:57:28 UTC (rev 31424)
@@ -240,6 +240,7 @@
 
 	void playTrack(uint8 track);
 	void haltTrack();
+	bool isPlaying();
 
 	void playSoundEffect(uint8 track);
 

Modified: scummvm/trunk/engines/kyra/sound_adlib.cpp
===================================================================
--- scummvm/trunk/engines/kyra/sound_adlib.cpp	2008-04-06 13:32:41 UTC (rev 31423)
+++ scummvm/trunk/engines/kyra/sound_adlib.cpp	2008-04-06 13:57:28 UTC (rev 31424)
@@ -112,7 +112,7 @@
 	int snd_setSoundData(va_list &list);
 	int snd_unkOpcode1(va_list &list);
 	int snd_startSong(va_list &list);
-	int snd_unkOpcode2(va_list &list);
+	int snd_isChannelPlaying(va_list &list);
 	int snd_unkOpcode3(va_list &list);
 	int snd_readByte(va_list &list);
 	int snd_writeByte(va_list &list);
@@ -543,8 +543,10 @@
 	return 0;
 }
 
-int AdlibDriver::snd_unkOpcode2(va_list &list) {
-	warning("unimplemented snd_unkOpcode2");
+int AdlibDriver::snd_isChannelPlaying(va_list &list) {
+	int channel = va_arg(list, int);
+	if (_channels[channel].dataptr)
+		return 1;
 	return 0;
 }
 
@@ -1888,7 +1890,7 @@
 		COMMAND(snd_setSoundData),
 		COMMAND(snd_unkOpcode1),
 		COMMAND(snd_startSong),
-		COMMAND(snd_unkOpcode2),
+		COMMAND(snd_isChannelPlaying),
 		COMMAND(snd_unkOpcode3),
 		COMMAND(snd_readByte),
 		COMMAND(snd_writeByte),
@@ -2274,6 +2276,10 @@
 	//_vm->_system->delayMillis(3 * 60);
 }
 
+bool SoundAdlibPC::isPlaying() {
+	return _driver->callback(7, int(0));
+}
+
 void SoundAdlibPC::playSoundEffect(uint8 track) {
 	if (_sfxEnabled)
 		play(track);


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