fix ldflags typo and other compile errors

This commit is contained in:
2024-01-27 16:54:07 +01:00
parent a71a5ea2bc
commit 22e19c7a97
3 changed files with 20 additions and 26 deletions

View File

@@ -2,7 +2,7 @@
namespace blitz { namespace blitz {
struct EMASmoother { class EMASmoother {
private: private:
float Alpha; float Alpha;
public: public:

View File

@@ -1,36 +1,30 @@
#include <cmath>> #include <cmath>
#include <cassert> #include <cassert>
#include "blitz/common/Smoothing.h"
namespace blitz { namespace blitz {
struct EMASmoother { EMASmoother::EMASmoother() : Alpha(1.0f), Current(0.0f) {}
private:
float Alpha;
public:
float Current;
EMASmoother::EMASmoother() : Alpha(1.0f), Current(0.0f) {} void EMASmoother::TickUnitT(float target) {
Current += Alpha * (target - Current);
}
void TickUnitT(float target) { void EMASmoother::Tick(float target, float delta) {
Current += Alpha * (target - Current); Current += std::powf(Alpha, delta) * (target - Current);
} }
void Tick(float target, float delta) { float EMASmoother::GetAlpha() {
Current += std::powf(Alpha, delta) * (target - Current); return Alpha;
} }
float GetAlpha() { void EMASmoother::SetAlpha(float alpha) {
return Alpha; assert(0.0f < alpha && alpha <= 1.0f);
} Alpha = alpha;
}
void SetAlpha(float alpha) { void EMASmoother::SetSmoothingTime(float t) {
assert(0.0f < alpha && alpha <= 1.0f); Alpha = 0.999f;
Alpha = alpha;
}
void SetSmoothingTime(float t) {
Alpha = 0.999f;
}
}; };
} }

View File

@@ -64,7 +64,7 @@ target("BlitzClient")
if is_plat("macosx") then if is_plat("macosx") then
add_frameworks("OpenGL") add_frameworks("OpenGL")
elseif is_plat("windows") then elseif is_plat("windows") then
add_ldflags("/LCTG") -- fix compiltation of glbinding add_ldflags("/LTCG") -- fix compiltation of glbinding
end end
-- Assets -- Assets