MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Sound_Play

Method Sound_Play

Source/Amiga/Sound_Amiga.cpp:193–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193void cSound_Amiga::Sound_Play( int16 pTileset, int16 pSoundEffect, int16 pVolume, int16 pIndex) {
194
195 Track_Load( &mSound_Sfx, pTileset + 0x32 );
196
197 if (SDL_LockMutex( mLock ) == 0) {
198 if (mSound_Sfx.mCurrentMusicSongData && mSound_Sfx.mCurrentMusicInstrumentData) {
199 Audio::AudioStream* Sfx = Audio::makeRjp1Stream( mSound_Sfx.mCurrentMusicSongData, mSound_Sfx.mCurrentMusicInstrumentData, -pSoundEffect );
200 if (Sfx) {
201 Sfx->mVolume = pVolume;
202 if (mCurrentSfx[pIndex]) {
203 delete mCurrentSfx[pIndex];
204 mCurrentSfx[pIndex] = 0;
205 }
206 mCurrentSfx[pIndex] = Sfx;
207 }
208 }
209
210 SDL_UnlockMutex( mLock );
211 }
212
213 SDL_PauseAudioDevice(mVal, 0);
214}
215
216void cSound_Amiga::Music_Play( int16 pTrack, int16 pSong) {
217

Callers

nothing calls this directly

Calls 1

makeRjp1StreamFunction · 0.85

Tested by

no test coverage detected