- [NEW] JA_PlaySoundOnChannel(JA_Sound_t *sound, const int channel, const int loop = 0);

This commit is contained in:
2024-12-28 10:59:25 +01:00
parent 774aebf4a4
commit f5ee23cea3
2 changed files with 14 additions and 0 deletions

View File

@@ -316,6 +316,19 @@ int JA_PlaySound(JA_Sound_t *sound, const int loop)
return channel;
}
int JA_PlaySoundOnChannel(JA_Sound_t *sound, const int channel, const int loop)
{
if (!JA_soundEnabled) return -1;
if (channel >= JA_MAX_SIMULTANEOUS_CHANNELS) return -1;
channels[channel].sound = sound;
channels[channel].times = loop;
channels[channel].pos = 0;
channels[channel].state = JA_CHANNEL_PLAYING;
return channel;
}
void JA_DeleteSound(JA_Sound_t *sound)
{
for (int i = 0; i < JA_MAX_SIMULTANEOUS_CHANNELS; i++) {