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

Function xEntBoulder_Render

src/SB/Core/x/xEntBoulder.cpp:45–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void xEntBoulder_Render(xEnt* ent)
46{
47 xModelInstance* model = ent->model;
48 S32 shadowResult;
49 xVec3 shadVec;
50 F32 radius;
51
52 if ((model != NULL) && xEntIsVisible(ent))
53 {
54 switch (model->Flags & 0x400)
55 {
56 case 0:
57 if (ent->flags & 0x40)
58 {
59 if (!iModelCull(model->Data, model->Mat))
60 {
61 xModelRender(model);
62 }
63 }
64 else
65 {
66 shadVec.x = model->Mat->pos.x;
67 shadVec.y = model->Mat->pos.y - 10.0f;
68 shadVec.z = model->Mat->pos.z;
69
70 if (!iModelCullPlusShadow(model->Data, model->Mat, &shadVec, &shadowResult))
71 {
72 xModelRender(model);
73 }
74
75 if (!shadowResult)
76 {
77 if (ent->flags & 0x10)
78 {
79 xShadowManager_Add(ent);
80 }
81 else
82 {
83 radius = ent->model->Data->boundingSphere.radius;
84 if (radius > 0.75f)
85 {
86 radius = 0.75f;
87 }
88 xShadowSimple_Add(ent->simpShadow, ent, 2.0f * radius, 1.0f);
89 }
90 }
91 }
92 break;
93 }
94 }
95}
96
97void xEntBoulder_Init(void* ent, void* asset)
98{

Callers

nothing calls this directly

Calls 6

xEntIsVisibleFunction · 0.85
iModelCullFunction · 0.85
xModelRenderFunction · 0.85
xShadowSimple_AddFunction · 0.85
xShadowManager_AddFunction · 0.70
iModelCullPlusShadowFunction · 0.50

Tested by

no test coverage detected