mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-23 15:25:19 -04:00
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:
@@ -2063,7 +2063,7 @@ static void captureScreenPerspDrawInfo(JPADrawInfo& info) {
|
||||
static void drawItem3D() {
|
||||
ZoneScoped;
|
||||
#ifdef TARGET_PC
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
if (dusk::frame_interp::is_enabled()) {
|
||||
// FRAME INTERP NOTE: Title screen needs 0.0f while everything else that runs through this is -100.0f.
|
||||
if (fopAcM_SearchByName(fpcNm_TITLE_e) != nullptr) {
|
||||
dMenu_Collect3D_c::setViewPortOffsetY(0.0f);
|
||||
@@ -2241,7 +2241,7 @@ int mDoGph_Painter() {
|
||||
#endif
|
||||
dKy_setLight();
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
if (dusk::frame_interp::is_enabled()) {
|
||||
dKy_setLight_again();
|
||||
}
|
||||
#endif
|
||||
@@ -2296,7 +2296,7 @@ int mDoGph_Painter() {
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.enableFrameInterpolation) {
|
||||
if (dusk::frame_interp::is_enabled()) {
|
||||
// FRAME INTERP NOTE: Currently only recalculating points for Epona's reins. Need a more global solution.
|
||||
if (daHorse_c* horse = dComIfGp_getHorseActor()) {
|
||||
horse->lerpControlPoints(dusk::frame_interp::get_interpolation_step());
|
||||
|
||||
Reference in New Issue
Block a user