Centralized headers. Centralized fixes in one function

This commit is contained in:
2025-10-16 10:01:49 +02:00
parent cfca38fb8d
commit edaa19cb3f

View File

@@ -1,13 +1,10 @@
#include <string>
#include <spdlog/spdlog.h>
#include <spdlog/sinks/rotating_file_sink.h>
#include <filesystem>
#include <safetyhook.hpp>
#include "CommonHeaders.h"
#include "GameFixes.h"
#include "GameInformations.h"
#include "ObfuscateString.h"
#include "Memory.hpp";
#include "Maths.hpp";
#include "UEngine.hpp";
#include "Memory.hpp"
#include "Maths.hpp"
#include "UEngine.hpp"
#include "SDK/Basic.hpp"
#include "SDK/Engine_classes.hpp"
#include "SDK/LVL_SplashScreens_classes.hpp"
@@ -72,7 +69,7 @@ static void VolumetricFogFixEnabled();
static void EnableConsole();
static void SkipIntro();
extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled)
extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled, bool init)
{
g_fix_enabled = enabled;
if (g_fix_enabled && !AOBScanDone) {
@@ -206,66 +203,28 @@ extern "C" __declspec(dllexport) void SetFixEnabled(bool enabled)
logger->info("-------------- Fixes initialisation -------------");
}
if (FOVaddress) FOVFixEnabled();
if (DOFaddress) DOFFixEnabled();
if (CAaddress) CAFixEnabled();
if (Vignettingaddress) VignettingFixEnabled();
if (Fogaddress) FogFixEnabled();
if (VolumetricFogaddress) VolumetricFogFixEnabled();
if (AspectRatioAxisConstraintaddress && ConstrainAspectRatioaddress) UltraWideFixEnabled();
if (!g_Console_Enabled && GObjectsaddress && GNamesaddress && ProcessEventaddress)
EnableConsole();
if (!init && FOVaddress) FOVFixEnabled();
if (!init && DOFaddress) DOFFixEnabled();
if (!init && CAaddress) CAFixEnabled();
if (!init && Vignettingaddress) VignettingFixEnabled();
if (!init && Fogaddress) FogFixEnabled();
if (!init && VolumetricFogaddress) VolumetricFogFixEnabled();
if (!init && AspectRatioAxisConstraintaddress && ConstrainAspectRatioaddress) UltraWideFixEnabled();
}
// Setters for Reshade addon call
extern "C" __declspec(dllexport) void SetFOVFixEnabled(bool enabled, bool init)
{
g_fov_fix_enabled = enabled;
if (!init) FOVFixEnabled();
extern "C" __declspec(dllexport) void SetFixesEnabled(GameFixes fix, bool enabled)
{ // Set each fix individually
if (fix == GameFixes::DevConsole && enabled) EnableConsole();
if (fix == GameFixes::SkipIntro && enabled) SkipIntro();
if (fix == GameFixes::FOV) { g_fov_fix_enabled = enabled; FOVFixEnabled(); }
if (fix == GameFixes::UltraWide) { g_ultrawide_fix_enabled = enabled; UltraWideFixEnabled(); }
if (fix == GameFixes::ChromaticAberrations) { g_CA_fix_enabled = enabled; CAFixEnabled(); }
if (fix == GameFixes::Vignetting) { g_Vignetting_fix_enabled = enabled; VignettingFixEnabled(); }
if (fix == GameFixes::Fog) { g_Fog_fix_enabled = enabled; FogFixEnabled(); }
if (fix == GameFixes::VolumetricFog) { g_VolumetricFog_fix_enabled = enabled; VolumetricFogFixEnabled(); }
}
extern "C" __declspec(dllexport) void SetUltraWideFixEnabled(bool enabled, bool init)
{
g_ultrawide_fix_enabled = enabled;
if (!init) UltraWideFixEnabled();
}
extern "C" __declspec(dllexport) void SetDOFFixEnabled(bool enabled, bool init)
{
g_DOF_fix_enabled = enabled;
if (!init) DOFFixEnabled();
}
extern "C" __declspec(dllexport) void SetCAFixEnabled(bool enabled, bool init)
{
g_CA_fix_enabled = enabled;
if (!init) CAFixEnabled();
}
extern "C" __declspec(dllexport) void SetVignettingFixEnabled(bool enabled, bool init)
{
g_Vignetting_fix_enabled = enabled;
if (!init) VignettingFixEnabled();
}
extern "C" __declspec(dllexport) void SetFogFixEnabled(bool enabled, bool init)
{
g_Fog_fix_enabled = enabled;
if (!init) FogFixEnabled();
}
extern "C" __declspec(dllexport) void SetVolumetricFogFixEnabled(bool enabled, bool init)
{
g_VolumetricFog_fix_enabled = enabled;
if (!init) VolumetricFogFixEnabled();
}
extern "C" __declspec(dllexport) void SetSkipIntroEnabled(bool enabled)
{
if (enabled) SkipIntro();
}
extern "C" __declspec(dllexport) void SetFOV(int fov)
{
g_AdditionalFOVValue = fov;