Fix RenderDataPointUtil capitalization

This commit is contained in:
James Seibel
2023-02-18 13:34:05 -06:00
parent 031bde07dd
commit 5dfd8d3738
8 changed files with 65 additions and 65 deletions
@@ -1,7 +1,7 @@
package com.seibel.lod.core.datatype.column.accessor;
import com.seibel.lod.core.util.RenderDatapointUtil;
import com.seibel.lod.core.util.RenderDataPointUtil;
import java.util.Arrays;
@@ -91,7 +91,7 @@ public final class ColumnArrayView implements IColumnDataView
{
if (override)
{
if (RenderDatapointUtil.compareDatapointPriority(source.get(o), get(o)) >= 0)
if (RenderDataPointUtil.compareDatapointPriority(source.get(o), get(o)) >= 0)
{
anyChange = true;
System.arraycopy(source.data, source.offset + o, data, offset + o, vertSize);
@@ -99,7 +99,7 @@ public final class ColumnArrayView implements IColumnDataView
}
else
{
if (RenderDatapointUtil.compareDatapointPriority(source.get(o), get(o)) > 0)
if (RenderDataPointUtil.compareDatapointPriority(source.get(o), get(o)) > 0)
{
anyChange = true;
System.arraycopy(source.data, source.offset + o, data, offset + o, vertSize);
@@ -123,7 +123,7 @@ public final class ColumnArrayView implements IColumnDataView
{
for (int i = 0; i < dataCount(); i++)
{
RenderDatapointUtil.mergeMultiData(source.subView(i, 1), subView(i, 1));
RenderDataPointUtil.mergeMultiData(source.subView(i, 1), subView(i, 1));
}
}
}
@@ -135,7 +135,7 @@ public final class ColumnArrayView implements IColumnDataView
throw new IllegalArgumentException("output dataCount must be 1");
}
RenderDatapointUtil.mergeMultiData(source, this);
RenderDataPointUtil.mergeMultiData(source, this);
}
@Override
@@ -149,7 +149,7 @@ public final class ColumnArrayView implements IColumnDataView
sb.append(" [");
for (int i = 0; i < size; i++)
{
sb.append(RenderDatapointUtil.toString(data[offset + i]));
sb.append(RenderDataPointUtil.toString(data[offset + i]));
if (i < size - 1)
{
sb.append(",\n");
@@ -15,7 +15,7 @@ import com.seibel.lod.core.level.IDhLevel;
import com.seibel.lod.core.render.LodQuadTree;
import com.seibel.lod.core.render.LodRenderSection;
import com.seibel.lod.core.util.ColorUtil;
import com.seibel.lod.core.util.RenderDatapointUtil;
import com.seibel.lod.core.util.RenderDataPointUtil;
import com.seibel.lod.core.util.objects.Reference;
import com.seibel.lod.core.util.LodUtil;
import org.apache.logging.log4j.Logger;
@@ -156,7 +156,7 @@ public class ColumnRenderSource implements IColumnDatatype
}
int dataOffset = posX * SECTION_SIZE * this.verticalDataCount + posZ * this.verticalDataCount;
int compare = RenderDatapointUtil.compareDatapointPriority(newData.get(0), this.dataContainer[dataOffset]);
int compare = RenderDataPointUtil.compareDatapointPriority(newData.get(0), this.dataContainer[dataOffset]);
if (overwriteDataWithSameGenerationMode)
{
if (compare < 0)
@@ -269,8 +269,8 @@ public class ColumnRenderSource implements IColumnDatatype
for (int i = 0; i < this.dataContainer.length; i += this.verticalDataCount)
{
int thisGenMode = RenderDatapointUtil.getGenerationMode(this.dataContainer[i]);
int srcGenMode = RenderDatapointUtil.getGenerationMode(renderSource.dataContainer[i]);
int thisGenMode = RenderDataPointUtil.getGenerationMode(this.dataContainer[i]);
int srcGenMode = RenderDataPointUtil.getGenerationMode(renderSource.dataContainer[i]);
if (srcGenMode == 0)
{
@@ -20,7 +20,7 @@
package com.seibel.lod.core.datatype.render.bufferBuilding;
import com.seibel.lod.core.datatype.column.accessor.ColumnArrayView;
import com.seibel.lod.core.util.RenderDatapointUtil;
import com.seibel.lod.core.util.RenderDataPointUtil;
import com.seibel.lod.core.render.renderer.LodRenderer;
import com.seibel.lod.core.enums.ELodDirection;
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
@@ -37,34 +37,34 @@ public class ColumnBox {
short maxY = (short) (y + ySize);
short maxZ = (short) (z + zSize);
byte skyLightTop = skyLight;
byte skyLightBot = RenderDatapointUtil.doesDataPointExist(botData) ? RenderDatapointUtil.getLightSky(botData) : 0;
byte skyLightBot = RenderDataPointUtil.doesDataPointExist(botData) ? RenderDataPointUtil.getLightSky(botData) : 0;
boolean isTransparent = ColorUtil.getAlpha(color) < 255 && LodRenderer.transparencyEnabled;
if (builder.skipQuadsWithZeroSkylight
&& 0 == skyLight
&& builder.skyLightCullingBelow > maxY
&& ((RenderDatapointUtil.getAlpha(topData) < 255 && RenderDatapointUtil.getHeight(topData) >= builder.skyLightCullingBelow)
|| (RenderDatapointUtil.getDepth(topData) >= builder.skyLightCullingBelow)
|| !RenderDatapointUtil.doesDataPointExist(topData))) {
&& ((RenderDataPointUtil.getAlpha(topData) < 255 && RenderDataPointUtil.getHeight(topData) >= builder.skyLightCullingBelow)
|| (RenderDataPointUtil.getDepth(topData) >= builder.skyLightCullingBelow)
|| !RenderDataPointUtil.doesDataPointExist(topData))) {
maxY = builder.skyLightCullingBelow;
}
boolean isTopTransparent = RenderDatapointUtil.getAlpha(topData) < 255 && LodRenderer.transparencyEnabled;
boolean isBotTransparent = RenderDatapointUtil.getAlpha(botData) < 255 && LodRenderer.transparencyEnabled;
boolean isTopTransparent = RenderDataPointUtil.getAlpha(topData) < 255 && LodRenderer.transparencyEnabled;
boolean isBotTransparent = RenderDataPointUtil.getAlpha(botData) < 255 && LodRenderer.transparencyEnabled;
// Up direction case
//We skip if
// current block is not transparent: we check if the adj block is attached and opaque
boolean skipTop = RenderDatapointUtil.doesDataPointExist(topData) && (RenderDatapointUtil.getDepth(topData) == maxY) && !isTopTransparent;
boolean skipBot = RenderDatapointUtil.doesDataPointExist(botData) && (RenderDatapointUtil.getHeight(botData) == y) && !isBotTransparent;
boolean skipTop = RenderDataPointUtil.doesDataPointExist(topData) && (RenderDataPointUtil.getDepth(topData) == maxY) && !isTopTransparent;
boolean skipBot = RenderDataPointUtil.doesDataPointExist(botData) && (RenderDataPointUtil.getHeight(botData) == y) && !isBotTransparent;
if (LodRenderer.transparencyEnabled && LodRenderer.fakeOceanFloor) {
if (!isTransparent && isTopTransparent && RenderDatapointUtil.doesDataPointExist(topData)) {
skyLightTop = (byte) MathUtil.clamp(0, 15 - (RenderDatapointUtil.getHeight(topData) - y), 15);
ySize = (short) (RenderDatapointUtil.getHeight(topData) - y - 1);
if (!isTransparent && isTopTransparent && RenderDataPointUtil.doesDataPointExist(topData)) {
skyLightTop = (byte) MathUtil.clamp(0, 15 - (RenderDataPointUtil.getHeight(topData) - y), 15);
ySize = (short) (RenderDataPointUtil.getHeight(topData) - y - 1);
//y = (short) (DataPointUtil.getHeight(topData) - 2);
//ySize = 1;
} else if (isTransparent && !isBotTransparent && RenderDatapointUtil.doesDataPointExist(botData)) {
} else if (isTransparent && !isBotTransparent && RenderDataPointUtil.doesDataPointExist(botData)) {
y = (short) (y + ySize - 1);
ySize = 1;
}
@@ -154,7 +154,7 @@ public class ColumnBox {
short z, short w0, short wy, int color, int overlapColor, byte upSkyLight, byte blockLight) {
color = ColorUtil.applyShade(color, MC.getShade(direction));
ColumnArrayView dataPoint = adjData;
if (dataPoint == null || RenderDatapointUtil.isVoid(dataPoint.get(0))) {
if (dataPoint == null || RenderDataPointUtil.isVoid(dataPoint.get(0))) {
builder.addQuadAdj(direction, x, y, z, w0, wy, color, (byte) 15, blockLight);
return;
}
@@ -166,24 +166,24 @@ public class ColumnBox {
byte nextSkyLight = upSkyLight;
boolean isTransparent = ColorUtil.getAlpha(color) < 255 && LodRenderer.transparencyEnabled;
boolean lastWasTransparent = false;
for (i = 0; i < dataPoint.size() && RenderDatapointUtil.doesDataPointExist(adjData.get(i))
&& !RenderDatapointUtil.isVoid(adjData.get(i)); i++) {
for (i = 0; i < dataPoint.size() && RenderDataPointUtil.doesDataPointExist(adjData.get(i))
&& !RenderDataPointUtil.isVoid(adjData.get(i)); i++) {
long adjPoint = adjData.get(i);
boolean isAdjTransparent = RenderDatapointUtil.getAlpha(adjPoint) < 255 && LodRenderer.transparencyEnabled;
boolean isAdjTransparent = RenderDataPointUtil.getAlpha(adjPoint) < 255 && LodRenderer.transparencyEnabled;
if (!(!isTransparent && isAdjTransparent && LodRenderer.transparencyEnabled)) {
short height = RenderDatapointUtil.getHeight(adjPoint);
short depth = RenderDatapointUtil.getDepth(adjPoint);
short height = RenderDataPointUtil.getHeight(adjPoint);
short depth = RenderDataPointUtil.getDepth(adjPoint);
if (LodRenderer.transparencyEnabled && LodRenderer.fakeOceanFloor) {
if (lastWasTransparent && !isAdjTransparent) {
height = (short) (RenderDatapointUtil.getHeight(adjData.get(i - 1)) - 1);
height = (short) (RenderDataPointUtil.getHeight(adjData.get(i - 1)) - 1);
} else if (isAdjTransparent && (i + 1) < adjData.size()) {
if (RenderDatapointUtil.getAlpha(adjData.get(i + 1)) == 255) {
if (RenderDataPointUtil.getAlpha(adjData.get(i + 1)) == 255) {
depth = (short) (height - 1);
}
}
@@ -201,14 +201,14 @@ public class ColumnBox {
// Basically: _____ height < y < maxY
// _______&&: depth ______ < y < maxY
if (firstFace) {
builder.addQuadAdj(direction, x, y, z, w0, wy, color, RenderDatapointUtil.getLightSky(adjPoint),
builder.addQuadAdj(direction, x, y, z, w0, wy, color, RenderDataPointUtil.getLightSky(adjPoint),
blockLight);
} else {
// Now: depth < height < y < previousDepth < maxY
if (previousDepth == -1)
throw new RuntimeException("Loop error");
builder.addQuadAdj(direction, x, y, z, w0, (short) (previousDepth - y), color,
RenderDatapointUtil.getLightSky(adjPoint), blockLight);
RenderDataPointUtil.getLightSky(adjPoint), blockLight);
previousDepth = -1;
}
break;
@@ -234,14 +234,14 @@ public class ColumnBox {
// if there was another face we finish the last one and break
if (firstFace) {
builder.addQuadAdj(direction, x, height, z, w0, (short) (y + wy - height), color,
RenderDatapointUtil.getLightSky(adjPoint), blockLight);
RenderDataPointUtil.getLightSky(adjPoint), blockLight);
} else {
// Now: depth <= y <= height <= previousDepth < maxY
if (previousDepth == -1)
throw new RuntimeException("Loop error");
if (previousDepth > height) {
builder.addQuadAdj(direction, x, height, z, w0, (short) (previousDepth - height), color,
RenderDatapointUtil.getLightSky(adjPoint), blockLight);
RenderDataPointUtil.getLightSky(adjPoint), blockLight);
}
previousDepth = -1;
}
@@ -267,14 +267,14 @@ public class ColumnBox {
}
if (firstFace) {
builder.addQuadAdj(direction, x, height, z, w0, (short) (y + wy - height), color,
RenderDatapointUtil.getLightSky(adjPoint), blockLight);
RenderDataPointUtil.getLightSky(adjPoint), blockLight);
} else {
// Now: y < depth < height <= previousDepth < maxY
if (previousDepth == -1)
throw new RuntimeException("Loop error");
if (previousDepth > height) {
builder.addQuadAdj(direction, x, height, z, w0, (short) (previousDepth - height), color,
RenderDatapointUtil.getLightSky(adjPoint), blockLight);
RenderDataPointUtil.getLightSky(adjPoint), blockLight);
}
previousDepth = -1;
}
@@ -285,8 +285,8 @@ public class ColumnBox {
previousDepth = depth;
firstFace = false;
nextSkyLight = upSkyLight;
if (i + 1 < adjData.size() && RenderDatapointUtil.doesDataPointExist(adjData.get(i + 1)))
nextSkyLight = RenderDatapointUtil.getLightSky(adjData.get(i + 1));
if (i + 1 < adjData.size() && RenderDataPointUtil.doesDataPointExist(adjData.get(i + 1)))
nextSkyLight = RenderDataPointUtil.getLightSky(adjData.get(i + 1));
lastWasTransparent = isAdjTransparent;
}
}
@@ -2,7 +2,7 @@ package com.seibel.lod.core.datatype.render.bufferBuilding;
import com.seibel.lod.core.datatype.render.ColumnRenderSource;
import com.seibel.lod.core.datatype.column.accessor.ColumnArrayView;
import com.seibel.lod.core.util.RenderDatapointUtil;
import com.seibel.lod.core.util.RenderDataPointUtil;
import com.seibel.lod.core.level.IDhClientLevel;
import com.seibel.lod.core.render.renderer.LodRenderer;
import com.seibel.lod.core.util.objects.UncheckedInterruptedException;
@@ -333,8 +333,8 @@ public class ColumnRenderBuffer extends AbstractRenderBuffer
UncheckedInterruptedException.throwIfInterrupted();
ColumnArrayView posData = region.getVerticalDataPointView(x, z);
if (posData.size() == 0 || !RenderDatapointUtil.doesDataPointExist(posData.get(0))
|| RenderDatapointUtil.isVoid(posData.get(0)))
if (posData.size() == 0 || !RenderDataPointUtil.doesDataPointExist(posData.get(0))
|| RenderDataPointUtil.isVoid(posData.get(0)))
continue;
ColumnRenderSource.DebugSourceFlag debugSourceFlag = region.debugGetFlag(x, z);
@@ -409,11 +409,11 @@ public class ColumnRenderBuffer extends AbstractRenderBuffer
long data = posData.get(i);
// If the data is not renderable (Void or non-existing) we stop since there is
// no data left in this position
if (RenderDatapointUtil.isVoid(data) || !RenderDatapointUtil.doesDataPointExist(data))
if (RenderDataPointUtil.isVoid(data) || !RenderDataPointUtil.doesDataPointExist(data))
break;
long adjDataTop = i - 1 >= 0 ? posData.get(i - 1) : RenderDatapointUtil.EMPTY_DATA;
long adjDataBot = i + 1 < posData.size() ? posData.get(i + 1) : RenderDatapointUtil.EMPTY_DATA;
long adjDataTop = i - 1 >= 0 ? posData.get(i - 1) : RenderDataPointUtil.EMPTY_DATA;
long adjDataBot = i + 1 < posData.size() ? posData.get(i + 1) : RenderDataPointUtil.EMPTY_DATA;
CubicLodTemplate.addLodToBuffer(data, adjDataTop, adjDataBot, adjData, detailLevel,
x, z, quadBuilder, debugMode, debugSourceFlag);
@@ -20,7 +20,7 @@
package com.seibel.lod.core.datatype.render.bufferBuilding;
import com.seibel.lod.core.datatype.render.ColumnRenderSource;
import com.seibel.lod.core.util.RenderDatapointUtil;
import com.seibel.lod.core.util.RenderDataPointUtil;
import com.seibel.lod.api.enums.rendering.EDebugMode;
import com.seibel.lod.core.dependencyInjection.SingletonInjector;
import com.seibel.lod.core.datatype.column.accessor.ColumnArrayView;
@@ -47,9 +47,9 @@ public class CubicLodTemplate
short width = (short) BitShiftUtil.powerOfTwo(detailLevel);
short x = (short) blockOffsetPos.x;
short y = RenderDatapointUtil.getDepth(data);
short y = RenderDataPointUtil.getDepth(data);
short z = (short) (short) blockOffsetPos.z;
short dy = (short) (RenderDatapointUtil.getHeight(data) - y);
short dy = (short) (RenderDataPointUtil.getHeight(data) - y);
if (dy == 0)
{
@@ -57,7 +57,7 @@ public class CubicLodTemplate
}
else if (dy < 0)
{
throw new IllegalArgumentException("Negative y size for the data! Data: " + RenderDatapointUtil.toString(data));
throw new IllegalArgumentException("Negative y size for the data! Data: " + RenderDataPointUtil.toString(data));
}
int color;
@@ -69,9 +69,9 @@ public class CubicLodTemplate
float saturationMultiplier = (float)CONFIG.client().graphics().advancedGraphics().getSaturationMultiplier();
float brightnessMultiplier = (float)CONFIG.client().graphics().advancedGraphics().getBrightnessMultiplier();
if (saturationMultiplier == 1.0 && brightnessMultiplier == 1.0) {
color = RenderDatapointUtil.getColor(data);
color = RenderDataPointUtil.getColor(data);
} else {
float[] ahsv = ColorUtil.argbToAhsv(RenderDatapointUtil.getColor(data));
float[] ahsv = ColorUtil.argbToAhsv(RenderDataPointUtil.getColor(data));
color = ColorUtil.ahsvToArgb(ahsv[0], ahsv[1], ahsv[2] * saturationMultiplier, ahsv[3] * brightnessMultiplier);
//ApiShared.LOGGER.info("Raw color:[{}], AHSV:{}, Out color:[{}]",
// ColorUtil.toString(DataPointUtil.getColor(data)),
@@ -89,7 +89,7 @@ public class CubicLodTemplate
case SHOW_GENMODE:
case SHOW_GENMODE_WIREFRAME:
{
color = LodUtil.DEBUG_DETAIL_LEVEL_COLORS[RenderDatapointUtil.getGenerationMode(data)];
color = LodUtil.DEBUG_DETAIL_LEVEL_COLORS[RenderDataPointUtil.getGenerationMode(data)];
fullBright = true;
break;
}
@@ -114,8 +114,8 @@ public class CubicLodTemplate
width, dy, width, // setWidth
x, y, z, // setOffset
color, // setColor
RenderDatapointUtil.getLightSky(data), // setSkyLights
fullBright ? 15 : RenderDatapointUtil.getLightBlock(data), // setBlockLights
RenderDataPointUtil.getLightSky(data), // setSkyLights
fullBright ? 15 : RenderDataPointUtil.getLightBlock(data), // setBlockLights
topData, botData, adjData); // setAdjData
}
}
@@ -1,7 +1,7 @@
package com.seibel.lod.core.datatype.transform;
import com.seibel.lod.core.datatype.full.IIncompleteFullDataSource;
import com.seibel.lod.core.util.RenderDatapointUtil;
import com.seibel.lod.core.util.RenderDataPointUtil;
import com.seibel.lod.core.datatype.render.ColumnRenderSource;
import com.seibel.lod.core.datatype.column.accessor.ColumnArrayView;
import com.seibel.lod.core.datatype.column.accessor.ColumnQuadView;
@@ -180,12 +180,12 @@ public class FullToColumnTransformer {
if (block.equals(AIR)) continue;
isVoid = false;
int color = level.computeBaseColor(new DhBlockPos(blockX, bottomY + level.getMinY(), blockZ), biome, block);
long columnData = RenderDatapointUtil.createDataPoint(bottomY + blockHeight, bottomY, color, light, genMode);
long columnData = RenderDataPointUtil.createDataPoint(bottomY + blockHeight, bottomY, color, light, genMode);
column.set(offset, columnData);
offset++;
}
if (isVoid) {
column.set(0, RenderDatapointUtil.createVoidDataPoint((byte) genMode));
column.set(0, RenderDataPointUtil.createVoidDataPoint((byte) genMode));
}
}
@@ -4,7 +4,7 @@ package com.seibel.lod.core.util;
import org.jetbrains.annotations.Contract;
import static com.seibel.lod.core.util.RenderDatapointUtil.MAX_WORLD_Y_SIZE;
import static com.seibel.lod.core.util.RenderDataPointUtil.MAX_WORLD_Y_SIZE;
/**
* <code>
@@ -30,7 +30,7 @@ import java.util.Arrays;
* A helper class that is used to access the data in a RenderColumn
* long datapoint.
*/
public class RenderDatapointUtil
public class RenderDataPointUtil
{
/*
@@ -319,8 +319,8 @@ public class RenderDatapointUtil
for (int index = 0; index < dataCount; index++)
{
tempData = sourceData.get(index * inputVerticalSize);
allVoid = allVoid && RenderDatapointUtil.isVoid(tempData);
allEmpty = allEmpty && !RenderDatapointUtil.doesDataPointExist(tempData);
allVoid = allVoid && RenderDataPointUtil.isVoid(tempData);
allEmpty = allEmpty && !RenderDataPointUtil.doesDataPointExist(tempData);
}
//We check if there is any data that's not empty or void
@@ -354,10 +354,10 @@ public class RenderDatapointUtil
if (indices[index] < inputVerticalSize)
{
tempData = sourceData.get(index * inputVerticalSize + indices[index]);
if (!RenderDatapointUtil.isVoid(tempData) && RenderDatapointUtil.doesDataPointExist(tempData))
if (!RenderDataPointUtil.isVoid(tempData) && RenderDataPointUtil.doesDataPointExist(tempData))
{
tempHeight = RenderDatapointUtil.getHeight(tempData);
tempDepth = RenderDatapointUtil.getDepth(tempData);
tempHeight = RenderDataPointUtil.getHeight(tempData);
tempDepth = RenderDataPointUtil.getDepth(tempData);
if (tempDepth >= newHeight)
{
//First case
@@ -452,7 +452,7 @@ public class RenderDatapointUtil
if (indices[index] < inputVerticalSize)
{
tempData = sourceData.get(index * inputVerticalSize + indices[index]);
stillHasDataToCheck |= !RenderDatapointUtil.isVoid(tempData) && RenderDatapointUtil.doesDataPointExist(tempData);
stillHasDataToCheck |= !RenderDataPointUtil.isVoid(tempData) && RenderDataPointUtil.doesDataPointExist(tempData);
}
}
}