mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-28 06:43:01 +05:00
Enable directional lights on flying car components
Fixes detached car parts rendering as near black Fixes #16
This commit is contained in:
parent
a4d83ac9ce
commit
c6c9fe6013
1 changed files with 30 additions and 0 deletions
|
@ -2500,6 +2500,18 @@ namespace ShootingStarsFix
|
|||
}
|
||||
|
||||
|
||||
// ============= Enable directional lights on flying car components =============
|
||||
namespace LitFlyingComponents
|
||||
{
|
||||
static void (*orgWorldAdd)(CEntity*);
|
||||
static void WorldAdd_SetLightObjectFlag(CEntity* entity)
|
||||
{
|
||||
entity->bLightObject = true;
|
||||
orgWorldAdd(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ============= LS-RP Mode stuff =============
|
||||
namespace LSRPMode
|
||||
{
|
||||
|
@ -5274,6 +5286,14 @@ void Patch_SA_10(HINSTANCE hInstance)
|
|||
InterceptCall(0x714610, orgRwIm3DTransform, RwIm3DTransform_UnsetTexture);
|
||||
}
|
||||
|
||||
|
||||
// Enable directional lights on flying car components
|
||||
{
|
||||
using namespace LitFlyingComponents;
|
||||
|
||||
InterceptCall(0x6A8BBE, orgWorldAdd, WorldAdd_SetLightObjectFlag);
|
||||
}
|
||||
|
||||
#if FULL_PRECISION_D3D
|
||||
// Test - full precision D3D device
|
||||
Patch<uint8_t>( 0x7F672B+1, *(uint8_t*)(0x7F672B+1) | D3DCREATE_FPU_PRESERVE );
|
||||
|
@ -6998,6 +7018,16 @@ void Patch_SA_NewBinaries_Common(HINSTANCE hInstance)
|
|||
|
||||
InterceptCall(rwIm3dTransform, orgRwIm3DTransform, RwIm3DTransform_UnsetTexture);
|
||||
}
|
||||
|
||||
|
||||
// Enable directional lights on flying car components
|
||||
{
|
||||
using namespace LitFlyingComponents;
|
||||
|
||||
auto worldAdd = get_pattern("53 E8 ? ? ? ? 8B 4D F4 83 C4 04 5F 5E 8B C3", 1);
|
||||
|
||||
InterceptCall(worldAdd, orgWorldAdd, WorldAdd_SetLightObjectFlag);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue