Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/main/java/rs117/hd/HdPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
import rs117.hd.utils.DestructibleHandler;
import rs117.hd.utils.DeveloperTools;
import rs117.hd.utils.FileWatcher;
import rs117.hd.utils.GraphicsPresets;
import rs117.hd.utils.GsonUtils;
import rs117.hd.utils.HDUtils;
import rs117.hd.utils.HDVariables;
Expand Down Expand Up @@ -251,6 +252,9 @@ public class HdPlugin extends Plugin {
@Inject
private HdPluginConfig config;

@Inject
private GraphicsPresets graphicsPresets;

@Inject
private GamevalManager gamevalManager;

Expand Down Expand Up @@ -672,6 +676,7 @@ protected void startUp() {
}
}

graphicsPresets.startUp();
updateCachedConfigs();
developerTools.activate();

Expand Down Expand Up @@ -1749,6 +1754,7 @@ public void processPendingConfigChanges() {

log.debug("Processing {} pending config changes: {}", pendingConfigChanges.size(), pendingConfigChanges);

graphicsPresets.processConfigChange(pendingConfigChanges);
renderer.processConfigChanges(pendingConfigChanges);

boolean recompilePrograms = false;
Expand Down
30 changes: 29 additions & 1 deletion src/main/java/rs117/hd/HdPluginConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import rs117.hd.config.DynamicLights;
import rs117.hd.config.FogDepthMode;
import rs117.hd.config.InfernalCape;
import rs117.hd.config.Presets;
import rs117.hd.config.Saturation;
import rs117.hd.config.SceneScalingMode;
import rs117.hd.config.SeasonalHemisphere;
Expand All @@ -53,6 +54,7 @@
import rs117.hd.config.TextureResolution;
import rs117.hd.config.UIScalingMode;
import rs117.hd.config.VanillaShadowMode;
import rs117.hd.utils.GraphicsPresets;

import static rs117.hd.HdPlugin.MAX_DISTANCE;
import static rs117.hd.HdPlugin.MAX_FOG_DEPTH;
Expand All @@ -64,6 +66,14 @@ public interface HdPluginConfig extends Config
{
String CONFIG_GROUP = "hd";

String KEY_GRAPHICS_PRESET = "graphicsPreset";
@ConfigItem(
keyName = KEY_GRAPHICS_PRESET,
name = "Graphics Preset",
description = ""
)
default GraphicsPresets.QualityLevel graphicsPreset() { return GraphicsPresets.QualityLevel.HIGH; }

/*====== General settings ======*/

@ConfigSection(
Expand All @@ -86,6 +96,7 @@ public interface HdPluginConfig extends Config
position = 1,
section = generalSettings
)
@Presets(ints = {50, 100, 125, 184})
default int drawDistance() {
return 50;
}
Expand All @@ -104,8 +115,9 @@ default int drawDistance() {
position = 2,
section = generalSettings
)
@Presets(ints = {25, 50, 75, 100})
default int detailDrawDistance() {
return 70;
return 75;
}

String KEY_EXPANDED_MAP_LOADING_CHUNKS = "expandedMapLoadingChunks";
Expand Down Expand Up @@ -148,6 +160,7 @@ default boolean hideUnrelatedAreas() {
position = 5,
section = generalSettings
)
@Presets(enums = {"DISABLED", "MSAA_2", "MSAA_4", "MSAA_16"})
default AntiAliasingMode antiAliasingMode()
{
return AntiAliasingMode.MSAA_8;
Expand Down Expand Up @@ -212,6 +225,7 @@ default UIScalingMode uiScalingMode() {
position = 9,
section = generalSettings
)
@Presets(ints = {1, 4, 8, 16})
default int anisotropicFilteringLevel()
{
return 16;
Expand Down Expand Up @@ -396,6 +410,7 @@ default int brightness() {
position = 1,
section = shadowSettings
)
@Presets(enums = {"FAST", "FAST", "DETAILED", "DETAILED"})
default ShadowMode shadowMode() {
return ShadowMode.DETAILED;
}
Expand All @@ -410,6 +425,7 @@ default ShadowMode shadowMode() {
position = 2,
section = shadowSettings
)
@Presets(enums = {"RES_1024", "RES_2048", "RES_4096", "RES_8192"})
default ShadowResolution shadowResolution() {
return ShadowResolution.RES_8192;
}
Expand Down Expand Up @@ -438,6 +454,7 @@ default ShadowFiltering shadowFiltering() {
position = 4,
section = shadowSettings
)
@Presets(bools = {false, false, true, true})
default boolean shadowTransparency() {
return true;
}
Expand All @@ -464,6 +481,7 @@ default boolean roofShadows() {
position = 6,
section = shadowSettings
)
@Presets(bools = {false, true, true, true})
default boolean expandShadowDraw() {
return false;
}
Expand All @@ -489,6 +507,7 @@ default boolean expandShadowDraw() {
position = 0,
section = lightingSettings
)
@Presets(enums = {"NONE", "FEW", "MANY", "MANY"})
default DynamicLights dynamicLights() {
return DynamicLights.SOME;
}
Expand All @@ -515,6 +534,7 @@ default boolean tiledLighting() {
position = 2,
section = lightingSettings
)
@Presets(bools = {false, true, true, true})
default boolean projectileLights() {
return true;
}
Expand All @@ -527,6 +547,7 @@ default boolean projectileLights() {
position = 3,
section = lightingSettings
)
@Presets(bools = {false, true, true, true})
default boolean npcLights() {
return true;
}
Expand Down Expand Up @@ -566,6 +587,7 @@ default VanillaShadowMode vanillaShadowMode() {
position = 12,
section = lightingSettings
)
@Presets(bools = {false, true, true, true})
default boolean normalMapping() {
return true;
}
Expand All @@ -578,6 +600,7 @@ default boolean normalMapping() {
position = 13,
section = lightingSettings
)
@Presets(bools = {false, false, true, true})
default boolean parallaxOcclusionMapping() {
return true;
}
Expand Down Expand Up @@ -722,6 +745,7 @@ default boolean groundTextures()
position = 9,
section = environmentSettings
)
@Presets(enums = {"RES_128", "RES_256", "RES_256", "RES_256"})
default TextureResolution textureResolution()
{
return TextureResolution.RES_256;
Expand All @@ -747,6 +771,7 @@ default boolean groundBlending()
position = 11,
section = environmentSettings
)
@Presets(bools = {false, true, true, true})
default boolean underwaterCaustics()
{
return true;
Expand All @@ -760,6 +785,7 @@ default boolean underwaterCaustics()
position = 13,
section = environmentSettings
)
@Presets(bools = {false, false, true, true})
default boolean windDisplacement() {
return true;
}
Expand All @@ -772,6 +798,7 @@ default boolean windDisplacement() {
position = 14,
section = environmentSettings
)
@Presets(bools = {false, false, true, true})
default boolean characterDisplacement() {
return true;
}
Expand Down Expand Up @@ -1259,4 +1286,5 @@ default boolean multithreadedModelProcessing() {
default int getPluginUpdateMessage() {
return 0;
}

}
15 changes: 15 additions & 0 deletions src/main/java/rs117/hd/config/Presets.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package rs117.hd.config;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Presets {
int[] ints() default {};
double[] floats() default {};
String[] enums() default {};
boolean[] bools() default {};
}
Loading