File tree 3 files changed +7
-4
lines changed
platforms/common/src/main/java/dynamic_fps/impl
3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ public class Constants {
8
8
public static final boolean DEBUG = Platform .getInstance ().isDevelopmentEnvironment ();
9
9
10
10
// Miscellaneous
11
- // Minecraft considers limits >=260 as infinite
11
+
12
+ // Minimum limit, for lower FPS we cancel frames
13
+ public static final int MIN_FRAME_RATE_LIMIT = 15 ;
14
+ // Minecraft considers limits >=260 as unlimited
12
15
public static final int NO_FRAME_RATE_LIMIT = 260 ;
13
16
14
17
// The Cloth Config mod ID has changed a few times
Original file line number Diff line number Diff line change @@ -307,8 +307,8 @@ private static boolean checkForRender(long timeSinceLastRender) {
307
307
return false ;
308
308
}
309
309
310
- // Disable frame rate limiting
311
- if (frameRateTarget == Constants .NO_FRAME_RATE_LIMIT ) {
310
+ // Disable mod-side frame rate limiting
311
+ if (frameRateTarget >= Constants .MIN_FRAME_RATE_LIMIT ) {
312
312
return true ;
313
313
}
314
314
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ private void getFramerateLimit(CallbackInfoReturnable<Integer> callbackInfo) {
36
36
if (state != PowerState .FOCUSED ) {
37
37
// Instruct Minecraft to render a minimum of 15 FPS
38
38
// Going lower here makes resuming again feel sluggish
39
- callbackInfo .setReturnValue (Math .max (this .getFramerateTarget (), 15 ));
39
+ callbackInfo .setReturnValue (Math .max (this .getFramerateTarget (), Constants . MIN_FRAME_RATE_LIMIT ));
40
40
} else {
41
41
IdleCondition condition = DynamicFPSConfig .INSTANCE .idle ().condition ();
42
42
You can’t perform that action at this time.
0 commit comments