Skip to content

Commit

Permalink
fix: host_timescale loads
Browse files Browse the repository at this point in the history
(mostly... it removes *most* of the timescale effect on loads)
Fixes #247
Approximately cuts loading times in half? Depends on hardware, and I'm unsure if this is the optimal value.
  • Loading branch information
ThisAMJ committed Jul 19, 2024
1 parent ce823b2 commit e02e553
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Modules/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,12 @@ void Host_AccumulateTime_Detour(float dt) {
*host_frametime_unbounded = 0;
}

// HACK: Force frametime to equal 2 ticks when loading
// Limits host_timescale effect on load times, faster loads
if (g_cap_frametime == 1 && sar_loads_uncap.GetBool()) {
*host_frametime = *host_frametime_unbounded = 2.0f/60;
}

if (*host_frametime != *host_frametime_unbounded) {
if (sar_frametime_uncap.GetBool() && g_cap_frametime == 0) {
if (sar_frametime_debug.GetBool()) console->Print("Host_AccumulateTime: %f (uncapped from %f)\n", *host_frametime_unbounded, *host_frametime);
Expand Down

0 comments on commit e02e553

Please sign in to comment.