From 19760d58ea09b9c345a0c845e89143ddcc5d6507 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 7 May 2023 21:30:20 +1000 Subject: Fix a crash when running with no_sound --- sound.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound.c b/sound.c index 798e8c2..3099a94 100644 --- a/sound.c +++ b/sound.c @@ -63,6 +63,7 @@ Song_Func get_current_song_f() { } void play_beep(int pitch, int length) { +#if !no_sound Beep* beep; #if DEBUG @@ -75,6 +76,7 @@ void play_beep(int pitch, int length) { beep = &sys.beeps[sys.beep_count++]; beep->pitch = pitch; beep->length = length; +#endif } void sound_mix(unsigned char* stream, int len) { @@ -85,7 +87,6 @@ void sound_mix(unsigned char* stream, int len) { f = get_current_song_f(); for (i = 0; i < len; i++) { -/* stream[i] = sys.t % 50;*/ stream[i] = f(sys.t) / 5; for (j = sys.beep_count - 1; j >= 0; j--) { beep = &sys.beeps[j]; -- cgit v1.2.3-54-g00ecf