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)
{
for ( auto* i = pData; i->first; i++ )
for ( auto* i = pData; i->first != nullptr; i++ )
*static_cast<int*>(i->first) = i->second;
}
@ -38,14 +38,19 @@ RpAtomic* ShadowCameraRenderCB(RpAtomic* pAtomic, void* pData)
if ( RpAtomicGetFlags(pAtomic) & rpATOMICRENDER )
{
RpGeometry* pGeometry = RpAtomicGetGeometry(pAtomic);
if ( pGeometry->repEntry != nullptr ) // Only switch to optimized flags if already instanced so as not to break the instanced model
{
RwUInt32 geometryFlags = RpGeometryGetFlags(pGeometry);
RpGeometrySetFlags(pGeometry, geometryFlags & ~(rpGEOMETRYTEXTURED|rpGEOMETRYPRELIT|
/*rpGEOMETRYNORMALS|*/rpGEOMETRYLIGHT|rpGEOMETRYMODULATEMATERIALCOLOR|rpGEOMETRYTEXTURED2));
AtomicDefaultRenderCallBack(pAtomic);
pGeometry->flags &= ~(rpGEOMETRYTEXTURED|rpGEOMETRYPRELIT|rpGEOMETRYNORMALS|rpGEOMETRYLIGHT|rpGEOMETRYMODULATEMATERIALCOLOR|rpGEOMETRYTEXTURED2);
pAtomic = AtomicDefaultRenderCallBack(pAtomic);
RpGeometrySetFlags(pGeometry, geometryFlags);
}
else
{
pAtomic = AtomicDefaultRenderCallBack(pAtomic);
}
}
return pAtomic;
}

View file

@ -6,7 +6,7 @@
<SILENTPATCH_EXT>.asi</SILENTPATCH_EXT>
<SILENTPATCH_FULL_NAME>SilentPatch for San Andreas</SILENTPATCH_FULL_NAME>
<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>
</PropertyGroup>
<PropertyGroup />