diff options
author | Holger Zickner <[email protected]> | 2004-07-08 15:58:48 +0000 |
---|---|---|
committer | Holger Zickner <[email protected]> | 2004-07-08 15:58:48 +0000 |
commit | 4f13ea26c4f47e54e66926f0700cf631e7bb3352 (patch) | |
tree | a9d434fc462417bb981b1565fd64cea5e7c82c15 /src/jake2/client/CL_fx.java | |
parent | 76839da3568e20f51220584d1fc92841b216505a (diff) |
import of Jake2 version hannover
Diffstat (limited to 'src/jake2/client/CL_fx.java')
-rw-r--r-- | src/jake2/client/CL_fx.java | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/src/jake2/client/CL_fx.java b/src/jake2/client/CL_fx.java index 1ce63ad..86642ee 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.1 2004-07-07 19:58:36 hzi Exp $ + * $Id: CL_fx.java,v 1.2 2004-07-08 15:58:42 hzi Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -125,7 +125,7 @@ public class CL_fx extends CL_tent { s = cl.configstrings[i + CS_LIGHTS]; - j = strlen(s); + j = s.length(); if (j >= MAX_QPATH) Com.Error(ERR_DROP, "svc_lightstyle length=" + j); @@ -288,9 +288,9 @@ public class CL_fx extends CL_tent { VectorMA(dl.origin, 18, fv, dl.origin); VectorMA(dl.origin, 16, rv, dl.origin); if (silenced != 0) - dl.radius = 100 + (rand() & 31); + dl.radius = 100 + (rnd.nextInt() & 31); else - dl.radius = 200 + (rand() & 31); + dl.radius = 200 + (rnd.nextInt() & 31); dl.minlight = 32; dl.die = cl.time; // + 0.1; @@ -323,7 +323,7 @@ public class CL_fx extends CL_tent { dl.color[1] = 1; dl.color[2] = 0; //Com_sprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1); - soundname = "weapons/machgf" + ((rand() % 5) + 1) + "b.wav"; + soundname = "weapons/machgf" + ((rnd.nextInt(5)) + 1) + "b.wav"; S.StartSound(null, i, CHAN_WEAPON, S.RegisterSound(soundname), volume, ATTN_NORM, 0); break; case MZ_SHOTGUN : @@ -340,41 +340,41 @@ public class CL_fx extends CL_tent { S.StartSound(null, i, CHAN_WEAPON, S.RegisterSound("weapons/sshotf1b.wav"), volume, ATTN_NORM, 0); break; case MZ_CHAINGUN1 : - dl.radius = 200 + (rand() & 31); + dl.radius = 200 + (rnd.nextInt() & 31); dl.color[0] = 1; dl.color[1] = 0.25f; dl.color[2] = 0; //Com_sprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1); - soundname = "weapons/machgf" + ((rand() % 5) + 1) + "b.wav"; + soundname = "weapons/machgf" + ((rnd.nextInt(5)) + 1) + "b.wav"; S.StartSound(null, i, CHAN_WEAPON, S.RegisterSound(soundname), volume, ATTN_NORM, 0); break; case MZ_CHAINGUN2 : - dl.radius = 225 + (rand() & 31); + dl.radius = 225 + (rnd.nextInt() & 31); dl.color[0] = 1; dl.color[1] = 0.5f; dl.color[2] = 0; dl.die = cl.time + 0.1f; // long delay //Com_sprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1); - soundname = "weapons/machgf" + ((rand() % 5) + 1) + "b.wav"; + soundname = "weapons/machgf" + ((rnd.nextInt(5)) + 1) + "b.wav"; S.StartSound(null, i, CHAN_WEAPON, S.RegisterSound(soundname), volume, ATTN_NORM, 0); //Com_sprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1); - soundname = "weapons/machgf" + ((rand() % 5) + 1) + "b.wav"; + soundname = "weapons/machgf" + ((rnd.nextInt(5)) + 1) + "b.wav"; S.StartSound(null, i, CHAN_WEAPON, S.RegisterSound(soundname), volume, ATTN_NORM, 0.05f); break; case MZ_CHAINGUN3 : - dl.radius = 250 + (rand() & 31); + dl.radius = 250 + (rnd.nextInt() & 31); dl.color[0] = 1; dl.color[1] = 1; dl.color[2] = 0; dl.die = cl.time + 0.1f; // long delay //Com_sprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1); - soundname = "weapons/machgf" + ((rand() % 5) + 1) + "b.wav"; + soundname = "weapons/machgf" + ((rnd.nextInt(5)) + 1) + "b.wav"; S.StartSound(null, i, CHAN_WEAPON, S.RegisterSound(soundname), volume, ATTN_NORM, 0); //Com_sprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1); - soundname = "weapons/machgf" + ((rand() % 5) + 1) + "b.wav"; + soundname = "weapons/machgf" + ((rnd.nextInt(5)) + 1) + "b.wav"; S.StartSound(null, i, CHAN_WEAPON, S.RegisterSound(soundname), volume, ATTN_NORM, 0.033f); //Com_sprintf(soundname, sizeof(soundname), "weapons/machgf%ib.wav", (rand() % 5) + 1); - soundname = "weapons/machgf" + ((rand() % 5) + 1) + "b.wav"; + soundname = "weapons/machgf" + ((rnd.nextInt(5)) + 1) + "b.wav"; S.StartSound(null, i, CHAN_WEAPON, S.RegisterSound(soundname), volume, ATTN_NORM, 0.066f); break; case MZ_RAILGUN : @@ -545,7 +545,7 @@ public class CL_fx extends CL_tent { dl = CL.AllocDlight(ent); VectorCopy(origin, dl.origin); - dl.radius = 200 + (rand() & 31); + dl.radius = 200 + (rnd.nextInt() & 31); dl.minlight = 32; dl.die = cl.time; // + 0.1; @@ -729,7 +729,7 @@ public class CL_fx extends CL_tent { CL.ParticleEffect(origin, vec3_origin, 0, 40); CL.SmokeAndFlash(origin); //Com_sprintf(soundname, sizeof(soundname), "tank/tnkatk2%c.wav", 'a' + rand() % 5); - soundname = "tank/tnkatk2" + (char) ('a' + rand() % 5) + ".wav"; + soundname = "tank/tnkatk2" + (char) ('a' + rnd.nextInt(5)) + ".wav"; S.StartSound(null, ent, CHAN_WEAPON, S.RegisterSound(soundname), 1, ATTN_NORM, 0); break; @@ -938,7 +938,7 @@ public class CL_fx extends CL_tent { case MZ2_WIDOW2_BEAM_SWEEP_9 : case MZ2_WIDOW2_BEAM_SWEEP_10 : case MZ2_WIDOW2_BEAM_SWEEP_11 : - dl.radius = 300 + (rand() & 100); + dl.radius = 300 + (rnd.nextInt() & 100); dl.color[0] = 1; dl.color[1] = 1; dl.color[2] = 0; @@ -1848,7 +1848,7 @@ public class CL_fx extends CL_tent { int i; cparticle_t p; float angle; - float sr, sp, sy, cr, cp, cy; + float sp, sy, cp, cy; float [] forward= new float[3]; float dist = 64; float ltime; @@ -1877,8 +1877,6 @@ public class CL_fx extends CL_tent { sp = (float)Math.sin(angle); cp = (float)Math.cos(angle); angle = ltime * avelocities[i][2]; - sr = (float)Math.sin(angle); - cr = (float)Math.cos(angle); forward[0] = cp*cy; forward[1] = cp*sy; @@ -1945,7 +1943,7 @@ public class CL_fx extends CL_tent { int i; cparticle_t p; float angle; - float sr, sp, sy, cr, cp, cy; + float sp, sy, cp, cy; float[] forward = new float[3]; float dist = 64; float[] v = new float[3]; @@ -1968,8 +1966,6 @@ public class CL_fx extends CL_tent { sp = (float)Math.sin(angle); cp = (float)Math.cos(angle); angle = ltime * avelocities[i][2]; - sr = (float)Math.sin(angle); - cr = (float)Math.cos(angle); forward[0] = cp * cy; forward[1] = cp * sy; |