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

Function zEntHangableEventCB

src/SB/Game/zEntHangable.cpp:234–306  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234S32 zEntHangableEventCB(xBase* from, xBase* to, U32 toEvent, const F32* toParam, xBase*)
235{
236 FloatAndVoid dist;
237 zEntHangable* ent = (zEntHangable*)to;
238 U32 wasVisible = xEntIsVisible(ent);
239 zEnt* follow = (zEnt*)from;
240
241 switch ((S32)toEvent)
242 {
243 case eEventVisible:
244 case eEventFastVisible:
245 xEntShow(ent);
246 break;
247 case eEventInvisible:
248 case eEventFastInvisible:
249 xEntHide(ent);
250 break;
251 case eEventCollisionOn:
252 ent->enabled = 1;
253 break;
254 case eEventMount:
255 zEntHangableMountFX(ent);
256 if ((ent->asset->modelInfoID == sChandelierHash) && (ent->candle_state == 0))
257 {
258 ent->candle_timer = 3.0f;
259 }
260 break;
261 case eEventDismount:
262 ent->enabled = -2;
263 break;
264 case eEventCollisionOff:
265 ent->enabled = 0;
266 break;
267 case eEventCollision_Visible_On:
268 xEntShow(ent);
269 ent->enabled = 1;
270 break;
271 case eEventCollision_Visible_Off:
272 xEntHide(ent);
273 ent->enabled = 0;
274 break;
275 case eEventReset:
276 zEntHangable_Reset(ent);
277 break;
278 case eEventSwingerFollow:
279 zEntHangable_SetFollow(ent, follow);
280 break;
281 case eEventSetUpdateDistance:
282 if (globals.updateMgr != NULL)
283 {
284 if (*toParam <= 0.0f)
285 {
286 xUpdateCull_SetCB(globals.updateMgr, ent, xUpdateCull_AlwaysTrueCB, NULL);
287 }
288 else
289 {
290 dist.f = *toParam * *toParam;
291 xUpdateCull_SetCB(globals.updateMgr, ent, xUpdateCull_DistanceSquaredCB, dist.v);

Callers

nothing calls this directly

Calls 7

xEntIsVisibleFunction · 0.85
xEntShowFunction · 0.85
xEntHideFunction · 0.85
zEntHangableMountFXFunction · 0.85
zEntHangable_ResetFunction · 0.85
zEntHangable_SetFollowFunction · 0.85
xUpdateCull_SetCBFunction · 0.50

Tested by

no test coverage detected