Skip to content

Commit

Permalink
Revert "New VertexFormatInterface to hold status of vertex format ove…
Browse files Browse the repository at this point in the history
…rlay"

This reverts commit 5b1cf17.
  • Loading branch information
IMS212 committed Feb 3, 2022
1 parent 5b1cf17 commit 86a315a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 41 deletions.

This file was deleted.

28 changes: 0 additions & 28 deletions src/main/java/net/coderbot/iris/mixin/MixinVertexFormat.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import net.coderbot.iris.layer.GbufferProgram;
import net.coderbot.iris.layer.IrisRenderTypeWrapper;
import net.coderbot.iris.layer.UseProgramRenderStateShard;
import net.coderbot.iris.layer.VertexFormatInterface;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.renderer.RenderStateShard;
Expand Down Expand Up @@ -151,7 +150,7 @@ private static RenderType wrap(RenderType wrapped, GbufferProgram program) {
private static void iris$wrapEntityRenderTypes(ResourceLocation texture, CallbackInfoReturnable<RenderType> cir) {
RenderType base = cir.getReturnValue();

cir.setReturnValue(wrap(base, ((VertexFormatInterface) base.format()).hasOverlay() ? GbufferProgram.ENTITIES : GbufferProgram.ENTITY_NO_OVERLAY));
cir.setReturnValue(wrap(base, base.format().getElements().contains(DefaultVertexFormat.ELEMENT_UV1) ? GbufferProgram.ENTITIES : GbufferProgram.ENTITY_NO_OVERLAY));
}

@Inject(at = @At("RETURN"), method = {
Expand All @@ -162,7 +161,7 @@ private static RenderType wrap(RenderType wrapped, GbufferProgram program) {
private static void iris$wrapEntityRenderTypesZ(ResourceLocation texture, boolean affectsOutline, CallbackInfoReturnable<RenderType> cir) {
RenderType base = cir.getReturnValue();

cir.setReturnValue(wrap(base, ((VertexFormatInterface) base.format()).hasOverlay() ? GbufferProgram.ENTITIES : GbufferProgram.ENTITY_NO_OVERLAY));
cir.setReturnValue(wrap(base, base.format().getElements().contains(DefaultVertexFormat.ELEMENT_UV1) ? GbufferProgram.ENTITIES : GbufferProgram.ENTITY_NO_OVERLAY));
}

@Inject(at = @At("RETURN"), method = {
Expand All @@ -171,7 +170,7 @@ private static RenderType wrap(RenderType wrapped, GbufferProgram program) {
private static void iris$wrapEntityAlpha(ResourceLocation texture, float alpha, CallbackInfoReturnable<RenderType> cir) {
RenderType base = cir.getReturnValue();

cir.setReturnValue(wrap(base, ((VertexFormatInterface) base.format()).hasOverlay() ? GbufferProgram.ENTITIES : GbufferProgram.ENTITY_NO_OVERLAY));
cir.setReturnValue(wrap(base, base.format().getElements().contains(DefaultVertexFormat.ELEMENT_UV1) ? GbufferProgram.ENTITIES : GbufferProgram.ENTITY_NO_OVERLAY));
}

@Inject(at = @At("RETURN"), method = {
Expand Down Expand Up @@ -199,7 +198,7 @@ private static RenderType wrap(RenderType wrapped, GbufferProgram program) {
RenderType base = cir.getReturnValue();

// TODO: What render type to use for this? It's used by charged creepers and withers.
cir.setReturnValue(wrap(base, ((VertexFormatInterface) base.format()).hasOverlay() ? GbufferProgram.ENTITIES : GbufferProgram.ENTITY_NO_OVERLAY));
cir.setReturnValue(wrap(base, base.format().getElements().contains(DefaultVertexFormat.ELEMENT_UV1) ? GbufferProgram.ENTITIES : GbufferProgram.ENTITY_NO_OVERLAY));
}

@Inject(at = @At("RETURN"), method = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.coderbot.iris.mixin.vertices;

import net.coderbot.iris.layer.VertexFormatInterface;
import net.coderbot.iris.vendored.joml.Vector3f;
import net.coderbot.iris.vertices.BlockSensitiveBufferBuilder;
import net.coderbot.iris.vertices.IrisVertexFormats;
Expand Down Expand Up @@ -77,7 +76,7 @@ public abstract class MixinBufferBuilder implements BufferVertexConsumer, BlockS
@Inject(method = "begin", at = @At("RETURN"))
private void iris$afterBegin(int drawMode, VertexFormat format, CallbackInfo ci) {
if (extending) {
this.format = ((VertexFormatInterface) this.format).hasOverlay() ? IrisVertexFormats.ENTITY : IrisVertexFormats.TERRAIN;
this.format = format == DefaultVertexFormat.NEW_ENTITY ? IrisVertexFormats.ENTITY : IrisVertexFormats.TERRAIN;
this.currentElement = this.format.getElements().get(0);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/mixins.iris.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"MixinTitleScreen",
"MixinMaxFpsCrashFix",
"MixinTweakFarPlane",
"MixinVertexFormat",
"MixinCrashReport",
"entity_render_context.MixinBlockEntityRenderDispatcher",
"entity_render_context.MixinEntityRenderDispatcher",
Expand Down

0 comments on commit 86a315a

Please sign in to comment.