Merge remote-tracking branch 'yquake2/master'

This commit is contained in:
Denis Pauk 2024-09-09 00:33:38 +03:00
commit f040b01e00
5 changed files with 39 additions and 11 deletions

View file

@ -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 0. Setting this cvar to `1` disables this behavior, the music keeps
playing. 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 * **s_doppler**: If set to `1` doppler effects are enabled. This is only
supported by the OpenAL sound backend. supported by the OpenAL sound backend.

View file

@ -236,10 +236,17 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym)
case SDLK_BACKSPACE: case SDLK_BACKSPACE:
key = K_BACKSPACE; key = K_BACKSPACE;
break; break;
case SDLK_LGUI: #ifdef __APPLE__
case SDLK_RGUI: case SDLK_RGUI:
key = K_COMMAND; // Win key case SDLK_LGUI:
key = K_COMMAND;
break; break;
#else
case SDLK_RGUI:
case SDLK_LGUI:
key = K_SUPER;
break;
#endif
case SDLK_CAPSLOCK: case SDLK_CAPSLOCK:
key = K_CAPSLOCK; key = K_CAPSLOCK;
break; break;
@ -395,8 +402,6 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym)
key = K_KP_EQUALS; key = K_KP_EQUALS;
break; break;
// TODO: K_SUPER ? Win Key is already K_COMMAND
case SDLK_APPLICATION: case SDLK_APPLICATION:
key = K_COMPOSE; key = K_COMPOSE;
break; break;

View file

@ -226,10 +226,17 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym)
case SDLK_BACKSPACE: case SDLK_BACKSPACE:
key = K_BACKSPACE; key = K_BACKSPACE;
break; break;
case SDLK_LGUI: #ifdef __APPLE__
case SDLK_RGUI: case SDLK_RGUI:
key = K_COMMAND; // Win key case SDLK_LGUI:
key = K_COMMAND;
break; break;
#else
case SDLK_RGUI:
case SDLK_LGUI:
key = K_SUPER;
break;
#endif
case SDLK_CAPSLOCK: case SDLK_CAPSLOCK:
key = K_CAPSLOCK; key = K_CAPSLOCK;
break; break;
@ -385,8 +392,6 @@ IN_TranslateSDLtoQ2Key(unsigned int keysym)
key = K_KP_EQUALS; key = K_KP_EQUALS;
break; break;
// TODO: K_SUPER ? Win Key is already K_COMMAND
case SDLK_APPLICATION: case SDLK_APPLICATION:
key = K_COMPOSE; key = K_COMPOSE;
break; break;

View file

@ -2376,6 +2376,7 @@ Options_MenuInit(void)
"play once", "play once",
"sequential", "sequential",
"random", "random",
"truly random",
0 0
}; };

View file

@ -530,6 +530,7 @@ OGG_PlayTrack(const char *track, qboolean cdtrack, qboolean immediate)
newtrack = (curtrack + 1) % (ogg_maxfileindex + 1) != 0 ? (curtrack + 1) : 2; newtrack = (curtrack + 1) % (ogg_maxfileindex + 1) != 0 ? (curtrack + 1) : 2;
} break; } break;
case 3: // random case 3: // random
case 4: // random with true randomness
{ {
int retries = 100; int retries = 100;
newtrack = 0; newtrack = 0;
@ -537,6 +538,14 @@ OGG_PlayTrack(const char *track, qboolean cdtrack, qboolean immediate)
while (retries-- > 0 && newtrack < 2) while (retries-- > 0 && newtrack < 2)
{ {
newtrack = randk() % (ogg_maxfileindex + 1); newtrack = randk() % (ogg_maxfileindex + 1);
if (playback == 3)
{
if (newtrack == curtrack)
{
newtrack = 0;
}
}
} }
} break; } break;
} }
@ -774,10 +783,9 @@ OGG_Cmd(void)
void void
OGG_SaveState(void) OGG_SaveState(void)
{ {
if (ogg_status != PLAY) if (ogg_enabled->value != 1 || ogg_status != PLAY)
{ {
ogg_saved_state.saved = false; ogg_saved_state.saved = false;
return; return;
} }
@ -792,7 +800,7 @@ OGG_SaveState(void)
void void
OGG_RecoverState(void) OGG_RecoverState(void)
{ {
if (!ogg_saved_state.saved) if (ogg_enabled->value != 1 || ogg_saved_state.saved != true)
{ {
return; return;
} }