diff --git a/doc/040_cvarlist.md b/doc/040_cvarlist.md index 89eb24b9..ee60685f 100644 --- a/doc/040_cvarlist.md +++ b/doc/040_cvarlist.md @@ -302,6 +302,15 @@ it's `+set busywait 0` (setting the `busywait` cvar) and `-portable` 0. Setting this cvar to `1` disables this behavior, the music keeps playing. +* **ogg_shuffle**: Ogg/Vorbis playback mode. Supported modes are: + `0`: Loop the current track (the default). + `1`: Play the current track once, then stop. + `2`: Play all available tracks in a linear sequence. + `3`: Shuffle through the available tracks, never play the same track + twice in a row. + `4`: Shuffle through the available tracks, may play the same track + multiple times in a row. + * **s_doppler**: If set to `1` doppler effects are enabled. This is only supported by the OpenAL sound backend. diff --git a/src/client/input/sdl2.c b/src/client/input/sdl2.c index dc9666b3..decb8001 100644 --- a/src/client/input/sdl2.c +++ b/src/client/input/sdl2.c @@ -236,10 +236,17 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym) case SDLK_BACKSPACE: key = K_BACKSPACE; break; - case SDLK_LGUI: +#ifdef __APPLE__ case SDLK_RGUI: - key = K_COMMAND; // Win key + case SDLK_LGUI: + key = K_COMMAND; break; +#else + case SDLK_RGUI: + case SDLK_LGUI: + key = K_SUPER; + break; +#endif case SDLK_CAPSLOCK: key = K_CAPSLOCK; break; @@ -395,8 +402,6 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym) key = K_KP_EQUALS; break; - // TODO: K_SUPER ? Win Key is already K_COMMAND - case SDLK_APPLICATION: key = K_COMPOSE; break; diff --git a/src/client/input/sdl3.c b/src/client/input/sdl3.c index e719b975..a4dc39ae 100644 --- a/src/client/input/sdl3.c +++ b/src/client/input/sdl3.c @@ -226,10 +226,17 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym) case SDLK_BACKSPACE: key = K_BACKSPACE; break; - case SDLK_LGUI: +#ifdef __APPLE__ case SDLK_RGUI: - key = K_COMMAND; // Win key + case SDLK_LGUI: + key = K_COMMAND; break; +#else + case SDLK_RGUI: + case SDLK_LGUI: + key = K_SUPER; + break; +#endif case SDLK_CAPSLOCK: key = K_CAPSLOCK; break; @@ -385,8 +392,6 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym) key = K_KP_EQUALS; break; - // TODO: K_SUPER ? Win Key is already K_COMMAND - case SDLK_APPLICATION: key = K_COMPOSE; break; diff --git a/src/client/menu/menu.c b/src/client/menu/menu.c index e30d4514..4e456937 100644 --- a/src/client/menu/menu.c +++ b/src/client/menu/menu.c @@ -2376,6 +2376,7 @@ Options_MenuInit(void) "play once", "sequential", "random", + "truly random", 0 }; diff --git a/src/client/sound/ogg.c b/src/client/sound/ogg.c index 9d65cc52..782c2731 100644 --- a/src/client/sound/ogg.c +++ b/src/client/sound/ogg.c @@ -530,6 +530,7 @@ OGG_PlayTrack(const char *track, qboolean cdtrack, qboolean immediate) newtrack = (curtrack + 1) % (ogg_maxfileindex + 1) != 0 ? (curtrack + 1) : 2; } break; case 3: // random + case 4: // random with true randomness { int retries = 100; newtrack = 0; @@ -537,6 +538,14 @@ OGG_PlayTrack(const char *track, qboolean cdtrack, qboolean immediate) while (retries-- > 0 && newtrack < 2) { newtrack = randk() % (ogg_maxfileindex + 1); + + if (playback == 3) + { + if (newtrack == curtrack) + { + newtrack = 0; + } + } } } break; } @@ -774,10 +783,9 @@ OGG_Cmd(void) void OGG_SaveState(void) { - if (ogg_status != PLAY) + if (ogg_enabled->value != 1 || ogg_status != PLAY) { ogg_saved_state.saved = false; - return; } @@ -792,7 +800,7 @@ OGG_SaveState(void) void OGG_RecoverState(void) { - if (!ogg_saved_state.saved) + if (ogg_enabled->value != 1 || ogg_saved_state.saved != true) { return; }