diff --git a/src/main/java/com/seibel/lod/builders/lodTemplates/Box.java b/src/main/java/com/seibel/lod/builders/lodTemplates/Box.java index fe1937e27..873127bcb 100644 --- a/src/main/java/com/seibel/lod/builders/lodTemplates/Box.java +++ b/src/main/java/com/seibel/lod/builders/lodTemplates/Box.java @@ -104,7 +104,7 @@ public class Box public int[][] box; public long[] order; public Map colorMap; - public int color; + public int debugColor; public Map adjHeightAndDepth; public Map culling; @@ -142,7 +142,7 @@ public class Box public void setColor(int color) { - this.color = color; + this.debugColor = color; for (Direction direction : DIRECTIONS) { colorMap.get(direction)[0] = ColorUtil.applyShade(color, MinecraftWrapper.INSTANCE.getClientWorld().getShade(direction, true)); @@ -154,9 +154,10 @@ public class Box if (LodConfig.CLIENT.debugging.debugMode.get() != DebugMode.SHOW_DETAIL) { return colorMap.get(direction)[0]; - } else + } + else { - return color; + return ColorUtil.applyShade(debugColor, MinecraftWrapper.INSTANCE.getClientWorld().getShade(direction, true)); } } @@ -400,7 +401,11 @@ public class Box return box[OFFSET][Z] + box[WIDTH][Z] * DIRECTION_VERTEX_MAP.get(direction)[vertexIndex][Z]; } - public boolean shouldContinue(Direction direction, int adjIndex) + /** + * returns true if the given direction should be rendered. + * TODO what does adjIndex represent? + */ + public boolean shouldRenderFace(Direction direction, int adjIndex) { if (direction == Direction.UP || direction == Direction.DOWN) { diff --git a/src/main/java/com/seibel/lod/builders/lodTemplates/CubicLodTemplate.java b/src/main/java/com/seibel/lod/builders/lodTemplates/CubicLodTemplate.java index 57ecca3d3..397475d05 100644 --- a/src/main/java/com/seibel/lod/builders/lodTemplates/CubicLodTemplate.java +++ b/src/main/java/com/seibel/lod/builders/lodTemplates/CubicLodTemplate.java @@ -103,10 +103,8 @@ public class CubicLodTemplate extends AbstractLodTemplate { for (Direction direction : Box.DIRECTIONS) { - //if(box.isCulled(direction)) - // continue; int adjIndex = 0; - while (box.shouldContinue(direction, adjIndex)) + while (box.shouldRenderFace(direction, adjIndex)) { for (int vertexIndex = 0; vertexIndex < 4; vertexIndex++) { @@ -124,7 +122,7 @@ public class CubicLodTemplate extends AbstractLodTemplate @Override public int getBufferMemoryForSingleNode(int maxVerticalData) { - // (sidesOnACube * pointsInASquare * (positionPoints + colorPoints))) + // TODO, someone please comment what these magic numbers mean return 2 * 4 * (3 + 4) + 4 * 4 * Math.max((maxVerticalData+1)/2,1) * (3 + 4); } diff --git a/src/main/java/com/seibel/lod/util/DataPointUtil.java b/src/main/java/com/seibel/lod/util/DataPointUtil.java index 3b255f606..e0aa52d6e 100644 --- a/src/main/java/com/seibel/lod/util/DataPointUtil.java +++ b/src/main/java/com/seibel/lod/util/DataPointUtil.java @@ -1,11 +1,11 @@ package com.seibel.lod.util; +import java.util.Arrays; + import com.seibel.lod.enums.DistanceGenerationMode; import net.minecraft.client.renderer.texture.NativeImage; -import java.util.Arrays; - public class DataPointUtil { /* @@ -178,7 +178,6 @@ public class DataPointUtil { int lightBlock = getLightBlock(dataPoint); int lightSky = getLightSky(dataPoint); - /**TODO ALL of this should be dimension dependent and lightMap dependent*/ int color = lightMap.getPixelRGBA(lightBlock, lightSky); int red = ColorUtil.getBlue(color); int green = ColorUtil.getGreen(color);