diff options
author | makamys <makamys@outlook.com> | 2021-05-29 22:34:31 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2021-05-29 22:34:31 +0200 |
commit | b1fa08343c48cd051e5c238e5852e9be8d2b761e (patch) | |
tree | fde0ca90ec8da4b35a1f1d1415c1d556ca4f47f8 /src | |
parent | 3d264ff0425bf98ed8f046433d3c0cb47d184f8d (diff) | |
download | Neodymium-b1fa08343c48cd051e5c238e5852e9be8d2b761e.tar.gz Neodymium-b1fa08343c48cd051e5c238e5852e9be8d2b761e.tar.bz2 Neodymium-b1fa08343c48cd051e5c238e5852e9be8d2b761e.zip |
Move debug mode toggle to config file, config max simple mesh height
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/makamys/lodmod/LODMod.java | 4 | ||||
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRenderer.java | 4 | ||||
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/makamys/lodmod/LODMod.java b/src/main/java/makamys/lodmod/LODMod.java index a5987b5..b41ee2f 100644 --- a/src/main/java/makamys/lodmod/LODMod.java +++ b/src/main/java/makamys/lodmod/LODMod.java @@ -45,10 +45,12 @@ public class LODMod public static LODRenderer renderer; public static boolean enabled; + public static boolean debugEnabled; public static int chunkLoadsPerTick; public static List<Class> blockClassBlacklist; public static double fogStart; public static double fogEnd; + public static float maxSimpleMeshHeight; private File configFile; @@ -79,6 +81,8 @@ public class LODMod .collect(Collectors.toList()); fogStart = config.get("Fog", "fogStart", "0.4").getDouble(); fogEnd = config.get("Fog", "fogEnd", "0.8").getDouble(); + debugEnabled = config.get("Debug", "enabled", false).getBoolean(); + maxSimpleMeshHeight = (float)config.get("Debug", "maxSimpleMeshHeight", 1000.0).getDouble(); if(config.hasChanged()) { config.save(); diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index 4c911e6..ce74177 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -52,8 +52,6 @@ import static org.lwjgl.opengl.GL30.*; public class LODRenderer { - public static boolean debugEnabled = Boolean.parseBoolean(System.getProperty("lodmod.debug", "false")); - public boolean hasInited = false; private boolean[] wasDown = new boolean[256]; @@ -114,7 +112,7 @@ public class LODRenderer { } mainLoop(); - if(debugEnabled) { + if(LODMod.debugEnabled) { handleKeyboard(); } if(lastGCTime == -1 || (System.currentTimeMillis() - lastGCTime) > gcInterval) { diff --git a/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java b/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java index bef8e46..5d9526c 100644 --- a/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java +++ b/src/main/java/makamys/lodmod/renderer/SimpleChunkMesh.java @@ -125,9 +125,9 @@ public class SimpleChunkMesh extends Mesh { if(biome.getFloatTemperature(worldX, y, worldZ) < 0.15f) { pass1.addCube(worldX, worldY + 0.2f, worldZ, size, size, 1f, Blocks.snow_layer.getIcon(1, 0), 0xFFFFFFFF, brightnessMult); - pass1.addCube(worldX, worldY - 0.8f, worldZ, size, size, worldY + 1 - 0.8f, icon, color, brightnessMult); + pass1.addCube(worldX, worldY - 0.8f, worldZ, size, size, Math.min(LODMod.maxSimpleMeshHeight, worldY + 1 - 0.8f), icon, color, brightnessMult); } else { - pass1.addCube(worldX, worldY, worldZ, size, size, worldY + 1, icon, color, brightnessMult); + pass1.addCube(worldX, worldY, worldZ, size, size, Math.min(LODMod.maxSimpleMeshHeight, worldY + 1), icon, color, brightnessMult); } |