Merge branch 'fix/fps-rounding': FPS arrodonit
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
#include <cmath>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "core/defaults.hpp"
|
#include "core/defaults.hpp"
|
||||||
@@ -35,7 +36,7 @@ namespace System {
|
|||||||
fps_frame_count_++;
|
fps_frame_count_++;
|
||||||
|
|
||||||
if (fps_accumulator_ >= Cfg::FPS_UPDATE_INTERVAL) {
|
if (fps_accumulator_ >= Cfg::FPS_UPDATE_INTERVAL) {
|
||||||
fps_display_ = static_cast<int>(fps_frame_count_ / fps_accumulator_);
|
fps_display_ = static_cast<int>(std::lround(static_cast<float>(fps_frame_count_) / fps_accumulator_));
|
||||||
fps_frame_count_ = 0;
|
fps_frame_count_ = 0;
|
||||||
fps_accumulator_ = 0.0F;
|
fps_accumulator_ = 0.0F;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user