ref: eb498d4e7706fa6f99d364ee96f8da2533d99a21
parent: 9eb97943b6836461e97e68b7d2eb5ff14f4d24cb
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Wed Dec 27 19:46:47 EST 2023
unix: move dummy cd logic to openal-specific stuff
--- a/Makefile
+++ b/Makefile
@@ -83,7 +83,6 @@
sv_move.o\
sv_phys.o\
sv_user.o\
- unix/cd.o\
unix/in.o\
unix/net_udp.o\
unix/qk1.o\
--- a/unix/cd.c
+++ /dev/null
@@ -1,47 +1,0 @@
-#include "quakedef.h"
-
-cvar_t bgmvolume = {"bgmvolume", "1", 1};
-
-void
-stopcd(void)
-{
-}
-
-void
-pausecd(void)
-{
-}
-
-void
-resumecd(void)
-{
-}
-
-void
-shutcd(void)
-{
-}
-
-void
-stepcd(void)
-{
-}
-
-void
-playcd(int nt, int loop)
-{
- USED(nt); USED(loop);
-}
-
-static void
-cdcmd(void)
-{
-}
-
-int
-initcd(void)
-{
- Cvar_RegisterVariable(&bgmvolume);
- Cmd_AddCommand("cd", cdcmd);
- return -1;
-}
--- a/unix/snd_openal.c
+++ b/unix/snd_openal.c
@@ -25,7 +25,8 @@
Srcamb,
};
-cvar_t volume = {"volume", "0.7", 1};
+cvar_t volume = {"volume", "0.7", true};
+cvar_t bgmvolume = {"bgmvolume", "0.5", true};
static cvar_t s_al_dev = {"s_al_device", "-1", true};
static int s_al_dev_prev = -2;
@@ -636,7 +637,44 @@
}
}
+void
+stepcd(void)
+{
+}
+
+void
+playcd(int nt, int loop)
+{
+ USED(nt); USED(loop);
+}
+
+static void
+cdcmd(void)
+{
+}
+
+void
+resumecd(void)
+{
+}
+
+void
+pausecd(void)
+{
+}
+
int
+initcd(void)
+{
+ return 0;
+}
+
+void
+shutcd(void)
+{
+}
+
+int
initsnd(void)
{
s_al_dev.cb = s_al_hrtf.cb = alvarcb;
@@ -643,6 +681,7 @@
s_al_doppler_factor.cb = aldopplercb;
Cvar_RegisterVariable(&volume);
+ Cvar_RegisterVariable(&bgmvolume);
Cvar_RegisterVariable(&ambient_level);
Cvar_RegisterVariable(&ambient_fade);
Cvar_RegisterVariable(&s_al_dev);
@@ -652,6 +691,7 @@
Cvar_RegisterVariable(&s_al_doppler_factor);
Cmd_AddCommand("stopsound", stopallsfx);
Cmd_AddCommand("soundlist", sfxlist);
+ Cmd_AddCommand("cd", cdcmd);
alinit(nil);
known_sfx = Hunk_Alloc(MAX_SOUNDS * sizeof *known_sfx);