mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-04 16:26:53 +00:00
GOB: Loop the Little Red title music
This commit is contained in:
parent
f917db972e
commit
a24cb57c9d
@ -527,6 +527,7 @@ protected:
|
||||
virtual void setupOpcodesGob();
|
||||
|
||||
void oLittleRed_keyFunc(OpFuncParams ¶ms);
|
||||
void oLittleRed_playComposition(OpFuncParams ¶ms);
|
||||
};
|
||||
|
||||
class Inter_v3 : public Inter_v2 {
|
||||
|
@ -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 ¶ms) {
|
||||
}
|
||||
}
|
||||
|
||||
void Inter_LittleRed::oLittleRed_playComposition(OpFuncParams ¶ms) {
|
||||
_vm->_sound->blasterRepeatComposition(-1);
|
||||
|
||||
o1_playComposition(params);
|
||||
}
|
||||
|
||||
} // End of namespace Gob
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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();
|
||||
else
|
||||
SoundMixer::checkEndSample();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_compositionRepCount != 0) {
|
||||
if (_compositionRepCount > 0)
|
||||
_compositionRepCount--;
|
||||
|
||||
nextCompositionPos();
|
||||
if (_compositionPos != -1)
|
||||
return;
|
||||
}
|
||||
|
||||
SoundMixer::checkEndSample();
|
||||
}
|
||||
|
||||
void SoundBlaster::endFade() {
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user