"Localize" renderer selection mechanism to several other classes
Add renderer changer to Per-Version Config
Move Per-Version Config to a separate class
This commit is contained in:
artdeell 2021-07-22 16:20:15 +03:00
parent ea6bd5f5a3
commit 67fac9a610
8 changed files with 182 additions and 94 deletions

View file

@ -103,7 +103,7 @@ public class BaseMainActivity extends LoggableActivity {
private File logFile;
private PrintStream logStream;
private PerVersionConfig.VersionConfig config;
/*
private LinearLayout contentCanvas;
private AWTSurfaceView contentCanvasView;
@ -140,14 +140,17 @@ public class BaseMainActivity extends LoggableActivity {
setTitle("Minecraft " + mProfile.selectedVersion);
PerVersionConfig.update();
PerVersionConfig.VersionConfig cfg = PerVersionConfig.configMap.get(mProfile.selectedVersion);
config = PerVersionConfig.configMap.get(mProfile.selectedVersion);
String runtime = LauncherPreferences.PREF_DEFAULT_RUNTIME;
if(cfg != null) {
if(cfg.selectedRuntime != null) {
if(MultiRTUtils.forceReread(cfg.selectedRuntime).versionString != null) {
runtime = cfg.selectedRuntime;
if(config != null) {
if(config.selectedRuntime != null) {
if(MultiRTUtils.forceReread(config.selectedRuntime).versionString != null) {
runtime = config.selectedRuntime;
}
}
if(config.renderer != null) {
Tools.LOCAL_RENDERER = config.renderer;
}
}
MultiRTUtils.setRuntimeNamed(this,runtime);
// Minecraft 1.13+
@ -904,10 +907,12 @@ public class BaseMainActivity extends LoggableActivity {
mLogObserver.startWatching();
}
*/
if(Tools.LOCAL_RENDERER == null) {
Tools.LOCAL_RENDERER = LauncherPreferences.PREF_RENDERER;
}
appendlnToLog("--------- beggining with launcher debug");
appendlnToLog("Info: Launcher version: " + BuildConfig.VERSION_NAME);
if (LauncherPreferences.PREF_RENDERER.equals("vulkan_zink")) {
if (Tools.LOCAL_RENDERER.equals("vulkan_zink")) {
checkVulkanZinkIsSupported();
}
checkLWJGL3Installed();