Add temporary vertical Quality CUSTOM option
This commit is contained in:
@@ -193,6 +193,22 @@ public class Config
|
||||
.addListener(ReloadLodsConfigEventHandler.INSTANCE)
|
||||
.build();
|
||||
|
||||
@Deprecated
|
||||
public static ConfigEntry<String> customVerticalQualityCsv = new ConfigEntry.Builder<String>()
|
||||
.set("16,8,4,3,3,3,3,3,3,3,1")
|
||||
.comment(" "
|
||||
+ "Each CSV value represents a single horizontal quality drop \n"
|
||||
+ "IE: \n"
|
||||
+ "- value 1 = detail level 0 \n"
|
||||
+ "- value 2 = detail level 1 \n"
|
||||
+ "The last value will be used for all subsequent \n"
|
||||
+ "detail levels. \n"
|
||||
+ "If parsing fails this defaults to 1 (IE ${EDhApiVerticalQuality.HEIGHT_MAP}). \n"
|
||||
+ "")
|
||||
.setPerformance(EConfigEntryPerformance.VERY_HIGH)
|
||||
.addListener(ReloadLodsConfigEventHandler.INSTANCE)
|
||||
.build();
|
||||
|
||||
public static ConfigEntry<EDhApiHorizontalQuality> horizontalQuality = new ConfigEntry.Builder<EDhApiHorizontalQuality>()
|
||||
.set(EDhApiHorizontalQuality.MEDIUM)
|
||||
.comment(""
|
||||
|
||||
+2
@@ -44,6 +44,7 @@ public class RenderCacheConfigEventHandler
|
||||
// previous values used to check if a watched setting was actually modified
|
||||
private final ConfigChangeListener<EDhApiMaxHorizontalResolution> horizontalResolutionChangeListener;
|
||||
private final ConfigChangeListener<EDhApiVerticalQuality> verticalQualityChangeListener;
|
||||
private final ConfigChangeListener<String> customVerticalQualityChangeListener;
|
||||
private final ConfigChangeListener<EDhApiTransparency> transparencyChangeListener;
|
||||
private final ConfigChangeListener<EDhApiBlocksToAvoid> blocksToIgnoreChangeListener;
|
||||
private final ConfigChangeListener<Boolean> tintWithAvoidedBlocksChangeListener;
|
||||
@@ -76,6 +77,7 @@ public class RenderCacheConfigEventHandler
|
||||
{
|
||||
this.horizontalResolutionChangeListener = new ConfigChangeListener<>(Config.Client.Advanced.Graphics.Quality.maxHorizontalResolution, (newValue) -> this.refreshRenderDataAfterTimeout());
|
||||
this.verticalQualityChangeListener = new ConfigChangeListener<>(Config.Client.Advanced.Graphics.Quality.verticalQuality, (newValue) -> this.refreshRenderDataAfterTimeout());
|
||||
this.customVerticalQualityChangeListener = new ConfigChangeListener<>(Config.Client.Advanced.Graphics.Quality.customVerticalQualityCsv, (newValue) -> this.refreshRenderDataAfterTimeout());
|
||||
this.transparencyChangeListener = new ConfigChangeListener<>(Config.Client.Advanced.Graphics.Quality.transparency, (newValue) -> this.refreshRenderDataAfterTimeout());
|
||||
this.blocksToIgnoreChangeListener = new ConfigChangeListener<>(Config.Client.Advanced.Graphics.Quality.blocksToIgnore, (newValue) -> this.refreshRenderDataAfterTimeout());
|
||||
this.tintWithAvoidedBlocksChangeListener = new ConfigChangeListener<>(Config.Client.Advanced.Graphics.Quality.tintWithAvoidedBlocks, (newValue) -> this.refreshRenderDataAfterTimeout());
|
||||
|
||||
+32
-1
@@ -20,6 +20,7 @@
|
||||
package com.seibel.distanthorizons.core.dataObjects.transformers;
|
||||
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiBlocksToAvoid;
|
||||
import com.seibel.distanthorizons.api.enums.config.EDhApiVerticalQuality;
|
||||
import com.seibel.distanthorizons.core.config.Config;
|
||||
import com.seibel.distanthorizons.core.dataObjects.fullData.FullDataPointIdMap;
|
||||
import com.seibel.distanthorizons.core.dataObjects.fullData.sources.FullDataSourceV2;
|
||||
@@ -39,10 +40,12 @@ import com.seibel.distanthorizons.core.wrapperInterfaces.block.IBlockStateWrappe
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftClientWrapper;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.world.IBiomeWrapper;
|
||||
import com.seibel.distanthorizons.coreapi.util.BitShiftUtil;
|
||||
import com.seibel.distanthorizons.coreapi.util.MathUtil;
|
||||
import it.unimi.dsi.fastutil.longs.LongArrayList;
|
||||
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
@@ -103,7 +106,35 @@ public class FullDataToRenderDataTransformer
|
||||
{
|
||||
final long pos = fullDataSource.getPos();
|
||||
final byte dataDetail = fullDataSource.getDataDetailLevel();
|
||||
final int vertSize = Config.Client.Advanced.Graphics.Quality.verticalQuality.get().calculateMaxVerticalData(fullDataSource.getDataDetailLevel());
|
||||
|
||||
int tempVertSize = 1;
|
||||
if (Config.Client.Advanced.Graphics.Quality.verticalQuality.get() != EDhApiVerticalQuality.CUSTOM)
|
||||
{
|
||||
tempVertSize = Config.Client.Advanced.Graphics.Quality.verticalQuality.get().calculateMaxVerticalData(fullDataSource.getDataDetailLevel());
|
||||
}
|
||||
else
|
||||
{
|
||||
// temporary code while we test additional vertical quality options
|
||||
String verticalQualityCsv = Config.Client.Advanced.Graphics.Quality.customVerticalQualityCsv.get();
|
||||
if (verticalQualityCsv != null)
|
||||
{
|
||||
String[] possibleVerticalValues = verticalQualityCsv.split(",");
|
||||
|
||||
// for detail levels lower than what the enum defines, use the lowest quality item
|
||||
int index = MathUtil.clamp(0, dataDetail, possibleVerticalValues.length - 1);
|
||||
String verticalValueString = possibleVerticalValues[index];
|
||||
|
||||
try
|
||||
{
|
||||
tempVertSize = Integer.parseInt(verticalValueString);
|
||||
}
|
||||
catch (NumberFormatException ignore) { }
|
||||
}
|
||||
}
|
||||
final int vertSize = tempVertSize;
|
||||
|
||||
|
||||
|
||||
final ColumnRenderSource columnSource = ColumnRenderSource.getPooledRenderSource(pos, vertSize, level.getMinY(), true);
|
||||
if (fullDataSource.isEmpty)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user