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

Method insert_player_animations

src/SB/Game/zEntCruiseBubble.cpp:2459–2509  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2457 }
2458
2459 void cruise_bubble::insert_player_animations(xAnimTable& table)
2460 {
2461 if (shared.astate.player.aim != NULL)
2462 {
2463 return;
2464 }
2465
2466 shared.astate.player.aim =
2467 xAnimTableNewState(&table, "cruise_bubble_aim", 0x10, 0, 1.0f, NULL, NULL, 0.0f,
2468 NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
2469
2470 shared.astate.player.fire =
2471 xAnimTableNewState(&table, "cruise_bubble_fire", 0x20, 0, 1.0f, NULL, NULL, 0.0f,
2472 NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
2473
2474 shared.astate.player.idle =
2475 xAnimTableNewState(&table, "cruise_bubble_idle", 0x10, 0, 1.0f, NULL, NULL, 0.0f,
2476 NULL, NULL, xAnimDefaultBeforeEnter, NULL, NULL);
2477
2478 char* start_from = (char*)xMemPushTemp(0x250);
2479 memset(start_from, 0, 0x250);
2480 char* s = start_from;
2481 *s = '\0';
2482 for (U32 i = 0; i < 37; ++i)
2483 {
2484 strcat(s, start_anim_states[i]);
2485 s += strlen(s);
2486 *s = ' ';
2487 *++s = '\0';
2488 }
2489
2490 shared.atran.player.aim =
2491 xAnimTableNewTransition(&table, start_from, "cruise_bubble_aim",
2492 (xAnimTransitionConditionalCallback)&check_anim_aim, NULL,
2493 0, 0, 0.0f, 0.0f, 0, 0, 0.15f, NULL);
2494
2495 shared.atran.player.fire =
2496 xAnimTableNewTransition(&table, "cruise_bubble_aim", "cruise_bubble_fire", NULL,
2497 NULL, 0, 0, 0.0f, 0.0f, 0, 0, 0.15f, NULL);
2498
2499 shared.atran.player.idle =
2500 xAnimTableNewTransition(&table, "cruise_bubble_fire", "cruise_bubble_idle", NULL,
2501 NULL, 0x10, 0, 0.0f, 0.0f, 0, 0, 0.15f, NULL);
2502
2503 shared.atran.player.end =
2504 xAnimTableNewTransition(&table,
2505 "cruise_bubble_aim cruise_bubble_fire cruise_bubble_idle",
2506 "Idle01", NULL, NULL, 0, 0, 0.0f, 0.0f, 0, 0, 0.15f, NULL);
2507
2508 xMemPopTemp(start_from);
2509 }
2510
2511 xAnimTable* cruise_bubble::anim_table()
2512 {

Callers

nothing calls this directly

Calls 6

memsetFunction · 0.85
strcatFunction · 0.85
xMemPopTempFunction · 0.85
xAnimTableNewStateFunction · 0.50
xMemPushTempFunction · 0.50
xAnimTableNewTransitionFunction · 0.50

Tested by

no test coverage detected