port: allow user to go back to the original crouch controls

set Game.ClassicCrouch=1
This commit is contained in:
fgsfds committed 2023-10-22 15:17:47 +02:00
1 parent 8347900d33
commit 4c1076080d
4 files changed
+16 -5

No files matched your search

+1
View File
@@ -75,6 +75,7 @@ static void gameLoadConfig(void)
g_PlayerMouseAimSpeedY = configGetFloatClamped("Game.MouseAimSpeedY", g_PlayerMouseAimSpeedY, 0.f, 10.f);
g_PlayerFovAffectsZoom = configGetIntClamped("Game.FovAffectsZoom", g_PlayerFovAffectsZoom, 0, 1);
g_PlayerFovZoomMultiplier = g_PlayerFovAffectsZoom ? g_PlayerDefaultFovY / 60.0f : 1.0f;
g_PlayerClassicCrouch = configGetIntClamped("Game.ClassicCrouch", 0, 0, 1);
g_ViShakeIntensityMult = configGetFloatClamped("Game.ScreenShakeIntensity", 1.f, 0.f, 100.f);
const s32 center = configGetIntClamped("Game.CenterHUD", 0, 0, 1);
if (center) {
+13 -5
View File
@@ -1628,12 +1628,17 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
movedata.zoominfovpersec = increment;
}
}
#endif
// Handle crouch and uncrouch
if (allowc1buttons) {
// Handle C-button and analog crouch and uncrouch, if enabled
if (g_PlayerClassicCrouch && allowc1buttons) {
for (i = 0; i < numsamples; i++) {
if (!canmanualzoom && aimonhist[i]) {
if (joyGetButtonsPressedOnSample(i, contpad1, c1allowedbuttons & (U_CBUTTONS))) {
bool goUp = joyGetButtonsPressedOnSample(i, contpad1, c1allowedbuttons & (U_CBUTTONS));
#ifndef PLATFORM_N64
goUp = goUp || ((joyGetRStickYOnSample(i, contpad1) > 30 && joyGetRStickYOnSampleIndex(i, contpad1) <= 30));
#endif
if (goUp) {
if (movedata.crouchdown) {
movedata.crouchdown--;
} else {
@@ -1643,7 +1648,11 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
g_Vars.currentplayer->aimtaptime = -1;
}
if (joyGetButtonsPressedOnSample(i, contpad1, c1allowedbuttons & (D_CBUTTONS))) {
bool goDn = joyGetButtonsPressedOnSample(i, contpad1, c1allowedbuttons & (D_CBUTTONS));
#ifndef PLATFORM_N64
goDn = goDn || ((joyGetRStickYOnSample(i, contpad1) < -30 && joyGetRStickYOnSampleIndex(i, contpad1) >= -30));
#endif
if (goDn) {
if (movedata.crouchup) {
movedata.crouchup--;
} else {
@@ -1675,7 +1684,6 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
}
}
}
#endif
// Handle shutting eyes in multiplayer
if (bmoveGetCrouchPos() == CROUCHPOS_SQUAT
+1
View File
@@ -210,6 +210,7 @@ f32 g_PlayerMouseAimSpeedX = 0.75f;
f32 g_PlayerMouseAimSpeedY = 0.75f;
s32 g_PlayerFovAffectsZoom = 1;
f32 g_PlayerFovZoomMultiplier = 1.0f;
s32 g_PlayerClassicCrouch = true;
#endif
/**
+1
View File
@@ -542,6 +542,7 @@ extern f32 g_PlayerMouseAimSpeedX;
extern f32 g_PlayerMouseAimSpeedY;
extern s32 g_PlayerFovAffectsZoom;
extern f32 g_PlayerFovZoomMultiplier;
extern s32 g_PlayerClassicCrouch;
extern f32 g_ViShakeIntensityMult;
extern u32 g_TexFilter2D;
extern u32 g_HudAlignModeL;