11
11
12
12
public class Config {
13
13
private int frameRateTarget ;
14
+ private boolean enableVsync ;
14
15
private final Map <String , Float > volumeMultipliers ;
15
16
private GraphicsState graphicsState ;
16
17
private boolean showToasts ;
17
18
private boolean runGarbageCollector ;
18
19
19
20
protected transient PowerState state ; // Set by main config, allows retrieving values from the default power state config
20
21
21
- public static final Config ACTIVE = new Config (-1 , new HashMap <>(), GraphicsState .DEFAULT , true , false );
22
+ public static final Config ACTIVE = new Config (-1 , false , new HashMap <>(), GraphicsState .DEFAULT , true , false );
22
23
23
- public Config (int frameRateTarget , Map <String , Float > volumeMultipliers , GraphicsState graphicsState , boolean showToasts , boolean runGarbageCollector ) {
24
+ public Config (int frameRateTarget , boolean enableVsync , Map <String , Float > volumeMultipliers , GraphicsState graphicsState , boolean showToasts , boolean runGarbageCollector ) {
24
25
this .frameRateTarget = frameRateTarget ;
26
+ this .enableVsync = enableVsync ;
25
27
this .volumeMultipliers = new HashMap <>(volumeMultipliers ); // Ensure the map is mutable
26
28
this .graphicsState = graphicsState ;
27
29
this .showToasts = showToasts ;
@@ -44,6 +46,14 @@ public void setFrameRateTarget(int value) {
44
46
}
45
47
}
46
48
49
+ public boolean enableVsync () {
50
+ return this .enableVsync ;
51
+ }
52
+
53
+ public void setEnableVsync (boolean value ) {
54
+ this .enableVsync = value ;
55
+ }
56
+
47
57
public float volumeMultiplier (SoundSource source ) {
48
58
if (this .rawVolumeMultiplier (SoundSource .MASTER ) == 0.0f ) {
49
59
return 0.0f ;
0 commit comments