summaryrefslogtreecommitdiff
path: root/in_practice/breakout/audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'in_practice/breakout/audio.c')
-rw-r--r--in_practice/breakout/audio.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/in_practice/breakout/audio.c b/in_practice/breakout/audio.c
new file mode 100644
index 0000000..2a62de4
--- /dev/null
+++ b/in_practice/breakout/audio.c
@@ -0,0 +1,14 @@
+#include "audio.h"
+
+#include <string.h>
+
+struct sound sounds[max_sounds] = {0};
+
+i32 get_sound(const char *name)
+{
+ for (i32 i = 0; i < max_sounds; i++) {
+ if (sounds[i].name && strstr(sounds[i].name, name))
+ return i;
+ }
+ return -1;
+}