Skip to content

Commit

Permalink
Merge branch 'ThirteenAG:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SandeMC committed Jan 14, 2024
2 parents 62134c2 + 66d797f commit 5b02ec5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion data/plugins/GTAIV.EFLC.FusionFix.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FpsLimit = 0 // used when FPS Limit menu toggle
CutsceneFpsLimit = 0
ScriptCutsceneFovLimit = 30
LoadingFpsLimit = 30 // used to avoid game freeze on loading (e.g. Off Route mission)
UnlockFramerateDuringLoadscreens = 0
UnlockFramerateDuringLoadscreens = 1 // game loads faster when using frame limiter

[MISC]
DefaultCameraAngleInTLAD = 0
Expand Down
20 changes: 3 additions & 17 deletions source/framelimit.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -154,21 +154,11 @@ void __cdecl sub_855640()
}
}

bool bIsC64CB0XRef = false;
injector::hook_back<void(__cdecl*)(void*)> hbsub_C64CB0;
void __cdecl sub_C64CB0(void* a1)
{
bIsC64CB0XRef = true;
hbsub_C64CB0.fun(a1);
bIsC64CB0XRef = false;
}

SafetyHookInline CCutsceneObjectHook{};
void __fastcall sub_C64380(void* _this, void* edx)
{
if (bIsC64CB0XRef)
LoadingFpsLimiter.Sync();
return CCutsceneObjectHook.unsafe_fastcall(_this, edx);
LoadingFpsLimiter.Sync();
return hbsub_C64CB0.fun(a1);
}

class Framelimit
Expand Down Expand Up @@ -252,11 +242,7 @@ public:
FusionFix::onInitEvent() += []()
{
// Off Route infinite loading (CCutsceneObject method causes CRenderer::removeAllTexturesFromDictionary to softlock for unidentified reason)
auto pattern = hook::pattern("56 8B F1 83 BE ? ? ? ? ? C7 06 ? ? ? ? 0F 85");
if (!pattern.empty())
CCutsceneObjectHook = safetyhook::create_inline(pattern.get_first(0), sub_C64380);

pattern = hook::pattern("E8 ? ? ? ? 83 C4 0C C7 04 B5 ? ? ? ? ? ? ? ? 4E");
auto pattern = hook::pattern("E8 ? ? ? ? 83 C4 0C C7 04 B5 ? ? ? ? ? ? ? ? 4E");
if (!pattern.empty())
hbsub_C64CB0.fun = injector::MakeCALL(pattern.get_first(0), sub_C64CB0).get();
};
Expand Down

0 comments on commit 5b02ec5

Please sign in to comment.