Skip to content

Commit 7cbb5f7

Browse files
committed
unroll Resizable Cuboid loops to draw an axis at a time and reduce repeated calculations
remove some redundant overrides
1 parent 2d4099c commit 7cbb5f7

File tree

5 files changed

+339
-151
lines changed

5 files changed

+339
-151
lines changed

src/main/java/mekanism/client/render/MekanismRenderer.java

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -110,31 +110,14 @@ public static TextureAtlasSprite getSprite(ResourceLocation spriteLocation) {
110110
public static void renderObject(@Nullable Model3D object, @NotNull PoseStack matrix, VertexConsumer buffer, int argb, int light, int overlay,
111111
FaceDisplay faceDisplay, Camera camera, BlockPos renderPos) {
112112
if (object != null) {
113-
renderObject(object, matrix, buffer, argb, light, overlay, faceDisplay, camera, Vec3.atLowerCornerOf(renderPos));
114-
}
115-
}
116-
117-
public static void renderObject(@Nullable Model3D object, @NotNull PoseStack matrix, VertexConsumer buffer, int argb, int light, int overlay,
118-
FaceDisplay faceDisplay, Camera camera) {
119-
renderObject(object, matrix, buffer, argb, light, overlay, faceDisplay, camera, (Vec3) null);
120-
}
121-
122-
public static void renderObject(@Nullable Model3D object, @NotNull PoseStack matrix, VertexConsumer buffer, int argb, int light, int overlay,
123-
FaceDisplay faceDisplay, Camera camera, @Nullable Vec3 renderPos) {
124-
if (object != null) {
125-
RenderResizableCuboid.renderCube(object, matrix, buffer, argb, light, overlay, faceDisplay, camera, renderPos);
113+
RenderResizableCuboid.renderCube(object, matrix, buffer, argb, light, overlay, faceDisplay, camera, Vec3.atLowerCornerOf(renderPos));
126114
}
127115
}
128116

129117
public static void renderObject(@Nullable Model3D object, @NotNull PoseStack matrix, VertexConsumer buffer, int[] colors, int light, int overlay,
130118
FaceDisplay faceDisplay, Camera camera) {
131-
renderObject(object, matrix, buffer, colors, light, overlay, faceDisplay, camera, null);
132-
}
133-
134-
public static void renderObject(@Nullable Model3D object, @NotNull PoseStack matrix, VertexConsumer buffer, int[] colors, int light, int overlay,
135-
FaceDisplay faceDisplay, Camera camera, @Nullable Vec3 renderPos) {
136119
if (object != null) {
137-
RenderResizableCuboid.renderCube(object, matrix, buffer, colors, light, overlay, faceDisplay, camera, renderPos);
120+
RenderResizableCuboid.renderCube(object, matrix, buffer, colors, light, overlay, faceDisplay, camera, null);
138121
}
139122
}
140123

0 commit comments

Comments
 (0)