mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 15:23:02 +05:00
Updated the parachute animations fix to preserve the night vertex colors of the parachute
Contributed by B1ack_Wh1te Fixes #19
This commit is contained in:
parent
723d56ec9c
commit
03fb49689d
1 changed files with 9 additions and 29 deletions
|
@ -1885,29 +1885,17 @@ namespace StaticShadowAlphaFix
|
||||||
// ============= Disable building pipeline for skinned objects (like parachute) =============
|
// ============= Disable building pipeline for skinned objects (like parachute) =============
|
||||||
namespace SkinBuildingPipelineFix
|
namespace SkinBuildingPipelineFix
|
||||||
{
|
{
|
||||||
static bool atomicHasSkinPipe;
|
static RpAtomic* (*orgCustomBuildingDNPipeline_CustomPipeAtomicSetup)(RpAtomic* atomic);
|
||||||
|
static RpAtomic* CustomBuildingDNPipeline_CustomPipeAtomicSetup_Skinned(RpAtomic* atomic)
|
||||||
static uint32_t (*orgGetPipelineID)(RpAtomic*);
|
|
||||||
static uint32_t GetPipelineID_SkinCheck( RpAtomic* atomic )
|
|
||||||
{
|
{
|
||||||
RxPipeline* pipeline;
|
RxPipeline* pipeline;
|
||||||
RpAtomicGetPipeline( atomic, &pipeline );
|
RpAtomicGetPipeline(atomic, &pipeline);
|
||||||
|
if (pipeline != nullptr && pipeline->pluginId == rwID_SKINPLUGIN)
|
||||||
// If skin pipeline, mark it as such
|
|
||||||
if ( pipeline != nullptr && pipeline->pluginId == rwID_SKINPLUGIN )
|
|
||||||
{
|
{
|
||||||
atomicHasSkinPipe = true;
|
return atomic;
|
||||||
return pipeline->pluginId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
atomicHasSkinPipe = false;
|
return orgCustomBuildingDNPipeline_CustomPipeAtomicSetup(atomic);
|
||||||
return orgGetPipelineID( atomic );
|
|
||||||
}
|
|
||||||
|
|
||||||
static void* (*orgGetExtraVertColourPtr)(RpGeometry*);
|
|
||||||
static void* GetExtraVertColourPtr_SkinCheck( RpGeometry* geometry )
|
|
||||||
{
|
|
||||||
return !atomicHasSkinPipe ? orgGetExtraVertColourPtr( geometry ) : nullptr;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -4995,11 +4983,7 @@ void Patch_SA_10(HINSTANCE hInstance)
|
||||||
{
|
{
|
||||||
using namespace SkinBuildingPipelineFix;
|
using namespace SkinBuildingPipelineFix;
|
||||||
|
|
||||||
ReadCall( 0x5D7F46, orgGetPipelineID );
|
InterceptCall(0x5D7F1E, orgCustomBuildingDNPipeline_CustomPipeAtomicSetup, CustomBuildingDNPipeline_CustomPipeAtomicSetup_Skinned);
|
||||||
InjectHook( 0x5D7F46, GetPipelineID_SkinCheck );
|
|
||||||
|
|
||||||
ReadCall( 0x5D7F60, orgGetExtraVertColourPtr );
|
|
||||||
InjectHook( 0x5D7F60, GetExtraVertColourPtr_SkinCheck );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6686,13 +6670,9 @@ void Patch_SA_NewBinaries_Common(HINSTANCE hInstance)
|
||||||
{
|
{
|
||||||
using namespace SkinBuildingPipelineFix;
|
using namespace SkinBuildingPipelineFix;
|
||||||
|
|
||||||
auto getPipeID = pattern( "E8 ? ? ? ? 8B 76 18 83 C4 04" ).get_one();
|
auto setupAtomic = get_pattern("74 0D 57 E8 ? ? ? ? 83 C4 04 5F 5E 5D C3", 3);
|
||||||
|
|
||||||
ReadCall( getPipeID.get<void>(), orgGetPipelineID );
|
InterceptCall(setupAtomic, orgCustomBuildingDNPipeline_CustomPipeAtomicSetup, CustomBuildingDNPipeline_CustomPipeAtomicSetup_Skinned);
|
||||||
InjectHook( getPipeID.get<void>(), GetPipelineID_SkinCheck );
|
|
||||||
|
|
||||||
ReadCall( getPipeID.get<void>( 0x1A ), orgGetExtraVertColourPtr );
|
|
||||||
InjectHook( getPipeID.get<void>( 0x1A ), GetExtraVertColourPtr_SkinCheck );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue