Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8896/src/jake2/client Modified Files: Tag: RST Menu.java CL_tent.java CL_fx.java CL_parse.java CL_ents.java CL_newfx.java CL_input.java V.java Log Message: added debug messages, fixed cooperative multiplayer bugs. Index: CL_ents.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_ents.java,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -C2 -d -r1.7 -r1.7.6.1 *** CL_ents.java 11 Oct 2004 14:04:16 -0000 1.7 --- CL_ents.java 23 Jan 2005 21:31:27 -0000 1.7.6.1 *************** *** 61,72 **** --- 61,75 ---- total = MSG.ReadByte(Globals.net_message); if ((total & Defines.U_MOREBITS1) != 0) { + b = MSG.ReadByte(Globals.net_message); total |= b << 8; } if ((total & Defines.U_MOREBITS2) != 0) { + b = MSG.ReadByte(Globals.net_message); total |= b << 16; } if ((total & Defines.U_MOREBITS3) != 0) { + b = MSG.ReadByte(Globals.net_message); total |= b << 24; *************** *** 102,112 **** if ((bits & Defines.U_MODEL) != 0) ! to.modelindex = MSG.ReadByte(Globals.net_message); if ((bits & Defines.U_MODEL2) != 0) ! to.modelindex2 = MSG.ReadByte(Globals.net_message); if ((bits & Defines.U_MODEL3) != 0) ! to.modelindex3 = MSG.ReadByte(Globals.net_message); if ((bits & Defines.U_MODEL4) != 0) to.modelindex4 = MSG.ReadByte(Globals.net_message); if ((bits & Defines.U_FRAME8) != 0) --- 105,123 ---- if ((bits & Defines.U_MODEL) != 0) ! { ! to.modelindex = MSG.ReadByte(Globals.net_message); ! } if ((bits & Defines.U_MODEL2) != 0) ! { ! to.modelindex2 = MSG.ReadByte(Globals.net_message); ! } if ((bits & Defines.U_MODEL3) != 0) ! { ! to.modelindex3 = MSG.ReadByte(Globals.net_message); ! } if ((bits & Defines.U_MODEL4) != 0) + { to.modelindex4 = MSG.ReadByte(Globals.net_message); + } if ((bits & Defines.U_FRAME8) != 0) *************** *** 221,224 **** --- 232,237 ---- } + // call by reference + private static final int[] iw = {0}; /* * ================== CL_ParsePacketEntities *************** *** 252,256 **** while (true) { ! int iw[] = { bits }; newnum = ParseEntityBits(iw); bits = iw[0]; --- 265,270 ---- while (true) { ! //int iw[] = { bits }; ! iw[0] = bits; newnum = ParseEntityBits(iw); bits = iw[0]; *************** *** 424,428 **** if ((flags & Defines.PS_WEAPONINDEX) != 0) { ! state.gunindex = MSG.ReadByte(Globals.net_message); } --- 438,442 ---- if ((flags & Defines.PS_WEAPONINDEX) != 0) { ! state.gunindex = MSG.ReadByte(Globals.net_message); } *************** *** 584,587 **** --- 598,603 ---- */ + // stack variable + private static final entity_t ent = new entity_t(); /* * =============== *************** *** 590,594 **** */ static void AddPacketEntities(frame_t frame) { - entity_t ent; entity_state_t s1; float autorotate; --- 606,609 ---- *************** *** 607,611 **** //memset( ent, 0, sizeof(ent)); ! ent = new entity_t(); for (pnum = 0; pnum < frame.num_entities; pnum++) { --- 622,626 ---- //memset( ent, 0, sizeof(ent)); ! ent.clear(); for (pnum = 0; pnum < frame.num_entities; pnum++) { *************** *** 1017,1026 **** } } ! /* * ============== CL_AddViewWeapon ============== */ static void AddViewWeapon(player_state_t ps, player_state_t ops) { - entity_t gun; // view model int i; --- 1032,1042 ---- } } ! ! // stack variable ! private static final entity_t gun = new entity_t(); /* * ============== CL_AddViewWeapon ============== */ static void AddViewWeapon(player_state_t ps, player_state_t ops) { int i; *************** *** 1034,1038 **** //memset( gun, 0, sizeof(gun)); ! gun = new entity_t(); if (Globals.gun_model != null) --- 1050,1054 ---- //memset( gun, 0, sizeof(gun)); ! gun.clear(); if (Globals.gun_model != null) Index: V.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/V.java,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** V.java 22 Sep 2004 19:22:08 -0000 1.3 --- V.java 23 Jan 2005 21:31:44 -0000 1.3.6.1 *************** *** 154,157 **** --- 154,159 ---- } + // stack variable + private static final float[] origin = { 0, 0, 0 }; /* * ================ V_TestParticles *************** *** 164,169 **** float d, r, u; - float[] origin = { 0, 0, 0 }; - r_numparticles = 0; for (i = 0; i < MAX_PARTICLES; i++) { --- 166,169 ---- *************** *** 193,197 **** //memset (r_entities, 0, sizeof(r_entities)); for (i = 0; i < r_entities.length; i++) ! r_entities[i] = new entity_t(); for (i = 0; i < r_numentities; i++) { --- 193,197 ---- //memset (r_entities, 0, sizeof(r_entities)); for (i = 0; i < r_entities.length; i++) ! r_entities[i].clear(); for (i = 0; i < r_numentities; i++) { Index: CL_newfx.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_newfx.java,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** CL_newfx.java 11 Oct 2004 14:04:16 -0000 1.6 --- CL_newfx.java 23 Jan 2005 21:31:27 -0000 1.6.6.1 *************** *** 76,92 **** } /* * ====== CL_DebugTrail ====== */ static void DebugTrail(float[] start, float[] end) { - float[] move = new float[3]; - float[] vec = new float[3]; - float len; // int j; cparticle_t p; float dec; - float[] right = new float[3]; - float[] up = new float[3]; // int i; // float d, c, s; --- 76,92 ---- } + // stack variable + private static final float[] move = {0, 0, 0}; + private static final float[] vec = {0, 0, 0}; + private static final float[] right = {0, 0, 0}; + private static final float[] up = {0, 0, 0}; /* * ====== CL_DebugTrail ====== */ static void DebugTrail(float[] start, float[] end) { float len; // int j; cparticle_t p; float dec; // int i; // float d, c, s; *************** *** 134,141 **** } static void ForceWall(float[] start, float[] end, int color) { - float[] move = new float[3]; - float[] vec = new float[3]; - ; float len; int j; --- 134,140 ---- } + // stack variable + // move, vec static void ForceWall(float[] start, float[] end, int color) { float len; int j; *************** *** 180,183 **** --- 179,184 ---- } + // stack variable + // move, vec /* * =============== CL_BubbleTrail2 (lets you control the # of bubbles by *************** *** 187,193 **** */ static void BubbleTrail2(float[] start, float[] end, int dist) { - float[] move = new float[3]; - float[] vec = new float[3]; - ; float len; int i, j; --- 188,191 ---- *************** *** 229,243 **** } static void Heatbeam(float[] start, float[] forward) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; cparticle_t p; - float[] right = new float[3]; - float[] up = new float[3]; int i; float c, s; - float[] dir = new float[3]; float ltime; float step = 32.0f, rstep; --- 227,241 ---- } + // stack variable + // move, vec, right, up + private static final float[] dir = {0, 0, 0}; + private static final float[] end = {0, 0, 0}; + static void Heatbeam(float[] start, float[] forward) { float len; int j; cparticle_t p; int i; float c, s; float ltime; float step = 32.0f, rstep; *************** *** 245,249 **** float rot; float variance; - float[] end = new float[3]; Math3D.VectorMA(start, 4096, forward, end); --- 243,246 ---- *************** *** 320,323 **** --- 317,323 ---- } + // stack variable + private static final float[] r = {0, 0, 0}; + private static final float[] u = {0, 0, 0}; /* * =============== CL_ParticleSteamEffect *************** *** 331,336 **** cparticle_t p; float d; - float[] r = new float[3]; - float[] u = new float[3]; // vectoangles2 (dir, angle_dir); --- 331,334 ---- *************** *** 368,371 **** --- 366,371 ---- } + // stack variable + // r, u, dir static void ParticleSteamEffect2(cl_sustain_t self) // float[] org, float[] dir, int color, int count, int magnitude) *************** *** 374,380 **** cparticle_t p; float d; - float[] r = new float[3]; - float[] u = new float[3]; - float[] dir = new float[3]; // vectoangles2 (dir, angle_dir); --- 374,377 ---- *************** *** 414,427 **** } /* * =============== CL_TrackerTrail =============== */ static void TrackerTrail(float[] start, float[] end, int particleColor) { - float[] move = new float[3]; - float[] vec = new float[3]; - float[] forward = new float[3]; - float[] right = new float[3]; - float[] up = new float[3]; - float[] angle_dir = new float[3]; float len; cparticle_t p; --- 411,422 ---- } + // stack variable + // move, vec, right, up + private static final float[] forward = {0, 0, 0}; + private static final float[] angle_dir = {0, 0, 0}; /* * =============== CL_TrackerTrail =============== */ static void TrackerTrail(float[] start, float[] end, int particleColor) { float len; cparticle_t p; *************** *** 469,478 **** } static void Tracker_Shell(float[] origin) { - float[] dir = new float[3]; - int i; cparticle_t p; ! for (i = 0; i < 300; i++) { if (CL_fx.free_particles == null) return; --- 464,473 ---- } + // stack variable + // dir static void Tracker_Shell(float[] origin) { cparticle_t p; ! for (int i = 0; i < 300; i++) { if (CL_fx.free_particles == null) return; *************** *** 498,507 **** } static void MonsterPlasma_Shell(float[] origin) { - float[] dir = new float[3]; - int i; cparticle_t p; ! for (i = 0; i < 40; i++) { if (CL_fx.free_particles == null) return; --- 493,502 ---- } + // stack variable + // dir static void MonsterPlasma_Shell(float[] origin) { cparticle_t p; ! for (int i = 0; i < 40; i++) { if (CL_fx.free_particles == null) return; *************** *** 531,536 **** private static int[] wb_colortable = { 2 * 8, 13 * 8, 21 * 8, 18 * 8 }; static void Widowbeamout(cl_sustain_t self) { - float[] dir = new float[3]; int i; cparticle_t p; --- 526,532 ---- private static int[] wb_colortable = { 2 * 8, 13 * 8, 21 * 8, 18 * 8 }; + // stack variable + // dir static void Widowbeamout(cl_sustain_t self) { int i; cparticle_t p; *************** *** 568,573 **** private static int[] nb_colortable = { 110, 112, 114, 116 }; static void Nukeblast(cl_sustain_t self) { - float[] dir = new float[3]; int i; cparticle_t p; --- 564,570 ---- private static int[] nb_colortable = { 110, 112, 114, 116 }; + // stack variable + // dir static void Nukeblast(cl_sustain_t self) { int i; cparticle_t p; *************** *** 605,612 **** private static int[] ws_colortable = { 2 * 8, 13 * 8, 21 * 8, 18 * 8 }; static void WidowSplash(float[] org) { int i; cparticle_t p; - float[] dir = new float[3]; for (i = 0; i < 256; i++) { --- 602,610 ---- private static int[] ws_colortable = { 2 * 8, 13 * 8, 21 * 8, 18 * 8 }; + // stack variable + // dir static void WidowSplash(float[] org) { int i; cparticle_t p; for (i = 0; i < 256; i++) { *************** *** 636,639 **** --- 634,639 ---- } + // stack variable + // move, vec /* * =============== *************** *** 642,647 **** */ static void TagTrail(float[] start, float[] end, float color) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 642,645 ---- *************** *** 713,716 **** --- 711,716 ---- } + // stack variable + // r, u /* * =============== CL_ParticleSmokeEffect - like the steam effect, but *************** *** 722,727 **** cparticle_t p; float d; - float[] r = new float[3]; - float[] u = new float[3]; Math3D.MakeNormalVectors(dir, r, u); --- 722,725 ---- *************** *** 792,795 **** --- 790,795 ---- } + // stack variable + // move, vec /* * =============== CL_BlasterTrail2 *************** *** 798,803 **** */ static void BlasterTrail2(float[] start, float[] end) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 798,801 ---- Index: CL_parse.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_parse.java,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -C2 -d -r1.18 -r1.18.2.1 *** CL_parse.java 29 Oct 2004 16:35:00 -0000 1.18 --- CL_parse.java 23 Jan 2005 21:31:26 -0000 1.18.2.1 *************** *** 35,38 **** --- 35,39 ---- import jake2.sys.Sys; import jake2.util.Lib; + import jake2.util.Math3D; import java.io.IOException; *************** *** 294,298 **** int i; ! Com.DPrintf("Serverdata packet received.\n"); // // wipe the client_state_t struct --- 295,299 ---- int i; ! Com.DPrintf("ParseServerData():Serverdata packet received.\n"); // // wipe the client_state_t struct *************** *** 317,320 **** --- 318,322 ---- str = MSG.ReadString(Globals.net_message); Globals.cl.gamedir = str; + Com.dprintln("gamedir=" + str); // set gamedir *************** *** 329,335 **** // parse player entity number Globals.cl.playernum = MSG.ReadShort(Globals.net_message); ! // get the full level name str = MSG.ReadString(Globals.net_message); if (Globals.cl.playernum == -1) { // playing a cinematic or showing a --- 331,338 ---- // parse player entity number Globals.cl.playernum = MSG.ReadShort(Globals.net_message); ! Com.dprintln("numplayers=" + Globals.cl.playernum); // get the full level name str = MSG.ReadString(Globals.net_message); + Com.dprintln("levelname=" + str); if (Globals.cl.playernum == -1) { // playing a cinematic or showing a *************** *** 408,411 **** --- 411,415 ---- ci.skin = Globals.re.RegisterSkin(skin_filename); ci.icon = Globals.re.RegisterPic(ci.iconname); + } else { // isolate the model name *************** *** 507,511 **** ci = Globals.cl.clientinfo[player]; ! LoadClientinfo(ci, new String(s)); } --- 511,515 ---- ci = Globals.cl.clientinfo[player]; ! LoadClientinfo(ci, s); } *************** *** 526,530 **** olds = Globals.cl.configstrings[i]; ! Globals.cl.configstrings[i] = new String(s); // do something apropriate --- 530,536 ---- olds = Globals.cl.configstrings[i]; ! Globals.cl.configstrings[i] = s; ! ! Com.dprintln("ParseConfigString(): configstring[" + i + "]=<"+s+">"); // do something apropriate *************** *** 532,538 **** if (i >= Defines.CS_LIGHTS && i < Defines.CS_LIGHTS + Defines.MAX_LIGHTSTYLES) { CL_fx.SetLightstyle(i - Defines.CS_LIGHTS); ! } else if (i >= Defines.CS_MODELS ! && i < Defines.CS_MODELS + Defines.MAX_MODELS) { if (Globals.cl.refresh_prepped) { Globals.cl.model_draw[i - Defines.CS_MODELS] = Globals.re --- 538,545 ---- if (i >= Defines.CS_LIGHTS && i < Defines.CS_LIGHTS + Defines.MAX_LIGHTSTYLES) { + CL_fx.SetLightstyle(i - Defines.CS_LIGHTS); ! ! } else if (i >= Defines.CS_MODELS && i < Defines.CS_MODELS + Defines.MAX_MODELS) { if (Globals.cl.refresh_prepped) { Globals.cl.model_draw[i - Defines.CS_MODELS] = Globals.re *************** *** 569,577 **** */ /* * ================== CL_ParseStartSoundPacket ================== */ public static void ParseStartSoundPacket() { - float[] pos_v = { 0, 0, 0 }; float pos[]; int channel, ent; --- 576,584 ---- */ + private static final float[] pos_v = { 0, 0, 0 }; /* * ================== CL_ParseStartSoundPacket ================== */ public static void ParseStartSoundPacket() { float pos[]; int channel, ent; *************** *** 615,619 **** if ((flags & Defines.SND_POS) != 0) { // positioned in space MSG.ReadPos(Globals.net_message, pos_v); ! pos = pos_v; } else --- 622,626 ---- if ((flags & Defines.SND_POS) != 0) { // positioned in space MSG.ReadPos(Globals.net_message, pos_v); ! // is ok. sound driver copies pos = pos_v; } else Index: Menu.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Menu.java,v retrieving revision 1.12.6.2 retrieving revision 1.12.6.3 diff -C2 -d -r1.12.6.2 -r1.12.6.3 *** Menu.java 16 Jan 2005 21:20:56 -0000 1.12.6.2 --- Menu.java 23 Jan 2005 21:31:26 -0000 1.12.6.3 *************** *** 4095,4098 **** --- 4095,4100 ---- static int yaw; + + private static final entity_t entity = new entity_t(); static void PlayerConfig_MenuDraw() { *************** *** 4116,4122 **** int maxframe = 29; - entity_t entity = new entity_t(); - //memset(entity, 0, sizeof(entity)); scratch = "players/" + s_pmi[s_player_model_box.curvalue].directory --- 4118,4123 ---- int maxframe = 29; //memset(entity, 0, sizeof(entity)); + entity.clear(); scratch = "players/" + s_pmi[s_player_model_box.curvalue].directory Index: CL_fx.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_fx.java,v retrieving revision 1.7.6.1 retrieving revision 1.7.6.2 diff -C2 -d -r1.7.6.1 -r1.7.6.2 *** CL_fx.java 16 Jan 2005 21:20:58 -0000 1.7.6.1 --- CL_fx.java 23 Jan 2005 21:31:26 -0000 1.7.6.2 *************** *** 251,254 **** --- 251,257 ---- } + // stack variable + private static final float[] fv = {0, 0, 0}; + private static final float[] rv = {0, 0, 0}; /* * ============== *************** *** 257,262 **** */ static void ParseMuzzleFlash() { - float[] fv = new float[3]; - float[] rv = new float[3]; float volume; String soundname; --- 260,263 ---- *************** *** 505,515 **** } /* * ============== CL_ParseMuzzleFlash2 ============== */ static void ParseMuzzleFlash2() { - float[] origin = new float[3]; - float[] forward = new float[3]; - float[] right = new float[3]; String soundname; --- 506,517 ---- } + // stack variable + private static final float[] origin = {0, 0, 0}; + private static final float[] forward = {0, 0, 0}; + private static final float[] right = {0, 0, 0}; /* * ============== CL_ParseMuzzleFlash2 ============== */ static void ParseMuzzleFlash2() { String soundname; *************** *** 981,990 **** */ static void ClearParticles() { - int i; - free_particles = particles[0]; active_particles = null; ! for (i = 0; i < particles.length - 1; i++) particles[i].next = particles[i + 1]; particles[particles.length - 1].next = null; --- 983,990 ---- */ static void ClearParticles() { free_particles = particles[0]; active_particles = null; ! for (int i = 0; i < particles.length - 1; i++) particles[i].next = particles[i + 1]; particles[particles.length - 1].next = null; *************** *** 997,1005 **** */ static void ParticleEffect(float[] org, float[] dir, int color, int count) { ! int i, j; cparticle_t p; float d; ! ! for (i = 0; i < count; i++) { if (free_particles == null) return; --- 997,1005 ---- */ static void ParticleEffect(float[] org, float[] dir, int color, int count) { ! int j; cparticle_t p; float d; ! ! for (int i = 0; i < count; i++) { if (free_particles == null) return; *************** *** 1030,1038 **** */ static void ParticleEffect2(float[] org, float[] dir, int color, int count) { ! int i, j; cparticle_t p; float d; ! for (i = 0; i < count; i++) { if (free_particles == null) return; --- 1030,1038 ---- */ static void ParticleEffect2(float[] org, float[] dir, int color, int count) { ! int j; cparticle_t p; float d; ! for (int i = 0; i < count; i++) { if (free_particles == null) return; *************** *** 1064,1072 **** */ static void ParticleEffect3(float[] org, float[] dir, int color, int count) { ! int i, j; cparticle_t p; float d; ! for (i = 0; i < count; i++) { if (free_particles == null) return; --- 1064,1072 ---- */ static void ParticleEffect3(float[] org, float[] dir, int color, int count) { ! int j; cparticle_t p; float d; ! for (int i = 0; i < count; i++) { if (free_particles == null) return; *************** *** 1097,1104 **** */ static void TeleporterParticles(entity_state_t ent) { ! int i, j; cparticle_t p; ! for (i = 0; i < 8; i++) { if (free_particles == null) return; --- 1097,1104 ---- */ static void TeleporterParticles(entity_state_t ent) { ! int j; cparticle_t p; ! for (int i = 0; i < 8; i++) { if (free_particles == null) return; *************** *** 1133,1140 **** */ static void LogoutEffect(float[] org, int type) { ! int i, j; cparticle_t p; ! for (i = 0; i < 500; i++) { if (free_particles == null) return; --- 1133,1140 ---- */ static void LogoutEffect(float[] org, int type) { ! int j; cparticle_t p; ! for (int i = 0; i < 500; i++) { if (free_particles == null) return; *************** *** 1174,1181 **** */ static void ItemRespawnParticles(float[] org) { ! int i, j; cparticle_t p; ! for (i = 0; i < 64; i++) { if (free_particles == null) return; --- 1174,1181 ---- */ static void ItemRespawnParticles(float[] org) { ! int j; cparticle_t p; ! for (int i = 0; i < 64; i++) { if (free_particles == null) return; *************** *** 1208,1215 **** */ static void ExplosionParticles(float[] org) { ! int i, j; cparticle_t p; ! for (i = 0; i < 256; i++) { if (free_particles == null) return; --- 1208,1215 ---- */ static void ExplosionParticles(float[] org) { ! int j; cparticle_t p; ! for (int i = 0; i < 256; i++) { if (free_particles == null) return; *************** *** 1236,1244 **** static void BigTeleportParticles(float[] org) { - int i; cparticle_t p; float angle, dist; ! for (i = 0; i < 4096; i++) { if (free_particles == null) return; --- 1236,1243 ---- static void BigTeleportParticles(float[] org) { cparticle_t p; float angle, dist; ! for (int i = 0; i < 4096; i++) { if (free_particles == null) return; *************** *** 1277,1287 **** */ static void BlasterParticles(float[] org, float[] dir) { ! int i, j; cparticle_t p; float d; - int count; ! count = 40; ! for (i = 0; i < count; i++) { if (free_particles == null) return; --- 1276,1285 ---- */ static void BlasterParticles(float[] org, float[] dir) { ! int j; cparticle_t p; float d; ! int count = 40; ! for (int i = 0; i < count; i++) { if (free_particles == null) return; *************** *** 1308,1311 **** --- 1306,1312 ---- } + // stack variable + private static final float[] move = {0, 0, 0}; + private static final float[] vec = {0, 0, 0}; /* * =============== CL_BlasterTrail *************** *** 1314,1319 **** */ static void BlasterTrail(float[] start, float[] end) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 1315,1318 ---- *************** *** 1355,1359 **** } ! /* * =============== --- 1354,1359 ---- } ! // stack variable ! // move, vec /* * =============== *************** *** 1362,1367 **** */ static void FlagTrail(float[] start, float[] end, float color) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 1362,1365 ---- *************** *** 1402,1405 **** --- 1400,1405 ---- } + // stack variable + // move, vec /* * =============== CL_DiminishingTrail *************** *** 1408,1413 **** */ static void DiminishingTrail(float[] start, float[] end, centity_t old, int flags) { - float[] move = new float[3]; - float[] vec = new float[3]; cparticle_t p; float orgscale; --- 1408,1411 ---- *************** *** 1487,1490 **** --- 1485,1490 ---- } + // stack variable + // move, vec /* * =============== CL_RocketTrail *************** *** 1493,1498 **** */ static void RocketTrail(float[] start, float[] end, centity_t old) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 1493,1496 ---- *************** *** 1539,1542 **** --- 1537,1542 ---- } + // stack variable + // move, vec /* * =============== CL_RailTrail *************** *** 1545,1550 **** */ static void RailTrail(float[] start, float[] end) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 1545,1548 ---- *************** *** 1625,1635 **** } ! // RAFAEL /* * =============== CL_IonripperTrail =============== */ static void IonripperTrail(float[] start, float[] ent) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 1623,1632 ---- } ! // stack variable ! // move, vec /* * =============== CL_IonripperTrail =============== */ static void IonripperTrail(float[] start, float[] ent) { float len; int j; *************** *** 1680,1683 **** --- 1677,1682 ---- } + // stack variable + // move, vec /* * =============== CL_BubbleTrail *************** *** 1686,1691 **** */ static void BubbleTrail(float[] start, float[] end) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int i, j; --- 1685,1688 ---- *************** *** 1725,1728 **** --- 1722,1727 ---- } + // stack variable + // forward /* * =============== CL_FlyParticles =============== *************** *** 1733,1737 **** float angle; float sp, sy, cp, cy; - float[] forward = new float[3]; float dist = 64; float ltime; --- 1732,1735 ---- *************** *** 1813,1816 **** --- 1811,1817 ---- } + // stack variable + private static final float[] v = {0, 0, 0}; + // forward /* * =============== CL_BfgParticles =============== *************** *** 1822,1828 **** float angle; float sp, sy, cp, cy; - float[] forward = new float[3]; float dist = 64; - float[] v = new float[3]; float ltime; --- 1823,1827 ---- *************** *** 1876,1879 **** --- 1875,1882 ---- } + // stack variable + // move, vec + private static final float[] start = {0, 0, 0}; + private static final float[] end = {0, 0, 0}; /* * =============== CL_TrapParticles =============== *************** *** 1881,1888 **** // RAFAEL static void TrapParticles(entity_t ent) { - float[] move = new float[3]; - float[] vec = new float[3]; - float[] start = new float[3]; - float[] end = new float[3]; float len; int j; --- 1884,1887 ---- *************** *** 1977,1984 **** // FIXME combined with CL_ExplosionParticles static void BFGExplosionParticles(float[] org) { ! int i, j; cparticle_t p; ! for (i = 0; i < 256; i++) { if (free_particles == null) return; --- 1976,1983 ---- // FIXME combined with CL_ExplosionParticles static void BFGExplosionParticles(float[] org) { ! int j; cparticle_t p; ! for (int i = 0; i < 256; i++) { if (free_particles == null) return; *************** *** 2004,2007 **** --- 2003,2008 ---- } + // stack variable + private static final float[] dir = {0, 0, 0}; /* * =============== CL_TeleportParticles *************** *** 2010,2017 **** */ static void TeleportParticles(float[] org) { - cparticle_t p; float vel; - float[] dir = new float[3]; for (int i = -16; i <= 16; i += 4) --- 2011,2016 ---- *************** *** 2048,2051 **** --- 2047,2052 ---- } + // stack variable + private static final float[] org = {0, 0, 0}; /* * =============== CL_AddParticles =============== *************** *** 2056,2060 **** float time = 0.0f; float time2; - float[] org = new float[3]; int color; cparticle_t active, tail; --- 2057,2060 ---- Index: CL_tent.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_tent.java,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -C2 -d -r1.7 -r1.7.6.1 *** CL_tent.java 11 Oct 2004 14:04:16 -0000 1.7 --- CL_tent.java 23 Jan 2005 21:31:26 -0000 1.7.6.1 *************** *** 59,63 **** void clear() { lightcolor[0] = lightcolor[1] = lightcolor[2] = light = start = type = frames = baseframe = 0; ! ent = new entity_t(); } } --- 59,63 ---- void clear() { lightcolor[0] = lightcolor[1] = lightcolor[2] = light = start = type = frames = baseframe = 0; ! ent.clear(); } } *************** *** 123,127 **** void clear() { endtime = 0; ! ent = new entity_t(); } } --- 123,127 ---- void clear() { endtime = 0; ! ent.clear(); } } *************** *** 545,548 **** --- 545,551 ---- // rogue + // stack variable + private static final float[] start = new float[3]; + private static final float[] end = new float[3]; /* * ================= CL_ParseLightning ================= *************** *** 550,555 **** static int ParseLightning(model_t model) { int srcEnt, destEnt; - float[] start = new float[3]; - float[] end = new float[3]; beam_t[] b; int i; --- 553,556 ---- *************** *** 596,605 **** } /* * ================= CL_ParseLaser ================= */ static void ParseLaser(int colors) { - float[] start = new float[3]; - float[] end = new float[3]; laser_t[] l; int i; --- 597,606 ---- } + // stack variable + // start, end /* * ================= CL_ParseLaser ================= */ static void ParseLaser(int colors) { laser_t[] l; int i; *************** *** 624,632 **** } // ============= // ROGUE static void ParseSteam() { - float[] pos = new float[3]; - float[] dir = new float[3]; int id, i; int r; --- 625,634 ---- } + // stack variable + private static final float[] pos = new float[3]; + private static final float[] dir = new float[3]; // ============= // ROGUE static void ParseSteam() { int id, i; int r; *************** *** 690,696 **** } } ! static void ParseWidow() { - float[] pos = new float[3]; int id, i; cl_sustain_t[] s; --- 692,699 ---- } } ! ! // stack variable ! // pos static void ParseWidow() { int id, i; cl_sustain_t[] s; *************** *** 725,730 **** } static void ParseNuke() { - float[] pos = new float[3]; int i; cl_sustain_t[] s; --- 728,734 ---- } + // stack variable + // pos static void ParseNuke() { int i; cl_sustain_t[] s; *************** *** 764,773 **** */ static int[] splash_color = { 0x00, 0xe0, 0xb0, 0x50, 0xd0, 0xe0, 0xe8 }; static void ParseTEnt() { int type; - float[] pos = new float[3]; - float[] pos2 = new float[3]; - float[] dir = new float[3]; explosion_t ex; int cnt; --- 768,777 ---- */ static int[] splash_color = { 0x00, 0xe0, 0xb0, 0x50, 0xd0, 0xe0, 0xe8 }; + // stack variable + // pos, dir + private static final float[] pos2 = {0, 0, 0}; static void ParseTEnt() { int type; explosion_t ex; int cnt; *************** *** 1294,1297 **** --- 1298,1304 ---- } + // stack variable + // dist, org + private static final entity_t ent = new entity_t(); /* * ================= CL_AddBeams ================= *************** *** 1300,1307 **** int i, j; beam_t[] b; - float[] dist = new float[3]; - float[] org = new float[3]; float d; - entity_t ent = new entity_t(); float yaw, pitch; float forward; --- 1307,1311 ---- *************** *** 1355,1359 **** //memset (&ent, 0, sizeof(ent)); ! ent = new entity_t(); if (b[i].model == cl_mod_lightning) { model_length = 35.0f; --- 1359,1363 ---- //memset (&ent, 0, sizeof(ent)); ! ent.clear(); if (b[i].model == cl_mod_lightning) { model_length = 35.0f; *************** *** 1412,1415 **** --- 1416,1425 ---- //extern cvar_t *hand; + // stack variable + private static final float[] dist = new float[3]; + private static final float[] org = new float[3]; + private static final float[] f = new float[3]; + private static final float[] u = new float[3]; + private static final float[] r = new float[3]; /* * ================= ROGUE - draw player locked beams CL_AddPlayerBeams *************** *** 1417,1424 **** */ static void AddPlayerBeams() { - float[] dist = new float[3]; - float[] org = new float[3]; float d; ! entity_t ent = new entity_t(); float yaw, pitch; float forward; --- 1427,1432 ---- */ static void AddPlayerBeams() { float d; ! //entity_t ent = new entity_t(); float yaw, pitch; float forward; *************** *** 1446,1452 **** // update beams beam_t[] b = cl_playerbeams; - float[] f = new float[3]; - float[] u = new float[3]; - float[] r = new float[3]; for (int i = 0; i < MAX_BEAMS; i++) { --- 1454,1457 ---- *************** *** 1583,1588 **** //memset (&ent, 0, sizeof(ent)); ! //ent = new entity_t(); ! // this is not required. hoz if (b[i].model == cl_mod_heatbeam) { --- 1588,1592 ---- //memset (&ent, 0, sizeof(ent)); ! ent.clear(); if (b[i].model == cl_mod_heatbeam) { Index: CL_input.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_input.java,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** CL_input.java 22 Sep 2004 19:22:08 -0000 1.4 --- CL_input.java 23 Jan 2005 21:31:44 -0000 1.4.6.1 *************** *** 28,37 **** import jake2.Defines; import jake2.Globals; - import jake2.game.*; import jake2.game.Cmd; import jake2.game.usercmd_t; import jake2.qcommon.*; - import jake2.qcommon.Cvar; - import jake2.qcommon.xcommand_t; import jake2.sys.IN; import jake2.util.Math3D; --- 28,35 ---- import jake2.Defines; import jake2.Globals; import jake2.game.Cmd; + import jake2.game.cvar_t; import jake2.game.usercmd_t; import jake2.qcommon.*; import jake2.sys.IN; import jake2.util.Math3D; *************** *** 374,378 **** //memset (cmd, 0, sizeof(*cmd)); ! cmd.reset(); Math3D.VectorCopy(Globals.cl.viewangles, cmd.angles); --- 372,376 ---- //memset (cmd, 0, sizeof(*cmd)); ! cmd.clear(); Math3D.VectorCopy(Globals.cl.viewangles, cmd.angles); *************** *** 464,469 **** * ================= CL_CreateCmd ================= */ ! static usercmd_t CreateCmd() { ! usercmd_t cmd = new usercmd_t(); frame_msec = Globals.sys_frame_time - old_sys_frame_time; --- 462,467 ---- * ================= CL_CreateCmd ================= */ ! static void CreateCmd(usercmd_t cmd) { ! //usercmd_t cmd = new usercmd_t(); frame_msec = Globals.sys_frame_time - old_sys_frame_time; *************** *** 483,487 **** old_sys_frame_time = Globals.sys_frame_time; ! return cmd; } --- 481,485 ---- old_sys_frame_time = Globals.sys_frame_time; ! //return cmd; } *************** *** 655,667 **** } /* * ================= CL_SendCmd ================= */ static void SendCmd() { - sizebuf_t buf = new sizebuf_t(); - byte[] data = new byte[128]; int i; usercmd_t cmd, oldcmd; - usercmd_t nullcmd = new usercmd_t(); int checksumIndex; --- 653,665 ---- } + private static final sizebuf_t buf = new sizebuf_t(); + private static final byte[] data = new byte[128]; + private static final usercmd_t nullcmd = new usercmd_t(); /* * ================= CL_SendCmd ================= */ static void SendCmd() { int i; usercmd_t cmd, oldcmd; int checksumIndex; *************** *** 674,678 **** // ping calculation ! cmd.set(CreateCmd()); Globals.cl.cmd.set(cmd); --- 672,677 ---- // ping calculation ! // fill the cmd ! CreateCmd(cmd); Globals.cl.cmd.set(cmd); *************** *** 726,730 **** cmd = Globals.cl.cmds[i]; //memset (nullcmd, 0, sizeof(nullcmd)); ! nullcmd.reset(); MSG.WriteDeltaUsercmd(buf, nullcmd, cmd); --- 725,729 ---- cmd = Globals.cl.cmds[i]; //memset (nullcmd, 0, sizeof(nullcmd)); ! nullcmd.clear(); MSG.WriteDeltaUsercmd(buf, nullcmd, cmd); |