Config: implemented toml reading

This commit is contained in:
Hyper
2024-10-17 21:20:35 +01:00
parent 554be01412
commit ee35458b5d
7 changed files with 121 additions and 21 deletions
+47
View File
@@ -0,0 +1,47 @@
void Config::Load()
{
auto toml = toml::parse_file(TOML_FILE);
TOML_BEGIN_SECTION("System")
{
TOML_READ_ENUM(ELanguage, Language);
TOML_READ_ENUM(EScoreBehaviour, ScoreBehaviour);
TOML_READ_BOOLEAN(Hints);
TOML_READ_BOOLEAN(WerehogHubTransformVideo);
}
TOML_END_SECTION();
TOML_BEGIN_SECTION("Controls")
{
TOML_READ_BOOLEAN(XButtonHoming);
TOML_READ_BOOLEAN(UnleashCancel);
}
TOML_END_SECTION();
TOML_BEGIN_SECTION("Audio")
{
TOML_READ_BOOLEAN(WerehogBattleMusic);
}
TOML_END_SECTION();
TOML_BEGIN_SECTION("Video")
{
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_END_SECTION();
}
void Config::Save()
{
// TODO
}