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

Function zEntAnimEvent

src/SB/Game/zEnt.cpp:387–544  ·  view source on GitHub ↗

This function suffers from a couple floating point memes Additionally it has a jumptable that needs to be generated in the correct place.

Source from the content-addressed store, hash-verified

385// This function suffers from a couple floating point memes
386// Additionally it has a jumptable that needs to be generated in the correct place.
387void zEntAnimEvent(zEnt* ent, U32 animEvent, const F32* animParam)
388{
389 xAnimPlay* play = ent->model->Anim;
390 if (play == NULL)
391 {
392 return;
393 }
394
395 xAnimSingle* single = play->Single;
396 if (single == NULL)
397 {
398 return;
399 }
400
401 if (ent->miscflags & 1)
402 {
403 zEntAnimEvent_AutoAnim(ent, animEvent, animParam);
404 }
405 else
406 {
407 switch (animEvent)
408 {
409 case 0xc3:
410 case 0xc4:
411 if (animParam == NULL)
412 {
413 break;
414 }
415
416 S32 anum = (int)*animParam - 1;
417 if (anum < 0 || anum >= 10 || ent->atbl == NULL)
418 {
419 break;
420 }
421
422 char name[12];
423 if (animEvent == 0xc4)
424 {
425 sprintf(name, "loop%d", anum);
426 }
427 else
428 {
429 sprintf(name, "stop%d", anum);
430 }
431
432 xAnimState* ast = xAnimTableGetState(ent->atbl, name);
433 if (ast == NULL)
434 {
435 break;
436 }
437
438 xAnimPlaySetState(single, ast, 0.0f);
439 single->CurrentSpeed = 1.0f;
440 xAnimPlayUpdate(play, 0.0f);
441 xAnimPlayEval(play);
442
443 if (ent->asset->modelInfoID != 0x8D398D0C /*is this an address???*/ ||
444 animEvent != 0xc3)

Callers 6

zPendulumEventCBFunction · 0.70
zEntSimpleObjEventCBFunction · 0.70
zEntButtonEventCBFunction · 0.70
PlatAnimSetMethod · 0.70
zEntDestructObjEventCBFunction · 0.70
zPlatformEventCBFunction · 0.70

Calls 11

sprintfFunction · 0.85
xAnimTableGetStateFunction · 0.85
xAnimPlaySetStateFunction · 0.85
strcmpFunction · 0.85
xrandFunction · 0.85
xurandFunction · 0.85
zEntAnimEvent_AutoAnimFunction · 0.70
xSndPlay3DFunction · 0.70
xAnimPlayUpdateFunction · 0.50
xAnimPlayEvalFunction · 0.50
xStrHashFunction · 0.50

Tested by

no test coverage detected