mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2025-01-11 10:34:09 +00:00
NULL -> nil
This commit is contained in:
parent
e2ded2d6ce
commit
224fd77641
|
@ -3958,7 +3958,7 @@ CCam::Process_Debug(const CVector&, float, float, float)
|
||||||
if(CPad::GetPad(1)->GetLeftShockJustDown() && gbBigWhiteDebugLightSwitchedOn)
|
if(CPad::GetPad(1)->GetLeftShockJustDown() && gbBigWhiteDebugLightSwitchedOn)
|
||||||
CShadows::StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &Source,
|
CShadows::StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &Source,
|
||||||
12.0f, 0.0f, 0.0f, -12.0f,
|
12.0f, 0.0f, 0.0f, -12.0f,
|
||||||
128, 128, 128, 128, 1000.0f, false, 1.0f, NULL, false);
|
128, 128, 128, 128, 1000.0f, false, 1.0f, nil, false);
|
||||||
|
|
||||||
if(CHud::m_Wants_To_Draw_Hud){
|
if(CHud::m_Wants_To_Draw_Hud){
|
||||||
char str[256];
|
char str[256];
|
||||||
|
@ -4103,7 +4103,7 @@ CCam::Process_Editor(const CVector&, float, float, float)
|
||||||
if(CPad::GetPad(1)->GetLeftShockJustDown() && gbBigWhiteDebugLightSwitchedOn)
|
if(CPad::GetPad(1)->GetLeftShockJustDown() && gbBigWhiteDebugLightSwitchedOn)
|
||||||
CShadows::StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &Source,
|
CShadows::StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &Source,
|
||||||
12.0f, 0.0f, 0.0f, -12.0f,
|
12.0f, 0.0f, 0.0f, -12.0f,
|
||||||
128, 128, 128, 128, 1000.0f, false, 1.0f, NULL, false);
|
128, 128, 128, 128, 1000.0f, false, 1.0f, nil, false);
|
||||||
|
|
||||||
if(CHud::m_Wants_To_Draw_Hud){
|
if(CHud::m_Wants_To_Draw_Hud){
|
||||||
char str[256];
|
char str[256];
|
||||||
|
|
|
@ -445,7 +445,7 @@ CEntity::PreRender(void)
|
||||||
gpShadowExplosionTex, &pos,
|
gpShadowExplosionTex, &pos,
|
||||||
8.0f, 0.0f, 0.0f, -8.0f,
|
8.0f, 0.0f, 0.0f, -8.0f,
|
||||||
255, 200.0f*flicker, 160.0f*flicker, 120.0f*flicker,
|
255, 200.0f*flicker, 160.0f*flicker, 120.0f*flicker,
|
||||||
20.0f, false, 1.0f, NULL, false);
|
20.0f, false, 1.0f, nil, false);
|
||||||
CPointLights::AddLight(CPointLights::LIGHT_POINT,
|
CPointLights::AddLight(CPointLights::LIGHT_POINT,
|
||||||
pos, CVector(0.0f, 0.0f, 0.0f),
|
pos, CVector(0.0f, 0.0f, 0.0f),
|
||||||
8.0f,
|
8.0f,
|
||||||
|
@ -483,7 +483,7 @@ CEntity::PreRender(void)
|
||||||
CTimeCycle::GetShadowStrength(),
|
CTimeCycle::GetShadowStrength(),
|
||||||
CTimeCycle::GetShadowStrength(),
|
CTimeCycle::GetShadowStrength(),
|
||||||
CTimeCycle::GetShadowStrength(),
|
CTimeCycle::GetShadowStrength(),
|
||||||
20.0f, false, 1.0f, NULL, false);
|
20.0f, false, 1.0f, nil, false);
|
||||||
}
|
}
|
||||||
// fall through
|
// fall through
|
||||||
case ENTITY_TYPE_DUMMY:
|
case ENTITY_TYPE_DUMMY:
|
||||||
|
|
|
@ -26,9 +26,9 @@ CCutsceneObject::CCutsceneObject(void)
|
||||||
m_fMass = 1.0f;
|
m_fMass = 1.0f;
|
||||||
m_fTurnMass = 1.0f;
|
m_fTurnMass = 1.0f;
|
||||||
|
|
||||||
m_pAttachTo = NULL;
|
m_pAttachTo = nil;
|
||||||
m_pAttachmentObject = NULL;
|
m_pAttachmentObject = nil;
|
||||||
m_pShadow = NULL;
|
m_pShadow = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
CCutsceneObject::~CCutsceneObject(void)
|
CCutsceneObject::~CCutsceneObject(void)
|
||||||
|
@ -36,7 +36,7 @@ CCutsceneObject::~CCutsceneObject(void)
|
||||||
if ( m_pShadow )
|
if ( m_pShadow )
|
||||||
{
|
{
|
||||||
delete m_pShadow;
|
delete m_pShadow;
|
||||||
m_pShadow = NULL;
|
m_pShadow = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ CCutsceneObject::PreRender(void)
|
||||||
|
|
||||||
if(IsPedModel(GetModelIndex()))
|
if(IsPedModel(GetModelIndex()))
|
||||||
{
|
{
|
||||||
if ( m_pShadow == NULL )
|
if ( m_pShadow == nil )
|
||||||
{
|
{
|
||||||
CShadows::StoreShadowForPedObject(this,
|
CShadows::StoreShadowForPedObject(this,
|
||||||
CTimeCycle::m_fShadowDisplacementX[CTimeCycle::m_CurrentStoredValue],
|
CTimeCycle::m_fShadowDisplacementX[CTimeCycle::m_CurrentStoredValue],
|
||||||
|
|
|
@ -10,9 +10,9 @@
|
||||||
|
|
||||||
CCutsceneShadow::CCutsceneShadow()
|
CCutsceneShadow::CCutsceneShadow()
|
||||||
{
|
{
|
||||||
m_pAtomic = NULL;
|
m_pAtomic = nil;
|
||||||
m_nRwObjectType = -1;
|
m_nRwObjectType = -1;
|
||||||
m_pLight = NULL;
|
m_pLight = nil;
|
||||||
m_nBlurPasses = 0;
|
m_nBlurPasses = 0;
|
||||||
m_bResample = false;
|
m_bResample = false;
|
||||||
m_bGradient = false;
|
m_bGradient = false;
|
||||||
|
@ -26,7 +26,7 @@ CCutsceneShadow::~CCutsceneShadow()
|
||||||
bool
|
bool
|
||||||
CCutsceneShadow::Create(RwObject *object, int32 rasterSize, bool resample, int32 blurPasses, bool gradient)
|
CCutsceneShadow::Create(RwObject *object, int32 rasterSize, bool resample, int32 blurPasses, bool gradient)
|
||||||
{
|
{
|
||||||
ASSERT(object != NULL);
|
ASSERT(object != nil);
|
||||||
|
|
||||||
RwRGBAReal color;
|
RwRGBAReal color;
|
||||||
RwFrame *frame;
|
RwFrame *frame;
|
||||||
|
@ -35,7 +35,7 @@ CCutsceneShadow::Create(RwObject *object, int32 rasterSize, bool resample, int32
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
m_pLight = RpLightCreate(rpLIGHTDIRECTIONAL);
|
m_pLight = RpLightCreate(rpLIGHTDIRECTIONAL);
|
||||||
ASSERT(m_pLight != NULL);
|
ASSERT(m_pLight != nil);
|
||||||
|
|
||||||
if (!m_pLight)
|
if (!m_pLight)
|
||||||
return false;
|
return false;
|
||||||
|
@ -46,7 +46,7 @@ CCutsceneShadow::Create(RwObject *object, int32 rasterSize, bool resample, int32
|
||||||
RpLightSetColor(m_pLight, &color);
|
RpLightSetColor(m_pLight, &color);
|
||||||
|
|
||||||
frame = RwFrameCreate();
|
frame = RwFrameCreate();
|
||||||
ASSERT(frame != NULL);
|
ASSERT(frame != nil);
|
||||||
|
|
||||||
RpLightSetFrame(m_pLight, frame);
|
RpLightSetFrame(m_pLight, frame);
|
||||||
|
|
||||||
|
@ -137,17 +137,17 @@ CCutsceneShadow::Create(RwObject *object, int32 rasterSize, bool resample, int32
|
||||||
RwFrame *
|
RwFrame *
|
||||||
CCutsceneShadow::SetLightProperties(float angleY, float angleX, bool setLight)
|
CCutsceneShadow::SetLightProperties(float angleY, float angleX, bool setLight)
|
||||||
{
|
{
|
||||||
ASSERT(m_pLight != NULL);
|
ASSERT(m_pLight != nil);
|
||||||
|
|
||||||
RwFrame *frame;
|
RwFrame *frame;
|
||||||
static RwV3d Xaxis = { 1.0f, 0.0f, 0.0f };
|
static RwV3d Xaxis = { 1.0f, 0.0f, 0.0f };
|
||||||
static RwV3d Yaxis = { 0.0f, 1.0f, 0.0f };
|
static RwV3d Yaxis = { 0.0f, 1.0f, 0.0f };
|
||||||
|
|
||||||
frame = RpLightGetFrame(m_pLight);
|
frame = RpLightGetFrame(m_pLight);
|
||||||
ASSERT(frame != NULL);
|
ASSERT(frame != nil);
|
||||||
|
|
||||||
if ( !frame )
|
if ( !frame )
|
||||||
return NULL;
|
return nil;
|
||||||
|
|
||||||
RwFrameRotate(frame, &Yaxis, angleY, rwCOMBINEREPLACE);
|
RwFrameRotate(frame, &Yaxis, angleY, rwCOMBINEREPLACE);
|
||||||
RwFrameRotate(frame, &Xaxis, angleX, rwCOMBINEPOSTCONCAT);
|
RwFrameRotate(frame, &Xaxis, angleX, rwCOMBINEPOSTCONCAT);
|
||||||
|
@ -161,7 +161,7 @@ CCutsceneShadow::SetLightProperties(float angleY, float angleX, bool setLight)
|
||||||
bool
|
bool
|
||||||
CCutsceneShadow::IsInitialized()
|
CCutsceneShadow::IsInitialized()
|
||||||
{
|
{
|
||||||
return m_pObject != NULL;
|
return m_pObject != nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -172,17 +172,17 @@ CCutsceneShadow::Destroy()
|
||||||
m_BlurCamera.Destroy();
|
m_BlurCamera.Destroy();
|
||||||
m_GradientCamera.Destroy();
|
m_GradientCamera.Destroy();
|
||||||
|
|
||||||
m_pAtomic = NULL;
|
m_pAtomic = nil;
|
||||||
|
|
||||||
m_nRwObjectType = -1;
|
m_nRwObjectType = -1;
|
||||||
|
|
||||||
if (m_pLight)
|
if (m_pLight)
|
||||||
{
|
{
|
||||||
RwFrame *frame = RpLightGetFrame(m_pLight);
|
RwFrame *frame = RpLightGetFrame(m_pLight);
|
||||||
RpLightSetFrame(m_pLight, NULL);
|
RpLightSetFrame(m_pLight, nil);
|
||||||
RwFrameDestroy(frame);
|
RwFrameDestroy(frame);
|
||||||
RpLightDestroy(m_pLight);
|
RpLightDestroy(m_pLight);
|
||||||
m_pLight = NULL;
|
m_pLight = nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,12 +192,12 @@ CCutsceneShadow::Update()
|
||||||
switch ( m_nRwObjectType )
|
switch ( m_nRwObjectType )
|
||||||
{
|
{
|
||||||
case rpCLUMP:
|
case rpCLUMP:
|
||||||
ASSERT(m_pClump != NULL);
|
ASSERT(m_pClump != nil);
|
||||||
RwV3dTransformPoints(&m_BaseSphere.center, &m_BoundingSphere.center, 1, RwFrameGetMatrix(RpClumpGetFrame(m_pClump)));
|
RwV3dTransformPoints(&m_BaseSphere.center, &m_BoundingSphere.center, 1, RwFrameGetMatrix(RpClumpGetFrame(m_pClump)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case rpATOMIC:
|
case rpATOMIC:
|
||||||
ASSERT(m_pAtomic != NULL);
|
ASSERT(m_pAtomic != nil);
|
||||||
RwV3dTransformPoints(&m_BaseSphere.center, &m_BoundingSphere.center, 1, RwFrameGetMatrix(RpAtomicGetFrame(m_pAtomic)));
|
RwV3dTransformPoints(&m_BaseSphere.center, &m_BoundingSphere.center, 1, RwFrameGetMatrix(RpAtomicGetFrame(m_pAtomic)));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ CCutsceneShadow::Update()
|
||||||
}
|
}
|
||||||
|
|
||||||
RwRaster *raster = m_Camera.GetRwRenderRaster();
|
RwRaster *raster = m_Camera.GetRwRenderRaster();
|
||||||
ASSERT(raster != NULL);
|
ASSERT(raster != nil);
|
||||||
|
|
||||||
if ( m_bResample )
|
if ( m_bResample )
|
||||||
return m_ResampleCamera.RasterResample(raster);
|
return m_ResampleCamera.RasterResample(raster);
|
||||||
|
|
|
@ -16,8 +16,8 @@ RpAtomic *ShadowRenderCallBack(RpAtomic *atomic, void *data)
|
||||||
|
|
||||||
CShadowCamera::CShadowCamera()
|
CShadowCamera::CShadowCamera()
|
||||||
{
|
{
|
||||||
m_pCamera = NULL;
|
m_pCamera = nil;
|
||||||
m_pTexture = NULL;
|
m_pTexture = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
CShadowCamera::~CShadowCamera()
|
CShadowCamera::~CShadowCamera()
|
||||||
|
@ -37,33 +37,33 @@ CShadowCamera::Destroy()
|
||||||
|
|
||||||
if ( frame )
|
if ( frame )
|
||||||
{
|
{
|
||||||
RwCameraSetFrame(m_pCamera, NULL);
|
RwCameraSetFrame(m_pCamera, nil);
|
||||||
RwFrameDestroy(frame);
|
RwFrameDestroy(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
raster = RwCameraGetZRaster(m_pCamera);
|
raster = RwCameraGetZRaster(m_pCamera);
|
||||||
if ( raster )
|
if ( raster )
|
||||||
{
|
{
|
||||||
RwCameraSetZRaster(m_pCamera, NULL);
|
RwCameraSetZRaster(m_pCamera, nil);
|
||||||
RwRasterDestroy(raster);
|
RwRasterDestroy(raster);
|
||||||
}
|
}
|
||||||
|
|
||||||
raster = RwCameraGetRaster(m_pCamera);
|
raster = RwCameraGetRaster(m_pCamera);
|
||||||
if ( raster )
|
if ( raster )
|
||||||
{
|
{
|
||||||
RwCameraSetRaster(m_pCamera, NULL);
|
RwCameraSetRaster(m_pCamera, nil);
|
||||||
RwRasterDestroy(raster);
|
RwRasterDestroy(raster);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_pTexture )
|
if ( m_pTexture )
|
||||||
{
|
{
|
||||||
RwTextureSetRaster(m_pTexture, NULL);
|
RwTextureSetRaster(m_pTexture, nil);
|
||||||
RwTextureDestroy(m_pTexture);
|
RwTextureDestroy(m_pTexture);
|
||||||
m_pTexture = NULL;
|
m_pTexture = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
RwCameraDestroy(m_pCamera);
|
RwCameraDestroy(m_pCamera);
|
||||||
m_pCamera = NULL;
|
m_pCamera = nil;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ CShadowCamera::Create(int32 rasterSize)
|
||||||
int32 size = 1 << rasterSize;
|
int32 size = 1 << rasterSize;
|
||||||
|
|
||||||
m_pCamera = RwCameraCreate();
|
m_pCamera = RwCameraCreate();
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
if ( m_pCamera )
|
if ( m_pCamera )
|
||||||
{
|
{
|
||||||
|
@ -83,20 +83,20 @@ CShadowCamera::Create(int32 rasterSize)
|
||||||
if( RwCameraGetFrame(m_pCamera) )
|
if( RwCameraGetFrame(m_pCamera) )
|
||||||
{
|
{
|
||||||
RwRaster *zRaster = RwRasterCreate(size, size, 0, rwRASTERTYPEZBUFFER);
|
RwRaster *zRaster = RwRasterCreate(size, size, 0, rwRASTERTYPEZBUFFER);
|
||||||
ASSERT(zRaster != NULL);
|
ASSERT(zRaster != nil);
|
||||||
|
|
||||||
if ( zRaster )
|
if ( zRaster )
|
||||||
{
|
{
|
||||||
RwCameraSetZRaster(m_pCamera, zRaster);
|
RwCameraSetZRaster(m_pCamera, zRaster);
|
||||||
|
|
||||||
RwRaster *raster = RwRasterCreate(size, size, 0, rwRASTERTYPECAMERATEXTURE);
|
RwRaster *raster = RwRasterCreate(size, size, 0, rwRASTERTYPECAMERATEXTURE);
|
||||||
ASSERT(raster != NULL);
|
ASSERT(raster != nil);
|
||||||
|
|
||||||
if ( raster )
|
if ( raster )
|
||||||
{
|
{
|
||||||
RwCameraSetRaster(m_pCamera, raster);
|
RwCameraSetRaster(m_pCamera, raster);
|
||||||
m_pTexture = RwTextureCreate(raster);
|
m_pTexture = RwTextureCreate(raster);
|
||||||
ASSERT(m_pTexture != NULL);
|
ASSERT(m_pTexture != nil);
|
||||||
|
|
||||||
if ( m_pTexture )
|
if ( m_pTexture )
|
||||||
{
|
{
|
||||||
|
@ -112,13 +112,13 @@ CShadowCamera::Create(int32 rasterSize)
|
||||||
|
|
||||||
Destroy();
|
Destroy();
|
||||||
|
|
||||||
return (NULL);
|
return (nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
RwCamera *
|
RwCamera *
|
||||||
CShadowCamera::SetFrustum(float objectRadius)
|
CShadowCamera::SetFrustum(float objectRadius)
|
||||||
{
|
{
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
RwV2d vw;
|
RwV2d vw;
|
||||||
|
|
||||||
|
@ -135,8 +135,8 @@ CShadowCamera::SetFrustum(float objectRadius)
|
||||||
RwCamera *
|
RwCamera *
|
||||||
CShadowCamera::SetLight(RpLight *light)
|
CShadowCamera::SetLight(RpLight *light)
|
||||||
{
|
{
|
||||||
ASSERT(light != NULL);
|
ASSERT(light != nil);
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
RwFrame *camFrame = RwCameraGetFrame(m_pCamera);
|
RwFrame *camFrame = RwCameraGetFrame(m_pCamera);
|
||||||
RwMatrix *camMatrix = RwFrameGetMatrix(camFrame);
|
RwMatrix *camMatrix = RwFrameGetMatrix(camFrame);
|
||||||
|
@ -156,8 +156,8 @@ CShadowCamera::SetLight(RpLight *light)
|
||||||
RwCamera *
|
RwCamera *
|
||||||
CShadowCamera::SetCenter(RwV3d *center)
|
CShadowCamera::SetCenter(RwV3d *center)
|
||||||
{
|
{
|
||||||
ASSERT(center != NULL);
|
ASSERT(center != nil);
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
RwFrame *camFrame = RwCameraGetFrame(m_pCamera);
|
RwFrame *camFrame = RwCameraGetFrame(m_pCamera);
|
||||||
RwMatrix *camMatrix = RwFrameGetMatrix(camFrame);
|
RwMatrix *camMatrix = RwFrameGetMatrix(camFrame);
|
||||||
|
@ -176,8 +176,8 @@ CShadowCamera::SetCenter(RwV3d *center)
|
||||||
RwCamera *
|
RwCamera *
|
||||||
CShadowCamera::Update(RpClump *clump)
|
CShadowCamera::Update(RpClump *clump)
|
||||||
{
|
{
|
||||||
ASSERT(clump != NULL);
|
ASSERT(clump != nil);
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
RwUInt32 flags;
|
RwUInt32 flags;
|
||||||
RpGeometry *geometry;
|
RpGeometry *geometry;
|
||||||
|
@ -189,14 +189,14 @@ CShadowCamera::Update(RpClump *clump)
|
||||||
if ( RwCameraBeginUpdate(m_pCamera) )
|
if ( RwCameraBeginUpdate(m_pCamera) )
|
||||||
{
|
{
|
||||||
geometry = GetFirstAtomic(clump)->geometry;
|
geometry = GetFirstAtomic(clump)->geometry;
|
||||||
ASSERT(geometry != NULL);
|
ASSERT(geometry != nil);
|
||||||
|
|
||||||
flags = RpGeometryGetFlags(geometry);
|
flags = RpGeometryGetFlags(geometry);
|
||||||
|
|
||||||
RpGeometrySetFlags(geometry, flags & ~(rpGEOMETRYPRELIT|rpGEOMETRYLIGHT
|
RpGeometrySetFlags(geometry, flags & ~(rpGEOMETRYPRELIT|rpGEOMETRYLIGHT
|
||||||
|rpGEOMETRYTEXTURED|rpGEOMETRYTEXTURED2|rpGEOMETRYMODULATEMATERIALCOLOR));
|
|rpGEOMETRYTEXTURED|rpGEOMETRYTEXTURED2|rpGEOMETRYMODULATEMATERIALCOLOR));
|
||||||
|
|
||||||
RpClumpForAllAtomics(clump, ShadowRenderCallBack, NULL);
|
RpClumpForAllAtomics(clump, ShadowRenderCallBack, nil);
|
||||||
|
|
||||||
RpGeometrySetFlags(geometry, flags);
|
RpGeometrySetFlags(geometry, flags);
|
||||||
|
|
||||||
|
@ -210,8 +210,8 @@ CShadowCamera::Update(RpClump *clump)
|
||||||
RwCamera *
|
RwCamera *
|
||||||
CShadowCamera::Update(RpAtomic *atomic)
|
CShadowCamera::Update(RpAtomic *atomic)
|
||||||
{
|
{
|
||||||
ASSERT(atomic != NULL);
|
ASSERT(atomic != nil);
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
RwUInt32 flags;
|
RwUInt32 flags;
|
||||||
RpGeometry *geometry;
|
RpGeometry *geometry;
|
||||||
|
@ -223,13 +223,13 @@ CShadowCamera::Update(RpAtomic *atomic)
|
||||||
if ( RwCameraBeginUpdate(m_pCamera) )
|
if ( RwCameraBeginUpdate(m_pCamera) )
|
||||||
{
|
{
|
||||||
geometry = RpAtomicGetGeometry(atomic);
|
geometry = RpAtomicGetGeometry(atomic);
|
||||||
ASSERT(geometry != NULL);
|
ASSERT(geometry != nil);
|
||||||
flags = RpGeometryGetFlags(geometry);
|
flags = RpGeometryGetFlags(geometry);
|
||||||
|
|
||||||
RpGeometrySetFlags(geometry, flags & ~(rpGEOMETRYPRELIT|rpGEOMETRYLIGHT
|
RpGeometrySetFlags(geometry, flags & ~(rpGEOMETRYPRELIT|rpGEOMETRYLIGHT
|
||||||
|rpGEOMETRYTEXTURED|rpGEOMETRYTEXTURED2|rpGEOMETRYMODULATEMATERIALCOLOR|rpGEOMETRYNORMALS));
|
|rpGEOMETRYTEXTURED|rpGEOMETRYTEXTURED2|rpGEOMETRYMODULATEMATERIALCOLOR|rpGEOMETRYNORMALS));
|
||||||
|
|
||||||
ShadowRenderCallBack(atomic, NULL);
|
ShadowRenderCallBack(atomic, nil);
|
||||||
|
|
||||||
RpGeometrySetFlags(geometry, flags);
|
RpGeometrySetFlags(geometry, flags);
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ CShadowCamera::Update(RpAtomic *atomic)
|
||||||
void
|
void
|
||||||
CShadowCamera::InvertRaster()
|
CShadowCamera::InvertRaster()
|
||||||
{
|
{
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
RwIm2DVertex vx[4];
|
RwIm2DVertex vx[4];
|
||||||
float crw, crh;
|
float crw, crh;
|
||||||
|
@ -251,7 +251,7 @@ CShadowCamera::InvertRaster()
|
||||||
float recipZ;
|
float recipZ;
|
||||||
|
|
||||||
raster = RwCameraGetRaster(m_pCamera);
|
raster = RwCameraGetRaster(m_pCamera);
|
||||||
ASSERT(raster != NULL);
|
ASSERT(raster != nil);
|
||||||
|
|
||||||
crw = (float)RwRasterGetWidth(raster);
|
crw = (float)RwRasterGetWidth(raster);
|
||||||
crh = (float)RwRasterGetHeight(raster);
|
crh = (float)RwRasterGetHeight(raster);
|
||||||
|
@ -284,7 +284,7 @@ CShadowCamera::InvertRaster()
|
||||||
|
|
||||||
|
|
||||||
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)FALSE);
|
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, (void *)NULL);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, (void *)nil);
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE);
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDINVDESTCOLOR);
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void *)rwBLENDINVDESTCOLOR);
|
||||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDZERO);
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void *)rwBLENDZERO);
|
||||||
|
@ -299,23 +299,23 @@ CShadowCamera::InvertRaster()
|
||||||
RwRaster *
|
RwRaster *
|
||||||
CShadowCamera::MakeGradientRaster()
|
CShadowCamera::MakeGradientRaster()
|
||||||
{
|
{
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
RwIm2DVertex vx[2];
|
RwIm2DVertex vx[2];
|
||||||
|
|
||||||
if ( !m_pCamera )
|
if ( !m_pCamera )
|
||||||
return NULL;
|
return nil;
|
||||||
|
|
||||||
float recipCamZ = 1.0f / RwCameraGetNearClipPlane(m_pCamera);
|
float recipCamZ = 1.0f / RwCameraGetNearClipPlane(m_pCamera);
|
||||||
|
|
||||||
RwRaster *raster = RwCameraGetRaster(m_pCamera);
|
RwRaster *raster = RwCameraGetRaster(m_pCamera);
|
||||||
ASSERT(raster != NULL);
|
ASSERT(raster != nil);
|
||||||
|
|
||||||
float width = (float)RwRasterGetWidth(raster);
|
float width = (float)RwRasterGetWidth(raster);
|
||||||
float height = (float)RwRasterGetHeight(raster);
|
float height = (float)RwRasterGetHeight(raster);
|
||||||
|
|
||||||
if ( height < 1 )
|
if ( height < 1 )
|
||||||
return NULL;
|
return nil;
|
||||||
|
|
||||||
if ( RwCameraBeginUpdate(m_pCamera) )
|
if ( RwCameraBeginUpdate(m_pCamera) )
|
||||||
{
|
{
|
||||||
|
@ -362,14 +362,14 @@ CShadowCamera::MakeGradientRaster()
|
||||||
RwRaster *
|
RwRaster *
|
||||||
CShadowCamera::RasterResample(RwRaster *dstRaster)
|
CShadowCamera::RasterResample(RwRaster *dstRaster)
|
||||||
{
|
{
|
||||||
ASSERT(dstRaster != NULL);
|
ASSERT(dstRaster != nil);
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
if ( !m_pCamera )
|
if ( !m_pCamera )
|
||||||
return NULL;
|
return nil;
|
||||||
|
|
||||||
RwRaster *raster = RwCameraGetRaster(m_pCamera);
|
RwRaster *raster = RwCameraGetRaster(m_pCamera);
|
||||||
ASSERT(raster != NULL);
|
ASSERT(raster != nil);
|
||||||
|
|
||||||
float size = (float) RwRasterGetWidth(raster);
|
float size = (float) RwRasterGetWidth(raster);
|
||||||
float uvOffset = TEXELOFFSET / size;
|
float uvOffset = TEXELOFFSET / size;
|
||||||
|
@ -398,14 +398,14 @@ CShadowCamera::RasterResample(RwRaster *dstRaster)
|
||||||
RwRaster *
|
RwRaster *
|
||||||
CShadowCamera::RasterBlur(RwRaster *dstRaster, int32 numPasses)
|
CShadowCamera::RasterBlur(RwRaster *dstRaster, int32 numPasses)
|
||||||
{
|
{
|
||||||
ASSERT(dstRaster != NULL);
|
ASSERT(dstRaster != nil);
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
if ( !m_pCamera )
|
if ( !m_pCamera )
|
||||||
return NULL;
|
return nil;
|
||||||
|
|
||||||
RwRaster *raster = RwCameraGetRaster(m_pCamera);
|
RwRaster *raster = RwCameraGetRaster(m_pCamera);
|
||||||
ASSERT(raster != NULL);
|
ASSERT(raster != nil);
|
||||||
|
|
||||||
float size = (float) RwRasterGetWidth(dstRaster);
|
float size = (float) RwRasterGetWidth(dstRaster);
|
||||||
float recipCamZ = 1.0f / RwCameraGetNearClipPlane(m_pCamera);
|
float recipCamZ = 1.0f / RwCameraGetNearClipPlane(m_pCamera);
|
||||||
|
@ -455,11 +455,11 @@ CShadowCamera::RasterBlur(RwRaster *dstRaster, int32 numPasses)
|
||||||
RwRaster *
|
RwRaster *
|
||||||
CShadowCamera::RasterGradient(RwRaster *dstRaster)
|
CShadowCamera::RasterGradient(RwRaster *dstRaster)
|
||||||
{
|
{
|
||||||
ASSERT(dstRaster != NULL);
|
ASSERT(dstRaster != nil);
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
RwRaster *raster = RwCameraGetRaster(m_pCamera);
|
RwRaster *raster = RwCameraGetRaster(m_pCamera);
|
||||||
ASSERT(raster != NULL);
|
ASSERT(raster != nil);
|
||||||
|
|
||||||
float size = (float)RwRasterGetWidth(dstRaster);
|
float size = (float)RwRasterGetWidth(dstRaster);
|
||||||
float recipCamZ = 1.0f / RwCameraGetNearClipPlane(m_pCamera);
|
float recipCamZ = 1.0f / RwCameraGetNearClipPlane(m_pCamera);
|
||||||
|
@ -490,13 +490,13 @@ CShadowCamera::RasterGradient(RwRaster *dstRaster)
|
||||||
|
|
||||||
RwRaster *CShadowCamera::DrawOutlineBorder(RwRGBA const& color)
|
RwRaster *CShadowCamera::DrawOutlineBorder(RwRGBA const& color)
|
||||||
{
|
{
|
||||||
ASSERT(m_pCamera != NULL);
|
ASSERT(m_pCamera != nil);
|
||||||
|
|
||||||
RwIm2DVertex vx[4];
|
RwIm2DVertex vx[4];
|
||||||
RwImVertexIndex ix[5];
|
RwImVertexIndex ix[5];
|
||||||
|
|
||||||
RwRaster *raster = RwCameraGetRaster(m_pCamera);
|
RwRaster *raster = RwCameraGetRaster(m_pCamera);
|
||||||
ASSERT(raster != NULL);
|
ASSERT(raster != nil);
|
||||||
|
|
||||||
float size = (float)RwRasterGetWidth(raster) - 1.0f;
|
float size = (float)RwRasterGetWidth(raster) - 1.0f;
|
||||||
float recipCamZ = 1.0f / RwCameraGetNearClipPlane(m_pCamera);
|
float recipCamZ = 1.0f / RwCameraGetNearClipPlane(m_pCamera);
|
||||||
|
@ -535,7 +535,7 @@ RwRaster *CShadowCamera::DrawOutlineBorder(RwRGBA const& color)
|
||||||
{
|
{
|
||||||
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)FALSE);
|
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void *)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE);
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, (void *)NULL);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, (void *)nil);
|
||||||
|
|
||||||
RwIm2DRenderIndexedPrimitive(rwPRIMTYPEPOLYLINE, vx, 4, ix, 5);
|
RwIm2DRenderIndexedPrimitive(rwPRIMTYPEPOLYLINE, vx, 4, ix, 5);
|
||||||
|
|
||||||
|
|
|
@ -66,39 +66,39 @@ CShadows::Init(void)
|
||||||
int32 slut = CTxdStore::FindTxdSlot("particle");
|
int32 slut = CTxdStore::FindTxdSlot("particle");
|
||||||
CTxdStore::SetCurrentTxd(slut);
|
CTxdStore::SetCurrentTxd(slut);
|
||||||
|
|
||||||
gpShadowCarTex = RwTextureRead("shad_car", NULL);
|
gpShadowCarTex = RwTextureRead("shad_car", nil);
|
||||||
gpShadowPedTex = RwTextureRead("shad_ped", NULL);
|
gpShadowPedTex = RwTextureRead("shad_ped", nil);
|
||||||
gpShadowHeliTex = RwTextureRead("shad_heli", NULL);
|
gpShadowHeliTex = RwTextureRead("shad_heli", nil);
|
||||||
gpShadowBikeTex = RwTextureRead("shad_bike", NULL);
|
gpShadowBikeTex = RwTextureRead("shad_bike", nil);
|
||||||
gpShadowBaronTex = RwTextureRead("shad_rcbaron", NULL);
|
gpShadowBaronTex = RwTextureRead("shad_rcbaron", nil);
|
||||||
gpShadowExplosionTex = RwTextureRead("shad_exp", NULL);
|
gpShadowExplosionTex = RwTextureRead("shad_exp", nil);
|
||||||
gpShadowHeadLightsTex = RwTextureRead("headlight", NULL);
|
gpShadowHeadLightsTex = RwTextureRead("headlight", nil);
|
||||||
gpOutline1Tex = RwTextureRead("outline_64", NULL);
|
gpOutline1Tex = RwTextureRead("outline_64", nil);
|
||||||
gpOutline2Tex = RwTextureRead("outline2_64", NULL);
|
gpOutline2Tex = RwTextureRead("outline2_64", nil);
|
||||||
gpOutline3Tex = RwTextureRead("outline3_64", NULL);
|
gpOutline3Tex = RwTextureRead("outline3_64", nil);
|
||||||
gpBloodPoolTex = RwTextureRead("bloodpool_64", NULL);
|
gpBloodPoolTex = RwTextureRead("bloodpool_64", nil);
|
||||||
gpReflectionTex = RwTextureRead("reflection01", NULL);
|
gpReflectionTex = RwTextureRead("reflection01", nil);
|
||||||
gpWalkDontTex = RwTextureRead("walk_dont", NULL);
|
gpWalkDontTex = RwTextureRead("walk_dont", nil);
|
||||||
gpCrackedGlassTex = RwTextureRead("wincrack_32", NULL);
|
gpCrackedGlassTex = RwTextureRead("wincrack_32", nil);
|
||||||
gpPostShadowTex = RwTextureRead("lamp_shad_64", NULL);
|
gpPostShadowTex = RwTextureRead("lamp_shad_64", nil);
|
||||||
|
|
||||||
CTxdStore::PopCurrentTxd();
|
CTxdStore::PopCurrentTxd();
|
||||||
|
|
||||||
ASSERT(gpShadowCarTex != NULL);
|
ASSERT(gpShadowCarTex != nil);
|
||||||
ASSERT(gpShadowPedTex != NULL);
|
ASSERT(gpShadowPedTex != nil);
|
||||||
ASSERT(gpShadowHeliTex != NULL);
|
ASSERT(gpShadowHeliTex != nil);
|
||||||
ASSERT(gpShadowBikeTex != NULL);
|
ASSERT(gpShadowBikeTex != nil);
|
||||||
ASSERT(gpShadowBaronTex != NULL);
|
ASSERT(gpShadowBaronTex != nil);
|
||||||
ASSERT(gpShadowExplosionTex != NULL);
|
ASSERT(gpShadowExplosionTex != nil);
|
||||||
ASSERT(gpShadowHeadLightsTex != NULL);
|
ASSERT(gpShadowHeadLightsTex != nil);
|
||||||
ASSERT(gpOutline1Tex != NULL);
|
ASSERT(gpOutline1Tex != nil);
|
||||||
ASSERT(gpOutline2Tex != NULL);
|
ASSERT(gpOutline2Tex != nil);
|
||||||
ASSERT(gpOutline3Tex != NULL);
|
ASSERT(gpOutline3Tex != nil);
|
||||||
ASSERT(gpBloodPoolTex != NULL);
|
ASSERT(gpBloodPoolTex != nil);
|
||||||
ASSERT(gpReflectionTex != NULL);
|
ASSERT(gpReflectionTex != nil);
|
||||||
ASSERT(gpWalkDontTex != NULL);
|
ASSERT(gpWalkDontTex != nil);
|
||||||
ASSERT(gpCrackedGlassTex != NULL);
|
ASSERT(gpCrackedGlassTex != nil);
|
||||||
ASSERT(gpPostShadowTex != NULL);
|
ASSERT(gpPostShadowTex != nil);
|
||||||
|
|
||||||
|
|
||||||
ShadowIndexList[0] = 0;
|
ShadowIndexList[0] = 0;
|
||||||
|
@ -137,7 +137,7 @@ CShadows::Init(void)
|
||||||
for ( int32 i = 0; i < MAX_STATICSHADOWS; i++ )
|
for ( int32 i = 0; i < MAX_STATICSHADOWS; i++ )
|
||||||
{
|
{
|
||||||
aStaticShadows[i].m_nId = 0;
|
aStaticShadows[i].m_nId = 0;
|
||||||
aStaticShadows[i].m_pPolyBunch = NULL;
|
aStaticShadows[i].m_pPolyBunch = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
pEmptyBunchList = &aPolyBunches[0];
|
pEmptyBunchList = &aPolyBunches[0];
|
||||||
|
@ -145,7 +145,7 @@ CShadows::Init(void)
|
||||||
for ( int32 i = 0; i < MAX_POLYBUNCHES; i++ )
|
for ( int32 i = 0; i < MAX_POLYBUNCHES; i++ )
|
||||||
{
|
{
|
||||||
if ( i == MAX_POLYBUNCHES - 1 )
|
if ( i == MAX_POLYBUNCHES - 1 )
|
||||||
aPolyBunches[i].m_pNext = NULL;
|
aPolyBunches[i].m_pNext = nil;
|
||||||
else
|
else
|
||||||
aPolyBunches[i].m_pNext = &aPolyBunches[i + 1];
|
aPolyBunches[i].m_pNext = &aPolyBunches[i + 1];
|
||||||
}
|
}
|
||||||
|
@ -159,21 +159,21 @@ CShadows::Init(void)
|
||||||
void
|
void
|
||||||
CShadows::Shutdown(void)
|
CShadows::Shutdown(void)
|
||||||
{
|
{
|
||||||
ASSERT(gpShadowCarTex != NULL);
|
ASSERT(gpShadowCarTex != nil);
|
||||||
ASSERT(gpShadowPedTex != NULL);
|
ASSERT(gpShadowPedTex != nil);
|
||||||
ASSERT(gpShadowHeliTex != NULL);
|
ASSERT(gpShadowHeliTex != nil);
|
||||||
ASSERT(gpShadowBikeTex != NULL);
|
ASSERT(gpShadowBikeTex != nil);
|
||||||
ASSERT(gpShadowBaronTex != NULL);
|
ASSERT(gpShadowBaronTex != nil);
|
||||||
ASSERT(gpShadowExplosionTex != NULL);
|
ASSERT(gpShadowExplosionTex != nil);
|
||||||
ASSERT(gpShadowHeadLightsTex != NULL);
|
ASSERT(gpShadowHeadLightsTex != nil);
|
||||||
ASSERT(gpOutline1Tex != NULL);
|
ASSERT(gpOutline1Tex != nil);
|
||||||
ASSERT(gpOutline2Tex != NULL);
|
ASSERT(gpOutline2Tex != nil);
|
||||||
ASSERT(gpOutline3Tex != NULL);
|
ASSERT(gpOutline3Tex != nil);
|
||||||
ASSERT(gpBloodPoolTex != NULL);
|
ASSERT(gpBloodPoolTex != nil);
|
||||||
ASSERT(gpReflectionTex != NULL);
|
ASSERT(gpReflectionTex != nil);
|
||||||
ASSERT(gpWalkDontTex != NULL);
|
ASSERT(gpWalkDontTex != nil);
|
||||||
ASSERT(gpCrackedGlassTex != NULL);
|
ASSERT(gpCrackedGlassTex != nil);
|
||||||
ASSERT(gpPostShadowTex != NULL);
|
ASSERT(gpPostShadowTex != nil);
|
||||||
|
|
||||||
RwTextureDestroy(gpShadowCarTex);
|
RwTextureDestroy(gpShadowCarTex);
|
||||||
RwTextureDestroy(gpShadowPedTex);
|
RwTextureDestroy(gpShadowPedTex);
|
||||||
|
@ -198,8 +198,8 @@ CShadows::AddPermanentShadow(uint8 ShadowType, RwTexture *pTexture, CVector *pPo
|
||||||
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
||||||
float fZDistance, uint32 nTime, float fScale)
|
float fZDistance, uint32 nTime, float fScale)
|
||||||
{
|
{
|
||||||
ASSERT(pTexture != NULL);
|
ASSERT(pTexture != nil);
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
|
|
||||||
|
|
||||||
// find free slot
|
// find free slot
|
||||||
|
@ -232,7 +232,7 @@ CShadows::StoreStaticShadow(uint32 nID, uint8 ShadowType, RwTexture *pTexture, C
|
||||||
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
||||||
float fZDistance, float fScale, float fDrawDistance, bool bTempShadow, float fUpDistance)
|
float fZDistance, float fScale, float fDrawDistance, bool bTempShadow, float fUpDistance)
|
||||||
{
|
{
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
|
|
||||||
float fDistToCamSqr = (*pPosn - TheCamera.GetPosition()).MagnitudeSqr2D();
|
float fDistToCamSqr = (*pPosn - TheCamera.GetPosition()).MagnitudeSqr2D();
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ CShadows::StoreStaticShadow(uint32 nID, uint8 ShadowType, RwTexture *pTexture, C
|
||||||
int32 nSlot;
|
int32 nSlot;
|
||||||
|
|
||||||
nSlot = 0;
|
nSlot = 0;
|
||||||
while ( nSlot < MAX_STATICSHADOWS && !(nID == aStaticShadows[nSlot].m_nId && aStaticShadows[nSlot].m_pPolyBunch != NULL) )
|
while ( nSlot < MAX_STATICSHADOWS && !(nID == aStaticShadows[nSlot].m_nId && aStaticShadows[nSlot].m_pPolyBunch != nil) )
|
||||||
nSlot++;
|
nSlot++;
|
||||||
|
|
||||||
if ( nSlot < MAX_STATICSHADOWS )
|
if ( nSlot < MAX_STATICSHADOWS )
|
||||||
|
@ -325,13 +325,13 @@ CShadows::StoreStaticShadow(uint32 nID, uint8 ShadowType, RwTexture *pTexture, C
|
||||||
|
|
||||||
GeneratePolysForStaticShadow(nSlot);
|
GeneratePolysForStaticShadow(nSlot);
|
||||||
|
|
||||||
return aStaticShadows[nSlot].m_pPolyBunch != NULL;
|
return aStaticShadows[nSlot].m_pPolyBunch != nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nSlot = 0;
|
nSlot = 0;
|
||||||
while ( nSlot < MAX_STATICSHADOWS && aStaticShadows[nSlot].m_pPolyBunch != NULL )
|
while ( nSlot < MAX_STATICSHADOWS && aStaticShadows[nSlot].m_pPolyBunch != nil )
|
||||||
nSlot++;
|
nSlot++;
|
||||||
|
|
||||||
if ( nSlot != MAX_STATICSHADOWS )
|
if ( nSlot != MAX_STATICSHADOWS )
|
||||||
|
@ -356,7 +356,7 @@ CShadows::StoreStaticShadow(uint32 nID, uint8 ShadowType, RwTexture *pTexture, C
|
||||||
|
|
||||||
GeneratePolysForStaticShadow(nSlot);
|
GeneratePolysForStaticShadow(nSlot);
|
||||||
|
|
||||||
return aStaticShadows[nSlot].m_pPolyBunch != NULL;
|
return aStaticShadows[nSlot].m_pPolyBunch != nil;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,7 +369,7 @@ CShadows::StoreShadowToBeRendered(uint8 ShadowTexture, CVector *pPosn,
|
||||||
float fFrontX, float fFrontY, float fSideX, float fSideY,
|
float fFrontX, float fFrontY, float fSideX, float fSideY,
|
||||||
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue)
|
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue)
|
||||||
{
|
{
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
|
|
||||||
switch ( ShadowTexture )
|
switch ( ShadowTexture )
|
||||||
{
|
{
|
||||||
|
@ -383,7 +383,7 @@ CShadows::StoreShadowToBeRendered(uint8 ShadowTexture, CVector *pPosn,
|
||||||
StoreShadowToBeRendered(SHADOWTYPE_DARK, gpShadowCarTex, pPosn,
|
StoreShadowToBeRendered(SHADOWTYPE_DARK, gpShadowCarTex, pPosn,
|
||||||
fFrontX, fFrontY, fSideX, fSideY,
|
fFrontX, fFrontY, fSideX, fSideY,
|
||||||
nIntensity, nRed, nGreen, nBlue,
|
nIntensity, nRed, nGreen, nBlue,
|
||||||
15.0f, false, 1.0f, NULL, false);
|
15.0f, false, 1.0f, nil, false);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -393,7 +393,7 @@ CShadows::StoreShadowToBeRendered(uint8 ShadowTexture, CVector *pPosn,
|
||||||
StoreShadowToBeRendered(SHADOWTYPE_DARK, gpShadowPedTex, pPosn,
|
StoreShadowToBeRendered(SHADOWTYPE_DARK, gpShadowPedTex, pPosn,
|
||||||
fFrontX, fFrontY, fSideX, fSideY,
|
fFrontX, fFrontY, fSideX, fSideY,
|
||||||
nIntensity, nRed, nGreen, nBlue,
|
nIntensity, nRed, nGreen, nBlue,
|
||||||
15.0f, false, 1.0f, NULL, false);
|
15.0f, false, 1.0f, nil, false);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -403,7 +403,7 @@ CShadows::StoreShadowToBeRendered(uint8 ShadowTexture, CVector *pPosn,
|
||||||
StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, pPosn,
|
StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, pPosn,
|
||||||
fFrontX, fFrontY, fSideX, fSideY,
|
fFrontX, fFrontY, fSideX, fSideY,
|
||||||
nIntensity, nRed, nGreen, nBlue,
|
nIntensity, nRed, nGreen, nBlue,
|
||||||
15.0f, false, 1.0f, NULL, false);
|
15.0f, false, 1.0f, nil, false);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -413,7 +413,7 @@ CShadows::StoreShadowToBeRendered(uint8 ShadowTexture, CVector *pPosn,
|
||||||
StoreShadowToBeRendered(SHADOWTYPE_DARK, gpShadowHeliTex, pPosn,
|
StoreShadowToBeRendered(SHADOWTYPE_DARK, gpShadowHeliTex, pPosn,
|
||||||
fFrontX, fFrontY, fSideX, fSideY,
|
fFrontX, fFrontY, fSideX, fSideY,
|
||||||
nIntensity, nRed, nGreen, nBlue,
|
nIntensity, nRed, nGreen, nBlue,
|
||||||
15.0f, false, 1.0f, NULL, false);
|
15.0f, false, 1.0f, nil, false);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -423,7 +423,7 @@ CShadows::StoreShadowToBeRendered(uint8 ShadowTexture, CVector *pPosn,
|
||||||
StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowHeadLightsTex, pPosn,
|
StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowHeadLightsTex, pPosn,
|
||||||
fFrontX, fFrontY, fSideX, fSideY,
|
fFrontX, fFrontY, fSideX, fSideY,
|
||||||
nIntensity, nRed, nGreen, nBlue,
|
nIntensity, nRed, nGreen, nBlue,
|
||||||
15.0f, false, 1.0f, NULL, false);
|
15.0f, false, 1.0f, nil, false);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -433,7 +433,7 @@ CShadows::StoreShadowToBeRendered(uint8 ShadowTexture, CVector *pPosn,
|
||||||
StoreShadowToBeRendered(SHADOWTYPE_DARK, gpBloodPoolTex, pPosn,
|
StoreShadowToBeRendered(SHADOWTYPE_DARK, gpBloodPoolTex, pPosn,
|
||||||
fFrontX, fFrontY, fSideX, fSideY,
|
fFrontX, fFrontY, fSideX, fSideY,
|
||||||
nIntensity, nRed, 150, 0,
|
nIntensity, nRed, 150, 0,
|
||||||
15.0f, false, 1.0f, NULL, false);
|
15.0f, false, 1.0f, nil, false);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -448,8 +448,8 @@ CShadows::StoreShadowToBeRendered(uint8 ShadowType, RwTexture *pTexture, CVector
|
||||||
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
||||||
float fZDistance, bool bDrawOnWater, float fScale, CCutsceneShadow *pShadow, bool bDrawOnBuildings)
|
float fZDistance, bool bDrawOnWater, float fScale, CCutsceneShadow *pShadow, bool bDrawOnBuildings)
|
||||||
{
|
{
|
||||||
ASSERT(pTexture != NULL);
|
ASSERT(pTexture != nil);
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
|
|
||||||
if ( ShadowsStoredToBeRendered < MAX_STOREDSHADOWS )
|
if ( ShadowsStoredToBeRendered < MAX_STOREDSHADOWS )
|
||||||
{
|
{
|
||||||
|
@ -478,7 +478,7 @@ CShadows::StoreShadowToBeRendered(uint8 ShadowType, RwTexture *pTexture, CVector
|
||||||
void
|
void
|
||||||
CShadows::StoreShadowForVehicle(CVehicle *pCar, VEH_SHD_TYPE type)
|
CShadows::StoreShadowForVehicle(CVehicle *pCar, VEH_SHD_TYPE type)
|
||||||
{
|
{
|
||||||
ASSERT(pCar != NULL);
|
ASSERT(pCar != nil);
|
||||||
|
|
||||||
if ( CTimeCycle::GetShadowStrength() != 0 )
|
if ( CTimeCycle::GetShadowStrength() != 0 )
|
||||||
{
|
{
|
||||||
|
@ -672,7 +672,7 @@ CShadows::StoreShadowForVehicle(CVehicle *pCar, VEH_SHD_TYPE type)
|
||||||
sidex * (fVehicleWidth / 2),
|
sidex * (fVehicleWidth / 2),
|
||||||
sidey * (fVehicleWidth / 2),
|
sidey * (fVehicleWidth / 2),
|
||||||
nColorStrength, nColorStrength, nColorStrength, nColorStrength,
|
nColorStrength, nColorStrength, nColorStrength, nColorStrength,
|
||||||
4.5f, false, 1.0f, NULL, bDrawOnBuildings);
|
4.5f, false, 1.0f, nil, bDrawOnBuildings);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -682,7 +682,7 @@ CShadows::StoreShadowForVehicle(CVehicle *pCar, VEH_SHD_TYPE type)
|
||||||
-sidex * (fVehicleWidth / 2),
|
-sidex * (fVehicleWidth / 2),
|
||||||
-sidey * (fVehicleWidth / 2),
|
-sidey * (fVehicleWidth / 2),
|
||||||
nColorStrength, nColorStrength, nColorStrength, nColorStrength,
|
nColorStrength, nColorStrength, nColorStrength, nColorStrength,
|
||||||
4.5f, false, 1.0f, NULL, bDrawOnBuildings);
|
4.5f, false, 1.0f, nil, bDrawOnBuildings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -717,8 +717,8 @@ CShadows::StoreCarLightShadow(CAutomobile *pCar, int32 nID, RwTexture *pTexture,
|
||||||
float fFrontX, float fFrontY, float fSideX, float fSideY, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
float fFrontX, float fFrontY, float fSideX, float fSideY, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
||||||
float fMaxViewAngle)
|
float fMaxViewAngle)
|
||||||
{
|
{
|
||||||
ASSERT(pCar != NULL);
|
ASSERT(pCar != nil);
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
|
|
||||||
float fDistToCamSqr = (*pPosn - TheCamera.GetPosition()).MagnitudeSqr2D();
|
float fDistToCamSqr = (*pPosn - TheCamera.GetPosition()).MagnitudeSqr2D();
|
||||||
|
|
||||||
|
@ -753,7 +753,7 @@ CShadows::StoreCarLightShadow(CAutomobile *pCar, int32 nID, RwTexture *pTexture,
|
||||||
fSideX, fSideY,
|
fSideX, fSideY,
|
||||||
128, nRed, nGreen, nBlue,
|
128, nRed, nGreen, nBlue,
|
||||||
6.0f, false, 1.0f,
|
6.0f, false, 1.0f,
|
||||||
NULL, pCar == FindPlayerVehicle());
|
nil, pCar == FindPlayerVehicle());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -774,11 +774,11 @@ void
|
||||||
StoreShadowForCutscenePedObject(CPed *pObject, float fDisplacementX, float fDisplacementY,
|
StoreShadowForCutscenePedObject(CPed *pObject, float fDisplacementX, float fDisplacementY,
|
||||||
float fFrontX, float fFrontY, float fSideX, float fSideY)
|
float fFrontX, float fFrontY, float fSideX, float fSideY)
|
||||||
{
|
{
|
||||||
ASSERT(pObject != NULL);
|
ASSERT(pObject != nil);
|
||||||
|
|
||||||
CCutsceneShadow *shadow = pObject->m_pRTShadow;
|
CCutsceneShadow *shadow = pObject->m_pRTShadow;
|
||||||
|
|
||||||
if ( shadow == NULL )
|
if ( shadow == nil )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( !shadow->IsInitialized() )
|
if ( !shadow->IsInitialized() )
|
||||||
|
@ -845,7 +845,7 @@ void
|
||||||
CShadows::StoreShadowForPed(CPed *pPed, float fDisplacementX, float fDisplacementY,
|
CShadows::StoreShadowForPed(CPed *pPed, float fDisplacementX, float fDisplacementY,
|
||||||
float fFrontX, float fFrontY, float fSideX, float fSideY)
|
float fFrontX, float fFrontY, float fSideX, float fSideY)
|
||||||
{
|
{
|
||||||
ASSERT(pPed != NULL);
|
ASSERT(pPed != nil);
|
||||||
|
|
||||||
if ( pPed->bIsVisible )
|
if ( pPed->bIsVisible )
|
||||||
{
|
{
|
||||||
|
@ -879,7 +879,7 @@ void
|
||||||
CShadows::StoreShadowForPedObject(CEntity *pPedObject, float fDisplacementX, float fDisplacementY,
|
CShadows::StoreShadowForPedObject(CEntity *pPedObject, float fDisplacementX, float fDisplacementY,
|
||||||
float fFrontX, float fFrontY, float fSideX, float fSideY)
|
float fFrontX, float fFrontY, float fSideX, float fSideY)
|
||||||
{
|
{
|
||||||
ASSERT(pPedObject != NULL);
|
ASSERT(pPedObject != nil);
|
||||||
|
|
||||||
CVector PedPos = pPedObject->GetPosition();
|
CVector PedPos = pPedObject->GetPosition();
|
||||||
|
|
||||||
|
@ -910,7 +910,7 @@ CShadows::StoreShadowForPedObject(CEntity *pPedObject, float fDisplacementX, flo
|
||||||
fFrontX, fFrontY,
|
fFrontX, fFrontY,
|
||||||
fSideX, fSideY,
|
fSideX, fSideY,
|
||||||
nColorStrength, nColorStrength, nColorStrength, nColorStrength,
|
nColorStrength, nColorStrength, nColorStrength, nColorStrength,
|
||||||
4.0f, false, 1.0f, NULL, pPedObject == FindPlayerPed());
|
4.0f, false, 1.0f, nil, pPedObject == FindPlayerPed());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -920,11 +920,11 @@ void
|
||||||
CShadows::StoreShadowForCutscenePedObject(CCutsceneObject *pObject, float fDisplacementX, float fDisplacementY,
|
CShadows::StoreShadowForCutscenePedObject(CCutsceneObject *pObject, float fDisplacementX, float fDisplacementY,
|
||||||
float fFrontX, float fFrontY, float fSideX, float fSideY)
|
float fFrontX, float fFrontY, float fSideX, float fSideY)
|
||||||
{
|
{
|
||||||
ASSERT(pObject != NULL);
|
ASSERT(pObject != nil);
|
||||||
|
|
||||||
CCutsceneShadow *shadow = pObject->m_pShadow;
|
CCutsceneShadow *shadow = pObject->m_pShadow;
|
||||||
|
|
||||||
if ( shadow == NULL )
|
if ( shadow == nil )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( !shadow->IsInitialized() )
|
if ( !shadow->IsInitialized() )
|
||||||
|
@ -988,7 +988,7 @@ CShadows::StoreShadowForCutscenePedObject(CCutsceneObject *pObject, float fDispl
|
||||||
void
|
void
|
||||||
CShadows::StoreShadowForTree(CEntity *pTree)
|
CShadows::StoreShadowForTree(CEntity *pTree)
|
||||||
{
|
{
|
||||||
ASSERT(pTree != NULL);
|
ASSERT(pTree != nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -996,7 +996,7 @@ void
|
||||||
CShadows::StoreShadowForPole(CEntity *pPole, float fOffsetX, float fOffsetY, float fOffsetZ,
|
CShadows::StoreShadowForPole(CEntity *pPole, float fOffsetX, float fOffsetY, float fOffsetZ,
|
||||||
float fPoleHeight, float fPoleWidth, uint32 nID)
|
float fPoleHeight, float fPoleWidth, uint32 nID)
|
||||||
{
|
{
|
||||||
ASSERT(pPole != NULL);
|
ASSERT(pPole != nil);
|
||||||
|
|
||||||
if ( CTimeCycle::GetShadowStrength() != 0 )
|
if ( CTimeCycle::GetShadowStrength() != 0 )
|
||||||
{
|
{
|
||||||
|
@ -1073,7 +1073,7 @@ CShadows::RenderStoredShadows(void)
|
||||||
{
|
{
|
||||||
SetRenderModeForShadowType(asShadowsStored[i].m_ShadowType);
|
SetRenderModeForShadowType(asShadowsStored[i].m_ShadowType);
|
||||||
|
|
||||||
ASSERT(asShadowsStored[i].m_pTexture != NULL);
|
ASSERT(asShadowsStored[i].m_pTexture != nil);
|
||||||
|
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(asShadowsStored[i].m_pTexture));
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(asShadowsStored[i].m_pTexture));
|
||||||
|
|
||||||
|
@ -1105,7 +1105,7 @@ CShadows::RenderStoredShadows(void)
|
||||||
{
|
{
|
||||||
CSector *pCurSector = CWorld::GetSector(x, y);
|
CSector *pCurSector = CWorld::GetSector(x, y);
|
||||||
|
|
||||||
ASSERT(pCurSector != NULL);
|
ASSERT(pCurSector != nil);
|
||||||
|
|
||||||
if ( asShadowsStored[j].m_pCutsceneShadow )
|
if ( asShadowsStored[j].m_pCutsceneShadow )
|
||||||
{
|
{
|
||||||
|
@ -1123,7 +1123,7 @@ CShadows::RenderStoredShadows(void)
|
||||||
asShadowsStored[j].m_nBlue,
|
asShadowsStored[j].m_nBlue,
|
||||||
asShadowsStored[j].m_fZDistance,
|
asShadowsStored[j].m_fZDistance,
|
||||||
asShadowsStored[j].m_fScale,
|
asShadowsStored[j].m_fScale,
|
||||||
NULL,
|
nil,
|
||||||
asShadowsStored[j].m_pCutsceneShadow);
|
asShadowsStored[j].m_pCutsceneShadow);
|
||||||
|
|
||||||
CastCutsceneShadowSectorList(pCurSector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP],
|
CastCutsceneShadowSectorList(pCurSector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP],
|
||||||
|
@ -1140,7 +1140,7 @@ CShadows::RenderStoredShadows(void)
|
||||||
asShadowsStored[j].m_nBlue,
|
asShadowsStored[j].m_nBlue,
|
||||||
asShadowsStored[j].m_fZDistance,
|
asShadowsStored[j].m_fZDistance,
|
||||||
asShadowsStored[j].m_fScale,
|
asShadowsStored[j].m_fScale,
|
||||||
NULL,
|
nil,
|
||||||
asShadowsStored[j].m_pCutsceneShadow);
|
asShadowsStored[j].m_pCutsceneShadow);
|
||||||
}
|
}
|
||||||
else if ( asShadowsStored[j].m_nFlags.bDrawOnBuildings )
|
else if ( asShadowsStored[j].m_nFlags.bDrawOnBuildings )
|
||||||
|
@ -1159,7 +1159,7 @@ CShadows::RenderStoredShadows(void)
|
||||||
asShadowsStored[j].m_nBlue,
|
asShadowsStored[j].m_nBlue,
|
||||||
asShadowsStored[j].m_fZDistance,
|
asShadowsStored[j].m_fZDistance,
|
||||||
asShadowsStored[j].m_fScale,
|
asShadowsStored[j].m_fScale,
|
||||||
NULL);
|
nil);
|
||||||
|
|
||||||
CastPlayerShadowSectorList(pCurSector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP],
|
CastPlayerShadowSectorList(pCurSector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP],
|
||||||
fStartX, fStartY,
|
fStartX, fStartY,
|
||||||
|
@ -1175,7 +1175,7 @@ CShadows::RenderStoredShadows(void)
|
||||||
asShadowsStored[j].m_nBlue,
|
asShadowsStored[j].m_nBlue,
|
||||||
asShadowsStored[j].m_fZDistance,
|
asShadowsStored[j].m_fZDistance,
|
||||||
asShadowsStored[j].m_fScale,
|
asShadowsStored[j].m_fScale,
|
||||||
NULL);
|
nil);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1193,7 +1193,7 @@ CShadows::RenderStoredShadows(void)
|
||||||
asShadowsStored[j].m_nBlue,
|
asShadowsStored[j].m_nBlue,
|
||||||
asShadowsStored[j].m_fZDistance,
|
asShadowsStored[j].m_fZDistance,
|
||||||
asShadowsStored[j].m_fScale,
|
asShadowsStored[j].m_fScale,
|
||||||
NULL);
|
nil);
|
||||||
|
|
||||||
CastShadowSectorList(pCurSector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP],
|
CastShadowSectorList(pCurSector->m_lists[ENTITYLIST_BUILDINGS_OVERLAP],
|
||||||
fStartX, fStartY,
|
fStartX, fStartY,
|
||||||
|
@ -1209,7 +1209,7 @@ CShadows::RenderStoredShadows(void)
|
||||||
asShadowsStored[j].m_nBlue,
|
asShadowsStored[j].m_nBlue,
|
||||||
asShadowsStored[j].m_fZDistance,
|
asShadowsStored[j].m_fZDistance,
|
||||||
asShadowsStored[j].m_fScale,
|
asShadowsStored[j].m_fScale,
|
||||||
NULL);
|
nil);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1254,19 +1254,19 @@ CShadows::RenderStaticShadows(void)
|
||||||
// optimization trick, render all shadows with same renderstate and texture
|
// optimization trick, render all shadows with same renderstate and texture
|
||||||
for ( int32 j = i; j < MAX_STATICSHADOWS; j++ )
|
for ( int32 j = i; j < MAX_STATICSHADOWS; j++ )
|
||||||
{
|
{
|
||||||
if ( aStaticShadows[j].m_pPolyBunch != NULL
|
if ( aStaticShadows[j].m_pPolyBunch != nil
|
||||||
&& aStaticShadows[i].m_nType == aStaticShadows[j].m_nType
|
&& aStaticShadows[i].m_nType == aStaticShadows[j].m_nType
|
||||||
&& aStaticShadows[i].m_pTexture == aStaticShadows[j].m_pTexture )
|
&& aStaticShadows[i].m_pTexture == aStaticShadows[j].m_pTexture )
|
||||||
{
|
{
|
||||||
for ( CPolyBunch *bunch = aStaticShadows[j].m_pPolyBunch; bunch != NULL; bunch = bunch->m_pNext )
|
for ( CPolyBunch *bunch = aStaticShadows[j].m_pPolyBunch; bunch != nil; bunch = bunch->m_pNext )
|
||||||
{
|
{
|
||||||
RwImVertexIndex *pIndexes;
|
RwImVertexIndex *pIndexes;
|
||||||
RwIm3DVertex *pVerts;
|
RwIm3DVertex *pVerts;
|
||||||
|
|
||||||
RenderBuffer::StartStoring(3 * (bunch->m_nNumVerts - 2), bunch->m_nNumVerts, &pIndexes, &pVerts);
|
RenderBuffer::StartStoring(3 * (bunch->m_nNumVerts - 2), bunch->m_nNumVerts, &pIndexes, &pVerts);
|
||||||
|
|
||||||
ASSERT(pIndexes != NULL);
|
ASSERT(pIndexes != nil);
|
||||||
ASSERT(pVerts != NULL);
|
ASSERT(pVerts != nil);
|
||||||
|
|
||||||
for ( int32 k = 0; k < bunch->m_nNumVerts; k++ )
|
for ( int32 k = 0; k < bunch->m_nNumVerts; k++ )
|
||||||
{
|
{
|
||||||
|
@ -1326,7 +1326,7 @@ CShadows::GeneratePolysForStaticShadow(int16 nStaticShadowID)
|
||||||
{
|
{
|
||||||
CSector *pCurSector = CWorld::GetSector(x, y);
|
CSector *pCurSector = CWorld::GetSector(x, y);
|
||||||
|
|
||||||
ASSERT(pCurSector != NULL);
|
ASSERT(pCurSector != nil);
|
||||||
|
|
||||||
CastShadowSectorList(pCurSector->m_lists[ENTITYLIST_BUILDINGS],
|
CastShadowSectorList(pCurSector->m_lists[ENTITYLIST_BUILDINGS],
|
||||||
fStartX, fStartY,
|
fStartX, fStartY,
|
||||||
|
@ -1364,19 +1364,19 @@ CShadows::CastShadowSectorList(CPtrList &PtrList, float fStartX, float fStartY,
|
||||||
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
||||||
float fZDistance, float fScale, CPolyBunch **ppPolyBunch)
|
float fZDistance, float fScale, CPolyBunch **ppPolyBunch)
|
||||||
{
|
{
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
|
|
||||||
CPtrNode *pNode = PtrList.first;
|
CPtrNode *pNode = PtrList.first;
|
||||||
|
|
||||||
CRect Bound;
|
CRect Bound;
|
||||||
|
|
||||||
while ( pNode != NULL )
|
while ( pNode != nil )
|
||||||
{
|
{
|
||||||
CEntity *pEntity = (CEntity *)pNode->item;
|
CEntity *pEntity = (CEntity *)pNode->item;
|
||||||
uint16 nScanCode = pEntity->m_scanCode;
|
uint16 nScanCode = pEntity->m_scanCode;
|
||||||
pNode = pNode->next;
|
pNode = pNode->next;
|
||||||
|
|
||||||
ASSERT( pEntity != NULL );
|
ASSERT( pEntity != nil );
|
||||||
|
|
||||||
if ( nScanCode != CWorld::GetCurrentScanCode() )
|
if ( nScanCode != CWorld::GetCurrentScanCode() )
|
||||||
{
|
{
|
||||||
|
@ -1419,19 +1419,19 @@ CShadows::CastPlayerShadowSectorList(CPtrList &PtrList, float fStartX, float fSt
|
||||||
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
||||||
float fZDistance, float fScale, CPolyBunch **ppPolyBunch)
|
float fZDistance, float fScale, CPolyBunch **ppPolyBunch)
|
||||||
{
|
{
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
|
|
||||||
CPtrNode *pNode = PtrList.first;
|
CPtrNode *pNode = PtrList.first;
|
||||||
|
|
||||||
CRect Bound;
|
CRect Bound;
|
||||||
|
|
||||||
while ( pNode != NULL )
|
while ( pNode != nil )
|
||||||
{
|
{
|
||||||
CEntity *pEntity = (CEntity *)pNode->item;
|
CEntity *pEntity = (CEntity *)pNode->item;
|
||||||
uint16 nScanCode = pEntity->m_scanCode;
|
uint16 nScanCode = pEntity->m_scanCode;
|
||||||
pNode = pNode->next;
|
pNode = pNode->next;
|
||||||
|
|
||||||
ASSERT( pEntity != NULL );
|
ASSERT( pEntity != nil );
|
||||||
|
|
||||||
if ( nScanCode != CWorld::GetCurrentScanCode() )
|
if ( nScanCode != CWorld::GetCurrentScanCode() )
|
||||||
{
|
{
|
||||||
|
@ -1474,20 +1474,20 @@ CShadows::CastCutsceneShadowSectorList(CPtrList &PtrList, float fStartX, float f
|
||||||
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
||||||
float fZDistance, float fScale, CPolyBunch **ppPolyBunch, CCutsceneShadow *pShadow)
|
float fZDistance, float fScale, CPolyBunch **ppPolyBunch, CCutsceneShadow *pShadow)
|
||||||
{
|
{
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
ASSERT(pShadow != NULL);
|
ASSERT(pShadow != nil);
|
||||||
|
|
||||||
CPtrNode *pNode = PtrList.first;
|
CPtrNode *pNode = PtrList.first;
|
||||||
|
|
||||||
CRect Bound;
|
CRect Bound;
|
||||||
|
|
||||||
while ( pNode != NULL )
|
while ( pNode != nil )
|
||||||
{
|
{
|
||||||
CEntity *pEntity = (CEntity *)pNode->item;
|
CEntity *pEntity = (CEntity *)pNode->item;
|
||||||
uint16 nScanCode = pEntity->m_scanCode;
|
uint16 nScanCode = pEntity->m_scanCode;
|
||||||
pNode = pNode->next;
|
pNode = pNode->next;
|
||||||
|
|
||||||
ASSERT( pEntity != NULL );
|
ASSERT( pEntity != nil );
|
||||||
|
|
||||||
if ( nScanCode != CWorld::GetCurrentScanCode() )
|
if ( nScanCode != CWorld::GetCurrentScanCode() )
|
||||||
{
|
{
|
||||||
|
@ -1526,15 +1526,15 @@ CShadows::CastShadowEntityXY(CEntity *pEntity, float fStartX, float fStartY, fl
|
||||||
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
||||||
float fZDistance, float fScale, CPolyBunch **ppPolyBunch)
|
float fZDistance, float fScale, CPolyBunch **ppPolyBunch)
|
||||||
{
|
{
|
||||||
ASSERT(pEntity != NULL);
|
ASSERT(pEntity != nil);
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
|
|
||||||
static CVector List [20];
|
static CVector List [20];
|
||||||
static CVector Texture[20];
|
static CVector Texture[20];
|
||||||
static CVector Points [4];
|
static CVector Points [4];
|
||||||
|
|
||||||
CColModel *pCol = pEntity->GetColModel();
|
CColModel *pCol = pEntity->GetColModel();
|
||||||
ASSERT(pCol != NULL);
|
ASSERT(pCol != nil);
|
||||||
|
|
||||||
#ifndef MASTER
|
#ifndef MASTER
|
||||||
if ( gbPrintShite )
|
if ( gbPrintShite )
|
||||||
|
@ -1580,12 +1580,12 @@ CShadows::CastShadowEntityXY(CEntity *pEntity, float fStartX, float fStartY, fl
|
||||||
for ( int32 i = 0; i < pCol->numTriangles; i++ )
|
for ( int32 i = 0; i < pCol->numTriangles; i++ )
|
||||||
{
|
{
|
||||||
CColTrianglePlane *pColTriPlanes = pCol->trianglePlanes;
|
CColTrianglePlane *pColTriPlanes = pCol->trianglePlanes;
|
||||||
ASSERT(pColTriPlanes != NULL);
|
ASSERT(pColTriPlanes != nil);
|
||||||
|
|
||||||
if ( Abs(pColTriPlanes[i].normal.z) > 0.1f )
|
if ( Abs(pColTriPlanes[i].normal.z) > 0.1f )
|
||||||
{
|
{
|
||||||
CColTriangle *pColTri = pCol->triangles;
|
CColTriangle *pColTri = pCol->triangles;
|
||||||
ASSERT(pColTri != NULL);
|
ASSERT(pColTri != nil);
|
||||||
|
|
||||||
CVector PointA, PointB, PointC;
|
CVector PointA, PointB, PointC;
|
||||||
|
|
||||||
|
@ -1985,12 +1985,12 @@ CShadows::CastShadowEntityXY(CEntity *pEntity, float fStartX, float fStartY, fl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( ppPolyBunch != NULL )
|
if ( ppPolyBunch != nil )
|
||||||
{
|
{
|
||||||
if ( pEmptyBunchList != NULL )
|
if ( pEmptyBunchList != nil )
|
||||||
{
|
{
|
||||||
CPolyBunch *pBunch = pEmptyBunchList;
|
CPolyBunch *pBunch = pEmptyBunchList;
|
||||||
ASSERT(pBunch != NULL);
|
ASSERT(pBunch != nil);
|
||||||
pEmptyBunchList = pEmptyBunchList->m_pNext;
|
pEmptyBunchList = pEmptyBunchList->m_pNext;
|
||||||
pBunch->m_pNext = *ppPolyBunch;
|
pBunch->m_pNext = *ppPolyBunch;
|
||||||
*ppPolyBunch = pBunch;
|
*ppPolyBunch = pBunch;
|
||||||
|
@ -2015,8 +2015,8 @@ CShadows::CastShadowEntityXY(CEntity *pEntity, float fStartX, float fStartY, fl
|
||||||
|
|
||||||
RenderBuffer::StartStoring(3 * (numVerts3 - 2), numVerts3, &pIndexes, &pVerts);
|
RenderBuffer::StartStoring(3 * (numVerts3 - 2), numVerts3, &pIndexes, &pVerts);
|
||||||
|
|
||||||
ASSERT(pIndexes != NULL);
|
ASSERT(pIndexes != nil);
|
||||||
ASSERT(pVerts != NULL);
|
ASSERT(pVerts != nil);
|
||||||
|
|
||||||
|
|
||||||
for ( int32 j = 0; j < numVerts3; j++ )
|
for ( int32 j = 0; j < numVerts3; j++ )
|
||||||
|
@ -2094,8 +2094,8 @@ RwV3d *ShadowRenderTriangleCB(RwV3d *points, RwV3d *normal, ProjectionParam *par
|
||||||
return points;
|
return points;
|
||||||
}
|
}
|
||||||
|
|
||||||
RwIm3DVertex *imv = NULL;
|
RwIm3DVertex *imv = nil;
|
||||||
RwImVertexIndex *imi = NULL;
|
RwImVertexIndex *imi = nil;
|
||||||
|
|
||||||
RenderBuffer::StartStoring(3, 3, &imi, &imv);
|
RenderBuffer::StartStoring(3, 3, &imi, &imv);
|
||||||
|
|
||||||
|
@ -2168,8 +2168,8 @@ CShadows::CastShadowEntityXYZ(CEntity *pEntity, CVector *pPosn,
|
||||||
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
int16 nIntensity, uint8 nRed, uint8 nGreen, uint8 nBlue,
|
||||||
float fZDistance, float fScale, CPolyBunch **ppPolyBunch, CCutsceneShadow *pShadow)
|
float fZDistance, float fScale, CPolyBunch **ppPolyBunch, CCutsceneShadow *pShadow)
|
||||||
{
|
{
|
||||||
ASSERT(pEntity != NULL);
|
ASSERT(pEntity != nil);
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
|
|
||||||
if ( pShadow )
|
if ( pShadow )
|
||||||
{
|
{
|
||||||
|
@ -2255,7 +2255,7 @@ CShadows::UpdateStaticShadows(void)
|
||||||
{
|
{
|
||||||
for ( int32 i = 0; i < MAX_STATICSHADOWS; i++ )
|
for ( int32 i = 0; i < MAX_STATICSHADOWS; i++ )
|
||||||
{
|
{
|
||||||
if ( aStaticShadows[i].m_pPolyBunch != NULL && !aStaticShadows[i].m_bJustCreated
|
if ( aStaticShadows[i].m_pPolyBunch != nil && !aStaticShadows[i].m_bJustCreated
|
||||||
&& (!aStaticShadows[i].m_bTemp || CTimer::GetTimeInMilliseconds() > aStaticShadows[i].m_nTimeCreated + 5000) )
|
&& (!aStaticShadows[i].m_bTemp || CTimer::GetTimeInMilliseconds() > aStaticShadows[i].m_nTimeCreated + 5000) )
|
||||||
{
|
{
|
||||||
aStaticShadows[i].Free();
|
aStaticShadows[i].Free();
|
||||||
|
@ -2328,19 +2328,19 @@ CShadows::UpdatePermanentShadows(void)
|
||||||
void
|
void
|
||||||
CStaticShadow::Free(void)
|
CStaticShadow::Free(void)
|
||||||
{
|
{
|
||||||
if ( m_pPolyBunch != NULL )
|
if ( m_pPolyBunch != nil )
|
||||||
{
|
{
|
||||||
CPolyBunch *pFree = CShadows::pEmptyBunchList;
|
CPolyBunch *pFree = CShadows::pEmptyBunchList;
|
||||||
CShadows::pEmptyBunchList = m_pPolyBunch;
|
CShadows::pEmptyBunchList = m_pPolyBunch;
|
||||||
|
|
||||||
CPolyBunch *pUsed = m_pPolyBunch;
|
CPolyBunch *pUsed = m_pPolyBunch;
|
||||||
while (pUsed->m_pNext != NULL)
|
while (pUsed->m_pNext != nil)
|
||||||
pUsed = pUsed->m_pNext;
|
pUsed = pUsed->m_pNext;
|
||||||
|
|
||||||
pUsed->m_pNext = pFree;
|
pUsed->m_pNext = pFree;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pPolyBunch = NULL;
|
m_pPolyBunch = nil;
|
||||||
|
|
||||||
m_nId = 0;
|
m_nId = 0;
|
||||||
}
|
}
|
||||||
|
@ -2351,12 +2351,12 @@ CShadows::CalcPedShadowValues(CVector vecLightDir,
|
||||||
float *pfSideX, float *pfSideY,
|
float *pfSideX, float *pfSideY,
|
||||||
float *pfDisplacementX, float *pfDisplacementY)
|
float *pfDisplacementX, float *pfDisplacementY)
|
||||||
{
|
{
|
||||||
ASSERT(pfFrontX != NULL);
|
ASSERT(pfFrontX != nil);
|
||||||
ASSERT(pfFrontY != NULL);
|
ASSERT(pfFrontY != nil);
|
||||||
ASSERT(pfSideX != NULL);
|
ASSERT(pfSideX != nil);
|
||||||
ASSERT(pfSideY != NULL);
|
ASSERT(pfSideY != nil);
|
||||||
ASSERT(pfDisplacementX != NULL);
|
ASSERT(pfDisplacementX != nil);
|
||||||
ASSERT(pfDisplacementY != NULL);
|
ASSERT(pfDisplacementY != nil);
|
||||||
|
|
||||||
*pfFrontX = -vecLightDir.x;
|
*pfFrontX = -vecLightDir.x;
|
||||||
*pfFrontY = -vecLightDir.y;
|
*pfFrontY = -vecLightDir.y;
|
||||||
|
@ -2395,7 +2395,7 @@ CShadows::RenderExtraPlayerShadows(void)
|
||||||
if ( CTimeCycle::GetLightShadowStrength() != 0 )
|
if ( CTimeCycle::GetLightShadowStrength() != 0 )
|
||||||
{
|
{
|
||||||
CVehicle *pCar = FindPlayerVehicle();
|
CVehicle *pCar = FindPlayerVehicle();
|
||||||
if ( pCar == NULL )
|
if ( pCar == nil )
|
||||||
; // R* cut it out for playerped
|
; // R* cut it out for playerped
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2454,7 +2454,7 @@ CShadows::RenderExtraPlayerShadows(void)
|
||||||
pCar->GetRight().x * (fVehicleWidth/3),
|
pCar->GetRight().x * (fVehicleWidth/3),
|
||||||
pCar->GetRight().y * (fVehicleWidth/3),
|
pCar->GetRight().y * (fVehicleWidth/3),
|
||||||
nColorStrength, 0, 0, 0,
|
nColorStrength, 0, 0, 0,
|
||||||
4.5f, false, 1.0f, NULL, false);
|
4.5f, false, 1.0f, nil, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2464,7 +2464,7 @@ CShadows::RenderExtraPlayerShadows(void)
|
||||||
-pCar->GetRight().x * (fVehicleWidth/2),
|
-pCar->GetRight().x * (fVehicleWidth/2),
|
||||||
-pCar->GetRight().y * (fVehicleWidth/2),
|
-pCar->GetRight().y * (fVehicleWidth/2),
|
||||||
nColorStrength, 0, 0, 0,
|
nColorStrength, 0, 0, 0,
|
||||||
4.5f, false, 1.0f, NULL, false);
|
4.5f, false, 1.0f, nil, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2486,7 +2486,7 @@ CShadows::RenderIndicatorShadow(uint32 nID, uint8 ShadowType, RwTexture *pTextur
|
||||||
float fFrontX, float fFrontY, float fSideX, float fSideY,
|
float fFrontX, float fFrontY, float fSideX, float fSideY,
|
||||||
int16 nIntensity)
|
int16 nIntensity)
|
||||||
{
|
{
|
||||||
ASSERT(pPosn != NULL);
|
ASSERT(pPosn != nil);
|
||||||
|
|
||||||
C3dMarkers::PlaceMarkerSet(nID, MARKERTYPE_CYLINDER, *pPosn, Max(fFrontX, -fSideY),
|
C3dMarkers::PlaceMarkerSet(nID, MARKERTYPE_CYLINDER, *pPosn, Max(fFrontX, -fSideY),
|
||||||
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B,
|
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B,
|
||||||
|
|
|
@ -484,8 +484,8 @@ RpClump *RpClumpGetBoundingSphere(RpClump *clump, RwSphere *sphere, bool useLTM)
|
||||||
|
|
||||||
b_cbsUseLTM = useLTM;
|
b_cbsUseLTM = useLTM;
|
||||||
|
|
||||||
if ( clump == NULL || sphere == NULL )
|
if ( clump == nil || sphere == nil )
|
||||||
return NULL;
|
return nil;
|
||||||
|
|
||||||
sphere->radius = 0.0f;
|
sphere->radius = 0.0f;
|
||||||
sphere->center.x = 0.0f;
|
sphere->center.x = 0.0f;
|
||||||
|
@ -494,7 +494,7 @@ RpClump *RpClumpGetBoundingSphere(RpClump *clump, RwSphere *sphere, bool useLTM)
|
||||||
|
|
||||||
RwInt32 numAtomics = RpClumpGetNumAtomics(clump);
|
RwInt32 numAtomics = RpClumpGetNumAtomics(clump);
|
||||||
if ( numAtomics < 1.0f )
|
if ( numAtomics < 1.0f )
|
||||||
return NULL;
|
return nil;
|
||||||
|
|
||||||
RpClumpForAllAtomics(clump, cbsCalcMeanBSphereCenterCB, &result);
|
RpClumpForAllAtomics(clump, cbsCalcMeanBSphereCenterCB, &result);
|
||||||
|
|
||||||
|
|
|
@ -593,7 +593,7 @@ CHeli::PreRenderAlways(void)
|
||||||
CShadows::StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &shadowPos,
|
CShadows::StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &shadowPos,
|
||||||
6.0f, 0.0f, 0.0f, -6.0f,
|
6.0f, 0.0f, 0.0f, -6.0f,
|
||||||
80*m_fSearchLightIntensity, 80*m_fSearchLightIntensity, 80*m_fSearchLightIntensity, 80*m_fSearchLightIntensity,
|
80*m_fSearchLightIntensity, 80*m_fSearchLightIntensity, 80*m_fSearchLightIntensity, 80*m_fSearchLightIntensity,
|
||||||
50.0f, true, 1.0f, NULL, false);
|
50.0f, true, 1.0f, nil, false);
|
||||||
|
|
||||||
CVector front = GetMatrix() * CVector(0.0f, 7.0f, 0.0f);
|
CVector front = GetMatrix() * CVector(0.0f, 7.0f, 0.0f);
|
||||||
CVector toPlayer = FindPlayerCoors() - front;
|
CVector toPlayer = FindPlayerCoors() - front;
|
||||||
|
|
Loading…
Reference in a new issue