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

Function zEntPickup_RenderOne

src/SB/Game/zEntPickup.cpp:1341–1396  ·  view source on GitHub ↗

equivalent: float load scheduling

Source from the content-addressed store, hash-verified

1339
1340// equivalent: float load scheduling
1341void zEntPickup_RenderOne(xEnt* ent)
1342{
1343 if (ent->baseType != eBaseTypePickup)
1344 {
1345 return;
1346 }
1347
1348 if (!xEntIsVisible(ent))
1349 {
1350 return;
1351 }
1352
1353 if (ent->model->Flags & 0x400)
1354 {
1355 return;
1356 }
1357
1358 zEntPickup* pickup = (zEntPickup*)ent;
1359 RpAtomic* imodel = pickup->model->Data;
1360 RwMatrix* mat = ent->model->Mat;
1361 S32 shadowResult;
1362 xVec3 shadVec;
1363
1364 // non-matching: scheduling
1365
1366 shadVec.x = ent->model->Mat->pos.x;
1367 shadVec.y = ent->model->Mat->pos.y - 10.0f;
1368 shadVec.z = ent->model->Mat->pos.z;
1369
1370 if (iModelCullPlusShadow(imodel, ent->model->Mat, &shadVec, &shadowResult))
1371 {
1372 return;
1373 }
1374
1375 RwFrame* frame = RpAtomicGetFrame(imodel);
1376
1377 if (!pickup->anim && (pickup->p->pickupType != PICKUP_TYPE_1 || !(pickup->state & 0x4)))
1378 {
1379 *(xMat3x3*)mat = *(xMat3x3*)&sPickupOrientation;
1380 }
1381
1382 frame->ltm = *mat;
1383
1384 if (1.0f != pickup->fx_scale)
1385 {
1386 RwV3d vec_scale;
1387
1388 vec_scale.x = pickup->fx_scale;
1389 vec_scale.y = pickup->fx_scale;
1390 vec_scale.z = pickup->fx_scale;
1391
1392 RwMatrixScale(&frame->ltm, &vec_scale, rwCOMBINEPRECONCAT);
1393 }
1394
1395 RpAtomicRender(imodel);
1396}
1397
1398// Uses int-to-float conversion

Callers 1

xFXAuraRenderFunction · 0.50

Calls 2

xEntIsVisibleFunction · 0.85
iModelCullPlusShadowFunction · 0.50

Tested by

no test coverage detected