diff --git a/src/main/java/com/seibel/lod/builders/LodBufferBuilder.java b/src/main/java/com/seibel/lod/builders/LodBufferBuilder.java index 281de947d..f6a0c9b77 100644 --- a/src/main/java/com/seibel/lod/builders/LodBufferBuilder.java +++ b/src/main/java/com/seibel/lod/builders/LodBufferBuilder.java @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.lwjgl.opengl.GL11; import com.seibel.lod.builders.worldGeneration.LodChunkGenWorker; +import com.seibel.lod.enums.LodDetail; import com.seibel.lod.handlers.LodConfig; import com.seibel.lod.objects.LodChunk; import com.seibel.lod.objects.LodDimension; @@ -156,13 +157,14 @@ public class LodBufferBuilder continue; } + LodDetail detail = LodConfig.CLIENT.lodDetail.get(); // set where this square will be drawn in the world double xOffset = (LodChunk.WIDTH * i) + // offset by the number of LOD blocks startX + // offset so the center LOD block is centered underneath the player - 2; // truncation(?) correction + detail.offset; // truncation(?) correction double yOffset = 0; - double zOffset = (LodChunk.WIDTH * j) + startZ + 2; + double zOffset = (LodChunk.WIDTH * j) + startZ + detail.offset; LodChunk lod = lodDim.getLodFromCoordinates(chunkX, chunkZ); diff --git a/src/main/java/com/seibel/lod/enums/LodDetail.java b/src/main/java/com/seibel/lod/enums/LodDetail.java index bdff9cfa2..06fbf22ef 100644 --- a/src/main/java/com/seibel/lod/enums/LodDetail.java +++ b/src/main/java/com/seibel/lod/enums/LodDetail.java @@ -17,7 +17,6 @@ */ package com.seibel.lod.enums; -import com.seibel.lod.objects.LodChunk; import com.seibel.lod.objects.LodDataPoint; /** @@ -29,19 +28,19 @@ import com.seibel.lod.objects.LodDataPoint; public enum LodDetail { /** render 1 LOD for each chunk */ - SINGLE(1), + SINGLE(1, 4), /** render 4 LODs for each chunk */ - DOUBLE(2), + DOUBLE(2, 2), /** render 16 LODs for each chunk */ - QUAD(4), + QUAD(4, 1), /** render 64 LODs for each chunk */ - HALF(8), + HALF(8, 0), /** render 256 LODs for each chunk */ - FULL(16); + FULL(16, 0); /** How many DataPoints should @@ -62,19 +61,25 @@ public enum LodDetail * when creating a LodChunk with this detail level */ public final int lodChunkStringDelimiterCount; + /** in LodBufferBuilder some of the detail don't render + * in the correct spot, this number fixes that. + * TODO find out why this is needed and see if it + * needed / could be removed */ + public final int offset; - - private LodDetail(int newLengthCount) + private LodDetail(int newLengthCount, int newOffset) { dataPointLengthCount = newLengthCount; dataPointWidth = 16 / dataPointLengthCount; - if(newLengthCount == LodChunk.WIDTH) - { - // this is to prevent overflow - newLengthCount = LodChunk.WIDTH - 1; - } + offset = newOffset; + +// if(newLengthCount == LodChunk.WIDTH) +// { +// // this is to prevent overflow +// newLengthCount = LodChunk.WIDTH - 1; +// } startX = new int[dataPointLengthCount * dataPointLengthCount]; endX = new int[dataPointLengthCount * dataPointLengthCount];