feat: FPS Limiter (#1446)

* Add interpolation frame rate cap

* wip: reworked framelimiter

Based on my testing this is a bit more stable in frametimes.

* wip: efficiency improvement + windows build fix

Significantly improve efficiency by using a hybrid approach.

* wip: UI changes

* wip: end frame AFTER limiting

* wip: remove unused include

* wip: minor ui code change

Makes it easier to remove/add presets

* Simplify Limiter UI

- Change enableFrameInterpolation to an enum with off/capped/unlimited values
- Simplify the UI to use 2 settings (unlock framerate + a max value entry)

* wip: slight limiter simplification

* wip: implement review suggestions

* wip: fix syntax error

* wip: revert enum order + replace old checks

* Fix compile error

---------

Co-authored-by: SailorSnoW <sailorsnow@pm.me>
Co-authored-by: Loïs <49660929+SailorSnoW@users.noreply.github.com>
Co-authored-by: SuperDude88 <82904174+SuperDude88@users.noreply.github.com>
Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
Ash
2026-05-18 04:11:32 +02:00
committed by GitHub
parent 66c5cb1dae
commit 2da6590657
32 changed files with 207 additions and 59 deletions
+1 -1
View File
@@ -535,7 +535,7 @@ static int daE_WB_Draw(e_wb_class* i_this) {
i_this->himo_tex.update(2, l_color, &actor->tevStr);
dComIfGd_set3DlineMat(&i_this->himo_tex);
#if TARGET_PC
if (dusk::getSettings().game.enableFrameInterpolation) {
if (dusk::frame_interp::is_enabled()) {
if (i_this->himo_interp_curr_valid) {
memcpy(i_this->himo_mat_interp_prev, i_this->himo_mat_interp_curr, sizeof(i_this->himo_mat_interp_curr));
memcpy(i_this->himo_tex_interp_prev, i_this->himo_tex_interp_curr, sizeof(i_this->himo_tex_interp_curr));