update: move avg consts into constants

This commit is contained in:
alexei-zebra 2025-12-23 18:22:14 +03:00
parent 79e46a1017
commit 976a9ff350
2 changed files with 6 additions and 4 deletions

View file

@ -73,3 +73,6 @@ inline const std::string SKELETONS_FOLDER = "skeletons";
inline const std::string POST_EFFECTS_FOLDER = "shaders/effects";
inline const std::string FONT_DEFAULT = "normal";
inline const float AVG_ALPHA = 0.1;
inline const float AVG_BETA = 0.01;

View file

@ -1,3 +1,4 @@
#include "constants.hpp"
#include "audio/audio.hpp"
#include "delegates.hpp"
#include "engine/Engine.hpp"
@ -74,8 +75,6 @@ std::shared_ptr<UINode> create_debug_panel(
static int fpsMaxOld = fpsMax;
static float fpsAvgFast = fps;
static float fpsAvgLong = fps;
static float fpsAvgAlpha = 0.1;
static float fpsAvgBeta = 0.01;
static std::wstring fpsString = L"";
static size_t lastTotalDownload = 0;
@ -86,8 +85,8 @@ std::shared_ptr<UINode> create_debug_panel(
fps = 1.0f / engine.getTime().getDelta();
fpsMin = std::min(fps, fpsMin);
fpsMax = std::max(fps, fpsMax);
fpsAvgFast = fpsAvgFast * (1 - fpsAvgAlpha) + fps * fpsAvgAlpha;
fpsAvgLong = fpsAvgLong * (1 - fpsAvgBeta) + fps * fpsAvgBeta;
fpsAvgFast = fpsAvgFast * (1 - AVG_ALPHA) + fps * AVG_ALPHA;
fpsAvgLong = fpsAvgLong * (1 - AVG_BETA) + fps * AVG_BETA;
});
panel->listenInterval(2.0f, []() {