From 772de1b8698f7965f9b4b480bef26f6007011821 Mon Sep 17 00:00:00 2001 From: Leonardo Date: Mon, 20 Sep 2021 14:59:42 +0200 Subject: [PATCH] Refactoring, removed unused class/enum, fixed a small array bug --- .../com/seibel/lod/builders/LodBuilder.java | 8 +- .../java/com/seibel/lod/config/LodConfig.java | 35 ++++---- .../com/seibel/lod/enums/ColorDirection.java | 51 ----------- .../lod/enums/DistanceCalculatorType.java | 5 -- .../java/com/seibel/lod/enums/LodCorner.java | 43 ---------- .../seibel/lod/enums/LodRenderDistance.java | 50 ----------- .../{LodDetail.java => LodResolution.java} | 35 ++++---- .../seibel/lod/enums/RelativeChunkPos.java | 86 ------------------- .../com/seibel/lod/proxy/ClientProxy.java | 6 +- .../com/seibel/lod/util/DataPointUtil.java | 2 +- .../seibel/lod/util/DetailDistanceUtil.java | 42 +++------ .../com/seibel/lod/util/ThreadMapUtil.java | 2 +- 12 files changed, 55 insertions(+), 310 deletions(-) delete mode 100644 src/main/java/com/seibel/lod/enums/ColorDirection.java delete mode 100644 src/main/java/com/seibel/lod/enums/LodCorner.java delete mode 100644 src/main/java/com/seibel/lod/enums/LodRenderDistance.java rename src/main/java/com/seibel/lod/enums/{LodDetail.java => LodResolution.java} (81%) delete mode 100644 src/main/java/com/seibel/lod/enums/RelativeChunkPos.java diff --git a/src/main/java/com/seibel/lod/builders/LodBuilder.java b/src/main/java/com/seibel/lod/builders/LodBuilder.java index 58a3f9e6d..7711e57e7 100644 --- a/src/main/java/com/seibel/lod/builders/LodBuilder.java +++ b/src/main/java/com/seibel/lod/builders/LodBuilder.java @@ -27,7 +27,7 @@ import java.util.concurrent.Executors; import com.seibel.lod.config.LodConfig; import com.seibel.lod.enums.DistanceGenerationMode; -import com.seibel.lod.enums.LodDetail; +import com.seibel.lod.enums.LodResolution; import com.seibel.lod.enums.LodQualityMode; import com.seibel.lod.objects.LodDimension; import com.seibel.lod.objects.LodRegion; @@ -198,7 +198,7 @@ public class LodBuilder int endZ; try { - LodDetail detail; + LodResolution detail; LodRegion region = lodDim.getRegion(chunk.getPos().getRegionX(), chunk.getPos().getRegionZ()); if (region == null) return; @@ -266,7 +266,7 @@ public class LodBuilder } - private long[] createVerticalDataToMerge(LodDetail detail, IChunk chunk, LodBuilderConfig config, int startX, int startZ, int endX, int endZ) + private long[] createVerticalDataToMerge(LodResolution detail, IChunk chunk, LodBuilderConfig config, int startX, int startZ, int endX, int endZ) { long[] dataToMerge = ThreadMapUtil.getBuilderVerticalArray()[detail.detailLevel]; int verticalData = DataPointUtil.WORLD_HEIGHT; @@ -423,7 +423,7 @@ public class LodBuilder return height; } - private long[] createSingleDataToMerge(LodDetail detail, IChunk chunk, LodBuilderConfig config, int startX, int startZ, int endX, int endZ) + private long[] createSingleDataToMerge(LodResolution detail, IChunk chunk, LodBuilderConfig config, int startX, int startZ, int endX, int endZ) { long[] dataToMerge = ThreadMapUtil.getBuilderArray()[detail.detailLevel]; ChunkPos chunkPos = chunk.getPos(); diff --git a/src/main/java/com/seibel/lod/config/LodConfig.java b/src/main/java/com/seibel/lod/config/LodConfig.java index b3d0d111a..c459a3720 100644 --- a/src/main/java/com/seibel/lod/config/LodConfig.java +++ b/src/main/java/com/seibel/lod/config/LodConfig.java @@ -31,7 +31,7 @@ import com.seibel.lod.enums.DistanceCalculatorType; import com.seibel.lod.enums.DistanceGenerationMode; import com.seibel.lod.enums.FogDistance; import com.seibel.lod.enums.FogDrawOverride; -import com.seibel.lod.enums.LodDetail; +import com.seibel.lod.enums.LodResolution; import com.seibel.lod.enums.LodQualityMode; import com.seibel.lod.enums.LodTemplate; import com.seibel.lod.enums.ShadingMode; @@ -87,7 +87,7 @@ public class LodConfig public ForgeConfigSpec.EnumValue lodTemplate; - public ForgeConfigSpec.EnumValue maxDrawDetail; + public ForgeConfigSpec.EnumValue maxDrawDetail; public ForgeConfigSpec.EnumValue shadingMode; @@ -142,12 +142,12 @@ public class LodConfig maxDrawDetail = builder .comment("\n\n" + " What is the maximum detail level that LODs should be drawn at? \n" - + " " + LodDetail.SINGLE.toString() + ": render 1 LOD for each Chunk. \n" - + " " + LodDetail.DOUBLE.toString() + ": render 4 LODs for each Chunk. \n" - + " " + LodDetail.QUAD.toString() + ": render 16 LODs for each Chunk. \n" - + " " + LodDetail.HALF.toString() + ": render 64 LODs for each Chunk. \n" - + " " + LodDetail.FULL.toString() + ": render 256 LODs for each Chunk. \n") - .defineEnum("lodDrawQuality", LodDetail.FULL); + + " " + LodResolution.CHUNK.toString() + ": render 1 LOD for each Chunk. \n" + + " " + LodResolution.HALF_CHUNK.toString() + ": render 4 LODs for each Chunk. \n" + + " " + LodResolution.FOUR_BLOCKS.toString() + ": render 16 LODs for each Chunk. \n" + + " " + LodResolution.TWO_BLOCKS.toString() + ": render 64 LODs for each Chunk. \n" + + " " + LodResolution.BLOCK.toString() + ": render 256 LODs for each Chunk. \n") + .defineEnum("lodDrawQuality", LodResolution.BLOCK); lodQuality = builder .comment("\n\n" @@ -208,7 +208,7 @@ public class LodConfig public static class WorldGenerator { public ForgeConfigSpec.EnumValue lodQualityMode; - public ForgeConfigSpec.EnumValue maxGenerationDetail; + public ForgeConfigSpec.EnumValue maxGenerationDetail; public ForgeConfigSpec.EnumValue distanceGenerationMode; public ForgeConfigSpec.BooleanValue allowUnstableFeatureGeneration; public ForgeConfigSpec.EnumValue lodDistanceCalculatorType; @@ -228,12 +228,12 @@ public class LodConfig maxGenerationDetail = builder .comment("\n\n" + " What is the maximum detail level that LODs should be generated at? \n" - + " " + LodDetail.SINGLE.toString() + ": render 1 LOD for each Chunk. \n" - + " " + LodDetail.DOUBLE.toString() + ": render 4 LODs for each Chunk. \n" - + " " + LodDetail.QUAD.toString() + ": render 16 LODs for each Chunk. \n" - + " " + LodDetail.HALF.toString() + ": render 64 LODs for each Chunk. \n" - + " " + LodDetail.FULL.toString() + ": render 256 LODs for each Chunk. \n") - .defineEnum("lodGenerationQuality", LodDetail.HALF); + + " " + LodResolution.CHUNK.toString() + ": render 1 LOD for each Chunk. \n" + + " " + LodResolution.HALF_CHUNK.toString() + ": render 4 LODs for each Chunk. \n" + + " " + LodResolution.FOUR_BLOCKS.toString() + ": render 16 LODs for each Chunk. \n" + + " " + LodResolution.TWO_BLOCKS.toString() + ": render 64 LODs for each Chunk. \n" + + " " + LodResolution.BLOCK.toString() + ": render 256 LODs for each Chunk. \n") + .defineEnum("lodGenerationQuality", LodResolution.TWO_BLOCKS); lodDistanceCalculatorType = builder .comment("\n\n" @@ -244,11 +244,6 @@ public class LodConfig + "\n" + " " + DistanceCalculatorType.QUADRATIC + " \n" + " with LINEAR calculator the quality of block decrease \n" - + " quadratically to the distance of the player \n" - - + "\n" - + " " + DistanceCalculatorType.RENDER_DEPENDANT + " \n" - + " with LINEAR calculator the quality of block decrease \n" + " quadratically to the distance of the player \n") .defineEnum("lodDistanceComputation", DistanceCalculatorType.LINEAR); diff --git a/src/main/java/com/seibel/lod/enums/ColorDirection.java b/src/main/java/com/seibel/lod/enums/ColorDirection.java deleted file mode 100644 index 22131ccd8..000000000 --- a/src/main/java/com/seibel/lod/enums/ColorDirection.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of the LOD Mod, licensed under the GNU GPL v3 License. - * - * Copyright (C) 2020 James Seibel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.seibel.lod.enums; - -/** - * TOP, NORTH, SOUTH, EAST, WEST, BOTTOM - * - * @author James Seibel - * @version 10-17-2020 - */ -public enum ColorDirection -{ - // used for colors - /** +Y */ - TOP(0), - - /** -Z */ - NORTH(1), - /** +Z */ - SOUTH(2), - - /** +X */ - EAST(3), - /** -X */ - WEST(4), - - /** -Y */ - BOTTOM(5); - - public final int value; - - private ColorDirection(int newValue) - { - value = newValue; - } -} diff --git a/src/main/java/com/seibel/lod/enums/DistanceCalculatorType.java b/src/main/java/com/seibel/lod/enums/DistanceCalculatorType.java index aa9df0682..a455bffb9 100644 --- a/src/main/java/com/seibel/lod/enums/DistanceCalculatorType.java +++ b/src/main/java/com/seibel/lod/enums/DistanceCalculatorType.java @@ -15,9 +15,4 @@ public enum DistanceCalculatorType * different Lod detail render and generate quadratically to the distance */ QUADRATIC, - - /** - * we calculate the distance based on game render distance and mod render distance - */ - RENDER_DEPENDANT; } \ No newline at end of file diff --git a/src/main/java/com/seibel/lod/enums/LodCorner.java b/src/main/java/com/seibel/lod/enums/LodCorner.java deleted file mode 100644 index 92969cff1..000000000 --- a/src/main/java/com/seibel/lod/enums/LodCorner.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of the LOD Mod, licensed under the GNU GPL v3 License. - * - * Copyright (C) 2020 James Seibel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.seibel.lod.enums; - -/** - * NE, SE, SW, NW - * - * @author James Seibel - * @version 1-20-2020 - */ -public enum LodCorner -{ - /** -Z, +X */ - NE(0), - /** +Z, +X */ - SE(1), - /** +Z, -X */ - SW(2), - /** -Z, -X */ - NW(3); - - public final int value; - - private LodCorner(int newValue) - { - value = newValue; - } -} diff --git a/src/main/java/com/seibel/lod/enums/LodRenderDistance.java b/src/main/java/com/seibel/lod/enums/LodRenderDistance.java deleted file mode 100644 index 782fed60a..000000000 --- a/src/main/java/com/seibel/lod/enums/LodRenderDistance.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of the LOD Mod, licensed under the GNU GPL v3 License. - * - * Copyright (C) 2020 James Seibel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.seibel.lod.enums; - -/** - * NONE
- * BIOME_ONLY
- * BIOME_ONLY_SIMULATE_HEIGHT
- * SURFACE
- * FEATURES
- * SERVER

- * - * In order of fastest to slowest. - * - * @author James Seibel - * @author Leonardo Amato - * @version 8-7-2021 - */ -public enum LodRenderDistance -{ - SHORT(32), - - MEDIUM(64), - - FAR(128); - - - /** The higher the number the more complete the generation is. */ - public final int renderDistance; - - LodRenderDistance(int complexity) - { - this.renderDistance = complexity; - } -} diff --git a/src/main/java/com/seibel/lod/enums/LodDetail.java b/src/main/java/com/seibel/lod/enums/LodResolution.java similarity index 81% rename from src/main/java/com/seibel/lod/enums/LodDetail.java rename to src/main/java/com/seibel/lod/enums/LodResolution.java index b83b944c3..756495587 100644 --- a/src/main/java/com/seibel/lod/enums/LodDetail.java +++ b/src/main/java/com/seibel/lod/enums/LodResolution.java @@ -28,24 +28,23 @@ import com.seibel.lod.util.LodUtil; * @author James Seibel * @version 8-11-2021 */ -public enum LodDetail +public enum LodResolution { /** render 1 LOD for each chunk */ - SINGLE(1, 4), + CHUNK(1, 4), /** render 4 LODs for each chunk */ - DOUBLE(2, 3), + HALF_CHUNK(2, 3), /** render 16 LODs for each chunk */ - QUAD(4, 2), + FOUR_BLOCKS(4, 2), /** render 64 LODs for each chunk */ - HALF(8, 1), + TWO_BLOCKS(8, 1), /** render 256 LODs for each chunk */ - FULL(16, 0); - - + BLOCK(16, 0); + /** How many DataPoints should * be drawn per side per LodChunk */ public final int dataPointLengthCount; @@ -69,12 +68,12 @@ public enum LodDetail * 2nd dimension: An array of all LodDetails that are less than or
* equal to that detailLevel */ - private static LodDetail[][] lowerDetailArrays; + private static LodResolution[][] lowerDetailArrays; - private LodDetail(int newLengthCount, int newDetailLevel) + private LodResolution(int newLengthCount, int newDetailLevel) { detailLevel = (byte) newDetailLevel; dataPointLengthCount = newLengthCount; @@ -113,20 +112,20 @@ public enum LodDetail * Returns an array of all LodDetails that have a detail level * that is less than or equal to the given LodDetail */ - public static LodDetail[] getSelfAndLowerDetails(LodDetail detail) + public static LodResolution[] getSelfAndLowerDetails(LodResolution detail) { if (lowerDetailArrays == null) { // run first time setup - lowerDetailArrays = new LodDetail[LodDetail.values().length][]; + lowerDetailArrays = new LodResolution[LodResolution.values().length][]; // go through each LodDetail - for(LodDetail currentDetail : LodDetail.values()) + for(LodResolution currentDetail : LodResolution.values()) { - ArrayList lowerDetails = new ArrayList<>(); + ArrayList lowerDetails = new ArrayList<>(); // find the details lower than currentDetail - for(LodDetail compareDetail : LodDetail.values()) + for(LodResolution compareDetail : LodResolution.values()) { if (currentDetail.detailLevel <= compareDetail.detailLevel) { @@ -138,7 +137,7 @@ public enum LodDetail Collections.sort(lowerDetails); Collections.reverse(lowerDetails); - lowerDetailArrays[currentDetail.detailLevel] = lowerDetails.toArray(new LodDetail[lowerDetails.size()]); + lowerDetailArrays[currentDetail.detailLevel] = lowerDetails.toArray(new LodResolution[lowerDetails.size()]); } } @@ -146,9 +145,9 @@ public enum LodDetail } /** Returns what detail level should be used at a given distance and maxDistance. */ - public static LodDetail getDetailForDistance(LodDetail maxDetailLevel, int distance, int maxDistance) + public static LodResolution getDetailForDistance(LodResolution maxDetailLevel, int distance, int maxDistance) { - LodDetail[] lowerDetails = getSelfAndLowerDetails(maxDetailLevel); + LodResolution[] lowerDetails = getSelfAndLowerDetails(maxDetailLevel); int distaneBetweenDetails = maxDistance / lowerDetails.length; int index = LodUtil.clamp(0, distance / distaneBetweenDetails, lowerDetails.length - 1); diff --git a/src/main/java/com/seibel/lod/enums/RelativeChunkPos.java b/src/main/java/com/seibel/lod/enums/RelativeChunkPos.java deleted file mode 100644 index ff4e48609..000000000 --- a/src/main/java/com/seibel/lod/enums/RelativeChunkPos.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * This file is part of the LOD Mod, licensed under the GNU GPL v3 License. - * - * Copyright (C) 2020 James Seibel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package com.seibel.lod.enums; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.EnumSet; - -/** - * NE, SE, SW, NW
- * NORTH, SOUTH, EAST, WEST,
- * CENTER - * - * @author James Seibel - * @version 05-30-2021 - */ -public enum RelativeChunkPos -{ - /** +X, -Z */ - NE(0, 1,-1), - /** +X, +Z */ - SE(1, 1,1), - /** -X, +Z */ - SW(2, -1,1), - /** -X, -Z */ - NW(3, -1,-1), - - /** -Z */ - NORTH(4, 0,-1), - /** +Z */ - SOUTH(5, 0,1), - - /** +X */ - EAST(6, 1,0), - /** -X */ - WEST(7, -1,0), - - CENTER(8, 0,0); - - /** index used when referencing objects in an array */ - public final int index; - - /** position relative to X CENTER */ - public final int x; - /** position relative to Z CENTER */ - public final int z; - - /** NORTH, SOUTH, EAST, WEST */ - public static EnumSet ADJACENT = EnumSet.of(NORTH, SOUTH, EAST, WEST); - /** NE, NW, SE, SW */ - public static EnumSet DIAGONAL = EnumSet.of(NE, NW, SE, SW); - - - public static EnumSet NW_CORNER = EnumSet.of(WEST, NW, NORTH); - public static EnumSet NE_CORNER = EnumSet.of(EAST, NE, NORTH); - public static EnumSet SW_CORNER = EnumSet.of(WEST, SW, SOUTH); - public static EnumSet SE_CORNER = EnumSet.of(EAST, SE, SOUTH); - - /** NW_CORNER, NE_CORNER, SW_CORNER, SE_CORNER
- * Contains the 3 points surrounding a corner. */ - public static ArrayList> CORNERS = new ArrayList>( Arrays.asList(NW_CORNER, NE_CORNER, SW_CORNER, SE_CORNER) ); - - private RelativeChunkPos(int newIndex, int newX, int newZ) - { - index = newIndex; - x = newX; - z = newZ; - } -} - - diff --git a/src/main/java/com/seibel/lod/proxy/ClientProxy.java b/src/main/java/com/seibel/lod/proxy/ClientProxy.java index 555d55482..9ecc39341 100644 --- a/src/main/java/com/seibel/lod/proxy/ClientProxy.java +++ b/src/main/java/com/seibel/lod/proxy/ClientProxy.java @@ -28,7 +28,7 @@ import com.seibel.lod.builders.worldGeneration.LodNodeGenWorker; import com.seibel.lod.builders.worldGeneration.LodWorldGenerator; import com.seibel.lod.config.LodConfig; import com.seibel.lod.enums.DistanceGenerationMode; -import com.seibel.lod.enums.LodDetail; +import com.seibel.lod.enums.LodResolution; import com.seibel.lod.objects.LodDimension; import com.seibel.lod.objects.LodWorld; import com.seibel.lod.objects.RegionPos; @@ -175,8 +175,8 @@ public class ClientProxy //LodConfig.CLIENT.debugMode.set(true); - LodConfig.CLIENT.graphics.maxDrawDetail.set(LodDetail.FULL); - LodConfig.CLIENT.worldGenerator.maxGenerationDetail.set(LodDetail.FULL); + LodConfig.CLIENT.graphics.maxDrawDetail.set(LodResolution.BLOCK); + LodConfig.CLIENT.worldGenerator.maxGenerationDetail.set(LodResolution.BLOCK); // requires a world restart? // LodConfig.CLIENT.worldGenerator.lodQualityMode.set(LodQualityMode.HEIGHTMAP); diff --git a/src/main/java/com/seibel/lod/util/DataPointUtil.java b/src/main/java/com/seibel/lod/util/DataPointUtil.java index 6701f6ed4..13514faa4 100644 --- a/src/main/java/com/seibel/lod/util/DataPointUtil.java +++ b/src/main/java/com/seibel/lod/util/DataPointUtil.java @@ -289,7 +289,7 @@ public class DataPointUtil boolean allEmpty = true; boolean allVoid = true; long singleData; - long[] dataPoint = ThreadMapUtil.verticalDataArray(DetailDistanceUtil.getMaxVerticalData(LodUtil.BLOCK_DETAIL_LEVEL)); + long[] dataPoint = ThreadMapUtil.verticalDataArray(WORLD_HEIGHT+1); Arrays.fill(projection, (short) 0); //probably can remove short depth; diff --git a/src/main/java/com/seibel/lod/util/DetailDistanceUtil.java b/src/main/java/com/seibel/lod/util/DetailDistanceUtil.java index a9a321c0b..37e7bc338 100644 --- a/src/main/java/com/seibel/lod/util/DetailDistanceUtil.java +++ b/src/main/java/com/seibel/lod/util/DetailDistanceUtil.java @@ -2,7 +2,7 @@ package com.seibel.lod.util; import com.seibel.lod.config.LodConfig; import com.seibel.lod.enums.DistanceGenerationMode; -import com.seibel.lod.enums.LodDetail; +import com.seibel.lod.enums.LodResolution; import com.seibel.lod.objects.RegionPos; import com.seibel.lod.wrappers.MinecraftWrapper; @@ -45,18 +45,18 @@ public class DetailDistanceUtil 8, 8};*/ - private static LodDetail[] lodGenDetails = { - LodDetail.FULL, - LodDetail.HALF, - LodDetail.QUAD, - LodDetail.DOUBLE, - LodDetail.SINGLE, - LodDetail.SINGLE, - LodDetail.SINGLE, - LodDetail.SINGLE, - LodDetail.SINGLE, - LodDetail.SINGLE, - LodDetail.SINGLE}; + private static LodResolution[] lodGenDetails = { + LodResolution.BLOCK, + LodResolution.TWO_BLOCKS, + LodResolution.FOUR_BLOCKS, + LodResolution.HALF_CHUNK, + LodResolution.CHUNK, + LodResolution.CHUNK, + LodResolution.CHUNK, + LodResolution.CHUNK, + LodResolution.CHUNK, + LodResolution.CHUNK, + LodResolution.CHUNK}; @@ -84,17 +84,6 @@ public class DetailDistanceUtil case QUADRATIC: initial = LodConfig.CLIENT.graphics.lodQuality.get() * 128; return (int) (Math.pow(base, detail) * initial); - case RENDER_DEPENDANT: - int realRenderDistance = MinecraftWrapper.INSTANCE.getRenderDistance() * 16; - int border = 64; - byte detailAtBorder = (byte) 4; - if (detail > detailAtBorder) - { - return (detail * (border - realRenderDistance) / detailAtBorder + realRenderDistance); - } else - { - return ((maxDetail - detail) * (maxDistance - border) / (maxDetail - detailAtBorder) + border); - } } return distance; } @@ -117,9 +106,6 @@ public class DetailDistanceUtil initial = LodConfig.CLIENT.graphics.lodQuality.get() * 128; detail = (byte) (Math.log(Math.floorDiv(distance, initial))/logBase); break; - case RENDER_DEPENDANT: - detail = (byte) 9; - break; } return (byte) Math.min(detail, LodUtil.REGION_DETAIL_LEVEL); } @@ -182,7 +168,7 @@ public class DetailDistanceUtil } } - public static LodDetail getLodGenDetail(int detail) + public static LodResolution getLodGenDetail(int detail) { if (detail < minGenDetail) { diff --git a/src/main/java/com/seibel/lod/util/ThreadMapUtil.java b/src/main/java/com/seibel/lod/util/ThreadMapUtil.java index dffa44190..26672a619 100644 --- a/src/main/java/com/seibel/lod/util/ThreadMapUtil.java +++ b/src/main/java/com/seibel/lod/util/ThreadMapUtil.java @@ -78,7 +78,7 @@ public class ThreadMapUtil { threadVerticalAddDataMap.put(Thread.currentThread().getName(), new long[count]); } - for(int i = 0; i < count ; i++) + for(int i = 0; i < threadVerticalAddDataMap.get(Thread.currentThread().getName()).length ; i++) { threadVerticalAddDataMap.get(Thread.currentThread().getName())[i] = DataPointUtil.EMPTY_DATA; }