mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 15:23:02 +05:00
Aaron's sun corrected
This commit is contained in:
parent
6559a04732
commit
d3cb0bb72c
1 changed files with 19 additions and 0 deletions
|
@ -1175,6 +1175,17 @@ static void DoPCScreenChange_Mod()
|
|||
}
|
||||
}
|
||||
|
||||
static CVector curVecToSun;
|
||||
static void (*orgSetLightsWithTimeOfDayColour)( RpWorld* );
|
||||
static void SetLightsWithTimeOfDayColour_SilentPatch( RpWorld* world )
|
||||
{
|
||||
static CVector* const VectorToSun = *AddressByVersion<CVector**>( 0x6FC5B7 + 3, 0, 0 ); // TODO: DO
|
||||
static int& CurrentStoredValue = **AddressByVersion<int**>( 0x6FC632 + 1, 0, 0 ); // TODO: DO
|
||||
|
||||
curVecToSun = VectorToSun[CurrentStoredValue];
|
||||
orgSetLightsWithTimeOfDayColour( world );
|
||||
}
|
||||
|
||||
#if MEM_VALIDATORS
|
||||
|
||||
#include <intrin.h>
|
||||
|
@ -2565,6 +2576,14 @@ BOOL InjectDelayedPatches_10()
|
|||
Patch<const void*>( 0x406620+2, &pCdStreamSetFilePointer );
|
||||
}
|
||||
|
||||
|
||||
// Fix directional light position
|
||||
ReadCall( 0x53E997, orgSetLightsWithTimeOfDayColour );
|
||||
InjectHook( 0x53E997, SetLightsWithTimeOfDayColour_SilentPatch );
|
||||
Patch<const void*>( 0x735618 + 2, &curVecToSun.x );
|
||||
Patch<const void*>( 0x73561E + 2, &curVecToSun.y );
|
||||
Patch<const void*>( 0x735624 + 1, &curVecToSun.z );
|
||||
|
||||
FLAUtils::Init();
|
||||
|
||||
return FALSE;
|
||||
|
|
Loading…
Reference in a new issue