mirror of
https://github.com/perfect-dark-pc-port/perfect_dark.git
synced 2026-10-23 15:52:41 +02:00
fixed Mouse Sensitivity affecting FOV Slider
Your mouse sens scale should now behave exactly the same, regardless of FOV Slider
This commit is contained in:
1 parent
8bfaaf63ed
commit
a1136f4d61
1 file changed
+82
-82
+82
-82
@@ -328,112 +328,112 @@ void bmoveUpdateSpeedTheta(void)
|
|||||||
|
|
||||||
f32 bmoveGetSpeedVertaLimit(f32 value)
|
f32 bmoveGetSpeedVertaLimit(f32 value)
|
||||||
{
|
{
|
||||||
if (value > 0) {
|
if (value > 0) {
|
||||||
return (viGetFovY() * value * -0.7f) / 60.0f;
|
return (value * -0.7f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
return (viGetFovY() * -value * 0.7f) / 60.0f;
|
return (-value * 0.7f);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bmoveUpdateSpeedVerta(f32 value)
|
void bmoveUpdateSpeedVerta(f32 value)
|
||||||
{
|
{
|
||||||
f32 mult = viGetFovY() / 60.0f;
|
f32 mult = 1.0f;
|
||||||
f32 limit = bmoveGetSpeedVertaLimit(value);
|
f32 limit = bmoveGetSpeedVertaLimit(value);
|
||||||
|
|
||||||
if (value > 0) {
|
if (value > 0) {
|
||||||
if (g_Vars.currentplayer->speedverta > 0) {
|
if (g_Vars.currentplayer->speedverta > 0) {
|
||||||
g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult;
|
||||||
} else {
|
} else {
|
||||||
g_Vars.currentplayer->speedverta -= 0.0125f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedverta -= 0.0125f * g_Vars.lvupdate60freal * mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_Vars.currentplayer->speedverta < limit) {
|
if (g_Vars.currentplayer->speedverta < limit) {
|
||||||
g_Vars.currentplayer->speedverta = limit;
|
g_Vars.currentplayer->speedverta = limit;
|
||||||
}
|
}
|
||||||
} else if (value < 0) {
|
} else if (value < 0) {
|
||||||
if (g_Vars.currentplayer->speedverta < 0) {
|
if (g_Vars.currentplayer->speedverta < 0) {
|
||||||
g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult;
|
||||||
} else {
|
} else {
|
||||||
g_Vars.currentplayer->speedverta += 0.0125f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedverta += 0.0125f * g_Vars.lvupdate60freal * mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_Vars.currentplayer->speedverta > limit) {
|
if (g_Vars.currentplayer->speedverta > limit) {
|
||||||
g_Vars.currentplayer->speedverta = limit;
|
g_Vars.currentplayer->speedverta = limit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (g_Vars.currentplayer->speedverta > limit) {
|
if (g_Vars.currentplayer->speedverta > limit) {
|
||||||
g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedverta -= 0.05f * g_Vars.lvupdate60freal * mult;
|
||||||
|
|
||||||
if (g_Vars.currentplayer->speedverta < limit) {
|
if (g_Vars.currentplayer->speedverta < limit) {
|
||||||
g_Vars.currentplayer->speedverta = limit;
|
g_Vars.currentplayer->speedverta = limit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedverta += 0.05f * g_Vars.lvupdate60freal * mult;
|
||||||
|
|
||||||
if (g_Vars.currentplayer->speedverta > limit) {
|
if (g_Vars.currentplayer->speedverta > limit) {
|
||||||
g_Vars.currentplayer->speedverta = limit;
|
g_Vars.currentplayer->speedverta = limit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
f32 bmoveGetSpeedThetaControlLimit(f32 value)
|
f32 bmoveGetSpeedThetaControlLimit(f32 value)
|
||||||
{
|
{
|
||||||
if (value > 0) {
|
if (value > 0) {
|
||||||
return (viGetFovY() * value * -0.7f) / 60.0f;
|
return (value * -0.7f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value < 0) {
|
if (value < 0) {
|
||||||
return (viGetFovY() * -value * 0.7f) / 60.0f;
|
return (-value * 0.7f);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bmoveUpdateSpeedThetaControl(f32 value)
|
void bmoveUpdateSpeedThetaControl(f32 value)
|
||||||
{
|
{
|
||||||
f32 mult = viGetFovY() / 60.0f;
|
f32 mult = 1.0f;
|
||||||
f32 limit = bmoveGetSpeedThetaControlLimit(value);
|
f32 limit = bmoveGetSpeedThetaControlLimit(value);
|
||||||
|
|
||||||
if (value > 0) {
|
if (value > 0) {
|
||||||
if (g_Vars.currentplayer->speedthetacontrol > 0) {
|
if (g_Vars.currentplayer->speedthetacontrol > 0) {
|
||||||
g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult;
|
||||||
} else {
|
} else {
|
||||||
g_Vars.currentplayer->speedthetacontrol -= 0.0125f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedthetacontrol -= 0.0125f * g_Vars.lvupdate60freal * mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_Vars.currentplayer->speedthetacontrol < limit) {
|
if (g_Vars.currentplayer->speedthetacontrol < limit) {
|
||||||
g_Vars.currentplayer->speedthetacontrol = limit;
|
g_Vars.currentplayer->speedthetacontrol = limit;
|
||||||
}
|
}
|
||||||
} else if (value < 0) {
|
} else if (value < 0) {
|
||||||
if (g_Vars.currentplayer->speedthetacontrol < 0.0f) {
|
if (g_Vars.currentplayer->speedthetacontrol < 0.0f) {
|
||||||
g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult;
|
||||||
} else {
|
} else {
|
||||||
g_Vars.currentplayer->speedthetacontrol += 0.0125f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedthetacontrol += 0.0125f * g_Vars.lvupdate60freal * mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_Vars.currentplayer->speedthetacontrol > limit) {
|
if (g_Vars.currentplayer->speedthetacontrol > limit) {
|
||||||
g_Vars.currentplayer->speedthetacontrol = limit;
|
g_Vars.currentplayer->speedthetacontrol = limit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (g_Vars.currentplayer->speedthetacontrol > limit) {
|
if (g_Vars.currentplayer->speedthetacontrol > limit) {
|
||||||
g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedthetacontrol -= 0.05f * g_Vars.lvupdate60freal * mult;
|
||||||
|
|
||||||
if (g_Vars.currentplayer->speedthetacontrol < limit) {
|
if (g_Vars.currentplayer->speedthetacontrol < limit) {
|
||||||
g_Vars.currentplayer->speedthetacontrol = limit;
|
g_Vars.currentplayer->speedthetacontrol = limit;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult;
|
g_Vars.currentplayer->speedthetacontrol += 0.05f * g_Vars.lvupdate60freal * mult;
|
||||||
|
|
||||||
if (g_Vars.currentplayer->speedthetacontrol > limit) {
|
if (g_Vars.currentplayer->speedthetacontrol > limit) {
|
||||||
g_Vars.currentplayer->speedthetacontrol = limit;
|
g_Vars.currentplayer->speedthetacontrol = limit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2032,7 +2032,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (movedata.cannaturalpitch) {
|
if (movedata.cannaturalpitch) {
|
||||||
tmp = viGetFovY() / 60.0f;
|
tmp = 1.0f;
|
||||||
fVar25 = movedata.analogpitch / 70.0f;
|
fVar25 = movedata.analogpitch / 70.0f;
|
||||||
|
|
||||||
if (fVar25 > 1) {
|
if (fVar25 > 1) {
|
||||||
@@ -2073,7 +2073,7 @@ void bmoveProcessInput(bool allowc1x, bool allowc1y, bool allowc1buttons, bool i
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (movedata.cannaturalturn) {
|
if (movedata.cannaturalturn) {
|
||||||
tmp = viGetFovY() / 60.0f;
|
tmp = 1.0f;
|
||||||
fVar25 = movedata.analogturn / 70.0f;
|
fVar25 = movedata.analogturn / 70.0f;
|
||||||
|
|
||||||
if (fVar25 > 1) {
|
if (fVar25 > 1) {
|
||||||
|
|||||||
Reference in new issue
Block a user