fix render api vs engine enum
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package com.seibel.distanthorizons.common;
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiMcRenderingFadeMode;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi;
|
||||
import com.seibel.distanthorizons.api.enums.worldGeneration.EDhApiDistantGeneratorMode;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
|
||||
import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiAfterDhInitEvent;
|
||||
import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiBeforeDhInitEvent;
|
||||
import com.seibel.distanthorizons.common.commands.CommandInitializer;
|
||||
@@ -387,17 +385,17 @@ public abstract class AbstractModInitializer
|
||||
if (iris != null)
|
||||
{
|
||||
// get the currently selected rendering API
|
||||
EDhApiRenderApi renderApi = Config.Client.Advanced.Graphics.Experimental.renderingApi.get();
|
||||
if (renderApi == EDhApiRenderApi.AUTO)
|
||||
EDhApiRenderingEngine renderApi = Config.Client.Advanced.Graphics.Experimental.renderingEngine.get();
|
||||
if (renderApi == EDhApiRenderingEngine.AUTO)
|
||||
{
|
||||
IVersionConstants versionConstants = SingletonInjector.INSTANCE.get(IVersionConstants.class);
|
||||
renderApi = versionConstants.getDefaultRenderingApi();
|
||||
renderApi = versionConstants.getDefaultRenderingEngine();
|
||||
}
|
||||
|
||||
// Iris only supports native OpenGL
|
||||
if (renderApi != EDhApiRenderApi.OPEN_GL)
|
||||
if (renderApi != EDhApiRenderingEngine.OPEN_GL)
|
||||
{
|
||||
String irisUnsupportedMessage = "Iris doesn't support DH when using the ["+EDhApiRenderApi.BLAZE_3D+"] rendering API, this will need to be fixed on Iris end. As a temporary fix please change the rendering API to ["+EDhApiRenderApi.OPEN_GL+"] in the DH config file.";
|
||||
String irisUnsupportedMessage = "Iris doesn't support DH when using the ["+ EDhApiRenderingEngine.BLAZE_3D+"] rendering engine, this will need to be fixed on Iris end. As a temporary fix please change the rendering engine to ["+ EDhApiRenderingEngine.OPEN_GL+"] in the DH config file.";
|
||||
LOGGER.fatal(irisUnsupportedMessage);
|
||||
NativeDialogUtil.showDialog(ModInfo.READABLE_NAME, irisUnsupportedMessage, "ok", "error");
|
||||
|
||||
|
||||
+4
-4
@@ -5,7 +5,8 @@ public class BlazeDhRenderApiDefinition {}
|
||||
|
||||
#else
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingApi;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
|
||||
import com.seibel.distanthorizons.common.render.blaze.objects.BlazeGenericObjectVertexContainer;
|
||||
import com.seibel.distanthorizons.common.render.blaze.postProcessing.BlazeDhFarFadeRenderer;
|
||||
import com.seibel.distanthorizons.common.render.blaze.postProcessing.BlazeDhFogRenderer;
|
||||
@@ -25,7 +26,6 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.render.renderPass.*;
|
||||
|
||||
#if MC_VER <= MC_26_1_2
|
||||
#else
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
#endif
|
||||
|
||||
public class BlazeDhRenderApiDefinition extends AbstractDhRenderApiDefinition
|
||||
@@ -48,8 +48,8 @@ public class BlazeDhRenderApiDefinition extends AbstractDhRenderApiDefinition
|
||||
}
|
||||
|
||||
|
||||
private final EDhApiRenderApi renderApi;
|
||||
public EDhApiRenderApi getRenderApi() { return renderApi; }
|
||||
private final EDhApiRenderingApi renderApi;
|
||||
public EDhApiRenderingApi getRenderApi() { return renderApi; }
|
||||
public boolean isNativeRenderer() { return false; }
|
||||
|
||||
//endregion
|
||||
|
||||
+5
-5
@@ -6,7 +6,7 @@ public class BlazeDhVertexFormatUtil {}
|
||||
#else
|
||||
|
||||
import com.mojang.blaze3d.vertex.VertexFormatElement;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.dataObjects.render.bufferBuilding.LodQuadBuilder;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||
@@ -48,14 +48,14 @@ public class BlazeDhVertexFormatUtil
|
||||
|
||||
static
|
||||
{
|
||||
EDhApiRenderApi renderingApi = Config.Client.Advanced.Graphics.Experimental.renderingApi.get();
|
||||
if (renderingApi == EDhApiRenderApi.AUTO)
|
||||
EDhApiRenderingEngine renderingApi = Config.Client.Advanced.Graphics.Experimental.renderingEngine.get();
|
||||
if (renderingApi == EDhApiRenderingEngine.AUTO)
|
||||
{
|
||||
IVersionConstants versionConstants = SingletonInjector.INSTANCE.get(IVersionConstants.class);
|
||||
renderingApi = versionConstants.getDefaultRenderingApi();
|
||||
renderingApi = versionConstants.getDefaultRenderingEngine();
|
||||
}
|
||||
|
||||
boolean register = (renderingApi == EDhApiRenderApi.BLAZE_3D);
|
||||
boolean register = (renderingApi == EDhApiRenderingEngine.BLAZE_3D);
|
||||
if (register)
|
||||
{
|
||||
LOGGER.debug("Attempting to register ["+VertexFormatElement.class.getSimpleName()+"]...");
|
||||
|
||||
+3
-3
@@ -1,6 +1,7 @@
|
||||
package com.seibel.distanthorizons.common.render.openGl;
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingApi;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
|
||||
import com.seibel.distanthorizons.common.render.openGl.generic.GlGenericObjectRenderer;
|
||||
import com.seibel.distanthorizons.common.render.openGl.generic.GlGenericObjectVertexContainer;
|
||||
import com.seibel.distanthorizons.common.render.openGl.glObject.GlDummyUniformData;
|
||||
@@ -9,7 +10,6 @@ import com.seibel.distanthorizons.common.render.openGl.postProcessing.fade.GlDhF
|
||||
import com.seibel.distanthorizons.common.render.openGl.postProcessing.fade.GlVanillaFadeRenderer;
|
||||
import com.seibel.distanthorizons.common.render.openGl.postProcessing.fog.GlDhFogRenderer;
|
||||
import com.seibel.distanthorizons.common.render.openGl.postProcessing.ssao.GlDhSSAORenderer;
|
||||
import com.seibel.distanthorizons.common.render.openGl.terrain.GlDhTerrainShaderProgram;
|
||||
import com.seibel.distanthorizons.common.render.openGl.test.GlTestTriangleRenderer;
|
||||
import com.seibel.distanthorizons.core.render.EDhRenderDepth;
|
||||
import com.seibel.distanthorizons.core.render.renderer.AbstractDebugWireframeRenderer;
|
||||
@@ -35,7 +35,7 @@ public class GlDhRenderApiDefinition extends AbstractDhRenderApiDefinition
|
||||
return EDhRenderDepth.FORWARD_Z;
|
||||
}
|
||||
|
||||
public EDhApiRenderApi getRenderApi() { return EDhApiRenderApi.OPEN_GL; }
|
||||
public EDhApiRenderingApi getRenderApi() { return EDhApiRenderingApi.OPEN_GL; }
|
||||
public boolean isNativeRenderer() { return true; }
|
||||
|
||||
//endregion
|
||||
|
||||
+3
-5
@@ -21,10 +21,9 @@ package com.seibel.distanthorizons.common.render.openGl.glObject;
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiGLErrorHandlingMode;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiGpuUploadMethod;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiLoggerLevel;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingApi;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.config.types.ConfigEntry;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.distanthorizons.core.jar.EPlatform;
|
||||
@@ -32,7 +31,6 @@ import com.seibel.distanthorizons.core.logging.DhLogger;
|
||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.distanthorizons.core.util.objects.GLMessages.*;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftSharedWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.IIrisAccessor;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.render.AbstractDhRenderApiDefinition;
|
||||
import com.seibel.distanthorizons.coreapi.ModInfo;
|
||||
@@ -132,7 +130,7 @@ public class GLProxy
|
||||
|
||||
private GLProxy() throws IllegalStateException
|
||||
{
|
||||
if (RENDER_API_DEF.getRenderApi() != EDhApiRenderApi.OPEN_GL)
|
||||
if (RENDER_API_DEF.getRenderApi() != EDhApiRenderingApi.OPEN_GL)
|
||||
{
|
||||
throw new IllegalStateException("[" + GLProxy.class.getSimpleName() + "] was created with the wrong Rendering API ["+RENDER_API_DEF.getRenderApi()+"]!");
|
||||
}
|
||||
|
||||
+10
-9
@@ -19,11 +19,12 @@
|
||||
|
||||
package com.seibel.distanthorizons.common.wrappers;
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
|
||||
import com.seibel.distanthorizons.api.interfaces.render.IDhApiCustomRenderObjectFactory;
|
||||
import com.seibel.distanthorizons.common.render.blaze.BlazeDhRenderApiDefinition;
|
||||
import com.seibel.distanthorizons.common.render.openGl.GlDhRenderApiDefinition;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingApi;
|
||||
import com.seibel.distanthorizons.core.render.renderer.GenericRenderObjectFactory;
|
||||
import com.seibel.distanthorizons.common.wrappers.gui.classicConfig.ClassicConfigGUI;
|
||||
import com.seibel.distanthorizons.common.wrappers.gui.LangWrapper;
|
||||
@@ -94,11 +95,11 @@ public class DependencySetup
|
||||
|
||||
|
||||
|
||||
EDhApiRenderApi renderingApiEnum = Config.Client.Advanced.Graphics.Experimental.renderingApi.get();
|
||||
if (renderingApiEnum == EDhApiRenderApi.AUTO)
|
||||
EDhApiRenderingEngine renderingApiEnum = Config.Client.Advanced.Graphics.Experimental.renderingEngine.get();
|
||||
if (renderingApiEnum == EDhApiRenderingEngine.AUTO)
|
||||
{
|
||||
IVersionConstants versionConstants = SingletonInjector.INSTANCE.get(IVersionConstants.class);
|
||||
renderingApiEnum = versionConstants.getDefaultRenderingApi();
|
||||
renderingApiEnum = versionConstants.getDefaultRenderingEngine();
|
||||
}
|
||||
|
||||
LOGGER.info("Setting DH Rendering API to: ["+renderingApiEnum+"]...");
|
||||
@@ -107,12 +108,12 @@ public class DependencySetup
|
||||
|
||||
boolean validApi;
|
||||
AbstractDhRenderApiDefinition renderDefinition;
|
||||
if (renderingApiEnum == EDhApiRenderApi.OPEN_GL)
|
||||
if (renderingApiEnum == EDhApiRenderingEngine.OPEN_GL)
|
||||
{
|
||||
validApi = true;
|
||||
renderDefinition = new GlDhRenderApiDefinition();
|
||||
}
|
||||
else if (renderingApiEnum == EDhApiRenderApi.BLAZE_3D)
|
||||
else if (renderingApiEnum == EDhApiRenderingEngine.BLAZE_3D)
|
||||
{
|
||||
#if MC_VER <= MC_1_21_10
|
||||
validApi = false;
|
||||
@@ -133,14 +134,14 @@ public class DependencySetup
|
||||
// crash if an invalid API is set
|
||||
if (!validApi)
|
||||
{
|
||||
String message = "["+renderingApiEnum+"] is not supported on this version of Minecraft, reverting to ["+EDhApiRenderApi.AUTO+"].";
|
||||
String message = "["+renderingApiEnum+"] is not supported on this version of Minecraft, reverting to ["+ EDhApiRenderingEngine.AUTO+"].";
|
||||
LOGGER.fatal(message);
|
||||
Config.Client.Advanced.Graphics.Experimental.renderingApi.set(EDhApiRenderApi.AUTO);
|
||||
Config.Client.Advanced.Graphics.Experimental.renderingEngine.set(EDhApiRenderingEngine.AUTO);
|
||||
throw new IllegalStateException(message);
|
||||
}
|
||||
|
||||
// crash if the rendering API set doesn't match Minecraft's
|
||||
EDhApiRenderApi mcRenderApi = MinecraftRenderWrapper.INSTANCE.getMcRenderingApi();
|
||||
EDhApiRenderingApi mcRenderApi = MinecraftRenderWrapper.INSTANCE.getMcRenderingApi();
|
||||
if (mcRenderApi != renderDefinition.getRenderApi())
|
||||
{
|
||||
String message = "["+renderDefinition.getApiName()+"] cannot be used due to it's API ["+renderDefinition.getRenderApi().name()+"] not matching what Minecraft is currently set to use. Please either change Minecraft's rendering API or Distant Horizons'.";
|
||||
|
||||
+4
-4
@@ -19,7 +19,7 @@
|
||||
|
||||
package com.seibel.distanthorizons.common.wrappers;
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingEngine;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.IVersionConstants;
|
||||
|
||||
public class VersionConstants implements IVersionConstants
|
||||
@@ -107,12 +107,12 @@ public class VersionConstants implements IVersionConstants
|
||||
}
|
||||
|
||||
@Override
|
||||
public EDhApiRenderApi getDefaultRenderingApi()
|
||||
public EDhApiRenderingEngine getDefaultRenderingEngine()
|
||||
{
|
||||
#if MC_VER <= MC_1_21_11
|
||||
return EDhApiRenderApi.OPEN_GL;
|
||||
return EDhApiRenderApi.OPEN_GL;
|
||||
#else
|
||||
return EDhApiRenderApi.BLAZE_3D;
|
||||
return EDhApiRenderingEngine.BLAZE_3D;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+4
-6
@@ -20,7 +20,6 @@
|
||||
package com.seibel.distanthorizons.common.wrappers.minecraft;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
#if MC_VER > MC_1_12_2
|
||||
@@ -29,7 +28,6 @@ import com.mojang.blaze3d.platform.NativeImage;
|
||||
#endif
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiLodShading;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderApi;
|
||||
import com.seibel.distanthorizons.common.wrappers.McObjectConverter;
|
||||
import com.seibel.distanthorizons.common.wrappers.misc.LightMapWrapper;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
@@ -37,6 +35,7 @@ import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector;
|
||||
import com.seibel.distanthorizons.core.enums.EDhDirection;
|
||||
import com.seibel.distanthorizons.core.logging.DhLoggerBuilder;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiRenderingApi;
|
||||
import com.seibel.distanthorizons.coreapi.util.ColorUtil;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.misc.ILightMapWrapper;
|
||||
|
||||
@@ -55,7 +54,6 @@ import org.joml.Vector3f;
|
||||
#else
|
||||
#endif
|
||||
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.modAccessor.AbstractOptifineAccessor;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IClientLevelWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IDimensionTypeWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.ILevelWrapper;
|
||||
@@ -437,9 +435,9 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
#endif
|
||||
}
|
||||
|
||||
private EDhApiRenderApi renderApi = null;
|
||||
private EDhApiRenderingApi renderApi = null;
|
||||
@Override
|
||||
public EDhApiRenderApi getMcRenderingApi()
|
||||
public EDhApiRenderingApi getMcRenderingApi()
|
||||
{
|
||||
if (this.renderApi != null)
|
||||
{
|
||||
@@ -455,7 +453,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
|
||||
.getDeviceInfo()
|
||||
.backendName();
|
||||
boolean isVulkan = backendName.equalsIgnoreCase("Vulkan");
|
||||
this.renderApi = isVulkan ? EDhApiRenderApi.VULKAN : EDhApiRenderApi.OPEN_GL;
|
||||
this.renderApi = isVulkan ? EDhApiRenderingApi.VULKAN : EDhApiRenderingApi.OPEN_GL;
|
||||
#endif
|
||||
return this.renderApi;
|
||||
}
|
||||
|
||||
+1
-1
Submodule coreSubProjects updated: 9db045d614...faa4fa3782
Reference in New Issue
Block a user