diff --git a/UnleashedRecomp/config.cpp b/UnleashedRecomp/config.cpp index 5826b02..4f5ad3e 100644 --- a/UnleashedRecomp/config.cpp +++ b/UnleashedRecomp/config.cpp @@ -7,8 +7,8 @@ void Config::Load() TOML_BEGIN_SECTION("System") { TOML_READ_ENUM(ELanguage, Language); - TOML_READ_ENUM(EScoreBehaviour, ScoreBehaviour); TOML_READ_BOOLEAN(Hints); + TOML_READ_ENUM(EScoreBehaviour, ScoreBehaviour); TOML_READ_BOOLEAN(UnleashOutOfControlDrain); TOML_READ_BOOLEAN(WerehogHubTransformVideo); TOML_READ_BOOLEAN(LogoSkip); @@ -17,6 +17,8 @@ void Config::Load() TOML_BEGIN_SECTION("Controls") { + TOML_READ_BOOLEAN(CameraXInvert); + TOML_READ_BOOLEAN(CameraYInvert); TOML_READ_BOOLEAN(XButtonHoming); TOML_READ_BOOLEAN(UnleashCancel); } @@ -24,6 +26,10 @@ void Config::Load() TOML_BEGIN_SECTION("Audio") { + TOML_READ_FLOAT(MusicVolume); + TOML_READ_FLOAT(SEVolume); + TOML_READ_ENUM(EVoiceLanguage, VoiceLanguage); + TOML_READ_FLOAT(Subtitles); TOML_READ_BOOLEAN(WerehogBattleMusic); } TOML_END_SECTION(); @@ -34,14 +40,19 @@ void Config::Load() TOML_READ_INTEGER(WindowWidth); TOML_READ_INTEGER(WindowHeight); TOML_READ_FLOAT(ResolutionScale); - TOML_READ_INTEGER(ShadowResolution); - TOML_READ_INTEGER(MSAA); - TOML_READ_ENUM(EMovieScaleMode, MovieScaleMode); - TOML_READ_ENUM(EUIScaleMode, UIScaleMode); - TOML_READ_BOOLEAN(AlphaToCoverage); TOML_READ_BOOLEAN(Fullscreen); TOML_READ_BOOLEAN(VSync); TOML_READ_INTEGER(BufferCount); + TOML_READ_INTEGER(FPS); + TOML_READ_FLOAT(Brightness); + TOML_READ_INTEGER(MSAA); + TOML_READ_INTEGER(AnisotropicFiltering); + TOML_READ_INTEGER(ShadowResolution); + TOML_READ_ENUM(EGITextureFiltering, GITextureFiltering); + TOML_READ_BOOLEAN(AlphaToCoverage); + TOML_READ_BOOLEAN(Xbox360ColorCorrection); + TOML_READ_ENUM(EMovieScaleMode, MovieScaleMode); + TOML_READ_ENUM(EUIScaleMode, UIScaleMode); } TOML_END_SECTION(); } diff --git a/UnleashedRecomp/config.h b/UnleashedRecomp/config.h index 0f66b37..a707957 100644 --- a/UnleashedRecomp/config.h +++ b/UnleashedRecomp/config.h @@ -13,7 +13,14 @@ #define TOML_READ_DOUBLE(var) var = section[#var].value_or(var); #define TOML_READ_ENUM(type, var) var = (type)section[#var].value_or(var); -enum ELanguage : uint32_t +#define CONFIG_DEFINE(type, name, defaultValue) \ + static const type name##_Default = defaultValue; \ + inline static type name = name##_Default; + +#define CONFIG_GET_DEFAULT(name) Config::name##_Default +#define CONFIG_SET_DEFAULT(name) Config::name = CONFIG_GET_DEFAULT(name) + +enum ELanguage { ELanguage_English = 1, ELanguage_Japanese, @@ -23,26 +30,38 @@ enum ELanguage : uint32_t ELanguage_Italian }; -enum EScoreBehaviour : uint32_t +enum EScoreBehaviour { EScoreBehaviour_CheckpointReset, EScoreBehaviour_CheckpointRetain }; +enum EVoiceLanguage +{ + EVoiceLanguage_English, + EVoiceLanguage_Japanese +}; + enum EGraphicsAPI { EGraphicsAPI_D3D12, EGraphicsAPI_Vulkan }; -enum EMovieScaleMode : uint32_t +enum EGITextureFiltering +{ + EGITextureFiltering_Linear, + EGITextureFiltering_Bicubic +}; + +enum EMovieScaleMode { EMovieScaleMode_Stretch, EMovieScaleMode_Fit, EMovieScaleMode_Fill }; -enum EUIScaleMode : uint32_t +enum EUIScaleMode { EUIScaleMode_Stretch, EUIScaleMode_Edge, @@ -53,33 +72,44 @@ class Config { public: // System - inline static ELanguage Language = ELanguage_English; - inline static EScoreBehaviour ScoreBehaviour = EScoreBehaviour_CheckpointReset; - inline static bool Hints = true; - inline static bool UnleashOutOfControlDrain = true; - inline static bool WerehogHubTransformVideo = true; - inline static bool LogoSkip = false; + CONFIG_DEFINE(ELanguage, Language, ELanguage_English); + CONFIG_DEFINE(bool, Hints, true); + CONFIG_DEFINE(EScoreBehaviour, ScoreBehaviour, EScoreBehaviour_CheckpointReset); + CONFIG_DEFINE(bool, UnleashOutOfControlDrain, true); + CONFIG_DEFINE(bool, WerehogHubTransformVideo, true); + CONFIG_DEFINE(bool, LogoSkip, false); // Controls - inline static bool XButtonHoming = true; - inline static bool UnleashCancel = false; + CONFIG_DEFINE(bool, CameraXInvert, false); + CONFIG_DEFINE(bool, CameraYInvert, false); + CONFIG_DEFINE(bool, XButtonHoming, true); + CONFIG_DEFINE(bool, UnleashCancel, false); // Audio - inline static bool WerehogBattleMusic = true; + CONFIG_DEFINE(float, MusicVolume, 1.0f); + CONFIG_DEFINE(float, SEVolume, 1.0f); + CONFIG_DEFINE(EVoiceLanguage, VoiceLanguage, EVoiceLanguage_English); + CONFIG_DEFINE(bool, Subtitles, true); + CONFIG_DEFINE(bool, WerehogBattleMusic, true); // Video - inline static EGraphicsAPI GraphicsAPI = EGraphicsAPI_D3D12; - inline static uint32_t WindowWidth = 1280; - inline static uint32_t WindowHeight = 720; - inline static float ResolutionScale = 1.0f; - inline static int32_t ShadowResolution = 4096; - inline static size_t MSAA = 4; - inline static EMovieScaleMode MovieScaleMode = EMovieScaleMode_Fit; - inline static EUIScaleMode UIScaleMode = EUIScaleMode_Centre; - inline static bool AlphaToCoverage = false; - inline static bool Fullscreen = false; - inline static bool VSync = false; - inline static uint32_t BufferCount = 3; + CONFIG_DEFINE(EGraphicsAPI, GraphicsAPI, EGraphicsAPI_D3D12); + CONFIG_DEFINE(size_t, WindowWidth, 1280); + CONFIG_DEFINE(size_t, WindowHeight, 720); + CONFIG_DEFINE(float, ResolutionScale, 1.0f); + CONFIG_DEFINE(bool, Fullscreen, false); + CONFIG_DEFINE(bool, VSync, true); + CONFIG_DEFINE(size_t, BufferCount, 3); + CONFIG_DEFINE(size_t, FPS, 60); + CONFIG_DEFINE(float, Brightness, 0.5f); + CONFIG_DEFINE(size_t, MSAA, 4); + CONFIG_DEFINE(size_t, AnisotropicFiltering, 16); + CONFIG_DEFINE(int32_t, ShadowResolution, 4096); + CONFIG_DEFINE(EGITextureFiltering, GITextureFiltering, EGITextureFiltering_Bicubic); + CONFIG_DEFINE(bool, AlphaToCoverage, false); + CONFIG_DEFINE(bool, Xbox360ColorCorrection, false); + CONFIG_DEFINE(EMovieScaleMode, MovieScaleMode, EMovieScaleMode_Fit); + CONFIG_DEFINE(EUIScaleMode, UIScaleMode, EUIScaleMode_Centre); static void Load(); static void Save(); diff --git a/UnleashedRecomp/res/config.toml b/UnleashedRecomp/res/config.toml index 53519dc..e9b8a94 100644 --- a/UnleashedRecomp/res/config.toml +++ b/UnleashedRecomp/res/config.toml @@ -1,40 +1,39 @@ [System] -Language = 1 # The language displayed by the game. - # English = 1; Japanese = 2; German = 3; French = 4; Spanish = 5; Italian = 6. -ScoreBehaviour = 0 # Determines how the score behaves when restarting at a checkpoint. - # Reset to zero = 0; Reset to last checkpoint score = 1. -Hints = true # Determines whether to spawn hint rings and volumes. -UnleashOutOfControlDrain = true # Determines whether to drain Dark Gaia energy whilst the player cannot move. -WerehogHubTransformVideo = true # Determines whether to play the transition video for switching time of day in the hub areas. - # Setting this to false will instead play a generic transition without artificial loading times. -LogoSkip = false # Determines whether the intro logos will be skipped on boot. +Language = 1 # English = 1; Japanese = 2; German = 3; French = 4; Spanish = 5; Italian = 6. +Hints = true +ScoreBehaviour = 0 # Reset to zero = 0; Reset to last checkpoint score = 1. +UnleashOutOfControlDrain = true +WerehogHubTransformVideo = true +LogoSkip = false [Controls] -XButtonHoming = true # Determines whether to decouple the homing attack from the X button. -UnleashCancel = false # Determines whether Unleash can be cancelled by pressing the right shoulder button whilst activated. +CameraXInvert = false +CameraYInvert = false +XButtonHoming = true +UnleashCancel = false [Audio] -WerehogBattleMusic = true # Determines whether to play the battle theme for enemy encounters as the Werehog. +MusicVolume = 1.0 +SEVolume = 1.0 +VoiceLanguage = 0 # English = 0; Japanese = 1. +Subtitles = true +WerehogBattleMusic = true [Video] -GraphicsAPI = 0 # 0 - D3D12; 1 - Vulkan. +GraphicsAPI = 0 # D3D12 = 0; Vulkan = 1. WindowWidth = 1280 WindowHeight = 720 ResolutionScale = 1.0 -ShadowResolution = 4096 # The resolution of the shadow maps. - # Default = -1; otherwise, any power of two resolution (e.g. 512, 1024, 2048, 4096, 8192). - # Default will let the game determine the resolution. -MSAA = 4 -MovieScaleMode = 1 # The strategy for scaling video playback (experimental). - # Stretch = 0; Fit = 1; Fill = 2. - # Fit is recommended for 21:9 or wider aspect ratios for the intro cinematic. - # Fill will scale the intro cinematic past the original aspect ratio to fit the window dimensions. -UIScaleMode = 2 # The strategy for scaling the UI (experimental). - # Stretch = 0; Edge = 1; Centre = 2. - # Corner is recommended for 21:9 or wider aspect ratios. - # Centre does not dynamically adjust to the window size until re-entering a stage. -AlphaToCoverage = true Fullscreen = false -VSync = false -BufferCount = 3 # Double buffering = 2; Triple buffering = 3. - # Triple buffering can increase FPS and improve frame pacing at the expense of higher input latency. +VSync = true +BufferCount = 3 # Double buffering = 2; Triple buffering = 3. +FPS = 60 # Unlocked = -1; 30 FPS = 30; 60 FPS = 60. +Brightness = 0.5 +MSAA = 4 +AnisotropicFiltering = 16 +ShadowResolution = 4096 # Default = -1; otherwise, any power of two resolution. +GITextureFiltering = 1 # Linear = 0; Bicubic = 1. +AlphaToCoverage = true +Xbox360ColorCorrection = false +MovieScaleMode = 1 # Stretch = 0; Fit = 1; Fill = 2. +UIScaleMode = 2 # Stretch = 0; Edge = 1; Centre = 2. \ No newline at end of file