Classic cvar 'in_initjoy' resurrected

Added myself to credits
This commit is contained in:
Jaime Moreira 2022-09-19 11:36:23 -03:00
parent da31490684
commit 9de55c603d
3 changed files with 15 additions and 4 deletions

View file

@ -471,6 +471,10 @@ Set `0` by default.
## Game Controller
* **in_initjoy**: Toggles initialization of game controller. Default is
`1`, which enables gamepad usage; `0` disables its detection at
startup. Can only be set from command line.
* **in_sdlbackbutton**: Defines which button is used in the gamepad or
joystick as the `Esc` key, to access the main menu and 'cancel' /
'go back' on its options. Default is `0`, which corresponds to the

View file

@ -1618,16 +1618,16 @@ IsCalibrationZero(void)
static void
IN_Controller_Init(qboolean notify_user)
{
cvar_t *in_sdlbackbutton;
cvar_t *cvar;
int nummappings;
char controllerdb[MAX_OSPATH] = {0};
SDL_Joystick *joystick = NULL;
SDL_bool is_controller = SDL_FALSE;
in_sdlbackbutton = Cvar_Get("in_sdlbackbutton", "0", CVAR_ARCHIVE);
if (in_sdlbackbutton)
cvar = Cvar_Get("in_sdlbackbutton", "0", CVAR_ARCHIVE);
if (cvar)
{
switch ((int)in_sdlbackbutton->value)
switch ((int)cvar->value)
{
case 1:
sdl_back_button = SDL_CONTROLLER_BUTTON_START;
@ -1640,6 +1640,12 @@ IN_Controller_Init(qboolean notify_user)
}
}
cvar = Cvar_Get("in_initjoy", "1", CVAR_NOSET);
if (!cvar->value)
{
return;
}
if (notify_user)
{
Com_Printf("- Game Controller init attempt -\n");

View file

@ -2508,6 +2508,7 @@ static const char *idcredits[] = {
"Sander van Dijk",
"Denis Pauk",
"Bjorn Alfredsson",
"Jaime Moreira",
"",
"Quake II(tm) (C)1997 Id Software, Inc.",
"All Rights Reserved. Distributed by",