Mouse Controls for saturn
This commit is contained in:
1 parent
ccbb894a6b
commit
49aaa25255
5 files changed
+47
-12
No files matched your search
@@ -301,6 +301,8 @@ INT32 cv_debug;
|
||||
|
||||
consvar_t cv_usemouse = {"use_mouse", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_usemouse2 = {"use_mouse2", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse2, 0, NULL, NULL, 0, 0, NULL};
|
||||
//WTF
|
||||
consvar_t cv_mouseturn = {"mouseturn", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
#if defined(HAVE_SDL) || defined(_WINDOWS) //joystick 1 and 2
|
||||
consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
|
||||
|
||||
@@ -41,6 +41,8 @@ extern consvar_t cv_splitplayers;
|
||||
extern consvar_t cv_seenames, cv_allowseenames;
|
||||
#endif
|
||||
extern consvar_t cv_usemouse;
|
||||
//WTF
|
||||
extern consvar_t cv_mouseturn;
|
||||
extern consvar_t cv_usejoystick;
|
||||
extern consvar_t cv_usejoystick2;
|
||||
extern consvar_t cv_usejoystick3;
|
||||
|
||||
+2
-2
@@ -1427,9 +1427,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||
side += ((axis * sidemove[0]) >> 10);
|
||||
}
|
||||
|
||||
// Specator mouse turning
|
||||
if (player->spectator)
|
||||
if (player->spectator || cv_mouseturn.value)
|
||||
{
|
||||
//THIS WORKS WTF????????
|
||||
cmd->angleturn = (INT16)(cmd->angleturn - ((mousex*(encoremode ? -1 : 1)*8)));
|
||||
cmd->driftturn = (INT16)(cmd->driftturn - ((mousex*(encoremode ? -1 : 1)*8)));
|
||||
}
|
||||
|
||||
@@ -720,6 +720,9 @@ void K_RegisterKartStuff(void)
|
||||
CV_RegisterVar(&cv_stagetitle);
|
||||
|
||||
CV_RegisterVar(&cv_lessflicker);
|
||||
|
||||
CV_RegisterVar(&cv_mouseturn);
|
||||
|
||||
}
|
||||
|
||||
//}
|
||||
|
||||
+38
-10
@@ -1166,9 +1166,11 @@ static menuitem_t OP_ControlsMenu[] =
|
||||
|
||||
{IT_CALL | IT_STRING, NULL, "Player 3 Controls...", &M_Setup3PControlsMenu, 30},
|
||||
{IT_CALL | IT_STRING, NULL, "Player 4 Controls...", &M_Setup4PControlsMenu, 40},
|
||||
|
||||
{IT_SUBMENU | IT_STRING, NULL, "Mouse Options...", &OP_MouseOptionsDef, 60},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 60},
|
||||
{IT_STRING | IT_CVAR, NULL, "Digital turn easing", &cv_turnsmooth, 70},
|
||||
{IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 80},
|
||||
{IT_STRING | IT_CVAR, NULL, "Digital turn easing", &cv_turnsmooth, 90},
|
||||
};
|
||||
|
||||
static const char* OP_ControlsTooltips[] =
|
||||
@@ -1179,6 +1181,9 @@ static const char* OP_ControlsTooltips[] =
|
||||
"Setup player 3 controls.",
|
||||
"Setup player 4 controls.",
|
||||
|
||||
"Options for mouse control.",
|
||||
|
||||
|
||||
"Allowed amount of controls per key.",
|
||||
"Turn smoothing for non-analog turning.",
|
||||
|
||||
@@ -1298,22 +1303,34 @@ static menuitem_t OP_JoystickSetMenu[] =
|
||||
{IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, (LINEHEIGHT*8)+5},
|
||||
};
|
||||
|
||||
/*static menuitem_t OP_MouseOptionsMenu[] =
|
||||
//WTF
|
||||
static menuitem_t OP_MouseOptionsMenu[] =
|
||||
{
|
||||
{IT_STRING | IT_CVAR, NULL, "Use Mouse", &cv_usemouse, 10},
|
||||
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "First-Person MouseLook", &cv_alwaysfreelook, 30},
|
||||
{IT_STRING | IT_CVAR, NULL, "Third-Person MouseLook", &cv_chasefreelook, 40},
|
||||
{IT_STRING | IT_CVAR, NULL, "Mouse Move", &cv_mousemove, 50},
|
||||
{IT_STRING | IT_CVAR, NULL, "Invert Mouse", &cv_invertmouse, 60},
|
||||
//{IT_STRING | IT_CVAR, NULL, "First-Person MouseLook", &cv_alwaysfreelook, 30},
|
||||
//{IT_STRING | IT_CVAR, NULL, "Third-Person MouseLook", &cv_chasefreelook, 40},
|
||||
{IT_STRING | IT_CVAR, NULL, "Mouse Turning", &cv_mouseturn, 20},
|
||||
{IT_STRING | IT_CVAR, NULL, "Invert Mouse", &cv_invertmouse, 30},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
|
||||
NULL, "Mouse X Speed", &cv_mousesens, 70},
|
||||
NULL, "Mouse X Speed", &cv_mousesens, 40},
|
||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
|
||||
NULL, "Mouse Y Speed", &cv_mouseysens, 80},
|
||||
NULL, "Mouse Y Speed", &cv_mouseysens, 50},
|
||||
};
|
||||
|
||||
static menuitem_t OP_Mouse2OptionsMenu[] =
|
||||
static const char* OP_MouseTooltips[] =
|
||||
{
|
||||
|
||||
"Enable the use of the mouse.",
|
||||
"Turn using the mouse.",
|
||||
"Invert mouse movements.",
|
||||
"Mouse horizontal sensitivity.",
|
||||
"Mouse vertical sensitivity.",
|
||||
|
||||
};
|
||||
|
||||
/*static menuitem_t OP_Mouse2OptionsMenu[] =
|
||||
{
|
||||
{IT_STRING | IT_CVAR, NULL, "Use Mouse 2", &cv_usemouse2, 10},
|
||||
{IT_STRING | IT_CVAR, NULL, "Second Mouse Serial Port",
|
||||
@@ -2648,6 +2665,8 @@ menu_t OP_MainDef =
|
||||
};
|
||||
|
||||
menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30);
|
||||
//WTF
|
||||
menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_ControlsDef, 60, 30);
|
||||
menu_t OP_AllControlsDef = CONTROLMENUSTYLE(OP_AllControlsMenu, &OP_ControlsDef);
|
||||
menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_AllControlsDef, 60, 30);
|
||||
menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_AllControlsDef, 60, 30);
|
||||
@@ -4866,6 +4885,15 @@ static void M_DrawGenericMenu(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (currentMenu == &OP_MouseOptionsDef)
|
||||
{
|
||||
if (!(OP_MouseTooltips[itemOn] == NULL))
|
||||
{
|
||||
M_DrawSplitText(BASEVIDWIDTH / 2, BASEVIDHEIGHT-50, V_ALLOWLOWERCASE|V_SNAPTOBOTTOM, OP_MouseTooltips[itemOn], 30, coolalphatimer);
|
||||
if (coolalphatimer > 0 && interpTimerHackAllow)
|
||||
coolalphatimer--;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentMenu == &OP_VideoOptionsDef)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user