Merge pull request #13869 from ZehMatt/feature/timescale

Allow the main game loop to scale the delta time
This commit is contained in:
ζeh Matt authored and GitHub committed 2021-01-27 06:09:51 +02:00
commit 8eab5d167e
3 files changed
+37 -7

No files matched your search

@@ -693,6 +693,10 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv)
{
console.WriteFormatLine("current_rotation %d", get_current_rotation());
}
else if (argv[0] == "host_timescale")
{
console.WriteFormatLine("host_timescale %.02f", OpenRCT2::GetContext()->GetTimeScale());
}
#ifndef NO_TTF
else if (argv[0] == "enable_hinting")
{
@@ -1011,6 +1015,14 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
}
console.Execute("get current_rotation");
}
else if (argv[0] == "host_timescale" && invalidArguments(&invalidArgs, double_valid[0]))
{
float newScale = static_cast<float>(double_val[0]);
OpenRCT2::GetContext()->SetTimeScale(newScale);
console.Execute("get host_timescale");
}
#ifndef NO_TTF
else if (argv[0] == "enable_hinting" && invalidArguments(&invalidArgs, int_valid[0]))
{