From 2239228bb09e0a33e28c750e29958012e49132e0 Mon Sep 17 00:00:00 2001 From: somewhatlurker <52014015+somewhatlurker@users.noreply.github.com> Date: Wed, 11 Sep 2019 10:28:07 +1000 Subject: [PATCH] add frm motion rate option and fix esm options --- source-code/data/plugins/config.ini | 2 ++ source-code/source/plugins/Launcher/framework.h | 6 ++++-- .../source/plugins/TLAC/Components/FrameRateManager.cpp | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/source-code/data/plugins/config.ini b/source-code/data/plugins/config.ini index cda8351..0b816d3 100644 --- a/source-code/data/plugins/config.ini +++ b/source-code/data/plugins/config.ini @@ -55,6 +55,8 @@ FPS.Limit.Verbose=0 TAA=1 # Morphological Anti-Aliasing MLAA=1 +# FrameRateManager motion rate (multiplier percentage) +FRM.Motion.Rate=500 [Resolution] # 0 = Windowed, 1 = Borderless (Forced to desktop resolution), 2 = Fullscreen diff --git a/source-code/source/plugins/Launcher/framework.h b/source-code/source/plugins/Launcher/framework.h index adfdd7b..9af26cc 100644 --- a/source-code/source/plugins/Launcher/framework.h +++ b/source-code/source/plugins/Launcher/framework.h @@ -162,8 +162,8 @@ ConfigOptionBase* optionsArray[] = { new BooleanOption(L"no_error", PATCHES_SECTION, CONFIG_FILE, L"Disable Error Banner", L"Disable the error banner on the attract screen.", true, false), new BooleanOption(L"hardware_slider", PATCHES_SECTION, CONFIG_FILE, L"Use Hardware Slider", L"Enable this if using a real arcade slider.\n(set the slider to port COM11)", false, false), - new NumericOption(L"Enhanced_Stage_Manager", GRAPHICS_SECTION, CONFIG_FILE, L"Number of stages:", L"Set the number of stages (0 = default).", 0, 0, INT_MAX), - new BooleanOption(L"Enhanced_Stage_Manager_Encore", PATCHES_SECTION, CONFIG_FILE, L"Encore", L"Enable encore stages.", true, false), + new NumericOption(L"Enhanced_Stage_Manager", PATCHES_SECTION, CONFIG_FILE, L"Number of stages:", L"Set the number of stages (0 = default).", 0, 0, INT_MAX), + new BooleanOption(L"Enhanced_Stage_Manager_Encore", PATCHES_SECTION, CONFIG_FILE, L"Encore Stages", L"Enable encore stages.", true, false), new BooleanOption(L"skip", LAUNCHER_SECTION, CONFIG_FILE, L"Skip Launcher", L"Forces the launcher to be skipped, you can also use the --launch parameter instead of this.", false, false), @@ -172,6 +172,8 @@ ConfigOptionBase* optionsArray[] = { new NumericOption(L"FPS.Limit", GRAPHICS_SECTION, CONFIG_FILE, L"FPS Limit:", L"Allows you to set a frame rate cap. Set to -1 to unlock the frame rate.", 60, -1, INT_MAX), new BooleanOption(L"FPS.Limit.LightMode", GRAPHICS_SECTION, CONFIG_FILE, L"Use Lightweight Limiter", L"Makes the FPS limiter use less CPU.\nMay have less consistent performance.", true, false), + new NumericOption(L"frm.motion.rate", GRAPHICS_SECTION, CONFIG_FILE, L"FRM Motion Rate:", L"Sets the motion rate (multiplier percentage) for the FrameRateManager component.\nLarger=smoother, but more CPU intensive.", 500, 1, INT_MAX), + new StringOption(L"command_line", LAUNCHER_SECTION, CONFIG_FILE, L"Command Line:", L"Allows setting command line parameters for the game when using the launcher.\nDisabling the launcher will bypass this.", L"", false), }; diff --git a/source-code/source/plugins/TLAC/Components/FrameRateManager.cpp b/source-code/source/plugins/TLAC/Components/FrameRateManager.cpp index 6b07d3e..b760948 100644 --- a/source-code/source/plugins/TLAC/Components/FrameRateManager.cpp +++ b/source-code/source/plugins/TLAC/Components/FrameRateManager.cpp @@ -5,11 +5,16 @@ #include #include "../framework.h" #include +#include namespace TLAC::Components { FrameRateManager::FrameRateManager() { + std::wstring_convert> converter; + std::wstring configPath = converter.from_bytes((TLAC::framework::GetModuleDirectory() + "/config.ini").c_str()); + float nMotionRate = GetPrivateProfileIntW(L"graphics", L"frm.motion.rate", 500, configPath.c_str()); + motionSpeedMultiplier = nMotionRate / 100.0f; } FrameRateManager::~FrameRateManager()