Skip to content

Commit

Permalink
update gyro activation when changing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sndein committed Dec 12, 2023
1 parent c74aee0 commit 209dbfe
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 21 additions & 2 deletions Quake/in_sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,31 +358,50 @@ void IN_ShutdownJoystick (void)
SDL_QuitSubSystem(SDL_INIT_GAMECONTROLLER);
}

void IN_GyroActionDown (void) {
void IN_GyroActionDown (void)
{
switch ((int)gyro_mode.value)
{
case 1:
gyro_active = true;
return;
case 2:
gyro_active = false;
return;
case 4:
gyro_dir = -1;
}
}
void IN_GyroActionUp (void) {
void IN_GyroActionUp (void)
{
switch ((int)gyro_mode.value)
{
case 1:
gyro_active = false;
return;
case 2:
gyro_active = true;
return;
case 4:
gyro_dir = 1;
}
}

void IN_UpdateGyroActive(void)
{
switch ((int)gyro_mode.value)
{
case 0:
case 1:
gyro_active = false;
return;
case 2:
case 3:
case 4:
gyro_active = true;
}
}

void IN_Init (void)
{
textmode = Key_TextEntry();
Expand Down
2 changes: 2 additions & 0 deletions Quake/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ extern qboolean quake64;

extern void StartCalibration(void);
extern qboolean IsCalibrationZero(void);
extern void IN_UpdateGyroActive(void);

enum m_state_e m_state;
extern qboolean keydown[256];
Expand Down Expand Up @@ -3073,6 +3074,7 @@ static void GYRO_Menu_ChooseNextMode (int dir)
i = 0;

Cvar_SetValueQuick (&gyro_mode, i);
IN_UpdateGyroActive();
}

/*
Expand Down

0 comments on commit 209dbfe

Please sign in to comment.