mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-25 14:44:28 +00:00
Add renderer selection to video settings - (#2215)
This commit is contained in:
1 parent
23e36f2b76
commit
2a8c8756d3
62 files changed
+1345
-1453
No files matched your search
@@ -0,0 +1,174 @@
|
||||
package com.gtnewhorizons.angelica.client.gui;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.config.GLVersionChoice;
|
||||
import com.gtnewhorizons.angelica.config.RenderBackendChoice;
|
||||
import com.gtnewhorizons.angelica.config.SdlGpuDriver;
|
||||
import com.gtnewhorizons.angelica.config.SystemProperties;
|
||||
import com.gtnewhorizons.angelica.glsm.GLStateManager;
|
||||
import com.gtnewhorizons.angelica.glsm.RenderSystem;
|
||||
import com.gtnewhorizons.angelica.glsm.backend.BackendManager;
|
||||
import com.gtnewhorizons.angelica.glsm.backend.BackendOptions;
|
||||
import com.gtnewhorizons.angelica.glsm.backend.BackendStartGuard;
|
||||
import com.gtnewhorizons.angelica.glsm.backend.MoltenVK;
|
||||
import com.gtnewhorizons.angelica.sdlgpu.SDLGPUGate;
|
||||
import me.flashyreese.mods.reeses_sodium_options.client.gui.ReeseSodiumVideoOptionsScreen;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.ActionOption;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.OptionFlag;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.OptionGroup;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.OptionImpl;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.OptionPage;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.control.CyclingControl;
|
||||
import me.jellysquid.mods.sodium.client.gui.options.storage.AngelicaOptionsStorage;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class RendererOptionPages {
|
||||
|
||||
private static final AngelicaOptionsStorage angelicaOpts = new AngelicaOptionsStorage();
|
||||
|
||||
public static OptionPage renderer() {
|
||||
final Util.EnumOS os = Util.getOSType();
|
||||
final boolean sdlAvailable = SDLGPUGate.isSDLGPUAvailable();
|
||||
final RenderBackendChoice[] backends = sdlAvailable ? RenderBackendChoice.values() : new RenderBackendChoice[] { RenderBackendChoice.OPENGL };
|
||||
final SdlGpuDriver[] drivers = allowedDrivers(os);
|
||||
final GLVersionChoice[] glVersions = allowedGlVersions(glVersionCeiling(os));
|
||||
final String active = activeLabel();
|
||||
|
||||
final OptionGroup.Builder status = OptionGroup.createBuilder()
|
||||
.add(ActionOption.label(I18n.format("options.angelica.renderer.status"), I18n.format("options.angelica.renderer.status.tooltip"), statusLabel()))
|
||||
.add(ActionOption.label(I18n.format("options.angelica.renderer.active"), I18n.format("options.angelica.renderer.active.tooltip"), () -> active));
|
||||
if (os == Util.EnumOS.OSX) {
|
||||
final String moltenVk = I18n.format("options.angelica.renderer.moltenvk." + MoltenVK.source().name().toLowerCase());
|
||||
status.add(ActionOption.label(I18n.format("options.angelica.renderer.moltenvk"), I18n.format("options.angelica.renderer.moltenvk.tooltip"), () -> moltenVk));
|
||||
}
|
||||
|
||||
return new OptionPage(I18n.format("options.angelica.renderer.page"), ImmutableList.of(
|
||||
OptionGroup.createBuilder()
|
||||
.add(OptionImpl.createBuilder(RenderBackendChoice.class, angelicaOpts)
|
||||
.setName(I18n.format("options.angelica.renderer.backend"))
|
||||
.setTooltip(overrideTooltip(backendTooltip(sdlAvailable), SystemProperties.KEY_USE_SDL_GPU, SystemProperties.SDL_GPU_OVERRIDE != null))
|
||||
.setControl(o -> new CyclingControl<>(o, RenderBackendChoice.class, backends))
|
||||
.setBinding((opts, value) -> AngelicaConfig.renderBackend = value, opts -> backendOf(SystemProperties.SDL_GPU_OVERRIDE != null ? SystemProperties.SDL_GPU_OVERRIDE : AngelicaConfig.sdlGpuConfigured()))
|
||||
.setEnabled(SystemProperties.SDL_GPU_OVERRIDE == null)
|
||||
.setFlags(OptionFlag.REQUIRES_GAME_RESTART)
|
||||
.build())
|
||||
.add(OptionImpl.createBuilder(SdlGpuDriver.class, angelicaOpts)
|
||||
.setName(I18n.format("options.angelica.renderer.driver"))
|
||||
.setTooltip(overrideTooltip(driverTooltip(os), SystemProperties.KEY_SDL_GPU_DRIVER, SystemProperties.SDL_GPU_DRIVER_OVERRIDE != null))
|
||||
.setControl(o -> new CyclingControl<>(o, SdlGpuDriver.class, drivers))
|
||||
.setBinding((opts, value) -> AngelicaConfig.sdlGpuDriver = value, opts -> shownDriver())
|
||||
.setEnabled(SystemProperties.SDL_GPU_DRIVER_OVERRIDE == null)
|
||||
.setFlags(OptionFlag.REQUIRES_GAME_RESTART)
|
||||
.build())
|
||||
.add(OptionImpl.createBuilder(GLVersionChoice.class, angelicaOpts)
|
||||
.setName(I18n.format("options.angelica.renderer.glVersion"))
|
||||
.setTooltip(I18n.format("options.angelica.renderer.glVersion.tooltip"))
|
||||
.setControl(o -> new CyclingControl<>(o, GLVersionChoice.class, glVersions, glVersionNames()))
|
||||
.setBinding((opts, value) -> AngelicaConfig.glVersion = value.version(), opts -> GLVersionChoice.of(AngelicaConfig.glVersion, GLVersionChoice.GL46.version()))
|
||||
.setFlags(OptionFlag.REQUIRES_GAME_RESTART)
|
||||
.build())
|
||||
.build(),
|
||||
status.build()));
|
||||
}
|
||||
|
||||
public static OptionPage withLink(OptionPage general, ReeseSodiumVideoOptionsScreen gui) {
|
||||
final String rendererPage = I18n.format("options.angelica.renderer.page");
|
||||
final String active = activeLabel();
|
||||
return new OptionPage(general.getName(), ImmutableList.<OptionGroup>builder()
|
||||
.add(OptionGroup.createBuilder()
|
||||
.add(new ActionOption(I18n.format("options.angelica.renderer.link"), I18n.format("options.angelica.renderer.link.tooltip"),
|
||||
() -> active, () -> gui.showPage(rendererPage), () -> true))
|
||||
.build())
|
||||
.addAll(general.getGroups())
|
||||
.build());
|
||||
}
|
||||
|
||||
private static RenderBackendChoice backendOf(boolean sdlGpu) {
|
||||
return sdlGpu ? RenderBackendChoice.SDL_GPU : RenderBackendChoice.OPENGL;
|
||||
}
|
||||
|
||||
private static SdlGpuDriver shownDriver() {
|
||||
final SdlGpuDriver forced = SystemProperties.SDL_GPU_DRIVER_OVERRIDE != null ? SdlGpuDriver.fromSdlName(SystemProperties.SDL_GPU_DRIVER_OVERRIDE) : null;
|
||||
if (forced != null) return forced;
|
||||
return AngelicaConfig.sdlGpuDriver != null ? AngelicaConfig.sdlGpuDriver : SdlGpuDriver.AUTO;
|
||||
}
|
||||
|
||||
static SdlGpuDriver[] allowedDrivers(Util.EnumOS os) {
|
||||
return switch (os) {
|
||||
case OSX -> new SdlGpuDriver[] { SdlGpuDriver.AUTO, SdlGpuDriver.METAL, SdlGpuDriver.VULKAN };
|
||||
case WINDOWS -> new SdlGpuDriver[] { SdlGpuDriver.AUTO, SdlGpuDriver.VULKAN, SdlGpuDriver.D3D12 };
|
||||
default -> new SdlGpuDriver[] { SdlGpuDriver.AUTO, SdlGpuDriver.VULKAN };
|
||||
};
|
||||
}
|
||||
|
||||
private static int glVersionCeiling(Util.EnumOS os) {
|
||||
final int platformMax = os == Util.EnumOS.OSX ? 41 : 46;
|
||||
final int pinned = AngelicaConfig.pinnedGLVersion;
|
||||
return pinned >= 33 && pinned < platformMax ? pinned : platformMax;
|
||||
}
|
||||
|
||||
static GLVersionChoice[] allowedGlVersions(int ceiling) {
|
||||
final List<GLVersionChoice> allowed = new ArrayList<>();
|
||||
for (final GLVersionChoice choice : GLVersionChoice.values()) {
|
||||
if (choice.version() <= ceiling) allowed.add(choice);
|
||||
}
|
||||
return allowed.toArray(new GLVersionChoice[0]);
|
||||
}
|
||||
|
||||
private static String[] glVersionNames() {
|
||||
final GLVersionChoice[] universe = GLVersionChoice.values();
|
||||
final String[] names = new String[universe.length];
|
||||
for (int i = 0; i < universe.length; i++) {
|
||||
names[i] = universe[i] == GLVersionChoice.AUTO ? I18n.format("options.angelica.renderer.glVersion.auto") : universe[i].label();
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
private static String backendTooltip(boolean sdlAvailable) {
|
||||
final String base = EnumChatFormatting.RED + I18n.format("options.angelica.renderer.backend.experimental") + EnumChatFormatting.RESET + " " + I18n.format("options.angelica.renderer.backend.tooltip");
|
||||
return sdlAvailable ? base : base + " " + I18n.format("options.angelica.renderer.backend.unavailable", SDLGPUGate.missingRequirement());
|
||||
}
|
||||
|
||||
private static String driverTooltip(Util.EnumOS os) {
|
||||
final String base = I18n.format("options.angelica.renderer.driver.tooltip");
|
||||
return switch (os) {
|
||||
case OSX -> base + " " + I18n.format("options.angelica.renderer.driver.tooltip.macos");
|
||||
case WINDOWS -> base + " " + I18n.format("options.angelica.renderer.driver.tooltip.windows") + " " + EnumChatFormatting.RED + I18n.format("options.angelica.renderer.driver.tooltip.d3d12") + EnumChatFormatting.RESET;
|
||||
default -> base + " " + I18n.format("options.angelica.renderer.driver.tooltip.other");
|
||||
};
|
||||
}
|
||||
|
||||
private static Supplier<String> statusLabel() {
|
||||
final String restartLabel = I18n.format("options.angelica.status.restart");
|
||||
final String forcedLabel = I18n.format("options.angelica.renderer.status.forced");
|
||||
final String failedLabel = I18n.format("options.angelica.renderer.status.failed");
|
||||
final String activeLabel = I18n.format("options.angelica.renderer.status.active");
|
||||
final String resetLabel = I18n.format("options.angelica.renderer.status.reset");
|
||||
return () -> {
|
||||
if (AngelicaConfig.sdlGpuConfigured() != BackendOptions.configSdlGpu()
|
||||
|| !AngelicaConfig.sdlGpuDriverName().equals(BackendOptions.configDriver())
|
||||
|| AngelicaConfig.glVersion != BackendOptions.configGlVersion()) {
|
||||
return restartLabel;
|
||||
}
|
||||
if (BackendStartGuard.tripped() && !AngelicaConfig.sdlGpuConfigured()) return resetLabel;
|
||||
if (BackendOptions.sdlGpuRequested() && !BackendManager.RENDER_BACKEND.isSDLGPU()) return failedLabel;
|
||||
return SystemProperties.SDL_GPU_OVERRIDE != null || SystemProperties.SDL_GPU_DRIVER_OVERRIDE != null ? forcedLabel : activeLabel;
|
||||
};
|
||||
}
|
||||
|
||||
private static String activeLabel() {
|
||||
final String name = GLStateManager.getRenderBackendName();
|
||||
return BackendManager.RENDER_BACKEND.isSDLGPU() ? name : name + " " + RenderSystem.getGlMajor() + "." + RenderSystem.getGlMinor();
|
||||
}
|
||||
|
||||
static String overrideTooltip(String base, String flag, boolean overridden) {
|
||||
return overridden ? base + " " + I18n.format("options.angelica.overriddenBy", flag) : base;
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,7 @@ public class TracyOptionPages {
|
||||
default -> startLabel;
|
||||
};
|
||||
|
||||
final String restartLabel = I18n.format("options.angelica.tracy.status.restart");
|
||||
final String restartLabel = I18n.format("options.angelica.status.restart");
|
||||
final String runningLabel = I18n.format("options.angelica.tracy.status.running");
|
||||
final String runningForcedLabel = I18n.format("options.angelica.tracy.status.runningForced");
|
||||
final String failedLabel = I18n.format("options.angelica.tracy.status.failed");
|
||||
@@ -87,8 +87,7 @@ public class TracyOptionPages {
|
||||
.build())
|
||||
.build(),
|
||||
OptionGroup.createBuilder()
|
||||
.add(new ActionOption(I18n.format("options.angelica.tracy.status"), I18n.format("options.angelica.tracy.status.tooltip"),
|
||||
statusLabel, () -> {}, () -> false))
|
||||
.add(ActionOption.label(I18n.format("options.angelica.tracy.status"), I18n.format("options.angelica.tracy.status.tooltip"), statusLabel))
|
||||
.build(),
|
||||
OptionGroup.createBuilder()
|
||||
.add(OptionImpl.createBuilder(int.class, angelicaOpts)
|
||||
@@ -104,7 +103,6 @@ public class TracyOptionPages {
|
||||
}
|
||||
|
||||
private static String overrideTooltip(String baseKey, String flag, boolean overridden) {
|
||||
final String base = I18n.format(baseKey);
|
||||
return overridden ? base + " " + I18n.format("options.angelica.tracy.overriddenBy", flag) : base;
|
||||
return RendererOptionPages.overrideTooltip(I18n.format(baseKey), flag, overridden);
|
||||
}
|
||||
}
|
||||
@@ -55,14 +55,6 @@ public class AngelicaConfig {
|
||||
@Config.RequiresMcRestart
|
||||
public static int workerThreadCount;
|
||||
|
||||
@Config.Comment("Enable NotFine Options")
|
||||
@Config.DefaultBoolean(false)
|
||||
public static boolean enableNotFineOptions;
|
||||
|
||||
@Config.Comment("Enable Reese's Sodium Options")
|
||||
@Config.DefaultBoolean(true)
|
||||
public static boolean enableReesesSodiumOptions;
|
||||
|
||||
@Config.Comment("Inject BakedModel rendering into some vanilla blocks")
|
||||
@Config.DefaultBoolean(false)
|
||||
@Config.RequiresMcRestart
|
||||
@@ -468,6 +460,22 @@ public class AngelicaConfig {
|
||||
@Config.RequiresMcRestart
|
||||
public static boolean disableGLVersionPinning;
|
||||
|
||||
@Config.Comment("Requested OpenGL context version as an integer (e.g. 46, 41, 33). 0 = highest available. Falls back to probing when the version cannot be created.")
|
||||
@Config.DefaultInt(0)
|
||||
@Config.RangeInt(min = 0, max = 46)
|
||||
@Config.RequiresMcRestart
|
||||
public static int glVersion;
|
||||
|
||||
@Config.Comment("Render backend: OPENGL, or SDL_GPU (experimental; Vulkan/Metal/Direct3D 12 through SDL3, falls back to OpenGL when no device can be created). -Dangelica.sdlgpu.enable=true|false overrides this.")
|
||||
@Config.DefaultEnum("OPENGL")
|
||||
@Config.RequiresMcRestart
|
||||
public static RenderBackendChoice renderBackend;
|
||||
|
||||
@Config.Comment("SDL GPU driver: AUTO, VULKAN, METAL (macOS), D3D12 (Windows). Vulkan on macOS needs MoltenVK and uses Metal without it. -Dangelica.sdlgpu.driver overrides this.")
|
||||
@Config.DefaultEnum("AUTO")
|
||||
@Config.RequiresMcRestart
|
||||
public static SdlGpuDriver sdlGpuDriver;
|
||||
|
||||
@Config.Comment("Disables GL Error checks. Always set to false in dev env or if LWJGL debug is on. Improves performance.")
|
||||
@Config.DefaultBoolean(true)
|
||||
@Config.RequiresMcRestart
|
||||
@@ -536,6 +544,14 @@ public class AngelicaConfig {
|
||||
return enableEntityBatching && enableCubeInstancing;
|
||||
}
|
||||
|
||||
public static boolean sdlGpuConfigured() {
|
||||
return renderBackend == RenderBackendChoice.SDL_GPU;
|
||||
}
|
||||
|
||||
public static String sdlGpuDriverName() {
|
||||
return sdlGpuDriver == null ? "" : sdlGpuDriver.sdlName();
|
||||
}
|
||||
|
||||
public static GLProfile getEffectiveGlProfile() {
|
||||
final String sys = SystemProperties.GL_PROFILE.trim().toUpperCase();
|
||||
if ("GLES".equals(sys)) return GLProfile.ES;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.gtnewhorizons.angelica.config;
|
||||
|
||||
public enum GLVersionChoice {
|
||||
AUTO(0),
|
||||
GL33(33),
|
||||
GL40(40),
|
||||
GL41(41),
|
||||
GL42(42),
|
||||
GL43(43),
|
||||
GL44(44),
|
||||
GL45(45),
|
||||
GL46(46);
|
||||
|
||||
private final int version;
|
||||
|
||||
GLVersionChoice(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public int version() { return version; }
|
||||
|
||||
public String label() {
|
||||
return version / 10 + "." + version % 10;
|
||||
}
|
||||
|
||||
public static GLVersionChoice of(int version, int ceiling) {
|
||||
GLVersionChoice best = AUTO;
|
||||
for (final GLVersionChoice choice : values()) {
|
||||
if (choice.version != 0 && choice.version <= version && choice.version <= ceiling) best = choice;
|
||||
}
|
||||
return best;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.gtnewhorizons.angelica.config;
|
||||
|
||||
import me.jellysquid.mods.sodium.client.gui.options.named.NamedState;
|
||||
|
||||
public enum RenderBackendChoice implements NamedState {
|
||||
OPENGL ("options.angelica.renderer.backend.opengl"),
|
||||
SDL_GPU("options.angelica.renderer.backend.sdl_gpu");
|
||||
|
||||
private final String key;
|
||||
|
||||
RenderBackendChoice(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.gtnewhorizons.angelica.config;
|
||||
|
||||
import me.jellysquid.mods.sodium.client.gui.options.named.NamedState;
|
||||
|
||||
public enum SdlGpuDriver implements NamedState {
|
||||
AUTO ("", "options.angelica.renderer.driver.auto"),
|
||||
VULKAN("vulkan", "options.angelica.renderer.driver.vulkan"),
|
||||
METAL ("metal", "options.angelica.renderer.driver.metal"),
|
||||
D3D12 ("direct3d12", "options.angelica.renderer.driver.d3d12");
|
||||
|
||||
private final String sdlName;
|
||||
private final String key;
|
||||
|
||||
SdlGpuDriver(String sdlName, String key) {
|
||||
this.sdlName = sdlName;
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String sdlName() { return sdlName; }
|
||||
|
||||
public static SdlGpuDriver fromSdlName(String sdlName) {
|
||||
for (final SdlGpuDriver driver : values()) {
|
||||
if (driver.sdlName.equalsIgnoreCase(sdlName)) return driver;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,10 @@ import com.gtnewhorizon.gtnhmixins.builders.ITransformers;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.config.CompatConfig;
|
||||
import com.gtnewhorizons.angelica.config.FontConfig;
|
||||
import com.gtnewhorizons.angelica.config.RenderBackendChoice;
|
||||
import com.gtnewhorizons.angelica.config.SystemProperties;
|
||||
import com.gtnewhorizons.angelica.glsm.backend.BackendOptions;
|
||||
import com.gtnewhorizons.angelica.glsm.backend.BackendStartGuard;
|
||||
import com.gtnewhorizons.angelica.glsm.loading.DependencyVerifier;
|
||||
import com.gtnewhorizons.angelica.glsm.loading.Lwjgl3ifyExclusions;
|
||||
import com.gtnewhorizons.angelica.glsm.profiling.TracyOptions;
|
||||
@@ -33,6 +36,7 @@ import org.apache.logging.log4j.core.config.LoggerConfig;
|
||||
import org.spongepowered.asm.launch.GlobalProperties;
|
||||
import org.spongepowered.asm.service.mojang.MixinServiceLaunchWrapper;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -68,6 +72,12 @@ public final class AngelicaClientTweaker implements IFMLLoadingPlugin, IEarlyMix
|
||||
// Angelica Config
|
||||
ConfigurationManager.registerConfig(AngelicaConfig.class);
|
||||
TracyOptions.latch(AngelicaConfig.enableTracy, AngelicaConfig.tracyAllowRemote, AngelicaConfig.tracyFineZones, AngelicaConfig.tracyMaxSrcLocs);
|
||||
if (BackendStartGuard.begin(new File(Launch.minecraftHome, "angelica" + File.separator + "sdlgpu-starting"), AngelicaConfig.sdlGpuConfigured(), SystemProperties.SDL_GPU_OVERRIDE != null)) {
|
||||
LOGGER.warn("The last start with SDL GPU did not reach the main menu; resetting the render backend to OpenGL");
|
||||
AngelicaConfig.renderBackend = RenderBackendChoice.OPENGL;
|
||||
ConfigurationManager.save(AngelicaConfig.class);
|
||||
}
|
||||
BackendOptions.latch(AngelicaConfig.sdlGpuConfigured(), AngelicaConfig.sdlGpuDriverName(), AngelicaConfig.glVersion);
|
||||
ConfigurationManager.registerConfig(CompatConfig.class);
|
||||
ConfigurationManager.registerConfig(FontConfig.class);
|
||||
MCPatcherForgeConfig.registerConfig();
|
||||
@@ -89,7 +99,7 @@ public final class AngelicaClientTweaker implements IFMLLoadingPlugin, IEarlyMix
|
||||
DependencyVerifier.gtnhLibChecks("Angelica"), LOGGER,
|
||||
(title, message) -> MissingDependencySdl.showFatal(title, message));
|
||||
|
||||
if (SystemProperties.USE_SDL_GPU) {
|
||||
if (BackendOptions.sdlGpuRequested()) {
|
||||
if (SDLGPUGate.isSDLGPUAvailable()) {
|
||||
LOGGER.info("SDL GPU window mode enabled");
|
||||
} else {
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.config.CompatConfig;
|
||||
import com.gtnewhorizons.angelica.config.SystemProperties;
|
||||
import com.gtnewhorizons.angelica.glsm.CaptureGate;
|
||||
import com.gtnewhorizons.angelica.glsm.backend.BackendOptions;
|
||||
import com.gtnewhorizons.angelica.glsm.profiling.TracyOptions;
|
||||
import com.gtnewhorizons.angelica.sdlgpu.SDLGPUGate;
|
||||
import jss.notfine.config.MCPatcherForgeConfig;
|
||||
@@ -104,7 +105,7 @@ public enum Mixins implements IMixins {
|
||||
|
||||
ANGELICA_SDL_GPU_DISPLAY(new MixinBuilder("SDL-GPU-aware Display.create path")
|
||||
.setPhase(Phase.EARLY)
|
||||
.setApplyIf(() -> SystemProperties.USE_SDL_GPU && SDLGPUGate.isSDLGPUAvailable())
|
||||
.setApplyIf(() -> BackendOptions.sdlGpuRequested() && SDLGPUGate.isSDLGPUAvailable())
|
||||
.addClientMixins(
|
||||
"sdlgpu.MixinForgeHooksClient_SDLGPUDisplay",
|
||||
"sdlgpu.MixinMinecraft_SDLGPUIcons"
|
||||
|
||||
@@ -62,6 +62,7 @@ import com.gtnewhorizons.angelica.debug.TPSGraph;
|
||||
import com.gtnewhorizons.angelica.dynamiclights.DynamicLights;
|
||||
import com.gtnewhorizons.angelica.dynamiclights.config.EntityLightConfig;
|
||||
import com.gtnewhorizons.angelica.glsm.GLStateManager;
|
||||
import com.gtnewhorizons.angelica.glsm.backend.BackendStartGuard;
|
||||
import com.gtnewhorizons.angelica.glsm.backend.VSyncMode;
|
||||
import com.gtnewhorizons.angelica.glsm.profiling.Tracy;
|
||||
import com.gtnewhorizons.angelica.glsm.shader.ShaderDiskCache;
|
||||
@@ -97,13 +98,10 @@ import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.registry.GameData;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import jss.notfine.core.Settings;
|
||||
import jss.notfine.gui.GuiCustomMenu;
|
||||
import jss.notfine.gui.NotFineGameOptionPages;
|
||||
import jss.notfine.gui.options.named.FOVMode;
|
||||
import me.flashyreese.mods.reeses_sodium_options.client.gui.ReeseSodiumVideoOptionsScreen;
|
||||
import me.jellysquid.mods.sodium.client.gui.FrameRateOptions;
|
||||
import me.jellysquid.mods.sodium.client.gui.SodiumGameOptions;
|
||||
import me.jellysquid.mods.sodium.client.gui.SodiumOptionsGUI;
|
||||
import net.coderbot.iris.Iris;
|
||||
import net.coderbot.iris.client.IrisDebugScreenHandler;
|
||||
|
||||
@@ -388,6 +386,7 @@ public final class ClientProxy extends CommonProxy {
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onGuiOpen(GuiOpenEvent event) {
|
||||
BackendStartGuard.finish();
|
||||
if (!event.isCanceled()) {
|
||||
if (event.gui instanceof GuiMainMenu && gameStartTime == -1) {
|
||||
gameStartTime = ManagementFactory.getRuntimeMXBean().getUptime() / 1000f;
|
||||
@@ -403,19 +402,7 @@ public final class ClientProxy extends CommonProxy {
|
||||
public void onGuiInit(GuiScreenEvent.InitGuiEvent.Pre event) {
|
||||
if (event.gui instanceof GuiVideoSettings eventGui) {
|
||||
event.setCanceled(true);
|
||||
if (AngelicaConfig.enableNotFineOptions || GuiScreen.isShiftKeyDown()) {
|
||||
Minecraft.getMinecraft().displayGuiScreen(new GuiCustomMenu(
|
||||
eventGui.parentGuiScreen,
|
||||
NotFineGameOptionPages.general(),
|
||||
NotFineGameOptionPages.detail(),
|
||||
NotFineGameOptionPages.atmosphere(),
|
||||
NotFineGameOptionPages.particles(),
|
||||
NotFineGameOptionPages.other()));
|
||||
} else if (!AngelicaConfig.enableReesesSodiumOptions || GuiScreen.isCtrlKeyDown()) {
|
||||
Minecraft.getMinecraft().displayGuiScreen(new SodiumOptionsGUI(eventGui.parentGuiScreen));
|
||||
} else {
|
||||
Minecraft.getMinecraft().displayGuiScreen(new ReeseSodiumVideoOptionsScreen(eventGui.parentGuiScreen));
|
||||
}
|
||||
Minecraft.getMinecraft().displayGuiScreen(new ReeseSodiumVideoOptionsScreen(eventGui.parentGuiScreen));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user