Add config option to control crosshair/gun sway
This commit is contained in:
parent
58e13db613
commit
d9beab0c8b
|
|
@ -55,6 +55,7 @@ struct configentry {
|
|||
{ "Input.RumbleScale", CONFIG_F32, { .f32val = 0.333f } },
|
||||
{ "Input.FirstGamepadNum", CONFIG_S32, { .s32val = 0 } },
|
||||
{ "Input.FakeGamepads", CONFIG_S32, { .s32val = 0 } },
|
||||
{ "Input.CrosshairSway", CONFIG_F32, { .f32val = 1.f } },
|
||||
/* Game */
|
||||
{ "Game.BaseDir", CONFIG_STR, { .strval = "./data" } },
|
||||
{ "Game.MemorySize", CONFIG_S32, { .s32val = 16 } },
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ static s32 deadzone[4] = {
|
|||
|
||||
static s32 stickCButtons = 1;
|
||||
|
||||
f32 crosshairSway = 1.f;
|
||||
|
||||
void inputSetDefaultKeyBinds(void)
|
||||
{
|
||||
// TODO: make VK constants for all these
|
||||
|
|
@ -243,6 +245,8 @@ s32 inputInit(void)
|
|||
connectedMask = overrideMask;
|
||||
}
|
||||
|
||||
crosshairSway = configGetFloat("Input.CrosshairSway", 1.f);
|
||||
|
||||
return connectedMask;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1939,8 +1939,8 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
|||
xscale = 1.f;
|
||||
yscale = 1.f;
|
||||
}
|
||||
x = g_Vars.currentplayer->speedtheta * 0.3f * xscale + g_Vars.currentplayer->gunextraaimx;
|
||||
y = -g_Vars.currentplayer->speedverta * 0.1f * yscale + g_Vars.currentplayer->gunextraaimy;
|
||||
x = g_Vars.currentplayer->speedtheta * 0.3f * crosshairSway * xscale + g_Vars.currentplayer->gunextraaimx;
|
||||
y = -g_Vars.currentplayer->speedverta * 0.1f * crosshairSway * yscale + g_Vars.currentplayer->gunextraaimy;
|
||||
#endif
|
||||
|
||||
bgunSwivelWithDamp(x, y, PAL ? 0.955f : 0.963f);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@
|
|||
#include "data.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
extern f32 crosshairSway;
|
||||
#endif
|
||||
|
||||
void bmoveSetControlDef(u32 controldef);
|
||||
void bmoveSetAutoMoveCentreEnabled(bool enabled);
|
||||
void bmoveSetAutoAimY(bool enabled);
|
||||
|
|
|
|||
Loading…
Reference in New Issue