Skip to content

Commit

Permalink
refactor: rename settings file
Browse files Browse the repository at this point in the history
  • Loading branch information
clshortfuse committed Jun 28, 2024
1 parent 454ddd3 commit a19adc4
Show file tree
Hide file tree
Showing 26 changed files with 58 additions and 60 deletions.
2 changes: 1 addition & 1 deletion src/games/animalwell/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/bge20/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/cp2077/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <include/reshade.hpp>
#include "../../mods/shader.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./cp2077.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/darksouls/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <include/reshade.hpp>
#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/dxmd/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/dyinglight2/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/fallout4/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include <include/reshade.hpp>
#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/fallout76/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include <include/reshade.hpp>
#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/hades/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/hades2/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/hifirush/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/horizonfw/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <include/reshade.hpp>

#include "../../mods/shader.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/justcause4/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/lanoire/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/lostplanet/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/p4g/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
70 changes: 34 additions & 36 deletions src/games/p5r/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// #define DEBUG_LEVEL_1
// #define DEBUG_LEVEL_2

#include <algorithm>

#include <deps/imgui/imgui.h>
#include <include/reshade.hpp>

Expand All @@ -37,7 +35,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down Expand Up @@ -69,19 +67,19 @@ renodx::mods::shader::CustomShaders custom_shaders = {
ShaderInjectData shader_injection;

// clang-format off
renodx::utils::user_settings::UserSettings user_settings = {
new renodx::utils::user_settings::UserSetting {
renodx::utils::settings::Settings settings = {
new renodx::utils::settings::Setting {
.key = "toneMapType",
.binding = &shader_injection.toneMapType,
.value_type = renodx::utils::user_settings::UserSettingValueType::INTEGER,
.value_type = renodx::utils::settings::SettingValueType::INTEGER,
.default_value = 3.f,
.can_reset = false,
.label = "Tone Mapper",
.section = "Tone Mapping",
.tooltip = "Sets the tone mapper type",
.labels = {"Vanilla", "None", "ACES", "RenoDRT"}
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "toneMapPeakNits",
.binding = &shader_injection.toneMapPeakNits,
.default_value = 1000.f,
Expand All @@ -92,7 +90,7 @@ renodx::utils::user_settings::UserSettings user_settings = {
.min = 48.f,
.max = 4000.f
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "toneMapGameNits",
.binding = &shader_injection.toneMapGameNits,
.default_value = 203.f,
Expand All @@ -103,7 +101,7 @@ renodx::utils::user_settings::UserSettings user_settings = {
.min = 48.f,
.max = 500.f
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "toneMapUINits",
.binding = &shader_injection.toneMapUINits,
.default_value = 203.f,
Expand All @@ -114,16 +112,16 @@ renodx::utils::user_settings::UserSettings user_settings = {
.min = 48.f,
.max = 500.f
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "toneMapGammaCorrection",
.binding = &shader_injection.toneMapGammaCorrection,
.value_type = renodx::utils::user_settings::UserSettingValueType::BOOLEAN,
.value_type = renodx::utils::settings::SettingValueType::BOOLEAN,
.can_reset = false,
.label = "Gamma Correction",
.section = "Tone Mapping",
.tooltip = "Emulates a 2.2 EOTF (use with HDR or sRGB)",
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "colorGradeExposure",
.binding = &shader_injection.colorGradeExposure,
.default_value = 1.f,
Expand All @@ -132,7 +130,7 @@ renodx::utils::user_settings::UserSettings user_settings = {
.max = 10.f,
.format = "%.2f"
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "colorGradeHighlights",
.binding = &shader_injection.colorGradeHighlights,
.default_value = 50.f,
Expand All @@ -141,7 +139,7 @@ renodx::utils::user_settings::UserSettings user_settings = {
.max = 100.f,
.parse = [](float value) { return value * 0.02f; }
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "colorGradeShadows",
.binding = &shader_injection.colorGradeShadows,
.default_value = 50.f,
Expand All @@ -150,7 +148,7 @@ renodx::utils::user_settings::UserSettings user_settings = {
.max = 100.f,
.parse = [](float value) { return value * 0.02f; }
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "colorGradeContrast",
.binding = &shader_injection.colorGradeContrast,
.default_value = 50.f,
Expand All @@ -159,7 +157,7 @@ renodx::utils::user_settings::UserSettings user_settings = {
.max = 100.f,
.parse = [](float value) { return value * 0.02f; }
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "colorGradeSaturation",
.binding = &shader_injection.colorGradeSaturation,
.default_value = 50.f,
Expand All @@ -168,7 +166,7 @@ renodx::utils::user_settings::UserSettings user_settings = {
.max = 100.f,
.parse = [](float value) { return value * 0.02f; }
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "colorGradeLUTStrength",
.binding = &shader_injection.colorGradeLUTStrength,
.default_value = 100.f,
Expand All @@ -177,7 +175,7 @@ renodx::utils::user_settings::UserSettings user_settings = {
.max = 100.f,
.parse = [](float value) { return value * 0.01f; }
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "colorGradeLUTScaling",
.binding = &shader_injection.colorGradeLUTScaling,
.default_value = 100.f,
Expand All @@ -187,18 +185,18 @@ renodx::utils::user_settings::UserSettings user_settings = {
.max = 100.f,
.parse = [](float value) { return value * 0.01f; }
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "colorGradeColorSpace",
.binding = &shader_injection.colorGradeColorSpace,
.value_type = renodx::utils::user_settings::UserSettingValueType::INTEGER,
.value_type = renodx::utils::settings::SettingValueType::INTEGER,
.default_value = 3.f,
.can_reset = false,
.label = "Color Space",
.section = "Color Grading",
.tooltip = "Selects color space gamut when clamping",
.labels = {"None", "BT709", "BT2020", "AP1"}
},
new renodx::utils::user_settings::UserSetting {
new renodx::utils::settings::Setting {
.key = "fxBloom",
.binding = &shader_injection.fxBloom,
.default_value = 50.f,
Expand All @@ -212,20 +210,20 @@ renodx::utils::user_settings::UserSettings user_settings = {
// clang-format on

void OnPresetOff() {
renodx::utils::user_settings::UpdateUserSetting("toneMapType", 0.f);
renodx::utils::user_settings::UpdateUserSetting("toneMapPeakNits", 203.f);
renodx::utils::user_settings::UpdateUserSetting("toneMapGameNits", 203.f);
renodx::utils::user_settings::UpdateUserSetting("toneMapUINits", 203.f);
renodx::utils::user_settings::UpdateUserSetting("toneMapGammaCorrection", 0);
renodx::utils::user_settings::UpdateUserSetting("colorGradeExposure", 1.f);
renodx::utils::user_settings::UpdateUserSetting("colorGradeHighlights", 50.f);
renodx::utils::user_settings::UpdateUserSetting("colorGradeShadows", 50.f);
renodx::utils::user_settings::UpdateUserSetting("colorGradeContrast", 50.f);
renodx::utils::user_settings::UpdateUserSetting("colorGradeSaturation", 50.f);
renodx::utils::user_settings::UpdateUserSetting("colorGradeLUTStrength", 100.f);
renodx::utils::user_settings::UpdateUserSetting("colorGradeLUTScaling", 0.f);
renodx::utils::user_settings::UpdateUserSetting("colorGradeColorSpace", 1.f);
renodx::utils::user_settings::UpdateUserSetting("fxBloom", 50.f);
renodx::utils::settings::UpdateSetting("toneMapType", 0.f);
renodx::utils::settings::UpdateSetting("toneMapPeakNits", 203.f);
renodx::utils::settings::UpdateSetting("toneMapGameNits", 203.f);
renodx::utils::settings::UpdateSetting("toneMapUINits", 203.f);
renodx::utils::settings::UpdateSetting("toneMapGammaCorrection", 0);
renodx::utils::settings::UpdateSetting("colorGradeExposure", 1.f);
renodx::utils::settings::UpdateSetting("colorGradeHighlights", 50.f);
renodx::utils::settings::UpdateSetting("colorGradeShadows", 50.f);
renodx::utils::settings::UpdateSetting("colorGradeContrast", 50.f);
renodx::utils::settings::UpdateSetting("colorGradeSaturation", 50.f);
renodx::utils::settings::UpdateSetting("colorGradeLUTStrength", 100.f);
renodx::utils::settings::UpdateSetting("colorGradeLUTScaling", 0.f);
renodx::utils::settings::UpdateSetting("colorGradeColorSpace", 1.f);
renodx::utils::settings::UpdateSetting("fxBloom", 50.f);
}

struct __declspec(uuid("5958c7c4-19b2-4300-af4d-c6802d6c7635")) DeviceData {
Expand Down Expand Up @@ -556,7 +554,7 @@ BOOL APIENTRY DllMain(HMODULE h_module, DWORD fdw_reason, LPVOID lpv_reserved) {

renodx::utils::resource::Use(fdw_reason);
renodx::utils::shader::Use(fdw_reason); // First to trace
renodx::utils::user_settings::Use(fdw_reason, &user_settings, &OnPresetOff);
renodx::utils::settings::Use(fdw_reason, &settings, &OnPresetOff);
renodx::mods::swapchain::Use(fdw_reason);
renodx::mods::shader::Use(fdw_reason, custom_shaders, &shader_injection);

Expand Down
2 changes: 1 addition & 1 deletion src/games/p5r_archive/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./p5r.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/seaofstars/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/sonicgenerations/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/starfield/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "../../mods/swapchain.hpp"
#include "../../utils/shader.hpp"
#include "../../utils/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
2 changes: 1 addition & 1 deletion src/games/thetownoflight/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <include/reshade.hpp>
#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"

namespace {

Expand Down
2 changes: 1 addition & 1 deletion src/games/thewitness/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "../../mods/shader.hpp"
#include "../../mods/swapchain.hpp"
#include "../../utils/user_setting.hpp"
#include "../../utils/settings.hpp"
#include "./shared.h"

namespace {
Expand Down
Loading

0 comments on commit a19adc4

Please sign in to comment.