mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-20 20:32:14 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea4a3cdf0b | ||
|
|
65959268d0 |
No files matched your search
@@ -328,6 +328,7 @@ public class GLStateManager {
|
||||
@Getter protected static final ViewPortStateStack viewportState = new ViewPortStateStack();
|
||||
|
||||
@Getter protected static int activeProgram = 0;
|
||||
@Getter protected static int listBase = 0;
|
||||
|
||||
public static void reset() {
|
||||
runningSplash = true;
|
||||
@@ -804,6 +805,7 @@ public class GLStateManager {
|
||||
return switch (pname) {
|
||||
case GL11.GL_ALPHA_TEST_FUNC -> alphaState.getFunction();
|
||||
case GL11.GL_DEPTH_FUNC -> depthState.getFunc();
|
||||
case GL11.GL_LIST_BASE -> listBase;
|
||||
case GL11.GL_LIST_MODE -> DisplayListManager.getListMode();
|
||||
case GL11.GL_MATRIX_MODE -> matrixMode.getMode();
|
||||
case GL11.GL_SHADE_MODEL -> shadeModelState.getValue();
|
||||
@@ -2137,7 +2139,7 @@ public class GLStateManager {
|
||||
// TODO: Iris Notifier
|
||||
if (HAS_MULTIPLE_SET.contains(pname)) {
|
||||
GL11.glFog(pname, param);
|
||||
|
||||
|
||||
if (pname == GL11.GL_FOG_COLOR && isCachingEnabled()) {
|
||||
final float red = param.get(0);
|
||||
final float green = param.get(1);
|
||||
@@ -2459,7 +2461,7 @@ public class GLStateManager {
|
||||
// Reset relative transform - subsequent transforms are relative to loaded matrix
|
||||
DisplayListManager.resetRelativeTransform();
|
||||
if (mode == RecordMode.COMPILE) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (isCachingEnabled()) {
|
||||
@@ -3584,24 +3586,28 @@ public class GLStateManager {
|
||||
|
||||
// Display List Commands
|
||||
public static void glCallLists(IntBuffer lists) {
|
||||
if (DisplayListManager.isRecording()) {
|
||||
throw new UnsupportedOperationException("glCallLists in display lists not yet implemented - if you see this, please report!");
|
||||
while (lists.hasRemaining()) {
|
||||
final int listId = lists.get() + listBase;
|
||||
glCallList(listId);
|
||||
}
|
||||
}
|
||||
|
||||
public static void glCallLists(ShortBuffer lists) {
|
||||
while (lists.hasRemaining()) {
|
||||
final int listId = (lists.get() & 0xFFFF) + listBase;
|
||||
glCallList(listId);
|
||||
}
|
||||
GL11.glCallLists(lists);
|
||||
}
|
||||
|
||||
public static void glCallLists(ByteBuffer lists) {
|
||||
if (DisplayListManager.isRecording()) {
|
||||
throw new UnsupportedOperationException("glCallLists in display lists not yet implemented - if you see this, please report!");
|
||||
while (lists.hasRemaining()) {
|
||||
final int listId = (lists.get() & 0xFF) + listBase;
|
||||
glCallList(listId);
|
||||
}
|
||||
GL11.glCallLists(lists);
|
||||
}
|
||||
|
||||
public static void glListBase(int base) {
|
||||
if (DisplayListManager.isRecording()) {
|
||||
throw new UnsupportedOperationException("glListBase in display lists not yet implemented - if you see this, please report!");
|
||||
}
|
||||
GL11.glListBase(base);
|
||||
listBase = base;
|
||||
}
|
||||
|
||||
// Clip Plane Commands
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.gtnewhorizons.angelica.mixins.interfaces.IGameSettingsExt;
|
||||
import com.gtnewhorizons.angelica.render.CloudRenderer;
|
||||
import com.gtnewhorizons.angelica.rendering.AngelicaBlockSafetyRegistry;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.CeleritasDebugScreenHandler;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.CeleritasSetup;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.threading.ChunkTaskRegistry;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.threading.DefaultChunkTaskProvider;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.threading.ThreadedChunkTaskProvider;
|
||||
@@ -66,9 +67,7 @@ import net.minecraftforge.client.event.GuiOpenEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import org.embeddedt.embeddium.impl.gl.device.GLRenderDevice;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL15;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@@ -116,8 +115,10 @@ public class ClientProxy extends CommonProxy {
|
||||
HUDCaching.init();
|
||||
}
|
||||
if (AngelicaConfig.enableCeleritas) {
|
||||
GLRenderDevice.VANILLA_STATE_RESETTER = () -> GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
|
||||
CeleritasSetup.ensureInitialized();
|
||||
MinecraftForge.EVENT_BUS.register(CeleritasDebugScreenHandler.INSTANCE);
|
||||
} else {
|
||||
LOGGER.info("Celeritas is disabled, skipping initialization from init()");
|
||||
}
|
||||
if (AngelicaConfig.enableIris) {
|
||||
MinecraftForge.EVENT_BUS.register(IrisDebugScreenHandler.INSTANCE);
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.gtnewhorizons.angelica.rendering.celeritas;
|
||||
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import org.embeddedt.embeddium.impl.gl.device.GLRenderDevice;
|
||||
import org.lwjgl.opengl.GL15;
|
||||
import static com.gtnewhorizons.angelica.loading.AngelicaTweaker.LOGGER;
|
||||
|
||||
public class CeleritasSetup {
|
||||
private static boolean initialized = false;
|
||||
|
||||
public static void ensureInitialized() {
|
||||
if (!initialized && AngelicaConfig.enableCeleritas) {
|
||||
GLRenderDevice.VANILLA_STATE_RESETTER = () -> GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
|
||||
LOGGER.debug("Celeritas init");
|
||||
initialized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
@@ -7,6 +7,7 @@ import com.gtnewhorizons.angelica.mixins.interfaces.IRenderGlobalExt;
|
||||
import com.gtnewhorizons.angelica.rendering.AngelicaRenderQueue;
|
||||
import com.gtnewhorizons.angelica.rendering.RenderingState;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.BlockRenderLayer;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.CeleritasSetup;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.CeleritasWorldRenderer;
|
||||
import net.coderbot.iris.Iris;
|
||||
import net.coderbot.iris.layer.GbufferPrograms;
|
||||
@@ -212,6 +213,7 @@ public class MixinRenderGlobal implements IRenderGlobalExt {
|
||||
|
||||
@Unique
|
||||
public void angelica$reload() {
|
||||
CeleritasSetup.ensureInitialized();
|
||||
RenderDevice.enterManagedCode();
|
||||
try {
|
||||
this.celeritas$renderer.reload();
|
||||
|
||||
Reference in new issue
Block a user