1515#include " CMatrix.h"
1616#include " gamesa_renderware.h"
1717
18+ #define SetLightColoursForPedsCarsAndObjects (fMult ) ((RpLight*(__cdecl*)(float ))0x735D90 )(fMult )
19+ #define SetAmbientColours () ((RpLight*(__cdecl*)())0x735D30 )()
20+
1821CRendererSA::CRendererSA ()
1922{
2023}
@@ -23,7 +26,7 @@ CRendererSA::~CRendererSA()
2326{
2427}
2528
26- void CRendererSA::RenderModel (CModelInfo* pModelInfo, const CMatrix& matrix)
29+ void CRendererSA::RenderModel (CModelInfo* pModelInfo, const CMatrix& matrix, float lighting )
2730{
2831 CBaseModelInfoSAInterface* pModelInfoSAInterface = pModelInfo->GetInterface ();
2932 if (!pModelInfoSAInterface)
@@ -40,7 +43,10 @@ void CRendererSA::RenderModel(CModelInfo* pModelInfo, const CMatrix& matrix)
4043 rwMatrix.up = (RwV3d&)matrix.vFront ;
4144 rwMatrix.at = (RwV3d&)matrix.vUp ;
4245 rwMatrix.pos = (RwV3d&)matrix.vPos ;
43- RwFrameTransform (pFrame, &rwMatrix, rwCOMBINEREPLACE);
46+ RwFrameTransform (pFrame, &rwMatrix, rwCOMBINEREPLACE);
47+
48+ // Setup ambient light multiplier
49+ SetLightColoursForPedsCarsAndObjects (lighting);
4450
4551 if (pRwObject->type == RP_TYPE_ATOMIC)
4652 {
@@ -52,4 +58,7 @@ void CRendererSA::RenderModel(CModelInfo* pModelInfo, const CMatrix& matrix)
5258 RpClump* pClump = reinterpret_cast <RpClump*>(pRwObject);
5359 RpClumpRender (pClump);
5460 }
61+
62+ // Restore ambient light
63+ SetAmbientColours ();
5564}
0 commit comments