MCPcopy Create free account
hub / github.com/assaultcube/AC / newparticle

Function newparticle

source/src/renderparticles.cpp:224–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void newparticle(const vec &o, const vec &d, int fade, int type)
225{
226 if(OUTBORD((int)o.x, (int)o.y)) return;
227
228 if(!parempty)
229 {
230 particle *ps = new particle[256];
231 loopi(256)
232 {
233 ps[i].next = parempty;
234 parempty = &ps[i];
235 }
236 }
237
238 particle *p = parempty;
239 parempty = p->next;
240 p->o = o;
241 p->d = d;
242 p->fade = fade;
243 p->type = type;
244 p->millis = lastmillis;
245 p->next = parlist[type];
246 parlist[type] = p;
247}
248
249const char *particletypenames[MAXPARTYPES + 1] = { "SPARK", "SMOKE", "ECLOSEST", "BLOOD", "DEMOTRACK", "FIREBALL", "SHOTLINE", "BULLETHOLE", "BLOODSTAIN", "SCORCH", // 0..9
250 "HUDMUZZLEFLASH", "MUZZLEFLASH", "ELIGHT", "ESPAWN", "EAMMO", "EPICKUP", "EMODEL", "ECARROT", "ELADDER", "EFLAG", "" }; // 10..19

Callers 8

render_particlesFunction · 0.85
particle_flashFunction · 0.85
loopiFunction · 0.85
particle_cubeFunction · 0.85
particle_fireballFunction · 0.85
addbulletholeFunction · 0.85
addscorchmarkFunction · 0.85
addshotlineFunction · 0.85

Calls 1

loopiFunction · 0.70

Tested by

no test coverage detected