[Scummvm-cvs-logs] scummvm master -> a24cb57c9d4d4292da582fafc52be70103a1e369

DrMcCoy drmccoy at drmccoy.de
Sat Jun 16 02:59:31 CEST 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a24cb57c9d GOB: Loop the Little Red title music


Commit: a24cb57c9d4d4292da582fafc52be70103a1e369
    https://github.com/scummvm/scummvm/commit/a24cb57c9d4d4292da582fafc52be70103a1e369
Author: Sven Hesse (drmccoy at users.sourceforge.net)
Date: 2012-06-15T17:58:53-07:00

Commit Message:
GOB: Loop the Little Red title music

Changed paths:
    engines/gob/inter.h
    engines/gob/inter_littlered.cpp
    engines/gob/sound/sound.cpp
    engines/gob/sound/sound.h
    engines/gob/sound/soundblaster.cpp
    engines/gob/sound/soundblaster.h



diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 0625646..63bf3eb 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -527,6 +527,7 @@ protected:
 	virtual void setupOpcodesGob();
 
 	void oLittleRed_keyFunc(OpFuncParams &params);
+	void oLittleRed_playComposition(OpFuncParams &params);
 };
 
 class Inter_v3 : public Inter_v2 {
diff --git a/engines/gob/inter_littlered.cpp b/engines/gob/inter_littlered.cpp
index 3a44945..729d9f5 100644
--- a/engines/gob/inter_littlered.cpp
+++ b/engines/gob/inter_littlered.cpp
@@ -48,6 +48,8 @@ void Inter_LittleRed::setupOpcodesFunc() {
 	Inter_v2::setupOpcodesFunc();
 
 	OPCODEFUNC(0x14, oLittleRed_keyFunc);
+
+	OPCODEFUNC(0x3D, oLittleRed_playComposition);
 }
 
 void Inter_LittleRed::setupOpcodesGob() {
@@ -107,4 +109,10 @@ void Inter_LittleRed::oLittleRed_keyFunc(OpFuncParams &params) {
 	}
 }
 
+void Inter_LittleRed::oLittleRed_playComposition(OpFuncParams &params) {
+	_vm->_sound->blasterRepeatComposition(-1);
+
+	o1_playComposition(params);
+}
+
 } // End of namespace Gob
diff --git a/engines/gob/sound/sound.cpp b/engines/gob/sound/sound.cpp
index 9f72d1a..170330f 100644
--- a/engines/gob/sound/sound.cpp
+++ b/engines/gob/sound/sound.cpp
@@ -445,6 +445,10 @@ void Sound::blasterPlay(SoundDesc *sndDesc, int16 repCount,
 	_blaster->playSample(*sndDesc, repCount, frequency, fadeLength);
 }
 
+void Sound::blasterRepeatComposition(int32 repCount) {
+	_blaster->repeatComposition(repCount);;
+}
+
 void Sound::blasterStop(int16 fadeLength, SoundDesc *sndDesc) {
 	if (!_blaster)
 		return;
diff --git a/engines/gob/sound/sound.h b/engines/gob/sound/sound.h
index 064a249..6ad0ec5 100644
--- a/engines/gob/sound/sound.h
+++ b/engines/gob/sound/sound.h
@@ -63,6 +63,7 @@ public:
 	void blasterPlayComposition(int16 *composition, int16 freqVal,
 			SoundDesc *sndDescs = 0, int8 sndCount = kSoundsCount);
 	void blasterStopComposition();
+	void blasterRepeatComposition(int32 repCount);
 
 	char blasterPlayingSound() const;
 
diff --git a/engines/gob/sound/soundblaster.cpp b/engines/gob/sound/soundblaster.cpp
index 4ff555b..915d744 100644
--- a/engines/gob/sound/soundblaster.cpp
+++ b/engines/gob/sound/soundblaster.cpp
@@ -31,6 +31,8 @@ SoundBlaster::SoundBlaster(Audio::Mixer &mixer) : SoundMixer(mixer, Audio::Mixer
 	_compositionSamples = 0;
 	_compositionSampleCount = 0;
 	_compositionPos = -1;
+
+	_compositionRepCount = 0;
 }
 
 SoundBlaster::~SoundBlaster() {
@@ -79,6 +81,7 @@ void SoundBlaster::nextCompositionPos() {
 		if (_compositionPos == 49)
 			_compositionPos = -1;
 	}
+
 	_compositionPos = -1;
 }
 
@@ -98,6 +101,10 @@ void SoundBlaster::playComposition(int16 *composition, int16 freqVal,
 	nextCompositionPos();
 }
 
+void SoundBlaster::repeatComposition(int32 repCount) {
+	_compositionRepCount = repCount;
+}
+
 void SoundBlaster::setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency,
 		int16 fadeLength) {
 
@@ -106,10 +113,21 @@ void SoundBlaster::setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency
 }
 
 void SoundBlaster::checkEndSample() {
-	if (_compositionPos != -1)
+	if (_compositionPos != -1) {
+		nextCompositionPos();
+		return;
+	}
+
+	if (_compositionRepCount != 0) {
+		if (_compositionRepCount > 0)
+			_compositionRepCount--;
+
 		nextCompositionPos();
-	else
-		SoundMixer::checkEndSample();
+		if (_compositionPos != -1)
+			return;
+	}
+
+	SoundMixer::checkEndSample();
 }
 
 void SoundBlaster::endFade() {
diff --git a/engines/gob/sound/soundblaster.h b/engines/gob/sound/soundblaster.h
index c2704c5..c740ba2 100644
--- a/engines/gob/sound/soundblaster.h
+++ b/engines/gob/sound/soundblaster.h
@@ -46,6 +46,8 @@ public:
 	void stopComposition();
 	void endComposition();
 
+	void repeatComposition(int32 repCount);
+
 protected:
 	Common::Mutex _mutex;
 
@@ -54,6 +56,8 @@ protected:
 	int16 _composition[50];
 	int8 _compositionPos;
 
+	int32 _compositionRepCount;
+
 	SoundDesc *_curSoundDesc;
 
 	void setSample(SoundDesc &sndDesc, int16 repCount,






More information about the Scummvm-git-logs mailing list