diff --git a/source-code/source/plugins/Launcher/framework.h b/source-code/source/plugins/Launcher/framework.h index 741fd97..45806a0 100644 --- a/source-code/source/plugins/Launcher/framework.h +++ b/source-code/source/plugins/Launcher/framework.h @@ -252,6 +252,8 @@ ConfigOptionBase* componentsArray[] = { new BooleanOption(L"fast_loader", COMPONENTS_SECTION, COMPONENTS_FILE, L"Fast Loader", L"Skip or speed up unnecessary loading steps.", false, true), + new NumericOption(L"fast_loader_speed", COMPONENTS_SECTION, COMPONENTS_FILE, L"Fast Loader Speed", L"Set this to 4 or less when playing online.\nDefault: 39", 39, 2, 1024), + new BooleanOption(L"camera_controller", COMPONENTS_SECTION, COMPONENTS_FILE, L"Camera Controller", L"Enables freecam (toggled using F3).\nWASD to move, SPACE/CTRL for up/down, Q/R to rotate, R/F for zoom.\nHolding SHIFT/ALT changes control speed.", false, true), new BooleanOption(L"scale_component", COMPONENTS_SECTION, COMPONENTS_FILE, L"Scale Component", L"Scales the graphics output framebuffer to fill the screen/window.", false, true), diff --git a/source-code/source/plugins/TLAC/Components/FastLoader.cpp b/source-code/source/plugins/TLAC/Components/FastLoader.cpp index 6832907..3cc2205 100644 --- a/source-code/source/plugins/TLAC/Components/FastLoader.cpp +++ b/source-code/source/plugins/TLAC/Components/FastLoader.cpp @@ -1,6 +1,8 @@ #include "FastLoader.h" +#include "../FileSystem/ConfigFile.h" #include "../Constants.h" #include +#include "../framework.h" namespace TLAC::Components { @@ -19,6 +21,14 @@ namespace TLAC::Components void FastLoader::Initialize(ComponentsManager*) { + TLAC::FileSystem::ConfigFile componentsConfig(TLAC::framework::GetModuleDirectory(), COMPONENTS_CONFIG_FILE_NAME); + bool success = componentsConfig.OpenRead(); + if (success) + { + int speed = componentsConfig.GetIntegerValue("fast_loader_speed"); + if (speed >= 2 && speed <= 1024) updatesPerFrame = speed; + } + printf("[Fast Loader] Speed: %d\n", updatesPerFrame); } void FastLoader::Update() diff --git a/source-code/source/plugins/TLAC/Components/FastLoader.h b/source-code/source/plugins/TLAC/Components/FastLoader.h index 1319cbc..21bb503 100644 --- a/source-code/source/plugins/TLAC/Components/FastLoader.h +++ b/source-code/source/plugins/TLAC/Components/FastLoader.h @@ -1,6 +1,7 @@ #pragma once #include "EmulatorComponent.h" #include "GameState.h" +#include namespace TLAC::Components { @@ -17,7 +18,8 @@ namespace TLAC::Components virtual void UpdateInput() override; private: - const int updatesPerFrame = 39; + const std::string COMPONENTS_CONFIG_FILE_NAME = "components.ini"; + int updatesPerFrame = 39; GameState currentGameState; GameState previousGameState;