Hardcode the SDL audio driver (again) to directsound under Windows.

Windows defaults to `wassapi`, which is a sensible choice. But WASAPI
only guarantees 32 bit float samples, anything else only works if the
driver or something supports it and YQ2 requires 16 bit samples. That
can be worked around by having SDL recode the audio, but I don't want
such a invasive change right before a release.

Another part of #1132.
This commit is contained in:
Yamagi 2024-08-08 18:39:29 +02:00
parent 409c508a7d
commit 8cc3361730
3 changed files with 14 additions and 3 deletions

View file

@ -1,10 +1,11 @@
Quake II 8.40 to 8.41:
- Fix an endless loop in the OpenGL 1.4 renderer crashing the game and
blocking further progress under some circumstances. (by protocultor)
- Don't force a platform dependend ,hard coded SDL audio driver, let SDL
- Don't force a platform dependend, hard coded SDL audio driver, let SDL
choose the driver instead. This may fix the SDL audio backend on some
platforms. The driver can still be overridden by setting `s_sdldriver`
to something else than `auto`.
to something else than `auto`. Under Windows `s_sdldriver` defaults
`directsound` because `auto` may choose an incompatible driver.
Quake II 8.30 to 8.40:
- Implement `g_quick_weap`. If set to 1, both weapprev and weapnext

View file

@ -303,7 +303,8 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable`
* **s_sdldriver**: Can be set to the name of a SDL audio driver. If set
to `auto`, SDL chooses the driver. If set to anything else the given
driver is forced, regardless if supported by SDL or the platform or
not.
not. By default set to `directsound` under Windows and `auto` on all
other platforms.
* **s_underwater**: Dampen sounds if submerged. Enabled by default.

View file

@ -1351,7 +1351,11 @@ SDL_BackendInit(void)
int sndfreq = (Cvar_Get("s_khz", "44", CVAR_ARCHIVE))->value;
int sndchans = (Cvar_Get("sndchannels", "2", CVAR_ARCHIVE))->value;
#if _WIN32
cvar_t *s_sdldriver = (Cvar_Get("s_sdldriver", "directsound", CVAR_ARCHIVE));
#else
cvar_t *s_sdldriver = (Cvar_Get("s_sdldriver", "auto", CVAR_ARCHIVE));
#endif
if (strcmp(s_sdldriver->string, "auto") != 0)
{
@ -1512,7 +1516,12 @@ SDL_BackendInit(void)
int sndbits = (Cvar_Get("sndbits", "16", CVAR_ARCHIVE))->value;
int sndfreq = (Cvar_Get("s_khz", "44", CVAR_ARCHIVE))->value;
int sndchans = (Cvar_Get("sndchannels", "2", CVAR_ARCHIVE))->value;
#if _WIN32
cvar_t *s_sdldriver = (Cvar_Get("s_sdldriver", "directsound", CVAR_ARCHIVE));
#else
cvar_t *s_sdldriver = (Cvar_Get("s_sdldriver", "auto", CVAR_ARCHIVE));
#endif
if (strcmp(s_sdldriver->string, "auto") != 0)
{