some rendering things

This commit is contained in:
aap 2020-12-13 12:53:19 +01:00
parent b3f97cdce4
commit 35cac6b93b
5 changed files with 64 additions and 57 deletions

View file

@ -191,7 +191,7 @@ CGame::InitialiseRenderWare(void)
CVisibilityPlugins::Initialise(); CVisibilityPlugins::Initialise();
/* Create camera */ /* Create camera */
Scene.camera = CameraCreate(RsGlobal.width, RsGlobal.height, TRUE); Scene.camera = CameraCreate(SCREEN_WIDTH, SCREEN_HEIGHT, TRUE);
ASSERT(Scene.camera != nil); ASSERT(Scene.camera != nil);
if (!Scene.camera) if (!Scene.camera)
{ {

View file

@ -890,18 +890,18 @@ void
MattRenderScene(void) MattRenderScene(void)
{ {
// this calls CMattRenderer::Render // this calls CMattRenderer::Render
CWorld::AdvanceCurrentScanCode(); /// CWorld::AdvanceCurrentScanCode();
// CMattRenderer::ResetRenderStates // CMattRenderer::ResetRenderStates
CRenderer::ClearForFrame(); /// CRenderer::ClearForFrame(); // before ConstructRenderList
// CClock::CalcEnvMapTimeMultiplicator // CClock::CalcEnvMapTimeMultiplicator
CWaterLevel::RenderWater(); // actually CMattRenderer::RenderWater CWaterLevel::RenderWater(); // actually CMattRenderer::RenderWater
// CClock::ms_EnvMapTimeMultiplicator = 1.0f; // CClock::ms_EnvMapTimeMultiplicator = 1.0f;
// cWorldStream::ClearDynamics // cWorldStream::ClearDynamics
CRenderer::ConstructRenderList(); /// CRenderer::ConstructRenderList(); // before PreRender
if(gbRenderWorld0) if(gbRenderWorld0)
CRenderer::RenderWorld(0); // roads CRenderer::RenderWorld(0); // roads
// CMattRenderer::ResetRenderStates // CMattRenderer::ResetRenderStates
CRenderer::PreRender(); /// CRenderer::PreRender(); // has to be called before BeginUpdate because of cutscene shadows
CCoronas::RenderReflections(); CCoronas::RenderReflections();
if(gbRenderWorld1) if(gbRenderWorld1)
CRenderer::RenderWorld(1); // opaque CRenderer::RenderWorld(1); // opaque
@ -1213,13 +1213,16 @@ Idle(void *arg)
pos.y = SCREEN_HEIGHT / 2.0f; pos.y = SCREEN_HEIGHT / 2.0f;
RsMouseSetPos(&pos); RsMouseSetPos(&pos);
#endif #endif
#ifdef NEW_RENDERER
if(!gbNewRenderer)
#endif
{
tbStartTimer(0, "CnstrRenderList"); tbStartTimer(0, "CnstrRenderList");
#ifdef PC_WATER #ifdef PC_WATER
CWaterLevel::PreCalcWaterGeometry(); CWaterLevel::PreCalcWaterGeometry();
#endif
#ifdef NEW_RENDERER
if(gbNewRenderer){
CWorld::AdvanceCurrentScanCode(); // don't think this is even necessary
CRenderer::ClearForFrame();
}
#endif #endif
CRenderer::ConstructRenderList(); CRenderer::ConstructRenderList();
tbEndTimer("CnstrRenderList"); tbEndTimer("CnstrRenderList");
@ -1227,7 +1230,6 @@ Idle(void *arg)
tbStartTimer(0, "PreRender"); tbStartTimer(0, "PreRender");
CRenderer::PreRender(); CRenderer::PreRender();
tbEndTimer("PreRender"); tbEndTimer("PreRender");
}
#ifdef FIX_BUGS #ifdef FIX_BUGS
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); // TODO: temp? this fixes OpenGL render but there should be a better place for this RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); // TODO: temp? this fixes OpenGL render but there should be a better place for this

View file

@ -61,14 +61,6 @@ CVehicle *CRenderer::m_pFirstPersonVehicle;
bool CRenderer::m_loadingPriority; bool CRenderer::m_loadingPriority;
float CRenderer::ms_lodDistScale = 1.2f; float CRenderer::ms_lodDistScale = 1.2f;
#ifdef FIX_BUGS
#define LOD_DISTANCE (300.0f*TheCamera.LODDistMultiplier)
#else
#define LOD_DISTANCE 300.0f
#endif
#define FADE_DISTANCE 20.0f
#define STREAM_DISTANCE 30.0f
void void
CRenderer::Init(void) CRenderer::Init(void)
@ -711,12 +703,13 @@ CRenderer::RenderOneBuilding(CEntity *ent, float camdist)
{ {
if(ent->m_rwObject == nil) if(ent->m_rwObject == nil)
return; return;
ent->bImBeingRendered = true; // TODO: this seems wrong, but do we even need it?
assert(RwObjectGetType(ent->m_rwObject) == rpATOMIC); assert(RwObjectGetType(ent->m_rwObject) == rpATOMIC);
RpAtomic *atomic = (RpAtomic*)ent->m_rwObject; RpAtomic *atomic = (RpAtomic*)ent->m_rwObject;
CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(ent->GetModelIndex()); CSimpleModelInfo *mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(ent->GetModelIndex());
ent->bImBeingRendered = true; // TODO: this seems wrong, but do we even need it?
int pass = PASS_BLEND; int pass = PASS_BLEND;
if(mi->m_additive) // very questionable if(mi->m_additive) // very questionable
pass = PASS_ADD; pass = PASS_ADD;

View file

@ -2,6 +2,14 @@
class CEntity; class CEntity;
#ifdef FIX_BUGS
#define LOD_DISTANCE (300.0f*TheCamera.LODDistMultiplier)
#else
#define LOD_DISTANCE 300.0f
#endif
#define FADE_DISTANCE 20.0f
#define STREAM_DISTANCE 30.0f
extern bool gbShowCollisionPolys; extern bool gbShowCollisionPolys;
extern bool gbShowCollisionLines; extern bool gbShowCollisionLines;
extern bool gbBigWhiteDebugLightSwitchedOn; extern bool gbBigWhiteDebugLightSwitchedOn;

View file

@ -14,8 +14,6 @@
//--MIAMI: file done //--MIAMI: file done
#define FADE_DISTANCE 20.0f
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaList; CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaList;
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaBoatAtomicList; CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaBoatAtomicList;
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaEntityList; CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaEntityList;
@ -39,6 +37,8 @@ float CVisibilityPlugins::ms_bigVehicleLod1Dist;
float CVisibilityPlugins::ms_pedLod1Dist; float CVisibilityPlugins::ms_pedLod1Dist;
float CVisibilityPlugins::ms_pedFadeDist; float CVisibilityPlugins::ms_pedFadeDist;
#define RENDERCALLBACK AtomicDefaultRenderCallBack
void void
CVisibilityPlugins::Initialise(void) CVisibilityPlugins::Initialise(void)
{ {
@ -132,6 +132,10 @@ CVisibilityPlugins::InsertAtomicIntoBoatSortedList(RpAtomic *a, float dist)
return !!m_alphaBoatAtomicList.InsertSorted(item); return !!m_alphaBoatAtomicList.InsertSorted(item);
} }
// can't increase this yet unfortunately...
// probably have to fix fading for this so material alpha isn't overwritten
#define VEHICLE_LODDIST_MULTIPLIER (TheCamera.GenerationDistMultiplier)
void void
CVisibilityPlugins::SetRenderWareCamera(RwCamera *camera) CVisibilityPlugins::SetRenderWareCamera(RwCamera *camera)
{ {
@ -144,13 +148,13 @@ CVisibilityPlugins::SetRenderWareCamera(RwCamera *camera)
else else
ms_cullCompsDist = sq(TheCamera.LODDistMultiplier * 20.0f); ms_cullCompsDist = sq(TheCamera.LODDistMultiplier * 20.0f);
ms_vehicleLod0Dist = sq(70.0f * TheCamera.GenerationDistMultiplier); ms_vehicleLod0Dist = sq(70.0f * VEHICLE_LODDIST_MULTIPLIER);
ms_vehicleLod1Dist = sq(90.0f * TheCamera.GenerationDistMultiplier); ms_vehicleLod1Dist = sq(90.0f * VEHICLE_LODDIST_MULTIPLIER);
ms_vehicleFadeDist = sq(100.0f * TheCamera.GenerationDistMultiplier); ms_vehicleFadeDist = sq(100.0f * VEHICLE_LODDIST_MULTIPLIER);
ms_bigVehicleLod0Dist = sq(60.0f * TheCamera.GenerationDistMultiplier); ms_bigVehicleLod0Dist = sq(60.0f * VEHICLE_LODDIST_MULTIPLIER);
ms_bigVehicleLod1Dist = sq(150.0f * TheCamera.GenerationDistMultiplier); ms_bigVehicleLod1Dist = sq(150.0f * VEHICLE_LODDIST_MULTIPLIER);
ms_pedLod1Dist = sq(60.0f * TheCamera.LODDistMultiplier); ms_pedLod1Dist = sq(60.0f * TheCamera.LODDistMultiplier);
ms_pedFadeDist = sq(70.0f * TheCamera.LODDistMultiplier); ms_pedFadeDist = sq(70.0f * TheCamera.LODDistMultiplier);
} }
static float DistToCameraSq; static float DistToCameraSq;
@ -187,7 +191,7 @@ CVisibilityPlugins::RenderAtomicList(CLinkList<AlphaObjectInfo> &list)
{ {
CLink<AlphaObjectInfo> *node; CLink<AlphaObjectInfo> *node;
for(node = list.tail.prev; node != &list.head; node = node->prev) for(node = list.tail.prev; node != &list.head; node = node->prev)
AtomicDefaultRenderCallBack(node->item.atomic); RENDERCALLBACK(node->item.atomic);
} }
void void
@ -257,11 +261,11 @@ CVisibilityPlugins::RenderWheelAtomicCB(RpAtomic *atomic)
mi = GetAtomicModelInfo(atomic); mi = GetAtomicModelInfo(atomic);
len = Sqrt(DistToCameraSq); len = Sqrt(DistToCameraSq);
lodatm = mi->GetAtomicFromDistance(len * TheCamera.LODDistMultiplier / TheCamera.GenerationDistMultiplier); lodatm = mi->GetAtomicFromDistance(len * TheCamera.LODDistMultiplier / VEHICLE_LODDIST_MULTIPLIER);
if(lodatm){ if(lodatm){
if(RpAtomicGetGeometry(lodatm) != RpAtomicGetGeometry(atomic)) if(RpAtomicGetGeometry(lodatm) != RpAtomicGetGeometry(atomic))
RpAtomicSetGeometry(atomic, RpAtomicGetGeometry(lodatm), rpATOMICSAMEBOUNDINGSPHERE); RpAtomicSetGeometry(atomic, RpAtomicGetGeometry(lodatm), rpATOMICSAMEBOUNDINGSPHERE);
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
return atomic; return atomic;
} }
@ -278,7 +282,7 @@ CVisibilityPlugins::RenderObjNormalAtomic(RpAtomic *atomic)
len = RwV3dLength(&view); len = RwV3dLength(&view);
if(RwV3dDotProduct(&view, RwMatrixGetUp(m)) < -0.3f*len && len > 8.0f) if(RwV3dDotProduct(&view, RwMatrixGetUp(m)) < -0.3f*len && len > 8.0f)
return atomic; return atomic;
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
return atomic; return atomic;
} }
@ -292,7 +296,7 @@ CVisibilityPlugins::RenderAlphaAtomic(RpAtomic *atomic, int alpha)
flags = RpGeometryGetFlags(geo); flags = RpGeometryGetFlags(geo);
RpGeometrySetFlags(geo, flags | rpGEOMETRYMODULATEMATERIALCOLOR); RpGeometrySetFlags(geo, flags | rpGEOMETRYMODULATEMATERIALCOLOR);
RpGeometryForAllMaterials(geo, SetAlphaCB, (void*)alpha); RpGeometryForAllMaterials(geo, SetAlphaCB, (void*)alpha);
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
RpGeometryForAllMaterials(geo, SetAlphaCB, (void*)255); RpGeometryForAllMaterials(geo, SetAlphaCB, (void*)255);
RpGeometrySetFlags(geo, flags); RpGeometrySetFlags(geo, flags);
return atomic; return atomic;
@ -312,7 +316,7 @@ CVisibilityPlugins::RenderWeaponCB(RpAtomic *atomic)
maxdist = mi->GetLodDistance(0); maxdist = mi->GetLodDistance(0);
distsq = RwV3dDotProduct(&view, &view); distsq = RwV3dDotProduct(&view, &view);
if(distsq < maxdist*maxdist) if(distsq < maxdist*maxdist)
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
return atomic; return atomic;
} }
@ -334,7 +338,7 @@ CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist)
fadefactor = 1.0f; fadefactor = 1.0f;
alpha = mi->m_alpha * fadefactor; alpha = mi->m_alpha * fadefactor;
if(alpha == 255) if(alpha == 255)
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
else{ else{
RpGeometry *geo = RpAtomicGetGeometry(lodatm); RpGeometry *geo = RpAtomicGetGeometry(lodatm);
uint32 flags = RpGeometryGetFlags(geo); uint32 flags = RpGeometryGetFlags(geo);
@ -342,7 +346,7 @@ CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist)
RpGeometryForAllMaterials(geo, SetAlphaCB, (void*)alpha); RpGeometryForAllMaterials(geo, SetAlphaCB, (void*)alpha);
if(geo != RpAtomicGetGeometry(atomic)) if(geo != RpAtomicGetGeometry(atomic))
RpAtomicSetGeometry(atomic, geo, rpATOMICSAMEBOUNDINGSPHERE); // originally 5 (mistake?) RpAtomicSetGeometry(atomic, geo, rpATOMICSAMEBOUNDINGSPHERE); // originally 5 (mistake?)
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
RpGeometryForAllMaterials(geo, SetAlphaCB, (void*)255); RpGeometryForAllMaterials(geo, SetAlphaCB, (void*)255);
RpGeometrySetFlags(geo, flags); RpGeometrySetFlags(geo, flags);
} }
@ -371,7 +375,7 @@ CVisibilityPlugins::RenderVehicleHiDetailCB(RpAtomic *atomic)
if(dot > 0.0f && ((flags & ATOMIC_FLAG_ANGLECULL) || 0.1f*DistToCameraSq < dot*dot)) if(dot > 0.0f && ((flags & ATOMIC_FLAG_ANGLECULL) || 0.1f*DistToCameraSq < dot*dot))
return atomic; return atomic;
} }
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
return atomic; return atomic;
} }
@ -395,10 +399,10 @@ CVisibilityPlugins::RenderVehicleHiDetailAlphaCB(RpAtomic *atomic)
if(flags & ATOMIC_FLAG_DRAWLAST){ if(flags & ATOMIC_FLAG_DRAWLAST){
// sort before clump // sort before clump
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq - 0.0001f)) if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq - 0.0001f))
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
}else{ }else{
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot)) if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot))
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
} }
return atomic; return atomic;
@ -420,7 +424,7 @@ CVisibilityPlugins::RenderVehicleHiDetailCB_BigVehicle(RpAtomic *atomic)
if(dot > 0.0f) if(dot > 0.0f)
return atomic; return atomic;
} }
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
return atomic; return atomic;
} }
@ -442,7 +446,7 @@ CVisibilityPlugins::RenderVehicleHiDetailAlphaCB_BigVehicle(RpAtomic *atomic)
return atomic; return atomic;
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot)) if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot))
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
return atomic; return atomic;
} }
@ -451,7 +455,7 @@ RpAtomic*
CVisibilityPlugins::RenderVehicleHiDetailCB_Boat(RpAtomic *atomic) CVisibilityPlugins::RenderVehicleHiDetailCB_Boat(RpAtomic *atomic)
{ {
if(DistToCameraSq < ms_bigVehicleLod1Dist) if(DistToCameraSq < ms_bigVehicleLod1Dist)
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
return atomic; return atomic;
} }
@ -461,9 +465,9 @@ CVisibilityPlugins::RenderVehicleHiDetailAlphaCB_Boat(RpAtomic *atomic)
if(DistToCameraSq < ms_vehicleLod0Dist){ if(DistToCameraSq < ms_vehicleLod0Dist){
if(GetAtomicId(atomic) & ATOMIC_FLAG_DRAWLAST){ if(GetAtomicId(atomic) & ATOMIC_FLAG_DRAWLAST){
if(!InsertAtomicIntoBoatSortedList(atomic, DistToCameraSq)) if(!InsertAtomicIntoBoatSortedList(atomic, DistToCameraSq))
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
}else }else
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
return atomic; return atomic;
} }
@ -485,7 +489,7 @@ CVisibilityPlugins::RenderVehicleLowDetailCB_BigVehicle(RpAtomic *atomic)
if(dot > 0.0f) if(dot > 0.0f)
return atomic; return atomic;
} }
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
return atomic; return atomic;
} }
@ -508,7 +512,7 @@ CVisibilityPlugins::RenderVehicleLowDetailAlphaCB_BigVehicle(RpAtomic *atomic)
return atomic; return atomic;
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot)) if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot))
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
return atomic; return atomic;
} }
@ -523,7 +527,7 @@ CVisibilityPlugins::RenderVehicleReallyLowDetailCB(RpAtomic *atomic)
if(DistToCameraSq >= ms_vehicleLod0Dist){ if(DistToCameraSq >= ms_vehicleLod0Dist){
alpha = GetClumpAlpha(clump); alpha = GetClumpAlpha(clump);
if(alpha == 255) if(alpha == 255)
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
else else
RenderAlphaAtomic(atomic, alpha); RenderAlphaAtomic(atomic, alpha);
} }
@ -535,7 +539,7 @@ RpAtomic*
CVisibilityPlugins::RenderVehicleReallyLowDetailCB_BigVehicle(RpAtomic *atomic) CVisibilityPlugins::RenderVehicleReallyLowDetailCB_BigVehicle(RpAtomic *atomic)
{ {
if(DistToCameraSq >= ms_bigVehicleLod1Dist) if(DistToCameraSq >= ms_bigVehicleLod1Dist)
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
return atomic; return atomic;
} }
@ -555,7 +559,7 @@ CVisibilityPlugins::RenderTrainHiDetailCB(RpAtomic *atomic)
if(dot > 0.0f && ((flags & ATOMIC_FLAG_ANGLECULL) || 0.1f*DistToCameraSq < dot*dot)) if(dot > 0.0f && ((flags & ATOMIC_FLAG_ANGLECULL) || 0.1f*DistToCameraSq < dot*dot))
return atomic; return atomic;
} }
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
return atomic; return atomic;
} }
@ -579,10 +583,10 @@ CVisibilityPlugins::RenderTrainHiDetailAlphaCB(RpAtomic *atomic)
if(flags & ATOMIC_FLAG_DRAWLAST){ if(flags & ATOMIC_FLAG_DRAWLAST){
// sort before clump // sort before clump
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq - 0.0001f)) if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq - 0.0001f))
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
}else{ }else{
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot)) if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot))
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
} }
return atomic; return atomic;
@ -600,7 +604,7 @@ CVisibilityPlugins::RenderVehicleRotorAlphaCB(RpAtomic *atomic)
RwV3dSub(&cam2atm, &RwFrameGetLTM(RpAtomicGetFrame(atomic))->pos, ms_pCameraPosn); RwV3dSub(&cam2atm, &RwFrameGetLTM(RpAtomicGetFrame(atomic))->pos, ms_pCameraPosn);
dot = RwV3dDotProduct(&cam2atm, &RwFrameGetLTM(clumpframe)->at); dot = RwV3dDotProduct(&cam2atm, &RwFrameGetLTM(clumpframe)->at);
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot*20.0f)) if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot*20.0f))
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
return atomic; return atomic;
} }
@ -618,7 +622,7 @@ CVisibilityPlugins::RenderVehicleTailRotorAlphaCB(RpAtomic *atomic)
RwV3dSub(&cam2atm, &atmMat->pos, ms_pCameraPosn); RwV3dSub(&cam2atm, &atmMat->pos, ms_pCameraPosn);
dot = RwV3dDotProduct(&cam2atm, &clumpMat->up) + RwV3dDotProduct(&cam2atm, &clumpMat->right); dot = RwV3dDotProduct(&cam2atm, &clumpMat->up) + RwV3dDotProduct(&cam2atm, &clumpMat->right);
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq - dot)) if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq - dot))
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
} }
return atomic; return atomic;
} }
@ -628,7 +632,7 @@ CVisibilityPlugins::RenderPlayerCB(RpAtomic *atomic)
{ {
if(CWorld::Players[0].m_pSkinTexture) if(CWorld::Players[0].m_pSkinTexture)
RpGeometryForAllMaterials(RpAtomicGetGeometry(atomic), SetTextureCB, CWorld::Players[0].m_pSkinTexture); RpGeometryForAllMaterials(RpAtomicGetGeometry(atomic), SetTextureCB, CWorld::Players[0].m_pSkinTexture);
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
return atomic; return atomic;
} }
@ -642,7 +646,7 @@ CVisibilityPlugins::RenderPedCB(RpAtomic *atomic)
if(RwV3dDotProduct(&cam2atm, &cam2atm) < ms_pedLod1Dist){ if(RwV3dDotProduct(&cam2atm, &cam2atm) < ms_pedLod1Dist){
alpha = GetClumpAlpha(RpAtomicGetClump(atomic)); alpha = GetClumpAlpha(RpAtomicGetClump(atomic));
if(alpha == 255) if(alpha == 255)
AtomicDefaultRenderCallBack(atomic); RENDERCALLBACK(atomic);
else else
RenderAlphaAtomic(atomic, alpha); RenderAlphaAtomic(atomic, alpha);
} }
@ -838,7 +842,7 @@ void
CVisibilityPlugins::SetAtomicRenderCallback(RpAtomic *atomic, RpAtomicCallBackRender cb) CVisibilityPlugins::SetAtomicRenderCallback(RpAtomic *atomic, RpAtomicCallBackRender cb)
{ {
if(cb == nil) if(cb == nil)
cb = AtomicDefaultRenderCallBack; // not necessary cb = RENDERCALLBACK; // not necessary
RpAtomicSetRenderCallBack(atomic, cb); RpAtomicSetRenderCallBack(atomic, cb);
} }