aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-02-16 01:07:24 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-02-16 01:07:24 +0100
commit1427e04e126c90810164bee34dd4f898d2f39f91 (patch)
tree3e87c876cc587a212140f7e2a69b3bae06bba7bb /src
parent560bd53d0e893a91a1bbc37fdaa1207ca2952a18 (diff)
Implement sound support
Diffstat (limited to 'src')
-rw-r--r--src/ahoy/gui.c6
-rw-r--r--src/ahoy/gui.h1
-rw-r--r--src/ahoy/main.c7
3 files changed, 10 insertions, 4 deletions
diff --git a/src/ahoy/gui.c b/src/ahoy/gui.c
index fd6a660..82a351e 100644
--- a/src/ahoy/gui.c
+++ b/src/ahoy/gui.c
@@ -112,6 +112,12 @@ noclr:
}
void
+auplay(bool stop)
+{
+ SDL_PauseAudioDevice(adev, stop);
+}
+
+void
readkb(void)
{
SDL_Event e;
diff --git a/src/ahoy/gui.h b/src/ahoy/gui.h
index e262620..5312d4e 100644
--- a/src/ahoy/gui.h
+++ b/src/ahoy/gui.h
@@ -14,6 +14,7 @@ void wininit(void);
void winfree(void);
void winclr(void);
void windrw(void);
+void auplay(bool);
void readkb(void);
extern guistate gs;
diff --git a/src/ahoy/main.c b/src/ahoy/main.c
index 10e79e6..69a7946 100644
--- a/src/ahoy/main.c
+++ b/src/ahoy/main.c
@@ -86,10 +86,9 @@ update_timers(void)
if (c8.ST > 0) {
c8.ST--;
- // SDL_PauseAudioDevice(adev, 0); // Play sound
- } else {
- // SDL_PauseAudioDevice(adev, 1); // Pause sound
- }
+ auplay(false);
+ } else
+ auplay(true);
}
void