From 2ee06c59f11f4cfa9a49ddd2cea30089b74ddd89 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 22 Jul 2024 17:34:04 -0500 Subject: [PATCH] Add configs for testing the ColumnRenderBufferBuilder --- .../distanthorizons/core/config/Config.java | 20 ++++++++++-- .../ColumnRenderBufferBuilder.java | 31 +++++++++++++------ 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java index a2c786984..22fb5ce05 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/config/Config.java @@ -1311,12 +1311,28 @@ public class Config .addListener(DebugColumnConfigEventHandler.INSTANCE) .build(); public static ConfigEntry columnBuilderDebugXPos = new ConfigEntry.Builder() - .set(0) + .set(-1) .setAppearance(EConfigEntryAppearance.ONLY_IN_GUI) .addListener(DebugColumnConfigEventHandler.INSTANCE) .build(); public static ConfigEntry columnBuilderDebugZPos = new ConfigEntry.Builder() - .set(0) + .set(-2) + .setAppearance(EConfigEntryAppearance.ONLY_IN_GUI) + .addListener(DebugColumnConfigEventHandler.INSTANCE) + .build(); + + public static ConfigEntry columnBuilderDebugXRow = new ConfigEntry.Builder() + .set(52) + .setAppearance(EConfigEntryAppearance.ONLY_IN_GUI) + .addListener(DebugColumnConfigEventHandler.INSTANCE) + .build(); + public static ConfigEntry columnBuilderDebugZRow = new ConfigEntry.Builder() + .set(14) + .setAppearance(EConfigEntryAppearance.ONLY_IN_GUI) + .addListener(DebugColumnConfigEventHandler.INSTANCE) + .build(); + public static ConfigEntry columnBuilderDebugColumnIndex = new ConfigEntry.Builder() + .set(-1) .setAppearance(EConfigEntryAppearance.ONLY_IN_GUI) .addListener(DebugColumnConfigEventHandler.INSTANCE) .build(); diff --git a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java index 64c1abd02..d6793a34c 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/dataObjects/render/bufferBuilding/ColumnRenderBufferBuilder.java @@ -167,14 +167,22 @@ public class ColumnRenderBufferBuilder { for (int z = 0; z < ColumnRenderSource.SECTION_SIZE; z++) { - // TODO make a config for this // can be uncommented to limit the buffer building to a specific // relative position in this section. // useful for debugging a single column's rendering -// if (x != 0 || (z != 0 && z != 1)) -// { -// continue; -// } + if (Config.Client.Advanced.Debugging.columnBuilderDebugEnable.get()) + { + int wantedX = Config.Client.Advanced.Debugging.columnBuilderDebugXRow.get(); + if (wantedX >= 0 && x != wantedX) + { + continue; + } + int wantedZ = Config.Client.Advanced.Debugging.columnBuilderDebugZRow.get(); + if (wantedZ >= 0 && z != wantedZ) + { + continue; + } + } UncheckedInterruptedException.throwIfInterrupted(); @@ -286,12 +294,15 @@ public class ColumnRenderBufferBuilder // We only stop when we find a block that is void or non-existing block for (int i = 0; i < columnRenderData.size(); i++) { - // TODO make a config for this // can be uncommented to limit which vertical LOD is generated -// if (i != 0) -// { -// continue; -// } + if (Config.Client.Advanced.Debugging.columnBuilderDebugEnable.get()) + { + int wantedColumnIndex = Config.Client.Advanced.Debugging.columnBuilderDebugColumnIndex.get(); + if (wantedColumnIndex >= 0 && i != wantedColumnIndex) + { + continue; + } + } long data = columnRenderData.get(i); // If the data is not render-able (Void or non-existing) we stop since there is