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

Function SingleUpdate

src/SB/Core/x/xAnim.cpp:1465–1770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1463}
1464
1465static void SingleUpdate(xAnimSingle* single, F32 timeDelta)
1466{
1467 U32 foundBlendstop = 0;
1468 U32 firstStep = 1;
1469 xAnimTransition* foundTransition = NULL;
1470 xAnimSingle* bl = NULL;
1471 F32 tranDelta = 0.0f;
1472 F32 blendDelta = 0.0f;
1473 F32 singleTime;
1474 if (single->State == NULL)
1475 {
1476 return;
1477 }
1478
1479 void* object = single->Play->Object;
1480 if (single->LastTime == -1.0f)
1481 {
1482 EffectSingleStart(single);
1483 }
1484
1485 single->LastTime = single->Time;
1486 singleTime = timeDelta * single->CurrentSpeed + single->Time;
1487
1488 if (single->Blend != NULL && single->Blend->State != NULL)
1489 {
1490 bl = single->Blend;
1491 if (bl->LastTime == -1.0f)
1492 {
1493 EffectSingleStart(bl);
1494 }
1495 bl->LastTime = bl->Time;
1496 }
1497
1498 F32 duration = single->State->Data->Duration;
1499 if (single->Sync != NULL)
1500 {
1501 // FIXME: assignment in the loop seems unlikely but assigning at the
1502 // declaration swaps instructions.
1503 F32 timeCmp;
1504 if ((timeCmp = single->Sync->SrcTime) != 0.0f)
1505 {
1506 if (timeCmp > duration)
1507 {
1508 timeCmp = duration;
1509 }
1510 if (single->LastTime <= timeCmp && singleTime >= timeCmp)
1511 {
1512 foundTransition = single->Sync;
1513 tranDelta = (singleTime - timeCmp) / single->CurrentSpeed;
1514 timeDelta = timeDelta - tranDelta;
1515 if (timeDelta < 0.0f)
1516 {
1517 timeDelta = 0.0f;
1518 }
1519 }
1520 else
1521 {
1522 timeCmp += duration;

Callers 1

xAnimPlayUpdateFunction · 0.70

Calls 10

fprintfFunction · 0.85
memcpyFunction · 0.85
TransitionTimeInitFunction · 0.85
LoopUpdateFunction · 0.85
StopUpdateFunction · 0.85
EffectSingleStartFunction · 0.70
EffectSingleStopFunction · 0.70
xMemPoolFreeFunction · 0.70
EffectSingleRunFunction · 0.70
EffectSingleDurationFunction · 0.70

Tested by

no test coverage detected