mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 22:41:49 +00:00
update: move avg consts into constants
This commit is contained in:
parent
79e46a1017
commit
976a9ff350
2 changed files with 6 additions and 4 deletions
|
|
@ -73,3 +73,6 @@ inline const std::string SKELETONS_FOLDER = "skeletons";
|
||||||
inline const std::string POST_EFFECTS_FOLDER = "shaders/effects";
|
inline const std::string POST_EFFECTS_FOLDER = "shaders/effects";
|
||||||
|
|
||||||
inline const std::string FONT_DEFAULT = "normal";
|
inline const std::string FONT_DEFAULT = "normal";
|
||||||
|
|
||||||
|
inline const float AVG_ALPHA = 0.1;
|
||||||
|
inline const float AVG_BETA = 0.01;
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "constants.hpp"
|
||||||
#include "audio/audio.hpp"
|
#include "audio/audio.hpp"
|
||||||
#include "delegates.hpp"
|
#include "delegates.hpp"
|
||||||
#include "engine/Engine.hpp"
|
#include "engine/Engine.hpp"
|
||||||
|
|
@ -74,8 +75,6 @@ std::shared_ptr<UINode> create_debug_panel(
|
||||||
static int fpsMaxOld = fpsMax;
|
static int fpsMaxOld = fpsMax;
|
||||||
static float fpsAvgFast = fps;
|
static float fpsAvgFast = fps;
|
||||||
static float fpsAvgLong = fps;
|
static float fpsAvgLong = fps;
|
||||||
static float fpsAvgAlpha = 0.1;
|
|
||||||
static float fpsAvgBeta = 0.01;
|
|
||||||
static std::wstring fpsString = L"";
|
static std::wstring fpsString = L"";
|
||||||
|
|
||||||
static size_t lastTotalDownload = 0;
|
static size_t lastTotalDownload = 0;
|
||||||
|
|
@ -86,8 +85,8 @@ std::shared_ptr<UINode> create_debug_panel(
|
||||||
fps = 1.0f / engine.getTime().getDelta();
|
fps = 1.0f / engine.getTime().getDelta();
|
||||||
fpsMin = std::min(fps, fpsMin);
|
fpsMin = std::min(fps, fpsMin);
|
||||||
fpsMax = std::max(fps, fpsMax);
|
fpsMax = std::max(fps, fpsMax);
|
||||||
fpsAvgFast = fpsAvgFast * (1 - fpsAvgAlpha) + fps * fpsAvgAlpha;
|
fpsAvgFast = fpsAvgFast * (1 - AVG_ALPHA) + fps * AVG_ALPHA;
|
||||||
fpsAvgLong = fpsAvgLong * (1 - fpsAvgBeta) + fps * fpsAvgBeta;
|
fpsAvgLong = fpsAvgLong * (1 - AVG_BETA) + fps * AVG_BETA;
|
||||||
});
|
});
|
||||||
|
|
||||||
panel->listenInterval(2.0f, []() {
|
panel->listenInterval(2.0f, []() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue