diff options
Diffstat (limited to 'src/jake2/client/CL_fx.java')
-rw-r--r-- | src/jake2/client/CL_fx.java | 90 |
1 files changed, 41 insertions, 49 deletions
diff --git a/src/jake2/client/CL_fx.java b/src/jake2/client/CL_fx.java index 86642ee..2a77d21 100644 --- a/src/jake2/client/CL_fx.java +++ b/src/jake2/client/CL_fx.java @@ -2,7 +2,7 @@ * CL_fx.java * Copyright (C) 2004 * - * $Id: CL_fx.java,v 1.2 2004-07-08 15:58:42 hzi Exp $ + * $Id: CL_fx.java,v 1.3 2004-07-08 20:24:29 hzi Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package jake2.client; +import jake2.Globals; import jake2.game.M_Flash; import jake2.game.entity_state_t; import jake2.qcommon.Com; @@ -239,11 +240,10 @@ public class CL_fx extends CL_tent { =============== */ static void RunDLights() { - int i; cdlight_t[] dl; dl = cl_dlights; - for (i = 0; i < MAX_DLIGHTS; i++) { + for (int i = 0; i < MAX_DLIGHTS; i++) { if (dl[i].radius == 0.0f) continue; @@ -265,24 +265,20 @@ public class CL_fx extends CL_tent { static void ParseMuzzleFlash() { float[] fv = new float[3]; float[] rv = new float[3]; - cdlight_t dl; - int i, weapon; - centity_t pl; - int silenced; float volume; String soundname; - i = MSG.ReadShort(net_message); + int i = MSG.ReadShort(net_message); if (i < 1 || i >= MAX_EDICTS) Com.Error(ERR_DROP, "CL_ParseMuzzleFlash: bad entity"); - weapon = MSG.ReadByte(net_message); - silenced = weapon & MZ_SILENCED; + int weapon = MSG.ReadByte(net_message); + int silenced = weapon & MZ_SILENCED; weapon &= ~MZ_SILENCED; - pl = cl_entities[i]; + centity_t pl = cl_entities[i]; - dl = CL.AllocDlight(i); + cdlight_t dl = CL.AllocDlight(i); VectorCopy(pl.current.origin, dl.origin); AngleVectors(pl.current.angles, fv, rv, null); VectorMA(dl.origin, 18, fv, dl.origin); @@ -513,19 +509,16 @@ public class CL_fx extends CL_tent { ============== */ static void ParseMuzzleFlash2() { - int ent; float[] origin = new float[3]; - int flash_number; - cdlight_t dl; float[] forward = new float[3]; float[] right = new float[3]; String soundname; - ent = MSG.ReadShort(net_message); + int ent = MSG.ReadShort(net_message); if (ent < 1 || ent >= MAX_EDICTS) Com.Error(ERR_DROP, "CL_ParseMuzzleFlash2: bad entity"); - flash_number = MSG.ReadByte(net_message); + int flash_number = MSG.ReadByte(net_message); // locate the origin AngleVectors(cl_entities[ent].current.angles, forward, right, null); @@ -543,7 +536,7 @@ public class CL_fx extends CL_tent { + right[2] * M_Flash.monster_flash_offset[flash_number][1] + M_Flash.monster_flash_offset[flash_number][2]; - dl = CL.AllocDlight(ent); + cdlight_t dl = CL.AllocDlight(ent); VectorCopy(origin, dl.origin); dl.radius = 200 + (rnd.nextInt() & 31); dl.minlight = 32; @@ -960,9 +953,8 @@ public class CL_fx extends CL_tent { */ static void AddDLights() { int i; - cdlight_t[] dl; - - dl = cl_dlights; + + cdlight_t[] dl = cl_dlights; // ===== // PGM @@ -1059,7 +1051,7 @@ public class CL_fx extends CL_tent { p.accel[2] = -PARTICLE_GRAVITY; p.alpha = 1.0f; - p.alphavel = -1.0f / (0.5f + frand() * 0.3f); + p.alphavel = -1.0f / (0.5f + Globals.rnd.nextFloat() * 0.3f); } } @@ -1094,7 +1086,7 @@ public class CL_fx extends CL_tent { p.accel[2] = -PARTICLE_GRAVITY; p.alpha = 1.0f; - p.alphavel = -1.0f / (0.5f + frand() * 0.3f); + p.alphavel = -1.0f / (0.5f + Globals.rnd.nextFloat() * 0.3f); } } @@ -1130,7 +1122,7 @@ public class CL_fx extends CL_tent { p.accel[2] = PARTICLE_GRAVITY; p.alpha = 1.0f; - p.alphavel = -1.0f / (0.5f + frand() * 0.3f); + p.alphavel = -1.0f / (0.5f + Globals.rnd.nextFloat() * 0.3f); } } @@ -1197,9 +1189,9 @@ public class CL_fx extends CL_tent { else p.color = 0xe0 + (rand() & 7); // yellow - p.org[0] = org[0] - 16 + frand() * 32; - p.org[1] = org[1] - 16 + frand() * 32; - p.org[2] = org[2] - 24 + frand() * 56; + p.org[0] = org[0] - 16 + Globals.rnd.nextFloat() * 32; + p.org[1] = org[1] - 16 + Globals.rnd.nextFloat() * 32; + p.org[2] = org[2] - 24 + Globals.rnd.nextFloat() * 56; for (j = 0; j < 3; j++) p.vel[j] = crand() * 20; @@ -1208,7 +1200,7 @@ public class CL_fx extends CL_tent { p.accel[2] = -PARTICLE_GRAVITY; p.alpha = 1.0f; - p.alphavel = -1.0f / (1.0f + frand() * 0.3f); + p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.3f); } } @@ -1245,7 +1237,7 @@ public class CL_fx extends CL_tent { p.accel[2] = -PARTICLE_GRAVITY * 0.2f; p.alpha = 1.0f; - p.alphavel = -1.0f / (1.0f + frand() * 0.3f); + p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.3f); } } @@ -1278,7 +1270,7 @@ public class CL_fx extends CL_tent { p.accel[2] = -PARTICLE_GRAVITY; p.alpha = 1.0f; - p.alphavel = -0.8f / (0.5f + frand() * 0.3f); + p.alphavel = -0.8f / (0.5f + Globals.rnd.nextFloat() * 0.3f); } } @@ -1320,7 +1312,7 @@ public class CL_fx extends CL_tent { p.accel[2] = PARTICLE_GRAVITY * 4; p.alpha = 1.0f; - p.alphavel = -0.3f / (0.5f + frand() * 0.3f); + p.alphavel = -0.3f / (0.5f + Globals.rnd.nextFloat() * 0.3f); } } @@ -1359,7 +1351,7 @@ public class CL_fx extends CL_tent { p.accel[2] = -PARTICLE_GRAVITY; p.alpha = 1.0f; - p.alphavel = -1.0f / (0.5f + frand() * 0.3f); + p.alphavel = -1.0f / (0.5f + Globals.rnd.nextFloat() * 0.3f); } } @@ -1399,7 +1391,7 @@ public class CL_fx extends CL_tent { p.time = cl.time; p.alpha = 1.0f; - p.alphavel = -1.0f / (0.3f + frand() * 0.2f); + p.alphavel = -1.0f / (0.3f + Globals.rnd.nextFloat() * 0.2f); p.color = 0xe0; for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand(); @@ -1446,7 +1438,7 @@ public class CL_fx extends CL_tent { p.time = cl.time; p.alpha = 1.0f; - p.alphavel = -1.0f / (0.8f + frand() * 0.2f); + p.alphavel = -1.0f / (0.8f + Globals.rnd.nextFloat() * 0.2f); p.color = 115; for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * 16; @@ -1493,7 +1485,7 @@ public class CL_fx extends CL_tent { p.time = cl.time; p.alpha = 1.0f; - p.alphavel = -1.0f / (0.8f + frand() * 0.2f); + p.alphavel = -1.0f / (0.8f + Globals.rnd.nextFloat() * 0.2f); p.color = color; for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * 16; @@ -1557,7 +1549,7 @@ public class CL_fx extends CL_tent { if ((flags & EF_GIB) != 0) { p.alpha = 1.0f; - p.alphavel = -1.0f / (1.0f + frand() * 0.4f); + p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.4f); p.color = 0xe8 + (rand() & 7); for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * orgscale; @@ -1567,7 +1559,7 @@ public class CL_fx extends CL_tent { p.vel[2] -= PARTICLE_GRAVITY; } else if ((flags & EF_GREENGIB) != 0) { p.alpha = 1.0f; - p.alphavel = -1.0f / (1.0f + frand() * 0.4f); + p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.4f); p.color = 0xdb + (rand() & 7); for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * orgscale; @@ -1577,7 +1569,7 @@ public class CL_fx extends CL_tent { p.vel[2] -= PARTICLE_GRAVITY; } else { p.alpha = 1.0f; - p.alphavel = -1.0f / (1.0f + frand() * 0.2f); + p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.2f); p.color = 4 + (rand() & 7); for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * orgscale; @@ -1635,7 +1627,7 @@ public class CL_fx extends CL_tent { p.time = cl.time; p.alpha = 1.0f; - p.alphavel = -1.0f / (1.0f + frand() * 0.2f); + p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.2f); p.color = 0xdc + (rand() & 3); for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * 5; @@ -1693,7 +1685,7 @@ public class CL_fx extends CL_tent { VectorMA(dir, s, up, dir); p.alpha = 1.0f; - p.alphavel = -1.0f / (1.0f + frand() * 0.2f); + p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.2f); p.color = clr + (rand() & 7); for (j = 0; j < 3; j++) { p.org[j] = move[j] + dir[j] * 3; @@ -1721,7 +1713,7 @@ public class CL_fx extends CL_tent { VectorClear(p.accel); p.alpha = 1.0f; - p.alphavel = -1.0f / (0.6f + frand() * 0.2f); + p.alphavel = -1.0f / (0.6f + Globals.rnd.nextFloat() * 0.2f); p.color = 0x0 + rand() & 15; for (j = 0; j < 3; j++) { @@ -1769,7 +1761,7 @@ public class CL_fx extends CL_tent { p.time = cl.time; p.alpha = 0.5f; - p.alphavel = -1.0f / (0.3f + frand() * 0.2f); + p.alphavel = -1.0f / (0.3f + Globals.rnd.nextFloat() * 0.2f); p.color = 0xe4 + (rand() & 3); for (j = 0; j < 3; j++) { @@ -1825,7 +1817,7 @@ public class CL_fx extends CL_tent { p.time = cl.time; p.alpha = 1.0f; - p.alphavel = -1.0f / (1.0f + frand() * 0.2f); + p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.2f); p.color = 4 + (rand() & 7); for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * 2; @@ -2041,7 +2033,7 @@ public class CL_fx extends CL_tent { p.time = cl.time; p.alpha = 1.0f; - p.alphavel = -1.0f / (0.3f + frand() * 0.2f); + p.alphavel = -1.0f / (0.3f + Globals.rnd.nextFloat() * 0.2f); p.color = 0xe0; for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand(); @@ -2127,7 +2119,7 @@ public class CL_fx extends CL_tent { p.accel[2] = -PARTICLE_GRAVITY; p.alpha = 1.0f; - p.alphavel = -0.8f / (0.5f + frand() * 0.3f); + p.alphavel = -0.8f / (0.5f + Globals.rnd.nextFloat() * 0.3f); } } @@ -2138,14 +2130,14 @@ public class CL_fx extends CL_tent { =============== */ static void TeleportParticles(float[] org) { - int i, j, k; + cparticle_t p; float vel; float[] dir = new float[3]; - for (i = -16; i <= 16; i += 4) - for (j = -16; j <= 16; j += 4) - for (k = -16; k <= 32; k += 4) { + for (int i = -16; i <= 16; i += 4) + for (int j = -16; j <= 16; j += 4) + for (int k = -16; k <= 32; k += 4) { if (free_particles == null) return; p = free_particles; |