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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Mon Dec 28 21:58:06 CET 2009


Revision: 46685
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46685&view=rev
Author:   fingolfin
Date:     2009-12-28 20:58:00 +0000 (Mon, 28 Dec 2009)

Log Message:
-----------
SCI: Make some code comply to our naming conventions

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

Modified: scummvm/trunk/engines/sci/sfx/midiparser.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/midiparser.cpp	2009-12-28 20:18:51 UTC (rev 46684)
+++ scummvm/trunk/engines/sci/sfx/midiparser.cpp	2009-12-28 20:58:00 UTC (rev 46685)
@@ -204,10 +204,10 @@
 					jumpToTick(_loopTick);
 					_pSnd->loop--;
 				} else {
-					_pSnd->status = kSndStatusStopped;
+					_pSnd->status = kSoundStopped;
 					PUT_SEL32V(segMan, _pSnd->soundObj, signal, 0xFFFF);
 					if (_soundVersion <= SCI_VERSION_0_LATE)
-						PUT_SEL32V(segMan, _pSnd->soundObj, state, kSndStatusStopped);
+						PUT_SEL32V(segMan, _pSnd->soundObj, state, kSoundStopped);
 					debugC(2, kDebugLevelSound, "signal EOT");
 				}
 			}

Modified: scummvm/trunk/engines/sci/sfx/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.cpp	2009-12-28 20:18:51 UTC (rev 46684)
+++ scummvm/trunk/engines/sci/sfx/music.cpp	2009-12-28 20:58:00 UTC (rev 46685)
@@ -138,7 +138,7 @@
 	
 	for (uint32 i = 0; i < _playList.size(); i++) {
 		if (_soundVersion <= SCI_VERSION_0_LATE)
-			PUT_SEL32V(segMan, _playList[i]->soundObj, state, kSndStatusStopped);
+			PUT_SEL32V(segMan, _playList[i]->soundObj, state, kSoundStopped);
 		else
 			PUT_SEL32V(segMan, _playList[i]->soundObj, signal, SIGNAL_OFFSET);
 
@@ -353,7 +353,7 @@
 
 	uint sz = _playList.size();
 	for (uint i = 0; i < sz; i++) {
-		if (_playList[i]->status != kSndStatusPlaying)
+		if (_playList[i]->status != kSoundPlaying)
 			continue;
 		if (_playList[i]->pMidiParser) {
 			if (_playList[i]->fadeStep)
@@ -363,14 +363,14 @@
 		} else if (_playList[i]->pStreamAud) {
 			if (!_pMixer->isSoundHandleActive(_playList[i]->hCurrentAud)) {
 				_playList[i]->ticker = 0xFFFF;
-				_playList[i]->status = kSndStatusStopped;
+				_playList[i]->status = kSoundStopped;
 
 				// Signal the engine scripts that the sound is done playing
 				// FIXME: is there any other place this can be triggered properly?
 				SegManager *segMan = ((SciEngine *)g_engine)->getEngineState()->_segMan;	// HACK
 				PUT_SEL32V(segMan, _playList[i]->soundObj, signal, SIGNAL_OFFSET);
 				if (_soundVersion <= SCI_VERSION_0_LATE)
-					PUT_SEL32V(segMan, _playList[i]->soundObj, state, kSndStatusStopped);
+					PUT_SEL32V(segMan, _playList[i]->soundObj, state, kSoundStopped);
 			} else {
 				_playList[i]->ticker = (uint16)(_pMixer->getSoundElapsedTime(
 						_playList[i]->hCurrentAud) * 0.06);
@@ -412,15 +412,15 @@
 				pSnd->pStreamAud, -1, pSnd->volume, 0, false);
 	} else if (pSnd->pMidiParser) {
 		pSnd->pMidiParser->setVolume(pSnd->volume);
-		if (pSnd->status == kSndStatusStopped)
+		if (pSnd->status == kSoundStopped)
 			pSnd->pMidiParser->jumpToTick(0);
 	}
 
-	pSnd->status = kSndStatusPlaying;
+	pSnd->status = kSoundPlaying;
 }
 //---------------------------------------------
 void SciMusic::soundStop(MusicEntry *pSnd) {
-	pSnd->status = kSndStatusStopped;
+	pSnd->status = kSoundStopped;
 	if (pSnd->pStreamAud)
 		_pMixer->stopHandle(pSnd->hCurrentAud);
 	if (pSnd->pMidiParser)
@@ -440,7 +440,7 @@
 }
 //---------------------------------------------
 void SciMusic::soundKill(MusicEntry *pSnd) {
-	pSnd->status = kSndStatusStopped;
+	pSnd->status = kSoundStopped;
 
 	if (pSnd->pMidiParser) {
 		pSnd->pMidiParser->unloadMusic();
@@ -465,7 +465,7 @@
 }
 //---------------------------------------------
 void SciMusic::soundPause(MusicEntry *pSnd) {
-	pSnd->status = kSndStatusPaused;
+	pSnd->status = kSoundPaused;
 	if (pSnd->pStreamAud)
 		_pMixer->pauseHandle(pSnd->hCurrentAud, true);
 	else if (pSnd->pMidiParser)

Modified: scummvm/trunk/engines/sci/sfx/music.h
===================================================================
--- scummvm/trunk/engines/sci/sfx/music.h	2009-12-28 20:18:51 UTC (rev 46684)
+++ scummvm/trunk/engines/sci/sfx/music.h	2009-12-28 20:58:00 UTC (rev 46685)
@@ -41,10 +41,7 @@
 
 namespace Sci {
 
-typedef uint16 SCIHANDLE;
-typedef uint16 HEAPHANDLE;
-
-enum kTrackType {
+enum TrackType {
 	kTrackAdlib = 0,
 	kTrackGameBlaster = 9,
 	kTrackMT32 = 12,
@@ -52,11 +49,11 @@
 	kTrackTandy = 19
 };
 
-enum kSndStatus {
-	kSndStatusStopped = 0,
-	kSndStatusInitialized = 1,
-	kSndStatusPaused = 2,
-	kSndStatusPlaying = 3
+enum SoundStatus {
+	kSoundStopped = 0,
+	kSoundInitialized = 1,
+	kSoundPaused = 2,
+	kSoundPlaying = 3
 };
 
 class MidiParser_SCI;
@@ -81,7 +78,7 @@
 	MidiParser_SCI *pMidiParser;
 	Audio::AudioStream* pStreamAud;
 	Audio::SoundHandle hCurrentAud;
-	kSndStatus status;
+	SoundStatus status;
 };
 
 typedef Common::Array<MusicEntry *> MusicList;

Modified: scummvm/trunk/engines/sci/sfx/soundcmd.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2009-12-28 20:18:51 UTC (rev 46684)
+++ scummvm/trunk/engines/sci/sfx/soundcmd.cpp	2009-12-28 20:58:00 UTC (rev 46685)
@@ -114,7 +114,7 @@
 			debugC(2, kDebugLevelSound, "[process-sound] Song %04x:%04x finished\n",
 			          PRINT_REG(obj));
 			PUT_SEL32V(segMan, obj, signal, SIGNAL_OFFSET);
-			PUT_SEL32V(segMan, obj, state, kSndStatusStopped);
+			PUT_SEL32V(segMan, obj, state, kSoundStopped);
 			break;
 
 		default:
@@ -275,7 +275,7 @@
 #endif
 
 	if (_soundVersion <= SCI_VERSION_0_LATE)
-		PUT_SEL32V(_segMan, obj, state, kSndStatusInitialized);
+		PUT_SEL32V(_segMan, obj, state, kSoundInitialized);
 	else
 		PUT_SEL32(_segMan, obj, nodePtr, obj);
 
@@ -299,7 +299,7 @@
 	newSound->fadeStep = 0;
 	newSound->fadeTicker = 0;
 	newSound->fadeTickerStep = 0;
-	newSound->status = kSndStatusStopped;
+	newSound->status = kSoundStopped;
 
 	// Check if a track with the same sound object is already playing
 	MusicEntry *oldSound = _music->getSlot(obj);
@@ -335,7 +335,7 @@
 	if (_soundVersion <= SCI_VERSION_0_LATE) {
 		_state->sfx_song_set_status(handle, SOUND_STATUS_PLAYING);
 		_state->sfx_song_set_loops(handle, GET_SEL32V(_segMan, obj, loop));
-		PUT_SEL32V(_segMan, obj, state, kSndStatusPlaying);
+		PUT_SEL32V(_segMan, obj, state, kSoundPlaying);
 	} else if (_soundVersion == SCI_VERSION_1_EARLY) {
 		_state->sfx_song_set_status(handle, SOUND_STATUS_PLAYING);
 		_state->sfx_song_set_loops(handle, GET_SEL32V(_segMan, obj, loop));
@@ -418,7 +418,7 @@
 		PUT_SEL32V(_segMan, obj, frame, 0);
 		PUT_SEL32V(_segMan, obj, signal, 0);
 	} else {
-		PUT_SEL32V(_segMan, obj, state, kSndStatusPlaying);
+		PUT_SEL32V(_segMan, obj, state, kSoundPlaying);
 	}
 
 	musicSlot->loop = GET_SEL32V(_segMan, obj, loop) == 0xFFFF ? 1 : 0;
@@ -478,7 +478,7 @@
 	if (_soundVersion >= SCI_VERSION_1_EARLY)
 		PUT_SEL32(_segMan, obj, nodePtr, NULL_REG);
 	else
-		PUT_SEL32V(_segMan, obj, state, kSndStatusStopped);
+		PUT_SEL32V(_segMan, obj, state, kSoundStopped);
 #endif
 }
 
@@ -500,7 +500,7 @@
 
 	PUT_SEL32V(_segMan, obj, handle, 0);
 	if (_soundVersion <= SCI_VERSION_0_LATE)
-		PUT_SEL32V(_segMan, obj, state, kSndStatusStopped);
+		PUT_SEL32V(_segMan, obj, state, kSoundStopped);
 	else
 		PUT_SEL32V(_segMan, obj, signal, SIGNAL_OFFSET);
 
@@ -521,7 +521,7 @@
 #else
 	MusicEntry *musicSlot = _music->getSlot(obj);
 
-	if (musicSlot->status == kSndStatusStopped) {
+	if (musicSlot->status == kSoundStopped) {
 		// WORKAROUND for the Sierra logo screen in Castle of Dr. Brain, where the
 		// game tries to pause/unpause the wrong sound in the playlist
 		if (!strcmp(_segMan->getObjectName(obj), "cMusic2"))
@@ -534,7 +534,7 @@
 	}
 
 	if (_soundVersion <= SCI_VERSION_0_LATE) {
-		PUT_SEL32V(_segMan, obj, state, kSndStatusPaused);
+		PUT_SEL32V(_segMan, obj, state, kSoundPaused);
 		_music->soundPause(musicSlot);
 	} else {
 		if (value)
@@ -560,7 +560,7 @@
 		return;
 	}
 
-	PUT_SEL32V(_segMan, obj, state, kSndStatusPlaying);
+	PUT_SEL32V(_segMan, obj, state, kSoundPlaying);
 	_music->soundPlay(musicSlot);
 #endif
 }


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