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

Function zParPTankSpawnSnow

src/SB/Game/zParPTank.cpp:582–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

580}
581
582void zParPTankSpawnSnow(xVec3* pos, xVec3* vel, U32 count)
583{
584 if (zGameIsPaused())
585 {
586 return;
587 }
588
589 zParPTank* zp = sSnowPTank;
590 U32 old_size = zp->num_particles;
591 zp->num_particles = old_size + count;
592
593 if (zp->num_particles > zp->max_particles)
594 {
595 zp->num_particles = zp->max_particles;
596 }
597
598 snow_particle_data* it = snow_particles + old_size;
599 snow_particle_data* end = it + (zp->num_particles - old_size);
600
601 for (; it != end; it++)
602 {
603 it->loc = *pos;
604 it->vel = *vel;
605 it->life = snow_life;
606
607 it->size = 0.15f * xurand() + 0.15f;
608 it->u = 0.125f * ((xrand() >> 13) & 0x7);
609
610 pos++;
611 vel++;
612 }
613}
614
615const RwV2d steam_size = { 0.4f, 0.4f };
616

Callers 1

UpdateRainFunction · 0.50

Calls 3

zGameIsPausedFunction · 0.85
xurandFunction · 0.85
xrandFunction · 0.85

Tested by

no test coverage detected