MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / SetGameSpeed

Method SetGameSpeed

Source/Main/engine.cpp:6553–6568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6551}
6552
6553void Engine::SetGameSpeed(float val, bool hard) {
6554 if (val >= 0.1f) {
6555 if (hard) {
6556 game_timer.time_scale /= current_global_scale_mult;
6557 }
6558 game_timer.target_time_scale /= current_global_scale_mult;
6559 config.GetRef("global_time_scale_mult") = val;
6560 current_global_scale_mult = val;
6561 game_timer.target_time_scale *= val;
6562 if (hard) {
6563 game_timer.time_scale *= val;
6564 }
6565 } else {
6566 LOGE << "Disallowing setting gamespeed below 0.1" << std::endl;
6567 }
6568}
6569
6570bool Engine::RequestedInterruptLoading() {
6571 loading_mutex_.lock();

Callers 3

LiveUpdateFunction · 0.80
SetGameSpeedFunction · 0.80
ReloadDynamicSettingsMethod · 0.80

Calls 1

GetRefMethod · 0.45

Tested by

no test coverage detected