From c40c7acb96a926378df7d7b43920966ab31ff95e Mon Sep 17 00:00:00 2001 From: aap Date: Sat, 1 Jun 2019 19:18:19 +0200 Subject: added CPointLights --- src/re3.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/re3.cpp') diff --git a/src/re3.cpp b/src/re3.cpp index 572f4c05..e99384e1 100644 --- a/src/re3.cpp +++ b/src/re3.cpp @@ -111,6 +111,29 @@ delayedPatches10(int a, int b) return RsEventHandler_orig(a, b); } +void __declspec(naked) HeadlightsFix() +{ + static const float fMinusOne = -1.0f; + _asm + { + fld [esp+708h-690h] + fcomp fMinusOne + fnstsw ax + and ah, 5 + cmp ah, 1 + jnz HeadlightsFix_DontLimit + fld fMinusOne + fstp [esp+708h-690h] + +HeadlightsFix_DontLimit: + fld [esp+708h-690h] + fabs + fld st + push 0x5382F2 + retn + } +} + void patch() @@ -120,6 +143,10 @@ patch() Patch(0x46BC61+6, 1.0f); // car distance InjectHook(0x59E460, printf, PATCH_JUMP); + // stolen from silentpatch (sorry) + Patch(0x5382BF, 0x0EEB); + InjectHook(0x5382EC, HeadlightsFix, PATCH_JUMP); + InterceptCall(&open_script_orig, open_script, 0x438869); InterceptCall(&RsEventHandler_orig, delayedPatches10, 0x58275E); -- cgit v1.2.3