MCPcopy Index your code
hub / github.com/assaultcube/AC / particle_cube

Function particle_cube

source/src/renderparticles.cpp:584–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

582}
583
584void particle_cube(int type, int num, int fade, int x, int y)
585{
586 sqr *s = S(x, y);
587 const int fc = s->ceil - s->floor + (s->vdelta + 3) / 4;
588 const float floor = s->floor - (s->type == FHF ? float(s->vdelta) / 4 : 0);
589 if(SOLID(s) || fc < 1) return;
590 loopi(num * fc / 12)
591 {
592 vec p(float(rnd(100)) / 100.0 + x, float(rnd(100)) / 100.0 + y, float(rnd(100) * fc) / 100 + floor), d(0, 0, 0);
593 newparticle(p, d, rnd(fade*3), type);
594 }
595}
596
597VARP(maxtrail, 1, 500, 10000);
598

Callers 2

cursorupdateFunction · 0.85
loopvFunction · 0.85

Calls 2

newparticleFunction · 0.85
loopiFunction · 0.70

Tested by

no test coverage detected