Skip to content

Commit 84be5c9

Browse files
committed
Fix no FPS limit being applied when using a non-default idle condition
Signed-off-by: Lilly Rose Berner <lilly@lostluma.net>
1 parent 55c3f82 commit 84be5c9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

platforms/common/src/main/java/dynamic_fps/impl/Constants.java

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public class Constants {
1313
public static final int MIN_FRAME_RATE_LIMIT = 15;
1414
// Minecraft considers limits >=260 as unlimited
1515
public static final int NO_FRAME_RATE_LIMIT = 260;
16+
// Default frame rate limit on all title screens
17+
public static final int TITLE_FRAME_RATE_LIMIT = 60;
1618

1719
// The Cloth Config mod ID has changed a few times
1820
public static final String[] CLOTH_CONFIG_ID = new String[] { "cloth-config", "cloth_config", "cloth-config2" };

platforms/common/src/main/java/dynamic_fps/impl/mixin/FramerateLimitTrackerMixin.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ private void getFramerateLimit(CallbackInfoReturnable<Integer> callbackInfo) {
4444
// Note: If Dynamic FPS thinks the user is idle the power state would be different above
4545
if (condition != IdleCondition.VANILLA) {
4646
// Since we're bypassing the idle checking code we also need to set the menu FPS here as it's bundled now
47-
if (isInLevel() || !DynamicFPSConfig.INSTANCE.uncapMenuFrameRate()) {
47+
if (isInLevel()) {
4848
callbackInfo.setReturnValue(this.framerateLimit);
49-
} else {
49+
} else if(DynamicFPSConfig.INSTANCE.uncapMenuFrameRate()) {
5050
callbackInfo.setReturnValue(this.getMenuFramerateLimit());
51+
}else {
52+
callbackInfo.setReturnValue(Constants.TITLE_FRAME_RATE_LIMIT);
5153
}
5254
}
5355
}

0 commit comments

Comments
 (0)