mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-14 11:15:43 +00:00
Use RenderSystem for setting polygon offsets
This commit is contained in:
parent
e7fe22d4f8
commit
36ce490566
@ -208,8 +208,8 @@ public class MonitorBlockEntityRenderer implements BlockEntityRenderer<MonitorBl
|
|||||||
backgroundBuffer.drawWithShader(matrix, RenderSystem.getProjectionMatrix(), RenderTypes.getTerminalShader());
|
backgroundBuffer.drawWithShader(matrix, RenderSystem.getProjectionMatrix(), RenderTypes.getTerminalShader());
|
||||||
|
|
||||||
// Render foreground geometry with glPolygonOffset enabled.
|
// Render foreground geometry with glPolygonOffset enabled.
|
||||||
GL11.glPolygonOffset(-1.0f, -10.0f);
|
RenderSystem.polygonOffset(-1.0f, -10.0f);
|
||||||
GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
|
RenderSystem.enablePolygonOffset();
|
||||||
|
|
||||||
foregroundBuffer.bind();
|
foregroundBuffer.bind();
|
||||||
foregroundBuffer.drawWithShader(
|
foregroundBuffer.drawWithShader(
|
||||||
@ -221,8 +221,8 @@ public class MonitorBlockEntityRenderer implements BlockEntityRenderer<MonitorBl
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Clear state
|
// Clear state
|
||||||
GL11.glPolygonOffset(0.0f, -0.0f);
|
RenderSystem.polygonOffset(0.0f, -0.0f);
|
||||||
GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
|
RenderSystem.disablePolygonOffset();
|
||||||
RenderTypes.TERMINAL.clearRenderState();
|
RenderTypes.TERMINAL.clearRenderState();
|
||||||
VertexBuffer.unbind();
|
VertexBuffer.unbind();
|
||||||
|
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of ComputerCraft - http://www.computercraft.info
|
||||||
|
* Copyright Daniel Ratcliffe, 2011-2022. Do not distribute without permission.
|
||||||
|
* Send enquiries to dratcliffe@gmail.com
|
||||||
|
*/
|
||||||
|
package dan200.computercraft.mixin.gametest.client;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.client.gui.screens.worldselection.WorldOpenFlows;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Overwrite;
|
||||||
|
|
||||||
|
@Mixin(WorldOpenFlows.class)
|
||||||
|
public class WorldOpenFlowsMixin {
|
||||||
|
/**
|
||||||
|
* Never prompt for backup/experimental options when running tests
|
||||||
|
*
|
||||||
|
* @param screen The current menu
|
||||||
|
* @param level The level to load.
|
||||||
|
* @param customised Whether this rule uses legacy customised worldgen options.
|
||||||
|
* @param action The action run to load the world.
|
||||||
|
* @author SquidDev
|
||||||
|
* @reason Makes it easier to run tests. We can switch to an @Inject if this becomes a problem.
|
||||||
|
*/
|
||||||
|
@Overwrite
|
||||||
|
private void askForBackup(Screen screen, String level, boolean customised, Runnable action) {
|
||||||
|
action.run();
|
||||||
|
}
|
||||||
|
}
|
@ -15,6 +15,7 @@
|
|||||||
"TestCommandAccessor"
|
"TestCommandAccessor"
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"client.MinecraftMixin"
|
"client.MinecraftMixin",
|
||||||
|
"client.WorldOpenFlowsMixin"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user