Merge pull request #70 from squiddingme/crosshair

Config option to control crosshair/gun sway
This commit is contained in:
fgsfds authored and GitHub committed 2023-08-30 12:15:57 +02:00
commit 4947350230
3 files changed
+10 -2

No files matched your search

+4
View File
@@ -130,6 +130,8 @@ static const char *vkJoyNames[] = {
static char vkNames[VK_TOTAL_COUNT][64];
f32 crosshairSway = 1.f;
void inputSetDefaultKeyBinds(void)
{
// TODO: make VK constants for all these
@@ -459,6 +461,8 @@ s32 inputInit(void)
inputLoadBinds();
crosshairSway = configGetFloat("Input.CrosshairSway", 1.f);
return connectedMask;
}
+2 -2
View File
@@ -1999,8 +1999,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
View File
@@ -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);