MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / GetFreeSmokeSpark

Function GetFreeSmokeSpark

TombEngine/Game/effects/tomb4fx.cpp:496–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494}
495
496int GetFreeSmokeSpark()
497{
498 SMOKE_SPARKS* spark = &SmokeSparks[NextSmokeSpark];
499 int sparkNum = NextSmokeSpark;
500 short minLife = 4095;
501 short minIndex = 0;
502 short count = 0;
503 while (spark->on)
504 {
505 if (spark->life < minLife)
506 {
507 minIndex = sparkNum;
508 minLife = spark->life;
509 }
510
511 if (sparkNum == MAX_SPARKS_SMOKE - 1)
512 {
513 spark = &SmokeSparks[0];
514 sparkNum = 0;
515 }
516 else
517 {
518 sparkNum++;
519 spark++;
520 }
521
522 if (++count >= MAX_SPARKS_SMOKE)
523 {
524 NextSmokeSpark = (minIndex + 1) % MAX_SPARKS_SMOKE;
525 return minIndex;
526 }
527 }
528
529 NextSmokeSpark = (sparkNum + 1) % MAX_SPARKS_SMOKE;
530
531 return sparkNum;
532}
533
534void UpdateSmoke()
535{

Callers 6

RomanStatueHitEffectFunction · 0.85
SpawnAutoGunSmokeFunction · 0.85
TriggerHammerSmokeFunction · 0.85
TriggerFlashSmokeFunction · 0.85
TriggerChaffSmokeFunction · 0.85
TriggerShatterSmokeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected