Skip to content

Commit

Permalink
disabled fps limiter during loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Jul 29, 2023
1 parent 56ad019 commit 57be766
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion source/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,24 @@ class FrameLimiter
}
};

bool bLoadingShown = false;
bool __cdecl sub_411F50(uint32_t* a1, uint32_t* a2)
{
bLoadingShown = false;
if (!a1[2] && !a2[2]) {
bLoadingShown = *a1 == *a2;
return *a1 == *a2;
}
if (a1[2] != a2[2])
return false;
if (a1[0] != a2[0])
return false;
if (a1[1] != a2[1])
return false;
bLoadingShown = true;
return true;
}

FrameLimiter FpsLimiter;
FrameLimiter CutsceneFpsLimiter;
FrameLimiter ScriptCutsceneFpsLimiter;
Expand All @@ -293,7 +311,7 @@ void __cdecl sub_855640()
{
static auto preset = FusionFixSettings.GetRef("PREF_FPS_LIMIT_PRESET");

if (bLoadscreenShown && !*bLoadscreenShown)
if (bLoadscreenShown && !*bLoadscreenShown && !bLoadingShown)
{
if (preset && *preset >= 2) {
if (fFpsLimit > 0.0f || (*preset > 2 && *preset < fpsCaps.size()))
Expand Down Expand Up @@ -930,6 +948,9 @@ void Init()

pattern = hook::pattern("80 3D ? ? ? ? ? 53 56 8A FA");
bLoadscreenShown = *pattern.get_first<uint8_t*>(2);

pattern = hook::pattern("8B 4C 24 04 8B 54 24 08 8B 41 08");
injector::MakeJMP(pattern.get_first(0), sub_411F50, true);
}

if (fScriptCutsceneFovLimit)
Expand Down

0 comments on commit 57be766

Please sign in to comment.