diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/makamys/lodmod/LODMod.java | 4 | ||||
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRegion.java | 4 | ||||
-rw-r--r-- | src/main/java/makamys/lodmod/renderer/LODRenderer.java | 6 |
3 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/makamys/lodmod/LODMod.java b/src/main/java/makamys/lodmod/LODMod.java index e573138..70b8507 100644 --- a/src/main/java/makamys/lodmod/LODMod.java +++ b/src/main/java/makamys/lodmod/LODMod.java @@ -59,8 +59,10 @@ public class LODMod public static boolean hideUnderVanillaChunks; public static boolean disableChunkMeshes; public static boolean disableSimpleMeshes; + public static boolean saveMeshes; public static boolean optimizeChunkMeshes; public static int maxMeshesPerFrame; + public static int sortFrequency; private File configFile; @@ -104,7 +106,9 @@ public class LODMod disableChunkMeshes = config.getBoolean("disableChunkMeshes", "render", true, ""); disableSimpleMeshes = config.getBoolean("disableSimpleMeshes", "render", false, ""); optimizeChunkMeshes = config.getBoolean("optimizeChunkMeshes", "render", true, ""); + saveMeshes = config.getBoolean("saveMeshes", "render", false, ""); maxMeshesPerFrame = config.getInt("maxMeshesPerFrame", "render", -1, -1, Integer.MAX_VALUE, ""); + sortFrequency = config.getInt("sortFrequency", "render", 1, 1, Integer.MAX_VALUE, ""); if(config.hasChanged()) { config.save(); diff --git a/src/main/java/makamys/lodmod/renderer/LODRegion.java b/src/main/java/makamys/lodmod/renderer/LODRegion.java index 4004adf..ed13980 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRegion.java +++ b/src/main/java/makamys/lodmod/renderer/LODRegion.java @@ -58,7 +58,7 @@ public class LODRegion { } public static LODRegion load(Path saveDir, int regionX, int regionZ) { - if(!LODMod.disableChunkMeshes) { + if(!LODMod.disableChunkMeshes && LODMod.saveMeshes) { File saveFile = getSavePath(saveDir, regionX, regionZ).toFile(); if(saveFile.exists()) { try { @@ -77,7 +77,7 @@ public class LODRegion { } public void save(Path saveDir) { - if(LODMod.disableChunkMeshes) return; + if(LODMod.disableChunkMeshes && LODMod.saveMeshes) return; try { File saveFile = getSavePath(saveDir, regionX, regionZ).toFile(); diff --git a/src/main/java/makamys/lodmod/renderer/LODRenderer.java b/src/main/java/makamys/lodmod/renderer/LODRenderer.java index d7504d7..ff86a76 100644 --- a/src/main/java/makamys/lodmod/renderer/LODRenderer.java +++ b/src/main/java/makamys/lodmod/renderer/LODRenderer.java @@ -92,6 +92,7 @@ public class LODRenderer { private long saveInterval = 60 * 1000; private int renderedMeshes; + private int frameCount; public int renderRange = 48; @@ -134,7 +135,10 @@ public class LODRenderer { } if(renderLOD) { - sort(); + if(frameCount % LODMod.sortFrequency == 0) { + sort(); + } + updateMeshes(); initIndexBuffers(); render(alpha); |