From 691d5cadedbecd1a5954cddf726f1234b62e0228 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Thu, 11 Jul 2024 17:38:51 -0500 Subject: [PATCH] Add api for generic rendering config --- .../client/IDhApiGenericRenderingConfig.java | 46 +++++++++++++++++++ .../client/DhApiGenericRenderingConfig.java | 46 +++++++++++++++++++ .../config/client/DhApiGraphicsConfig.java | 6 +-- 3 files changed, 94 insertions(+), 4 deletions(-) create mode 100644 api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGenericRenderingConfig.java create mode 100644 core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGenericRenderingConfig.java diff --git a/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGenericRenderingConfig.java b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGenericRenderingConfig.java new file mode 100644 index 000000000..3209b07ba --- /dev/null +++ b/api/src/main/java/com/seibel/distanthorizons/api/interfaces/config/client/IDhApiGenericRenderingConfig.java @@ -0,0 +1,46 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.seibel.distanthorizons.api.interfaces.config.client; + +import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigGroup; +import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue; + +/** + * Distant Horizons' generic rendering configuration.

+ * + * @author James Seibel + * @version 2024-7-11 + * @since API 3.0.0 + */ +public interface IDhApiGenericRenderingConfig extends IDhApiConfigGroup +{ + /** + * If enabled DH will render generic objects into its terrain pass.
+ * This includes: clouds, beacons, and API added objects. + */ + IDhApiConfigValue renderingEnabled(); + + /** If enabled DH will render beacon beams. */ + IDhApiConfigValue beaconRenderingEnabled(); + + /** If enabled DH will render clouds. */ + IDhApiConfigValue cloudRenderingEnabled(); + +} diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGenericRenderingConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGenericRenderingConfig.java new file mode 100644 index 000000000..f7fded3e5 --- /dev/null +++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGenericRenderingConfig.java @@ -0,0 +1,46 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020-2023 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.seibel.distanthorizons.core.api.external.methods.config.client; + +import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue; +import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiGenericRenderingConfig; +import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiNoiseTextureConfig; +import com.seibel.distanthorizons.api.objects.config.DhApiConfigValue; +import com.seibel.distanthorizons.core.config.Config; + +public class DhApiGenericRenderingConfig implements IDhApiGenericRenderingConfig +{ + public static DhApiGenericRenderingConfig INSTANCE = new DhApiGenericRenderingConfig(); + + private DhApiGenericRenderingConfig() { } + + + + @Override + public IDhApiConfigValue renderingEnabled() + { return new DhApiConfigValue(Config.Client.Advanced.Graphics.GenericRendering.enableRendering); } + @Override + public IDhApiConfigValue beaconRenderingEnabled() + { return new DhApiConfigValue(Config.Client.Advanced.Graphics.GenericRendering.enableBeaconRendering); } + @Override + public IDhApiConfigValue cloudRenderingEnabled() + { return new DhApiConfigValue(Config.Client.Advanced.Graphics.GenericRendering.enableCloudRendering); } + +} diff --git a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java index 27c1d48eb..a65bdffba 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/api/external/methods/config/client/DhApiGraphicsConfig.java @@ -22,10 +22,7 @@ package com.seibel.distanthorizons.core.api.external.methods.config.client; import com.seibel.distanthorizons.api.enums.config.*; import com.seibel.distanthorizons.api.enums.rendering.EDhApiTransparency; import com.seibel.distanthorizons.api.interfaces.config.IDhApiConfigValue; -import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiAmbientOcclusionConfig; -import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiFogConfig; -import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiGraphicsConfig; -import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiNoiseTextureConfig; +import com.seibel.distanthorizons.api.interfaces.config.client.*; import com.seibel.distanthorizons.api.objects.config.DhApiConfigValue; import com.seibel.distanthorizons.api.enums.rendering.EDhApiRendererMode; import com.seibel.distanthorizons.core.config.Config; @@ -45,6 +42,7 @@ public class DhApiGraphicsConfig implements IDhApiGraphicsConfig public IDhApiFogConfig fog() { return DhApiFogConfig.INSTANCE; } public IDhApiAmbientOcclusionConfig ambientOcclusion() { return DhApiAmbientOcclusionConfig.INSTANCE; } public IDhApiNoiseTextureConfig noiseTexture() { return DhApiNoiseTextureConfig.INSTANCE; } + public IDhApiGenericRenderingConfig genericRendering() { return DhApiGenericRenderingConfig.INSTANCE; }