aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2023-05-07 21:30:20 +1000
committerquou <quou@disroot.org>2023-05-07 21:30:20 +1000
commit19760d58ea09b9c345a0c845e89143ddcc5d6507 (patch)
tree673e17ad8659a30e9abd9613b76ca081a0b3e147
parentf3ee0b0b2ddcf4484cd61aa2b33e49d9cc35779a (diff)
Fix a crash when running with no_sound
-rw-r--r--sound.c3
1 files changed, 2 insertions, 1 deletions
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];