config: update layout and added more options

This commit is contained in:
Hyper 2024-10-21 14:13:54 +01:00
parent be08d1e7a4
commit 5508b23f39
3 changed files with 100 additions and 60 deletions

View file

@ -7,8 +7,8 @@ void Config::Load()
TOML_BEGIN_SECTION("System") TOML_BEGIN_SECTION("System")
{ {
TOML_READ_ENUM(ELanguage, Language); TOML_READ_ENUM(ELanguage, Language);
TOML_READ_ENUM(EScoreBehaviour, ScoreBehaviour);
TOML_READ_BOOLEAN(Hints); TOML_READ_BOOLEAN(Hints);
TOML_READ_ENUM(EScoreBehaviour, ScoreBehaviour);
TOML_READ_BOOLEAN(UnleashOutOfControlDrain); TOML_READ_BOOLEAN(UnleashOutOfControlDrain);
TOML_READ_BOOLEAN(WerehogHubTransformVideo); TOML_READ_BOOLEAN(WerehogHubTransformVideo);
TOML_READ_BOOLEAN(LogoSkip); TOML_READ_BOOLEAN(LogoSkip);
@ -17,6 +17,8 @@ void Config::Load()
TOML_BEGIN_SECTION("Controls") TOML_BEGIN_SECTION("Controls")
{ {
TOML_READ_BOOLEAN(CameraXInvert);
TOML_READ_BOOLEAN(CameraYInvert);
TOML_READ_BOOLEAN(XButtonHoming); TOML_READ_BOOLEAN(XButtonHoming);
TOML_READ_BOOLEAN(UnleashCancel); TOML_READ_BOOLEAN(UnleashCancel);
} }
@ -24,6 +26,10 @@ void Config::Load()
TOML_BEGIN_SECTION("Audio") 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_READ_BOOLEAN(WerehogBattleMusic);
} }
TOML_END_SECTION(); TOML_END_SECTION();
@ -34,14 +40,19 @@ void Config::Load()
TOML_READ_INTEGER(WindowWidth); TOML_READ_INTEGER(WindowWidth);
TOML_READ_INTEGER(WindowHeight); TOML_READ_INTEGER(WindowHeight);
TOML_READ_FLOAT(ResolutionScale); 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(Fullscreen);
TOML_READ_BOOLEAN(VSync); TOML_READ_BOOLEAN(VSync);
TOML_READ_INTEGER(BufferCount); 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(); TOML_END_SECTION();
} }

View file

@ -13,7 +13,14 @@
#define TOML_READ_DOUBLE(var) var = section[#var].value_or(var); #define TOML_READ_DOUBLE(var) var = section[#var].value_or(var);
#define TOML_READ_ENUM(type, var) var = (type)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_English = 1,
ELanguage_Japanese, ELanguage_Japanese,
@ -23,26 +30,38 @@ enum ELanguage : uint32_t
ELanguage_Italian ELanguage_Italian
}; };
enum EScoreBehaviour : uint32_t enum EScoreBehaviour
{ {
EScoreBehaviour_CheckpointReset, EScoreBehaviour_CheckpointReset,
EScoreBehaviour_CheckpointRetain EScoreBehaviour_CheckpointRetain
}; };
enum EVoiceLanguage
{
EVoiceLanguage_English,
EVoiceLanguage_Japanese
};
enum EGraphicsAPI enum EGraphicsAPI
{ {
EGraphicsAPI_D3D12, EGraphicsAPI_D3D12,
EGraphicsAPI_Vulkan EGraphicsAPI_Vulkan
}; };
enum EMovieScaleMode : uint32_t enum EGITextureFiltering
{
EGITextureFiltering_Linear,
EGITextureFiltering_Bicubic
};
enum EMovieScaleMode
{ {
EMovieScaleMode_Stretch, EMovieScaleMode_Stretch,
EMovieScaleMode_Fit, EMovieScaleMode_Fit,
EMovieScaleMode_Fill EMovieScaleMode_Fill
}; };
enum EUIScaleMode : uint32_t enum EUIScaleMode
{ {
EUIScaleMode_Stretch, EUIScaleMode_Stretch,
EUIScaleMode_Edge, EUIScaleMode_Edge,
@ -53,33 +72,44 @@ class Config
{ {
public: public:
// System // System
inline static ELanguage Language = ELanguage_English; CONFIG_DEFINE(ELanguage, Language, ELanguage_English);
inline static EScoreBehaviour ScoreBehaviour = EScoreBehaviour_CheckpointReset; CONFIG_DEFINE(bool, Hints, true);
inline static bool Hints = true; CONFIG_DEFINE(EScoreBehaviour, ScoreBehaviour, EScoreBehaviour_CheckpointReset);
inline static bool UnleashOutOfControlDrain = true; CONFIG_DEFINE(bool, UnleashOutOfControlDrain, true);
inline static bool WerehogHubTransformVideo = true; CONFIG_DEFINE(bool, WerehogHubTransformVideo, true);
inline static bool LogoSkip = false; CONFIG_DEFINE(bool, LogoSkip, false);
// Controls // Controls
inline static bool XButtonHoming = true; CONFIG_DEFINE(bool, CameraXInvert, false);
inline static bool UnleashCancel = false; CONFIG_DEFINE(bool, CameraYInvert, false);
CONFIG_DEFINE(bool, XButtonHoming, true);
CONFIG_DEFINE(bool, UnleashCancel, false);
// Audio // 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 // Video
inline static EGraphicsAPI GraphicsAPI = EGraphicsAPI_D3D12; CONFIG_DEFINE(EGraphicsAPI, GraphicsAPI, EGraphicsAPI_D3D12);
inline static uint32_t WindowWidth = 1280; CONFIG_DEFINE(size_t, WindowWidth, 1280);
inline static uint32_t WindowHeight = 720; CONFIG_DEFINE(size_t, WindowHeight, 720);
inline static float ResolutionScale = 1.0f; CONFIG_DEFINE(float, ResolutionScale, 1.0f);
inline static int32_t ShadowResolution = 4096; CONFIG_DEFINE(bool, Fullscreen, false);
inline static size_t MSAA = 4; CONFIG_DEFINE(bool, VSync, true);
inline static EMovieScaleMode MovieScaleMode = EMovieScaleMode_Fit; CONFIG_DEFINE(size_t, BufferCount, 3);
inline static EUIScaleMode UIScaleMode = EUIScaleMode_Centre; CONFIG_DEFINE(size_t, FPS, 60);
inline static bool AlphaToCoverage = false; CONFIG_DEFINE(float, Brightness, 0.5f);
inline static bool Fullscreen = false; CONFIG_DEFINE(size_t, MSAA, 4);
inline static bool VSync = false; CONFIG_DEFINE(size_t, AnisotropicFiltering, 16);
inline static uint32_t BufferCount = 3; 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 Load();
static void Save(); static void Save();

View file

@ -1,40 +1,39 @@
[System] [System]
Language = 1 # The language displayed by the game. Language = 1 # English = 1; Japanese = 2; German = 3; French = 4; Spanish = 5; Italian = 6.
# English = 1; Japanese = 2; German = 3; French = 4; Spanish = 5; Italian = 6. Hints = true
ScoreBehaviour = 0 # Determines how the score behaves when restarting at a checkpoint. ScoreBehaviour = 0 # Reset to zero = 0; Reset to last checkpoint score = 1.
# Reset to zero = 0; Reset to last checkpoint score = 1. UnleashOutOfControlDrain = true
Hints = true # Determines whether to spawn hint rings and volumes. WerehogHubTransformVideo = true
UnleashOutOfControlDrain = true # Determines whether to drain Dark Gaia energy whilst the player cannot move. LogoSkip = false
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.
[Controls] [Controls]
XButtonHoming = true # Determines whether to decouple the homing attack from the X button. CameraXInvert = false
UnleashCancel = false # Determines whether Unleash can be cancelled by pressing the right shoulder button whilst activated. CameraYInvert = false
XButtonHoming = true
UnleashCancel = false
[Audio] [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] [Video]
GraphicsAPI = 0 # 0 - D3D12; 1 - Vulkan. GraphicsAPI = 0 # D3D12 = 0; Vulkan = 1.
WindowWidth = 1280 WindowWidth = 1280
WindowHeight = 720 WindowHeight = 720
ResolutionScale = 1.0 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 Fullscreen = false
VSync = false VSync = true
BufferCount = 3 # Double buffering = 2; Triple buffering = 3. BufferCount = 3 # Double buffering = 2; Triple buffering = 3.
# Triple buffering can increase FPS and improve frame pacing at the expense of higher input latency. 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.