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

Function xEnt_AnimTable_AutoEventSmall

src/SB/Game/zEnt.cpp:551–592  ·  view source on GitHub ↗

Thank you floating point memes. Very cool.

Source from the content-addressed store, hash-verified

549};
550// Thank you floating point memes. Very cool.
551xAnimTable* xEnt_AnimTable_AutoEventSmall()
552{
553 char** names = g_strz_xentanim;
554 U32* hash = g_hash_xentanim;
555 xAnimTransition* deftran = NULL;
556 if (*hash == 0)
557 {
558 for (S32 i = 0; i < 5; i++)
559 {
560 hash[i] = xStrHash(names[i]);
561 }
562 }
563
564 xAnimTable* table = xAnimTableNew("xEntAutoEventSimple", NULL, 0);
565
566 for (S32 i = 0; i < 5; i++)
567 {
568 if (i == 0)
569 {
570 xAnimTableNewState(table, names[i], 0x10, 1, 1.0f, NULL, NULL, 0.0f, NULL, NULL,
571 xAnimDefaultBeforeEnter, NULL, NULL);
572 }
573 else
574 {
575 xAnimTableNewState(table, names[i], 0x20, 1, 1.0f, NULL, NULL, 0.0f, NULL, NULL,
576 xAnimDefaultBeforeEnter, NULL, NULL);
577 }
578 if (deftran != NULL)
579 {
580 xAnimTableAddTransition(table, deftran, names[i]);
581 }
582 else
583 {
584 if (i != 0)
585 {
586 deftran = xAnimTableNewTransition(table, names[i], names[0], 0, 0, 0x10, 0, 0.0f,
587 0.0f, 1, 0, 0.25f, 0);
588 }
589 }
590 }
591 return table;
592}
593
594// This function needs the floats to be replaced with literals
595// and the jumptable to be generated in the right spot.

Callers

nothing calls this directly

Calls 5

xAnimTableAddTransitionFunction · 0.85
xStrHashFunction · 0.50
xAnimTableNewFunction · 0.50
xAnimTableNewStateFunction · 0.50
xAnimTableNewTransitionFunction · 0.50

Tested by

no test coverage detected