MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xModelBucket_RenderOpaque

Function xModelBucket_RenderOpaque

src/SB/Core/x/xModelBucket.cpp:342–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340}
341
342void xModelBucket_RenderOpaque()
343{
344 xModelBucketEnabled = 0;
345
346 for (S32 i = 0; i < sBucketCount; i++)
347 {
348 xModelBucket* bucket = &sBucketList[i];
349 RpAtomic* data = bucket->Data;
350 xModelInstance* minst = bucket->List;
351 while (minst)
352 {
353 xLightKit_Enable(minst->LightKit, xglobals->currWorld);
354
355 S32 oldHack = iModelHack_DisablePrelight;
356 if ((minst->PipeFlags & 0xC0) == 0x80)
357 {
358 iModelHack_DisablePrelight = 0;
359 }
360
361 if (minst->Surf)
362 {
363 xEntSetupPipeline(minst->Surf, data);
364 }
365
366 RpAtomic* oldmodel = minst->Data;
367 minst->Data = data;
368
369 if ((minst->PipeFlags & 0x30) == 0x20)
370 {
371 RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLBACK);
372 }
373
374 RwFogType oldfogtype = rwFOGTYPENAFOGTYPE;
375 if ((minst->PipeFlags & 0x10000) && xglobals->fog.type != rwFOGTYPENAFOGTYPE)
376 {
377 oldfogtype = xglobals->fog.type;
378 xglobals->fog.type = rwFOGTYPENAFOGTYPE;
379 iCameraSetFogRenderStates();
380 }
381
382 xModelRenderSingle(minst);
383
384 if ((minst->PipeFlags & 0x10000) && oldfogtype != rwFOGTYPENAFOGTYPE)
385 {
386 xglobals->fog.type = oldfogtype;
387 iCameraSetFogRenderStates();
388 }
389
390 if ((minst->PipeFlags & 0x30) == 0x20)
391 {
392 RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
393 }
394
395 if (minst->Surf)
396 {
397 xEntRestorePipeline(minst->Surf, data);
398 }
399

Callers 1

zSceneRenderPreFXFunction · 0.50

Calls 5

xEntRestorePipelineFunction · 0.85
xLightKit_EnableFunction · 0.70
xEntSetupPipelineFunction · 0.70
xModelRenderSingleFunction · 0.70

Tested by

no test coverage detected