Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/client
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-29 00:12:05 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-29 00:12:05 +1000
commit45493ca8dd67cdb62e4aca97b5010e08f5e0d02a (patch)
tree8512eb67a0f93a98ad78541fe3a989efecb312ec /source/client
parent99846487b96b66bcfee9df50696c99f9429edda7 (diff)
Revert timestep values to default, make configurable
Diffstat (limited to 'source/client')
-rw-r--r--source/client/StarClientApplication.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/client/StarClientApplication.cpp b/source/client/StarClientApplication.cpp
index fa8d97b..fb26dcc 100644
--- a/source/client/StarClientApplication.cpp
+++ b/source/client/StarClientApplication.cpp
@@ -168,7 +168,6 @@ void ClientApplication::applicationInit(ApplicationControllerPtr appController)
m_guiContext = make_shared<GuiContext>(m_mainMixer->mixer(), appController);
- appController->setTargetUpdateRate(1.0f / WorldTimestep);
auto configuration = m_root->configuration();
bool vsync = configuration->get("vsync").toBool();
@@ -178,6 +177,16 @@ void ClientApplication::applicationInit(ApplicationControllerPtr appController)
bool borderless = configuration->get("borderless").toBool();
bool maximized = configuration->get("maximized").toBool();
+ float updateRate = 1.0f / WorldTimestep;
+ if (auto jUpdateRate = configuration->get("updateRate")) {
+ updateRate = jUpdateRate.toFloat();
+ WorldTimestep = 1.0f / updateRate;
+ }
+
+ if (auto jServerUpdateRate = configuration->get("serverUpdateRate"))
+ ServerWorldTimestep = 1.0f / jServerUpdateRate.toFloat();
+
+ appController->setTargetUpdateRate(updateRate);
appController->setApplicationTitle(assets->json("/client.config:windowTitle").toString());
appController->setVSyncEnabled(vsync);