diff options
| author | wyatt8740 <wyattfward@gmail.com> | 2021-01-19 14:40:32 -0500 |
|---|---|---|
| committer | wyatt8740 <wyattfward@gmail.com> | 2021-01-19 14:40:32 -0500 |
| commit | 6f34ea985bc389605b9e03645ab258259ba49c81 (patch) | |
| tree | 98874957c6baaae857ed8ce70e0c624c1f8ba50c /WinQuake/snd_dma.c | |
| parent | 9b671e8d4380c6cdf4b70fbf954e29481b9fdf85 (diff) | |
| download | quake-pum-6f34ea985bc389605b9e03645ab258259ba49c81.tar.gz | |
SDL2 audio backend, retrofitted from quakespasm (Music still requires either a CD drive with analogue audio playback or CD drive emulator software like cdemu, but SFX no longer require OSS DMA for playback and Quake no longer inherently prevents other software from making sound while running)
Diffstat (limited to 'WinQuake/snd_dma.c')
| -rw-r--r-- | WinQuake/snd_dma.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/WinQuake/snd_dma.c b/WinQuake/snd_dma.c index accb617..adb5504 100644 --- a/WinQuake/snd_dma.c +++ b/WinQuake/snd_dma.c @@ -74,6 +74,11 @@ cvar_t volume = {"volume", "0.7", true}; cvar_t nosound = {"nosound", "0"};
cvar_t precache = {"precache", "1"};
cvar_t loadas8bit = {"loadas8bit", "0"};
+/* for sdl */
+#if defined(USE_SDL2)
+cvar_t sndspeed = {"sndspeed", "11025", CVAR_NONE};
+cvar_t snd_mixspeed = {"snd_mixspeed", "44100", CVAR_NONE};
+#endif
cvar_t bgmbuffer = {"bgmbuffer", "4096"};
cvar_t ambient_level = {"ambient_level", "0.3"};
cvar_t ambient_fade = {"ambient_fade", "100"};
@@ -143,8 +148,14 @@ void S_Startup (void) if (!fakedma)
{
+#if defined(USE_SDL2)
+ /* Since I borrowed a lot of the SDL2 code from Quakespasm, I
+ found this to be the easiest way to retrofit it: */
+ rc = SNDDMA_Init(&sn);
+#else
+ /* in the original code from Id, no argument is used here: */
rc = SNDDMA_Init();
-
+#endif
if (!rc)
{
#ifndef _WIN32
|
