MCPcopy Create free account
hub / github.com/demoth/jake2 / AddParticles

Method AddParticles

client/src/main/java/jake2/client/CL_fx.java:2051–2105  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2049 * =============== CL_AddParticles ===============
2050 */
2051 static void AddParticles() {
2052 cparticle_t p, next;
2053 float alpha;
2054 float time = 0.0f;
2055 float time2;
2056 int color;
2057 cparticle_t active, tail;
2058
2059 active = null;
2060 tail = null;
2061
2062 for (p = active_particles; p != null; p = next) {
2063 next = p.next;
2064
2065 // PMM - added INSTANT_PARTICLE handling for heat beam
2066 if (p.alphavel != INSTANT_PARTICLE) {
2067 time = (ClientGlobals.cl.time - p.time) * 0.001f;
2068 alpha = p.alpha + time * p.alphavel;
2069 if (alpha <= 0) { // faded out
2070 p.next = free_particles;
2071 free_particles = p;
2072 continue;
2073 }
2074 } else {
2075 alpha = p.alpha;
2076 }
2077
2078 p.next = null;
2079 if (tail == null)
2080 active = tail = p;
2081 else {
2082 tail.next = p;
2083 tail = p;
2084 }
2085
2086 if (alpha > 1.0)
2087 alpha = 1;
2088 color = (int) p.color;
2089
2090 time2 = time * time;
2091
2092 org[0] = p.org[0] + p.vel[0] * time + p.accel[0] * time2;
2093 org[1] = p.org[1] + p.vel[1] * time + p.accel[1] * time2;
2094 org[2] = p.org[2] + p.vel[2] * time + p.accel[2] * time2;
2095
2096 V.AddParticle(org, color, alpha);
2097 // PMM
2098 if (p.alphavel == INSTANT_PARTICLE) {
2099 p.alphavel = 0.0f;
2100 p.alpha = 0.0f;
2101 }
2102 }
2103
2104 active_particles = active;
2105 }
2106
2107 /*
2108 * ============== CL_EntityEvent

Callers 1

AddEntitiesMethod · 0.95

Calls 1

AddParticleMethod · 0.95

Tested by

no test coverage detected