mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-24 00:02:43 +02:00
Add config option to control crosshair/gun sway
This commit is contained in:
1 parent
66443dd2c2
commit
3f562c3009
3 files changed
+10
-2
No files matched your search
@@ -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
@@ -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,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);
|
||||
|
||||
Reference in new issue
Block a user