16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 13:39:18 +02:00

reformat: use auto on certain types

This commit is contained in:
jerrrrycho
2026-07-04 05:22:52 +02:00
parent f61068ff89
commit 20e7a99516
118 changed files with 2118 additions and 2063 deletions

View File

@@ -45,10 +45,10 @@ void TCamera::OnCursorMove(double x, double y) {
}
static double ComputeAxisSpeed(double param, double walkspeed, double maxspeed, double threshold) {
double absval = std::abs(param);
const double absval = std::abs(param);
// 2/3rd of the stick range lerps walk speed, past that we lerp between max walk and run speed
double walk = walkspeed * std::min(absval / threshold, 1.0);
double run = std::max(0.0, absval - threshold) / (1.0 - threshold) * std::max(0.0, maxspeed - walkspeed);
const double walk = walkspeed * std::min(absval / threshold, 1.0);
const double run = std::max(0.0, absval - threshold) / (1.0 - threshold) * std::max(0.0, maxspeed - walkspeed);
return (param >= 0.0 ? 1.0 : -1.0) * (walk + run);
}