Allow the main game loop to scale the delta time

This commit is contained in:
Matt committed 2021-01-20 23:13:02 +02:00
1 parent bd27046142
commit f684ebd7d9
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]))
{