Correct imshadows a bit

This commit is contained in:
Silent 2017-03-25 13:46:35 +01:00
parent b9dff82bcc
commit 1e69da6ce5
2 changed files with 13 additions and 8 deletions

View file

@ -27,7 +27,7 @@ static void SetVehicleColour(unsigned char primaryColour, unsigned char secondar
static void ResetEditableMaterials(std::pair<void*,int>* pData) static void ResetEditableMaterials(std::pair<void*,int>* pData)
{ {
for ( auto* i = pData; i->first; i++ ) for ( auto* i = pData; i->first != nullptr; i++ )
*static_cast<int*>(i->first) = i->second; *static_cast<int*>(i->first) = i->second;
} }
@ -38,13 +38,18 @@ RpAtomic* ShadowCameraRenderCB(RpAtomic* pAtomic, void* pData)
if ( RpAtomicGetFlags(pAtomic) & rpATOMICRENDER ) if ( RpAtomicGetFlags(pAtomic) & rpATOMICRENDER )
{ {
RpGeometry* pGeometry = RpAtomicGetGeometry(pAtomic); RpGeometry* pGeometry = RpAtomicGetGeometry(pAtomic);
RwUInt32 geometryFlags = RpGeometryGetFlags(pGeometry);
RpGeometrySetFlags(pGeometry, geometryFlags & ~(rpGEOMETRYTEXTURED|rpGEOMETRYPRELIT| if ( pGeometry->repEntry != nullptr ) // Only switch to optimized flags if already instanced so as not to break the instanced model
/*rpGEOMETRYNORMALS|*/rpGEOMETRYLIGHT|rpGEOMETRYMODULATEMATERIALCOLOR|rpGEOMETRYTEXTURED2)); {
RwUInt32 geometryFlags = RpGeometryGetFlags(pGeometry);
AtomicDefaultRenderCallBack(pAtomic); pGeometry->flags &= ~(rpGEOMETRYTEXTURED|rpGEOMETRYPRELIT|rpGEOMETRYNORMALS|rpGEOMETRYLIGHT|rpGEOMETRYMODULATEMATERIALCOLOR|rpGEOMETRYTEXTURED2);
RpGeometrySetFlags(pGeometry, geometryFlags); pAtomic = AtomicDefaultRenderCallBack(pAtomic);
RpGeometrySetFlags(pGeometry, geometryFlags);
}
else
{
pAtomic = AtomicDefaultRenderCallBack(pAtomic);
}
} }
return pAtomic; return pAtomic;
} }

View file

@ -6,7 +6,7 @@
<SILENTPATCH_EXT>.asi</SILENTPATCH_EXT> <SILENTPATCH_EXT>.asi</SILENTPATCH_EXT>
<SILENTPATCH_FULL_NAME>SilentPatch for San Andreas</SILENTPATCH_FULL_NAME> <SILENTPATCH_FULL_NAME>SilentPatch for San Andreas</SILENTPATCH_FULL_NAME>
<SILENTPATCH_REVISION_ID>28</SILENTPATCH_REVISION_ID> <SILENTPATCH_REVISION_ID>28</SILENTPATCH_REVISION_ID>
<SILENTPATCH_BUILD_ID>3</SILENTPATCH_BUILD_ID> <SILENTPATCH_BUILD_ID>5</SILENTPATCH_BUILD_ID>
<SILENTPATCH_COPYRIGHT>2014-2017</SILENTPATCH_COPYRIGHT> <SILENTPATCH_COPYRIGHT>2014-2017</SILENTPATCH_COPYRIGHT>
</PropertyGroup> </PropertyGroup>
<PropertyGroup /> <PropertyGroup />