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

Function xModelRenderSingle

src/SB/Core/x/xModel.cpp:353–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351}
352
353void xModelRenderSingle(xModelInstance* modelInst)
354{
355 if ((modelInst->Flags & 0x401) != 0x1)
356 return;
357
358 U8 reset = FALSE;
359 xMat3x3 tmpmat;
360
361 if (modelInst->Scale.x)
362 {
363 tmpmat = *(xMat3x3*)modelInst->Mat;
364
365 modelInst->Mat->right.x *= modelInst->Scale.x;
366 modelInst->Mat->right.y *= modelInst->Scale.x;
367 modelInst->Mat->right.z *= modelInst->Scale.x;
368 modelInst->Mat->up.x *= modelInst->Scale.y;
369 modelInst->Mat->up.y *= modelInst->Scale.y;
370 modelInst->Mat->up.z *= modelInst->Scale.y;
371 modelInst->Mat->at.x *= modelInst->Scale.z;
372 modelInst->Mat->at.y *= modelInst->Scale.z;
373 modelInst->Mat->at.z *= modelInst->Scale.z;
374 }
375
376 if (!iModelCull(modelInst->Data, modelInst->Mat))
377 {
378 if (modelInst->RedMultiplier != 1.0f || modelInst->GreenMultiplier != 1.0f ||
379 modelInst->BlueMultiplier != 1.0f)
380 {
381 xModelMaterialMul(modelInst, modelInst->RedMultiplier, modelInst->GreenMultiplier,
382 modelInst->BlueMultiplier);
383 }
384
385 reset = TRUE;
386 xModelSetMaterialAlpha(modelInst, (U8)(modelInst->Alpha * 255.0f) & 0xFF);
387
388 if (modelInst->Flags & 0x80)
389 {
390 xAnimPlay* a = modelInst->Anim;
391 for (U16 i = 0; i < a->NumSingle; i++)
392 {
393 if (a->Single[i].SingleFlags & 0x8000)
394 {
395 if (a->Single[i].State)
396 {
397 xMorphRender((xMorphSeqFile*)a->Single[i].State->Data->RawData[0],
398 modelInst->Mat,
399 xAnimFileRawTime(a->Single[i].State->Data, a->Single[i].Time));
400 }
401 break;
402 }
403 }
404 }
405 else
406 {
407 iModelRender(modelInst->Data, modelInst->Mat);
408 }
409 }
410

Callers 4

xModelRenderFunction · 0.70
RenderExtraMethod · 0.50

Calls 7

iModelCullFunction · 0.85
xModelMaterialMulFunction · 0.85
xModelSetMaterialAlphaFunction · 0.85
xAnimFileRawTimeFunction · 0.85
xModelResetMaterialFunction · 0.85
xMorphRenderFunction · 0.70
iModelRenderFunction · 0.50

Tested by

no test coverage detected