mirror of
https://github.com/halpz/re3.git
synced 2025-05-13 05:26:38 +03:00
added CPointLights
This commit is contained in:
parent
92434f01f1
commit
c40c7acb96
5 changed files with 366 additions and 3 deletions
27
src/re3.cpp
27
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<float>(0x46BC61+6, 1.0f); // car distance
|
||||
InjectHook(0x59E460, printf, PATCH_JUMP);
|
||||
|
||||
// stolen from silentpatch (sorry)
|
||||
Patch<WORD>(0x5382BF, 0x0EEB);
|
||||
InjectHook(0x5382EC, HeadlightsFix, PATCH_JUMP);
|
||||
|
||||
InterceptCall(&open_script_orig, open_script, 0x438869);
|
||||
|
||||
InterceptCall(&RsEventHandler_orig, delayedPatches10, 0x58275E);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue