Remove sound playing slots, as they do not work
This commit is contained in:
@@ -4,9 +4,9 @@ void soundsApplyVolume(SoundState *sounds, f32 master, f32 music, f32 sound) {
|
||||
SetMasterVolume(master);
|
||||
if (sounds->musicLoaded)
|
||||
SetMusicVolume(sounds->music, music);
|
||||
for (i32 i = 0; i < SOUND_MAX_PLAYING; i++) {
|
||||
if (IsSoundPlaying(sounds->playing[i]))
|
||||
SetSoundVolume(sounds->playing[i], sound);
|
||||
for (i32 i = 0; i < SOUND_COUNT; i++) {
|
||||
if (IsSoundPlaying(sounds->sounds[i]))
|
||||
SetSoundVolume(sounds->sounds[i], sound);
|
||||
}
|
||||
|
||||
sounds->masterVolume = master;
|
||||
@@ -25,20 +25,8 @@ bool soundsPlay(SoundState *sounds, SoundType type) {
|
||||
if (time - lastPlayedTime < sounds->soundInterval[type])
|
||||
return false;
|
||||
|
||||
i32 freeSlot = -1;
|
||||
for (i32 i = 0; i < SOUND_MAX_PLAYING; i++) {
|
||||
if (!IsSoundPlaying(sounds->playing[i])) {
|
||||
freeSlot = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (freeSlot == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
sounds->playing[freeSlot] = sounds->sounds[type];
|
||||
PlaySound(sounds->playing[freeSlot]);
|
||||
SetSoundVolume(sounds->playing[freeSlot], sounds->soundVolume);
|
||||
PlaySound(sounds->sounds[type]);
|
||||
SetSoundVolume(sounds->sounds[type], sounds->soundVolume);
|
||||
sounds->soundLastPlayed[type] = time;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user