add a temporary fix to color debug mode not having shading

This commit is contained in:
James Seibel
2021-09-24 07:59:07 -05:00
parent f6816d9974
commit ccb2c601a6
3 changed files with 14 additions and 12 deletions
@@ -104,7 +104,7 @@ public class Box
public int[][] box;
public long[] order;
public Map<Direction, int[]> colorMap;
public int color;
public int debugColor;
public Map<Direction, int[][]> adjHeightAndDepth;
public Map<Direction, boolean[]> 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)
{
@@ -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);
}
@@ -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);