improve quadBuilder var name

This commit is contained in:
James Seibel
2026-05-18 21:25:21 -05:00
parent d39c04d9cf
commit 7739e1cafd
3 changed files with 31 additions and 28 deletions
@@ -1114,6 +1114,8 @@ public class Config
.set(0) .set(0)
.build(); .build();
public static ConfigUISpacer positionFinderBlockPosSpacer = new ConfigUISpacer.Builder().build();
public static ConfigEntry<Integer> positionFinderMinBlockY = new ConfigEntry.Builder<Integer>() public static ConfigEntry<Integer> positionFinderMinBlockY = new ConfigEntry.Builder<Integer>()
.set(-64) .set(-64)
.build(); .build();
@@ -20,6 +20,7 @@
package com.seibel.distanthorizons.core.dataObjects.render.bufferBuilding; package com.seibel.distanthorizons.core.dataObjects.render.bufferBuilding;
import com.seibel.distanthorizons.core.config.Config; import com.seibel.distanthorizons.core.config.Config;
import com.seibel.distanthorizons.core.dataObjects.render.ColumnRenderSource;
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
import com.seibel.distanthorizons.core.enums.EDhDirection; import com.seibel.distanthorizons.core.enums.EDhDirection;
import com.seibel.distanthorizons.core.level.IDhClientLevel; import com.seibel.distanthorizons.core.level.IDhClientLevel;
@@ -51,7 +52,7 @@ public class ColumnBox
public static void addBoxQuadsToBuilder( public static void addBoxQuadsToBuilder(
LodQuadBuilder builder, PhantomArrayListCheckout phantomArrayCheckout, IDhClientLevel clientLevel, LodQuadBuilder builder, PhantomArrayListCheckout phantomArrayCheckout, IDhClientLevel clientLevel,
short width, short yHeight, short blockWidth, short yHeight,
short minX, short minY, short minZ, short minX, short minY, short minZ,
int color, byte irisBlockMaterialId, byte skyLight, byte blockLight, int color, byte irisBlockMaterialId, byte skyLight, byte blockLight,
long topData, long bottomData, ColumnRenderView[] adjData, boolean[] isAdjDataSameDetailLevel) long topData, long bottomData, ColumnRenderView[] adjData, boolean[] isAdjDataSameDetailLevel)
@@ -60,9 +61,9 @@ public class ColumnBox
// variable setup // // variable setup //
//================// //================//
short maxX = (short) (minX + width); short maxX = (short) (minX + blockWidth);
short maxY = (short) (minY + yHeight); short maxY = (short) (minY + yHeight);
short maxZ = (short) (minZ + width); short maxZ = (short) (minZ + blockWidth);
byte skyLightTop = skyLight; byte skyLightTop = skyLight;
byte skyLightBot = RenderDataPointUtil.doesDataPointExist(bottomData) ? RenderDataPointUtil.getLightSky(bottomData) : 0; byte skyLightBot = RenderDataPointUtil.doesDataPointExist(bottomData) ? RenderDataPointUtil.getLightSky(bottomData) : 0;
@@ -122,7 +123,7 @@ public class ColumnBox
&& !isTopTransparent; && !isTopTransparent;
if (!skipTop) if (!skipTop)
{ {
builder.addQuadUp(minX, maxY, minZ, width, ColorUtil.applyShade(color, MC_RENDER.getShade(EDhDirection.UP)), irisBlockMaterialId, skyLightTop, blockLight); builder.addQuadUp(minX, maxY, minZ, blockWidth, ColorUtil.applyShade(color, MC_RENDER.getShade(EDhDirection.UP)), irisBlockMaterialId, skyLightTop, blockLight);
} }
} }
@@ -133,7 +134,7 @@ public class ColumnBox
&& !isBottomTransparent; && !isBottomTransparent;
if (!skipBottom) if (!skipBottom)
{ {
builder.addQuadDown(minX, minY, minZ, width, ColorUtil.applyShade(color, MC_RENDER.getShade(EDhDirection.DOWN)), irisBlockMaterialId, skyLightBot, blockLight); builder.addQuadDown(minX, minY, minZ, blockWidth, ColorUtil.applyShade(color, MC_RENDER.getShade(EDhDirection.DOWN)), irisBlockMaterialId, skyLightBot, blockLight);
} }
} }
@@ -156,7 +157,7 @@ public class ColumnBox
builder.addQuadAdj( builder.addQuadAdj(
EDhDirection.NORTH, EDhDirection.NORTH,
minX, minY, minZ, minX, minY, minZ,
width, yHeight, blockWidth, yHeight,
color, irisBlockMaterialId, LodUtil.MAX_MC_LIGHT, blockLight); color, irisBlockMaterialId, LodUtil.MAX_MC_LIGHT, blockLight);
} }
} }
@@ -165,7 +166,7 @@ public class ColumnBox
makeAdjVerticalQuad( makeAdjVerticalQuad(
builder, phantomArrayCheckout, builder, phantomArrayCheckout,
adjCol, adjSameDetailLevel, caveCullingMaxY, EDhDirection.NORTH, adjCol, adjSameDetailLevel, caveCullingMaxY, EDhDirection.NORTH,
minX, minY, minZ, width, yHeight, minX, minY, minZ, blockWidth, yHeight,
color, irisBlockMaterialId, blockLight); color, irisBlockMaterialId, blockLight);
} }
} }
@@ -181,7 +182,7 @@ public class ColumnBox
builder.addQuadAdj( builder.addQuadAdj(
EDhDirection.SOUTH, EDhDirection.SOUTH,
minX, minY, maxZ, minX, minY, maxZ,
width, yHeight, blockWidth, yHeight,
color, irisBlockMaterialId, LodUtil.MAX_MC_LIGHT, blockLight); color, irisBlockMaterialId, LodUtil.MAX_MC_LIGHT, blockLight);
} }
} }
@@ -190,7 +191,7 @@ public class ColumnBox
makeAdjVerticalQuad( makeAdjVerticalQuad(
builder, phantomArrayCheckout, builder, phantomArrayCheckout,
adjCol, adjSameDetailLevel, caveCullingMaxY, EDhDirection.SOUTH, adjCol, adjSameDetailLevel, caveCullingMaxY, EDhDirection.SOUTH,
minX, minY, maxZ, width, yHeight, minX, minY, maxZ, blockWidth, yHeight,
color, irisBlockMaterialId, blockLight); color, irisBlockMaterialId, blockLight);
} }
} }
@@ -206,7 +207,7 @@ public class ColumnBox
builder.addQuadAdj( builder.addQuadAdj(
EDhDirection.WEST, EDhDirection.WEST,
minX, minY, minZ, minX, minY, minZ,
width, yHeight, blockWidth, yHeight,
color, irisBlockMaterialId, LodUtil.MAX_MC_LIGHT, blockLight); color, irisBlockMaterialId, LodUtil.MAX_MC_LIGHT, blockLight);
} }
} }
@@ -215,7 +216,7 @@ public class ColumnBox
makeAdjVerticalQuad( makeAdjVerticalQuad(
builder, phantomArrayCheckout, builder, phantomArrayCheckout,
adjCol, adjSameDetailLevel, caveCullingMaxY, EDhDirection.WEST, adjCol, adjSameDetailLevel, caveCullingMaxY, EDhDirection.WEST,
minX, minY, minZ, width, yHeight, minX, minY, minZ, blockWidth, yHeight,
color, irisBlockMaterialId, blockLight); color, irisBlockMaterialId, blockLight);
} }
} }
@@ -231,7 +232,7 @@ public class ColumnBox
builder.addQuadAdj( builder.addQuadAdj(
EDhDirection.EAST, EDhDirection.EAST,
maxX, minY, minZ, maxX, minY, minZ,
width, yHeight, blockWidth, yHeight,
color, irisBlockMaterialId, LodUtil.MAX_MC_LIGHT, blockLight); color, irisBlockMaterialId, LodUtil.MAX_MC_LIGHT, blockLight);
} }
} }
@@ -240,7 +241,7 @@ public class ColumnBox
makeAdjVerticalQuad( makeAdjVerticalQuad(
builder, phantomArrayCheckout, builder, phantomArrayCheckout,
adjCol, adjSameDetailLevel, caveCullingMaxY, EDhDirection.EAST, adjCol, adjSameDetailLevel, caveCullingMaxY, EDhDirection.EAST,
maxX, minY, minZ, width, yHeight, maxX, minY, minZ, blockWidth, yHeight,
color, irisBlockMaterialId, blockLight); color, irisBlockMaterialId, blockLight);
} }
} }
@@ -249,7 +250,7 @@ public class ColumnBox
private static void makeAdjVerticalQuad( private static void makeAdjVerticalQuad(
LodQuadBuilder builder, PhantomArrayListCheckout phantomArrayCheckout, LodQuadBuilder builder, PhantomArrayListCheckout phantomArrayCheckout,
@NotNull ColumnRenderView adjColumnView, boolean adjacentIsSameDetailLevel, int caveCullingMaxY, EDhDirection direction, @NotNull ColumnRenderView adjColumnView, boolean adjacentIsSameDetailLevel, int caveCullingMaxY, EDhDirection direction,
short x, short yMin, short z, short horizontalWidth, short ySize, short x, short yMin, short z, short horizontalBlockWidth, short ySize,
int color, byte irisBlockMaterialId, byte blockLight) int color, byte irisBlockMaterialId, byte blockLight)
{ {
// pooled arrays // pooled arrays
@@ -268,7 +269,7 @@ public class ColumnBox
if (adjColumnView.size == 0 if (adjColumnView.size == 0
|| RenderDataPointUtil.hasZeroHeight(adjColumnView.get(0))) || RenderDataPointUtil.hasZeroHeight(adjColumnView.get(0)))
{ {
builder.addQuadAdj(direction, x, yMin, z, horizontalWidth, ySize, color, irisBlockMaterialId, LodUtil.MAX_MC_LIGHT, blockLight); builder.addQuadAdj(direction, x, yMin, z, horizontalBlockWidth, ySize, color, irisBlockMaterialId, LodUtil.MAX_MC_LIGHT, blockLight);
return; return;
} }
@@ -374,7 +375,7 @@ public class ColumnBox
long segment = segments.getLong(i); long segment = segments.getLong(i);
tryAddVerticalFaceWithSkyLightToBuilder( tryAddVerticalFaceWithSkyLightToBuilder(
builder, direction, builder, direction,
x, z, horizontalWidth, x, z, horizontalBlockWidth,
color, irisBlockMaterialId, blockLight, color, irisBlockMaterialId, blockLight,
YSegmentUtil.getSkyLight(segment), inputTransparent, YSegmentUtil.getEndY(segment), YSegmentUtil.getStartY(segment) YSegmentUtil.getSkyLight(segment), inputTransparent, YSegmentUtil.getEndY(segment), YSegmentUtil.getStartY(segment)
); );
@@ -143,7 +143,7 @@ public class LodQuadBuilder
//===========// //===========//
// add quads // // add quads //
//===========// //===========//
///region //region
public void addQuadAdj( public void addQuadAdj(
EDhDirection dir, EDhDirection dir,
@@ -182,35 +182,35 @@ public class LodQuadBuilder
} }
// XZ // XZ
public void addQuadUp(short minX, short maxY, short minZ, short width, int color, byte irisBlockMaterialId, byte skylight, byte blocklight) public void addQuadUp(short minX, short maxY, short minZ, short blockWidth, int color, byte irisBlockMaterialId, byte skylight, byte blocklight)
{ {
boolean isTransparent = (this.doTransparency && ColorUtil.getAlpha(color) < 255); boolean isTransparent = (this.doTransparency && ColorUtil.getAlpha(color) < 255);
ArrayList<BufferQuad> quadList = isTransparent ArrayList<BufferQuad> quadList = isTransparent
? this.transparentQuads[EDhDirection.UP.ordinal()] ? this.transparentQuads[EDhDirection.UP.ordinal()]
: this.opaqueQuads[EDhDirection.UP.ordinal()]; : this.opaqueQuads[EDhDirection.UP.ordinal()];
BufferQuad quad = new BufferQuad(minX, maxY, minZ, width, width, color, irisBlockMaterialId, skylight, blocklight, EDhDirection.UP); BufferQuad quad = new BufferQuad(minX, maxY, minZ, blockWidth, blockWidth, color, irisBlockMaterialId, skylight, blocklight, EDhDirection.UP);
quadList.add(quad); quadList.add(quad);
} }
public void addQuadDown(short x, short y, short z, short width, int color, byte irisBlockMaterialId, byte skylight, byte blocklight) public void addQuadDown(short x, short y, short z, short blockWidth, int color, byte irisBlockMaterialId, byte skylight, byte blocklight)
{ {
ArrayList<BufferQuad> quadArray = (this.doTransparency && ColorUtil.getAlpha(color) < 255) ArrayList<BufferQuad> quadArray = (this.doTransparency && ColorUtil.getAlpha(color) < 255)
? this.transparentQuads[EDhDirection.DOWN.ordinal()] ? this.transparentQuads[EDhDirection.DOWN.ordinal()]
: this.opaqueQuads[EDhDirection.DOWN.ordinal()]; : this.opaqueQuads[EDhDirection.DOWN.ordinal()];
BufferQuad quad = new BufferQuad(x, y, z, width, width, color, irisBlockMaterialId, skylight, blocklight, EDhDirection.DOWN); BufferQuad quad = new BufferQuad(x, y, z, blockWidth, blockWidth, color, irisBlockMaterialId, skylight, blocklight, EDhDirection.DOWN);
quadArray.add(quad); quadArray.add(quad);
} }
///endregion //endregion
//=================// //=================//
// data finalizing // // data finalizing //
//=================// //=================//
///region //region
/** Uses Greedy meshing to merge this builder's Quads. */ /** Uses Greedy meshing to merge this builder's Quads. */
public void mergeQuads() public void mergeQuads()
@@ -279,14 +279,14 @@ public class LodQuadBuilder
return mergeCount; return mergeCount;
} }
///endregion //endregion
//==============// //==============//
// buffer setup // // buffer setup //
//==============// //==============//
///region //region
public ArrayList<ByteBuffer> makeOpaqueVertexBuffers() { return this.makeVertexBuffers(this.opaqueQuads); } public ArrayList<ByteBuffer> makeOpaqueVertexBuffers() { return this.makeVertexBuffers(this.opaqueQuads); }
public ArrayList<ByteBuffer> makeTransparentVertexBuffers() { return this.makeVertexBuffers(this.transparentQuads); } public ArrayList<ByteBuffer> makeTransparentVertexBuffers() { return this.makeVertexBuffers(this.transparentQuads); }
@@ -451,14 +451,14 @@ public class LodQuadBuilder
bb.putShort((short) 0); // padding to make sure the vertex format as a whole is a multiple of 4 bb.putShort((short) 0); // padding to make sure the vertex format as a whole is a multiple of 4
} }
///endregion //endregion
//=========// //=========//
// getters // // getters //
//=========// //=========//
///region //region
public int getCurrentOpaqueQuadsCount() public int getCurrentOpaqueQuadsCount()
{ {
@@ -513,7 +513,7 @@ public class LodQuadBuilder
return fullSizedBuffer; return fullSizedBuffer;
} }
///endregion //endregion