- in_mousebias and in_mousedeadzone

Actually, two totally useless options being preserved for historical significance.

Urgh.
This commit is contained in:
Christoph Oelckers 2019-10-23 00:55:48 +02:00
parent c0c62fe367
commit b73cf76f05
11 changed files with 60 additions and 69 deletions

View file

@ -56,7 +56,6 @@ BEGIN_BLD_NS
hashtable_t h_gamefuncs = { NUMGAMEFUNCTIONS<<1, NULL };
int32_t MouseDeadZone, MouseBias;
int32_t SmoothInput;
int32_t MouseFunctions[MAXMOUSEBUTTONS][2];
int32_t MouseDigitalFunctions[MAXMOUSEAXES][2];
@ -280,8 +279,6 @@ void CONFIG_SetDefaults(void)
//snd_ambience = 1;
//ud.config.AutoAim = 1;
CheckForUpdates = 1;
MouseBias = 0;
MouseDeadZone = 0;
gBrightness = 8;
//ud.config.ShowWeapons = 0;
SmoothInput = 1;

View file

@ -38,7 +38,6 @@ BEGIN_BLD_NS
#define MAXPLAYERNAME 16
#define MAXMOUSEAXES 2
extern int32_t MouseDeadZone, MouseBias;
extern int32_t SmoothInput;
extern int32_t MouseFunctions[MAXMOUSEBUTTONS][2];
extern int32_t MouseDigitalFunctions[MAXMOUSEAXES][2];

View file

@ -217,25 +217,25 @@ void ctrlGetInput(void)
CONTROL_GetInput(&info);
if (MouseDeadZone)
if (in_mousedeadzone)
{
if (info.mousey > 0)
info.mousey = max(info.mousey - MouseDeadZone, 0);
info.mousey = max(info.mousey - in_mousedeadzone, 0);
else if (info.mousey < 0)
info.mousey = min(info.mousey + MouseDeadZone, 0);
info.mousey = min(info.mousey + in_mousedeadzone, 0);
if (info.mousex > 0)
info.mousex = max(info.mousex - MouseDeadZone, 0);
info.mousex = max(info.mousex - in_mousedeadzone, 0);
else if (info.mousex < 0)
info.mousex = min(info.mousex + MouseDeadZone, 0);
info.mousex = min(info.mousex + in_mousedeadzone, 0);
}
if (MouseBias)
if (in_mousebias)
{
if (klabs(info.mousex) > klabs(info.mousey))
info.mousey = tabledivide32_noinline(info.mousey, MouseBias);
info.mousey = tabledivide32_noinline(info.mousey, in_mousebias);
else
info.mousex = tabledivide32_noinline(info.mousex, MouseBias);
info.mousex = tabledivide32_noinline(info.mousex, in_mousebias);
}
if (gQuitRequest)

View file

@ -230,20 +230,27 @@ CUSTOM_CVARD(Bool, in_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCAL
CONTROL_MouseEnabled = (self && CONTROL_MousePresent);
}
CVARD(Bool, in_aimmode, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "0:toggle, 1:hold to aim")// (void *)&ud.mouseaiming, CVAR_BOOL, 0, 1 },
CVARD(Bool, in_aimmode, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "0:toggle, 1:hold to aim")
CUSTOM_CVARD(Int, in_mousebias, 0, CVAR_INT|CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time")
{
if (self < 0) self = 0;
else if (self > 32) self = 32;
}
CUSTOM_CVARD(Int, in_mousedeadzone, 0, CVAR_INT|CVAR_GLOBALCONFIG|CVAR_ARCHIVE, "amount of mouse movement to filter out")
{
if (self < 0) self = 0;
else if (self > 512) self = 512;
}
#if 0
{ "in_aimmode", "0:toggle, 1:hold to aim", (void *)&gMouseAiming, CVAR_BOOL, 0, 1 },
// DN3D
static osdcvardata_t cvars_game[] =
{
"in_mousebias", "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time",
(void *)&ud.config.MouseBias, CVAR_INT, 0, 32
},
{ "in_mousedeadzone", "amount of mouse movement to filter out", (void *)&ud.config.MouseDeadZone, CVAR_INT, 0, 512 },
{ "in_mouseflip", "invert vertical mouse movement", (void *)&ud.mouseflip, CVAR_BOOL, 0, 1 },
{ "in_mousemode", "toggles vertical mouse view", (void *)&g_myAimMode, CVAR_BOOL, 0, 1 },
{ "in_mousesmoothing", "enable/disable mouse input smoothing", (void *)&ud.config.SmoothInput, CVAR_BOOL, 0, 1 },
@ -289,11 +296,6 @@ CVARD(Bool, in_aimmode, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "0:toggle, 1:hold
static osdcvardata_t cvars_game[] =
{
{
"in_mousebias", "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time",
(void *)&ud.config.MouseBias, CVAR_INT, 0, 32
},
{ "in_mousedeadzone", "amount of mouse movement to filter out", (void *)&ud.config.MouseDeadZone, CVAR_INT, 0, 512 },
{ "in_mouseflip", "invert vertical mouse movement", (void *)&ud.mouseflip, CVAR_BOOL, 0, 1 },
{ "in_mousemode", "toggles vertical mouse view", (void *)&g_myAimMode, CVAR_BOOL, 0, 1 },
{ "in_mousesmoothing", "enable/disable mouse input smoothing", (void *)&ud.config.SmoothInput, CVAR_BOOL, 0, 1 },
@ -342,11 +344,6 @@ int32_t registerosdcommands(void)
char buffer[256];
static osdcvardata_t cvars_game[] =
{
{
"in_mousebias", "emulates the original mouse code's weighting of input towards whichever axis is moving the most at any given time",
(void *)&MouseBias, CVAR_INT, 0, 32
},
{ "in_mousedeadzone", "amount of mouse movement to filter out", (void *)&MouseDeadZone, CVAR_INT, 0, 512 },
{ "in_mouseflip", "invert vertical mouse movement", (void *)&gMouseAimingFlipped, CVAR_BOOL, 0, 1 },
{ "in_mousemode", "toggles vertical mouse view", (void *)&gMouseAim, CVAR_BOOL, 0, 1 },
{ "in_mousesmoothing", "enable/disable mouse input smoothing", (void *)&SmoothInput, CVAR_BOOL, 0, 1 },

View file

@ -56,10 +56,13 @@ EXTERN_CVAR(Bool, hud_stats)
EXTERN_CVAR(Bool, hud_showmapname)
EXTERN_CVAR(Int, r_fov)
EXTERN_CVAR(r_horizcenter)
EXTERN_CVAR(Bool, r_horizcenter)
EXTERN_CVAR(in_joystick)
EXTERN_CVAR(in_mouse)
EXTERN_CVAR(Bool, in_joystick)
EXTERN_CVAR(Bool, in_mouse)
EXTERN_CVAR(Int, in_aimmode)
EXTERN_CVAR(Int, in_mousebias)
EXTERN_CVAR(Int, in_mousedeadzone)
extern int hud_statusbarrange; // will be set by the game's configuration setup.
bool G_ChangeHudLayout(int direction);

View file

@ -243,8 +243,6 @@ void CONFIG_SetDefaults(void)
ud.camerasprite = -1;
ud.color = 0;
ud.config.CheckForUpdates = 1;
ud.config.MouseBias = 0;
ud.config.MouseDeadZone = 0;
ud.config.ShowWeapons = 0;
ud.config.SmoothInput = 1;
ud.config.useprecache = 1;

View file

@ -219,7 +219,6 @@ typedef struct {
struct {
int32_t AutoAim;
int32_t ShowWeapons;
int32_t MouseDeadZone,MouseBias;
int32_t SmoothInput;
// JBF 20031211: Store the input settings because

View file

@ -2923,25 +2923,25 @@ void P_GetInput(int const playerNum)
CONTROL_GetInput(&info);
if (ud.config.MouseDeadZone)
if (in_mousedeadzone)
{
if (info.mousey > 0)
info.mousey = max(info.mousey - ud.config.MouseDeadZone, 0);
info.mousey = max(info.mousey - in_mousedeadzone, 0);
else if (info.mousey < 0)
info.mousey = min(info.mousey + ud.config.MouseDeadZone, 0);
info.mousey = min(info.mousey + in_mousedeadzone, 0);
if (info.mousex > 0)
info.mousex = max(info.mousex - ud.config.MouseDeadZone, 0);
info.mousex = max(info.mousex - in_mousedeadzone, 0);
else if (info.mousex < 0)
info.mousex = min(info.mousex + ud.config.MouseDeadZone, 0);
info.mousex = min(info.mousex + in_mousedeadzone, 0);
}
if (ud.config.MouseBias)
if (in_mousebias)
{
if (klabs(info.mousex) > klabs(info.mousey))
info.mousey = tabledivide32_noinline(info.mousey, ud.config.MouseBias);
info.mousey = tabledivide32_noinline(info.mousey, in_mousebias);
else
info.mousex = tabledivide32_noinline(info.mousex, ud.config.MouseBias);
info.mousex = tabledivide32_noinline(info.mousex, in_mousebias);
}
// JBF: Run key behaviour is selectable

View file

@ -212,8 +212,7 @@ void CONFIG_SetDefaults(void)
ud.setup.bpp = 8;
#endif
ud.config.useprecache = 1;
ud.config.MouseBias = 0;
ud.config.MouseDeadZone = 0;
in_mousebias = 0;
g_myAimMode = g_player[0].ps->aim_mode = 1;
ud.config.ShowOpponentWeapons = 0;
ud.config.SmoothInput = 1;

View file

@ -194,7 +194,6 @@ typedef struct {
struct {
int32_t AutoAim;
int32_t ShowOpponentWeapons;
int32_t MouseDeadZone,MouseBias;
int32_t SmoothInput;
// JBF 20031211: Store the input settings because

View file

@ -2773,25 +2773,25 @@ void P_GetInput(int playerNum)
CONTROL_GetInput(&info);
if (ud.config.MouseDeadZone)
if (in_mousedeadzone)
{
if (info.mousey > 0)
info.mousey = max(info.mousey - ud.config.MouseDeadZone, 0);
info.mousey = max(info.mousey - in_mousedeadzone, 0);
else if (info.mousey < 0)
info.mousey = min(info.mousey + ud.config.MouseDeadZone, 0);
info.mousey = min(info.mousey + in_mousedeadzone, 0);
if (info.mousex > 0)
info.mousex = max(info.mousex - ud.config.MouseDeadZone, 0);
info.mousex = max(info.mousex - in_mousedeadzone, 0);
else if (info.mousex < 0)
info.mousex = min(info.mousex + ud.config.MouseDeadZone, 0);
info.mousex = min(info.mousex + in_mousedeadzone, 0);
}
if (ud.config.MouseBias)
if (in_mousebias)
{
if (klabs(info.mousex) > klabs(info.mousey))
info.mousey = tabledivide32_noinline(info.mousey, ud.config.MouseBias);
info.mousey = tabledivide32_noinline(info.mousey, in_mousebias);
else
info.mousex = tabledivide32_noinline(info.mousex, ud.config.MouseBias);
info.mousex = tabledivide32_noinline(info.mousex, in_mousebias);
}
// JBF: Run key behaviour is selectable
@ -3079,25 +3079,25 @@ void P_GetInputMotorcycle(int playerNum)
CONTROL_GetInput(&info);
if (ud.config.MouseDeadZone)
if (in_mousedeadzone)
{
if (info.mousey > 0)
info.mousey = max(info.mousey - ud.config.MouseDeadZone, 0);
info.mousey = max(info.mousey - in_mousedeadzone, 0);
else if (info.mousey < 0)
info.mousey = min(info.mousey + ud.config.MouseDeadZone, 0);
info.mousey = min(info.mousey + in_mousedeadzone, 0);
if (info.mousex > 0)
info.mousex = max(info.mousex - ud.config.MouseDeadZone, 0);
info.mousex = max(info.mousex - in_mousedeadzone, 0);
else if (info.mousex < 0)
info.mousex = min(info.mousex + ud.config.MouseDeadZone, 0);
info.mousex = min(info.mousex + in_mousedeadzone, 0);
}
if (ud.config.MouseBias)
if (in_mousebias)
{
if (klabs(info.mousex) > klabs(info.mousey))
info.mousey = tabledivide32_noinline(info.mousey, ud.config.MouseBias);
info.mousey = tabledivide32_noinline(info.mousey, in_mousebias);
else
info.mousex = tabledivide32_noinline(info.mousex, ud.config.MouseBias);
info.mousex = tabledivide32_noinline(info.mousex, in_mousebias);
}
// JBF: Run key behaviour is selectable
@ -3377,25 +3377,25 @@ void P_GetInputBoat(int playerNum)
CONTROL_GetInput(&info);
if (ud.config.MouseDeadZone)
if (in_mousedeadzone)
{
if (info.mousey > 0)
info.mousey = max(info.mousey - ud.config.MouseDeadZone, 0);
info.mousey = max(info.mousey - in_mousedeadzone, 0);
else if (info.mousey < 0)
info.mousey = min(info.mousey + ud.config.MouseDeadZone, 0);
info.mousey = min(info.mousey + in_mousedeadzone, 0);
if (info.mousex > 0)
info.mousex = max(info.mousex - ud.config.MouseDeadZone, 0);
info.mousex = max(info.mousex - in_mousedeadzone, 0);
else if (info.mousex < 0)
info.mousex = min(info.mousex + ud.config.MouseDeadZone, 0);
info.mousex = min(info.mousex + in_mousedeadzone, 0);
}
if (ud.config.MouseBias)
if (in_mousebias)
{
if (klabs(info.mousex) > klabs(info.mousey))
info.mousey = tabledivide32_noinline(info.mousey, ud.config.MouseBias);
info.mousey = tabledivide32_noinline(info.mousey, in_mousebias);
else
info.mousex = tabledivide32_noinline(info.mousex, ud.config.MouseBias);
info.mousex = tabledivide32_noinline(info.mousex, in_mousebias);
}
// JBF: Run key behaviour is selectable