added CPointLights
This commit is contained in:
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);
|
||||
|
Reference in New Issue
Block a user