New option: sustained performance

This commit is contained in:
SerpentSpirale 2021-11-14 14:51:36 +01:00
parent 154fb36cb0
commit 14529f109b
5 changed files with 24 additions and 0 deletions

View file

@ -14,6 +14,7 @@ import net.kdt.pojavlaunch.utils.MCOptionUtils;
import java.io.*;
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.DEFAULT_PREF;
import static net.kdt.pojavlaunch.prefs.LauncherPreferences.PREF_SUSTAINED_PERFORMANCE;
public class MainActivity extends BaseMainActivity {
public static ControlLayout mControlLayout;
@ -24,6 +25,11 @@ public class MainActivity extends BaseMainActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
initLayout(R.layout.main_with_customctrl);
// Set the sustained performance mode for available APIs
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
getWindow().setSustainedPerformanceMode(PREF_SUSTAINED_PERFORMANCE);
super.ingameControlsEditorListener = menuItem -> {
switch (menuItem.getItemId()) {
case R.id.menu_ctrl_load: