You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(52) |
Aug
(34) |
Sep
(99) |
Oct
(110) |
Nov
(21) |
Dec
(69) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(117) |
Feb
(90) |
Mar
(1) |
Apr
(22) |
May
(96) |
Jun
(25) |
Jul
(22) |
Aug
|
Sep
|
Oct
(18) |
Nov
(43) |
Dec
(71) |
2006 |
Jan
(20) |
Feb
(10) |
Mar
|
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(60) |
Nov
(63) |
Dec
(35) |
2007 |
Jan
(18) |
Feb
(40) |
Mar
(14) |
Apr
(18) |
May
(33) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(25) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rene S. <sa...@us...> - 2005-02-06 18:54:00
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13917/src/jake2/game Modified Files: Cmd.java Log Message: scoreboard bug fixed Index: Cmd.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Cmd.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Cmd.java 23 Jan 2005 20:04:02 -0000 1.10 --- Cmd.java 6 Feb 2005 18:53:50 -0000 1.11 *************** *** 28,31 **** --- 28,32 ---- import jake2.Defines; import jake2.Globals; + import jake2.game.monsters.M_Player; import jake2.qcommon.*; import jake2.server.SV_GAME; *************** *** 380,385 **** * ============ Cmd_ExecuteString * ! * A complete command line has been parsed, so try to execute it FIXME: ! * lookupnoadd the token to speed search? ============ */ public static void ExecuteString(String text) { --- 381,386 ---- * ============ Cmd_ExecuteString * ! * A complete command line has been parsed, so try to execute it ! * FIXME: lookupnoadd the token to speed search? */ public static void ExecuteString(String text) { *************** *** 660,664 **** --- 661,667 ---- s = Cmd.Args(); + it = GameUtil.FindItem(s); + Com.dprintln("using:" + s); if (it == null) { SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "unknown item: " + s *************** *** 667,672 **** } if (it.use == null) { ! SV_GAME ! .PF_cprintf(ent, Defines.PRINT_HIGH, "Item is not usable.\n"); return; --- 670,674 ---- } if (it.use == null) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "Item is not usable.\n"); return; *************** *** 897,901 **** ent.client.showscores = true; ! GameAI.DeathmatchScoreboard(ent); } --- 899,903 ---- ent.client.showscores = true; ! PlayerHud.DeathmatchScoreboard(ent); } *************** *** 947,951 **** ent.client.showhelp = false; ent.client.showinventory = false; - } --- 949,952 ---- |
From: Rene S. <sa...@us...> - 2005-02-06 18:53:05
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13711/src/jake2/game Modified Files: client_persistant_t.java Log Message: fixed scoreboard switchoff bug Index: client_persistant_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/client_persistant_t.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** client_persistant_t.java 10 Sep 2004 19:02:55 -0000 1.6 --- client_persistant_t.java 6 Feb 2005 18:52:55 -0000 1.7 *************** *** 77,86 **** // ammo capacities ! int max_bullets; ! int max_shells; ! int max_rockets; ! int max_grenades; ! int max_cells; ! int max_slugs; //pointer gitem_t weapon; --- 77,86 ---- // ammo capacities ! public int max_bullets; ! public int max_shells; ! public int max_rockets; ! public int max_grenades; ! public int max_cells; ! public int max_slugs; //pointer gitem_t weapon; |
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13400/src/jake2/game Removed Files: M_Boss3.java M_Soldier.java M_Boss2.java M_Float.java M_Flyer.java M_Tank.java M_Hover.java M_Brain.java M_Flash.java M_Actor.java M_Supertank.java M_Flipper.java M_Parasite.java M_Berserk.java M_Boss32.java M_Chick.java M_Infantry.java M_Gladiator.java M_Player.java M_Medic.java M_Gunner.java M_Insane.java M_Mutant.java M_Boss31.java Log Message: part of refactoring the monster files --- M_Gunner.java DELETED --- --- M_Soldier.java DELETED --- --- M_Parasite.java DELETED --- --- M_Player.java DELETED --- --- M_Insane.java DELETED --- --- M_Float.java DELETED --- --- M_Actor.java DELETED --- --- M_Tank.java DELETED --- --- M_Supertank.java DELETED --- --- M_Chick.java DELETED --- --- M_Flipper.java DELETED --- --- M_Gladiator.java DELETED --- --- M_Boss3.java DELETED --- --- M_Infantry.java DELETED --- --- M_Berserk.java DELETED --- --- M_Boss31.java DELETED --- --- M_Medic.java DELETED --- --- M_Hover.java DELETED --- --- M_Boss32.java DELETED --- --- M_Flyer.java DELETED --- --- M_Flash.java DELETED --- --- M_Boss2.java DELETED --- --- M_Mutant.java DELETED --- --- M_Brain.java DELETED --- |
Update of /cvsroot/jake2/jake2/src/jake2/game/monsters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12496/src/jake2/game/monsters Added Files: M_Infantry.java M_Brain.java M_Player.java M_Insane.java M_Gunner.java M_Tank.java M_Soldier.java M_Parasite.java M_Boss32.java M_Boss31.java M_Chick.java M_Flipper.java M_Mutant.java M_Boss3.java M_Flyer.java M_Hover.java M_Float.java M_Gladiator.java M_Berserk.java M_Supertank.java M_Medic.java M_Actor.java M_Flash.java M_Boss2.java Log Message: part of refactoring the monster files --- NEW FILE: M_Gunner.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1056 lines suppressed...] self.pain = gunner_pain; self.die = gunner_die; self.monsterinfo.stand = gunner_stand; self.monsterinfo.walk = gunner_walk; self.monsterinfo.run = gunner_run; self.monsterinfo.dodge = gunner_dodge; self.monsterinfo.attack = gunner_attack; self.monsterinfo.melee = null; self.monsterinfo.sight = gunner_sight; self.monsterinfo.search = gunner_search; GameBase.gi.linkentity(self); self.monsterinfo.currentmove = gunner_move_stand; self.monsterinfo.scale = MODEL_SCALE; GameAI.walkmonster_start.think(self); } } --- NEW FILE: M_Soldier.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...2203 lines suppressed...] if (r > 0.33) self.monsterinfo.currentmove = soldier_move_duck; else self.monsterinfo.currentmove = soldier_move_attack3; return; } if (GameBase.skill.value >= 2) { if (r > 0.66) self.monsterinfo.currentmove = soldier_move_duck; else self.monsterinfo.currentmove = soldier_move_attack3; return; } self.monsterinfo.currentmove = soldier_move_attack3; } }; } --- NEW FILE: M_Parasite.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ // Created on 13.11.2003 by RST. // $Id: M_Parasite.java,v 1.2 2005/02/06 18:48:16 salomo Exp $ package jake2.game.monsters; import jake2.Defines; import jake2.Globals; import jake2.game.EntDieAdapter; import jake2.game.EntInteractAdapter; import jake2.game.EntPainAdapter; import jake2.game.EntThinkAdapter; import jake2.game.GameAI; import jake2.game.GameBase; import jake2.game.GameUtil; import jake2.game.edict_t; import jake2.game.mframe_t; import jake2.game.mmove_t; import jake2.game.trace_t; import jake2.util.Lib; import jake2.util.Math3D; public class M_Parasite { // This file generated by ModelGen - Do NOT Modify public final static int FRAME_break01 = 0; public final static int FRAME_break02 = 1; public final static int FRAME_break03 = 2; public final static int FRAME_break04 = 3; public final static int FRAME_break05 = 4; public final static int FRAME_break06 = 5; public final static int FRAME_break07 = 6; public final static int FRAME_break08 = 7; public final static int FRAME_break09 = 8; public final static int FRAME_break10 = 9; public final static int FRAME_break11 = 10; public final static int FRAME_break12 = 11; public final static int FRAME_break13 = 12; public final static int FRAME_break14 = 13; public final static int FRAME_break15 = 14; public final static int FRAME_break16 = 15; public final static int FRAME_break17 = 16; public final static int FRAME_break18 = 17; public final static int FRAME_break19 = 18; public final static int FRAME_break20 = 19; public final static int FRAME_break21 = 20; public final static int FRAME_break22 = 21; public final static int FRAME_break23 = 22; public final static int FRAME_break24 = 23; public final static int FRAME_break25 = 24; public final static int FRAME_break26 = 25; public final static int FRAME_break27 = 26; public final static int FRAME_break28 = 27; public final static int FRAME_break29 = 28; public final static int FRAME_break30 = 29; public final static int FRAME_break31 = 30; public final static int FRAME_break32 = 31; public final static int FRAME_death101 = 32; public final static int FRAME_death102 = 33; public final static int FRAME_death103 = 34; public final static int FRAME_death104 = 35; public final static int FRAME_death105 = 36; public final static int FRAME_death106 = 37; public final static int FRAME_death107 = 38; public final static int FRAME_drain01 = 39; public final static int FRAME_drain02 = 40; public final static int FRAME_drain03 = 41; public final static int FRAME_drain04 = 42; public final static int FRAME_drain05 = 43; public final static int FRAME_drain06 = 44; public final static int FRAME_drain07 = 45; public final static int FRAME_drain08 = 46; public final static int FRAME_drain09 = 47; public final static int FRAME_drain10 = 48; public final static int FRAME_drain11 = 49; public final static int FRAME_drain12 = 50; public final static int FRAME_drain13 = 51; public final static int FRAME_drain14 = 52; public final static int FRAME_drain15 = 53; public final static int FRAME_drain16 = 54; public final static int FRAME_drain17 = 55; public final static int FRAME_drain18 = 56; public final static int FRAME_pain101 = 57; public final static int FRAME_pain102 = 58; public final static int FRAME_pain103 = 59; public final static int FRAME_pain104 = 60; public final static int FRAME_pain105 = 61; public final static int FRAME_pain106 = 62; public final static int FRAME_pain107 = 63; public final static int FRAME_pain108 = 64; public final static int FRAME_pain109 = 65; public final static int FRAME_pain110 = 66; public final static int FRAME_pain111 = 67; public final static int FRAME_run01 = 68; public final static int FRAME_run02 = 69; public final static int FRAME_run03 = 70; public final static int FRAME_run04 = 71; public final static int FRAME_run05 = 72; public final static int FRAME_run06 = 73; public final static int FRAME_run07 = 74; public final static int FRAME_run08 = 75; public final static int FRAME_run09 = 76; public final static int FRAME_run10 = 77; public final static int FRAME_run11 = 78; public final static int FRAME_run12 = 79; public final static int FRAME_run13 = 80; public final static int FRAME_run14 = 81; public final static int FRAME_run15 = 82; public final static int FRAME_stand01 = 83; public final static int FRAME_stand02 = 84; public final static int FRAME_stand03 = 85; public final static int FRAME_stand04 = 86; public final static int FRAME_stand05 = 87; public final static int FRAME_stand06 = 88; public final static int FRAME_stand07 = 89; public final static int FRAME_stand08 = 90; public final static int FRAME_stand09 = 91; public final static int FRAME_stand10 = 92; public final static int FRAME_stand11 = 93; public final static int FRAME_stand12 = 94; public final static int FRAME_stand13 = 95; public final static int FRAME_stand14 = 96; public final static int FRAME_stand15 = 97; public final static int FRAME_stand16 = 98; public final static int FRAME_stand17 = 99; public final static int FRAME_stand18 = 100; public final static int FRAME_stand19 = 101; public final static int FRAME_stand20 = 102; public final static int FRAME_stand21 = 103; public final static int FRAME_stand22 = 104; public final static int FRAME_stand23 = 105; public final static int FRAME_stand24 = 106; public final static int FRAME_stand25 = 107; public final static int FRAME_stand26 = 108; public final static int FRAME_stand27 = 109; public final static int FRAME_stand28 = 110; public final static int FRAME_stand29 = 111; public final static int FRAME_stand30 = 112; public final static int FRAME_stand31 = 113; public final static int FRAME_stand32 = 114; public final static int FRAME_stand33 = 115; public final static int FRAME_stand34 = 116; public final static int FRAME_stand35 = 117; public final static float MODEL_SCALE = 1.000000f; static int sound_pain1; static int sound_pain2; static int sound_die; static int sound_launch; static int sound_impact; static int sound_suck; static int sound_reelin; static int sound_sight; static int sound_tap; static int sound_scratch; static int sound_search; static EntThinkAdapter parasite_launch = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_launch, 1, Defines.ATTN_NORM, 0); return true; } }; static EntThinkAdapter parasite_reel_in = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_reelin, 1, Defines.ATTN_NORM, 0); return true; } }; static EntInteractAdapter parasite_sight = new EntInteractAdapter() { public boolean interact(edict_t self, edict_t other) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_sight, 1, Defines.ATTN_NORM, 0); return true; } }; static EntThinkAdapter parasite_tap = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_tap, 1, Defines.ATTN_IDLE, 0); return true; } }; static EntThinkAdapter parasite_scratch = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_scratch, 1, Defines.ATTN_IDLE, 0); return true; } }; static EntThinkAdapter parasite_search = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_search, 1, Defines.ATTN_IDLE, 0); return true; } }; static EntThinkAdapter parasite_start_walk = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_start_walk; return true; } }; static EntThinkAdapter parasite_walk = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_walk; return true; } }; static EntThinkAdapter parasite_stand = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_stand; return true; } }; static EntThinkAdapter parasite_end_fidget = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_end_fidget; return true; } }; static EntThinkAdapter parasite_do_fidget = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_fidget; return true; } }; static EntThinkAdapter parasite_refidget = new EntThinkAdapter() { public boolean think(edict_t self) { if (Lib.random() <= 0.8) self.monsterinfo.currentmove = parasite_move_fidget; else self.monsterinfo.currentmove = parasite_move_end_fidget; return true; } }; static EntThinkAdapter parasite_idle = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_start_fidget; return true; } }; static EntThinkAdapter parasite_start_run = new EntThinkAdapter() { public boolean think(edict_t self) { if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) self.monsterinfo.currentmove = parasite_move_stand; else self.monsterinfo.currentmove = parasite_move_start_run; return true; } }; static EntThinkAdapter parasite_run = new EntThinkAdapter() { public boolean think(edict_t self) { if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) self.monsterinfo.currentmove = parasite_move_stand; else self.monsterinfo.currentmove = parasite_move_run; return true; } }; static mframe_t parasite_frames_start_fidget[] = new mframe_t[] { new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null) }; static mmove_t parasite_move_start_fidget = new mmove_t(FRAME_stand18, FRAME_stand21, parasite_frames_start_fidget, parasite_do_fidget); static mframe_t parasite_frames_fidget[] = new mframe_t[] { new mframe_t(GameAI.ai_stand, 0, parasite_scratch), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_scratch), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null) }; static mmove_t parasite_move_fidget = new mmove_t(FRAME_stand22, FRAME_stand27, parasite_frames_fidget, parasite_refidget); static mframe_t parasite_frames_end_fidget[] = new mframe_t[] { new mframe_t(GameAI.ai_stand, 0, parasite_scratch), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null) }; static mmove_t parasite_move_end_fidget = new mmove_t(FRAME_stand28, FRAME_stand35, parasite_frames_end_fidget, parasite_stand); static mframe_t parasite_frames_stand[] = new mframe_t[] { new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap) }; static mmove_t parasite_move_stand = new mmove_t(FRAME_stand01, FRAME_stand17, parasite_frames_stand, parasite_stand); static mframe_t parasite_frames_run[] = new mframe_t[] { new mframe_t(GameAI.ai_run, 30, null), new mframe_t(GameAI.ai_run, 30, null), new mframe_t(GameAI.ai_run, 22, null), new mframe_t(GameAI.ai_run, 19, null), new mframe_t(GameAI.ai_run, 24, null), new mframe_t(GameAI.ai_run, 28, null), new mframe_t(GameAI.ai_run, 25, null) }; static mmove_t parasite_move_run = new mmove_t(FRAME_run03, FRAME_run09, parasite_frames_run, null); static mframe_t parasite_frames_start_run[] = new mframe_t[] { new mframe_t(GameAI.ai_run, 0, null), new mframe_t(GameAI.ai_run, 30, null), }; static mmove_t parasite_move_start_run = new mmove_t(FRAME_run01, FRAME_run02, parasite_frames_start_run, parasite_run); static mframe_t parasite_frames_stop_run[] = new mframe_t[] { new mframe_t(GameAI.ai_run, 20, null), new mframe_t(GameAI.ai_run, 20, null), new mframe_t(GameAI.ai_run, 12, null), new mframe_t(GameAI.ai_run, 10, null), new mframe_t(GameAI.ai_run, 0, null), new mframe_t(GameAI.ai_run, 0, null) }; static mmove_t parasite_move_stop_run = new mmove_t(FRAME_run10, FRAME_run15, parasite_frames_stop_run, null); static mframe_t parasite_frames_walk[] = new mframe_t[] { new mframe_t(GameAI.ai_walk, 30, null), new mframe_t(GameAI.ai_walk, 30, null), new mframe_t(GameAI.ai_walk, 22, null), new mframe_t(GameAI.ai_walk, 19, null), new mframe_t(GameAI.ai_walk, 24, null), new mframe_t(GameAI.ai_walk, 28, null), new mframe_t(GameAI.ai_walk, 25, null) }; static mmove_t parasite_move_walk = new mmove_t(FRAME_run03, FRAME_run09, parasite_frames_walk, parasite_walk); static mframe_t parasite_frames_start_walk[] = new mframe_t[] { new mframe_t(GameAI.ai_walk, 0, null), new mframe_t(GameAI.ai_walk, 30, parasite_walk) }; static mmove_t parasite_move_start_walk = new mmove_t(FRAME_run01, FRAME_run02, parasite_frames_start_walk, null); static mframe_t parasite_frames_stop_walk[] = new mframe_t[] { new mframe_t(GameAI.ai_walk, 20, null), new mframe_t(GameAI.ai_walk, 20, null), new mframe_t(GameAI.ai_walk, 12, null), new mframe_t(GameAI.ai_walk, 10, null), new mframe_t(GameAI.ai_walk, 0, null), new mframe_t(GameAI.ai_walk, 0, null) }; static mmove_t parasite_move_stop_walk = new mmove_t(FRAME_run10, FRAME_run15, parasite_frames_stop_walk, null); static mframe_t parasite_frames_pain1[] = new mframe_t[] { new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 6, null), new mframe_t(GameAI.ai_move, 16, null), new mframe_t(GameAI.ai_move, -6, null), new mframe_t(GameAI.ai_move, -7, null), new mframe_t(GameAI.ai_move, 0, null) }; static mmove_t parasite_move_pain1 = new mmove_t(FRAME_pain101, FRAME_pain111, parasite_frames_pain1, parasite_start_run); static EntPainAdapter parasite_pain = new EntPainAdapter() { public void pain(edict_t self, edict_t other, float kick, int damage) { if (self.health < (self.max_health / 2)) self.s.skinnum = 1; if (GameBase.level.time < self.pain_debounce_time) return; self.pain_debounce_time = GameBase.level.time + 3; if (GameBase.skill.value == 3) return; // no pain anims in nightmare if (Lib.random() < 0.5) GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain1, 1, Defines.ATTN_NORM, 0); else GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain2, 1, Defines.ATTN_NORM, 0); self.monsterinfo.currentmove = parasite_move_pain1; } }; static EntThinkAdapter parasite_drain_attack = new EntThinkAdapter() { public boolean think(edict_t self) { float[] offset = { 0, 0, 0 }, start = { 0, 0, 0 }, f = { 0, 0, 0 }, r = { 0, 0, 0 }, end = { 0, 0, 0 }, dir = { 0, 0, 0 }; trace_t tr; int damage; Math3D.AngleVectors(self.s.angles, f, r, null); Math3D.VectorSet(offset, 24, 0, 6); Math3D.G_ProjectSource(self.s.origin, offset, f, r, start); Math3D.VectorCopy(self.enemy.s.origin, end); if (!parasite_drain_attack_ok(start, end)) { end[2] = self.enemy.s.origin[2] + self.enemy.maxs[2] - 8; if (!parasite_drain_attack_ok(start, end)) { end[2] = self.enemy.s.origin[2] + self.enemy.mins[2] + 8; if (!parasite_drain_attack_ok(start, end)) return true; } } Math3D.VectorCopy(self.enemy.s.origin, end); tr = GameBase.gi.trace(start, null, null, end, self, Defines.MASK_SHOT); if (tr.ent != self.enemy) return true; if (self.s.frame == FRAME_drain03) { damage = 5; GameBase.gi.sound(self.enemy, Defines.CHAN_AUTO, sound_impact, 1, Defines.ATTN_NORM, 0); } else { if (self.s.frame == FRAME_drain04) GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_suck, 1, Defines.ATTN_NORM, 0); damage = 2; } GameBase.gi.WriteByte(Defines.svc_temp_entity); GameBase.gi.WriteByte(Defines.TE_PARASITE_ATTACK); //gi.WriteShort(self - g_edicts); GameBase.gi.WriteShort(self.index); GameBase.gi.WritePosition(start); GameBase.gi.WritePosition(end); GameBase.gi.multicast(self.s.origin, Defines.MULTICAST_PVS); Math3D.VectorSubtract(start, end, dir); GameUtil.T_Damage(self.enemy, self, self, dir, self.enemy.s.origin, Globals.vec3_origin, damage, 0, Defines.DAMAGE_NO_KNOCKBACK, Defines.MOD_UNKNOWN); return true; } }; static mframe_t parasite_frames_drain[] = new mframe_t[] { new mframe_t(GameAI.ai_charge, 0, parasite_launch), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, 15, parasite_drain_attack), // Target hits) new mframe_t(GameAI.ai_charge, 0, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, 0, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, 0, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, 0, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, -2, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, -2, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, -3, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, -2, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, 0, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, -1, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, 0, parasite_reel_in), // let go) new mframe_t(GameAI.ai_charge, -2, null), new mframe_t(GameAI.ai_charge, -2, null), new mframe_t(GameAI.ai_charge, -3, null), new mframe_t(GameAI.ai_charge, 0, null) }; static mmove_t parasite_move_drain = new mmove_t(FRAME_drain01, FRAME_drain18, parasite_frames_drain, parasite_start_run); static mframe_t parasite_frames_break[] = new mframe_t[] { new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, -3, null), new mframe_t(GameAI.ai_charge, 1, null), new mframe_t(GameAI.ai_charge, 2, null), new mframe_t(GameAI.ai_charge, -3, null), new mframe_t(GameAI.ai_charge, 1, null), new mframe_t(GameAI.ai_charge, 1, null), new mframe_t(GameAI.ai_charge, 3, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, -18, null), new mframe_t(GameAI.ai_charge, 3, null), new mframe_t(GameAI.ai_charge, 9, null), new mframe_t(GameAI.ai_charge, 6, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, -18, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, 8, null), new mframe_t(GameAI.ai_charge, 9, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, -18, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, 0, null), /* airborne */ new mframe_t(GameAI.ai_charge, 0, null), /* slides */ new mframe_t(GameAI.ai_charge, 0, null), /* slides */ new mframe_t(GameAI.ai_charge, 0, null), /* slides */ new mframe_t(GameAI.ai_charge, 0, null), /* slides */ new mframe_t(GameAI.ai_charge, 4, null), new mframe_t(GameAI.ai_charge, 11, null), new mframe_t(GameAI.ai_charge, -2, null), new mframe_t(GameAI.ai_charge, -5, null), new mframe_t(GameAI.ai_charge, 1, null) }; static mmove_t parasite_move_break = new mmove_t(FRAME_break01, FRAME_break32, parasite_frames_break, parasite_start_run); /* * === Break Stuff Ends === */ static EntThinkAdapter parasite_attack = new EntThinkAdapter() { public boolean think(edict_t self) { // if (random() <= 0.2) // self.monsterinfo.currentmove = ¶site_move_break; // else self.monsterinfo.currentmove = parasite_move_drain; return true; } }; /* * === Death Stuff Starts === */ static EntThinkAdapter parasite_dead = new EntThinkAdapter() { public boolean think(edict_t self) { Math3D.VectorSet(self.mins, -16, -16, -24); Math3D.VectorSet(self.maxs, 16, 16, -8); self.movetype = Defines.MOVETYPE_TOSS; self.svflags |= Defines.SVF_DEADMONSTER; self.nextthink = 0; GameBase.gi.linkentity(self); return true; } }; static mframe_t parasite_frames_death[] = new mframe_t[] { new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null) }; static mmove_t parasite_move_death = new mmove_t(FRAME_death101, FRAME_death107, parasite_frames_death, parasite_dead); static EntDieAdapter parasite_die = new EntDieAdapter() { public void die(edict_t self, edict_t inflictor, edict_t attacker, int damage, float[] point) { int n; // check for gib if (self.health <= self.gib_health) { GameBase.gi .sound(self, Defines.CHAN_VOICE, GameBase.gi .soundindex("misc/udeath.wav"), 1, Defines.ATTN_NORM, 0); for (n = 0; n < 2; n++) GameAI.ThrowGib(self, "models/objects/gibs/bone/tris.md2", damage, Defines.GIB_ORGANIC); for (n = 0; n < 4; n++) GameAI.ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, Defines.GIB_ORGANIC); GameAI.ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, Defines.GIB_ORGANIC); self.deadflag = Defines.DEAD_DEAD; return; } if (self.deadflag == Defines.DEAD_DEAD) return; // regular death GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_die, 1, Defines.ATTN_NORM, 0); self.deadflag = Defines.DEAD_DEAD; self.takedamage = Defines.DAMAGE_YES; self.monsterinfo.currentmove = parasite_move_death; } }; /* * === End Death Stuff === */ /* * QUAKED monster_parasite (1 .5 0) (-16 -16 -24) (16 16 32) Ambush * Trigger_Spawn Sight */ public static EntThinkAdapter SP_monster_parasite = new EntThinkAdapter() { public boolean think(edict_t self) { if (GameBase.deathmatch.value != 0) { GameUtil.G_FreeEdict(self); return true; } sound_pain1 = GameBase.gi.soundindex("parasite/parpain1.wav"); sound_pain2 = GameBase.gi.soundindex("parasite/parpain2.wav"); sound_die = GameBase.gi.soundindex("parasite/pardeth1.wav"); sound_launch = GameBase.gi.soundindex("parasite/paratck1.wav"); sound_impact = GameBase.gi.soundindex("parasite/paratck2.wav"); sound_suck = GameBase.gi.soundindex("parasite/paratck3.wav"); sound_reelin = GameBase.gi.soundindex("parasite/paratck4.wav"); sound_sight = GameBase.gi.soundindex("parasite/parsght1.wav"); sound_tap = GameBase.gi.soundindex("parasite/paridle1.wav"); sound_scratch = GameBase.gi.soundindex("parasite/paridle2.wav"); sound_search = GameBase.gi.soundindex("parasite/parsrch1.wav"); self.s.modelindex = GameBase.gi .modelindex("models/monsters/parasite/tris.md2"); Math3D.VectorSet(self.mins, -16, -16, -24); Math3D.VectorSet(self.maxs, 16, 16, 24); self.movetype = Defines.MOVETYPE_STEP; self.solid = Defines.SOLID_BBOX; self.health = 175; self.gib_health = -50; self.mass = 250; self.pain = parasite_pain; self.die = parasite_die; self.monsterinfo.stand = parasite_stand; self.monsterinfo.walk = parasite_start_walk; self.monsterinfo.run = parasite_start_run; self.monsterinfo.attack = parasite_attack; self.monsterinfo.sight = parasite_sight; self.monsterinfo.idle = parasite_idle; GameBase.gi.linkentity(self); self.monsterinfo.currentmove = parasite_move_stand; self.monsterinfo.scale = MODEL_SCALE; GameAI.walkmonster_start.think(self); return true; } }; static boolean parasite_drain_attack_ok(float[] start, float[] end) { float[] dir = { 0, 0, 0 }, angles = { 0, 0, 0 }; // check for max distance Math3D.VectorSubtract(start, end, dir); if (Math3D.VectorLength(dir) > 256) return false; // check for min/max pitch Math3D.vectoangles(dir, angles); if (angles[0] < -180) angles[0] += 360; if (Math.abs(angles[0]) > 30) return false; return true; } } --- NEW FILE: M_Player.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ // Created on 11.11.2003 by RST. // $Id: M_Player.java,v 1.2 2005/02/06 18:48:14 salomo Exp $ package jake2.game.monsters; public class M_Player { // This file generated by qdata - Do NOT Modify public final static int FRAME_stand01 = 0; public final static int FRAME_stand02 = 1; public final static int FRAME_stand03 = 2; public final static int FRAME_stand04 = 3; public final static int FRAME_stand05 = 4; public final static int FRAME_stand06 = 5; public final static int FRAME_stand07 = 6; public final static int FRAME_stand08 = 7; public final static int FRAME_stand09 = 8; public final static int FRAME_stand10 = 9; public final static int FRAME_stand11 = 10; public final static int FRAME_stand12 = 11; public final static int FRAME_stand13 = 12; public final static int FRAME_stand14 = 13; public final static int FRAME_stand15 = 14; public final static int FRAME_stand16 = 15; public final static int FRAME_stand17 = 16; public final static int FRAME_stand18 = 17; public final static int FRAME_stand19 = 18; public final static int FRAME_stand20 = 19; public final static int FRAME_stand21 = 20; public final static int FRAME_stand22 = 21; public final static int FRAME_stand23 = 22; public final static int FRAME_stand24 = 23; public final static int FRAME_stand25 = 24; public final static int FRAME_stand26 = 25; public final static int FRAME_stand27 = 26; public final static int FRAME_stand28 = 27; public final static int FRAME_stand29 = 28; public final static int FRAME_stand30 = 29; public final static int FRAME_stand31 = 30; public final static int FRAME_stand32 = 31; public final static int FRAME_stand33 = 32; public final static int FRAME_stand34 = 33; public final static int FRAME_stand35 = 34; public final static int FRAME_stand36 = 35; public final static int FRAME_stand37 = 36; public final static int FRAME_stand38 = 37; public final static int FRAME_stand39 = 38; public final static int FRAME_stand40 = 39; public final static int FRAME_run1 = 40; public final static int FRAME_run2 = 41; public final static int FRAME_run3 = 42; public final static int FRAME_run4 = 43; public final static int FRAME_run5 = 44; public final static int FRAME_run6 = 45; public final static int FRAME_attack1 = 46; public final static int FRAME_attack2 = 47; public final static int FRAME_attack3 = 48; public final static int FRAME_attack4 = 49; public final static int FRAME_attack5 = 50; public final static int FRAME_attack6 = 51; public final static int FRAME_attack7 = 52; public final static int FRAME_attack8 = 53; public final static int FRAME_pain101 = 54; public final static int FRAME_pain102 = 55; public final static int FRAME_pain103 = 56; public final static int FRAME_pain104 = 57; public final static int FRAME_pain201 = 58; public final static int FRAME_pain202 = 59; public final static int FRAME_pain203 = 60; public final static int FRAME_pain204 = 61; public final static int FRAME_pain301 = 62; public final static int FRAME_pain302 = 63; public final static int FRAME_pain303 = 64; public final static int FRAME_pain304 = 65; public final static int FRAME_jump1 = 66; public final static int FRAME_jump2 = 67; public final static int FRAME_jump3 = 68; public final static int FRAME_jump4 = 69; public final static int FRAME_jump5 = 70; public final static int FRAME_jump6 = 71; public final static int FRAME_flip01 = 72; public final static int FRAME_flip02 = 73; public final static int FRAME_flip03 = 74; public final static int FRAME_flip04 = 75; public final static int FRAME_flip05 = 76; public final static int FRAME_flip06 = 77; public final static int FRAME_flip07 = 78; public final static int FRAME_flip08 = 79; public final static int FRAME_flip09 = 80; public final static int FRAME_flip10 = 81; public final static int FRAME_flip11 = 82; public final static int FRAME_flip12 = 83; public final static int FRAME_salute01 = 84; public final static int FRAME_salute02 = 85; public final static int FRAME_salute03 = 86; public final static int FRAME_salute04 = 87; public final static int FRAME_salute05 = 88; public final static int FRAME_salute06 = 89; public final static int FRAME_salute07 = 90; public final static int FRAME_salute08 = 91; public final static int FRAME_salute09 = 92; public final static int FRAME_salute10 = 93; public final static int FRAME_salute11 = 94; public final static int FRAME_taunt01 = 95; public final static int FRAME_taunt02 = 96; public final static int FRAME_taunt03 = 97; public final static int FRAME_taunt04 = 98; public final static int FRAME_taunt05 = 99; public final static int FRAME_taunt06 = 100; public final static int FRAME_taunt07 = 101; public final static int FRAME_taunt08 = 102; public final static int FRAME_taunt09 = 103; public final static int FRAME_taunt10 = 104; public final static int FRAME_taunt11 = 105; public final static int FRAME_taunt12 = 106; public final static int FRAME_taunt13 = 107; public final static int FRAME_taunt14 = 108; public final static int FRAME_taunt15 = 109; public final static int FRAME_taunt16 = 110; public final static int FRAME_taunt17 = 111; public final static int FRAME_wave01 = 112; public final static int FRAME_wave02 = 113; public final static int FRAME_wave03 = 114; public final static int FRAME_wave04 = 115; public final static int FRAME_wave05 = 116; public final static int FRAME_wave06 = 117; public final static int FRAME_wave07 = 118; public final static int FRAME_wave08 = 119; public final static int FRAME_wave09 = 120; public final static int FRAME_wave10 = 121; public final static int FRAME_wave11 = 122; public final static int FRAME_point01 = 123; public final static int FRAME_point02 = 124; public final static int FRAME_point03 = 125; public final static int FRAME_point04 = 126; public final static int FRAME_point05 = 127; public final static int FRAME_point06 = 128; public final static int FRAME_point07 = 129; public final static int FRAME_point08 = 130; public final static int FRAME_point09 = 131; public final static int FRAME_point10 = 132; public final static int FRAME_point11 = 133; public final static int FRAME_point12 = 134; public final static int FRAME_crstnd01 = 135; public final static int FRAME_crstnd02 = 136; public final static int FRAME_crstnd03 = 137; public final static int FRAME_crstnd04 = 138; public final static int FRAME_crstnd05 = 139; public final static int FRAME_crstnd06 = 140; public final static int FRAME_crstnd07 = 141; public final static int FRAME_crstnd08 = 142; public final static int FRAME_crstnd09 = 143; public final static int FRAME_crstnd10 = 144; public final static int FRAME_crstnd11 = 145; public final static int FRAME_crstnd12 = 146; public final static int FRAME_crstnd13 = 147; public final static int FRAME_crstnd14 = 148; public final static int FRAME_crstnd15 = 149; public final static int FRAME_crstnd16 = 150; public final static int FRAME_crstnd17 = 151; public final static int FRAME_crstnd18 = 152; public final static int FRAME_crstnd19 = 153; public final static int FRAME_crwalk1 = 154; public final static int FRAME_crwalk2 = 155; public final static int FRAME_crwalk3 = 156; public final static int FRAME_crwalk4 = 157; public final static int FRAME_crwalk5 = 158; public final static int FRAME_crwalk6 = 159; public final static int FRAME_crattak1 = 160; public final static int FRAME_crattak2 = 161; public final static int FRAME_crattak3 = 162; public final static int FRAME_crattak4 = 163; public final static int FRAME_crattak5 = 164; public final static int FRAME_crattak6 = 165; public final static int FRAME_crattak7 = 166; public final static int FRAME_crattak8 = 167; public final static int FRAME_crattak9 = 168; public final static int FRAME_crpain1 = 169; public final static int FRAME_crpain2 = 170; public final static int FRAME_crpain3 = 171; public final static int FRAME_crpain4 = 172; public final static int FRAME_crdeath1 = 173; public final static int FRAME_crdeath2 = 174; public final static int FRAME_crdeath3 = 175; public final static int FRAME_crdeath4 = 176; public final static int FRAME_crdeath5 = 177; public final static int FRAME_death101 = 178; public final static int FRAME_death102 = 179; public final static int FRAME_death103 = 180; public final static int FRAME_death104 = 181; public final static int FRAME_death105 = 182; public final static int FRAME_death106 = 183; public final static int FRAME_death201 = 184; public final static int FRAME_death202 = 185; public final static int FRAME_death203 = 186; public final static int FRAME_death204 = 187; public final static int FRAME_death205 = 188; public final static int FRAME_death206 = 189; public final static int FRAME_death301 = 190; public final static int FRAME_death302 = 191; public final static int FRAME_death303 = 192; public final static int FRAME_death304 = 193; public final static int FRAME_death305 = 194; public final static int FRAME_death306 = 195; public final static int FRAME_death307 = 196; public final static int FRAME_death308 = 197; public final static float MODEL_SCALE = 1.000000f; } --- NEW FILE: M_Insane.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1255 lines suppressed...] GameBase.gi.linkentity(self); if ((self.spawnflags & 16) != 0) // Stand Ground self.monsterinfo.aiflags |= Defines.AI_STAND_GROUND; self.monsterinfo.currentmove = insane_move_stand_normal; self.monsterinfo.scale = MODEL_SCALE; if ((self.spawnflags & 8) != 0) // Crucified ? { Math3D.VectorSet(self.mins, -16, 0, 0); Math3D.VectorSet(self.maxs, 16, 8, 32); self.flags |= Defines.FL_NO_KNOCKBACK; GameAI.flymonster_start.think(self); } else { GameAI.walkmonster_start.think(self); self.s.skinnum = Lib.rand() % 3; } } } --- NEW FILE: M_Float.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1185 lines suppressed...] self.monsterinfo.walk = floater_walk; self.monsterinfo.run = floater_run; // self.monsterinfo.dodge = floater_dodge; self.monsterinfo.attack = floater_attack; self.monsterinfo.melee = floater_melee; self.monsterinfo.sight = floater_sight; self.monsterinfo.idle = floater_idle; GameBase.gi.linkentity(self); if (Lib.random() <= 0.5) self.monsterinfo.currentmove = floater_move_stand1; else self.monsterinfo.currentmove = floater_move_stand2; self.monsterinfo.scale = MODEL_SCALE; GameAI.flymonster_start.think(self); } } --- NEW FILE: M_Actor.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1559 lines suppressed...] self.solid = Defines.SOLID_TRIGGER; self.touch = target_actor_touch; Math3D.VectorSet(self.mins, -8, -8, -8); Math3D.VectorSet(self.maxs, 8, 8, 8); self.svflags = Defines.SVF_NOCLIENT; if ((self.spawnflags & 1) != 0) { if (0 == self.speed) self.speed = 200; if (0 == GameBase.st.height) GameBase.st.height = 200; if (self.s.angles[Defines.YAW] == 0) self.s.angles[Defines.YAW] = 360; GameBase.G_SetMovedir(self.s.angles, self.movedir); self.movedir[2] = GameBase.st.height; } GameBase.gi.linkentity(self); } } --- NEW FILE: M_Tank.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1482 lines suppressed...] self.monsterinfo.dodge = null; self.monsterinfo.attack = tank_attack; self.monsterinfo.melee = null; self.monsterinfo.sight = tank_sight; self.monsterinfo.idle = tank_idle; GameBase.gi.linkentity(self); self.monsterinfo.currentmove = tank_move_stand; self.monsterinfo.scale = MODEL_SCALE; GameAI.walkmonster_start.think(self); if (Lib.strcmp(self.classname, "monster_tank_commander") == 0) self.s.skinnum = 2; return true; } }; } --- NEW FILE: M_Supertank.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1224 lines suppressed...] for (n = 0; n < 8; n++) GameAI.ThrowGib(self, "models/objects/gibs/sm_metal/tris.md2", 500, Defines.GIB_METALLIC); GameAI.ThrowGib(self, "models/objects/gibs/chest/tris.md2", 500, Defines.GIB_ORGANIC); GameAI.ThrowHead(self, "models/objects/gibs/gear/tris.md2", 500, Defines.GIB_METALLIC); self.deadflag = Defines.DEAD_DEAD; return; } GameBase.gi.WriteByte(Defines.svc_temp_entity); GameBase.gi.WriteByte(Defines.TE_EXPLOSION1); GameBase.gi.WritePosition(org); GameBase.gi.multicast(self.s.origin, Defines.MULTICAST_PVS); self.nextthink = GameBase.level.time + 0.1f; } } --- NEW FILE: M_Chick.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1276 lines suppressed...] self.pain = chick_pain; self.die = chick_die; self.monsterinfo.stand = chick_stand; self.monsterinfo.walk = chick_walk; self.monsterinfo.run = chick_run; self.monsterinfo.dodge = chick_dodge; self.monsterinfo.attack = chick_attack; self.monsterinfo.melee = chick_melee; self.monsterinfo.sight = chick_sight; GameBase.gi.linkentity(self); self.monsterinfo.currentmove = chick_move_stand; self.monsterinfo.scale = MODEL_SCALE; GameAI.walkmonster_start.think(self); } } --- NEW FILE: M_Flipper.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ // Created on 13.11.2003 by RST. // $Id: M_Flipper.java,v 1.2 2005/02/06 18:48:17 salomo Exp $ package jake2.game.monsters; import jake2.Defines; import jake2.game.EntDieAdapter; import jake2.game.EntInteractAdapter; import jake2.game.EntPainAdapter; import jake2.game.EntThinkAdapter; import jake2.game.Fire; import jake2.game.GameAI; import jake2.game.GameBase; import jake2.game.GameUtil; import jake2.game.edict_t; import jake2.game.mframe_t; import jake2.game.mmove_t; import jake2.util.Lib; import jake2.util.Math3D; public class M_Flipper { // This file generated by ModelGen - Do NOT Modify public final static int FRAME_flpbit01 = 0; public final static int FRAME_flpbit02 = 1; public final static int FRAME_flpbit03 = 2; public final static int FRAME_flpbit04 = 3; public final static int FRAME_flpbit05 = 4; public final static int FRAME_flpbit06 = 5; public final static int FRAME_flpbit07 = 6; public final static int FRAME_flpbit08 = 7; public final static int FRAME_flpbit09 = 8; public final static int FRAME_flpbit10 = 9; public final static int FRAME_flpbit11 = 10; public final static int FRAME_flpbit12 = 11; public final static int FRAME_flpbit13 = 12; public final static int FRAME_flpbit14 = 13; public final static int FRAME_flpbit15 = 14; public final static int FRAME_flpbit16 = 15; public final static int FRAME_flpbit17 = 16; public final static int FRAME_flpbit18 = 17; public final static int FRAME_flpbit19 = 18; public final static int FRAME_flpbit20 = 19; public final static int FRAME_flptal01 = 20; public final static int FRAME_flptal02 = 21; public final static int FRAME_flptal03 = 22; public final static int FRAME_flptal04 = 23; public final static int FRAME_flptal05 = 24; public final static int FRAME_flptal06 = 25; public final static int FRAME_flptal07 = 26; public final static int FRAME_flptal08 = 27; public final static int FRAME_flptal09 = 28; public final static int FRAME_flptal10 = 29; public final static int FRAME_flptal11 = 30; public final static int FRAME_flptal12 = 31; public final static int FRAME_flptal13 = 32; public final static int FRAME_flptal14 = 33; public final static int FRAME_flptal15 = 34; public final static int FRAME_flptal16 = 35; public final static int FRAME_flptal17 = 36; public final static int FRAME_flptal18 = 37; public final static int FRAME_flptal19 = 38; public final static int FRAME_flptal20 = 39; public final static int FRAME_flptal21 = 40; public final static int FRAME_flphor01 = 41; public final static int FRAME_flphor02 = 42; public final static int FRAME_flphor03 = 43; public final static int FRAME_flphor04 = 44; public final static int FRAME_flphor05 = 45; public final static int FRAME_flphor06 = 46; public final static int FRAME_flphor07 = 47; public final static int FRAME_flphor08 = 48; public final static int FRAME_flphor09 = 49; public final static int FRAME_flphor10 = 50; public final static int FRAME_flphor11 = 51; public final static int FRAME_flphor12 = 52; public final static int FRAME_flphor13 = 53; public final static int FRAME_flphor14 = 54; public final static int FRAME_flphor15 = 55; public final static int FRAME_flphor16 = 56; public final static int FRAME_flphor17 = 57; public final static int FRAME_flphor18 = 58; public final static int FRAME_flphor19 = 59; public final static int FRAME_flphor20 = 60; public final static int FRAME_flphor21 = 61; public final static int FRAME_flphor22 = 62; public final static int FRAME_flphor23 = 63; public final static int FRAME_flphor24 = 64; public final static int FRAME_flpver01 = 65; public final static int FRAME_flpver02 = 66; public final static int FRAME_flpver03 = 67; public final static int FRAME_flpver04 = 68; public final static int FRAME_flpver05 = 69; public final static int FRAME_flpver06 = 70; public final static int FRAME_flpver07 = 71; public final static int FRAME_flpver08 = 72; public final static int FRAME_flpver09 = 73; public final static int FRAME_flpver10 = 74; public final static int FRAME_flpver11 = 75; public final static int FRAME_flpver12 = 76; public final static int FRAME_flpver13 = 77; public final static int FRAME_flpver14 = 78; public final static int FRAME_flpver15 = 79; public final static int FRAME_flpver16 = 80; public final static int FRAME_flpver17 = 81; public final static int FRAME_flpver18 = 82; public final static int FRAME_flpver19 = 83; public final static int FRAME_flpver20 = 84; public final static int FRAME_flpver21 = 85; public final static int FRAME_flpver22 = 86; public final static int FRAME_flpver23 = 87; public final static int FRAME_flpver24 = 88; public final static int FRAME_flpver25 = 89; public final static int FRAME_flpver26 = 90; public final static int FRAME_flpver27 = 91; public final static int FRAME_flpver28 = 92; public final static int FRAME_flpver29 = 93; public final static int FRAME_flppn101 = 94; public final static int FRAME_flppn102 = 95; public final static int FRAME_flppn103 = 96; public final static int FRAME_flppn104 = 97; public final static int FRAME_flppn105 = 98; public final static int FRAME_flppn201 = 99; public final static int FRAME_flppn202 = 100; public final static int FRAME_flppn203 = 101; public final static int FRAME_flppn204 = 102; public final static int FRAME_flppn205 = 103; public final static int FRAME_flpdth01 = 104; public final static int FRAME_flpdth02 = 105; public final static int FRAME_flpdth03 = 106; public final static int FRAME_flpdth04 = 107; public final static int FRAME_flpdth05 = 108; public final static int ... [truncated message content] |
From: Rene S. <sa...@us...> - 2005-02-06 18:47:11
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12365/src/jake2/qcommon Modified Files: MSG.java Log Message: added some helpful debug info for me Index: MSG.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/MSG.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MSG.java 22 Sep 2004 19:22:09 -0000 1.5 --- MSG.java 6 Feb 2005 18:47:00 -0000 1.6 *************** *** 88,91 **** --- 88,92 ---- SZ.Write(sb, x.getBytes()); WriteByte(sb, 0); + Com.dprintln("MSG.WriteString:" + s.replace('\0', '@')); } *************** *** 416,419 **** --- 417,421 ---- else c = msg_read.data[msg_read.readcount] & 0xff; + msg_read.readcount++; *************** *** 473,478 **** l++; } while (l < 2047); ! ! return new String(readbuf, 0, l); } --- 475,482 ---- l++; } while (l < 2047); ! ! String ret = new String(readbuf, 0, l); ! Com.dprintln("MSG.ReadString:[" + ret + "]"); ! return ret; } *************** *** 490,495 **** l++; } while (l < 2047); ! ! return new String(readbuf, 0, l).trim(); } --- 494,501 ---- l++; } while (l < 2047); ! ! String ret = new String(readbuf, 0, l).trim(); ! Com.dprintln("MSG.ReadStringLine:[" + ret.replace('\0', '@') + "]"); ! return ret; } *************** *** 556,559 **** for (int i = 0; i < len; i++) data[i] = (byte) ReadByte(msg_read); ! } } \ No newline at end of file --- 562,566 ---- for (int i = 0; i < len; i++) data[i] = (byte) ReadByte(msg_read); ! } ! } \ No newline at end of file |
From: Rene S. <sa...@us...> - 2005-02-06 18:46:02
|
Update of /cvsroot/jake2/jake2/info In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12159/info Added Files: ent_structure.txt Log Message: some helpfull doc for me --- NEW FILE: ent_structure.txt --- Written by Davo (sm...@cs...) (parts marked //kami0 supplied by Michael 'kami0' DiGiovanni (ka...@co...)) These are the attributes which all entities have. This is an explanation of the type 'edict_t'. Attributes are referenced by the format 'entity_name->attribute' (eg self->angle) Many of these will be familiar to QuakeC programers. NOTE - Not all of these are relevant to all entities (infact there are no entities for which all of these are relevant). name type notes absmin, absmax vec3_t position of min and max points of entity relative to the world's origin accel float acceleration of platforms activator edict_t * entity which activated the current entity air_finished float time when air will run out (when underwater) angle float entity yaw set by level editor (-1 = up; -2 = down) area link_t ? areanum, areanum2 int area where you currently are used when checking if monsters can hear sounds attenuation float attenuation of above sound (set at level edit) avelocity vec3_t angular velocity (see note for velocity) blocked void function to call when blocked? (optional) chain editc_t * used when creating a list of entities classname char * type of entity (eg 'player','monster_soldier') client struct gclient_s* points to the player controling it, NULL if not player controled clipmask int type of objects the entity will not pass through can be any of MASK_* or CONTENTS_* listed at bottom of this document clusternums[] int ? combattarget char * name of entity to attack (used once) count int general purpose 'amount' variable, often set in level editor damage_debounce_time float time when lava/slime can do more damage to player deadflag int state of deadness : DEAD_NO, DEAD_DYING, DEAD_DEAD, DEAD_RESPAWNABLE deathtarget char * name of entity to use when current entity dies decel float deceleration of platforms delay float time between triggering switch and effect activating die void function to call when health <= 0 (MUST be present if the entity can take damage) dmg int damage done by entity dmg_radius float area to do radius damage enemy edict_t * entity to attack flags int various attributes : FL_FLY -flying FL_SWIM -swimming, won't drown FL_IMMUNE_LASER -not hurt by laser FL_INWATER -set when entering water, cleared when leaving FL_GODMODE -god-mode on FL_NOTARGET -will not be targeted by monsters FL_IMMUNE_SLIME -not hurt by slime FL_IMMUNE_LAVA -not hurt by lava FL_PARTIAL_GROUND -ground pulled out from under monster FL_WATERJUMP -player jumping from water FL_TEAMSLAVE -not first member of a team FL_NO_KNOCKBACK -entity not thrown back by damage FL_POWER_ARMOR -active power armor FL_RESPAWN -entity waiting before re-spawning fly_sound_debounce_time float used with looping sound when pushing player (in_trigger.c) freetime float time when entity was freed-up in memory gib_health int health at which to gib :) goalentity edict_t * entity currently moving towards gravity float not used by any entites, but can be used to define reduced/ increased gravity for individual entities (normal=1.0) groundentity edict_t * what the entity is standing on groundentity_linkcount int used in conjunction with linkcount to see if the current entity is still standing on the groundentity headnode int ? health int health of entity, increased and set in many places, but should only be reduced by t_damage() ideal_yaw float yaw the entity wants to face inuse qboolean the entity exists in the world item gitem_t * info about item (see below) killtarget char * name of entity to remove when current entity triggered last_move_time float time to play earthquake sound again light_level int player's light level, used by monsters when checking if player can be seen linkcount int changed by the gi.linkentity function ? map char * filename of the next map, part of entity target_changelevel mass int used when pushing entites and calculating knock-back for weapons (eg rocket hits) max_health int maximum health message char * message when entity activated (set by level editor) mins, maxs vec3_t position of min and max points of entity relative to its origin model char * filename of entitie's model monsterinfo monsterinfo_t info about the monster (see below) move_angles vec3_t the angle that the gun turret is facing move_origin vec3_t the origin of the gun turret movedir vec3_t direction currently moving in moveinfo moveinfo_t used by the ships flying overhead movetarget edict_t * entity to wark towards when not got anything better to do (such as killing the player) movetype int how the entity moves : MOVETYPE_NONE -never moves MOVETYPE_NOCLIP -ignores walls, entities, etc. MOVETYPE_PUSH -ignores walls, pushes entities MOVETYPE_STOP -ignores walls, stops on entities MOVETYPE_WALK -affected by gravity MOVETYPE_STEP -gravity, special edge handling, used by monsters MOVETYPE_FLY -no gravity, used by flying monsters MOVETYPE_TOSS -gravity, hits ground and stops MOVETYPE_FLYMISSILE -weapons, extra clip size when hitting monsters MOVETYPE_BOUNCE -bounces (eg grenade) mynoise,mynoise2 edict_t * spawned when player makes a noise, monsters can home in on them nextthink float time at which entity should call function 'ent->think' noise_index int index of sound to play when entity is triggered noise_index2 int not used anywhere num_clusters int ? oldenemy edict_t * player they were attacking before distracted (by anither monster hitting them) pain void function to call when hurt (optional) pain_debounce_time float prevent pain sounds/anims playing to often pathtarget char * name of entity to move towards pos1 vec3_t top position of lift pos2 vec3_t bottom position of lift powerarmor_time float time to stop showing translucent shield effects prethink void function to call before each frame (optional) owner edict_t * usually the entity that spawned this entity (eg bullet is 'owned' by the monster that fired it) radius_dmg int amount of radius damage done by entity random float used to add a bit of time variation to func_timer s entity_state_t has several subtypes (see below) show_hostile qboolean any monsters seeing this one will inherit its enemy size vec3_t size of entity (vector from mins to maxs) solid solid_t solidity of entity : SOLID_NOT -no interaction with other objects SOLID_TOUCH -touch inside after moving (used for triggers) SOLID_BBOX -touch on side (monsters, etc) SOLID_BDP -bsp clip, touch on edge (for solid walls, blocks, etc) sounds int type of sounds to play - used by doors, lifts, etc spawnflags int set by level editor, some values are :SPAWNFLAG_NOT_EASY, SPAWNFLAG_NOT_MEDIUM, SPAWNFLAG_NOT_HARD, SPAWNFLAG_NOT_DEATHMATCH, SPAWNFLAG_NOT_COOP There are other possible settings, which I have not yet looked at in detail. speed float speed of misc entities, including moving buttons, the gun turret and the fly-by ships style int type of entities (eg type of health box) also used as areaportal number (something to do with separating areas) svflags int either : SVF_NOCLIENT - don't send to clients SVF_DEADMONSTER - a dead monster SVF_MONSTER - same, a bit earlier takedamgage int can the entity be damaged? : DAMAGE_NO -will not take damage DAMAGE_YES -will take damage DAMAGE_AIM -will take damage + weapons 'auto-aim' at it target char * name of entity to trigger or move towards target_ent editc_t * entity that platform/lift is moving towards targetname char * name pointed to by target team char * name of team which entity is part of teamchain edict_t * the next entity in the team teammaster edict_t * the master entity in the team teleport_time float time when monster teleported into level think void sets the function that should be called at time nextthink timestamp float used by various functions to mark the spawn time of an entity or the start of a change (eg a light ramp) touch void function to call when it touches another entity/the world (optional) touch_debounce_time float prevent touch function from being called again too quickly use void function to call when used (optional) viewheight int height above origin where eyes are found velocity vec3_t current velocity. I think this is used in the external c code to change the entity's position. Can anyone confirm whether this is internal or external? volume float volume when playing above sound (set at level edit) wait float time to wait before platform moves to the next point on its path waterlevel int height of liquid : 0 - not in liquid 1 - feet in liquid 2 - on surface of liquid 3 - surrounded by liquid watertype int type of water the entity is in (see the CONTENTS_* list at bottom of document) yaw_speed float speed to turn towards ideal yaw gitem_t referenced by 'entity_name->item.attribute' Name Type Notes ammo char * type of ammo to use classname char * name when spawning it count_width int number of digits to display by icon drop void function called when entity dropped flags int type of pickup : IT_WEAPON, IT_AMMO, IT_ARMOR icon char * filename of icon info void * ? unused pickup qboolean function called when entity picked up pickup_name char * displayed onscreen when item picked up pickup_sound char * filename of sound to play when picked up precaches char * string containing all models, sounds etc. needed by this item quantity int ammo gained by item/ammo used per shot by item tag int ? unused use void function called when entity used view_model char * filename of model when being held weaponthink void unused function world_model char * filename of model when item is sitting on level world_model_flags int copied to 'ent->s.effects' (see s.effects for values) monsterinfo_t referenced by 'entity_name->monsterinfo.attribute' Name Type Notes aiflags int controls how the monster will behave : AI_STAND_GROUND -don't move AI_TEMP_STAND_GROUND -stand ground for a short time (don't get too close to enemy?) AI_SOUND_TARGET -look for source of a sound AI_LOST_SIGHT -just lost sight of player AI_PURSUIT_LAST_SEEN - AI_PURSUE_NEXT -able to get to last sighting point this frame AI_PURSUE_TEMP -continue to persue for a bit AI_HOLD_FRAME -entity will hold the same frame (eg machine gun firing) AI_GOOD_GUY -don't attack you (prisoners) AI_BRUTAL -keep attacking until enemy's health < -80 (usualy stop at 0) AI_NOSTEP -used by exploding box AI_DUKED -monster's (pathetic) attempts to evade your shots AI_COMBAT_POINT -ignores everything else until it reaches it's destination AI_MEDIC -healing something (stop when the 'enemy's health > 0 ) AI_RESURRECTING -it's ALIVE!!! (almost) show resurection effects attack_finished float time when attack will be finished (prevents further attacks before monster is ready) attack_state int attack method the monster is using : AS_STRAIGHT -moving forwards to firing position AS_SLIDING -moving sideways to firing position AS_MELEE -close range attack AS_MISSILE -long range attack currentmove mmove_t * current set of frames cycling between idle_time float time until which the idle animation should be played last_sighting vec3_t last point where the player was seen lefty int if and attack_state is AS_SLIDING, the monster will go left otherwise it'll go right. this is swapped each time linkcount int changed by gi.linkentity? nextframe int next frame to display pausetime float time to stop at a particular path_corner power_armor_power int energy the armor has left power_armor_type int type of power armor: POWER_ARMOR_NONE, POWER_ARMOR_SCREEN, POWER_ARMOR_SHIELD 2 saved_goal vec3_t if the monster can't get to where it wants to this frame, that position is saved here scale float adjusts the running speed of the monster search_time float time to keep looking for player trail_time float timestamp of last section of player's trail found The following functions are called when certain conditions are met: attack void ranged attack (optional) checkattack qboolean function called to see if the monster will attack this frame dodge void !!INCOMING!! so just duck 'cos they wouldn't aim for your feet, would they? (optional) idle void animation to 'spice up' the standing around (optional) melee void close-up attack (optional) run void has an enemy, getting ready to attack search void searching for player animation (optional) sight void just spotted someone (optional) stand void function to call when just standing around walk void moving towards movetarget entity_state_t attributes here are referenced by 'entity_name->s.attribute' Name Type Notes angles vec3_t angles of the entity : ...angles[0] = pitch ...angles[1] = yaw ...angles[2] = roll (not really used) frame int current frame effects int special effects to apply to entity can be one or more of: EF_ROTATE -rotates (bonus items) EF_GIB -leave a blood trail EF_BLASTER -coloured light + trail EF_ROCKET -coloured light + trail EF_GRENADE -smoke trail? EF_HYPERBLASTER -light + trail EF_BFG -light + particles? EF_COLOR_SHELL -coloured glow around the entity EF_POWERSCREEN -green screen EF_ANIM01 -automatically cycle between frames 0 and 1 at 2 hz EF_ANIM23 -automatically cycle between frames 2 and 3 at 2 hz EF_ANIM_ALL -automatically cycle through all frames at 2hz EF_ANIM_ALLFAST -automatically cycle through all frames at 10hz EF_FLIES -flies effect EF_QUAD -quad damage 'glow' EF_PENT -invincibility 'glow' event int effects that last one frame : EV_NONE -no effect EV_ITEM_RESPAWN -item respawning EV_FOOTSTEP -footstep noise EV_FALLSHORT -noise from small fall EV_MALE_FALL -noise from male falling EV_MALE_FALLFAR -noise from male falling a long way EV_FEMALE_FALL -noise from female falling EV_FEMALE_FALLFAR -noise from female falling a long way EV_PLAYER_TELEPORT-teleportation effects modelindex int index of precached model modelindex2 int for when one modelindex just isn't enough ;). Used with the final 2-stage boss (oops, sorry if that's a spolier) and to show separate player weapons modelindex3,4 int not used number int entity index number old_origin vec3_t last position of entity (used in a few odd places) origin vec3_t origin of the entity renderfx int various drawing effects : RF_MINLIGHT -can always see the entity RF_VIEWERMODEL -don't let the player see this (himself) RF_WEAPONMODEL -only let the current player see this RF_FULLBRIGHT -entity always fully lit RF_DEPTHHACK -for view weapon Z crunching (?!) RF_TRANSLUCENT -entity is see through RF_FRAMELERP -? used by monsters and bodies RF_BEAM -laser beam RF_CUSTOMSKIN -skin is an index in image_precache RF_GLOW -pulse lighting for bonus items RF_SHELL_RED -red glow, when monsters are resurrecting RF_SHELL_GREEN -green glow, from power shield RF_SHELL_BLUE -blue glow, not currently used skinnum int current skin number solid int set by gi.linkentity, for client-side prediction sound int to gaurentee shut-off of looping sounds CONTENTS_SOLID solid wall (not windows) CONTENTS_WINDOW windows CONTENTS_AUX ? CONTENTS_LAVA err.. lava CONTENTS_SLIME slime CONTENTS_WATER water CONTENTS_MIST !!Unused!! LAST_VISIBLE_CONTENTS ? CONTENTS_AREAPORTAL portals to conserve memory used in map designing, also dont allow sounds to pass //kami0 CONTENTS_PLAYERCLIP brush which player may not pass through //kami0 CONTENTS_MONSTERCLIP brush where monsters may not pass through //kami0 CONTENTS_CURRENT_0 flowing current moving at angle 0 //kami0 CONTENTS_CURRENT_90 flowing current moving at angle 90 //kami0 CONTENTS_CURRENT_180 flowing current moving at angle 180 //kami0 CONTENTS_CURRENT_270 flowing current moving at angle 270 //kami0 CONTENTS_CURRENT_UP flowing current moving up //kami0 CONTENTS_CURRENT_DOWN flowing current moving down //kami0 CONTENTS_ORIGIN used for rotation, invisible //kami0 CONTENTS_MONSTER non-solid monster? CONTENTS_DEADMONSTER dead monster CONTENTS_DETAIL brush that is not passed to vis - not in final BSP ? CONTENTS_TRANSLUCENT see through CONTENTS_LADDER ladder MASK_ALL -stop on anything MASK_SOLID -walls/windows MASK_PLAYERSOLID -anything you'd expect a player to stop on MASK_DEADSOLID -same as above, can go through monsters MASK_MONSTERSOLID -anything you'd expect a monster to stop on MASK_WATER -any liquid MASK_OPAQUE -walls and liquid except water (which is see-through) MASK_SHOT -walls, monsters and dead monsters MASK_CURRENT -flowing brush Written by Davo (sm...@cs...) (parts marked //kami0 supplied by Michael 'kami0' DiGiovanni (ka...@co...)) If there are any corrections, bugs etc, please e-mail me. Please also note that this has been the result of searching through the c files supplied by iD, and I don't have reference to any official documents or anything, so don't assume I know what I'm talking about ;). |
From: Rene S. <sa...@us...> - 2005-02-06 10:57:12
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15933/src/jake2/client Modified Files: Tag: RST CL.java Log Message: bugfixes coop game and demo record. Index: CL.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL.java,v retrieving revision 1.16.2.1 retrieving revision 1.16.2.2 diff -C2 -d -r1.16.2.1 -r1.16.2.2 *** CL.java 30 Jan 2005 19:47:17 -0000 1.16.2.1 --- CL.java 6 Feb 2005 10:56:55 -0000 1.16.2.2 *************** *** 108,112 **** // finish up len = -1; ! Globals.cls.demofile.writeInt(len); Globals.cls.demofile.close(); Globals.cls.demofile = null; --- 108,112 ---- // finish up len = -1; ! Globals.cls.demofile.writeInt(EndianHandler.swapInt(len)); Globals.cls.demofile.close(); Globals.cls.demofile = null; *************** *** 188,196 **** if (Globals.cl.configstrings[i].length() > 0) { if (buf.cursize + Globals.cl.configstrings[i].length() ! + 32 > buf.maxsize) { // write it out ! //len = LittleLong(buf.cursize); ! //fwrite(& len, 4, 1, cls.demofile); ! Globals.cls.demofile.writeInt(buf.cursize); ! //fwrite(buf.data, buf.cursize, 1, cls.demofile); Globals.cls.demofile .write(buf.data, 0, buf.cursize); --- 188,194 ---- if (Globals.cl.configstrings[i].length() > 0) { if (buf.cursize + Globals.cl.configstrings[i].length() ! + 32 > buf.maxsize) { ! // write it out ! Globals.cls.demofile.writeInt(EndianHandler.swapInt(buf.cursize)); Globals.cls.demofile .write(buf.data, 0, buf.cursize); *************** *** 206,210 **** // baselines - //memset( nullstate, 0, sizeof(nullstate)); nullstate.clear(); for (i = 0; i < Defines.MAX_EDICTS; i++) { --- 204,207 ---- *************** *** 214,221 **** if (buf.cursize + 64 > buf.maxsize) { // write it out ! //len = LittleLong(buf.cursize); ! //fwrite(& len, 4, 1, cls.demofile); ! Globals.cls.demofile.writeInt(buf.cursize); ! //fwrite(buf.data, buf.cursize, 1, cls.demofile); Globals.cls.demofile.write(buf.data, 0, buf.cursize); buf.cursize = 0; --- 211,215 ---- if (buf.cursize + 64 > buf.maxsize) { // write it out ! Globals.cls.demofile.writeInt(EndianHandler.swapInt(buf.cursize)); Globals.cls.demofile.write(buf.data, 0, buf.cursize); buf.cursize = 0; *************** *** 231,239 **** // write it to the demo file ! ! //len = LittleLong(buf.cursize); ! //fwrite(& len, 4, 1, cls.demofile); ! Globals.cls.demofile.writeInt(buf.cursize); ! //fwrite(buf.data, buf.cursize, 1, cls.demofile); Globals.cls.demofile.write(buf.data, 0, buf.cursize); // the rest of the demo file will be individual frames --- 225,229 ---- // write it to the demo file ! Globals.cls.demofile.writeInt(EndianHandler.swapInt(buf.cursize)); Globals.cls.demofile.write(buf.data, 0, buf.cursize); // the rest of the demo file will be individual frames *************** *** 627,634 **** try { ! Globals.cls.demofile.writeInt(swlen); ! //fwrite (&swlen, 4, 1, cls.demofile); Globals.cls.demofile.write(Globals.net_message.data, 8, swlen); - //fwrite (net_message.data+8, len, 1, cls.demofile); } catch (IOException e) { } --- 617,622 ---- try { ! Globals.cls.demofile.writeInt(EndianHandler.swapInt(swlen)); Globals.cls.demofile.write(Globals.net_message.data, 8, swlen); } catch (IOException e) { } |
From: Rene S. <sa...@us...> - 2005-02-06 10:57:11
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15933/src/jake2/server Modified Files: Tag: RST SV_INIT.java SV_USER.java Log Message: bugfixes coop game and demo record. Index: SV_USER.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_USER.java,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** SV_USER.java 23 Jan 2005 21:31:50 -0000 1.7.2.1 --- SV_USER.java 6 Feb 2005 10:56:54 -0000 1.7.2.2 *************** *** 475,480 **** //ZOID, ss_pic can be nextserver'd in coop mode if (SV_INIT.sv.state == Defines.ss_game ! || (SV_INIT.sv.state == Defines.ss_pic && 0 == Cvar ! .VariableValue("coop"))) return; // can't nextserver while playing a normal game --- 475,480 ---- //ZOID, ss_pic can be nextserver'd in coop mode if (SV_INIT.sv.state == Defines.ss_game ! || (SV_INIT.sv.state == Defines.ss_pic && ! 0 == Cvar.VariableValue("coop"))) return; // can't nextserver while playing a normal game Index: SV_INIT.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_INIT.java,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** SV_INIT.java 6 Nov 2004 20:58:11 -0000 1.10 --- SV_INIT.java 6 Feb 2005 10:56:54 -0000 1.10.2.1 *************** *** 448,452 **** //ZOID special hack for end game screen in coop mode ! if (Cvar.VariableValue("coop") != 0 && !level.equals("victory.pcx")) Cvar.Set("nextserver", "gamemap \"*base1\""); --- 448,452 ---- //ZOID special hack for end game screen in coop mode ! if (Cvar.VariableValue("coop") != 0 && level.equals("victory.pcx")) Cvar.Set("nextserver", "gamemap \"*base1\""); |
From: Rene S. <sa...@us...> - 2005-02-06 10:57:09
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15933/src/jake2/game Modified Files: Tag: RST PlayerHud.java Log Message: bugfixes coop game and demo record. Index: PlayerHud.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerHud.java,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.2 diff -C2 -d -r1.6.6.1 -r1.6.6.2 *** PlayerHud.java 23 Jan 2005 21:31:46 -0000 1.6.6.1 --- PlayerHud.java 6 Feb 2005 10:56:56 -0000 1.6.6.2 *************** *** 230,234 **** if (tag != null) { string.append("xv ").append(x + 32).append(" yv ").append(y) ! .append(" picn ").append(tag); /* * //Com_sprintf(entry, sizeof(entry), "xv %i yv %i picn %s ", x + --- 230,234 ---- if (tag != null) { string.append("xv ").append(x + 32).append(" yv ").append(y) ! .append(" picn ").append(tag).append(" "); /* * //Com_sprintf(entry, sizeof(entry), "xv %i yv %i picn %s ", x + |
From: Carsten W. <ca...@us...> - 2005-02-01 16:55:38
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18045/src/jake2/render/lwjgl Modified Files: Surf.java Log Message: a little bit faster Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Surf.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Surf.java 17 Jan 2005 16:50:24 -0000 1.7 --- Surf.java 1 Feb 2005 16:55:28 -0000 1.8 *************** *** 938,950 **** { // memcpy (fatvis, vis, (r_worldmodel.numleafs+7)/8); ! System.arraycopy(vis, 0, fatvis, 0, (r_worldmodel.numleafs+7) / 8); vis = Mod_ClusterPVS(r_viewcluster2, r_worldmodel); ! c = (r_worldmodel.numleafs + 31) / 32; ! int k = 0; for (i=0 ; i<c ; i++) { ! fatvis[k] |= vis[k++]; ! fatvis[k] |= vis[k++]; ! fatvis[k] |= vis[k++]; ! fatvis[k] |= vis[k++]; } --- 938,950 ---- { // memcpy (fatvis, vis, (r_worldmodel.numleafs+7)/8); ! System.arraycopy(vis, 0, fatvis, 0, (r_worldmodel.numleafs+7) >> 3); vis = Mod_ClusterPVS(r_viewcluster2, r_worldmodel); ! c = (r_worldmodel.numleafs + 31) >> 5; ! int k = -1; for (i=0 ; i<c ; i++) { ! fatvis[++k] |= vis[k]; ! fatvis[++k] |= vis[k]; ! fatvis[++k] |= vis[k]; ! fatvis[++k] |= vis[k]; } |
From: Carsten W. <ca...@us...> - 2005-02-01 16:55:17
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17956/src/jake2/render/lwjgl Modified Files: Mesh.java Log Message: a little bit faster Index: Mesh.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Mesh.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Mesh.java 22 Jan 2005 22:28:15 -0000 1.4 --- Mesh.java 1 Feb 2005 16:55:07 -0000 1.5 *************** *** 82,85 **** --- 82,86 ---- int[] vv; FloatBuffer lerp = vertexArrayBuf; + lerp.limit((nverts << 2) - nverts); // nverts * 3 //PMM -- added RF_SHELL_DOUBLE, RF_SHELL_HALF_DAM *************** *** 87,91 **** { float[] normal; ! int j = 0; for (int i=0 ; i < nverts; i++/* , v++, ov++, lerp+=4 */) { --- 88,92 ---- { float[] normal; ! int j = -1; for (int i=0 ; i < nverts; i++/* , v++, ov++, lerp+=4 */) { *************** *** 94,105 **** vv = verts[i].v; ! lerp.put(j++, move[0] + ovv[0]*backv[0] + vv[0]*frontv[0] + normal[0] * Defines.POWERSUIT_SCALE); ! lerp.put(j++, move[1] + ovv[1]*backv[1] + vv[1]*frontv[1] + normal[1] * Defines.POWERSUIT_SCALE); ! lerp.put(j++, move[2] + ovv[2]*backv[2] + vv[2]*frontv[2] + normal[2] * Defines.POWERSUIT_SCALE); } } else { ! int j = 0; for (int i=0 ; i < nverts; i++ /* , v++, ov++, lerp+=4 */) { --- 95,106 ---- vv = verts[i].v; ! lerp.put(++j, move[0] + ovv[0]*backv[0] + vv[0]*frontv[0] + normal[0] * Defines.POWERSUIT_SCALE); ! lerp.put(++j, move[1] + ovv[1]*backv[1] + vv[1]*frontv[1] + normal[1] * Defines.POWERSUIT_SCALE); ! lerp.put(++j, move[2] + ovv[2]*backv[2] + vv[2]*frontv[2] + normal[2] * Defines.POWERSUIT_SCALE); } } else { ! int j = -1; for (int i=0 ; i < nverts; i++ /* , v++, ov++, lerp+=4 */) { *************** *** 107,113 **** vv = verts[i].v; ! lerp.put(j++, move[0] + ovv[0]*backv[0] + vv[0]*frontv[0]); ! lerp.put(j++, move[1] + ovv[1]*backv[1] + vv[1]*frontv[1]); ! lerp.put(j++, move[2] + ovv[2]*backv[2] + vv[2]*frontv[2]); } } --- 108,114 ---- vv = verts[i].v; ! lerp.put(++j, move[0] + ovv[0]*backv[0] + vv[0]*frontv[0]); ! lerp.put(++j, move[1] + ovv[1]*backv[1] + vv[1]*frontv[1]); ! lerp.put(++j, move[2] + ovv[2]*backv[2] + vv[2]*frontv[2]); } } *************** *** 193,205 **** // FloatBuffer color = colorArrayBuf; ! int j = 0; float l; ! for (int i = 0; i < paliashdr.num_xyz; i++ ) { l = shadedots[verts[i].lightnormalindex]; ! color.put(j++, l * shadelight[0]); ! color.put(j++, l * shadelight[1]); ! color.put(j++, l * shadelight[2]); ! color.put(j++, alpha); } } --- 194,207 ---- // FloatBuffer color = colorArrayBuf; ! int j = -1; float l; ! int size = paliashdr.num_xyz; ! for (int i = 0; i < size; i++ ) { l = shadedots[verts[i].lightnormalindex]; ! color.put(++j, l * shadelight[0]); ! color.put(++j, l * shadelight[1]); ! color.put(++j, l * shadelight[2]); ! color.put(++j, alpha); } } *************** *** 220,224 **** int srcIndex = 0; int count; ! for (int j = 0; j < counts.length; j++) { // get the vertex count and primitive type --- 222,228 ---- int srcIndex = 0; int count; ! int mode; ! int size = counts.length; ! for (int j = 0; j < size; j++) { // get the vertex count and primitive type *************** *** 229,233 **** srcIndexBuf = paliashdr.indexElements[j]; ! int mode = GL11.GL_TRIANGLE_STRIP; if (count < 0) { mode = GL11.GL_TRIANGLE_FAN; --- 233,237 ---- srcIndexBuf = paliashdr.indexElements[j]; ! mode = GL11.GL_TRIANGLE_STRIP; if (count < 0) { mode = GL11.GL_TRIANGLE_FAN; *************** *** 235,242 **** } srcIndex = pos << 1; for (int k = 0; k < count; k++) { dstIndex = srcIndexBuf.get(k) << 1; ! dstTextureCoords.put(dstIndex++, srcTextureCoords.get(srcIndex++)); ! dstTextureCoords.put(dstIndex, srcTextureCoords.get(srcIndex++)); } --- 239,247 ---- } srcIndex = pos << 1; + srcIndex--; for (int k = 0; k < count; k++) { dstIndex = srcIndexBuf.get(k) << 1; ! dstTextureCoords.put(dstIndex, srcTextureCoords.get(++srcIndex)); ! dstTextureCoords.put(++dstIndex, srcTextureCoords.get(++srcIndex)); } |
From: Rene S. <sa...@us...> - 2005-01-30 19:48:06
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2095/src/jake2/client Modified Files: Tag: RST CL.java SCR.java Log Message: merged from head Index: SCR.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/SCR.java,v retrieving revision 1.8.6.1 retrieving revision 1.8.6.2 diff -C2 -d -r1.8.6.1 -r1.8.6.2 *** SCR.java 16 Jan 2005 21:20:58 -0000 1.8.6.1 --- SCR.java 30 Jan 2005 19:47:18 -0000 1.8.6.2 *************** *** 1127,1142 **** token = Com.Parse(ph); value = cl.frame.playerstate.stats[Lib.atoi(token)]; ! if (value == 0) { // skip to endif ! // while (s && strcmp(token, "endif") ) ! // { ! // token = Com.Parse(ph); ! // } ! ! while (!ph.isEof() ! && !(token = Com.Parse(ph)).equals("endif")) ! ; ! } - continue; } --- 1127,1134 ---- token = Com.Parse(ph); value = cl.frame.playerstate.stats[Lib.atoi(token)]; ! if (value == 0) { ! // skip to endif ! while (!ph.isEof() && !(token = Com.Parse(ph)).equals("endif")); } continue; } Index: CL.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL.java,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -C2 -d -r1.16 -r1.16.2.1 *** CL.java 7 Nov 2004 19:38:40 -0000 1.16 --- CL.java 30 Jan 2005 19:47:17 -0000 1.16.2.1 *************** *** 44,48 **** */ public final class CL { ! static int precache_check; // for autodownload of precache items --- 44,48 ---- */ public final class CL { ! static int precache_check; // for autodownload of precache items *************** *** 207,210 **** --- 207,211 ---- // baselines //memset( nullstate, 0, sizeof(nullstate)); + nullstate.clear(); for (i = 0; i < Defines.MAX_EDICTS; i++) { ent = Globals.cl_entities[i].baseline; *************** *** 1292,1305 **** CL_input.InitInput(); ! // never used !! ! // adr0 = Cvar.Get("adr0", "", CVAR_ARCHIVE); ! // adr1 = Cvar.Get("adr1", "", CVAR_ARCHIVE); ! // adr2 = Cvar.Get("adr2", "", CVAR_ARCHIVE); ! // adr3 = Cvar.Get("adr3", "", CVAR_ARCHIVE); ! // adr4 = Cvar.Get("adr4", "", CVAR_ARCHIVE); ! // adr5 = Cvar.Get("adr5", "", CVAR_ARCHIVE); ! // adr6 = Cvar.Get("adr6", "", CVAR_ARCHIVE); ! // adr7 = Cvar.Get("adr7", "", CVAR_ARCHIVE); ! // adr8 = Cvar.Get("adr8", "", CVAR_ARCHIVE); // --- 1293,1305 ---- CL_input.InitInput(); ! Cvar.Get("adr0", "", Defines.CVAR_ARCHIVE); ! Cvar.Get("adr1", "", Defines.CVAR_ARCHIVE); ! Cvar.Get("adr2", "", Defines.CVAR_ARCHIVE); ! Cvar.Get("adr3", "", Defines.CVAR_ARCHIVE); ! Cvar.Get("adr4", "", Defines.CVAR_ARCHIVE); ! Cvar.Get("adr5", "", Defines.CVAR_ARCHIVE); ! Cvar.Get("adr6", "", Defines.CVAR_ARCHIVE); ! Cvar.Get("adr7", "", Defines.CVAR_ARCHIVE); ! Cvar.Get("adr8", "", Defines.CVAR_ARCHIVE); // |
From: Rene S. <sa...@us...> - 2005-01-30 19:48:06
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2095/src/jake2/qcommon Modified Files: Tag: RST Com.java CRC.java Log Message: merged from head Index: CRC.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/CRC.java,v retrieving revision 1.1 retrieving revision 1.1.8.1 diff -C2 -d -r1.1 -r1.1.8.1 *** CRC.java 9 Jul 2004 06:50:49 -0000 1.1 --- CRC.java 30 Jan 2005 19:47:21 -0000 1.1.8.1 *************** *** 31,294 **** public final static short CRC_XOR_VALUE= (short) 0x0000; ! private static int crctable[]= ! { ! 0x0000, ! 0x1021, ! 0x2042, ! 0x3063, ! 0x4084, ! 0x50a5, ! 0x60c6, ! 0x70e7, ! 0x8108, ! 0x9129, ! 0xa14a, ! 0xb16b, ! 0xc18c, ! 0xd1ad, ! 0xe1ce, ! 0xf1ef, ! 0x1231, ! 0x0210, ! 0x3273, ! 0x2252, ! 0x52b5, ! 0x4294, ! 0x72f7, ! 0x62d6, ! 0x9339, ! 0x8318, ! 0xb37b, ! 0xa35a, ! 0xd3bd, ! 0xc39c, ! 0xf3ff, ! 0xe3de, ! 0x2462, ! 0x3443, ! 0x0420, ! 0x1401, ! 0x64e6, ! 0x74c7, ! 0x44a4, ! 0x5485, ! 0xa56a, ! 0xb54b, ! 0x8528, ! 0x9509, ! 0xe5ee, ! 0xf5cf, ! 0xc5ac, ! 0xd58d, ! 0x3653, ! 0x2672, ! 0x1611, ! 0x0630, ! 0x76d7, ! 0x66f6, ! 0x5695, ! 0x46b4, ! 0xb75b, ! 0xa77a, ! 0x9719, ! 0x8738, ! 0xf7df, ! 0xe7fe, ! 0xd79d, ! 0xc7bc, ! 0x48c4, ! 0x58e5, ! 0x6886, ! 0x78a7, ! 0x0840, ! 0x1861, ! 0x2802, ! 0x3823, ! 0xc9cc, ! 0xd9ed, ! 0xe98e, ! 0xf9af, ! 0x8948, ! 0x9969, ! 0xa90a, ! 0xb92b, ! 0x5af5, ! 0x4ad4, ! 0x7ab7, ! 0x6a96, ! 0x1a71, ! 0x0a50, ! 0x3a33, ! 0x2a12, ! 0xdbfd, ! 0xcbdc, ! 0xfbbf, ! 0xeb9e, ! 0x9b79, ! 0x8b58, ! 0xbb3b, ! 0xab1a, ! 0x6ca6, ! 0x7c87, ! 0x4ce4, ! 0x5cc5, ! 0x2c22, ! 0x3c03, ! 0x0c60, ! 0x1c41, ! 0xedae, ! 0xfd8f, ! 0xcdec, ! 0xddcd, ! 0xad2a, ! 0xbd0b, ! 0x8d68, ! 0x9d49, ! 0x7e97, ! 0x6eb6, ! 0x5ed5, ! 0x4ef4, ! 0x3e13, ! 0x2e32, ! 0x1e51, ! 0x0e70, ! 0xff9f, ! 0xefbe, ! 0xdfdd, ! 0xcffc, ! 0xbf1b, ! 0xaf3a, ! 0x9f59, ! 0x8f78, ! 0x9188, ! 0x81a9, ! 0xb1ca, ! 0xa1eb, ! 0xd10c, ! 0xc12d, ! 0xf14e, ! 0xe16f, ! 0x1080, ! 0x00a1, ! 0x30c2, ! 0x20e3, ! 0x5004, ! 0x4025, ! 0x7046, ! 0x6067, ! 0x83b9, ! 0x9398, ! 0xa3fb, ! 0xb3da, ! 0xc33d, ! 0xd31c, ! 0xe37f, ! 0xf35e, ! 0x02b1, ! 0x1290, ! 0x22f3, ! 0x32d2, ! 0x4235, ! 0x5214, ! 0x6277, ! 0x7256, ! 0xb5ea, ! 0xa5cb, ! 0x95a8, ! 0x8589, ! 0xf56e, ! 0xe54f, ! 0xd52c, ! 0xc50d, ! 0x34e2, ! 0x24c3, ! 0x14a0, ! 0x0481, ! 0x7466, ! 0x6447, ! 0x5424, ! 0x4405, ! 0xa7db, ! 0xb7fa, ! 0x8799, ! 0x97b8, ! 0xe75f, ! 0xf77e, ! 0xc71d, ! 0xd73c, ! 0x26d3, ! 0x36f2, ! 0x0691, ! 0x16b0, ! 0x6657, ! 0x7676, ! 0x4615, ! 0x5634, ! 0xd94c, ! 0xc96d, ! 0xf90e, ! 0xe92f, ! 0x99c8, ! 0x89e9, ! 0xb98a, ! 0xa9ab, ! 0x5844, ! 0x4865, ! 0x7806, ! 0x6827, ! 0x18c0, ! 0x08e1, ! 0x3882, ! 0x28a3, ! 0xcb7d, ! 0xdb5c, ! 0xeb3f, ! 0xfb1e, ! 0x8bf9, ! 0x9bd8, ! 0xabbb, ! 0xbb9a, ! 0x4a75, ! 0x5a54, ! 0x6a37, ! 0x7a16, ! 0x0af1, ! 0x1ad0, ! 0x2ab3, ! 0x3a92, ! 0xfd2e, ! 0xed0f, ! 0xdd6c, ! 0xcd4d, ! 0xbdaa, ! 0xad8b, ! 0x9de8, ! 0x8dc9, ! 0x7c26, ! 0x6c07, ! 0x5c64, ! 0x4c45, ! 0x3ca2, ! 0x2c83, ! 0x1ce0, ! 0x0cc1, ! 0xef1f, ! 0xff3e, ! 0xcf5d, ! 0xdf7c, ! 0xaf9b, ! 0xbfba, ! 0x8fd9, ! 0x9ff8, ! 0x6e17, ! 0x7e36, ! 0x4e55, ! 0x5e74, ! 0x2e93, ! 0x3eb2, ! 0x0ed1, ! 0x1ef0 }; ! static short CRC_Block(byte start[], int count) { short crc= CRC_INIT_VALUE; --- 31,69 ---- public final static short CRC_XOR_VALUE= (short) 0x0000; ! private static int crctable[] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, ! 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, ! 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, ! 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, ! 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, ! 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, ! 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, ! 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, ! 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, ! 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, ! 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, ! 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, ! 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, ! 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, ! 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, ! 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, ! 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, ! 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, ! 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, ! 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, ! 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, ! 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, ! 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, ! 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, ! 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, ! 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, ! 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, ! 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, ! 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, ! 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, ! 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, ! 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, ! 0x3eb2, 0x0ed1, 0x1ef0 }; ! static int CRC_Block(byte start[], int count) { short crc= CRC_INIT_VALUE; *************** *** 299,303 **** crc= (short) ((crc << 8) ^ crctable[0xff & ((crc >> 8) ^ start[ndx++])]); ! return crc; } --- 74,79 ---- crc= (short) ((crc << 8) ^ crctable[0xff & ((crc >> 8) ^ start[ndx++])]); ! // unsigned short ! return crc & 0xFFFF; } Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.java,v retrieving revision 1.6.6.2 retrieving revision 1.6.6.3 diff -C2 -d -r1.6.6.2 -r1.6.6.3 *** Com.java 23 Jan 2005 21:31:17 -0000 1.6.6.2 --- Com.java 30 Jan 2005 19:47:20 -0000 1.6.6.3 *************** *** 217,222 **** // skip whitespace hlp.skipwhites(); ! if (hlp.isEof()) ! return ""; // skip // comments --- 217,224 ---- // skip whitespace hlp.skipwhites(); ! if (hlp.isEof()) { [...1235 lines suppressed...] //memcpy(chkb, base, length); ! length = Math.min(60, length); ! System.arraycopy(base, offset , chkb, 0, length); + chkb[length] = chktbl[p_ndx + 0]; + chkb[length + 1] = chktbl[p_ndx + 1]; + chkb[length + 2] = chktbl[p_ndx + 2]; + chkb[length + 3] = chktbl[p_ndx + 3]; length += 4; ! // unsigned short ! int crc = CRC.CRC_Block(chkb, length); ! int x = 0; ! for (int n=0; n < length; n++) ! x += chkb[n] & 0xFF; crc ^= x; |
From: Rene S. <sa...@us...> - 2005-01-30 19:48:05
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2095/src/jake2/render Modified Files: Tag: RST model_t.java Log Message: merged from head Index: model_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/model_t.java,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** model_t.java 9 Jul 2004 06:50:47 -0000 1.3 --- model_t.java 30 Jan 2005 19:47:19 -0000 1.3.6.1 *************** *** 24,34 **** package jake2.render; ! import java.util.Vector; ! ! import jake2.qcommon.*; import jake2.util.Lib; import jake2.util.Math3D; ! import jake2.*; ! import jake2.game.*; public class model_t implements Cloneable { --- 24,34 ---- package jake2.render; ! import jake2.Defines; ! import jake2.game.cplane_t; ! import jake2.qcommon.qfiles; import jake2.util.Lib; import jake2.util.Math3D; ! ! import java.util.Arrays; public class model_t implements Cloneable { *************** *** 172,182 **** // for alias models and skins // was image_t *skins[]; (array of pointers) ! for (int i = 0; i < skins.length; i++) ! { ! skins[i] = null; ! } extradatasize = 0; - // or whatever extradata = null; --- 172,178 ---- // for alias models and skins // was image_t *skins[]; (array of pointers) ! Arrays.fill(skins, null); extradatasize = 0; // or whatever extradata = null; |
From: Rene S. <sa...@us...> - 2005-01-30 19:47:45
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2095/src/jake2/render/lwjgl Modified Files: Tag: RST Mesh.java Model.java Log Message: merged from head Index: Model.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Model.java,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** Model.java 16 Jan 2005 21:21:08 -0000 1.3.2.1 --- Model.java 30 Jan 2005 19:47:21 -0000 1.3.2.2 *************** *** 1336,1339 **** --- 1336,1340 ---- model.vertexIndexBuf.position(pos); model.indexElements[i] = model.vertexIndexBuf.slice(); + model.indexElements[i].limit(count); pos += count; } Index: Mesh.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Mesh.java,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** Mesh.java 23 Jan 2005 21:31:49 -0000 1.2.2.1 --- Mesh.java 30 Jan 2005 19:47:21 -0000 1.2.2.2 *************** *** 217,221 **** FloatBuffer srcTextureCoords = paliashdr.textureCoordBuf; - int size = 0; int dstIndex = 0; int srcIndex = 0; --- 217,220 ---- *************** *** 235,251 **** count = -count; } ! size = count + pos; ! srcIndex = 2 * pos; ! for (int k = pos; k < size; k++) { ! dstIndex = 2 * srcIndexBuf.get(k-pos); dstTextureCoords.put(dstIndex++, srcTextureCoords.get(srcIndex++)); dstTextureCoords.put(dstIndex, srcTextureCoords.get(srcIndex++)); } - int limit=srcIndexBuf.limit(); - srcIndexBuf.limit(count); gl.glDrawElements(mode, srcIndexBuf); - srcIndexBuf.limit(limit); - pos += count; } --- 234,245 ---- count = -count; } ! srcIndex = pos << 1; ! for (int k = 0; k < count; k++) { ! dstIndex = srcIndexBuf.get(k) << 1; dstTextureCoords.put(dstIndex++, srcTextureCoords.get(srcIndex++)); dstTextureCoords.put(dstIndex, srcTextureCoords.get(srcIndex++)); } gl.glDrawElements(mode, srcIndexBuf); pos += count; } |
From: Rene S. <sa...@us...> - 2005-01-30 19:47:45
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2095/src/jake2/game Modified Files: Tag: RST Cmd.java entity_state_t.java Log Message: merged from head Index: Cmd.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Cmd.java,v retrieving revision 1.8.2.2 retrieving revision 1.8.2.3 diff -C2 -d -r1.8.2.2 -r1.8.2.3 *** Cmd.java 23 Jan 2005 21:31:46 -0000 1.8.2.2 --- Cmd.java 30 Jan 2005 19:47:31 -0000 1.8.2.3 *************** *** 267,271 **** while (true) { - cmd_argv[cmd_argc] = null; // skip whitespace up to a /n char c = ph.skipwhitestoeol(); --- 267,270 ---- *************** *** 287,291 **** com_token = Com.Parse(ph); ! if (com_token.length() == 0) return; --- 286,290 ---- com_token = Com.Parse(ph); ! if (ph.data == null) return; *************** *** 392,401 **** TokenizeString(text.toCharArray(), true); ! // if (Argc() > 0) { ! // Com.DPrintf("tokenized:"); ! // for (int xxx = 0; xxx < Argc(); xxx++) ! // Com.dprintln("<" + Argv(xxx) + ">"); ! // } ! // execute the command line if (Argc() == 0) --- 391,401 ---- TokenizeString(text.toCharArray(), true); ! // if (Argc() > 0) { ! // Com.DPrintf("tokenized:"); ! // for (int xxx = 0; xxx < Argc(); xxx++) ! // Com.DPrintf("[" + Argv(xxx) + "]"); ! // ! // Com.DPrintf("\n"); ! // } // execute the command line if (Argc() == 0) Index: entity_state_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/entity_state_t.java,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** entity_state_t.java 20 Aug 2004 21:29:58 -0000 1.3 --- entity_state_t.java 30 Jan 2005 19:47:32 -0000 1.3.6.1 *************** *** 146,148 **** --- 146,166 ---- event = from.event; } + + public void clear() + { + number = -99999; + surrounding_ent = null; + Math3D.VectorClear(origin); + Math3D.VectorClear(angles); + Math3D.VectorClear(old_origin); + modelindex = 0; + modelindex2 = modelindex3 = modelindex4 = 0; + frame = 0; + skinnum = 0; + effects = 0; + renderfx = 0; + solid = 0; + sound = 0; + event = 0; + } } \ No newline at end of file |
From: Rene S. <sa...@us...> - 2005-01-30 19:47:45
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2095/src/jake2/render/fastjogl Modified Files: Tag: RST Mesh.java Model.java Log Message: merged from head Index: Model.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Model.java,v retrieving revision 1.5.6.1 retrieving revision 1.5.6.2 diff -C2 -d -r1.5.6.1 -r1.5.6.2 *** Model.java 16 Jan 2005 21:21:04 -0000 1.5.6.1 --- Model.java 30 Jan 2005 19:47:32 -0000 1.5.6.2 *************** *** 1238,1241 **** --- 1238,1242 ---- model.vertexIndexBuf.position(pos); model.indexElements[i] = model.vertexIndexBuf.slice(); + model.indexElements[i].limit(count); pos += count; } Index: Mesh.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Mesh.java,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.2 diff -C2 -d -r1.6.6.1 -r1.6.6.2 *** Mesh.java 16 Jan 2005 21:21:04 -0000 1.6.6.1 --- Mesh.java 30 Jan 2005 19:47:32 -0000 1.6.6.2 *************** *** 227,231 **** FloatBuffer srcTextureCoords = paliashdr.textureCoordBuf; - int size = 0; int dstIndex = 0; int srcIndex = 0; --- 227,230 ---- *************** *** 245,252 **** count = -count; } ! size = count + pos; ! srcIndex = 2 * pos; ! for (int k = pos; k < size; k++) { ! dstIndex = 2 * srcIndexBuf.get(k - pos); dstTextureCoords.put(dstIndex++, srcTextureCoords .get(srcIndex++)); --- 244,250 ---- count = -count; } ! srcIndex = pos << 1; ! for (int k = 0; k < count; k++) { ! dstIndex = srcIndexBuf.get(k) << 1; dstTextureCoords.put(dstIndex++, srcTextureCoords .get(srcIndex++)); |
From: Rene S. <sa...@us...> - 2005-01-23 21:32:38
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8896/src/jake2/game Modified Files: Tag: RST pmove_t.java usercmd_t.java GameUtil.java gitem_t.java PlayerClient.java PlayerHud.java Cmd.java GameSpawn.java GamePWeapon.java GameAI.java pmove_state_t.java client_persistant_t.java Log Message: added debug messages, fixed cooperative multiplayer bugs. Index: pmove_state_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/pmove_state_t.java,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -C2 -d -r1.2 -r1.2.6.1 *** pmove_state_t.java 20 Aug 2004 21:29:58 -0000 1.2 --- pmove_state_t.java 23 Jan 2005 21:31:47 -0000 1.2.6.1 *************** *** 52,56 **** private static pmove_state_t prototype = new pmove_state_t(); ! public void reset() { this.set(prototype); --- 52,56 ---- private static pmove_state_t prototype = new pmove_state_t(); ! public void clear() { this.set(prototype); Index: PlayerHud.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerHud.java,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** PlayerHud.java 22 Sep 2004 19:22:03 -0000 1.6 --- PlayerHud.java 23 Jan 2005 21:31:46 -0000 1.6.6.1 *************** *** 110,116 **** continue; // strip players of all keys between units ! for (n = 1; n < Defines.MAX_ITEMS; n++) { ! if ((GameAI.itemlist[n].flags & Defines.IT_KEY) != 0) ! client.client.pers.inventory[n] = 0; } } --- 110,118 ---- continue; // strip players of all keys between units ! for (n = 1; n < GameAI.itemlist.length; n++) { ! // null pointer exception fixed. (RST) ! if (GameAI.itemlist[n] != null) ! if ((GameAI.itemlist[n].flags & Defines.IT_KEY) != 0) ! client.client.pers.inventory[n] = 0; } } Index: GameSpawn.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSpawn.java,v retrieving revision 1.9.6.1 retrieving revision 1.9.6.2 diff -C2 -d -r1.9.6.1 -r1.9.6.2 *** GameSpawn.java 16 Jan 2005 21:21:02 -0000 1.9.6.1 --- GameSpawn.java 23 Jan 2005 21:31:46 -0000 1.9.6.2 *************** *** 24,27 **** --- 24,28 ---- import jake2.Defines; + import jake2.Globals; import jake2.game.monsters.*; import jake2.qcommon.Com; *************** *** 471,474 **** --- 472,477 ---- public static void SpawnEntities(String mapname, String entities, String spawnpoint) { + + Com.dprintln("SpawnEntities(), mapname=" + mapname); edict_t ent; int inhibit; *************** *** 509,514 **** Com.ParseHelp ph = new Com.ParseHelp(entities); - //Com.DPrintf("* * * die scheiss edict- nummer stimmen nicht ??? * * * - // \n"); while (true) { // parse the opening brace --- 512,515 ---- *************** *** 525,535 **** ent = GameUtil.G_Spawn(); - Com.DPrintf("===\n"); - - Com.DPrintf("allocated new edict:" + ent.index + "\n"); ED_ParseEdict(ph, ent); ! Com.DPrintf("ent.classname:" + ent.classname + "\n"); ! Com.DPrintf("ent.spawnflags:" + Integer.toHexString(ent.spawnflags) ! + "\n"); // yet another map hack if (0 == Lib.Q_stricmp(GameBase.level.mapname, "command") --- 526,533 ---- ent = GameUtil.G_Spawn(); ED_ParseEdict(ph, ent); ! Com.DPrintf("spawning ent[" + ent.index + "], classname=" + ! ent.classname + ", flags= " + Integer.toHexString(ent.spawnflags)); ! // yet another map hack if (0 == Lib.Q_stricmp(GameBase.level.mapname, "command") *************** *** 543,546 **** --- 541,546 ---- if (GameBase.deathmatch.value != 0) { if ((ent.spawnflags & Defines.SPAWNFLAG_NOT_DEATHMATCH) != 0) { + + Com.DPrintf("->inhibited.\n"); GameUtil.G_FreeEdict(ent); inhibit++; *************** *** 555,560 **** --- 555,563 ---- || ((GameBase.skill.value == 1) && (ent.spawnflags & Defines.SPAWNFLAG_NOT_MEDIUM) != 0) || (((GameBase.skill.value == 2) || (GameBase.skill.value == 3)) && (ent.spawnflags & Defines.SPAWNFLAG_NOT_HARD) != 0)) { + + Com.DPrintf("->inhibited.\n"); GameUtil.G_FreeEdict(ent); inhibit++; + continue; } *************** *** 566,574 **** | Defines.SPAWNFLAG_NOT_COOP | Defines.SPAWNFLAG_NOT_DEATHMATCH); } - ED_CallSpawn(ent); } ! //gi.dprintf("player skill level:" +skill.value + "\n"); ! //gi.dprintf(inhibit + " entities inhibited\n"); i = 1; G_FindTeams(); --- 569,577 ---- | Defines.SPAWNFLAG_NOT_COOP | Defines.SPAWNFLAG_NOT_DEATHMATCH); } ED_CallSpawn(ent); + Com.DPrintf("\n"); } ! Com.DPrintf("player skill level:" + GameBase.skill.value + "\n"); ! Com.DPrintf(inhibit + " entities inhibited.\n"); i = 1; G_FindTeams(); Index: PlayerClient.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerClient.java,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** PlayerClient.java 22 Sep 2004 19:22:06 -0000 1.6 --- PlayerClient.java 23 Jan 2005 21:31:44 -0000 1.6.6.1 *************** *** 521,526 **** while (true) { ! spot = (es = GameBase.G_Find(es, GameBase.findByClass, ! "info_player_coop")).o; if (spot == null) return null; // we didn't have enough... --- 521,533 ---- while (true) { ! es = GameBase.G_Find(es, GameBase.findByClass, ! "info_player_coop"); ! ! // nullpointer exi fixed (RST). ! if (es == null) ! return null; ! ! spot = es.o; ! if (spot == null) return null; // we didn't have enough... *************** *** 793,820 **** // deathmatch wipes most client data every spawn ! if (GameBase.deathmatch.value != 0) { ! String userinfo; ! //char userinfo[MAX_INFO_STRING]; resp.set(client.resp); ! userinfo = client.pers.userinfo; ! ! //memcpy(userinfo, client.pers.userinfo, sizeof(userinfo)); InitClientPersistant(client); userinfo = ClientUserinfoChanged(ent, userinfo); } else if (GameBase.coop.value != 0) { - // int n; - //char userinfo[MAX_INFO_STRING]; - String userinfo; resp.set(client.resp); ! //memcpy(userinfo, client.pers.userinfo, sizeof(userinfo)); ! userinfo = client.pers.userinfo; ! // this is kind of ugly, but it's how we want to handle keys in coop ! // for (n = 0; n < game.num_items; n++) ! // { ! // if (itemlist[n].flags & IT_KEY) ! // resp.coop_respawn.inventory[n] = client.pers.inventory[n]; ! // } resp.coop_respawn.game_helpchanged = client.pers.game_helpchanged; resp.coop_respawn.helpchanged = client.pers.helpchanged; --- 800,817 ---- // deathmatch wipes most client data every spawn ! if (GameBase.deathmatch.value != 0) { resp.set(client.resp); ! String userinfo = client.pers.userinfo; InitClientPersistant(client); + userinfo = ClientUserinfoChanged(ent, userinfo); + } else if (GameBase.coop.value != 0) { resp.set(client.resp); ! ! String userinfo = client.pers.userinfo; ! resp.coop_respawn.game_helpchanged = client.pers.game_helpchanged; resp.coop_respawn.helpchanged = client.pers.helpchanged; *************** *** 824,828 **** client.pers.score = resp.score; } else { - //memset(& resp, 0, sizeof(resp)); resp.clear(); } --- 821,824 ---- *************** *** 830,834 **** // clear everything but the persistant data saved.set(client.pers); - //memset(client, 0, sizeof(* client)); client.clear(); client.pers.set(saved); --- 826,829 ---- *************** *** 867,872 **** // clear playerstate values ! ent.client.ps.clear(); ! //memset(& ent.client.ps, 0, sizeof(client.ps)); client.ps.pmove.origin[0] = (short) (spawn_origin[0] * 8); --- 862,866 ---- // clear playerstate values ! ent.client.ps.clear(); client.ps.pmove.origin[0] = (short) (spawn_origin[0] * 8); *************** *** 1014,1018 **** if (GameBase.game.maxclients > 1) { GameBase.gi.WriteByte(Defines.svc_muzzleflash); - //gi.WriteShort(ent - g_edicts); GameBase.gi.WriteShort(ent.index); GameBase.gi.WriteByte(Defines.MZ_LOGIN); --- 1008,1011 ---- *************** *** 1042,1046 **** // check for malformed or illegal info strings if (!Info.Info_Validate(userinfo)) { - //strcpy(userinfo, "\\name\\badinfo\\skin\\male/grunt"); return "\\name\\badinfo\\skin\\male/grunt"; } --- 1035,1038 ---- *************** *** 1049,1054 **** s = Info.Info_ValueForKey(userinfo, "name"); - //strncpy(ent.client.pers.netname, s, sizeof(ent.client.pers.netname) - - // 1); ent.client.pers.netname = s; --- 1041,1044 ---- *************** *** 1090,1095 **** // save off the userinfo in case we want to check something later - //strncpy(ent.client.pers.userinfo, userinfo, - // sizeof(ent.client.pers.userinfo) - 1); ent.client.pers.userinfo = userinfo; --- 1080,1083 ---- Index: GameUtil.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameUtil.java,v retrieving revision 1.7.6.2 retrieving revision 1.7.6.3 diff -C2 -d -r1.7.6.2 -r1.7.6.3 *** GameUtil.java 16 Jan 2005 21:21:03 -0000 1.7.6.2 --- GameUtil.java 23 Jan 2005 21:31:44 -0000 1.7.6.3 *************** *** 606,610 **** public static void Killed(edict_t targ, edict_t inflictor, edict_t attacker, int damage, float[] point) { ! Com.Printf("Killing a " + targ.classname + "\n"); if (targ.health < -999) targ.health = -999; --- 606,610 ---- public static void Killed(edict_t targ, edict_t inflictor, edict_t attacker, int damage, float[] point) { ! Com.DPrintf("Killing a " + targ.classname + "\n"); if (targ.health < -999) targ.health = -999; Index: gitem_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/gitem_t.java,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** gitem_t.java 22 Sep 2004 19:22:04 -0000 1.4 --- gitem_t.java 23 Jan 2005 21:31:44 -0000 1.4.6.1 *************** *** 108,127 **** // use - public static void main(String args[]) { - gitem_t xxx = new gitem_t(123); - gitem_t i2 = new gitem_t("item_armor_combat", GameAI.Pickup_Armor, - null, null, null, "misc/ar1_pkup.wav", - "models/items/armor/combat/tris.md2", Defines.EF_ROTATE, null, - /* icon */ - "i_combatarmor", - /* pickup */ - "Combat Armor", - /* width */ - 3, 0, null, Defines.IT_ARMOR, 0, GameAI.combatarmor_info, - Defines.ARMOR_COMBAT, - /* precache */ - ""); - } - public int index; } \ No newline at end of file --- 108,111 ---- Index: GamePWeapon.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GamePWeapon.java,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.2 diff -C2 -d -r1.6.6.1 -r1.6.6.2 *** GamePWeapon.java 16 Jan 2005 21:21:02 -0000 1.6.6.1 --- GamePWeapon.java 23 Jan 2005 21:31:46 -0000 1.6.6.2 *************** *** 26,29 **** --- 26,30 ---- import jake2.Globals; import jake2.game.monsters.M_Player; + import jake2.qcommon.Com; import jake2.util.Lib; import jake2.util.Math3D; *************** *** 231,235 **** radius_damage); ! GameUtil.T_Damage(ent, ent, ent.owner, ent.velocity, ent.s.origin, ent.s.origin, 25, 0, 0, 0); // send muzzle flash --- 232,237 ---- radius_damage); ! //MOD: sabotage rocket! ! //GameUtil.T_Damage(ent, ent, ent.owner, ent.velocity, ent.s.origin, ent.s.origin, 25, 0, 0, 0); // send muzzle flash *************** *** 759,762 **** --- 761,765 ---- if (item.ammo != null && 0 == GameBase.g_select_empty.value && 0 == (item.flags & Defines.IT_AMMO)) { + ammo_item = GameUtil.FindItem(item.ammo); ammo_index = GameUtil.ITEM_INDEX(ammo_item); *************** *** 1076,1079 **** --- 1079,1083 ---- if (ent.client.pers.weapon != null && ent.client.pers.weapon.ammo != null) + ent.client.ammo_index = GameUtil.ITEM_INDEX(GameUtil .FindItem(ent.client.pers.weapon.ammo)); *************** *** 1091,1094 **** --- 1095,1101 ---- .modelindex(ent.client.pers.weapon.view_model); + Com.dprintln("ChangeWeapon: gunindex=" + ent.client.ps.gunindex); + Com.dprintln("ChangeWeapon: viewmodel=" + ent.client.pers.weapon.view_model); + ent.client.anim_priority = Defines.ANIM_PAIN; if ((ent.client.ps.pmove.pm_flags & pmove_t.PMF_DUCKED) != 0) { *************** *** 1210,1214 **** ent.s.frame = M_Player.FRAME_pain304 + 1; ent.client.anim_end = M_Player.FRAME_pain301; - } } --- 1217,1220 ---- Index: pmove_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/pmove_t.java,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -C2 -d -r1.2 -r1.2.6.1 *** pmove_t.java 22 Sep 2004 19:22:04 -0000 1.2 --- pmove_t.java 23 Jan 2005 21:31:44 -0000 1.2.6.1 *************** *** 23,28 **** package jake2.game; ! import jake2.*; ! import jake2.server.SV_WORLD; public class pmove_t { --- 23,30 ---- package jake2.game; ! import jake2.Defines; ! import jake2.util.Math3D; ! ! import java.util.Arrays; public class pmove_t { *************** *** 91,108 **** public void clear() { - groundentity = null; waterlevel = watertype = 0; trace = null; pointcontents = null; ! mins = new float[3]; ! maxs = new float[3]; viewheight = 0; ! viewangles = new float[3]; ! touchents = new edict_t[Defines.MAXTOUCH]; numtouch = 0; snapinitial = false; ! cmd = new usercmd_t(); ! s = new pmove_state_t(); } } \ No newline at end of file --- 93,109 ---- public void clear() { groundentity = null; waterlevel = watertype = 0; trace = null; pointcontents = null; ! Math3D.VectorClear(mins); ! Math3D.VectorClear(maxs); viewheight = 0; ! Math3D.VectorClear(viewangles); ! Arrays.fill(touchents, null); numtouch = 0; snapinitial = false; ! cmd.clear(); ! s.clear(); } } \ No newline at end of file Index: usercmd_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/usercmd_t.java,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** usercmd_t.java 12 Sep 2004 18:25:49 -0000 1.3 --- usercmd_t.java 23 Jan 2005 21:31:44 -0000 1.3.6.1 *************** *** 27,30 **** --- 27,31 ---- import jake2.util.Lib; + import jake2.util.Math3D; public class usercmd_t implements Cloneable { *************** *** 36,42 **** public byte lightlevel; // light level the player is standing on ! public void reset() { forwardmove= sidemove= upmove= msec= buttons= impulse= lightlevel= 0; ! Arrays.fill(angles, (short) 0); } --- 37,43 ---- public byte lightlevel; // light level the player is standing on ! public void clear() { forwardmove= sidemove= upmove= msec= buttons= impulse= lightlevel= 0; ! angles[0] = angles[1] = angles[2] = 0; } Index: client_persistant_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/client_persistant_t.java,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** client_persistant_t.java 10 Sep 2004 19:02:55 -0000 1.6 --- client_persistant_t.java 23 Jan 2005 21:31:47 -0000 1.6.6.1 *************** *** 77,86 **** // ammo capacities ! int max_bullets; ! int max_shells; ! int max_rockets; ! int max_grenades; ! int max_cells; ! int max_slugs; //pointer gitem_t weapon; --- 77,86 ---- // ammo capacities ! public int max_bullets; ! public int max_shells; ! public int max_rockets; ! public int max_grenades; ! public int max_cells; ! public int max_slugs; //pointer gitem_t weapon; Index: Cmd.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Cmd.java,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -C2 -d -r1.8.2.1 -r1.8.2.2 *** Cmd.java 16 Jan 2005 21:21:00 -0000 1.8.2.1 --- Cmd.java 23 Jan 2005 21:31:46 -0000 1.8.2.2 *************** *** 267,270 **** --- 267,271 ---- while (true) { + cmd_argv[cmd_argc] = null; // skip whitespace up to a /n char c = ph.skipwhitestoeol(); *************** *** 381,386 **** * ============ Cmd_ExecuteString * ! * A complete command line has been parsed, so try to execute it FIXME: ! * lookupnoadd the token to speed search? ============ */ public static void ExecuteString(String text) { --- 382,387 ---- * ============ Cmd_ExecuteString * ! * A complete command line has been parsed, so try to execute it ! * FIXME: lookupnoadd the token to speed search? */ public static void ExecuteString(String text) { *************** *** 391,401 **** TokenizeString(text.toCharArray(), true); ! // if (Argc() > 0) { ! // Com.DPrintf("tokenized:"); ! // for (int xxx = 0; xxx < Argc(); xxx++) ! // Com.DPrintf("[" + Argv(xxx) + "]"); ! // ! // Com.DPrintf("\n"); ! // } // execute the command line if (Argc() == 0) --- 392,401 ---- TokenizeString(text.toCharArray(), true); ! // if (Argc() > 0) { ! // Com.DPrintf("tokenized:"); ! // for (int xxx = 0; xxx < Argc(); xxx++) ! // Com.dprintln("<" + Argv(xxx) + ">"); ! // } ! // execute the command line if (Argc() == 0) *************** *** 661,665 **** --- 661,667 ---- s = Cmd.Args(); + it = GameUtil.FindItem(s); + Com.dprintln("using:" + s); if (it == null) { SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "unknown item: " + s *************** *** 668,673 **** } if (it.use == null) { ! SV_GAME ! .PF_cprintf(ent, Defines.PRINT_HIGH, "Item is not usable.\n"); return; --- 670,674 ---- } if (it.use == null) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "Item is not usable.\n"); return; Index: GameAI.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameAI.java,v retrieving revision 1.5.6.1 retrieving revision 1.5.6.2 diff -C2 -d -r1.5.6.1 -r1.5.6.2 *** GameAI.java 16 Jan 2005 21:21:03 -0000 1.5.6.1 --- GameAI.java 23 Jan 2005 21:31:46 -0000 1.5.6.2 *************** *** 1359,1363 **** boolean ff; ! if (GameBase.coop.value != 0 && attacker.client != null) GameBase.meansOfDeath |= Defines.MOD_FRIENDLY_FIRE; --- 1359,1364 ---- boolean ff; ! // attacker can be null by some mods! bug fix by rene stoeckel ! if (GameBase.coop.value != 0 && attacker != null && attacker.client != null) GameBase.meansOfDeath |= Defines.MOD_FRIENDLY_FIRE; |
From: Rene S. <sa...@us...> - 2005-01-23 21:32:38
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8896/src/jake2/render/lwjgl Modified Files: Tag: RST Light.java Warp.java Main.java Mesh.java Surf.java Log Message: added debug messages, fixed cooperative multiplayer bugs. Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Light.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Light.java 14 Dec 2004 12:56:59 -0000 1.2 --- Light.java 23 Jan 2005 21:31:47 -0000 1.2.2.1 *************** *** 37,40 **** --- 37,41 ---- import jake2.render.mtexinfo_t; import jake2.util.Math3D; + import jake2.util.Vec3Cache; import java.nio.ByteBuffer; *************** *** 64,75 **** */ [...1014 lines suppressed...] ! float af = a / 255.0f; ! r *= af; ! g *= af; ! b *= af; ! break; ! case 'A': ! default: ! r = g = b = 0; ! a = 255 - a; ! break; ! } ! //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; ! dest.put(destp++, (a << 24) | (b << 16) | (g << 8) | r); ! } ! } ! } ! } ! ! } \ No newline at end of file Index: Warp.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Warp.java,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** Warp.java 16 Jan 2005 21:21:08 -0000 1.2.2.1 --- Warp.java 23 Jan 2005 21:31:48 -0000 1.2.2.2 *************** *** 31,34 **** --- 31,35 ---- import jake2.render.*; import jake2.util.Math3D; + import jake2.util.Vec3Cache; import org.lwjgl.opengl.GL11; *************** *** 40,45 **** */ public abstract class Warp extends Model { - - // warpsin.h public static final float[] SIN = { --- 41,44 ---- *************** *** 78,84 **** }; - // gl_warp.c -- sky and water polygons - //extern model_t *loadmodel; // Model.java - String skyname; float skyrotate; --- 77,80 ---- *************** *** 90,105 **** static final int SUBDIVIDE_SIZE = 64; ! void BoundPoly(int numverts, float[][] verts, float[] mins, float[] maxs) ! { ! int i, j; ! float[] v; ! mins[0] = mins[1] = mins[2] = 9999; maxs[0] = maxs[1] = maxs[2] = -9999; ! for (i=0 ; i<numverts ; i++) ! { v = verts[i]; ! for (j=0 ; j<3 ; j++) ! { if (v[j] < mins[j]) mins[j] = v[j]; --- 86,105 ---- static final int SUBDIVIDE_SIZE = 64; ! /** ! * BoundPoly ! * @param numverts ! * @param verts ! * @param mins ! * @param maxs ! */ ! void BoundPoly(int numverts, float[][] verts, float[] mins, float[] maxs) { mins[0] = mins[1] = mins[2] = 9999; maxs[0] = maxs[1] = maxs[2] = -9999; ! ! int j; ! float[] v; ! for (int i=0 ; i<numverts ; i++) { v = verts[i]; ! for (j=0 ; j<3 ; j++) { if (v[j] < mins[j]) mins[j] = v[j]; *************** *** 110,120 **** } void SubdividePolygon(int numverts, float[][] verts) { int i, j, k; - float[] mins = {0, 0, 0}; - float[] maxs = {0, 0, 0}; float m; - float[] v = {0, 0, 0}; float[][] front = new float[64][3]; float[][] back = new float[64][3]; --- 110,122 ---- } + /** + * SubdividePolygon + * @param numverts + * @param verts + */ void SubdividePolygon(int numverts, float[][] verts) { int i, j, k; float m; float[][] front = new float[64][3]; float[][] back = new float[64][3]; *************** *** 123,135 **** float[] dist = new float[64]; float frac; - float s, t; - float[] total = {0, 0, 0}; - float total_s, total_t; if (numverts > 60) Com.Error(Defines.ERR_DROP, "numverts = " + numverts); ! BoundPoly(numverts, verts, mins, maxs); // x,y und z for (i=0 ; i<3 ; i++) --- 125,137 ---- float[] dist = new float[64]; float frac; if (numverts > 60) Com.Error(Defines.ERR_DROP, "numverts = " + numverts); ! float[] mins = Vec3Cache.get(); ! float[] maxs = Vec3Cache.get(); + BoundPoly(numverts, verts, mins, maxs); + float[] v; // x,y und z for (i=0 ; i<3 ; i++) *************** *** 151,155 **** Math3D.VectorCopy(verts[0], verts[numverts]); ! f = b = 0; for (j=0 ; j<numverts ; j++) --- 153,157 ---- Math3D.VectorCopy(verts[0], verts[numverts]); ! f = b = 0; for (j=0 ; j<numverts ; j++) *************** *** 182,188 **** SubdividePolygon(f, front); SubdividePolygon(b, back); return; } ! // add a point in the center to help keep warp valid --- 184,194 ---- SubdividePolygon(f, front); SubdividePolygon(b, back); + + Vec3Cache.release(2); // mins, maxs return; } ! ! Vec3Cache.release(2); // mins, maxs ! // add a point in the center to help keep warp valid *************** *** 195,202 **** poly.next = warpface.polys; warpface.polys = poly; Math3D.VectorClear(total); ! total_s = 0; ! total_t = 0; ! for (i = 0; i < numverts; i++) { poly.x(i + 1, verts[i][0]); poly.y(i + 1, verts[i][1]); --- 201,211 ---- poly.next = warpface.polys; warpface.polys = poly; + + float[] total = Vec3Cache.get(); Math3D.VectorClear(total); ! float total_s = 0; ! float total_t = 0; ! float s, t; ! for (i = 0; i < numverts; i++) { poly.x(i + 1, verts[i][0]); poly.y(i + 1, verts[i][1]); *************** *** 227,243 **** poly.s2(i + 1, poly.s2(1)); poly.t2(i + 1, poly.t2(1)); } ! /* ! ================ ! GL_SubdivideSurface ! ! Breaks a polygon up along axial 64 unit ! boundaries so that turbulent and sky warps ! can be done reasonably. ! ================ ! */ ! float[][] tmpVerts = new float[64][3]; ! void GL_SubdivideSurface(msurface_t fa) { float[][] verts = tmpVerts; --- 236,250 ---- poly.s2(i + 1, poly.s2(1)); poly.t2(i + 1, poly.t2(1)); + + Vec3Cache.release(); // total } ! private final float[][] tmpVerts = new float[64][3]; ! /** ! * GL_SubdivideSurface ! * Breaks a polygon up along axial 64 unit ! * boundaries so that turbulent and sky warps ! * can be done reasonably. ! */ void GL_SubdivideSurface(msurface_t fa) { float[][] verts = tmpVerts; *************** *** 261,293 **** } ! // ========================================================= ! ! ! ! //// speed up sin calculations - Ed ! // float r_turbsin[] = ! // { ! // #include "warpsin.h" ! // }; static final float TURBSCALE = (float)(256.0f / (2 * Math.PI)); ! /* ! ============= ! EmitWaterPolys ! ! Does a water warp on the pre-fragmented glpoly_t chain ! ============= ! */ void EmitWaterPolys(msurface_t fa) { - glpoly_t p, bp; - float[] v; - int i; - float s = 0; - float t = 0; - float os, ot; - float scroll; float rdt = r_newrefdef.time; if ((fa.texinfo.flags & Defines.SURF_FLOWING) != 0) scroll = -64 * ( (r_newrefdef.time*0.5f) - (int)(r_newrefdef.time*0.5f) ); --- 268,283 ---- } ! // ========================================================= static final float TURBSCALE = (float)(256.0f / (2 * Math.PI)); ! /** ! * EmitWaterPolys ! * Does a water warp on the pre-fragmented glpoly_t chain ! */ void EmitWaterPolys(msurface_t fa) { float rdt = r_newrefdef.time; + float scroll; if ((fa.texinfo.flags & Defines.SURF_FLOWING) != 0) scroll = -64 * ( (r_newrefdef.time*0.5f) - (int)(r_newrefdef.time*0.5f) ); *************** *** 295,298 **** --- 285,291 ---- scroll = 0; + int i; + float s, t, os, ot; + glpoly_t p, bp; for (bp = fa.polys; bp != null; bp = bp.next) { p = bp; *************** *** 321,325 **** // =================================================================== - float[][] skyclip = { { 1, 1, 0}, --- 314,317 ---- *************** *** 364,379 **** float sky_min, sky_max; ! void DrawSkyPolygon (int nump, float[][] vecs) { - int i,j; - float[] v = {0, 0, 0}; - float[] av = {0, 0, 0}; - float s, t, dv; - int axis; - float[] vp; - c_sky++; // decide which face it maps to Math3D.VectorCopy(Globals.vec3_origin, v); for (i=0; i<nump ; i++) { --- 356,373 ---- float sky_min, sky_max; ! // stack variable ! private final float[] v = {0, 0, 0}; ! private final float[] av = {0, 0, 0}; ! /** ! * DrawSkyPolygon ! * @param nump ! * @param vecs ! */ ! void DrawSkyPolygon(int nump, float[][] vecs) { c_sky++; // decide which face it maps to Math3D.VectorCopy(Globals.vec3_origin, v); + int i, axis; for (i=0; i<nump ; i++) { *************** *** 406,409 **** --- 400,405 ---- // project new texture coords + float s, t, dv; + int j; for (i=0 ; i<nump ; i++) { *************** *** 448,460 **** float[][][][] newv = new float[6][2][MAX_CLIP_VERTS][3]; void ClipSkyPolygon(int nump, float[][] vecs, int stage) { - float[] norm; - float[] v; - boolean front, back; - float d, e; - int[] newc = { 0, 0 }; - int i, j; - if (nump > MAX_CLIP_VERTS-2) Com.Error(Defines.ERR_DROP, "ClipSkyPolygon: MAX_CLIP_VERTS"); --- 444,455 ---- float[][][][] newv = new float[6][2][MAX_CLIP_VERTS][3]; + /** + * ClipSkyPolygon + * @param nump + * @param vecs + * @param stage + */ void ClipSkyPolygon(int nump, float[][] vecs, int stage) { if (nump > MAX_CLIP_VERTS-2) Com.Error(Defines.ERR_DROP, "ClipSkyPolygon: MAX_CLIP_VERTS"); *************** *** 465,470 **** } ! front = back = false; ! norm = skyclip[stage]; for (i=0 ; i<nump ; i++) { --- 460,469 ---- } ! boolean front = false; ! boolean back = false; ! float[] norm = skyclip[stage]; ! ! int i; ! float d; for (i=0 ; i<nump ; i++) { *************** *** 495,500 **** dists[i] = dists[0]; Math3D.VectorCopy(vecs[0], vecs[i]); - newc[0] = newc[1] = 0; for (i=0; i<nump ; i++) { --- 494,502 ---- dists[i] = dists[0]; Math3D.VectorCopy(vecs[0], vecs[i]); + int newc0 = 0; int newc1 = 0; + float[] v; + float e; + int j; for (i=0; i<nump ; i++) { *************** *** 503,518 **** { case SIDE_FRONT: ! Math3D.VectorCopy(v, newv[stage][0][newc[0]]); ! newc[0]++; break; case SIDE_BACK: ! Math3D.VectorCopy(v, newv[stage][1][newc[1]]); ! newc[1]++; break; case SIDE_ON: ! Math3D.VectorCopy(v, newv[stage][0][newc[0]]); ! newc[0]++; ! Math3D.VectorCopy (v, newv[stage][1][newc[1]]); ! newc[1]++; break; } --- 505,520 ---- { case SIDE_FRONT: ! Math3D.VectorCopy(v, newv[stage][0][newc0]); ! newc0++; break; case SIDE_BACK: ! Math3D.VectorCopy(v, newv[stage][1][newc1]); ! newc1++; break; case SIDE_ON: ! Math3D.VectorCopy(v, newv[stage][0][newc0]); ! newc0++; ! Math3D.VectorCopy (v, newv[stage][1][newc1]); ! newc1++; break; } *************** *** 525,547 **** { e = v[j] + d * (vecs[i + 1][j] - v[j]); ! newv[stage][0][newc[0]][j] = e; ! newv[stage][1][newc[1]][j] = e; } ! newc[0]++; ! newc[1]++; } // continue ! ClipSkyPolygon(newc[0], newv[stage][0], stage+1); ! ClipSkyPolygon(newc[1], newv[stage][1], stage+1); } float[][] verts = new float[MAX_CLIP_VERTS][3]; ! /* ! ================= ! R_AddSkySurface ! ================= ! */ void R_AddSkySurface(msurface_t fa) { --- 527,547 ---- { e = v[j] + d * (vecs[i + 1][j] - v[j]); ! newv[stage][0][newc0][j] = e; ! newv[stage][1][newc1][j] = e; } ! newc0++; ! newc1++; } // continue ! ClipSkyPolygon(newc0, newv[stage][0], stage+1); ! ClipSkyPolygon(newc1, newv[stage][1], stage+1); } float[][] verts = new float[MAX_CLIP_VERTS][3]; ! /** ! * R_AddSkySurface ! */ void R_AddSkySurface(msurface_t fa) { *************** *** 557,593 **** } ! ! /* ! ============== ! R_ClearSkyBox ! ============== ! */ void R_ClearSkyBox() { for (int i=0 ; i<6 ; i++) { ! skymins[0][i] = skymins[1][i] = 9999; ! skymaxs[0][i] = skymaxs[1][i] = -9999; } } ! ! ! void MakeSkyVec (float s, float t, int axis) { - float[] v = {0, 0, 0}; - float[] b = {0, 0, 0}; - int j, k; - b[0] = s*2300; b[1] = t*2300; b[2] = 2300; for (j=0 ; j<3 ; j++) { k = st_to_vec[axis][j]; if (k < 0) ! v[j] = -b[-k - 1]; else ! v[j] = b[k - 1]; } --- 557,600 ---- } ! /** ! * R_ClearSkyBox ! */ void R_ClearSkyBox() { + float[] skymins0 = skymins[0]; + float[] skymins1 = skymins[1]; + float[] skymaxs0 = skymaxs[0]; + float[] skymaxs1 = skymaxs[1]; + for (int i=0 ; i<6 ; i++) { ! skymins0[i] = skymins1[i] = 9999; ! skymaxs0[i] = skymaxs1[i] = -9999; } } ! ! // stack variable ! private final float[] v1 = {0, 0, 0}; ! private final float[] b = {0, 0, 0}; ! /** ! * MakeSkyVec ! * @param s ! * @param t ! * @param axis ! */ ! void MakeSkyVec(float s, float t, int axis) { b[0] = s*2300; b[1] = t*2300; b[2] = 2300; + int j, k; for (j=0 ; j<3 ; j++) { k = st_to_vec[axis][j]; if (k < 0) ! v1[j] = -b[-k - 1]; else ! v1[j] = b[k - 1]; } *************** *** 607,620 **** t = 1.0f - t; gl.glTexCoord2f (s, t); ! gl.glVertex3f(v[0], v[1], v[2]); } - /* - ============== - R_DrawSkyBox - ============== - */ int[] skytexorder = {0,2,1,3,4,5}; void R_DrawSkyBox() { --- 614,625 ---- t = 1.0f - t; gl.glTexCoord2f (s, t); ! gl.glVertex3f(v1[0], v1[1], v1[2]); } int[] skytexorder = {0,2,1,3,4,5}; + /** + * R_DrawSkyBox + */ void R_DrawSkyBox() { *************** *** 661,680 **** } - - /* - ============ - R_SetSky - ============ - */ // 3dstudio environment map names String[] suf = {"rt", "bk", "lf", "ft", "up", "dn"}; protected void R_SetSky(String name, float rotate, float[] axis) { assert (axis.length == 3) : "vec3_t bug"; - int i; String pathname; - - // strncpy (skyname, name, sizeof(skyname)-1); skyname = name; --- 666,682 ---- } // 3dstudio environment map names String[] suf = {"rt", "bk", "lf", "ft", "up", "dn"}; + /** + * R_SetSky + * @param name + * @param rotate + * @param axis + */ protected void R_SetSky(String name, float rotate, float[] axis) { assert (axis.length == 3) : "vec3_t bug"; String pathname; skyname = name; *************** *** 682,686 **** Math3D.VectorCopy(axis, skyaxis); ! for (i=0 ; i<6 ; i++) { // chop down rotating skies for less memory --- 684,688 ---- Math3D.VectorCopy(axis, skyaxis); ! for (int i=0 ; i<6 ; i++) { // chop down rotating skies for less memory *************** *** 714,716 **** } } ! } --- 716,718 ---- } } ! } \ No newline at end of file Index: Mesh.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Mesh.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Mesh.java 14 Dec 2004 12:56:59 -0000 1.2 --- Mesh.java 23 Jan 2005 21:31:49 -0000 1.2.2.1 *************** *** 47,51 **** // g_mesh.c: triangle model functions - /* ============================================================= --- 47,50 ---- *************** *** 69,72 **** --- 68,80 ---- float[] shadedots = r_avertexnormal_dots[0]; + /** + * GL_LerpVerts + * @param nverts + * @param ov + * @param verts + * @param move + * @param frontv + * @param backv + */ void GL_LerpVerts(int nverts, qfiles.dtrivertx_t[] ov, qfiles.dtrivertx_t[] verts, float[] move, float[] frontv, float[] backv ) { *************** *** 115,136 **** }; ! /* ! ============= ! GL_DrawAliasFrameLerp ! ! interpolates between two frames and origins ! FIXME: batch lerp all vertexes ! ============= ! */ ! void GL_DrawAliasFrameLerp(qfiles.dmdl_t paliashdr, float backlerp) { - int count; - float alpha; - - float[] move = {0, 0, 0}; // vec3_t - float[] frontv = {0, 0, 0}; // vec3_t - float[] backv = {0, 0, 0}; // vec3_t - qfiles.daliasframe_t frame = paliashdr.aliasFrames[currententity.frame]; --- 123,138 ---- }; ! // stack variable ! private final float[] move = {0, 0, 0}; // vec3_t ! private final float[] frontv = {0, 0, 0}; // vec3_t ! private final float[] backv = {0, 0, 0}; // vec3_t ! /** ! * GL_DrawAliasFrameLerp ! * ! * interpolates between two frames and origins ! * FIXME: batch lerp all vertexes ! */ void GL_DrawAliasFrameLerp(qfiles.dmdl_t paliashdr, float backlerp) { qfiles.daliasframe_t frame = paliashdr.aliasFrames[currententity.frame]; *************** *** 141,144 **** --- 143,147 ---- qfiles.dtrivertx_t[] ov = oldframe.verts; + float alpha; if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) alpha = currententity.alpha; *************** *** 217,221 **** int dstIndex = 0; int srcIndex = 0; ! for (int j = 0; j < counts.length; j++) { --- 220,224 ---- int dstIndex = 0; int srcIndex = 0; ! int count; for (int j = 0; j < counts.length; j++) { *************** *** 253,284 **** gl.glDisableClientState( GL11.GL_COLOR_ARRAY ); - } ! /* ! ============= ! GL_DrawAliasShadow ! ============= ! */ void GL_DrawAliasShadow(qfiles.dmdl_t paliashdr, int posenum) { ! qfiles.dtrivertx_t[] verts; ! int[] order; ! float[] point = {0, 0, 0}; ! float height, lheight; ! int count; ! qfiles.daliasframe_t frame; ! ! lheight = currententity.origin[2] - lightspot[2]; ! ! frame = paliashdr.aliasFrames[currententity.frame]; ! ! verts = frame.verts; ! ! height = 0; ! ! order = paliashdr.glCmds; ! ! height = -lheight + 1.0f; int orderIndex = 0; --- 256,272 ---- gl.glDisableClientState( GL11.GL_COLOR_ARRAY ); } ! private final float[] point = {0, 0, 0}; ! /** ! * GL_DrawAliasShadow ! */ void GL_DrawAliasShadow(qfiles.dmdl_t paliashdr, int posenum) { ! float lheight = currententity.origin[2] - lightspot[2]; ! qfiles.daliasframe_t frame = paliashdr.aliasFrames[currententity.frame]; ! qfiles.dtrivertx_t[] verts = frame.verts; ! int[] order = paliashdr.glCmds; ! float height = -lheight + 1.0f; int orderIndex = 0; *************** *** 287,290 **** --- 275,279 ---- // TODO shadow drawing with vertex arrays + int count; while (true) { *************** *** 321,333 **** } - - /* - ** R_CullAliasModel - */ // TODO sync with jogl renderer. hoz boolean R_CullAliasModel(entity_t e) { - float[] mins = { 0, 0, 0 }; - float[] maxs = { 0, 0, 0 }; - qfiles.dmdl_t paliashdr = (qfiles.dmdl_t) currentmodel.extradata; --- 310,321 ---- } // TODO sync with jogl renderer. hoz + // stack variable + private final float[] mins = { 0, 0, 0 }; + private final float[] maxs = { 0, 0, 0 }; + /** + * R_CullAliasModel + */ boolean R_CullAliasModel(entity_t e) { qfiles.dmdl_t paliashdr = (qfiles.dmdl_t) currentmodel.extradata; *************** *** 442,460 **** }; - /* - ================= - R_DrawAliasModel - - ================= - */ // TODO sync with jogl renderer. hoz void R_DrawAliasModel(entity_t e) { - int i; - //qfiles.dmdl_t paliashdr; - //float an; - - image_t skin; - if ( ( e.flags & Defines.RF_WEAPONMODEL ) == 0) { --- 430,439 ---- }; // TODO sync with jogl renderer. hoz + /** + * R_DrawAliasModel + */ void R_DrawAliasModel(entity_t e) { if ( ( e.flags & Defines.RF_WEAPONMODEL ) == 0) { *************** *** 477,480 **** --- 456,460 ---- // PMM - 3.20 code .. replaced with original way of doing it to keep mod authors happy // + int i; if ( (currententity.flags & ( Defines.RF_SHELL_HALF_DAM | Defines.RF_SHELL_GREEN | Defines.RF_SHELL_RED | Defines.RF_SHELL_BLUE | Defines.RF_SHELL_DOUBLE )) != 0 ) { *************** *** 621,624 **** --- 601,607 ---- e.angles[PITCH] = -e.angles[PITCH]; // sigh. + + + image_t skin; // select skin if (currententity.skin != null) *************** *** 706,709 **** gl.glColor4f (1,1,1,1); } ! ! } --- 689,691 ---- gl.glColor4f (1,1,1,1); } ! } \ No newline at end of file Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Surf.java,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** Surf.java 16 Jan 2005 21:21:08 -0000 1.4.2.1 --- Surf.java 23 Jan 2005 21:31:49 -0000 1.4.2.2 *************** *** 115,133 **** */ ! /* ! =============== ! R_TextureAnimation ! ! Returns the proper texture for a given time and base texture ! =============== ! */ image_t R_TextureAnimation(mtexinfo_t tex) { - int c; - if (tex.next == null) return tex.image; ! c = currententity.frame % tex.numframes; while (c != 0) { --- 115,128 ---- */ ! /** ! * R_TextureAnimation ! * Returns the proper texture for a given time and base texture ! */ image_t R_TextureAnimation(mtexinfo_t tex) { if (tex.next == null) return tex.image; ! int c = currententity.frame % tex.numframes; while (c != 0) { *************** *** 139,147 **** } ! /* ! ================ ! DrawGLPoly ! ================ ! */ void DrawGLPoly(glpoly_t p) { --- 134,140 ---- } ! /** ! * DrawGLPoly ! */ void DrawGLPoly(glpoly_t p) { *************** *** 149,165 **** } ! // ============ ! // PGM ! /* ! ================ ! DrawGLFlowingPoly -- version of DrawGLPoly that handles scrolling texture ! ================ ! */ void DrawGLFlowingPoly(glpoly_t p) { ! int i; ! float scroll; ! ! scroll = -64 * ( (r_newrefdef.time / 40.0f) - (int)(r_newrefdef.time / 40.0f) ); if(scroll == 0.0f) scroll = -64.0f; --- 142,152 ---- } ! /** ! * DrawGLFlowingPoly ! * version that handles scrolling texture ! */ void DrawGLFlowingPoly(glpoly_t p) { ! float scroll = -64 * ( (r_newrefdef.time / 40.0f) - (int)(r_newrefdef.time / 40.0f) ); if(scroll == 0.0f) scroll = -64.0f; *************** *** 168,176 **** p.endScrolling(); } - // PGM - // ============ ! /* ! ** R_DrawTriangleOutlines */ void R_DrawTriangleOutlines() --- 155,161 ---- p.endScrolling(); } ! /** ! * R_DrawTriangleOutlines */ void R_DrawTriangleOutlines() *************** *** 183,190 **** gl.glColor4f(1, 1, 1, 1); for (int i = 0; i < MAX_LIGHTMAPS; i++) { ! for (msurface_t surf = gl_lms.lightmap_surfaces[i]; surf != null; surf = surf.lightmapchain) { ! for (glpoly_t p = surf.polys; p != null; p = p.chain) { ! for (int j = 2; j < p.numverts; j++) { gl.glBegin(GL11.GL_LINE_STRIP); gl.glVertex3f(p.x(0), p.y(0), p.z(0)); --- 168,178 ---- gl.glColor4f(1, 1, 1, 1); + msurface_t surf; + glpoly_t p; + int j; for (int i = 0; i < MAX_LIGHTMAPS; i++) { ! for (surf = gl_lms.lightmap_surfaces[i]; surf != null; surf = surf.lightmapchain) { ! for (p = surf.polys; p != null; p = p.chain) { ! for (j = 2; j < p.numverts; j++) { gl.glBegin(GL11.GL_LINE_STRIP); gl.glVertex3f(p.x(0), p.y(0), p.z(0)); *************** *** 202,221 **** } ! private IntBuffer temp2 = Lib.newIntBuffer(34 * 34, ByteOrder.LITTLE_ENDIAN); ! /* ! ================ ! R_RenderBrushPoly ! ================ ! */ void R_RenderBrushPoly(msurface_t fa) { - int maps; - image_t image; - boolean is_dynamic = false; - c_brush_polys++; ! image = R_TextureAnimation(fa.texinfo); if ((fa.flags & Defines.SURF_DRAWTURB) != 0) --- 190,203 ---- } ! private final IntBuffer temp2 = Lib.newIntBuffer(34 * 34, ByteOrder.LITTLE_ENDIAN); ! /** ! * R_RenderBrushPoly ! */ void R_RenderBrushPoly(msurface_t fa) { c_brush_polys++; ! image_t image = R_TextureAnimation(fa.texinfo); if ((fa.flags & Defines.SURF_DRAWTURB) != 0) *************** *** 254,257 **** --- 236,240 ---- ** check for lightmap modification */ + int maps; for ( maps = 0; maps < Defines.MAXLIGHTMAPS && fa.styles[maps] != (byte)255; maps++ ) { *************** *** 266,269 **** --- 249,253 ---- // dynamic this frame or dynamic previously + boolean is_dynamic = false; if ( gotoDynamic || ( fa.dlightframe == r_framecount ) ) { *************** *** 316,333 **** ! /* ! ================ ! R_DrawAlphaSurfaces ! ! Draw water surfaces and windows. ! The BSP tree is waled front to back, so unwinding the chain ! of alpha_surfaces will draw back to front, giving proper ordering. ! ================ ! */ void R_DrawAlphaSurfaces() { - msurface_t s; - float intens; - r_world_matrix.clear(); // --- 300,311 ---- ! /** ! * R_DrawAlphaSurfaces ! * Draw water surfaces and windows. ! * The BSP tree is waled front to back, so unwinding the chain ! * of alpha_surfaces will draw back to front, giving proper ordering. ! */ void R_DrawAlphaSurfaces() { r_world_matrix.clear(); // *************** *** 342,350 **** // the textures are prescaled up for a better lighting range, // so scale it back down ! intens = gl_state.inverse_intensity; gl.glInterleavedArrays(GL11.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); ! for (s=r_alpha_surfaces ; s != null ; s=s.texturechain) { GL_Bind(s.texinfo.image.texnum); --- 320,328 ---- // the textures are prescaled up for a better lighting range, // so scale it back down ! float intens = gl_state.inverse_intensity; gl.glInterleavedArrays(GL11.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); ! for (msurface_t s = r_alpha_surfaces ; s != null ; s=s.texturechain) { GL_Bind(s.texinfo.image.texnum); *************** *** 371,387 **** } ! /* ! ================ ! DrawTextureChains ! ================ ! */ void DrawTextureChains() { - int i; - msurface_t s; - image_t image; - c_visible_textures = 0; for (i = 0; i < numgltextures ; i++) { --- 349,362 ---- } ! /** ! * DrawTextureChains ! */ void DrawTextureChains() { c_visible_textures = 0; + msurface_t s; + image_t image; + int i; for (i = 0; i < numgltextures ; i++) { *************** *** 425,445 **** // direct buffer ! private IntBuffer temp = Lib.newIntBuffer(128 * 128, ByteOrder.LITTLE_ENDIAN); ! void GL_RenderLightmappedPoly( msurface_t surf ) { - int i, nv = surf.polys.numverts; - int map = 0; - int index; - float[][] v; - FloatBuffer texCoord = globalPolygonInterleavedBuf; - image_t image = R_TextureAnimation( surf.texinfo ); - boolean is_dynamic = false; - int lmtex = surf.lightmaptexturenum; - glpoly_t p; // ersetzt goto boolean gotoDynamic = false; ! for ( map = 0; map < Defines.MAXLIGHTMAPS && (surf.styles[map] != (byte)255); map++ ) { --- 400,415 ---- // direct buffer ! private final IntBuffer temp = Lib.newIntBuffer(128 * 128, ByteOrder.LITTLE_ENDIAN); ! ! /** ! * GL_RenderLightmappedPoly ! * @param surf ! */ void GL_RenderLightmappedPoly( msurface_t surf ) { // ersetzt goto boolean gotoDynamic = false; ! int map; for ( map = 0; map < Defines.MAXLIGHTMAPS && (surf.styles[map] != (byte)255); map++ ) { *************** *** 454,457 **** --- 424,428 ---- // dynamic this frame or dynamic previously + boolean is_dynamic = false; if ( gotoDynamic || ( surf.dlightframe == r_framecount ) ) { *************** *** 466,469 **** --- 437,445 ---- } + glpoly_t p; + FloatBuffer texCoord = globalPolygonInterleavedBuf; + image_t image = R_TextureAnimation( surf.texinfo ); + int lmtex = surf.lightmaptexturenum; + if ( is_dynamic ) { *************** *** 582,602 **** } ! /* ! ================= ! R_DrawInlineBModel ! ================= ! */ void R_DrawInlineBModel() { - int i, k; - cplane_t pplane; - float dot; - msurface_t psurf; - dlight_t lt; - // calculate dynamic lighting for bmodel if ( gl_flashblend.value == 0 ) { ! for (k=0 ; k<r_newrefdef.num_dlights ; k++) { lt = r_newrefdef.dlights[k]; --- 558,571 ---- } ! /** ! * R_DrawInlineBModel ! */ void R_DrawInlineBModel() { // calculate dynamic lighting for bmodel if ( gl_flashblend.value == 0 ) { ! dlight_t lt; ! for (int k=0 ; k<r_newrefdef.num_dlights ; k++) { lt = r_newrefdef.dlights[k]; *************** *** 607,612 **** // psurf = ¤tmodel->surfaces[currentmodel->firstmodelsurface]; int psurfp = currentmodel.firstmodelsurface; ! msurface_t[] surfaces; ! surfaces = currentmodel.surfaces; //psurf = surfaces[psurfp]; --- 576,580 ---- // psurf = ¤tmodel->surfaces[currentmodel->firstmodelsurface]; int psurfp = currentmodel.firstmodelsurface; ! msurface_t[] surfaces = currentmodel.surfaces; //psurf = surfaces[psurfp]; *************** *** 621,625 **** // draw texture // ! for (i=0 ; i<currentmodel.nummodelsurfaces ; i++) { psurf = surfaces[psurfp++]; --- 589,596 ---- // draw texture // ! msurface_t psurf; ! cplane_t pplane; ! float dot; ! for (int i=0 ; i<currentmodel.nummodelsurfaces ; i++) { psurf = surfaces[psurfp++]; *************** *** 658,673 **** } ! /* ! ================= ! R_DrawBrushModel ! ================= ! */ void R_DrawBrushModel(entity_t e) { - float[] mins = {0, 0, 0}; - float[] maxs = {0, 0, 0}; - int i; - boolean rotated; - if (currentmodel.nummodelsurfaces == 0) return; --- 629,644 ---- } ! // stack variable ! private final float[] mins = {0, 0, 0}; ! private final float[] maxs = {0, 0, 0}; ! private final float[] org = {0, 0, 0}; ! private final float[] forward = {0, 0, 0}; ! private final float[] right = {0, 0, 0}; ! private final float[] up = {0, 0, 0}; ! /** ! * R_DrawBrushModel ! */ void R_DrawBrushModel(entity_t e) { if (currentmodel.nummodelsurfaces == 0) return; *************** *** 676,683 **** gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; if (e.angles[0] != 0 || e.angles[1] != 0 || e.angles[2] != 0) { rotated = true; ! for (i=0 ; i<3 ; i++) { mins[i] = e.origin[i] - currentmodel.radius; --- 647,655 ---- gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; + boolean rotated; if (e.angles[0] != 0 || e.angles[1] != 0 || e.angles[2] != 0) { rotated = true; ! for (int i=0 ; i<3 ; i++) { mins[i] = e.origin[i] - currentmodel.radius; *************** *** 704,717 **** if (rotated) { ! float[] temp = {0, 0, 0}; ! float[] forward = {0, 0, 0}; ! float[] right = {0, 0, 0}; ! float[] up = {0, 0, 0}; ! ! Math3D.VectorCopy (modelorg, temp); Math3D.AngleVectors (e.angles, forward, right, up); ! modelorg[0] = Math3D.DotProduct (temp, forward); ! modelorg[1] = -Math3D.DotProduct (temp, right); ! modelorg[2] = Math3D.DotProduct (temp, up); } --- 676,684 ---- if (rotated) { ! Math3D.VectorCopy (modelorg, org); Math3D.AngleVectors (e.angles, forward, right, up); ! modelorg[0] = Math3D.DotProduct (org, forward); ! modelorg[1] = -Math3D.DotProduct (org, right); ! modelorg[2] = Math3D.DotProduct (org, up); } *************** *** 751,769 **** */ ! /* ! ================ ! R_RecursiveWorldNode ! ================ ! */ void R_RecursiveWorldNode (mnode_t node) { - int c, side, sidebit; - cplane_t plane; - msurface_t surf; - msurface_t mark; - mleaf_t pleaf; - float dot = 0; - image_t image; - if (node.contents == Defines.CONTENTS_SOLID) return; // solid --- 718,726 ---- */ ! /** ! * R_RecursiveWorldNode ! */ void R_RecursiveWorldNode (mnode_t node) { if (node.contents == Defines.CONTENTS_SOLID) return; // solid *************** *** 775,782 **** return; // if a leaf node, draw stuff if (node.contents != -1) { ! pleaf = (mleaf_t)node; // check for door connected areas --- 732,741 ---- return; + int c; + msurface_t mark; // if a leaf node, draw stuff if (node.contents != -1) { ! mleaf_t pleaf = (mleaf_t)node; // check for door connected areas *************** *** 807,812 **** // find which side of the node we are on ! plane = node.plane; ! switch (plane.type) { --- 766,771 ---- // find which side of the node we are on ! cplane_t plane = node.plane; ! float dot; switch (plane.type) { *************** *** 825,828 **** --- 784,788 ---- } + int side, sidebit; if (dot >= 0.0f) { *************** *** 840,843 **** --- 800,805 ---- // draw stuff + msurface_t surf; + image_t image; //for ( c = node.numsurfaces, surf = r_worldmodel.surfaces[node.firstsurface]; c != 0 ; c--, surf++) for ( c = 0; c < node.numsurfaces; c++) *************** *** 876,897 **** } } - // recurse down the back side R_RecursiveWorldNode(node.children[1 - side]); } ! ! /* ! ============= ! R_DrawWorld ! ============= ! */ void R_DrawWorld() { - entity_t ent = new entity_t(); - // auto cycle the world frame for texture animation - ent.frame = (int)(r_newrefdef.time*2); - currententity = ent; - if (r_drawworld.value == 0) return; --- 838,852 ---- } } // recurse down the back side R_RecursiveWorldNode(node.children[1 - side]); } ! private final entity_t worldEntity = new entity_t(); ! ! /** ! * R_DrawWorld ! */ void R_DrawWorld() { if (r_drawworld.value == 0) return; *************** *** 904,907 **** --- 859,868 ---- Math3D.VectorCopy(r_newrefdef.vieworg, modelorg); + entity_t ent = worldEntity; + // auto cycle the world frame for texture animation + ent.clear(); + ent.frame = (int)(r_newrefdef.time*2); + currententity = ent; + gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; *************** *** 939,964 **** } ! byte[] fatvis = new byte[Defines.MAX_MAP_LEAFS / 8]; ! ! /* ! =============== ! R_MarkLeaves ! Mark the leaves and nodes that are in the PVS for the current ! cluster ! =============== ! */ void R_MarkLeaves() { - //byte[] vis; - //byte[] fatvis = new byte[Defines.MAX_MAP_LEAFS / 8]; - - //Arrays.fill(fatvis, (byte)0); - - mnode_t node; - int i, c; - mleaf_t leaf; - int cluster; - if (r_oldviewcluster == r_viewcluster && r_oldviewcluster2 == r_viewcluster2 && r_novis.value == 0 && r_viewcluster != -1) return; --- 900,912 ---- } ! final byte[] fatvis = new byte[Defines.MAX_MAP_LEAFS / 8]; ! /** ! * R_MarkLeaves ! * Mark the leaves and nodes that are in the PVS for the current ! * cluster ! */ void R_MarkLeaves() { if (r_oldviewcluster == r_viewcluster && r_oldviewcluster2 == r_viewcluster2 && r_novis.value == 0 && r_viewcluster != -1) return; *************** *** 973,976 **** --- 921,925 ---- r_oldviewcluster2 = r_viewcluster2; + int i; if (r_novis.value != 0 || r_viewcluster == -1 || r_worldmodel.vis == null) { *************** *** 984,987 **** --- 933,937 ---- byte[] vis = Mod_ClusterPVS(r_viewcluster, r_worldmodel); + int c; // may have to combine two clusters because of solid water boundaries if (r_viewcluster2 != r_viewcluster) *************** *** 1001,1005 **** vis = fatvis; } ! for ( i=0; i < r_worldmodel.numleafs; i++) { --- 951,958 ---- vis = fatvis; } ! ! mnode_t node; ! mleaf_t leaf; ! int cluster; for ( i=0; i < r_worldmodel.numleafs; i++) { *************** *** 1022,1027 **** } - - /* ============================================================================= --- 975,978 ---- *************** *** 1032,1035 **** --- 983,989 ---- */ + /** + * LM_InitBlock + */ void LM_InitBlock() { *************** *** 1037,1053 **** } void LM_UploadBlock( boolean dynamic ) { ! int texture; ! int height = 0; ! ! if ( dynamic ) ! { ! texture = 0; ! } ! else ! { ! texture = gl_lms.current_lightmap_texture; ! } GL_Bind( gl_state.lightmap_textures + texture ); --- 991,1001 ---- } + /** + * LM_UploadBlock + * @param dynamic + */ void LM_UploadBlock( boolean dynamic ) { ! int texture = ( dynamic ) ? 0 : gl_lms.current_lightmap_texture; GL_Bind( gl_state.lightmap_textures + texture ); *************** *** 1058,1064 **** if ( dynamic ) { ! int i; ! ! for ( i = 0; i < BLOCK_WIDTH; i++ ) { if ( gl_lms.allocated[i] > height ) --- 1006,1011 ---- if ( dynamic ) { ! int height = 0; ! for (int i = 0; i < BLOCK_WIDTH; i++ ) { if ( gl_lms.allocated[i] > height ) *************** *** 1087,1106 **** Com.Error( Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n" ); - //debugLightmap(gl_lms.lightmap_buffer, 128, 128, 4); - } } ! // returns a texture number and the position inside it boolean LM_AllocBlock (int w, int h, pos_t pos) { int x = pos.x; int y = pos.y; - int i, j; - int best, best2; - - best = BLOCK_HEIGHT; for (i=0 ; i<BLOCK_WIDTH-w ; i++) { --- 1034,1056 ---- Com.Error( Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n" ); //debugLightmap(gl_lms.lightmap_buffer, 128, 128, 4); } } ! /** ! * LM_AllocBlock ! * @param w ! * @param h ! * @param pos ! * @return a texture number and the position inside it ! */ boolean LM_AllocBlock (int w, int h, pos_t pos) { + int best = BLOCK_HEIGHT; int x = pos.x; int y = pos.y; + int best2; + int i, j; for (i=0 ; i<BLOCK_WIDTH-w ; i++) { *************** *** 1130,1154 **** } ! /* ! ================ ! GL_BuildPolygonFromSurface ! ================ ! */ void GL_BuildPolygonFromSurface(msurface_t fa) { - int i, lindex, lnumverts; - medge_t[] pedges; - medge_t r_pedge; - int vertpage; - float[] vec; - float s, t; - float[] total = {0, 0, 0}; - // reconstruct the polygon ! pedges = currentmodel.edges; ! lnumverts = fa.numedges; ! vertpage = 0; ! ! Math3D.VectorClear(total); // // draw texture --- 1080,1092 ---- } ! /** ! * GL_BuildPolygonFromSurface ! */ void GL_BuildPolygonFromSurface(msurface_t fa) { // reconstruct the polygon ! medge_t[] pedges = currentmodel.edges; ! int lnumverts = fa.numedges; ! int vertpage = 0; // // draw texture *************** *** 1161,1165 **** fa.polys = poly; ! for (i=0 ; i<lnumverts ; i++) { lindex = currentmodel.surfedges[fa.firstedge + i]; --- 1099,1107 ---- fa.polys = poly; ! int lindex; ! float[] vec; ! medge_t r_pedge; ! float s, t; ! for (int i=0 ; i<lnumverts ; i++) { lindex = currentmodel.surfedges[fa.firstedge + i]; *************** *** 1181,1185 **** t /= fa.texinfo.image.height; - Math3D.VectorAdd (total, vec, total); poly.x(i, vec[0]); poly.y(i, vec[1]); --- 1123,1126 ---- *************** *** 1209,1227 **** } ! /* ! ======================== ! GL_CreateSurfaceLightmap ! ======================== ! */ void GL_CreateSurfaceLightmap(msurface_t surf) { - int smax, tmax; - IntBuffer base; - if ( (surf.flags & (Defines.SURF_DRAWSKY | Defines.SURF_DRAWTURB)) != 0) return; ! smax = (surf.extents[0]>>4)+1; ! tmax = (surf.extents[1]>>4)+1; pos_t lightPos = new pos_t(surf.light_s, surf.light_t); --- 1150,1163 ---- } ! /** ! * GL_CreateSurfaceLightmap ! */ void GL_CreateSurfaceLightmap(msurface_t surf) { if ( (surf.flags & (Defines.SURF_DRAWSKY | Defines.SURF_DRAWTURB)) != 0) return; ! int smax = (surf.extents[0]>>4)+1; ! int tmax = (surf.extents[1]>>4)+1; pos_t lightPos = new pos_t(surf.light_s, surf.light_t); *************** *** 1244,1248 **** surf.lightmaptexturenum = gl_lms.current_lightmap_texture; ! base = gl_lms.lightmap_buffer; base.position(surf.light_t * BLOCK_WIDTH + surf.light_s); --- 1180,1184 ---- surf.lightmaptexturenum = gl_lms.current_lightmap_texture; ! IntBuffer base = gl_lms.lightmap_buffer; base.position(surf.light_t * BLOCK_WIDTH + surf.light_s); *************** *** 1252,1263 **** lightstyle_t[] lightstyles; ! IntBuffer dummy = BufferUtils.createIntBuffer(128*128); ! ! /* ! ================== ! GL_BeginBuildingLightmaps ! ================== ! */ void GL_BeginBuildingLightmaps(model_t m) { --- 1188,1196 ---- lightstyle_t[] lightstyles; ! private final IntBuffer dummy = BufferUtils.createIntBuffer(128*128); ! /** ! * GL_BeginBuildingLightmaps ! */ void GL_BeginBuildingLightmaps(model_t m) { *************** *** 1358,1366 **** } ! /* ! ======================= ! GL_EndBuildingLightmaps ! ======================= ! */ void GL_EndBuildingLightmaps() { --- 1291,1297 ---- } ! /** ! * GL_EndBuildingLightmaps ! */ void GL_EndBuildingLightmaps() { Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Main.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Main.java 14 Dec 2004 12:56:58 -0000 1.2 --- Main.java 23 Jan 2005 21:31:48 -0000 1.2.2.1 *************** *** 63,67 **** public abstract class Main extends Base { - public static int[] d_8to24table = new int[256]; --- 63,66 ---- *************** *** 128,132 **** int GL_TEXTURE1 = GL13.GL_TEXTURE1; - model_t r_worldmodel; --- 127,130 ---- *************** *** 240,250 **** // ============================================================================ ! /* ! ================= ! R_CullBox ! ! Returns true if the box is completely outside the frustom ! ================= ! */ final boolean R_CullBox(float[] mins, float[] maxs) { assert(mins.length == 3 && maxs.length == 3) : "vec3_t bug"; --- 238,245 ---- // ============================================================================ ! /** ! * R_CullBox ! * Returns true if the box is completely outside the frustum ! */ final boolean R_CullBox(float[] mins, float[] maxs) { assert(mins.length == 3 && maxs.length == 3) : "vec3_t bug"; *************** *** 260,265 **** } final void R_RotateForEntity(entity_t e) { - gl.glTranslatef(e.origin[0], e.origin[1], e.origin[2]); --- 255,262 ---- } + /** + * R_RotateForEntity + */ final void R_RotateForEntity(entity_t e) { gl.glTranslatef(e.origin[0], e.origin[1], e.origin[2]); *************** *** 277,289 **** */ ! /* ! ================= ! R_DrawSpriteModel ! ! ================= ! */ void R_DrawSpriteModel(entity_t e) { float alpha = 1.0F; - float[] point = { 0, 0, 0 }; qfiles.dsprframe_t frame; --- 274,284 ---- */ ! // stack variable ! private final float[] point = { 0, 0, 0 }; ! /** ! * R_DrawSpriteModel ! */ void R_DrawSpriteModel(entity_t e) { float alpha = 1.0F; qfiles.dsprframe_t frame; *************** *** 351,363 **** // ================================================================================== ! /* ! ============= ! R_DrawNullModel ! ============= ! cwei :-) */ void R_DrawNullModel() { - float[] shadelight = { 0, 0, 0 }; - if ((currententity.flags & Defines.RF_FULLBRIGHT) != 0) { // cwei wollte blau: shadelight[0] = shadelight[1] = shadelight[2] = 1.0F; --- 346,355 ---- // ================================================================================== ! // stack variable ! private final float[] shadelight = { 0, 0, 0 }; ! /** ! * R_DrawNullModel */ void R_DrawNullModel() { if ((currententity.flags & Defines.RF_FULLBRIGHT) != 0) { // cwei wollte blau: shadelight[0] = shadelight[1] = shadelight[2] = 1.0F; *************** *** 399,414 **** } ! /* ! ============= ! R_DrawEntitiesOnList ! ============= ! */ void R_DrawEntitiesOnList() { - int i; - if (r_drawentities.value == 0.0f) return; // draw non-transparent first for (i = 0; i < r_newrefdef.num_entities; i++) { currententity = r_newrefdef.entities[i]; --- 391,403 ---- } ! /** ! * R_DrawEntitiesOnList ! */ void R_DrawEntitiesOnList() { if (r_drawentities.value == 0.0f) return; // draw non-transparent first + int i; for (i = 0; i < r_newrefdef.num_entities; i++) { currententity = r_newrefdef.entities[i]; *************** *** 478,491 **** } ! /* ! ** GL_DrawParticles ! ** ! */ void GL_DrawParticles(int num_particles) { - float[] up = { 0, 0, 0 }; - float[] right = { 0, 0, 0 }; - float scale; - int color; - float origin_x, origin_y, origin_z; --- 467,477 ---- } ! // stack variable ! private final float[] up = { 0, 0, 0 }; ! private final float[] right = { 0, 0, 0 }; ! /** ! * GL_DrawParticles ! */ void GL_DrawParticles(int num_particles) { float origin_x, origin_y, origin_z; *************** *** 502,505 **** --- 488,493 ---- FloatBuffer sourceVertices = particle_t.vertexArray; IntBuffer sourceColors = particle_t.colorArray; + float scale; + int color; for (int j = 0, i = 0; i < num_particles; i++) { origin_x = sourceVertices.get(j++); *************** *** 541,549 **** } ! /* ! =============== ! R_DrawParticles ! =============== ! */ void R_DrawParticles() { --- 529,535 ---- } ! /** ! * R_DrawParticles ! */ void R_DrawParticles() { *************** *** 576,584 **** } ! /* ! ============ ! R_PolyBlend ! ============ ! */ void R_PolyBlend() { if (gl_polyblend.value == 0.0f) --- 562,568 ---- } ! /** ! * R_PolyBlend ! */ void R_PolyBlend() { if (gl_polyblend.value == 0.0f) *************** *** 618,621 **** --- 602,608 ---- // ======================================================================= + /** + * SignbitsForPlane + */ int SignbitsForPlane(cplane_t out) { // for fast box on planeside test *************** *** 628,631 **** --- 615,621 ---- } + /** + * R_SetFrustum + */ void R_SetFrustum() { // rotate VPN right by FOV_X/2 degrees *************** *** 647,659 **** // ======================================================================= ! /* ! =============== ! R_SetupFrame ! =============== ! */ void R_SetupFrame() { - int i; - mleaf_t leaf; - r_framecount++; --- 637,646 ---- // ======================================================================= ! // stack variable ! private final float[] temp = {0, 0, 0}; ! /** ! * R_SetupFrame ! */ void R_SetupFrame() { r_framecount++; *************** *** 664,667 **** --- 651,655 ---- // current viewcluster + mleaf_t leaf; if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) == 0) { r_oldviewcluster = r_viewcluster; *************** *** 672,677 **** // check above and below so crossing solid water doesn't draw wrong if (leaf.contents == 0) { // look down a bit - float[] temp = { 0, 0, 0 }; - Math3D.VectorCopy(r_origin, temp); temp[2] -= 16; --- 660,663 ---- *************** *** 681,686 **** } else { // look up a bit - float[] temp = { 0, 0, 0 }; - Math3D.VectorCopy(r_origin, temp); temp[2] += 16; --- 667,670 ---- *************** *** 691,695 **** } ! for (i = 0; i < 4; i++) v_blend[i] = r_newrefdef.blend[i]; --- 675,679 ---- } ! for (int i = 0; i < 4; i++) v_blend[i] = r_newrefdef.blend[i]; *************** *** 712,723 **** } void MYgluPerspective(double fovy, double aspect, double zNear, double zFar) { ! double xmin, xmax, ymin, ymax; ! ! ymax = zNear * Math.tan(fovy * Math.PI / 360.0); ! ymin = -ymax; ! xmin = ymin * aspect; ! xmax = ymax * aspect; xmin += - (2 * gl_state.camera_separation) / zNear; --- 696,713 ---- } + /** + * MYgluPerspective + * + * @param fovy + * @param aspect + * @param zNear + * @param zFar + */ void MYgluPerspective(double fovy, double aspect, double zNear, double zFar) { ! double ymax = zNear * Math.tan(fovy * Math.PI / 360.0); ! double ymin = -ymax; ! double xmin = ymin * aspect; ! double xmax = ymax * aspect; xmin += - (2 * gl_state.camera_separation) / zNear; *************** *** 727,735 **** } ! /* ! ============= ! R_SetupGL ! ============= ! */ void R_SetupGL() { --- 717,723 ---- } ! /** ! * R_SetupGL ! */ void R_SetupGL() { *************** *** 787,797 **** } - /* - ============= - R_Clear - ============= - */ int trickframe = 0; void R_Clear() { if (gl_ztrick.value != 0.0f) { --- 775,783 ---- } int trickframe = 0; + /** + * R_Clear + */ void R_Clear() { if (gl_ztrick.value != 0.0f) { *************** *** 826,840 **** } void R_Flash() { R_PolyBlend(); } ! /* ! ================ ! R_RenderView ! ! r_newrefdef must be set before the first call ! ================ ! */ void R_RenderView(refdef_t fd) { --- 812,826 ---- } + /** + * R_Flash + */ void R_Flash() { R_PolyBlend(); } ! /** ! * R_RenderView ! * r_newrefdef must be set before the first call ! */ void R_RenderView(refdef_t fd) { *************** *** 890,893 **** --- 876,882 ---- } + /** + * R_SetGL2D + */ void R_SetGL2D() { // set 2D virtual screen size *************** *** 905,917 **** } ! /* ! ==================== ! R_SetLightLevel ! ! ==================== ! */ void R_SetLightLevel() { - float[] shadelight = { 0, 0, 0 }; - if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0) return; --- 894,903 ---- } ! // stack variable ! private final float[] light = { 0, 0, 0 }; ! /** ! * R_SetLightLevel ! */ void R_SetLightLevel() { if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0) return; *************** *** 919,946 **** // save off light value for server to look at (BIG HACK!) ! R_LightPoint(r_newrefdef.vieworg, shadelight); // pick the greatest component, which should be the same // as the mono value returned by software ! if (shadelight[0] > shadelight[1]) { ! if (shadelight[0] > shadelight[2]) ! r_lightlevel.value = 150 * shadelight[0]; else ! r_lightlevel.value = 150 * shadelight[2]; } else { ! if (shadelight[1] > shadelight[2]) ! r_lightlevel.value = 150 * shadelight[1]; else ! r_lightlevel.value = 150 * shadelight[2]; } } ! /* ! @@@@@@@@@@@@@@@@@@@@@ ! R_RenderFrame ! ! @@@@@@@@@@@@@@@@@@@@@ ! */ protected void R_RenderFrame(refdef_t fd) { R_RenderView(fd); --- 905,929 ---- // save off light value for server to look at (BIG HACK!) ! R_LightPoint(r_newrefdef.vieworg, light); // pick the greatest component, which should be the same // as the mono value returned by software ! if (light[0] > light[1]) { ! if (light[0] > light[2]) ! r_lightlevel.value = 150 * light[0]; else ! r_lightlevel.value = 150 * light[2]; } else { ! if (light[1] > light[2]) ! r_lightlevel.value = 150 * light[1]; else ! r_lightlevel.value = 150 * light[2]; } } ! /** ! * R_RenderFrame ! */ protected void R_RenderFrame(refdef_t fd) { R_RenderView(fd); *************** *** 949,952 **** --- 932,938 ---- } + /** + * R_Register + */ protected void R_Register() { r_lefthand = Cvar.Get("hand", "0", Globals.CVAR_USERINFO | Globals.CVAR_ARCHIVE); *************** *** 1015,1019 **** vid_fullscreen = Cvar.Get("vid_fullscreen", "0", Globals.CVAR_ARCHIVE); vid_gamma = Cvar.Get("vid_gamma", "1.0", Globals.CVAR_ARCHIVE); ! vid_ref = Cvar.Get("vid_ref", "fastjogl", Globals.CVAR_ARCHIVE); Cmd.AddCommand("imagelist", new xcommand_t() { --- 1001,1005 ---- vid_fullscreen = Cvar.Get("vid_fullscreen", "0", Globals.CVAR_ARCHIVE); vid_gamma = Cvar.Get("vid_gamma", "1.0", Globals.CVAR_ARCHIVE); ! vid_ref = Cvar.Get("vid_ref", "lwjgl", Globals.CVAR_ARCHIVE); Cmd.AddCommand("imagelist", new xcommand_t() { *************** *** 1040,1060 **** } ! /* ! ================== ! R_SetMode ! ================== ! */ protected boolean R_SetMode() { ! ! int err; // enum rserr_t ! boolean fullscreen; ! ! // if (vid_fullscreen.modified && !gl_config.allow_cds) { ! // VID.Printf(Defines.PRINT_ALL, "R_SetMode() - CDS not allowed with this driver\n"); ! // Cvar.SetValue("vid_fullscreen", (vid_fullscreen.value > 0.0f) ? 0.0f : 1.0f); ! // vid_fullscreen.modified = false; ! // } ! ! fullscreen = (vid_fullscreen.value > 0.0f); vid_fullscreen.modified = false; --- 1026,1034 ---- } ! /** ! * R_SetMode ! */ protected boolean R_SetMode() { ! boolean fullscreen = (vid_fullscreen.value > 0.0f); vid_fullscreen.modified = false; *************** *** 1063,1066 **** --- 1037,1041 ---- Dimension dim = new Dimension(vid.width, vid.height); + int err; // enum rserr_t if ((err = GLimp_SetMode(dim, (int) gl_mode.value, fullscreen)) == rserr_ok) { gl_state.prev_mode = (int) gl_mode.value; *************** *** 1089,1099 **** } - /* - =============== - R_Init - =============== - */ float[] r_turbsin = new float[256]; protected boolean R_Init(int vid_xpos, int vid_ypos) { --- 1064,1072 ---- } float[] r_turbsin = new float[256]; + /** + * R_Init + */ protected boolean R_Init(int vid_xpos, int vid_ypos) { *************** *** 1122,1125 **** --- 1095,1101 ---- } + /** + * R_Init2 + */ protected boolean R_Init2() { VID.MenuInit(); *************** *** 1314,1322 **** } ! /* ! =============== ! R_Shutdown ! =============== ! */ protected void R_Shutdown() { Cmd.RemoveCommand("modellist"); --- 1290,1296 ---- } ! /** ! * R_Shutdown ! */ protected void R_Shutdown() { Cmd.RemoveCommand("modellist"); *************** *** 1335,1343 **** } ! /* ! @@@@@@@@@@@@@@@@@@@@@ ! R_BeginFrame ! @@@@@@@@@@@@@@@@@@@@@ ! */ protected void R_BeginFrame(float camera_separation) { --- 1309,1315 ---- } ! /** ! * R_BeginFrame ! */ protected void R_BeginFrame(float camera_separation) { *************** *** 1351,1355 **** cvar_t ref; ! ref = Cvar.Get("vid_ref", "fastjogl", 0); ref.modified = true; } --- 1323,1327 ---- cvar_t ref; ! ref = Cvar.Get("vid_ref", "lwjgl", 0); ref.modified = true; } *************** *** 1450,1458 **** int[] r_rawpalette = new int[256]; ! /* ! ============= ! R_SetPalette ! ============= ! */ protected void R_SetPalette(byte[] palette) { // 256 RGB values (768 bytes) --- 1422,1428 ---- int[] r_rawpalette = new int[256]; ! /** ! * R_SetPalette ! */ protected void R_SetPalette(byte[] palette) { // 256 RGB values (768 bytes) *************** *** 1488,1506 **** float[][] end_points = new float[NUM_BEAM_SEGS][3]; // array of vec3_t ! /* ! ** R_DrawBeam ! */ void R_DrawBeam(entity_t e) { - - int i; - float r, g, b; - - float[] perpvec = { 0, 0, 0 }; // vec3_t - float[] direction = { 0, 0, 0 }; // vec3_t - float[] normalized_direction = { 0, 0, 0 }; // vec3_t - - float[] oldorigin = { 0, 0, 0 }; // vec3_t - float[] origin = { 0, 0, 0 }; // vec3_t - oldorigin[0] = e.oldorigin[0]; oldorigin[1] = e.oldorigin[1]; --- 1458,1471 ---- float[][] end_points = new float[NUM_BEAM_SEGS][3]; // array of vec3_t ! // stack variable ! private final float[] perpvec = { 0, 0, 0 }; // vec3_t ! private final float[] direction = { 0, 0, 0 }; // vec3_t ! private final float[] normalized_direction = { 0, 0, 0 }; // vec3_t ! private final float[] oldorigin = { 0, 0, 0 }; // vec3_t ! private final float[] origin = { 0, 0, 0 }; // vec3_t ! /** ! * R_DrawBeam ! */ void R_DrawBeam(entity_t e) { oldorigin[0] = e.oldorigin[0]; oldorigin[1] = e.oldorigin[1]; *************** *** 1521,1525 **** Math3D.VectorScale(perpvec, e.frame / 2, perpvec); ! for (i = 0; i < 6; i++) { Math3D.RotatePointAroundVector( start_points[i], --- 1486,1490 ---- Math3D.VectorScale(perpvec, e.frame / 2, perpvec); ! for (int i = 0; i < 6; i++) { Math3D.RotatePointAroundVector( start_points[i], *************** *** 1536,1542 **** gl.glDepthMask(false); ! r = (d_8to24table[e.skinnum & 0xFF]) & 0xFF; ! g = (d_8to24table[e.skinnum & 0xFF] >> 8) & 0xFF; ! b = (d_8to24table[e.skinnum & 0xFF] >> 16) & 0xFF; r *= 1 / 255.0f; --- 1501,1507 ---- gl.glDepthMask(false); ! float r = (d_8to24table[e.skinnum & 0xFF]) & 0xFF; ! float g = (d_8to24table[e.skinnum & 0xFF] >> 8) & 0xFF; ! float b = (d_8to24table[e.skinnum & 0xFF] >> 16) & 0xFF; r *= 1 / 255.0f; *************** *** 1550,1554 **** float[] v; ! for (i = 0; i < NUM_BEAM_SEGS; i++) { v = start_points[i]; gl.glVertex3f(v[0], v[1], v[2]); --- 1515,1519 ---- float[] v; ! for (int i = 0; i < NUM_BEAM_SEGS; i++) { v = start_points[i]; gl.glVertex3f(v[0], v[1], v[2]); *************** *** 1566,1569 **** gl.glDepthMask(true); } ! ! } --- 1531,1533 ---- gl.glDepthMask(true); } ! } \ No newline at end of file |
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); |
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8896/src/jake2/qcommon Modified Files: Tag: RST SZ.java Cbuf.java Qcommon.java CM.java Com.java Netchan.java MSG.java Log Message: added debug messages, fixed cooperative multiplayer bugs. Index: SZ.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/SZ.java,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** SZ.java 10 Sep 2004 19:02:53 -0000 1.3 --- SZ.java 23 Jan 2005 21:31:17 -0000 1.3.6.1 *************** *** 40,44 **** public static void Init(sizebuf_t buf, byte data[], int length) { ! buf.data = data; buf.maxsize = length; buf.cursize = 0; --- 40,47 ---- public static void Init(sizebuf_t buf, byte data[], int length) { ! // TODO check this. cwei ! buf.readcount = 0; ! ! buf.data = data; buf.maxsize = length; buf.cursize = 0; *************** *** 86,89 **** --- 89,93 ---- // public static void Print(sizebuf_t buf, String data) { + Com.dprintln("SZ.print():<" + data + ">" ); int length = data.length(); byte str[] = data.getBytes(); Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.java,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.2 diff -C2 -d -r1.6.6.1 -r1.6.6.2 *** Com.java 16 Jan 2005 21:20:59 -0000 1.6.6.1 --- Com.java 23 Jan 2005 21:31:17 -0000 1.6.6.2 *************** *** 44,47 **** --- 44,50 ---- { + static String debugContext = ""; + static String _debugContext = ""; + static int com_argc; static String[] com_argv= new String[Defines.MAX_NUM_ARGVS]; *************** *** 337,346 **** public static void DPrintf(String fmt) { DPrintf(fmt, null); } public static void Printf(String fmt) { ! Printf(fmt, null); } --- 340,356 ---- public static void DPrintf(String fmt) { + _debugContext = debugContext; DPrintf(fmt, null); + _debugContext = ""; + } + + public static void dprintln(String fmt) + { + DPrintf(_debugContext + fmt + "\n", null); } public static void Printf(String fmt) { ! Printf(_debugContext + fmt, null); } *************** *** 349,360 **** if (Globals.developer == null || Globals.developer.value == 0) return; // don't confuse non-developers with techie stuff... ! Printf(fmt, vargs); } public static void Printf(String fmt, Vargs vargs) { ! // TODO Com.Printf ist nur zum testen ! String msg= sprintf(fmt, vargs); if (rd_target != 0) --- 359,371 ---- if (Globals.developer == null || Globals.developer.value == 0) return; // don't confuse non-developers with techie stuff... ! _debugContext = debugContext; Printf(fmt, vargs); + _debugContext=""; } public static void Printf(String fmt, Vargs vargs) { ! // Com.Printf is for testing only. ! String msg= sprintf(_debugContext + fmt, vargs); if (rd_target != 0) *************** *** 422,426 **** public static void Println(String fmt) { ! Printf(fmt + "\n"); } --- 433,437 ---- public static void Println(String fmt) { ! Printf(_debugContext + fmt + "\n"); } Index: MSG.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/MSG.java,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -C2 -d -r1.5 -r1.5.6.1 *** MSG.java 22 Sep 2004 19:22:09 -0000 1.5 --- MSG.java 23 Jan 2005 21:31:17 -0000 1.5.6.1 *************** *** 88,91 **** --- 88,92 ---- SZ.Write(sb, x.getBytes()); WriteByte(sb, 0); + Com.dprintln("MSG.WriteString:" + s.replace('\0', '@')); } *************** *** 416,419 **** --- 417,421 ---- else c = msg_read.data[msg_read.readcount] & 0xff; + msg_read.readcount++; *************** *** 473,478 **** l++; } while (l < 2047); ! ! return new String(readbuf, 0, l); } --- 475,482 ---- l++; } while (l < 2047); ! ! String ret = new String(readbuf, 0, l); ! Com.dprintln("MSG.ReadString:[" + ret + "]"); ! return ret; } *************** *** 490,495 **** l++; } while (l < 2047); ! ! return new String(readbuf, 0, l).trim(); } --- 494,501 ---- l++; } while (l < 2047); ! ! String ret = new String(readbuf, 0, l).trim(); ! Com.dprintln("MSG.ReadStringLine:[" + ret.replace('\0', '@') + "]"); ! return ret; } *************** *** 556,559 **** for (int i = 0; i < len; i++) data[i] = (byte) ReadByte(msg_read); ! } } \ No newline at end of file --- 562,566 ---- for (int i = 0; i < len; i++) data[i] = (byte) ReadByte(msg_read); ! } ! } \ No newline at end of file Index: Qcommon.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Qcommon.java,v retrieving revision 1.12.2.2 retrieving revision 1.12.2.3 diff -C2 -d -r1.12.2.2 -r1.12.2.3 *** Qcommon.java 16 Jan 2005 21:20:59 -0000 1.12.2.2 --- Qcommon.java 23 Jan 2005 21:31:17 -0000 1.12.2.3 *************** *** 92,96 **** Globals.host_speeds= Cvar.Get("host_speeds", "0", 0); Globals.log_stats= Cvar.Get("log_stats", "0", 0); ! Globals.developer= Cvar.Get("developer", "0", 0); Globals.timescale= Cvar.Get("timescale", "0", 0); Globals.fixedtime= Cvar.Get("fixedtime", "0", 0); --- 92,96 ---- Globals.host_speeds= Cvar.Get("host_speeds", "0", 0); Globals.log_stats= Cvar.Get("log_stats", "0", 0); ! Globals.developer= Cvar.Get("developer", "0", CVAR_ARCHIVE); Globals.timescale= Cvar.Get("timescale", "0", 0); Globals.fixedtime= Cvar.Get("fixedtime", "0", 0); *************** *** 207,216 **** if (Globals.host_speeds.value != 0.0f) time_before= Sys.Milliseconds(); ! SV_MAIN.SV_Frame(msec); if (Globals.host_speeds.value != 0.0f) time_between= Sys.Milliseconds(); ! CL.Frame(msec); --- 207,218 ---- if (Globals.host_speeds.value != 0.0f) time_before= Sys.Milliseconds(); ! ! Com.debugContext = "SV:"; SV_MAIN.SV_Frame(msec); if (Globals.host_speeds.value != 0.0f) time_between= Sys.Milliseconds(); ! ! Com.debugContext = "CL:"; CL.Frame(msec); Index: Cbuf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Cbuf.java,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -C2 -d -r1.5 -r1.5.6.1 *** Cbuf.java 22 Sep 2004 19:22:09 -0000 1.5 --- Cbuf.java 23 Jan 2005 21:31:17 -0000 1.5.6.1 *************** *** 36,39 **** --- 36,42 ---- public final class Cbuf { + private static final byte[] line = new byte[1024]; + private static final byte[] tmp = new byte[8192]; + /** * *************** *** 46,50 **** public static void InsertText(String text) { - byte[] temp = null; int templen = 0; --- 49,52 ---- *************** *** 52,57 **** templen = Globals.cmd_text.cursize; if (templen != 0) { ! temp = new byte[templen]; ! System.arraycopy(Globals.cmd_text.data, 0, temp, 0, templen); SZ.Clear(Globals.cmd_text); } --- 54,58 ---- templen = Globals.cmd_text.cursize; if (templen != 0) { ! System.arraycopy(Globals.cmd_text.data, 0, tmp, 0, templen); SZ.Clear(Globals.cmd_text); } *************** *** 62,67 **** // add the copied off data if (templen != 0) { ! SZ.Write(Globals.cmd_text, temp, templen); ! temp = null; } } --- 63,67 ---- // add the copied off data if (templen != 0) { ! SZ.Write(Globals.cmd_text, tmp, templen); } } *************** *** 157,161 **** byte[] text = null; - byte[] line = new byte[1024]; Globals.alias_count = 0; // don't allow infinite alias loops --- 157,160 ---- *************** *** 191,195 **** i++; Globals.cmd_text.cursize -= i; ! byte[] tmp = new byte[Globals.cmd_text.cursize]; System.arraycopy(text, i, tmp, 0, Globals.cmd_text.cursize); --- 190,194 ---- i++; Globals.cmd_text.cursize -= i; ! //byte[] tmp = new byte[Globals.cmd_text.cursize]; System.arraycopy(text, i, tmp, 0, Globals.cmd_text.cursize); Index: Netchan.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Netchan.java,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** Netchan.java 22 Sep 2004 19:22:09 -0000 1.4 --- Netchan.java 23 Jan 2005 21:31:17 -0000 1.4.6.1 *************** *** 119,122 **** --- 119,124 ---- } + private static final byte send_buf[] = new byte[Defines.MAX_MSGLEN]; + private static final sizebuf_t send = new sizebuf_t(); /* * =============== Netchan_OutOfBand *************** *** 127,132 **** public static void Netchan_OutOfBand(int net_socket, netadr_t adr, int length, byte data[]) { - sizebuf_t send = new sizebuf_t(); - byte send_buf[] = new byte[Defines.MAX_MSGLEN]; // write the packet header --- 129,132 ---- *************** *** 195,198 **** --- 195,200 ---- } + // private static final byte send_buf[] = new byte[Defines.MAX_MSGLEN]; + // private static final sizebuf_t send = new sizebuf_t(); /* * =============== Netchan_Transmit *************** *** 205,210 **** */ public static void Transmit(netchan_t chan, int length, byte data[]) { - sizebuf_t send = new sizebuf_t(); - byte send_buf[] = new byte[Defines.MAX_MSGLEN]; int send_reliable; int w1, w2; --- 207,210 ---- Index: CM.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/CM.java,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.2 diff -C2 -d -r1.6.6.1 -r1.6.6.2 *** CM.java 16 Jan 2005 21:20:59 -0000 1.6.6.1 --- CM.java 23 Jan 2005 21:31:17 -0000 1.6.6.2 *************** *** 217,221 **** public static cmodel_t CM_LoadMap(String name, boolean clientload, int checksum[]) { ! Com.DPrintf("CM_LoadMap...\n"); byte buf[]; int i; --- 217,221 ---- public static cmodel_t CM_LoadMap(String name, boolean clientload, int checksum[]) { ! Com.DPrintf("CM_LoadMap(" + name + ")...\n"); byte buf[]; int i; *************** *** 280,284 **** // load into heap ! CMod_LoadSurfaces(header.lumps[Defines.LUMP_TEXINFO]); // ok. CMod_LoadLeafs(header.lumps[Defines.LUMP_LEAFS]); CMod_LoadLeafBrushes(header.lumps[Defines.LUMP_LEAFBRUSHES]); --- 280,284 ---- // load into heap ! CMod_LoadSurfaces(header.lumps[Defines.LUMP_TEXINFO]); // ok CMod_LoadLeafs(header.lumps[Defines.LUMP_LEAFS]); CMod_LoadLeafBrushes(header.lumps[Defines.LUMP_LEAFBRUSHES]); *************** *** 289,297 **** CMod_LoadNodes(header.lumps[Defines.LUMP_NODES]); ! CMod_LoadAreas(header.lumps[Defines.LUMP_AREAS]); ! CMod_LoadAreaPortals(header.lumps[Defines.LUMP_AREAPORTALS]); CMod_LoadVisibility(header.lumps[Defines.LUMP_VISIBILITY]); CMod_LoadEntityString(header.lumps[Defines.LUMP_ENTITIES]); ! FS.FreeFile(buf); --- 289,297 ---- CMod_LoadNodes(header.lumps[Defines.LUMP_NODES]); ! CMod_LoadAreas(header.lumps[Defines.LUMP_AREAS]); ! CMod_LoadAreaPortals(header.lumps[Defines.LUMP_AREAPORTALS]); CMod_LoadVisibility(header.lumps[Defines.LUMP_VISIBILITY]); CMod_LoadEntityString(header.lumps[Defines.LUMP_ENTITIES]); ! FS.FreeFile(buf); *************** *** 319,323 **** */ public static void CMod_LoadSubmodels(lump_t l) { ! Com.DPrintf("CMod_LoadSubmodels...\n"); qfiles.dmodel_t in; cmodel_t out; --- 319,323 ---- */ public static void CMod_LoadSubmodels(lump_t l) { ! Com.DPrintf("CMod_LoadSubmodels()\n"); qfiles.dmodel_t in; cmodel_t out; *************** *** 325,329 **** if ((l.filelen % qfiles.dmodel_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size"); count = l.filelen / qfiles.dmodel_t.SIZE; --- 325,329 ---- if ((l.filelen % qfiles.dmodel_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "CMod_LoadBmodel: funny lump size"); count = l.filelen / qfiles.dmodel_t.SIZE; *************** *** 334,338 **** Com.Error(Defines.ERR_DROP, "Map has too many models"); ! Com.DPrintf(" numcmodels=" + count + "\n"); numcmodels = count; --- 334,338 ---- Com.Error(Defines.ERR_DROP, "Map has too many models"); ! Com.DPrintf(" numcmodels=" + count + "\n"); numcmodels = count; *************** *** 371,375 **** */ public static void CMod_LoadSurfaces(lump_t l) { ! Com.DPrintf("CMod_LoadSurfaces...\n"); texinfo_t in; mapsurface_t out; --- 371,375 ---- */ public static void CMod_LoadSurfaces(lump_t l) { ! Com.DPrintf("CMod_LoadSurfaces()\n"); texinfo_t in; mapsurface_t out; *************** *** 386,390 **** numtexinfo = count; ! Com.DPrintf("numtexinfo=" + count + "\n"); if (debugloadmap) Com.DPrintf("surfaces:\n"); --- 386,390 ---- numtexinfo = count; ! Com.DPrintf(" numtexinfo=" + count + "\n"); if (debugloadmap) Com.DPrintf("surfaces:\n"); *************** *** 415,419 **** */ public static void CMod_LoadNodes(lump_t l) { ! Com.DPrintf("CMod_LoadNodes...\n"); qfiles.dnode_t in; int child; --- 415,419 ---- */ public static void CMod_LoadNodes(lump_t l) { ! Com.DPrintf("CMod_LoadNodes()\n"); qfiles.dnode_t in; int child; *************** *** 432,436 **** numnodes = count; ! Com.DPrintf(" numnodes=" + count + "\n"); if (debugloadmap) { --- 432,436 ---- numnodes = count; ! Com.DPrintf(" numnodes=" + count + "\n"); if (debugloadmap) { *************** *** 461,465 **** */ public static void CMod_LoadBrushes(lump_t l) { ! Com.DPrintf("CMod_LoadBrushes...\n"); qfiles.dbrush_t in; cbrush_t out; --- 461,465 ---- */ public static void CMod_LoadBrushes(lump_t l) { ! Com.DPrintf("CMod_LoadBrushes()\n"); qfiles.dbrush_t in; cbrush_t out; *************** *** 475,479 **** numbrushes = count; ! Com.DPrintf(" numbrushes=" + count + "\n"); if (debugloadmap) { Com.DPrintf("brushes:(firstbrushside, numsides, contents)\n"); --- 475,479 ---- numbrushes = count; ! Com.DPrintf(" numbrushes=" + count + "\n"); if (debugloadmap) { Com.DPrintf("brushes:(firstbrushside, numsides, contents)\n"); *************** *** 500,504 **** */ public static void CMod_LoadLeafs(lump_t l) { ! Com.DPrintf("CMod_LoadLeafs...\n"); int i; cleaf_t out; --- 500,504 ---- */ public static void CMod_LoadLeafs(lump_t l) { ! Com.DPrintf("CMod_LoadLeafs()\n"); int i; cleaf_t out; *************** *** 518,528 **** Com.Error(Defines.ERR_DROP, "Map has too many planes"); ! Com.DPrintf(" numleafes=" + count + "\n"); numleafs = count; numclusters = 0; if (debugloadmap) ! Com ! .DPrintf("cleaf-list:(contents, cluster, area, firstleafbrush, numleafbrushes)\n"); for (i = 0; i < count; i++) { in = new qfiles.dleaf_t(cmod_base, i * qfiles.dleaf_t.SIZE --- 518,527 ---- Com.Error(Defines.ERR_DROP, "Map has too many planes"); ! Com.DPrintf(" numleafes=" + count + "\n"); numleafs = count; numclusters = 0; if (debugloadmap) ! Com.DPrintf("cleaf-list:(contents, cluster, area, firstleafbrush, numleafbrushes)\n"); for (i = 0; i < count; i++) { in = new qfiles.dleaf_t(cmod_base, i * qfiles.dleaf_t.SIZE *************** *** 548,552 **** } ! Com.DPrintf(" numclusters=" + numclusters + "\n"); if (map_leafs[0].contents != Defines.CONTENTS_SOLID) --- 547,551 ---- } ! Com.DPrintf(" numclusters=" + numclusters + "\n"); if (map_leafs[0].contents != Defines.CONTENTS_SOLID) *************** *** 571,575 **** */ public static void CMod_LoadPlanes(lump_t l) { ! Com.DPrintf("CMod_LoadPlanes...\n"); int i, j; cplane_t out; --- 570,574 ---- */ public static void CMod_LoadPlanes(lump_t l) { ! Com.DPrintf("CMod_LoadPlanes()\n"); int i, j; cplane_t out; *************** *** 590,594 **** Com.Error(Defines.ERR_DROP, "Map has too many planes"); ! Com.DPrintf(" numplanes=" + count + "\n"); numplanes = count; --- 589,593 ---- Com.Error(Defines.ERR_DROP, "Map has too many planes"); ! Com.DPrintf(" numplanes=" + count + "\n"); numplanes = count; *************** *** 629,633 **** */ public static void CMod_LoadLeafBrushes(lump_t l) { ! Com.DPrintf("CMod_LoadLeafBrushes...\n"); int i; int out[]; --- 628,632 ---- */ public static void CMod_LoadLeafBrushes(lump_t l) { ! Com.DPrintf("CMod_LoadLeafBrushes()\n"); int i; int out[]; *************** *** 640,644 **** count = l.filelen / 2; ! Com.DPrintf(" numbrushes=" + count + "\n"); if (count < 1) --- 639,643 ---- count = l.filelen / 2; ! Com.DPrintf(" numbrushes=" + count + "\n"); if (count < 1) *************** *** 671,675 **** */ public static void CMod_LoadBrushSides(lump_t l) { ! Com.DPrintf("CMod_LoadBrushSides...\n"); int i, j; cbrushside_t out; --- 670,674 ---- */ public static void CMod_LoadBrushSides(lump_t l) { ! Com.DPrintf("CMod_LoadBrushSides()\n"); int i, j; cbrushside_t out; *************** *** 688,692 **** numbrushsides = count; ! Com.DPrintf(" numbrushsides=" + count + "\n"); if (debugloadmap) { --- 687,691 ---- numbrushsides = count; ! Com.DPrintf(" numbrushsides=" + count + "\n"); if (debugloadmap) { *************** *** 728,732 **** */ public static void CMod_LoadAreas(lump_t l) { ! Com.DPrintf("CMod_LoadAreas...\n"); int i; carea_t out; --- 727,731 ---- */ public static void CMod_LoadAreas(lump_t l) { ! Com.DPrintf("CMod_LoadAreas()\n"); int i; carea_t out; *************** *** 742,746 **** Com.Error(Defines.ERR_DROP, "Map has too many areas"); ! Com.DPrintf(" numareas=" + count + "\n"); numareas = count; --- 741,745 ---- Com.Error(Defines.ERR_DROP, "Map has too many areas"); ! Com.DPrintf(" numareas=" + count + "\n"); numareas = count; *************** *** 770,774 **** */ public static void CMod_LoadAreaPortals(lump_t l) { ! Com.DPrintf("CMod_LoadAreaPortals...\n"); int i; qfiles.dareaportal_t out; --- 769,773 ---- */ public static void CMod_LoadAreaPortals(lump_t l) { ! Com.DPrintf("CMod_LoadAreaPortals()\n"); int i; qfiles.dareaportal_t out; *************** *** 784,788 **** numareaportals = count; ! Com.DPrintf(" numareaportals=" + count + "\n"); if (debugloadmap) { Com.DPrintf("areaportals(portalnum, otherarea)\n"); --- 783,787 ---- numareaportals = count; ! Com.DPrintf(" numareaportals=" + count + "\n"); if (debugloadmap) { Com.DPrintf("areaportals(portalnum, otherarea)\n"); *************** *** 809,818 **** */ public static void CMod_LoadVisibility(lump_t l) { ! Com.DPrintf("CMod_LoadVisibility...\n"); int i; numvisibility = l.filelen; ! Com.DPrintf(" numvisibility=" + numvisibility + "\n"); if (l.filelen > Defines.MAX_MAP_VISIBILITY) --- 808,817 ---- */ public static void CMod_LoadVisibility(lump_t l) { ! Com.DPrintf("CMod_LoadVisibility()\n"); int i; numvisibility = l.filelen; ! Com.DPrintf(" numvisibility=" + numvisibility + "\n"); if (l.filelen > Defines.MAX_MAP_VISIBILITY) *************** *** 832,836 **** */ public static void CMod_LoadEntityString(lump_t l) { ! Com.DPrintf("CMod_LoadEntityString...\n"); numentitychars = l.filelen; --- 831,835 ---- */ public static void CMod_LoadEntityString(lump_t l) { ! Com.DPrintf("CMod_LoadEntityString()\n"); numentitychars = l.filelen; *************** *** 840,847 **** int x = 0; ! for (; x < l.filelen && cmod_base[x + l.fileofs] != 0; x++) ! ; map_entitystring = new String(cmod_base, l.fileofs, x).trim(); } --- 839,848 ---- int x = 0; ! for (; x < l.filelen && cmod_base[x + l.fileofs] != 0; x++); map_entitystring = new String(cmod_base, l.fileofs, x).trim(); + Com.dprintln("entitystring=" + map_entitystring.length() + + " bytes, [" + map_entitystring.substring(0, Math.min ( + map_entitystring.length(), 15)) + "...]" ); } *************** *** 1401,1405 **** float idist; int i; - float[] mid = { 0, 0, 0 }; int side; float midf; --- 1402,1405 ---- *************** *** 1470,1473 **** --- 1470,1475 ---- midf = p1f + (p2f - p1f) * frac; + float[] mid = Vec3Cache.get(); + for (i = 0; i < 3; i++) mid[i] = p1[i] + frac * (p2[i] - p1[i]); *************** *** 1486,1489 **** --- 1488,1492 ---- CM_RecursiveHullCheck(node.children[side ^ 1], midf, p2f, mid, p2); + Vec3Cache.release(); } |
From: Rene S. <sa...@us...> - 2005-01-23 21:32:05
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/joal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8896/src/jake2/sound/joal Modified Files: Tag: RST JOALSoundImpl.java Log Message: added debug messages, fixed cooperative multiplayer bugs. Index: JOALSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/JOALSoundImpl.java,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** JOALSoundImpl.java 3 Nov 2004 12:17:17 -0000 1.10 --- JOALSoundImpl.java 23 Jan 2005 21:31:25 -0000 1.10.2.1 *************** *** 28,34 **** static { S.register(new JOALSoundImpl()); }; ! static AL al; static ALC alc; --- 28,35 ---- static { + Com.Println("registering JOAL sound driver."); S.register(new JOALSoundImpl()); }; ! static AL al; static ALC alc; *************** *** 70,74 **** */ public boolean Init() { ! // preload OpenAL native library String os = System.getProperty("os.name"); --- 71,75 ---- */ public boolean Init() { ! // preload OpenAL native library String os = System.getProperty("os.name"); |
From: Rene S. <sa...@us...> - 2005-01-23 21:32:01
|
Update of /cvsroot/jake2/jake2/src/jake2/sound In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8896/src/jake2/sound Modified Files: Tag: RST S.java Log Message: added debug messages, fixed cooperative multiplayer bugs. Index: S.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/S.java,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -C2 -d -r1.5.2.1 -r1.5.2.2 *** S.java 16 Jan 2005 21:21:07 -0000 1.5.2.1 --- S.java 23 Jan 2005 21:31:51 -0000 1.5.2.2 *************** *** 6,27 **** */ /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ package jake2.sound; --- 6,27 ---- */ /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ package jake2.sound; *************** *** 30,33 **** --- 30,34 ---- import jake2.qcommon.Com; import jake2.qcommon.Cvar; + import jake2.sound.joal.JOALSoundImpl; import java.util.Vector; *************** *** 37,217 **** */ public class S { - - static Sound impl; - static cvar_t s_impl; - - static Vector drivers = new Vector(3); - - static { - try { - // dummy driver (no sound) - Class.forName("jake2.sound.DummyDriver"); - try { - Class.forName("org.lwjgl.openal.AL"); - Class.forName("jake2.sound.lwjgl.LWJGLSoundImpl"); - } catch (ClassNotFoundException e) { - // ignore the lwjgl driver if runtime not in classpath - } - // prefered driver - try { - Class.forName("net.java.games.joal.AL"); - Class.forName("jake2.sound.joal.JOALSoundImpl"); - } catch (ClassNotFoundException e) { - // ignore the joal driver if runtime not in classpath - } - } - catch (Throwable e) { - } - }; - - public static void register(Sound driver) { - if (driver == null) { - throw new IllegalArgumentException("Sound implementation can't be null"); - } - if (!drivers.contains(driver)) { - drivers.add(driver); - } - } - - public static void useDriver(String driverName) { - Sound driver = null; - int count = drivers.size(); - for (int i = 0; i < count; i++) { - driver = (Sound) drivers.get(i); - if (driver.getName().equals(driverName)) { - impl = driver; - return; - } - } - // if driver not found use dummy - impl = (Sound)drivers.firstElement(); - } - - public static void Init() { - - Com.Printf("\n------- sound initialization -------\n"); ! cvar_t cv = Cvar.Get("s_initsound", "1", 0); ! if (cv.value == 0.0f) { ! Com.Printf("not initializing.\n"); ! useDriver("dummy"); ! return; ! } ! // set the last registered driver as default ! String defaultDriver = "dummy"; ! if (drivers.size() > 1){ ! defaultDriver = ((Sound)drivers.lastElement()).getName(); ! } ! ! s_impl = Cvar.Get("s_impl", defaultDriver, Defines.CVAR_ARCHIVE); ! useDriver(s_impl.string); ! if (impl.Init()) { ! // driver ok ! Cvar.Set("s_impl", impl.getName()); ! } else { ! // fallback ! useDriver("dummy"); ! } ! ! Com.Printf("\n------- use sound driver \"" + impl.getName() + "\" -------\n"); ! StopAllSounds(); ! } ! ! public static void Shutdown() { ! impl.Shutdown(); ! } ! ! /* ! ===================== ! S_BeginRegistration ! ===================== ! */ ! public static void BeginRegistration() { ! impl.BeginRegistration(); ! } ! ! /* ! ===================== ! S_RegisterSound ! ===================== ! */ ! public static sfx_t RegisterSound(String sample) { ! return impl.RegisterSound(sample); ! } ! ! /* ! ===================== ! S_EndRegistration ! ===================== ! */ ! public static void EndRegistration() { ! impl.EndRegistration(); ! } ! ! /* ! ================== ! S_StartLocalSound ! ================== ! */ ! public static void StartLocalSound(String sound) { ! impl.StartLocalSound(sound); ! } ! ! /* ! ==================== ! S_StartSound ! Validates the parms and ques the sound up ! if pos is NULL, the sound will be dynamically sourced from the entity ! Entchannel 0 will never override a playing sound ! ==================== ! */ ! public static void StartSound(float[] origin, int entnum, int entchannel, sfx_t sfx, float fvol, float attenuation, float timeofs) { ! impl.StartSound(origin, entnum, entchannel, sfx, fvol, attenuation, timeofs); ! } ! /* ! ============ ! S_Update ! Called once each time through the main loop ! ============ ! */ ! public static void Update(float[] origin, float[] forward, float[] right, float[] up) { ! impl.Update(origin, forward, right, up); ! } ! /* ! ============ ! S_RawSamples ! ! Cinematic streaming and voice over network ! ============ ! */ ! public static void RawSamples(int samples, int rate, int width, int channels, byte[] data) { ! impl.RawSamples(samples, rate, width, channels, data); ! } ! /* ! ================== ! S_StopAllSounds ! ================== ! */ ! public static void StopAllSounds() { ! impl.StopAllSounds(); ! } ! ! public static String getDriverName() { ! return impl.getName(); ! } ! ! public static String[] getDriverNames() { ! String[] names = new String[drivers.size()]; ! for (int i = 0; i < names.length; i++) { ! names[i] = ((Sound)drivers.get(i)).getName(); ! } ! return names; ! } } \ No newline at end of file --- 38,223 ---- */ public class S { ! static Sound impl; ! static cvar_t s_impl; ! static Vector drivers = new Vector(3); ! static { ! try { ! Com.Println("registering sound drivers..."); ! // dummy driver (no sound) ! try { ! Class.forName("jake2.sound.DummyDriver"); ! } catch (Exception e) { ! Com.Println("" + e.getStackTrace()); ! // ignore the lwjgl driver if runtime not in classpath ! } ! try { ! Class.forName("org.lwjgl.openal.AL"); ! Class.forName("jake2.sound.lwjgl.LWJGLSoundImpl"); ! } catch (Throwable e) { ! e.printStackTrace(); ! Com.Println("" + e.getStackTrace()); ! // ignore the lwjgl driver if runtime not in classpath ! } ! // prefered driver ! try { ! System.out.println("loading joal..."); ! Class.forName("net.java.games.joal.AL"); ! Class.forName("jake2.sound.joal.JOALSoundImpl"); ! } catch (Throwable e) { ! // ignore the joal driver if runtime not in classpath ! } ! } catch (Throwable e) { ! } ! }; ! public static void register(Sound driver) { ! if (driver == null) { ! throw new IllegalArgumentException( ! "Sound implementation can't be null"); ! } ! if (!drivers.contains(driver)) { ! drivers.add(driver); ! } ! } ! public static void useDriver(String driverName) { ! Sound driver = null; ! int count = drivers.size(); ! for (int i = 0; i < count; i++) { ! driver = (Sound) drivers.get(i); ! if (driver.getName().equals(driverName)) { ! impl = driver; ! return; ! } ! } ! // if driver not found use dummy ! impl = (Sound) drivers.firstElement(); ! } ! public static void Init() { ! ! Com.Printf("\n------- sound initialization -------\n"); ! Com.Println("Initializing JOAL.. "); ! ! cvar_t cv = Cvar.Get("s_initsound", "1", 0); ! if (cv.value == 0.0f) { ! Com.Printf("not initializing.\n"); ! useDriver("dummy"); ! return; ! } ! ! // set the last registered driver as default ! String defaultDriver = "dummy"; ! if (drivers.size() > 1) { ! defaultDriver = ((Sound) drivers.lastElement()).getName(); ! } ! ! s_impl = Cvar.Get("s_impl", defaultDriver, Defines.CVAR_ARCHIVE); ! ! s_impl.string = "joal"; ! Com.Println("trying to open sound driver:" + s_impl.string); ! useDriver(s_impl.string); ! ! if (impl.Init()) { ! // driver ok ! Cvar.Set("s_impl", impl.getName()); ! } else { ! // fallback ! Com.Println("falling back to dummy driver."); ! useDriver("dummy"); ! } ! ! Com.Printf("\n------- use sound driver \"" + impl.getName() ! + "\" -------\n"); ! StopAllSounds(); ! } ! ! public static void Shutdown() { ! impl.Shutdown(); ! } ! ! /* ! * ===================== S_BeginRegistration ===================== ! */ ! public static void BeginRegistration() { ! impl.BeginRegistration(); ! } ! ! /* ! * ===================== S_RegisterSound ===================== ! */ ! public static sfx_t RegisterSound(String sample) { ! return impl.RegisterSound(sample); ! } ! ! /* ! * ===================== S_EndRegistration ===================== ! */ ! public static void EndRegistration() { ! impl.EndRegistration(); ! } ! ! /* ! * ================== S_StartLocalSound ================== ! */ ! public static void StartLocalSound(String sound) { ! impl.StartLocalSound(sound); ! } ! ! /* ! * ==================== S_StartSound ! * ! * Validates the parms and ques the sound up if pos is NULL, the sound will ! * be dynamically sourced from the entity Entchannel 0 will never override a ! * playing sound ==================== ! */ ! public static void StartSound(float[] origin, int entnum, int entchannel, ! sfx_t sfx, float fvol, float attenuation, float timeofs) { ! impl.StartSound(origin, entnum, entchannel, sfx, fvol, attenuation, ! timeofs); ! } ! ! /* ! * ============ S_Update ! * ! * Called once each time through the main loop ============ ! */ ! public static void Update(float[] origin, float[] forward, float[] right, ! float[] up) { ! impl.Update(origin, forward, right, up); ! } ! ! /* ! * ============ S_RawSamples ! * ! * Cinematic streaming and voice over network ============ ! */ ! public static void RawSamples(int samples, int rate, int width, ! int channels, byte[] data) { ! impl.RawSamples(samples, rate, width, channels, data); ! } ! ! /* ! * ================== S_StopAllSounds ================== ! */ ! public static void StopAllSounds() { ! impl.StopAllSounds(); ! } ! ! public static String getDriverName() { ! return impl.getName(); ! } ! ! public static String[] getDriverNames() { ! String[] names = new String[drivers.size()]; ! for (int i = 0; i < names.length; i++) { ! names[i] = ((Sound) drivers.get(i)).getName(); ! } ! return names; ! } } \ No newline at end of file |
From: Rene S. <sa...@us...> - 2005-01-23 21:32:00
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8896/src/jake2/render/fastjogl Modified Files: Tag: RST Surf.java Log Message: added debug messages, fixed cooperative multiplayer bugs. Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Surf.java,v retrieving revision 1.5.6.1 retrieving revision 1.5.6.2 diff -C2 -d -r1.5.6.1 -r1.5.6.2 *** Surf.java 16 Jan 2005 21:21:04 -0000 1.5.6.1 --- Surf.java 23 Jan 2005 21:31:50 -0000 1.5.6.2 *************** *** 818,822 **** * ============= R_DrawWorld ============= */ ! entity_t worldEnt = new entity_t(); void R_DrawWorld() { --- 818,822 ---- * ============= R_DrawWorld ============= */ ! private final entity_t worldEnt = new entity_t(); void R_DrawWorld() { |
From: Rene S. <sa...@us...> - 2005-01-23 21:31:59
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8896/src/jake2/server Modified Files: Tag: RST SV_USER.java SV_SEND.java Log Message: added debug messages, fixed cooperative multiplayer bugs. Index: SV_USER.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_USER.java,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** SV_USER.java 6 Dec 2004 14:23:04 -0000 1.7 --- SV_USER.java 23 Jan 2005 21:31:50 -0000 1.7.2.1 *************** *** 166,176 **** // send the serverdata ! MSG ! .WriteByte(SV_MAIN.sv_client.netchan.message, Defines.svc_serverdata); MSG.WriteInt(SV_MAIN.sv_client.netchan.message, Defines.PROTOCOL_VERSION); ! MSG ! .WriteLong(SV_MAIN.sv_client.netchan.message, SV_INIT.svs.spawncount); MSG.WriteByte(SV_MAIN.sv_client.netchan.message, --- 166,175 ---- // send the serverdata ! MSG.WriteByte(SV_MAIN.sv_client.netchan.message, Defines.svc_serverdata); MSG.WriteInt(SV_MAIN.sv_client.netchan.message, Defines.PROTOCOL_VERSION); ! ! MSG.WriteLong(SV_MAIN.sv_client.netchan.message, SV_INIT.svs.spawncount); MSG.WriteByte(SV_MAIN.sv_client.netchan.message, *************** *** 207,211 **** "cmd configstrings " + SV_INIT.svs.spawncount + " 0\n"); } ! } --- 206,210 ---- "cmd configstrings " + SV_INIT.svs.spawncount + " 0\n"); } ! } *************** *** 514,517 **** --- 513,518 ---- */ public static void SV_ExecuteUserCommand(String s) { + + Com.dprintln("SV_ExecuteUserCommand:" + s ); SV_USER.ucmd_t u = null; Index: SV_SEND.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_SEND.java,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** SV_SEND.java 22 Sep 2004 19:22:12 -0000 1.6 --- SV_SEND.java 23 Jan 2005 21:31:50 -0000 1.6.6.1 *************** *** 218,221 **** --- 218,223 ---- SZ.Clear(SV_INIT.sv.multicast); } + + private static final float[] origin_v = { 0, 0, 0 }; /* ================== *************** *** 256,260 **** int i; int ent; - float[] origin_v = { 0, 0, 0 }; boolean use_phs; --- 258,261 ---- *************** *** 355,358 **** --- 356,360 ---- */ + private static final sizebuf_t msg = new sizebuf_t(); /* ======================= *************** *** 361,370 **** */ public static boolean SV_SendClientDatagram(client_t client) { ! byte msg_buf[] = new byte[Defines.MAX_MSGLEN]; ! sizebuf_t msg = new sizebuf_t(); SV_ENTS.SV_BuildClientFrame(client); ! SZ.Init(msg, msg_buf, msg_buf.length); msg.allowoverflow = true; --- 363,371 ---- */ public static boolean SV_SendClientDatagram(client_t client) { ! //byte msg_buf[] = new byte[Defines.MAX_MSGLEN]; SV_ENTS.SV_BuildClientFrame(client); ! SZ.Init(msg, msgbuf, msgbuf.length); msg.allowoverflow = true; *************** *** 443,446 **** --- 444,450 ---- return false; } + + private static final byte msgbuf[] = new byte[Defines.MAX_MSGLEN]; + private static final byte[] NULLBYTE = {0}; /* ======================= *************** *** 452,456 **** client_t c; int msglen; - byte msgbuf[] = new byte[Defines.MAX_MSGLEN]; int r; --- 456,459 ---- *************** *** 524,528 **** // just update reliable if needed if (c.netchan.message.cursize != 0 || Globals.curtime - c.netchan.last_sent > 1000) ! Netchan.Transmit(c.netchan, 0, new byte[0]); } } --- 527,531 ---- // just update reliable if needed if (c.netchan.message.cursize != 0 || Globals.curtime - c.netchan.last_sent > 1000) ! Netchan.Transmit(c.netchan, 0, NULLBYTE); } } |