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: Holger Z. <hz...@us...> - 2004-09-08 09:46:02
|
Update of /cvsroot/jake2/jake2/src/jake2/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16527/src/jake2/sys Modified Files: Tag: r_0_9 IN.java Log Message: merge late changes for 0.9.3 Index: IN.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/IN.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 *** IN.java 6 Sep 2004 19:39:20 -0000 1.2.2.1 --- IN.java 8 Sep 2004 09:45:47 -0000 1.2.2.2 *************** *** 113,117 **** Globals.m_filter = Cvar.Get("m_filter", "0", 0); Globals.in_mouse = Cvar.Get("in_mouse", "1", CVAR_ARCHIVE); ! Globals.freelook = Cvar.Get("freelook", "0", 0 ); Globals.lookstrafe = Cvar.Get("lookstrafe", "0", 0); Globals.sensitivity = Cvar.Get("sensitivity", "3", 0); --- 113,117 ---- Globals.m_filter = Cvar.Get("m_filter", "0", 0); Globals.in_mouse = Cvar.Get("in_mouse", "1", CVAR_ARCHIVE); ! Globals.freelook = Cvar.Get("freelook", "1", 0 ); Globals.lookstrafe = Cvar.Get("lookstrafe", "0", 0); Globals.sensitivity = Cvar.Get("sensitivity", "3", 0); |
From: Holger Z. <hz...@us...> - 2004-09-08 09:46:02
|
Update of /cvsroot/jake2/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16527 Modified Files: Tag: r_0_9 README README_DE Log Message: merge late changes for 0.9.3 Index: README =================================================================== RCS file: /cvsroot/jake2/jake2/README,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** README 9 Jul 2004 08:38:28 -0000 1.1.2.2 --- README 8 Sep 2004 09:45:29 -0000 1.1.2.3 *************** *** 38,45 **** installation of Quake2 data: - download ftp://ftp.idsoftware.com/idstuff/quake2/q2-314-demo-x86.exe (37 MB) ! - extract the directory Install\Data\baseq2 from q2-314-demo-x86.exe with unzip or ! Winzip - copy the baseq2 directory to the Jake2 directory have fun! --- 38,52 ---- installation of Quake2 data: - download ftp://ftp.idsoftware.com/idstuff/quake2/q2-314-demo-x86.exe (37 MB) ! - extract the directory Install\Data\baseq2 from q2-314-demo-x86.exe with unzip ! or Winzip - copy the baseq2 directory to the Jake2 directory + If you want to have the latest experimental features you can grab the latest + Jake2 sources from CVS. + - "cvs -d:pserver:ano...@cv...:/cvsroot/jake2 login" + - when askesd for password jut hit return + - "cvs co jake2" + - procced with the build from source instructions + have fun! Index: README_DE =================================================================== RCS file: /cvsroot/jake2/jake2/README_DE,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** README_DE 9 Jul 2004 08:38:28 -0000 1.1.2.1 --- README_DE 8 Sep 2004 09:45:46 -0000 1.1.2.2 *************** *** 45,48 **** --- 45,55 ---- - baseq2 ins Jake2 Verzeichnis kopieren + Zum Testen neuer und experimenteller Features kann der aktuelle Jake2 + Sourcetree per anonymous CVS ausgecheckt werden. + - "cvs -d:pserver:ano...@cv...:/cvsroot/jake2 login" + - bei der Frage nach dem Passwort gehts mit RETURN weiter + - "cvs co jake2" + - dann gehts weiter wie oben für die Sourcedistribution beschrieben + viel Spass! |
From: Holger Z. <hz...@us...> - 2004-09-08 09:46:02
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16527/src/jake2/qcommon Modified Files: Tag: r_0_9 Qcommon.java Log Message: merge late changes for 0.9.3 Index: Qcommon.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Qcommon.java,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -C2 -d -r1.3.2.3 -r1.3.2.4 *** Qcommon.java 6 Sep 2004 19:39:18 -0000 1.3.2.3 --- Qcommon.java 8 Sep 2004 09:45:46 -0000 1.3.2.4 *************** *** 76,79 **** --- 76,81 ---- Cbuf.AddText("exec default.cfg\n"); + Cbuf.Execute(); + Cvar.Set("vid_fullscreen", "0"); Cbuf.AddText("exec config.cfg\n"); |
From: Holger Z. <hz...@us...> - 2004-09-08 09:38:18
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14783/src/jake2/client Modified Files: CL.java Log Message: default to freelook Index: CL.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** CL.java 4 Sep 2004 19:08:29 -0000 1.9 --- CL.java 8 Sep 2004 09:37:39 -0000 1.10 *************** *** 1261,1265 **** cl_run = Cvar.Get("cl_run", "0", CVAR_ARCHIVE); - freelook = Cvar.Get("freelook", "0", CVAR_ARCHIVE); lookspring = Cvar.Get("lookspring", "0", CVAR_ARCHIVE); lookstrafe = Cvar.Get("lookstrafe", "0", CVAR_ARCHIVE); --- 1261,1264 ---- |
From: Holger Z. <hz...@us...> - 2004-09-08 09:38:04
|
Update of /cvsroot/jake2/jake2/src/jake2/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14783/src/jake2/sys Modified Files: IN.java Log Message: default to freelook Index: IN.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/IN.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IN.java 19 Jul 2004 19:22:57 -0000 1.3 --- IN.java 8 Sep 2004 09:37:39 -0000 1.4 *************** *** 113,117 **** Globals.m_filter = Cvar.Get("m_filter", "0", 0); Globals.in_mouse = Cvar.Get("in_mouse", "1", CVAR_ARCHIVE); ! Globals.freelook = Cvar.Get("freelook", "0", 0 ); Globals.lookstrafe = Cvar.Get("lookstrafe", "0", 0); Globals.sensitivity = Cvar.Get("sensitivity", "3", 0); --- 113,117 ---- Globals.m_filter = Cvar.Get("m_filter", "0", 0); Globals.in_mouse = Cvar.Get("in_mouse", "1", CVAR_ARCHIVE); ! Globals.freelook = Cvar.Get("freelook", "1", 0 ); Globals.lookstrafe = Cvar.Get("lookstrafe", "0", 0); Globals.sensitivity = Cvar.Get("sensitivity", "3", 0); |
From: Holger Z. <hz...@us...> - 2004-09-08 06:38:31
|
Update of /cvsroot/jake2/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15500 Modified Files: README README_DE Log Message: add CVS instructions Index: README =================================================================== RCS file: /cvsroot/jake2/jake2/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README 9 Jul 2004 06:50:48 -0000 1.2 --- README 8 Sep 2004 06:38:20 -0000 1.3 *************** *** 38,45 **** installation of Quake2 data: - download ftp://ftp.idsoftware.com/idstuff/quake2/q2-314-demo-x86.exe (37 MB) ! - extract the directory Install\Data\baseq2 from q2-314-demo-x86.exe with unzip or ! Winzip - copy the baseq2 directory to the Jake2 directory have fun! --- 38,52 ---- installation of Quake2 data: - download ftp://ftp.idsoftware.com/idstuff/quake2/q2-314-demo-x86.exe (37 MB) ! - extract the directory Install\Data\baseq2 from q2-314-demo-x86.exe with unzip ! or Winzip - copy the baseq2 directory to the Jake2 directory + If you want to have the latest experimental features you can grab the latest + Jake2 sources from CVS. + - "cvs -d:pserver:ano...@cv...:/cvsroot/jake2 login" + - when askesd for password jut hit return + - "cvs co jake2" + - procced with the build from source instructions + have fun! Index: README_DE =================================================================== RCS file: /cvsroot/jake2/jake2/README_DE,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README_DE 11 Jul 2004 20:22:12 -0000 1.2 --- README_DE 8 Sep 2004 06:38:21 -0000 1.3 *************** *** 45,48 **** --- 45,55 ---- - baseq2 ins Jake2 Verzeichnis kopieren + Zum Testen neuer und experimenteller Features kann der aktuelle Jake2 + Sourcetree per anonymous CVS ausgecheckt werden. + - "cvs -d:pserver:ano...@cv...:/cvsroot/jake2 login" + - bei der Frage nach dem Passwort gehts mit RETURN weiter + - "cvs co jake2" + - dann gehts weiter wie oben für die Sourcedistribution beschrieben + viel Spass! |
From: Holger Z. <hz...@us...> - 2004-09-06 20:30:31
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12927/src/jake2/qcommon Modified Files: Qcommon.java Log Message: default to window mode for better compatbility Index: Qcommon.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Qcommon.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Qcommon.java 18 Aug 2004 20:27:36 -0000 1.5 --- Qcommon.java 6 Sep 2004 20:30:21 -0000 1.6 *************** *** 76,79 **** --- 76,81 ---- Cbuf.AddText("exec default.cfg\n"); + Cbuf.Execute(); + Cvar.Set("vid_fullscreen", "0"); Cbuf.AddText("exec config.cfg\n"); |
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/game Modified Files: Tag: r_0_9 monsterinfo_t.java PlayerClient.java PlayerClientAdapters.java GameTargetAdapters.java Cmd.java entity_state_t.java GameUtil.java pmove_state_t.java trace_t.java GameSpawn.java level_locals_t.java client_persistant_t.java edict_t.java mframe_t.java GameMiscAdapters.java gclient_t.java GameSave.java moveinfo_t.java client_respawn_t.java PlayerHud.java GameAIAdapters.java GameBase.java player_state_t.java GameAI.java GameFuncAdapters.java SuperAdapter.java GameTriggerAdapters.java game_locals_t.java M_Flyer.java mmove_t.java game_import_t.java gitem_t.java Removed Files: Tag: r_0_9 game_export_t.java Swap.java Log Message: merge changes for 0.9.3 Index: GameTargetAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameTargetAdapters.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** GameTargetAdapters.java 8 Jul 2004 15:58:43 -0000 1.1 --- GameTargetAdapters.java 6 Sep 2004 19:39:14 -0000 1.1.2.1 *************** *** 24,32 **** package jake2.game; ! import jake2.*; ! import jake2.client.*; ! import jake2.qcommon.*; ! import jake2.render.*; ! import jake2.server.*; import jake2.util.Lib; import jake2.util.Math3D; --- 24,29 ---- package jake2.game; ! import jake2.Defines; ! import jake2.Globals; import jake2.util.Lib; import jake2.util.Math3D; *************** *** 92,99 **** if ((ent.spawnflags & 1) != 0) //strncpy(game.helpmessage1, ent.message, sizeof(game.helpmessage2) - 1); ! ent.message = GameBase.game.helpmessage1; else //strncpy(game.helpmessage2, ent.message, sizeof(game.helpmessage1) - 1); ! ent.message = GameBase.game.helpmessage2; GameBase.game.helpchanged++; --- 89,96 ---- if ((ent.spawnflags & 1) != 0) //strncpy(game.helpmessage1, ent.message, sizeof(game.helpmessage2) - 1); ! GameBase.game.helpmessage1 = ent.message; else //strncpy(game.helpmessage2, ent.message, sizeof(game.helpmessage1) - 1); ! GameBase.game.helpmessage2 = ent.message; GameBase.game.helpchanged++; *************** *** 554,558 **** } ! for (i = 1; i < GameBase.globals.num_edicts; i++) { e = GameBase.g_edicts[i]; --- 551,555 ---- } ! for (i = 1; i < GameBase.num_edicts; i++) { e = GameBase.g_edicts[i]; Index: edict_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/edict_t.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** edict_t.java 8 Jul 2004 15:58:44 -0000 1.2 --- edict_t.java 6 Sep 2004 19:39:15 -0000 1.2.2.1 *************** *** 19,110 **** */ package jake2.game; import jake2.*; import jake2.util.*; public class edict_t { ! public edict_t(int i) { [...1090 lines suppressed...] + style= f.readInt(); + + item= f.readItem(); + + moveinfo.read(f); + monsterinfo.read(f); + + int ndx= f.readInt(); + if (ndx == -1) + client= null; + else + client= Game.game.clients[ndx]; + + owner= f.readEdictRef(); + + // rst's checker :-) + if (f.readInt() != 9876) + System.err.println("ent load check failed for num " + index); + } } Index: monsterinfo_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/monsterinfo_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** monsterinfo_t.java 7 Jul 2004 19:59:26 -0000 1.1.1.1 --- monsterinfo_t.java 6 Sep 2004 19:39:14 -0000 1.1.1.1.2.1 *************** *** 24,27 **** --- 24,32 ---- package jake2.game; + import jake2.util.QuakeFile; + + import java.io.IOException; + import java.io.RandomAccessFile; + public class monsterinfo_t { *************** *** 61,63 **** --- 66,162 ---- public int power_armor_power; + /** Writes the monsterinfo to the file.*/ + public void write(QuakeFile f) throws IOException + { + f.writeBoolean(currentmove != null); + if (currentmove != null) + currentmove.write(f); + f.writeInt(aiflags); + f.writeInt(nextframe); + f.writeFloat(scale); + f.writeAdapter(stand); + f.writeAdapter(idle); + f.writeAdapter(search); + f.writeAdapter(walk); + f.writeAdapter(run); + + f.writeAdapter(dodge); + + f.writeAdapter(attack); + f.writeAdapter(melee); + + f.writeAdapter(sight); + + f.writeAdapter(checkattack); + + f.writeFloat(pausetime); + f.writeFloat(attack_finished); + + f.writeVector(saved_goal); + + f.writeFloat(search_time); + f.writeFloat(trail_time); + + f.writeVector(last_sighting); + + f.writeInt(attack_state); + f.writeInt(lefty); + + f.writeFloat(idle_time); + f.writeInt(linkcount); + + f.writeInt(power_armor_power); + f.writeInt(power_armor_type); + } + + /** Writes the monsterinfo to the file.*/ + public void read(QuakeFile f) throws IOException + { + if (f.readBoolean()) + { + currentmove= new mmove_t(); + currentmove.read(f); + } + else + currentmove= null; + aiflags = f.readInt(); + nextframe = f.readInt(); + scale = f.readFloat(); + stand = (EntThinkAdapter) f.readAdapter(); + idle = (EntThinkAdapter) f.readAdapter(); + search = (EntThinkAdapter) f.readAdapter(); + walk = (EntThinkAdapter) f.readAdapter(); + run = (EntThinkAdapter) f.readAdapter(); + + dodge = (EntDodgeAdapter) f.readAdapter(); + + attack = (EntThinkAdapter) f.readAdapter(); + melee = (EntThinkAdapter) f.readAdapter(); + + sight = (EntInteractAdapter) f.readAdapter(); + + checkattack = (EntThinkAdapter) f.readAdapter(); + + pausetime = f.readFloat(); + attack_finished = f.readFloat(); + + saved_goal = f.readVector(); + + search_time = f.readFloat(); + trail_time = f.readFloat(); + + last_sighting = f.readVector(); + + attack_state = f.readInt(); + lefty = f.readInt(); + + idle_time = f.readFloat(); + linkcount = f.readInt(); + + power_armor_power = f.readInt(); + power_armor_type = f.readInt(); + + } + + } Index: moveinfo_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/moveinfo_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** moveinfo_t.java 7 Jul 2004 19:59:26 -0000 1.1.1.1 --- moveinfo_t.java 6 Sep 2004 19:39:15 -0000 1.1.1.1.2.1 *************** *** 24,27 **** --- 24,31 ---- package jake2.game; + import java.io.IOException; + + import jake2.util.QuakeFile; + public class moveinfo_t { // fixed data *************** *** 52,54 **** --- 56,116 ---- float decel_distance; EntThinkAdapter endfunc; + + /** saves the moveinfo to the file.*/ + public void write(QuakeFile f) throws IOException { + f.writeVector(start_origin); + f.writeVector(start_angles); + f.writeVector(end_origin); + f.writeVector(end_angles); + + f.writeInt(sound_start); + f.writeInt(sound_middle); + f.writeInt(sound_end); + + f.writeFloat(accel); + f.writeFloat(speed); + f.writeFloat(decel); + f.writeFloat(distance); + + f.writeFloat(wait); + + f.writeInt(state); + f.writeVector(dir); + + f.writeFloat(current_speed); + f.writeFloat(move_speed); + f.writeFloat(next_speed); + f.writeFloat(remaining_distance); + f.writeFloat(decel_distance); + f.writeAdapter(endfunc); + } + + /** Reads the moveinfo from a file. */ + public void read(QuakeFile f) throws IOException { + start_origin= f.readVector(); + start_angles= f.readVector(); + end_origin= f.readVector(); + end_angles= f.readVector(); + + sound_start= f.readInt(); + sound_middle= f.readInt(); + sound_end= f.readInt(); + + accel= f.readFloat(); + speed= f.readFloat(); + decel= f.readFloat(); + distance= f.readFloat(); + + wait= f.readFloat(); + + state= f.readInt(); + dir= f.readVector(); + + current_speed= f.readFloat(); + move_speed= f.readFloat(); + next_speed= f.readFloat(); + remaining_distance= f.readFloat(); + decel_distance= f.readFloat(); + endfunc= (EntThinkAdapter) f.readAdapter(); + } } Index: player_state_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/player_state_t.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 *** player_state_t.java 9 Jul 2004 08:38:29 -0000 1.2.2.1 --- player_state_t.java 6 Sep 2004 19:39:15 -0000 1.2.2.2 *************** *** 25,28 **** --- 25,29 ---- import java.io.IOException; + import java.io.RandomAccessFile; import java.nio.ByteBuffer; *************** *** 33,56 **** import jake2.util.Math3D; public class player_state_t { - // player_state_t is the information needed in addition to pmove_state_t - // to rendered a view. There will only be 10 player_state_t sent each second, - // but the number of pmove_state_t changes will be reletive to client - // frame rates ! public pmove_state_t pmove = new pmove_state_t(); // for prediction // these fields do not need to be communicated bit-precise ! public float[] viewangles = { 0, 0, 0 }; // for fixed views ! public float[] viewoffset = { 0, 0, 0 }; // add to pmovestate->origin ! public float[] kick_angles = { 0, 0, 0 }; // add to view direction to get render angles // set by weapon kicks, pain effects, etc ! public float[] gunangles = { 0, 0, 0 }; ! public float[] gunoffset = { 0, 0, 0 }; public int gunindex; public int gunframe; ! public float blend[] = new float[4]; // rgba full screen effect public float fov; // horizontal field of view --- 34,60 ---- import jake2.util.Math3D; + /** + Player_state_t is the information needed in addition to pmove_state_t + to rendered a view. There will only be 10 player_state_t sent each second, + but the number of pmove_state_t changes will be relative to client + frame rates. + */ + public class player_state_t { ! public pmove_state_t pmove= new pmove_state_t(); // for prediction // these fields do not need to be communicated bit-precise ! public float[] viewangles= { 0, 0, 0 }; // for fixed views ! public float[] viewoffset= { 0, 0, 0 }; // add to pmovestate->origin ! public float[] kick_angles= { 0, 0, 0 }; // add to view direction to get render angles // set by weapon kicks, pain effects, etc ! public float[] gunangles= { 0, 0, 0 }; ! public float[] gunoffset= { 0, 0, 0 }; public int gunindex; public int gunframe; ! public float blend[]= new float[4]; // rgba full screen effect public float fov; // horizontal field of view *************** *** 58,144 **** public int rdflags; // refdef flags ! public short stats[] = new short[Defines.MAX_STATS]; ! /** ! * ! */ ! private static player_state_t prototype = new player_state_t(); ! public void clear() { this.set(prototype); } ! ! public player_state_t getClone() ! { return new player_state_t().set(this); } ! ! public player_state_t set(player_state_t from) ! { pmove.set(from.pmove); Math3D.VectorCopy(from.viewangles, viewangles); ! Math3D.VectorCopy(from.viewoffset,viewoffset); Math3D.VectorCopy(from.kick_angles, kick_angles); ! Math3D.VectorCopy(from.gunangles,gunangles); Math3D.VectorCopy(from.gunoffset, gunoffset); ! gunindex = from.gunindex; ! gunframe = from.gunframe; - blend[0] = from.blend[0]; - blend[1] = from.blend[1]; - blend[2] = from.blend[2]; - blend[3] = from.blend[3]; - - fov = from.fov; - rdflags = from.rdflags; - - //stats = new short[Defines.MAX_STATS]; - System.arraycopy(from.stats, 0, stats,0, Defines.MAX_STATS); - return this; } ! public void load(ByteBuffer bb) throws IOException { ! pmove.load(bb); ! viewangles[0] = bb.getFloat(); ! viewangles[1] = bb.getFloat(); ! viewangles[2] = bb.getFloat(); ! viewoffset[0] = bb.getFloat(); ! viewoffset[1] = bb.getFloat(); ! viewoffset[2] = bb.getFloat(); ! kick_angles[0] = bb.getFloat(); ! kick_angles[1] = bb.getFloat(); ! kick_angles[2] = bb.getFloat(); ! gunangles[0] = bb.getFloat(); ! gunangles[1] = bb.getFloat(); ! gunangles[2] = bb.getFloat(); ! gunoffset[0] = bb.getFloat(); ! gunoffset[1] = bb.getFloat(); ! gunoffset[2] = bb.getFloat(); ! gunindex = bb.getInt(); ! gunframe = bb.getInt(); ! blend[0] = bb.getFloat(); ! blend[1] = bb.getFloat(); ! blend[2] = bb.getFloat(); ! blend[3] = bb.getFloat(); ! fov = bb.getFloat(); ! rdflags = bb.getInt(); ! for (int n = 0; n < Defines.MAX_STATS; n++) ! stats[n] = bb.getShort(); } public void dump() { pmove.dump(); --- 62,187 ---- public int rdflags; // refdef flags ! public short stats[]= new short[Defines.MAX_STATS]; ! /** Lets cleverly reset the structure. */ ! private static player_state_t prototype= new player_state_t(); ! ! /** Clears the player_state.*/ public void clear() { this.set(prototype); } ! ! /** Clones the object.*/ ! public player_state_t getClone() { return new player_state_t().set(this); } ! ! /** Copies the player state data. */ ! public player_state_t set(player_state_t from) { pmove.set(from.pmove); Math3D.VectorCopy(from.viewangles, viewangles); ! Math3D.VectorCopy(from.viewoffset, viewoffset); Math3D.VectorCopy(from.kick_angles, kick_angles); ! Math3D.VectorCopy(from.gunangles, gunangles); Math3D.VectorCopy(from.gunoffset, gunoffset); ! gunindex= from.gunindex; ! gunframe= from.gunframe; ! ! blend[0]= from.blend[0]; ! blend[1]= from.blend[1]; ! blend[2]= from.blend[2]; ! blend[3]= from.blend[3]; ! ! fov= from.fov; ! rdflags= from.rdflags; ! ! System.arraycopy(from.stats, 0, stats, 0, Defines.MAX_STATS); return this; } ! /** Reads a player_state from a file.*/ ! public void load(RandomAccessFile f) throws IOException { ! pmove.load(f); ! viewangles[0]= f.readFloat(); ! viewangles[1]= f.readFloat(); ! viewangles[2]= f.readFloat(); ! viewoffset[0]= f.readFloat(); ! viewoffset[1]= f.readFloat(); ! viewoffset[2]= f.readFloat(); ! kick_angles[0]= f.readFloat(); ! kick_angles[1]= f.readFloat(); ! kick_angles[2]= f.readFloat(); ! gunangles[0]= f.readFloat(); ! gunangles[1]= f.readFloat(); ! gunangles[2]= f.readFloat(); ! gunoffset[0]= f.readFloat(); ! gunoffset[1]= f.readFloat(); ! gunoffset[2]= f.readFloat(); ! gunindex= f.readInt(); ! gunframe= f.readInt(); ! blend[0]= f.readFloat(); ! blend[1]= f.readFloat(); ! blend[2]= f.readFloat(); ! blend[3]= f.readFloat(); ! fov= f.readFloat(); ! rdflags= f.readInt(); ! for (int n= 0; n < Defines.MAX_STATS; n++) ! stats[n]= f.readShort(); ! } ! ! /** Writes a player_state to a file.*/ ! public void write(RandomAccessFile f) throws IOException { ! pmove.write(f); ! ! f.writeFloat(viewangles[0]); ! f.writeFloat(viewangles[1]); ! f.writeFloat(viewangles[2]); ! ! f.writeFloat(viewoffset[0]); ! f.writeFloat(viewoffset[1]); ! f.writeFloat(viewoffset[2]); ! ! f.writeFloat(kick_angles[0]); ! f.writeFloat(kick_angles[1]); ! f.writeFloat(kick_angles[2]); ! ! f.writeFloat(gunangles[0]); ! f.writeFloat(gunangles[1]); ! f.writeFloat(gunangles[2]); + f.writeFloat(gunoffset[0]); + f.writeFloat(gunoffset[1]); + f.writeFloat(gunoffset[2]); + + f.writeInt(gunindex); + f.writeInt(gunframe); + + f.writeFloat(blend[0]); + f.writeFloat(blend[1]); + f.writeFloat(blend[2]); + f.writeFloat(blend[3]); + + f.writeFloat(fov); + + f.writeInt(rdflags); + + for (int n= 0; n < Defines.MAX_STATS; n++) + f.writeShort(stats[n]); } + /** Prints the player state. */ public void dump() { pmove.dump(); *************** *** 159,163 **** Com.Println("rdflags: " + rdflags); ! for (int n = 0; n < Defines.MAX_STATS; n++) System.out.println("stats[" + n + "]: " + stats[n]); } --- 202,206 ---- Com.Println("rdflags: " + rdflags); ! for (int n= 0; n < Defines.MAX_STATS; n++) System.out.println("stats[" + n + "]: " + stats[n]); } Index: GameBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameBase.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 *** GameBase.java 9 Jul 2004 08:38:28 -0000 1.2.2.1 --- GameBase.java 6 Sep 2004 19:39:15 -0000 1.2.2.2 *************** *** 22,26 **** // $Id$ ! /** Father of all Objects. */ package jake2.game; --- 22,26 ---- // $Id$ ! /** Father of all GameObjects. */ [...1165 lines suppressed...] }; ! //globals.apiversion= GAME_API_VERSION; /* globals.Init = InitGame; *************** *** 874,878 **** */ ! return globals; } } \ No newline at end of file --- 711,715 ---- */ ! //return globals; } } \ No newline at end of file Index: GameUtil.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameUtil.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 *** GameUtil.java 9 Jul 2004 08:38:28 -0000 1.2.2.1 --- GameUtil.java 6 Sep 2004 19:39:15 -0000 1.2.2.2 *************** *** 24,33 **** package jake2.game; - import java.sql.Savepoint; - - import jake2.Defines; import jake2.client.M; import jake2.qcommon.Com; ! import jake2.util.*; public class GameUtil extends GameBase --- 24,31 ---- package jake2.game; import jake2.client.M; import jake2.qcommon.Com; ! import jake2.util.Lib; ! import jake2.util.Math3D; public class GameUtil extends GameBase *************** *** 166,170 **** edict_t e = null; ! for (i = (int) maxclients.value + 1; i < globals.num_edicts; i++) { e = g_edicts[i]; --- 164,168 ---- edict_t e = null; ! for (i = (int) maxclients.value + 1; i < num_edicts; i++) { e = g_edicts[i]; *************** *** 183,187 **** e = g_edicts[i] = new edict_t(i); ! globals.num_edicts++; G_InitEdict(e, i); return e; --- 181,185 ---- e = g_edicts[i] = new edict_t(i); ! num_edicts++; G_InitEdict(e, i); return e; *************** *** 888,892 **** static gitem_t FindItem(String pickup_name) { - //Com.Printf("FindItem:" + pickup_name + "\n"); for (int i = 1; i < game.num_items; i++) { --- 886,889 ---- Index: GameAIAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameAIAdapters.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** GameAIAdapters.java 8 Jul 2004 20:24:29 -0000 1.2 --- GameAIAdapters.java 6 Sep 2004 19:39:15 -0000 1.2.2.1 *************** *** 32,52 **** import java.util.*; ! public class GameAIAdapters ! { /** Common Boss explode animation.*/ ! public static EntThinkAdapter BossExplode = new EntThinkAdapter() ! { ! public boolean think(edict_t self) ! { [...1800 lines suppressed...] }; ! public static ItemDropAdapter Drop_PowerArmor= new ItemDropAdapter() { ! public void drop(edict_t ent, gitem_t item) { if (0 != (ent.flags & Defines.FL_POWER_ARMOR) && (ent.client.pers.inventory[GameUtil.ITEM_INDEX(item)] == 1)) Use_PowerArmor.use(ent, item); *************** *** 1173,1178 **** } }; ! public static gitem_armor_t jacketarmor_info = new gitem_armor_t(25, 50, .30f, .00f, Defines.ARMOR_JACKET); ! public static gitem_armor_t combatarmor_info = new gitem_armor_t(50, 100, .60f, .30f, Defines.ARMOR_COMBAT); ! public static gitem_armor_t bodyarmor_info = new gitem_armor_t(100, 200, .80f, .60f, Defines.ARMOR_BODY); } --- 1044,1049 ---- } }; ! public static gitem_armor_t jacketarmor_info= new gitem_armor_t(25, 50, .30f, .00f, Defines.ARMOR_JACKET); ! public static gitem_armor_t combatarmor_info= new gitem_armor_t(50, 100, .60f, .30f, Defines.ARMOR_COMBAT); ! public static gitem_armor_t bodyarmor_info= new gitem_armor_t(100, 200, .80f, .60f, Defines.ARMOR_BODY); } Index: GameSave.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSave.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** GameSave.java 7 Jul 2004 19:59:01 -0000 1.1.1.1 --- GameSave.java 6 Sep 2004 19:39:15 -0000 1.1.1.1.2.1 *************** *** 24,42 **** package jake2.game; ! import java.io.FileNotFoundException; ! import java.io.IOException; ! import java.io.RandomAccessFile; ! import java.nio.*; ! ! import jake2.*; ! import jake2.client.*; ! import jake2.qcommon.*; ! import jake2.render.*; ! import jake2.server.*; ! import jake2.util.*; public class GameSave extends GameFunc { ! public static field_t levelfields[] = { new field_t("changemap", F_LSTRING), --- 24,33 ---- package jake2.game; ! import jake2.qcommon.Com; ! import jake2.util.QuakeFile; public class GameSave extends GameFunc { ! public static field_t levelfields[]= { new field_t("changemap", F_LSTRING), *************** *** 47,51 **** new field_t(null, F_INT)}; ! public static field_t clientfields[] = { new field_t("pers.weapon", F_ITEM), --- 38,42 ---- new field_t(null, F_INT)}; ! public static field_t clientfields[]= { new field_t("pers.weapon", F_ITEM), *************** *** 55,67 **** public static void CreateEdicts() { ! g_edicts = new edict_t[game.maxentities]; ! for (int i = 0; i < game.maxentities; i++) ! g_edicts[i] = new edict_t(i); } public static void CreateClients() { ! game.clients = new gclient_t[game.maxclients]; ! for (int i = 0; i < game.maxclients; i++) ! game.clients[i] = new gclient_t(i); } --- 46,59 ---- public static void CreateEdicts() { ! g_edicts= new edict_t[game.maxentities]; ! for (int i= 0; i < game.maxentities; i++) ! g_edicts[i]= new edict_t(i); ! GameBase.g_edicts= g_edicts; } public static void CreateClients() { ! game.clients= new gclient_t[game.maxclients]; ! for (int i= 0; i < game.maxclients; i++) ! game.clients[i]= new gclient_t(i); } *************** *** 79,733 **** gi.dprintf("==== InitGame ====\n"); ! gun_x = gi.cvar("gun_x", "0", 0); ! gun_y = gi.cvar("gun_y", "0", 0); ! gun_z = gi.cvar("gun_z", "0", 0); //FIXME: sv_ prefix is wrong for these ! sv_rollspeed = gi.cvar("sv_rollspeed", "200", 0); ! sv_rollangle = gi.cvar("sv_rollangle", "2", 0); ! sv_maxvelocity = gi.cvar("sv_maxvelocity", "2000", 0); ! sv_gravity = gi.cvar("sv_gravity", "800", 0); // noset vars ! dedicated = gi.cvar("dedicated", "0", CVAR_NOSET); // latched vars ! sv_cheats = gi.cvar("cheats", "0", CVAR_SERVERINFO | CVAR_LATCH); gi.cvar("gamename", GAMEVERSION, CVAR_SERVERINFO | CVAR_LATCH); gi.cvar("gamedate", __DATE__, CVAR_SERVERINFO | CVAR_LATCH); ! maxclients = gi.cvar("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); ! maxspectators = gi.cvar("maxspectators", "4", CVAR_SERVERINFO); ! deathmatch = gi.cvar("deathmatch", "0", CVAR_LATCH); ! coop = gi.cvar("coop", "0", CVAR_LATCH); ! skill = gi.cvar("skill", "0", CVAR_LATCH); ! maxentities = gi.cvar("maxentities", "1024", CVAR_LATCH); // change anytime vars ! dmflags = gi.cvar("dmflags", "0", CVAR_SERVERINFO); ! fraglimit = gi.cvar("fraglimit", "0", CVAR_SERVERINFO); ! timelimit = gi.cvar("timelimit", "0", CVAR_SERVERINFO); ! password = gi.cvar("password", "", CVAR_USERINFO); ! spectator_password = gi.cvar("spectator_password", "", CVAR_USERINFO); ! needpass = gi.cvar("needpass", "0", CVAR_SERVERINFO); ! filterban = gi.cvar("filterban", "1", 0); ! g_select_empty = gi.cvar("g_select_empty", "0", CVAR_ARCHIVE); ! run_pitch = gi.cvar("run_pitch", "0.002", 0); ! run_roll = gi.cvar("run_roll", "0.005", 0); ! bob_up = gi.cvar("bob_up", "0.005", 0); ! bob_pitch = gi.cvar("bob_pitch", "0.002", 0); ! bob_roll = gi.cvar("bob_roll", "0.002", 0); // flood control ! flood_msgs = gi.cvar("flood_msgs", "4", 0); ! flood_persecond = gi.cvar("flood_persecond", "4", 0); ! flood_waitdelay = gi.cvar("flood_waitdelay", "10", 0); // dm map list ! sv_maplist = gi.cvar("sv_maplist", "", 0); // items InitItems(); ! //Com_sprintf (game.helpmessage1, sizeof(game.helpmessage1), ""); ! game.helpmessage1 = ""; ! ! //Com_sprintf (game.helpmessage2, sizeof(game.helpmessage2), ""); ! game.helpmessage2 = ""; // initialize all entities for this game ! game.maxentities = (int) maxentities.value; ! ! //g_edicts = gi.TagMalloc(game.maxentities * sizeof(g_edicts[0]), TAG_GAME); CreateEdicts(); ! globals.edicts = g_edicts; ! globals.max_edicts = game.maxentities; // initialize all clients for this game ! game.maxclients = (int) maxclients.value; - //game.clients = gi.TagMalloc(game.maxclients * sizeof(game.clients[0]), TAG_GAME); CreateClients(); ! globals.num_edicts = game.maxclients + 1; } - ////========================================================= - // - //public static void WriteField1 (FILE *f, field_t field, byte base) - //{ - // void *p; - // int len; - // int index; - // - // if (field.flags & FFL_SPAWNTEMP) - // return; - // - // p = (void *)(base + field.ofs); - // switch (field.type) - // { - // case F_INT: - // case F_FLOAT: - // case F_ANGLEHACK: - // case F_VECTOR: - // case F_IGNORE: - // break; - // - // case F_LSTRING: - // case F_GSTRING: - // if ( *(char **)p ) - // len = strlen(*(char **)p) + 1; - // else - // len = 0; - // *(int *)p = len; - // break; - // case F_EDICT: - // if ( *(edict_t **)p == NULL) - // index = -1; - // else - // index = *(edict_t **)p - g_edicts; - // *(int *)p = index; - // break; - // case F_CLIENT: - // if ( *(gclient_t **)p == NULL) - // index = -1; - // else - // index = *(gclient_t **)p - game.clients; - // *(int *)p = index; - // break; - // case F_ITEM: - // if ( *(edict_t **)p == NULL) - // index = -1; - // else - // index = *(gitem_t **)p - itemlist; - // *(int *)p = index; - // break; - // - // //relative to code segment - // case F_FUNCTION: - // if (*(byte **)p == NULL) - // index = 0; - // else - // index = *(byte **)p - ((byte *)InitGame); - // *(int *)p = index; - // break; - // - // //relative to data segment - // case F_MMOVE: - // if (*(byte **)p == NULL) - // index = 0; - // else - // index = *(byte **)p - (byte *)&mmove_reloc; - // *(int *)p = index; - // break; - // - // default: - // gi.error ("WriteEdict: unknown field type"); - // } - //} - // - // - //void WriteField2 (FILE *f, field_t *field, byte *base) - //{ - // int len; - // void *p; - // - // if (field.flags & FFL_SPAWNTEMP) - // return; - // - // p = (void *)(base + field.ofs); - // switch (field.type) - // { - // case F_LSTRING: - // if ( *(char **)p ) - // { - // len = strlen(*(char **)p) + 1; - // fwrite (*(char **)p, len, 1, f); - // } - // break; - // } - //} - // - //void ReadField (FILE *f, field_t *field, byte *base) - //{ - // void *p; - // int len; - // int index; - // - // if (field.flags & FFL_SPAWNTEMP) - // return; - // - // p = (void *)(base + field.ofs); - // switch (field.type) - // { - // case F_INT: - // case F_FLOAT: - // case F_ANGLEHACK: - // case F_VECTOR: - // case F_IGNORE: - // break; - // - // case F_LSTRING: - // len = *(int *)p; - // if (!len) - // *(char **)p = NULL; - // else - // { - // *(char **)p = gi.TagMalloc (len, TAG_LEVEL); - // fread (*(char **)p, len, 1, f); - // } - // break; - // case F_EDICT: - // index = *(int *)p; - // if ( index == -1 ) - // *(edict_t **)p = NULL; - // else - // *(edict_t **)p = &g_edicts[index]; - // break; - // case F_CLIENT: - // index = *(int *)p; - // if ( index == -1 ) - // *(gclient_t **)p = NULL; - // else - // *(gclient_t **)p = &game.clients[index]; - // break; - // case F_ITEM: - // index = *(int *)p; - // if ( index == -1 ) - // *(gitem_t **)p = NULL; - // else - // *(gitem_t **)p = &itemlist[index]; - // break; - // - // //relative to code segment - // case F_FUNCTION: - // index = *(int *)p; - // if ( index == 0 ) - // *(byte **)p = NULL; - // else - // *(byte **)p = ((byte *)InitGame) + index; - // break; - // - // //relative to data segment - // case F_MMOVE: - // index = *(int *)p; - // if (index == 0) - // *(byte **)p = NULL; - // else - // *(byte **)p = (byte *)&mmove_reloc + index; - // break; - // - // default: - // gi.error ("ReadEdict: unknown field type"); - // } - //} - // - ////========================================================= - // - ///* - //============== - //WriteClient - // - //All pointer variables (except function pointers) must be handled specially. - //============== - //*/ - //void WriteClient (FILE *f, gclient_t *client) - //{ - // field_t *field; - // gclient_t temp; - // - // // all of the ints, floats, and vectors stay as they are - // temp = *client; - // - // // change the pointers to lengths or indexes - // for (field=clientfields ; field.name ; field++) - // { - // WriteField1 (f, field, (byte *)&temp); - // } - // - // // write the block - // fwrite (&temp, sizeof(temp), 1, f); - // - // // now write any allocated data following the edict - // for (field=clientfields ; field.name ; field++) - // { - // WriteField2 (f, field, (byte *)client); - // } - //} - // /* ! ============== ! ReadClient ! All pointer variables (except function pointers) must be handled specially. ! ============== */ ! //} // ! ! /* ! //============ ! //WriteGame ! // ! //This will be called whenever the game goes to a new level, ! //and when the user explicitly saves the game. ! // ! //Game information include cross level data, like multi level ! //triggers, help computer info, and all client states. ! // ! //A single player death will automatically restore from the ! //last save position. ! //============ ! //*/ ! //public static void WriteGame (String filename, boolean autosave) ! //{ ! // FILE *f; ! // int i; ! // char str[16]; ! // ! // if (!autosave) ! // SaveClientData (); ! // ! // f = fopen (filename, "rw"); ! // if (!f) ! // gi.error ("Couldn't open %s", filename); ! // ! // memset (str, 0, sizeof(str)); ! // strcpy (str, __DATE__); ! // fwrite (str, sizeof(str), 1, f); ! // ! // game.autosaved = autosave; ! // fwrite (&game, sizeof(game), 1, f); ! // game.autosaved = false; ! // ! // for (i=0 ; i<game.maxclients ; i++) ! // WriteClient (f, &game.clients[i]); ! // ! // fclose (f); ! //} ! // ! ! public static void ReadGame(String filename) { ! RandomAccessFile f = null; ! try { ! f = new RandomAccessFile(filename, "r"); ! byte buf[] = new byte[(int) f.length()]; ! Com.Printf("loading game:" + filename); ! f.readFully(buf); ! ByteBuffer bb = ByteBuffer.wrap(buf); ! bb.order(ByteOrder.LITTLE_ENDIAN); CreateEdicts(); ! game.load(bb); ! //game.dump(); ! for (int i = 0; i < game.maxclients; i++) { ! game.clients[i] = new gclient_t(i); ! game.clients[i].load(bb); } - - Com.Println(""); - Com.Println("file length:" + f.length()); - Com.Println("processed bytes:" + bb.position()); } catch (Exception e) { e.printStackTrace(); ! //gi.error ("File problems in "+ filename); ! } //if (!f) ! // gi.error ("Couldn't open %s", filename); ! // ! // fread (str, sizeof(str), 1, f); ! // if (strcmp (str, __DATE__)) ! // { ! // fclose (f); ! // gi.error ("Savegame from an older version.\n"); ! // } ! // ! // CreateEdicts(); ! // ! // fread (game, sizeof(game), 1, f); ! // ! // CreateClients(); ! // ! // for (i=0 ; i<game.maxclients ; i++) ! // ReadClient (f, game.clients[i]); ! // ! // fclose (f); try { f.close(); } ! catch (IOException e) { ! Com.Error(Defines.ERR_DROP, "Unable to load savegame"); } } ! // ! ////========================================================== ! // ! // ! ///* ! //============== ! //WriteEdict ! // ! //All pointer variables (except function pointers) must be handled specially. ! //============== ! //*/ ! //void WriteEdict (FILE *f, edict_t *ent) ! //{ ! // field_t *field; ! // edict_t temp; ! // ! // // all of the ints, floats, and vectors stay as they are ! // temp = *ent; ! // ! // // change the pointers to lengths or indexes ! // for (field=fields ; field.name ; field++) ! // { ! // WriteField1 (f, field, (byte *)&temp); ! // } ! // ! // // write the block ! // fwrite (&temp, sizeof(temp), 1, f); ! // ! // // now write any allocated data following the edict ! // for (field=fields ; field.name ; field++) ! // { ! // WriteField2 (f, field, (byte *)ent); ! // } ! // ! //} ! // ! ///* ! //============== ! //WriteLevelLocals ! // ! //All pointer variables (except function pointers) must be handled specially. ! //============== ! //*/ ! //void WriteLevelLocals (FILE *f) ! //{ ! // field_t *field; ! // level_locals_t temp; ! // ! // // all of the ints, floats, and vectors stay as they are ! // temp = level; ! // ! // // change the pointers to lengths or indexes ! // for (field=levelfields ; field.name ; field++) ! // { ! // WriteField1 (f, field, (byte *)&temp); ! // } ! // ! // // write the block ! // fwrite (&temp, sizeof(temp), 1, f); ! // ! // // now write any allocated data following the edict ! // for (field=levelfields ; field.name ; field++) ! // { ! // WriteField2 (f, field, (byte *)&level); ! // } ! //} ! // ! // ! ///* ! //============== ! //ReadEdict ! // ! //All pointer variables (except function pointers) must be handled specially. ! //============== ! //*/ ! //void ReadEdict (FILE *f, edict_t *ent) ! //{ ! // field_t *field; ! // ! // fread (ent, sizeof(*ent), 1, f); ! // ! // for (field=fields ; field.name ; field++) ! // { ! // ReadField (f, field, (byte *)ent); ! // } ! //} ! // ! ///* ! //============== ! //ReadLevelLocals ! // ! //All pointer variables (except function pointers) must be handled specially. ! //============== ! //*/ ! //void ReadLevelLocals (FILE *f) ! //{ ! // field_t *field; ! // ! // fread (&level, sizeof(level), 1, f); ! // ! // for (field=levelfields ; field.name ; field++) ! // { ! // ReadField (f, field, (byte *)&level); ! // } ! //} ! // ! ///* ! //================= ! //WriteLevel ! // ! //================= ! //*/ ! //void WriteLevel (char *filename) ! //{ ! // int i; ! // edict_t *ent; ! // FILE *f; ! // void *base; ! // ! // f = fopen (filename, "rw"); ! // if (!f) ! // gi.error ("Couldn't open %s", filename); ! // ! // // write out edict size for checking ! // i = sizeof(edict_t); ! // fwrite (&i, sizeof(i), 1, f); ! // ! // // write out a function pointer for checking ! // base = (void *)InitGame; ! // fwrite (&base, sizeof(base), 1, f); ! // ! // // write out level_locals_t ! // WriteLevelLocals (f); ! // ! // // write out all the entities ! // for (i=0 ; i<globals.num_edicts ; i++) ! // { ! // ent = &g_edicts[i]; ! // if (!ent.inuse) ! // continue; ! // fwrite (&i, sizeof(i), 1, f); ! // WriteEdict (f, ent); ! // } ! // i = -1; ! // fwrite (&i, sizeof(i), 1, f); ! // ! // fclose (f); ! //} ! // ! // ! ///* ! //================= ! //ReadLevel ! // ! //SpawnEntities will allready have been called on the ! //level the same way it was when the level was saved. ! // ! //That is necessary to get the baselines ! //set up identically. ! // ! //The server will have cleared all of the world links before ! //calling ReadLevel. ! // ! //No clients are connected yet. ! //================= ! //*/ ! //void ReadLevel (char *filename) ! //{ ! // int entnum; ! // FILE *f; ! // int i; ! // void *base; ! // edict_t *ent; ! // ! // f = fopen (filename, "r"); ! // if (!f) ! // gi.error ("Couldn't open %s", filename); ! // ! // // free any dynamic memory allocated by loading the level ! // // base state ! // gi.FreeTags (TAG_LEVEL); ! // ! // // wipe all the entities ! // memset (g_edicts, 0, game.maxentities*sizeof(g_edicts[0])); ! // globals.num_edicts = maxclients.value+1; ! // ! // // check edict size ! // fread (&i, sizeof(i), 1, f); ! // if (i != sizeof(edict_t)) ! // { ! // fclose (f); ! // gi.error ("ReadLevel: mismatched edict size"); ! // } ! // ! // // check function pointer base address ! // fread (&base, sizeof(base), 1, f); ! //#ifdef _WIN32 ! // if (base != (void *)InitGame) ! // { ! // fclose (f); ! // gi.error ("ReadLevel: function pointers have moved"); ! // } ! //#else ! // gi.dprintf("Function offsets %d\n", ((byte *)base) - ((byte *)InitGame)); ! //#endif ! // ! // // load the level locals ! // ReadLevelLocals (f); ! // ! // // load all the entities ! // while (1) ! // { ! // if (fread (&entnum, sizeof(entnum), 1, f) != 1) ! // { ! // fclose (f); ! // gi.error ("ReadLevel: failed to read entnum"); ! // } ! // if (entnum == -1) ! // break; ! // if (entnum >= globals.num_edicts) ! // globals.num_edicts = entnum+1; ! // ! // ent = &g_edicts[entnum]; ! // ReadEdict (f, ent); ! // ! // // let the server rebuild world links for this ent ! // memset (&ent.area, 0, sizeof(ent.area)); ! // gi.linkentity (ent); ! // } ! // ! // fclose (f); ! // ! // // mark all clients as unconnected ! // for (i=0 ; i<maxclients.value ; i++) ! // { ! // ent = &g_edicts[i+1]; ! // ent.client = game.clients + i; ! // ent.client.pers.connected = false; ! // } ! // ! // // do any load time things at this point ! // for (i=0 ; i<globals.num_edicts ; i++) ! // { ! // ent = &g_edicts[i]; ! // ! // if (!ent.inuse) ! // continue; ! // ! // // fire any cross-level triggers ! // if (ent.classname) ! // if (strcmp(ent.classname, "target_crosslevel_target") == 0) ! // ent.nextthink = level.time + ent.delay; ! // } ! //} } --- 71,321 ---- gi.dprintf("==== InitGame ====\n"); ! gun_x= gi.cvar("gun_x", "0", 0); ! gun_y= gi.cvar("gun_y", "0", 0); ! gun_z= gi.cvar("gun_z", "0", 0); //FIXME: sv_ prefix is wrong for these ! sv_rollspeed= gi.cvar("sv_rollspeed", "200", 0); ! sv_rollangle= gi.cvar("sv_rollangle", "2", 0); ! sv_maxvelocity= gi.cvar("sv_maxvelocity", "2000", 0); ! sv_gravity= gi.cvar("sv_gravity", "800", 0); // noset vars ! dedicated= gi.cvar("dedicated", "0", CVAR_NOSET); // latched vars ! sv_cheats= gi.cvar("cheats", "0", CVAR_SERVERINFO | CVAR_LATCH); gi.cvar("gamename", GAMEVERSION, CVAR_SERVERINFO | CVAR_LATCH); gi.cvar("gamedate", __DATE__, CVAR_SERVERINFO | CVAR_LATCH); ! maxclients= gi.cvar("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); ! maxspectators= gi.cvar("maxspectators", "4", CVAR_SERVERINFO); ! deathmatch= gi.cvar("deathmatch", "0", CVAR_LATCH); ! coop= gi.cvar("coop", "0", CVAR_LATCH); ! skill= gi.cvar("skill", "0", CVAR_LATCH); ! maxentities= gi.cvar("maxentities", "1024", CVAR_LATCH); // change anytime vars ! dmflags= gi.cvar("dmflags", "0", CVAR_SERVERINFO); ! fraglimit= gi.cvar("fraglimit", "0", CVAR_SERVERINFO); ! timelimit= gi.cvar("timelimit", "0", CVAR_SERVERINFO); ! password= gi.cvar("password", "", CVAR_USERINFO); ! spectator_password= gi.cvar("spectator_password", "", CVAR_USERINFO); ! needpass= gi.cvar("needpass", "0", CVAR_SERVERINFO); ! filterban= gi.cvar("filterban", "1", 0); ! g_select_empty= gi.cvar("g_select_empty", "0", CVAR_ARCHIVE); ! run_pitch= gi.cvar("run_pitch", "0.002", 0); ! run_roll= gi.cvar("run_roll", "0.005", 0); ! bob_up= gi.cvar("bob_up", "0.005", 0); ! bob_pitch= gi.cvar("bob_pitch", "0.002", 0); ! bob_roll= gi.cvar("bob_roll", "0.002", 0); // flood control ! flood_msgs= gi.cvar("flood_msgs", "4", 0); ! flood_persecond= gi.cvar("flood_persecond", "4", 0); ! flood_waitdelay= gi.cvar("flood_waitdelay", "10", 0); // dm map list ! sv_maplist= gi.cvar("sv_maplist", "", 0); // items InitItems(); ! game.helpmessage1= ""; ! game.helpmessage2= ""; // initialize all entities for this game ! game.maxentities= (int) maxentities.value; CreateEdicts(); ! // globals.edicts= g_edicts; ! // globals.max_edicts= game.maxentities; // initialize all clients for this game ! game.maxclients= (int) maxclients.value; CreateClients(); ! num_edicts= game.maxclients + 1; } /* ! ============ ! WriteGame ! This will be called whenever the game goes to a new level, ! and when the user explicitly saves the game. ! ! Game information include cross level data, like multi level ! triggers, help computer info, and all client states. ! ! A single player death will automatically restore from the ! last save position. ! ============ */ + public static void WriteGame(String filename, boolean autosave) { + try { + QuakeFile f; ! if (!autosave) ! SaveClientData(); ! f= new QuakeFile(filename, "rw"); ! if (f == null) ! gi.error("Couldn't write to " + filename); ! game.autosaved= autosave; ! game.write(f); ! game.autosaved= false; ! for (int i= 0; i < game.maxclients; i++) ! game.clients[i].write(f); ! fclose(f); ! } ! catch (Exception e) { ! e.printStackTrace(); ! } ! } ! public static void ReadGame(String filename) { ! QuakeFile f= null; ! try { + f= new QuakeFile(filename, "r"); CreateEdicts(); ! game.load(f); ! for (int i= 0; i < game.maxclients; i++) { ! game.clients[i]= new gclient_t(i); ! game.clients[i].read(f); } + f.close(); } catch (Exception e) { e.printStackTrace(); ! } ! } ! ! /* ! ================= ! WriteLevel ! ! ================= ! */ ! public static void WriteLevel(String filename) { try { + int i; + edict_t ent; + QuakeFile f; + + f= new QuakeFile(filename, "rw"); + if (f == null) + gi.error("Couldn't open for writing: " + filename); + + // write out level_locals_t + level.write(f); + + // write out all the entities + for (i= 0; i < num_edicts; i++) { + ent= g_edicts[i]; + if (!ent.inuse) + continue; + f.writeInt(i); + ent.write(f); + + } + + i= -1; + f.writeInt(-1); + f.close(); } ! catch (Exception e) { ! e.printStackTrace(); } } ! /* ! ================= ! ReadLevel ! ! SpawnEntities will allready have been called on the ! level the same way it was when the level was saved. ! ! That is necessary to get the baselines ! set up identically. ! ! The server will have cleared all of the world links before ! calling ReadLevel. ! ! No clients are connected yet. ! ================= ! */ ! public static void ReadLevel(String filename) { ! try { ! edict_t ent; ! ! QuakeFile f= new QuakeFile(filename, "r"); + if (f == null) + gi.error("Couldn't read level file " + filename); + + // wipe all the entities + Game.CreateEdicts(); + + num_edicts= (int) maxclients.value + 1; + + // load the level locals + level.read(f); + + // load all the entities + while (true) { + int entnum= f.readInt(); + if (entnum == -1) + break; + + if (entnum >= num_edicts) + num_edicts= entnum + 1; + + ent= g_edicts[entnum]; + ent.read(f); + ent.cleararealinks(); + gi.linkentity(ent); + } + + fclose(f); + + // mark all clients as unconnected + for (int i= 0; i < maxclients.value; i++) { + ent= g_edicts[i + 1]; + ent.client= game.clients[i]; + ent.client.pers.connected= false; + } + + // do any load time things at this point + for (int i= 0; i < num_edicts; i++) { + ent= g_edicts[i]; + + if (!ent.inuse) + continue; + + // fire any cross-level triggers + if (ent.classname != null) + if (strcmp(ent.classname, "target_crosslevel_target") == 0) + ent.nextthink= level.time + ent.delay; + } + } + catch (Exception e) { + e.printStackTrace(); + } + } } Index: client_respawn_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/client_respawn_t.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** client_respawn_t.java 8 Jul 2004 20:24:29 -0000 1.3 --- client_respawn_t.java 6 Sep 2004 19:39:15 -0000 1.3.2.1 *************** *** 25,41 **** import jake2.qcommon.Com; import jake2.util.Lib; import java.io.IOException; import java.nio.ByteBuffer; public class client_respawn_t ! // client data that stays across deathmatch respawns { ! client_persistant_t coop_respawn = new client_persistant_t(); // what to set client->pers to on a respawn ! int enterframe; // level.framenum the client entered the game ! int score; // frags, etc ! float cmd_angles[] = { 0, 0, 0 }; // angles sent over in the last command ! boolean spectator; // client is a spectator public void set(client_respawn_t from) { --- 25,56 ---- import jake2.qcommon.Com; import jake2.util.Lib; + import jake2.util.Math3D; + import jake2.util.QuakeFile; import java.io.IOException; + import java.io.RandomAccessFile; import java.nio.ByteBuffer; + /** Client data that stays across deathmatch respawns.*/ public class client_respawn_t ! { ! /** What to set client->pers to on a respawn */ ! protected client_persistant_t coop_respawn = new client_persistant_t(); ! ! /** Level.framenum the client entered the game. */ ! protected int enterframe; ! ! /** frags, etc. */ ! protected int score; ! ! /** angles sent over in the last command. */ ! protected float cmd_angles[] = { 0, 0, 0 }; ! ! /** client is a spectator. */ ! protected boolean spectator; + + /** Copies the client respawn data. */ public void set(client_respawn_t from) { *************** *** 43,51 **** enterframe = from.enterframe; score = from.score; ! cmd_angles = Lib.clone(from.cmd_angles); spectator = from.spectator; } ! //ok public void clear() { --- 58,66 ---- enterframe = from.enterframe; score = from.score; ! Math3D.VectorCopy(from.cmd_angles, cmd_angles); spectator = from.spectator; } ! /** Clears the client reaspawn informations. */ public void clear() { *************** *** 53,71 **** enterframe = 0; score = 0; ! cmd_angles = new float[3]; spectator = false; } ! public void load(ByteBuffer bb) throws IOException { ! coop_respawn.load(bb); ! enterframe = bb.getInt(); ! score = bb.getInt(); ! cmd_angles[0] = bb.getFloat(); ! cmd_angles[1] = bb.getFloat(); ! cmd_angles[2] = bb.getFloat(); ! spectator = bb.getInt() != 0; } public void dump() { --- 68,102 ---- enterframe = 0; score = 0; ! Math3D.VectorClear(cmd_angles); spectator = false; } ! /** Reads a client_respawn from a file. */ ! public void read(QuakeFile f) throws IOException { ! coop_respawn.read(f); ! enterframe = f.readInt(); ! score = f.readInt(); ! cmd_angles[0] = f.readFloat(); ! cmd_angles[1] = f.readFloat(); ! cmd_angles[2] = f.readFloat(); ! spectator = f.readInt() != 0; ! } ! ! /** Writes a client_respawn to a file. */ ! public void write(QuakeFile f) throws IOException ! { ! coop_respawn.write(f); ! f.writeInt(enterframe); ! f.writeInt(score); ! f.writeFloat(cmd_angles[0]); ! f.writeFloat(cmd_angles[1]); ! f.writeFloat(cmd_angles[2]); ! f.writeInt(spectator?1:0); } + + + /** Prints out a client_respawn_t to the quake console.*/ public void dump() { Index: GameSpawn.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSpawn.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 *** GameSpawn.java 9 Jul 2004 08:38:29 -0000 1.2.2.1 --- GameSpawn.java 6 Sep 2004 19:39:15 -0000 1.2.2.2 *************** *** 24,30 **** package jake2.game; ! import jake2.Defines; ! import jake2.util.*; ! import jake2.qcommon.*; public class GameSpawn extends GameSave { --- 24,29 ---- package jake2.game; ! import jake2.qcommon.Com; ! import jake2.util.Lib; public class GameSpawn extends GameSave { *************** *** 129,146 **** static String ED_NewString(String string) { ! //String newb, new_p; ! int i, l; ! ! l = string.length() + 1; ! //newb = gi.TagMalloc(l, TAG_LEVEL); ! StringBuffer newb = new StringBuffer(l); ! for (i = 0; i < l - 1; i++) { ! char c; ! ! c = string.charAt(i); if (c == '\\' && i < l - 1) { ! c = string.charAt(i++); if (c == 'n') newb.append('\n'); --- 128,138 ---- static String ED_NewString(String string) { ! int l = string.length(); StringBuffer newb = new StringBuffer(l); ! for (int i = 0; i < l; i++) { ! char c = string.charAt(i); if (c == '\\' && i < l - 1) { ! c = string.charAt(++i); if (c == 'n') newb.append('\n'); *************** *** 175,221 **** gi.dprintf("??? The key [" + key + "] is not a field\n"); - - - /** OLD CODE, delegated to ent.set(...) and st.set(...) - - for (f = fields; f.name; f++) { - if (!(f.flags & FFL_NOSPAWN) && !Q_stricmp(f.name, key)) { - // found it - if (f.flags & FFL_SPAWNTEMP) - b = (byte *) & st; - else - b = (byte *) ent; - - switch (f.type) { - case F_LSTRING : - * (String *) (b + f.ofs) = ED_NewString(value); - break; - case F_VECTOR : - sscanf(value, "%f %f %f", & vec[0], & vec[1], & vec[2]); - ((float *) (b + f.ofs))[0] = vec[0]; - ((float *) (b + f.ofs))[1] = vec[1]; - ((float *) (b + f.ofs))[2] = vec[2]; - break; - case F_INT : - * (int *) (b + f.ofs) = atoi(value); - break; - case F_FLOAT : - * (float *) (b + f.ofs) = atof(value); - break; - case F_ANGLEHACK : - v = atof(value); - ((float *) (b + f.ofs))[0] = 0; - ((float *) (b + f.ofs))[1] = v; - ((float *) (b + f.ofs))[2] = 0; - break; - case F_IGNORE : - break; - } - return; - } - } - gi.dprintf("%s is not a field\n", key); - - */ } --- 167,170 ---- *************** *** 293,297 **** c = 0; c2 = 0; ! for (i = 1; i < globals.num_edicts; i++) { e = g_edicts[i]; --- 242,246 ---- c = 0; c2 = 0; ! for (i = 1; i < num_edicts; i++) { e = g_edicts[i]; *************** *** 307,311 **** c2++; //Com.Printf("Team:" + e.team+" entity: " + e.index + "\n"); ! for (j = i + 1; j < globals.num_edicts; j++) { e2 = g_edicts[j]; if (!e2.inuse) --- 256,260 ---- c2++; //Com.Printf("Team:" + e.team+" entity: " + e.index + "\n"); ! for (j = i + 1; j < num_edicts; j++) { e2 = g_edicts[j]; if (!e2.inuse) *************** *** 337,341 **** */ ! static void SpawnEntities(String mapname, String entities, String spawnpoint) { edict_t ent; int inhibit; --- 286,290 ---- */ ! public static void SpawnEntities(String mapname, String entities, String spawnpoint) { edict_t ent; int inhibit; *************** *** 596,600 **** if (item.classname == null) continue; ! if (0 == Lib.stricmp(item.classname, ent.classname)) { // found it SpawnItem(ent, item); return; --- 545,549 ---- if (item.classname == null) continue; ! if (item.classname.equalsIgnoreCase(ent.classname)) { // found it SpawnItem(ent, item); return; *************** *** 603,607 **** for (i=0; (s = spawns[i]) !=null && s.name != null; i++) { ! if (0 == Lib.stricmp(s.name, ent.classname)) { // found it if (s.spawn == null) --- 552,556 ---- for (i=0; (s = spawns[i]) !=null && s.name != null; i++) { ! if (s.name.equalsIgnoreCase(ent.classname)) { // found it if (s.spawn == null) Index: GameMiscAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameMiscAdapters.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** GameMiscAdapters.java 8 Jul 2004 20:24:29 -0000 1.2 --- GameMiscAdapters.java 6 Sep 2004 19:39:15 -0000 1.2.2.1 *************** *** 30,34 **** import jake2.util.Math3D; ! import java.util.Date; public class GameMiscAdapters --- 30,34 ---- import jake2.util.Math3D; ! import java.util.Calendar; public class GameMiscAdapters *************** *** 879,884 **** else { ! Date d = new Date(); ! self.message = "" + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds(); /* --- 879,884 ---- else { ! Calendar c = Calendar.getInstance(); ! self.message = "" + c.get(Calendar.HOUR_OF_DAY) + ":" + c.get(Calendar.MINUTE) + ":" + c.get(Calendar.SECOND); /* Index: GameTriggerAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameTriggerAdapters.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** GameTriggerAdapters.java 8 Jul 2004 15:58:44 -0000 1.1 --- GameTriggerAdapters.java 6 Sep 2004 19:39:15 -0000 1.1.2.1 *************** *** 115,119 **** int index; - Com.p("trigger_key_use!"); if (self.item == null) return; --- 115,118 ---- *************** *** 225,229 **** static EntTouchAdapter trigger_push_touch = new EntTouchAdapter() { public void touch(edict_t self, edict_t other, cplane_t plane, csurface_t surf) { - Com.p("TRIGGER TOUCH!"); if (Lib.strcmp(other.classname, "grenade") == 0) { Math3D.VectorScale(self.movedir, self.speed * 10, other.velocity); --- 224,227 ---- --- game_export_t.java DELETED --- Index: GameFuncAdapters.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameFuncAdapters.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** GameFuncAdapters.java 8 Jul 2004 15:58:44 -0000 1.1 --- GameFuncAdapters.java 6 Sep 2004 19:39:15 -0000 1.1.2.1 *************** *** 31,36 **** import jake2.util.*; ! public class GameFuncAdapters ! { /* --- 31,35 ---- import jake2.util.*; ! public class GameFuncAdapters { [...2696 lines suppressed...] GameBase.gi.setmodel(ent, ent.model); ! ent.use = use_killbox; ! ent.svflags = Defines.SVF_NOCLIENT; return true; } --- 1623,1636 ---- Kills everything inside when fired, irrespective of protection. */ ! static EntUseAdapter use_killbox= new EntUseAdapter() { ! public void use(edict_t self, edict_t other, edict_t activator) { GameUtil.KillBox(self); } }; ! static EntThinkAdapter SP_func_killbox= new EntThinkAdapter() { ! public boolean think(edict_t ent) { GameBase.gi.setmodel(ent, ent.model); ! ent.use= use_killbox; ! ent.svflags= Defines.SVF_NOCLIENT; return true; } Index: pmove_state_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/pmove_state_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** pmove_state_t.java 7 Jul 2004 19:59:26 -0000 1.1.1.1 --- pmove_state_t.java 6 Sep 2004 19:39:15 -0000 1.1.1.1.2.1 *************** *** 27,30 **** --- 27,31 ---- import java.io.IOException; + import java.io.RandomAccessFile; import java.nio.ByteBuffer; *************** *** 40,49 **** public short origin[] = { 0, 0, 0 }; // 12.3 public short velocity[] = { 0, 0, 0 }; // 12.3 ! public byte pm_flags; // ducked, jump_held, etc ! public byte pm_time; // each unit = 8 ms public short gravity; ! public short delta_angles[] = { 0, 0, 0 }; // add to command angles to get view direction ! // changed by spawns, rotating objects, and teleporters ! private static pmove_state_t prototype = new pmove_state_t(); --- 41,53 ---- public short origin[] = { 0, 0, 0 }; // 12.3 public short velocity[] = { 0, 0, 0 }; // 12.3 ! /** ducked, jump_held, etc. */ ! public byte pm_flags; ! /** each unit = 8 ms. */ ! public byte pm_time; public short gravity; ! /** add to command angles to get view direction. */ ! public short delta_angles[] = { 0, 0, 0 }; ! /** changed by spawns, rotating objects, and teleporters.*/ ! private static pmove_state_t prototype = new pmove_state_t(); *************** *** 82,107 **** } ! public void load(ByteBuffer bb) throws IOException { ! pm_type = bb.getInt(); ! origin[0] = bb.getShort(); ! origin[1] = bb.getShort(); ! origin[2] = bb.getShort(); ! velocity[0] = bb.getShort(); ! velocity[1] = bb.getShort(); ! velocity[2] = bb.getShort(); ! pm_flags = bb.get(); ! pm_time = bb.get(); ! gravity = bb.getShort(); ! bb.getShort(); ! delta_angles[0] = bb.getShort(); ! delta_angles[1] = bb.getShort(); ! delta_angles[2] = bb.getShort(); } --- 86,136 ---- } ! /** Reads the playermove from the file.*/ ! public void load(RandomAccessFile f) throws IOException { ! pm_type = f.readInt(); ! origin[0] = f.readShort(); ! origin[1] = f.readShort(); ! origin[2] = f.readShort(); ! velocity[0] = f.readShort(); ! velocity[1] = f.readShort(); ! velocity[2] = f.readShort(); ! pm_flags = f.readByte(); ! pm_time = f.readByte(); ! gravity = f.readShort(); ! f.readShort(); ! delta_angles[0] = f.readShort(); ! delta_angles[1] = f.readShort(); ! delta_angles[2] = f.readShort(); ! ! } ! ! /** Writes the playermove to the file. */ ! public void write (RandomAccessFile f) throws IOException { ! ! f.writeInt(pm_type); ! ! f.writeShort(origin[0]); ! f.writeShort(origin[1]); ! f.writeShort(origin[2]); ! ! f.writeShort(velocity[0]); ! f.writeShort(velocity[1]); ! f.writeShort(velocity[2]); ! ! f.writeByte(pm_flags); ! f.writeByte(pm_time); ! f.writeShort(gravity); ! ! f.writeShort(0); + f.writeShort(delta_angles[0]); + f.writeShort(delta_angles[1]); + f.writeShort(delta_angles[2]); } *************** *** 125,130 **** Com.Println("delta-angle[2]: " + delta_angles[0]); } - - - } \ No newline at end of file --- 154,156 ---- Index: PlayerHud.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerHud.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 *** PlayerHud.java 9 Jul 2004 08:38:28 -0000 1.2.2.1 --- PlayerHud.java 6 Sep 2004 19:39:15 -0000 1.2.2.2 *************** *** 99,113 **** level.intermissiontime = level.time; ! ! // TODO: BIG HACK TO IGNORE CINEMATIC ! ! String xxx = targ.map; ! int pos = xxx.indexOf(".cin"); ! if (pos != -1) ! level.changemap = xxx.substring(pos + 5); // including "+" ! else ! level.changemap = xxx; ! // ------------------------ ! //level.changemap = targ.map; if (level.changemap.indexOf('*') > -1) { if (coop.value != 0) { --- 99,104 ---- level.intermissiontime = level.time; ! level.changemap = targ.map; ! if (level.changemap.indexOf('*') > -1) { if (coop.value != 0) { *************** *** 319,396 **** } - /* - ================== - HelpComputer - - Draw help computer. - ================== - */ - public static void HelpComputer(edict_t ent) { - //char string[1024]; - String string; - - String s... [truncated message content] |
From: Holger Z. <hz...@us...> - 2004-09-06 19:40:04
|
Update of /cvsroot/jake2/jake2/src/jake2/render/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/render/jogl Modified Files: Tag: r_0_9 Main.java Surf.java Misc.java Light.java Warp.java Base.java Model.java Draw.java Image.java Mesh.java Removed Files: Tag: r_0_9 Impl.java Log Message: merge changes for 0.9.3 Index: Image.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Image.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 *** Image.java 9 Jul 2004 08:38:26 -0000 1.2.2.1 --- Image.java 6 Sep 2004 19:39:17 -0000 1.2.2.2 *************** *** 27,32 **** --- 27,34 ---- import jake2.Defines; + import jake2.client.VID; import jake2.client.particle_t; import jake2.game.cvar_t; + import jake2.qcommon.*; import jake2.qcommon.longjmpException; import jake2.qcommon.qfiles; *************** *** 264,268 **** if (i == NUM_GL_MODES) { ! ri.Con_Printf(Defines.PRINT_ALL, "bad filter name: [" + string + "]\n"); return; } --- 266,270 ---- if (i == NUM_GL_MODES) { ! VID.Printf(Defines.PRINT_ALL, "bad filter name: [" + string + "]\n"); return; } *************** *** 298,302 **** if (i == NUM_GL_ALPHA_MODES) { ! ri.Con_Printf(Defines.PRINT_ALL, "bad alpha texture mode name: [" + string + "]\n"); return; } --- 300,304 ---- if (i == NUM_GL_ALPHA_MODES) { ! VID.Printf(Defines.PRINT_ALL, "bad alpha texture mode name: [" + string + "]\n"); return; } *************** *** 318,322 **** if (i == NUM_GL_SOLID_MODES) { ! ri.Con_Printf(Defines.PRINT_ALL, "bad solid texture mode name: [" + string + "]\n"); return; } --- 320,324 ---- if (i == NUM_GL_SOLID_MODES) { ! VID.Printf(Defines.PRINT_ALL, "bad solid texture mode name: [" + string + "]\n"); return; } *************** *** 336,340 **** final String[] palstrings = { "RGB", "PAL" }; ! ri.Con_Printf(Defines.PRINT_ALL, "------------------\n"); texels = 0; --- 338,342 ---- final String[] palstrings = { "RGB", "PAL" }; ! VID.Printf(Defines.PRINT_ALL, "------------------\n"); texels = 0; *************** *** 347,367 **** switch (image.type) { case it_skin : ! ri.Con_Printf(Defines.PRINT_ALL, "M"); break; case it_sprite : ! ri.Con_Printf(Defines.PRINT_ALL, "S"); break; case it_wall : ! ri.Con_Printf(Defines.PRINT_ALL, "W"); break; case it_pic : ! ri.Con_Printf(Defines.PRINT_ALL, "P"); break; default : ! ri.Con_Printf(Defines.PRINT_ALL, " "); break; } ! ri.Con_Printf( Defines.PRINT_ALL, " %3i %3i %s: %s\n", --- 349,369 ---- switch (image.type) { case it_skin : ! VID.Printf(Defines.PRINT_ALL, "M"); break; case it_sprite : ! VID.Printf(Defines.PRINT_ALL, "S"); break; case it_wall : ! VID.Printf(Defines.PRINT_ALL, "W"); break; case it_pic : ! VID.Printf(Defines.PRINT_ALL, "P"); break; default : ! VID.Printf(Defines.PRINT_ALL, " "); break; } ! VID.Printf( Defines.PRINT_ALL, " %3i %3i %s: %s\n", *************** *** 369,373 **** image.name)); } ! ri.Con_Printf(Defines.PRINT_ALL, "Total texel count (not counting mipmaps): " + texels + '\n'); } --- 371,375 ---- image.name)); } ! VID.Printf(Defines.PRINT_ALL, "Total texel count (not counting mipmaps): " + texels + '\n'); } *************** *** 465,472 **** // load the file // ! byte[] raw = ri.FS_LoadFile(filename); if (raw == null) { ! ri.Con_Printf(Defines.PRINT_DEVELOPER, "Bad pcx file " + filename + '\n'); return null; } --- 467,474 ---- // load the file // ! byte[] raw = FS.LoadFile(filename); if (raw == null) { ! VID.Printf(Defines.PRINT_DEVELOPER, "Bad pcx file " + filename + '\n'); return null; } *************** *** 484,488 **** || pcx.ymax >= 480) { ! ri.Con_Printf(Defines.PRINT_ALL, "Bad pcx file " + filename + '\n'); return null; } --- 486,490 ---- || pcx.ymax >= 480) { ! VID.Printf(Defines.PRINT_ALL, "Bad pcx file " + filename + '\n'); return null; } *************** *** 560,568 **** // load the file // ! raw = ri.FS_LoadFile (name); if (raw == null) { ! ri.Con_Printf(Defines.PRINT_DEVELOPER, "Bad tga file "+ name +'\n'); return null; } --- 562,570 ---- // load the file // ! raw = FS.LoadFile (name); if (raw == null) { ! VID.Printf(Defines.PRINT_DEVELOPER, "Bad tga file "+ name +'\n'); return null; } *************** *** 571,578 **** if (targa_header.image_type != 2 && targa_header.image_type != 10) ! ri.Sys_Error(Defines.ERR_DROP, "LoadTGA: Only type 2 and 10 targa RGB images supported\n"); if (targa_header.colormap_type != 0 || (targa_header.pixel_size != 32 && targa_header.pixel_size != 24)) ! ri.Sys_Error (Defines.ERR_DROP, "LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n"); columns = targa_header.width; --- 573,580 ---- if (targa_header.image_type != 2 && targa_header.image_type != 10) ! Com.Error(Defines.ERR_DROP, "LoadTGA: Only type 2 and 10 targa RGB images supported\n"); if (targa_header.colormap_type != 0 || (targa_header.pixel_size != 32 && targa_header.pixel_size != 24)) ! Com.Error (Defines.ERR_DROP, "LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n"); columns = targa_header.width; *************** *** 762,779 **** // else if (pos[off] != 255) fdc = pos[off]; // } ! // TODO check this: R_FloodFillSkin( byte[] skin, int skinwidth, int skinheight) void R_FloodFillSkin(byte[] skin, int skinwidth, int skinheight) { // byte fillcolor = *skin; // assume this is the pixel to fill int fillcolor = skin[0] & 0xff; - floodfill_t[] fifo = new floodfill_t[FLOODFILL_FIFO_SIZE]; int inpt = 0, outpt = 0; int filledcolor = -1; int i; - for (int j = 0; j < fifo.length; j++) { - fifo[j] = new floodfill_t(); - } - if (filledcolor == -1) { filledcolor = 0; --- 764,781 ---- // else if (pos[off] != 255) fdc = pos[off]; // } ! static floodfill_t[] fifo = new floodfill_t[FLOODFILL_FIFO_SIZE]; ! static { ! for (int j = 0; j < fifo.length; j++) { ! fifo[j] = new floodfill_t(); ! } ! } // TODO check this: R_FloodFillSkin( byte[] skin, int skinwidth, int skinheight) void R_FloodFillSkin(byte[] skin, int skinwidth, int skinheight) { // byte fillcolor = *skin; // assume this is the pixel to fill int fillcolor = skin[0] & 0xff; int inpt = 0, outpt = 0; int filledcolor = -1; int i; if (filledcolor == -1) { filledcolor = 0; *************** *** 1102,1106 **** if (scaled_width * scaled_height > 256 * 256) ! ri.Sys_Error(Defines.ERR_DROP, "GL_Upload32: too big"); // scan the texture for any non-255 alpha --- 1104,1108 ---- if (scaled_width * scaled_height > 256 * 256) ! Com.Error(Defines.ERR_DROP, "GL_Upload32: too big"); // scan the texture for any non-255 alpha *************** *** 1120,1124 **** comp = gl_tex_alpha_format; else { ! ri.Con_Printf(Defines.PRINT_ALL, "Unknown number of texture components " + samples + '\n'); comp = samples; } --- 1122,1126 ---- comp = gl_tex_alpha_format; else { ! VID.Printf(Defines.PRINT_ALL, "Unknown number of texture components " + samples + '\n'); comp = samples; } *************** *** 1263,1267 **** if (s > trans.length) ! ri.Sys_Error(Defines.ERR_DROP, "GL_Upload8: too large"); if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f && is_sky) { --- 1265,1269 ---- if (s > trans.length) ! Com.Error(Defines.ERR_DROP, "GL_Upload8: too large"); if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f && is_sky) { *************** *** 1330,1334 **** { if (numgltextures == MAX_GLTEXTURES) ! ri.Sys_Error (Defines.ERR_DROP, "MAX_GLTEXTURES"); numgltextures++; --- 1332,1336 ---- { if (numgltextures == MAX_GLTEXTURES) ! Com.Error (Defines.ERR_DROP, "MAX_GLTEXTURES"); numgltextures++; *************** *** 1337,1341 **** if (name.length() > Defines.MAX_QPATH) ! ri.Sys_Error(Defines.ERR_DROP, "Draw_LoadPic: \"" + name + "\" is too long"); image.name = name; --- 1339,1343 ---- if (name.length() > Defines.MAX_QPATH) ! Com.Error(Defines.ERR_DROP, "Draw_LoadPic: \"" + name + "\" is too long"); image.name = name; *************** *** 1453,1459 **** image_t image = null; ! byte[] raw = ri.FS_LoadFile(name); if (raw == null) { ! ri.Con_Printf(Defines.PRINT_ALL, "GL_FindImage: can't load " + name + '\n'); return r_notexture; } --- 1455,1461 ---- image_t image = null; ! byte[] raw = FS.LoadFile(name); if (raw == null) { ! VID.Printf(Defines.PRINT_ALL, "GL_FindImage: can't load " + name + '\n'); return r_notexture; } *************** *** 1487,1492 **** if (name == null || name.length() < 5) ! return null; // ri.Sys_Error (ERR_DROP, "GL_FindImage: NULL name"); ! // ri.Sys_Error (ERR_DROP, "GL_FindImage: bad name: %s", name); // look for it --- 1489,1494 ---- if (name == null || name.length() < 5) ! return null; // Com.Error (ERR_DROP, "GL_FindImage: NULL name"); ! // Com.Error (ERR_DROP, "GL_FindImage: bad name: %s", name); // look for it *************** *** 1596,1600 **** if (palette[0] == null || palette[0].length != 768) ! ri.Sys_Error(Defines.ERR_FATAL, "Couldn't load pics/colormap.pcx"); byte[] pal = palette[0]; --- 1598,1602 ---- if (palette[0] == null || palette[0].length != 768) ! Com.Error(Defines.ERR_FATAL, "Couldn't load pics/colormap.pcx"); byte[] pal = palette[0]; *************** *** 1626,1633 **** // init intensity conversions ! intensity = ri.Cvar_Get("intensity", "2", 0); if (intensity.value <= 1) ! ri.Cvar_Set("intensity", "1"); gl_state.inverse_intensity = 1 / intensity.value; --- 1628,1635 ---- // init intensity conversions ! intensity = Cvar.Get("intensity", "2", 0); if (intensity.value <= 1) ! Cvar.Set("intensity", "1"); gl_state.inverse_intensity = 1 / intensity.value; *************** *** 1636,1642 **** if (qglColorTableEXT) { ! gl_state.d_16to8table = ri.FS_LoadFile("pics/16to8.dat"); if (gl_state.d_16to8table == null) ! ri.Sys_Error(Defines.ERR_FATAL, "Couldn't load pics/16to8.pcx"); } --- 1638,1644 ---- if (qglColorTableEXT) { ! gl_state.d_16to8table = FS.LoadFile("pics/16to8.dat"); if (gl_state.d_16to8table == null) ! Com.Error(Defines.ERR_FATAL, "Couldn't load pics/16to8.pcx"); } Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Surf.java,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** Surf.java 9 Jul 2004 08:38:26 -0000 1.2.2.2 --- Surf.java 6 Sep 2004 19:39:16 -0000 1.2.2.3 *************** *** 29,32 **** --- 29,33 ---- import jake2.client.*; import jake2.game.cplane_t; + import jake2.qcommon.Com; import jake2.render.*; import jake2.util.Lib; *************** *** 425,429 **** if ( !LM_AllocBlock( smax, tmax, lightPos) ) { ! ri.Sys_Error( Defines.ERR_FATAL, "Consecutive calls to LM_AllocBlock(" + smax + "," + tmax + ") failed (dynamic)\n"); } --- 426,430 ---- if ( !LM_AllocBlock( smax, tmax, lightPos) ) { ! Com.Error( Defines.ERR_FATAL, "Consecutive calls to LM_AllocBlock(" + smax + "," + tmax + ") failed (dynamic)\n"); } *************** *** 1205,1209 **** { entity_t ent = new entity_t(); ! if (r_drawworld.value == 0) return; --- 1206,1213 ---- { 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; *************** *** 1216,1224 **** Math3D.VectorCopy(r_newrefdef.vieworg, modelorg); - // auto cycle the world frame for texture animation - // memset (&ent, 0, sizeof(ent)); - ent.frame = (int)(r_newrefdef.time*2); - currententity = ent; - gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; --- 1220,1223 ---- *************** *** 1408,1412 **** gl_lms.lightmap_buffer ); if ( ++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS ) ! ri.Sys_Error( Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n" ); --- 1407,1411 ---- gl_lms.lightmap_buffer ); if ( ++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS ) ! Com.Error( Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n" ); *************** *** 1559,1563 **** if ( !LM_AllocBlock( smax, tmax, lightPos ) ) { ! ri.Sys_Error( Defines.ERR_FATAL, "Consecutive calls to LM_AllocBlock(" + smax +"," + tmax +") failed\n"); } } --- 1558,1562 ---- if ( !LM_AllocBlock( smax, tmax, lightPos ) ) { ! Com.Error( Defines.ERR_FATAL, "Consecutive calls to LM_AllocBlock(" + smax +"," + tmax +") failed\n"); } } Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Light.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 *** Light.java 9 Jul 2004 08:38:26 -0000 1.3.2.1 --- Light.java 6 Sep 2004 19:39:16 -0000 1.3.2.2 *************** *** 32,35 **** --- 32,36 ---- import jake2.game.GameBase; import jake2.game.cplane_t; + import jake2.qcommon.Com; import jake2.qcommon.longjmpException; import jake2.render.*; *************** *** 231,239 **** int RecursiveLightPoint (mnode_t node, float[] start, float[] end) { ! float front, back, frac; ! boolean side; ! int sideIndex; ! cplane_t plane; ! float[] mid = {0, 0, 0}; msurface_t surf; int s, t, ds, dt; --- 232,238 ---- int RecursiveLightPoint (mnode_t node, float[] start, float[] end) { ! if (node.contents != -1) ! return -1; // didn't hit anything ! msurface_t surf; int s, t, ds, dt; *************** *** 242,263 **** ByteBuffer lightmap; int maps; ! int r; ! ! if (node.contents != -1) ! return -1; // didn't hit anything // calculate mid point // FIXME: optimize for axial ! plane = node.plane; ! front = Math3D.DotProduct (start, plane.normal) - plane.dist; ! back = Math3D.DotProduct (end, plane.normal) - plane.dist; ! side = (front < 0); ! sideIndex = (side) ? 1 : 0; if ( (back < 0) == side) return RecursiveLightPoint (node.children[sideIndex], start, end); ! frac = front / (front-back); mid[0] = start[0] + (end[0] - start[0])*frac; mid[1] = start[1] + (end[1] - start[1])*frac; --- 241,259 ---- ByteBuffer lightmap; int maps; ! float[] mid = {0, 0, 0}; // calculate mid point // FIXME: optimize for axial ! cplane_t plane = node.plane; ! float front = Math3D.DotProduct (start, plane.normal) - plane.dist; ! float back = Math3D.DotProduct (end, plane.normal) - plane.dist; ! boolean side = (front < 0); ! int sideIndex = (side) ? 1 : 0; if ( (back < 0) == side) return RecursiveLightPoint (node.children[sideIndex], start, end); ! float frac = front / (front-back); mid[0] = start[0] + (end[0] - start[0])*frac; mid[1] = start[1] + (end[1] - start[1])*frac; *************** *** 265,269 **** // go down front side ! r = RecursiveLightPoint (node.children[sideIndex], start, mid); if (r >= 0) return r; // hit something --- 261,265 ---- // go down front side ! int r = RecursiveLightPoint (node.children[sideIndex], start, mid); if (r >= 0) return r; // hit something *************** *** 277,280 **** --- 273,277 ---- int surfIndex = node.firstsurface; + float[] scale = {0, 0, 0}; for (i=0 ; i<node.numsurfaces ; i++, surfIndex++) { *************** *** 310,320 **** if (lightmap != null) { ! float[] scale = {0, 0, 0}; lightmapIndex += 3 * (dt * ((surf.extents[0] >> 4) + 1) + ds); for (maps = 0 ; maps < Defines.MAXLIGHTMAPS && surf.styles[maps] != (byte)255; maps++) { ! for (i=0 ; i<3 ; i++) ! scale[i] = gl_modulate.value * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[i]; pointcolor[0] += (lightmap.get(lightmapIndex + 0) & 0xFF) * scale[0] * (1.0f/255); --- 307,320 ---- if (lightmap != null) { ! //float[] scale = {0, 0, 0}; ! float[] rgb; lightmapIndex += 3 * (dt * ((surf.extents[0] >> 4) + 1) + ds); for (maps = 0 ; maps < Defines.MAXLIGHTMAPS && surf.styles[maps] != (byte)255; maps++) { ! rgb = r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb; ! scale[0] = gl_modulate.value * rgb[0]; ! scale[1] = gl_modulate.value * rgb[1]; ! scale[2] = gl_modulate.value * rgb[2]; pointcolor[0] += (lightmap.get(lightmapIndex + 0) & 0xFF) * scale[0] * (1.0f/255); *************** *** 326,329 **** --- 326,330 ---- return 1; } + // go down back side return RecursiveLightPoint (node.children[1 - sideIndex], mid, end); *************** *** 341,349 **** float[] end = {0, 0, 0}; - float r; - int lnum; dlight_t dl; - float light; - float[] dist = {0, 0, 0}; float add; --- 342,346 ---- *************** *** 358,362 **** end[2] = p[2] - 2048; ! r = RecursiveLightPoint(r_worldmodel.nodes[0], p, end); if (r == -1) --- 355,359 ---- end[2] = p[2] - 2048; ! float r = RecursiveLightPoint(r_worldmodel.nodes[0], p, end); if (r == -1) *************** *** 372,382 **** // add dynamic lights // ! light = 0; ! for (lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++) { dl = r_newrefdef.dlights[lnum]; ! Math3D.VectorSubtract (currententity.origin, dl.origin, dist); ! add = dl.intensity - Math3D.VectorLength(dist); add *= (1.0f/256); if (add > 0) --- 369,378 ---- // add dynamic lights // ! for (int lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++) { dl = r_newrefdef.dlights[lnum]; ! Math3D.VectorSubtract (currententity.origin, dl.origin, end); ! add = dl.intensity - Math3D.VectorLength(end); add *= (1.0f/256); if (add > 0) *************** *** 389,393 **** } - // =================================================================== --- 385,388 ---- *************** *** 510,514 **** if ( (surf.texinfo.flags & (Defines.SURF_SKY | Defines.SURF_TRANS33 | Defines.SURF_TRANS66 | Defines.SURF_WARP)) != 0 ) ! ri.Sys_Error(Defines.ERR_DROP, "R_BuildLightMap called for non-lit surface"); smax = (surf.extents[0] >> 4) + 1; --- 505,509 ---- if ( (surf.texinfo.flags & (Defines.SURF_SKY | Defines.SURF_TRANS33 | Defines.SURF_TRANS66 | Defines.SURF_WARP)) != 0 ) ! Com.Error(Defines.ERR_DROP, "R_BuildLightMap called for non-lit surface"); smax = (surf.extents[0] >> 4) + 1; *************** *** 516,520 **** size = smax * tmax; if (size > ((s_blocklights.length * Defines.SIZE_OF_FLOAT) >> 4) ) ! ri.Sys_Error(Defines.ERR_DROP, "Bad s_blocklights size"); try { --- 511,515 ---- size = smax * tmax; if (size > ((s_blocklights.length * Defines.SIZE_OF_FLOAT) >> 4) ) ! Com.Error(Defines.ERR_DROP, "Bad s_blocklights size"); try { --- Impl.java DELETED --- Index: Base.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Base.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** Base.java 7 Jul 2004 19:59:36 -0000 1.1.1.1 --- Base.java 6 Sep 2004 19:39:16 -0000 1.1.1.1.2.1 *************** *** 26,29 **** --- 26,30 ---- package jake2.render.jogl; + import jake2.render.JoglBase; import net.java.games.jogl.GL; *************** *** 33,37 **** * @author cwei */ ! public class Base { static final int GL_COLOR_INDEX8_EXT = GL.GL_COLOR_INDEX; --- 34,38 ---- * @author cwei */ ! public abstract class Base extends JoglBase { static final int GL_COLOR_INDEX8_EXT = GL.GL_COLOR_INDEX; *************** *** 76,85 **** // =================================================================== - // enum rserr_t - static final int rserr_ok = 0; - static final int rserr_invalid_fullscreen = 1; - static final int rserr_invalid_mode = 2; - static final int rserr_unknown = 3; - // // #include "gl_model.h" --- 77,80 ---- Index: Draw.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Draw.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 *** Draw.java 9 Jul 2004 08:38:26 -0000 1.2.2.1 --- Draw.java 6 Sep 2004 19:39:17 -0000 1.2.2.2 *************** *** 27,31 **** import jake2.Defines; ! import jake2.Globals; import jake2.render.image_t; --- 27,32 ---- import jake2.Defines; ! import jake2.client.VID; ! import jake2.qcommon.Com; import jake2.render.image_t; *************** *** 33,37 **** import net.java.games.jogl.GL; - import net.java.games.jogl.util.GLUT; /** --- 34,37 ---- *************** *** 139,143 **** if (image == null) { ! ri.Con_Printf (Defines.PRINT_ALL, "Can't find pic: " + pic +'\n'); return; } --- 139,143 ---- if (image == null) { ! VID.Printf (Defines.PRINT_ALL, "Can't find pic: " + pic +'\n'); return; } *************** *** 178,182 **** if (image == null) { ! ri.Con_Printf(Defines.PRINT_ALL, "Can't find pic: " +pic + '\n'); return; } --- 178,182 ---- if (image == null) { ! VID.Printf(Defines.PRINT_ALL, "Can't find pic: " +pic + '\n'); return; } *************** *** 218,222 **** if (image == null) { ! ri.Con_Printf(Defines.PRINT_ALL, "Can't find pic: " + pic + '\n'); return; } --- 218,222 ---- if (image == null) { ! VID.Printf(Defines.PRINT_ALL, "Can't find pic: " + pic + '\n'); return; } *************** *** 252,256 **** if ( colorIndex > 255) ! ri.Sys_Error(Defines.ERR_FATAL, "Draw_Fill: bad color"); gl.glDisable(GL.GL_TEXTURE_2D); --- 252,256 ---- if ( colorIndex > 255) ! Com.Error(Defines.ERR_FATAL, "Draw_Fill: bad color"); gl.glDisable(GL.GL_TEXTURE_2D); Index: Model.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Model.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** Model.java 7 Jul 2004 19:59:42 -0000 1.1.1.1 --- Model.java 6 Sep 2004 19:39:16 -0000 1.1.1.1.2.1 *************** *** 26,51 **** package jake2.render.jogl; - import java.nio.ByteBuffer; - import java.nio.ByteOrder; - import java.util.Arrays; - import java.util.Vector; - import jake2.Defines; import jake2.game.cplane_t; import jake2.game.cvar_t; ! import jake2.qcommon.lump_t; ! import jake2.qcommon.qfiles; ! import jake2.qcommon.texinfo_t; ! import jake2.render.medge_t; ! import jake2.render.mleaf_t; ! import jake2.render.mmodel_t; ! import jake2.render.mnode_t; ! import jake2.render.model_t; ! import jake2.render.msurface_t; ! import jake2.render.mtexinfo_t; ! import jake2.render.mvertex_t; import jake2.util.Math3D; import jake2.util.Vargs; /** * Model --- 26,42 ---- package jake2.render.jogl; import jake2.Defines; + import jake2.client.VID; import jake2.game.cplane_t; import jake2.game.cvar_t; ! import jake2.qcommon.*; ! import jake2.render.*; import jake2.util.Math3D; import jake2.util.Vargs; + import java.nio.ByteBuffer; + import java.nio.ByteOrder; + import java.util.Arrays; + /** * Model *************** *** 83,87 **** if (model == null || model.nodes == null) ! ri.Sys_Error (Defines.ERR_DROP, "Mod_PointInLeaf: bad model"); node = model.nodes[0]; // root node --- 74,78 ---- if (model == null || model.nodes == null) ! Com.Error (Defines.ERR_DROP, "Mod_PointInLeaf: bad model"); node = model.nodes[0]; // root node *************** *** 180,184 **** total = 0; ! ri.Con_Printf(Defines.PRINT_ALL,"Loaded models:\n"); for (i=0; i < mod_numknown ; i++) { --- 171,175 ---- total = 0; ! VID.Printf(Defines.PRINT_ALL,"Loaded models:\n"); for (i=0; i < mod_numknown ; i++) { *************** *** 187,194 **** continue; ! ri.Con_Printf (Defines.PRINT_ALL, "%8i : %s\n", new Vargs(2).add(mod.extradatasize).add(mod.name)); total += mod.extradatasize; } ! ri.Con_Printf (Defines.PRINT_ALL, "Total resident: " + total +'\n'); } --- 178,185 ---- continue; ! VID.Printf (Defines.PRINT_ALL, "%8i : %s\n", new Vargs(2).add(mod.extradatasize).add(mod.name)); total += mod.extradatasize; } ! VID.Printf (Defines.PRINT_ALL, "Total resident: " + total +'\n'); } *************** *** 222,226 **** if (name == null || name.length() == 0) ! ri.Sys_Error(Defines.ERR_DROP, "Mod_ForName: NULL name"); // --- 213,217 ---- if (name == null || name.length() == 0) ! Com.Error(Defines.ERR_DROP, "Mod_ForName: NULL name"); // *************** *** 231,235 **** i = Integer.parseInt(name.substring(1)); if (i < 1 || r_worldmodel == null || i >= r_worldmodel.numsubmodels) ! ri.Sys_Error (Defines.ERR_DROP, "bad inline model number"); return mod_inline[i]; } --- 222,226 ---- i = Integer.parseInt(name.substring(1)); if (i < 1 || r_worldmodel == null || i >= r_worldmodel.numsubmodels) ! Com.Error (Defines.ERR_DROP, "bad inline model number"); return mod_inline[i]; } *************** *** 261,265 **** { if (mod_numknown == MAX_MOD_KNOWN) ! ri.Sys_Error (Defines.ERR_DROP, "mod_numknown == MAX_MOD_KNOWN"); mod_numknown++; mod = mod_known[i]; --- 252,256 ---- { if (mod_numknown == MAX_MOD_KNOWN) ! Com.Error (Defines.ERR_DROP, "mod_numknown == MAX_MOD_KNOWN"); mod_numknown++; mod = mod_known[i]; *************** *** 271,280 **** // load the file // ! fileBuffer = ri.FS_LoadFile(name); if (fileBuffer == null) { if (crash) ! ri.Sys_Error(Defines.ERR_DROP, "Mod_NumForName: " + mod.name + " not found"); mod.name = ""; --- 262,271 ---- // load the file // ! fileBuffer = FS.LoadFile(name); if (fileBuffer == null) { if (crash) ! Com.Error(Defines.ERR_DROP, "Mod_NumForName: " + mod.name + " not found"); mod.name = ""; *************** *** 311,315 **** break; default: ! ri.Sys_Error(Defines.ERR_DROP,"Mod_NumForName: unknown fileid for " + mod.name); break; } --- 302,306 ---- break; default: ! Com.Error(Defines.ERR_DROP,"Mod_NumForName: unknown fileid for " + mod.name); break; } *************** *** 393,397 **** if ( (l.filelen % mvertex_t.DISK_SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / mvertex_t.DISK_SIZE; --- 384,388 ---- if ( (l.filelen % mvertex_t.DISK_SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / mvertex_t.DISK_SIZE; *************** *** 440,444 **** if ((l.filelen % qfiles.dmodel_t.SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dmodel_t.SIZE; --- 431,435 ---- if ((l.filelen % qfiles.dmodel_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dmodel_t.SIZE; *************** *** 480,484 **** if ( (l.filelen % medge_t.DISK_SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / medge_t.DISK_SIZE; --- 471,475 ---- if ( (l.filelen % medge_t.DISK_SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / medge_t.DISK_SIZE; *************** *** 513,521 **** if ((l.filelen % texinfo_t.SIZE) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / texinfo_t.SIZE; // out = Hunk_Alloc ( count*sizeof(*out)); out = new mtexinfo_t[count]; loadmodel.texinfo = out; --- 504,515 ---- if ((l.filelen % texinfo_t.SIZE) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / texinfo_t.SIZE; // out = Hunk_Alloc ( count*sizeof(*out)); out = new mtexinfo_t[count]; + for ( i=0 ; i<count ; i++) { + out[i] = new mtexinfo_t(); + } loadmodel.texinfo = out; *************** *** 525,535 **** bb.order(ByteOrder.LITTLE_ENDIAN); ! for ( i=0 ; i<count ; i++) ! { ! in = new texinfo_t(bb); ! out[i] = new mtexinfo_t(); ! //for (j=0 ; j<8 ; j++) ! out[i].vecs = in.vecs; out[i].flags = in.flags; next = in.nexttexinfo; --- 519,526 ---- bb.order(ByteOrder.LITTLE_ENDIAN); ! for ( i=0 ; i<count ; i++) { + in = new texinfo_t(bb); + out[i].vecs = in.vecs; out[i].flags = in.flags; next = in.nexttexinfo; *************** *** 542,548 **** out[i].image = GL_FindImage(name, it_wall); ! if (out[i].image == null) ! { ! ri.Con_Printf(Defines.PRINT_ALL, "Couldn't load " + name + '\n'); out[i].image = r_notexture; } --- 533,538 ---- out[i].image = GL_FindImage(name, it_wall); ! if (out[i].image == null) { ! VID.Printf(Defines.PRINT_ALL, "Couldn't load " + name + '\n'); out[i].image = r_notexture; } *************** *** 550,556 **** // count animation frames ! for (i=0 ; i<count ; i++) ! { ! // out = &loadmodel.texinfo[i]; out[i].numframes = 1; for (step = out[i].next ; (step != null) && (step != out[i]) ; step=step.next) --- 540,544 ---- // count animation frames ! for (i=0 ; i<count ; i++) { out[i].numframes = 1; for (step = out[i].next ; (step != null) && (step != out[i]) ; step=step.next) *************** *** 572,578 **** float val; ! int i, j, e; mvertex_t v; - mtexinfo_t tex; int[] bmins = {0, 0}; int[] bmaxs = {0, 0}; --- 560,565 ---- float val; ! int j, e; mvertex_t v; int[] bmins = {0, 0}; int[] bmaxs = {0, 0}; *************** *** 581,587 **** maxs[0] = maxs[1] = -99999; ! tex = s.texinfo; ! for (i=0 ; i<s.numedges ; i++) { e = loadmodel.surfedges[s.firstedge+i]; --- 568,574 ---- maxs[0] = maxs[1] = -99999; ! mtexinfo_t tex = s.texinfo; ! for (int i=0 ; i<s.numedges ; i++) { e = loadmodel.surfedges[s.firstedge+i]; *************** *** 604,608 **** } ! for (i=0 ; i<2 ; i++) { bmins[i] = (int)Math.floor(mins[i]/16); --- 591,595 ---- } ! for (int i=0 ; i<2 ; i++) { bmins[i] = (int)Math.floor(mins[i]/16); *************** *** 629,633 **** if ((l.filelen % qfiles.dface_t.SIZE) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dface_t.SIZE; --- 616,620 ---- if ((l.filelen % qfiles.dface_t.SIZE) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dface_t.SIZE; *************** *** 663,667 **** ti = in.texinfo; if (ti < 0 || ti >= loadmodel.numtexinfo) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: bad texinfo number"); out[surfnum].texinfo = loadmodel.texinfo[ti]; --- 650,654 ---- ti = in.texinfo; if (ti < 0 || ti >= loadmodel.numtexinfo) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: bad texinfo number"); out[surfnum].texinfo = loadmodel.texinfo[ti]; *************** *** 735,739 **** if ((l.filelen % qfiles.dnode_t.SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dnode_t.SIZE; --- 722,726 ---- if ((l.filelen % qfiles.dnode_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dnode_t.SIZE; *************** *** 792,796 **** if ((l.filelen % qfiles.dleaf_t.SIZE) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dleaf_t.SIZE; --- 779,783 ---- if ((l.filelen % qfiles.dleaf_t.SIZE) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dleaf_t.SIZE; *************** *** 837,841 **** if ((l.filelen % Defines.SIZE_OF_SHORT) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_SHORT; // out = Hunk_Alloc ( count*sizeof(*out)); --- 824,828 ---- if ((l.filelen % Defines.SIZE_OF_SHORT) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_SHORT; // out = Hunk_Alloc ( count*sizeof(*out)); *************** *** 852,856 **** j = bb.getShort(); if (j < 0 || j >= loadmodel.numsurfaces) ! ri.Sys_Error(Defines.ERR_DROP, "Mod_ParseMarksurfaces: bad surface number"); out[i] = loadmodel.surfaces[j]; --- 839,843 ---- j = bb.getShort(); if (j < 0 || j >= loadmodel.numsurfaces) ! Com.Error(Defines.ERR_DROP, "Mod_ParseMarksurfaces: bad surface number"); out[i] = loadmodel.surfaces[j]; *************** *** 870,878 **** if ( (l.filelen % Defines.SIZE_OF_INT) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_INT; if (count < 1 || count >= Defines.MAX_MAP_SURFEDGES) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: bad surfedges count in " + loadmodel.name + ": " + count); offsets = new int[count]; --- 857,865 ---- if ( (l.filelen % Defines.SIZE_OF_INT) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_INT; if (count < 1 || count >= Defines.MAX_MAP_SURFEDGES) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: bad surfedges count in " + loadmodel.name + ": " + count); offsets = new int[count]; *************** *** 902,906 **** if ((l.filelen % qfiles.dplane_t.SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dplane_t.SIZE; --- 889,893 ---- if ((l.filelen % qfiles.dplane_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dplane_t.SIZE; *************** *** 945,949 **** loadmodel.type = mod_brush; if (loadmodel != mod_known[0]) ! ri.Sys_Error(Defines.ERR_DROP, "Loaded a brush model after the world"); header = new qfiles.dheader_t(buffer); --- 932,936 ---- loadmodel.type = mod_brush; if (loadmodel != mod_known[0]) ! Com.Error(Defines.ERR_DROP, "Loaded a brush model after the world"); header = new qfiles.dheader_t(buffer); *************** *** 951,955 **** i = header.version; if (i != Defines.BSPVERSION) ! ri.Sys_Error (Defines.ERR_DROP, "Mod_LoadBrushModel: " + mod.name + " has wrong version number (" + i + " should be " + Defines.BSPVERSION + ")"); mod_base = fileBuffer; //(byte *)header; --- 938,942 ---- i = header.version; if (i != Defines.BSPVERSION) ! Com.Error (Defines.ERR_DROP, "Mod_LoadBrushModel: " + mod.name + " has wrong version number (" + i + " should be " + Defines.BSPVERSION + ")"); mod_base = fileBuffer; //(byte *)header; *************** *** 985,989 **** starmod.firstnode = bm.headnode; if (starmod.firstnode >= loadmodel.numnodes) ! ri.Sys_Error(Defines.ERR_DROP, "Inline model " + i + " has bad firstnode"); Math3D.VectorCopy(bm.maxs, starmod.maxs); --- 972,976 ---- starmod.firstnode = bm.headnode; if (starmod.firstnode >= loadmodel.numnodes) ! Com.Error(Defines.ERR_DROP, "Inline model " + i + " has bad firstnode"); Math3D.VectorCopy(bm.maxs, starmod.maxs); *************** *** 1023,1046 **** if (pheader.version != qfiles.ALIAS_VERSION) ! ri.Sys_Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(pheader.version).add(qfiles.ALIAS_VERSION)); if (pheader.skinheight > MAX_LBM_HEIGHT) ! ri.Sys_Error(Defines.ERR_DROP, "model "+ mod.name +" has a skin taller than " + MAX_LBM_HEIGHT); if (pheader.num_xyz <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no vertices"); if (pheader.num_xyz > qfiles.MAX_VERTS) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name +" has too many vertices"); if (pheader.num_st <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no st vertices"); if (pheader.num_tris <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no triangles"); if (pheader.num_frames <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no frames"); // --- 1010,1033 ---- if (pheader.version != qfiles.ALIAS_VERSION) ! Com.Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(pheader.version).add(qfiles.ALIAS_VERSION)); if (pheader.skinheight > MAX_LBM_HEIGHT) ! Com.Error(Defines.ERR_DROP, "model "+ mod.name +" has a skin taller than " + MAX_LBM_HEIGHT); if (pheader.num_xyz <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no vertices"); if (pheader.num_xyz > qfiles.MAX_VERTS) ! Com.Error(Defines.ERR_DROP, "model " + mod.name +" has too many vertices"); if (pheader.num_st <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no st vertices"); if (pheader.num_tris <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no triangles"); if (pheader.num_frames <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no frames"); // *************** *** 1135,1143 **** if (sprout.version != qfiles.SPRITE_VERSION) ! ri.Sys_Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(sprout.version).add(qfiles.SPRITE_VERSION)); if (sprout.numframes > qfiles.MAX_MD2SKINS) ! ri.Sys_Error(Defines.ERR_DROP, "%s has too many frames (%i > %i)", new Vargs(3).add(mod.name).add(sprout.numframes).add(qfiles.MAX_MD2SKINS)); --- 1122,1130 ---- if (sprout.version != qfiles.SPRITE_VERSION) ! Com.Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(sprout.version).add(qfiles.SPRITE_VERSION)); if (sprout.numframes > qfiles.MAX_MD2SKINS) ! Com.Error(Defines.ERR_DROP, "%s has too many frames (%i > %i)", new Vargs(3).add(mod.name).add(sprout.numframes).add(qfiles.MAX_MD2SKINS)); *************** *** 1171,1175 **** // explicitly free the old map if different // this guarantees that mod_known[0] is the world map ! flushmap = ri.Cvar_Get("flushmap", "0", 0); if ( !mod_known[0].name.equals(fullname) || flushmap.value != 0.0f) Mod_Free(mod_known[0]); --- 1158,1162 ---- // explicitly free the old map if different // this guarantees that mod_known[0] is the world map ! flushmap = Cvar.Get("flushmap", "0", 0); if ( !mod_known[0].name.equals(fullname) || flushmap.value != 0.0f) Mod_Free(mod_known[0]); Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Main.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 *** Main.java 9 Jul 2004 08:38:26 -0000 1.2.2.1 --- Main.java 6 Sep 2004 19:39:16 -0000 1.2.2.2 *************** *** 26,36 **** package jake2.render.jogl; ! import jake2.*; import jake2.client.*; import jake2.game.cplane_t; import jake2.game.cvar_t; ! import jake2.qcommon.Cvar; ! import jake2.qcommon.qfiles; ! import jake2.qcommon.xcommand_t; import jake2.render.*; import jake2.util.Math3D; --- 26,36 ---- package jake2.render.jogl; ! import jake2.Defines; ! import jake2.Globals; import jake2.client.*; + import jake2.game.*; import jake2.game.cplane_t; import jake2.game.cvar_t; ! import jake2.qcommon.*; import jake2.render.*; import jake2.util.Math3D; *************** *** 42,48 **** import net.java.games.jogl.GL; - import net.java.games.jogl.GLU; - import net.java.games.jogl.util.BufferUtils; - import net.java.games.jogl.util.GLUT; /** --- 42,45 ---- *************** *** 53,60 **** public abstract class Main extends Base { - GL gl; - GLU glu; - GLUT glut = new GLUT(); - public static int[] d_8to24table = new int[256]; --- 50,53 ---- *************** *** 87,99 **** abstract mleaf_t Mod_PointInLeaf(float[] point, model_t model); - abstract boolean QGL_Init(String dll_name); - abstract void QGL_Shutdown(); - abstract boolean GLimp_Init(int xpos, int ypos); - abstract void GLimp_BeginFrame(float camera_separation); - abstract int GLimp_SetMode(Dimension dim, int mode, boolean fullscreen); - abstract void GLimp_Shutdown(); - abstract void GLimp_EnableLogging(boolean enable); - abstract void GLimp_LogNewFrame(); - abstract void GL_SetDefaultState(); --- 80,83 ---- *************** *** 129,140 **** */ - // IMPORTED FUNCTIONS - protected refimport_t ri = null; - int GL_TEXTURE0 = GL.GL_TEXTURE0; int GL_TEXTURE1 = GL.GL_TEXTURE1; - viddef_t vid = new viddef_t(); - model_t r_worldmodel; --- 113,119 ---- *************** *** 239,243 **** cvar_t gl_3dlabs_broken; - cvar_t vid_fullscreen; cvar_t vid_gamma; cvar_t vid_ref; --- 218,221 ---- *************** *** 443,447 **** break; default : ! ri.Sys_Error(Defines.ERR_DROP, "Bad modeltype"); break; } --- 421,425 ---- break; default : ! Com.Error(Defines.ERR_DROP, "Bad modeltype"); break; } *************** *** 477,481 **** break; default : ! ri.Sys_Error(Defines.ERR_DROP, "Bad modeltype"); break; } --- 455,459 ---- break; default : ! Com.Error(Defines.ERR_DROP, "Bad modeltype"); break; } *************** *** 849,857 **** // included by cwei if (r_newrefdef == null) { ! ri.Sys_Error(Defines.ERR_DROP, "R_RenderView: refdef_t fd is null"); } if (r_worldmodel == null && (r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) == 0) ! ri.Sys_Error(Defines.ERR_DROP, "R_RenderView: NULL worldmodel"); if (r_speeds.value != 0.0f) { --- 827,835 ---- // included by cwei if (r_newrefdef == null) { ! Com.Error(Defines.ERR_DROP, "R_RenderView: refdef_t fd is null"); } if (r_worldmodel == null && (r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) == 0) ! Com.Error(Defines.ERR_DROP, "R_RenderView: NULL worldmodel"); if (r_speeds.value != 0.0f) { *************** *** 886,890 **** if (r_speeds.value != 0.0f) { ! ri.Con_Printf( Defines.PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n", --- 864,868 ---- if (r_speeds.value != 0.0f) { ! VID.Printf( Defines.PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n", *************** *** 953,1024 **** protected void R_Register() { ! r_lefthand = ri.Cvar_Get("hand", "0", Globals.CVAR_USERINFO | Globals.CVAR_ARCHIVE); ! r_norefresh = ri.Cvar_Get("r_norefresh", "0", 0); ! r_fullbright = ri.Cvar_Get("r_fullbright", "0", 0); ! r_drawentities = ri.Cvar_Get("r_drawentities", "1", 0); ! r_drawworld = ri.Cvar_Get("r_drawworld", "1", 0); ! r_novis = ri.Cvar_Get("r_novis", "0", 0); ! r_nocull = ri.Cvar_Get("r_nocull", "0", 0); ! r_lerpmodels = ri.Cvar_Get("r_lerpmodels", "1", 0); ! r_speeds = ri.Cvar_Get("r_speeds", "0", 0); ! r_lightlevel = ri.Cvar_Get("r_lightlevel", "1", 0); ! gl_nosubimage = ri.Cvar_Get("gl_nosubimage", "0", 0); ! gl_allow_software = ri.Cvar_Get("gl_allow_software", "0", 0); ! gl_particle_min_size = ri.Cvar_Get("gl_particle_min_size", "2", Globals.CVAR_ARCHIVE); ! gl_particle_max_size = ri.Cvar_Get("gl_particle_max_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_size = ri.Cvar_Get("gl_particle_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_att_a = ri.Cvar_Get("gl_particle_att_a", "0.01", Globals.CVAR_ARCHIVE); ! gl_particle_att_b = ri.Cvar_Get("gl_particle_att_b", "0.0", Globals.CVAR_ARCHIVE); ! gl_particle_att_c = ri.Cvar_Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = ri.Cvar_Get("gl_modulate", "1", Globals.CVAR_ARCHIVE); ! gl_log = ri.Cvar_Get("gl_log", "0", 0); ! gl_bitdepth = ri.Cvar_Get("gl_bitdepth", "0", 0); ! gl_mode = ri.Cvar_Get("gl_mode", "1", Globals.CVAR_ARCHIVE); ! gl_lightmap = ri.Cvar_Get("gl_lightmap", "0", 0); ! gl_shadows = ri.Cvar_Get("gl_shadows", "0", Globals.CVAR_ARCHIVE); ! gl_dynamic = ri.Cvar_Get("gl_dynamic", "1", 0); ! gl_nobind = ri.Cvar_Get("gl_nobind", "0", 0); ! gl_round_down = ri.Cvar_Get("gl_round_down", "1", 0); ! gl_picmip = ri.Cvar_Get("gl_picmip", "0", 0); ! gl_skymip = ri.Cvar_Get("gl_skymip", "0", 0); ! gl_showtris = ri.Cvar_Get("gl_showtris", "0", 0); ! gl_ztrick = ri.Cvar_Get("gl_ztrick", "0", 0); ! gl_finish = ri.Cvar_Get("gl_finish", "0", Globals.CVAR_ARCHIVE); ! gl_clear = ri.Cvar_Get("gl_clear", "0", 0); ! gl_cull = ri.Cvar_Get("gl_cull", "1", 0); ! gl_polyblend = ri.Cvar_Get("gl_polyblend", "1", 0); ! gl_flashblend = ri.Cvar_Get("gl_flashblend", "0", 0); ! gl_playermip = ri.Cvar_Get("gl_playermip", "0", 0); ! gl_monolightmap = ri.Cvar_Get("gl_monolightmap", "0", 0); ! gl_driver = ri.Cvar_Get("gl_driver", "opengl32", Globals.CVAR_ARCHIVE); ! gl_texturemode = ri.Cvar_Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", Globals.CVAR_ARCHIVE); ! gl_texturealphamode = ri.Cvar_Get("gl_texturealphamode", "default", Globals.CVAR_ARCHIVE); ! gl_texturesolidmode = ri.Cvar_Get("gl_texturesolidmode", "default", Globals.CVAR_ARCHIVE); ! gl_lockpvs = ri.Cvar_Get("gl_lockpvs", "0", 0); ! gl_vertex_arrays = ri.Cvar_Get("gl_vertex_arrays", "0", Globals.CVAR_ARCHIVE); ! gl_ext_swapinterval = ri.Cvar_Get("gl_ext_swapinterval", "1", Globals.CVAR_ARCHIVE); ! gl_ext_palettedtexture = ri.Cvar_Get("gl_ext_palettedtexture", "0", Globals.CVAR_ARCHIVE); ! gl_ext_multitexture = ri.Cvar_Get("gl_ext_multitexture", "1", Globals.CVAR_ARCHIVE); ! gl_ext_pointparameters = ri.Cvar_Get("gl_ext_pointparameters", "1", Globals.CVAR_ARCHIVE); ! gl_ext_compiled_vertex_array = ri.Cvar_Get("gl_ext_compiled_vertex_array", "1", Globals.CVAR_ARCHIVE); ! gl_drawbuffer = ri.Cvar_Get("gl_drawbuffer", "GL_BACK", 0); ! gl_swapinterval = ri.Cvar_Get("gl_swapinterval", "1", Globals.CVAR_ARCHIVE); ! gl_saturatelighting = ri.Cvar_Get("gl_saturatelighting", "0", 0); ! gl_3dlabs_broken = ri.Cvar_Get("gl_3dlabs_broken", "1", Globals.CVAR_ARCHIVE); ! vid_fullscreen = ri.Cvar_Get("vid_fullscreen", "0", Globals.CVAR_ARCHIVE); ! vid_gamma = ri.Cvar_Get("vid_gamma", "1.0", Globals.CVAR_ARCHIVE); ! vid_ref = ri.Cvar_Get("vid_ref", "jogl", Globals.CVAR_ARCHIVE); ! ri.Cmd_AddCommand("imagelist", new xcommand_t() { public void execute() { GL_ImageList_f(); --- 931,1002 ---- protected void R_Register() { ! r_lefthand = Cvar.Get("hand", "0", Globals.CVAR_USERINFO | Globals.CVAR_ARCHIVE); ! r_norefresh = Cvar.Get("r_norefresh", "0", 0); ! r_fullbright = Cvar.Get("r_fullbright", "0", 0); ! r_drawentities = Cvar.Get("r_drawentities", "1", 0); ! r_drawworld = Cvar.Get("r_drawworld", "1", 0); ! r_novis = Cvar.Get("r_novis", "0", 0); ! r_nocull = Cvar.Get("r_nocull", "0", 0); ! r_lerpmodels = Cvar.Get("r_lerpmodels", "1", 0); ! r_speeds = Cvar.Get("r_speeds", "0", 0); ! r_lightlevel = Cvar.Get("r_lightlevel", "1", 0); ! gl_nosubimage = Cvar.Get("gl_nosubimage", "0", 0); ! gl_allow_software = Cvar.Get("gl_allow_software", "0", 0); ! gl_particle_min_size = Cvar.Get("gl_particle_min_size", "2", Globals.CVAR_ARCHIVE); ! gl_particle_max_size = Cvar.Get("gl_particle_max_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_size = Cvar.Get("gl_particle_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_att_a = Cvar.Get("gl_particle_att_a", "0.01", Globals.CVAR_ARCHIVE); ! gl_particle_att_b = Cvar.Get("gl_particle_att_b", "0.0", Globals.CVAR_ARCHIVE); ! gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = Cvar.Get("gl_modulate", "1", Globals.CVAR_ARCHIVE); ! gl_log = Cvar.Get("gl_log", "0", 0); ! gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0); ! gl_mode = Cvar.Get("gl_mode", "1", Globals.CVAR_ARCHIVE); ! gl_lightmap = Cvar.Get("gl_lightmap", "0", 0); ! gl_shadows = Cvar.Get("gl_shadows", "0", Globals.CVAR_ARCHIVE); ! gl_dynamic = Cvar.Get("gl_dynamic", "1", 0); ! gl_nobind = Cvar.Get("gl_nobind", "0", 0); ! gl_round_down = Cvar.Get("gl_round_down", "1", 0); ! gl_picmip = Cvar.Get("gl_picmip", "0", 0); ! gl_skymip = Cvar.Get("gl_skymip", "0", 0); ! gl_showtris = Cvar.Get("gl_showtris", "0", 0); ! gl_ztrick = Cvar.Get("gl_ztrick", "0", 0); ! gl_finish = Cvar.Get("gl_finish", "0", Globals.CVAR_ARCHIVE); ! gl_clear = Cvar.Get("gl_clear", "0", 0); ! gl_cull = Cvar.Get("gl_cull", "1", 0); ! gl_polyblend = Cvar.Get("gl_polyblend", "1", 0); ! gl_flashblend = Cvar.Get("gl_flashblend", "0", 0); ! gl_playermip = Cvar.Get("gl_playermip", "0", 0); ! gl_monolightmap = Cvar.Get("gl_monolightmap", "0", 0); ! gl_driver = Cvar.Get("gl_driver", "opengl32", Globals.CVAR_ARCHIVE); ! gl_texturemode = Cvar.Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", Globals.CVAR_ARCHIVE); ! gl_texturealphamode = Cvar.Get("gl_texturealphamode", "default", Globals.CVAR_ARCHIVE); ! gl_texturesolidmode = Cvar.Get("gl_texturesolidmode", "default", Globals.CVAR_ARCHIVE); ! gl_lockpvs = Cvar.Get("gl_lockpvs", "0", 0); ! gl_vertex_arrays = Cvar.Get("gl_vertex_arrays", "0", Globals.CVAR_ARCHIVE); ! gl_ext_swapinterval = Cvar.Get("gl_ext_swapinterval", "1", Globals.CVAR_ARCHIVE); ! gl_ext_palettedtexture = Cvar.Get("gl_ext_palettedtexture", "0", Globals.CVAR_ARCHIVE); ! gl_ext_multitexture = Cvar.Get("gl_ext_multitexture", "1", Globals.CVAR_ARCHIVE); ! gl_ext_pointparameters = Cvar.Get("gl_ext_pointparameters", "1", Globals.CVAR_ARCHIVE); ! gl_ext_compiled_vertex_array = Cvar.Get("gl_ext_compiled_vertex_array", "1", Globals.CVAR_ARCHIVE); ! gl_drawbuffer = Cvar.Get("gl_drawbuffer", "GL_BACK", 0); ! gl_swapinterval = Cvar.Get("gl_swapinterval", "1", Globals.CVAR_ARCHIVE); ! gl_saturatelighting = Cvar.Get("gl_saturatelighting", "0", 0); ! gl_3dlabs_broken = Cvar.Get("gl_3dlabs_broken", "1", Globals.CVAR_ARCHIVE); ! 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", "jogl", Globals.CVAR_ARCHIVE); ! Cmd.AddCommand("imagelist", new xcommand_t() { public void execute() { GL_ImageList_f(); *************** *** 1026,1040 **** }); ! ri.Cmd_AddCommand("screenshot", new xcommand_t() { public void execute() { GL_ScreenShot_f(); } }); ! ri.Cmd_AddCommand("modellist", new xcommand_t() { public void execute() { Mod_Modellist_f(); } }); ! ri.Cmd_AddCommand("gl_strings", new xcommand_t() { public void execute() { GL_Strings_f(); --- 1004,1018 ---- }); ! Cmd.AddCommand("screenshot", new xcommand_t() { public void execute() { GL_ScreenShot_f(); } }); ! Cmd.AddCommand("modellist", new xcommand_t() { public void execute() { Mod_Modellist_f(); } }); ! Cmd.AddCommand("gl_strings", new xcommand_t() { public void execute() { GL_Strings_f(); *************** *** 1054,1059 **** // if (vid_fullscreen.modified && !gl_config.allow_cds) { ! // ri.Con_Printf(Defines.PRINT_ALL, "R_SetMode() - CDS not allowed with this driver\n"); ! // ri.Cvar_SetValue("vid_fullscreen", (vid_fullscreen.value > 0.0f) ? 0.0f : 1.0f); // vid_fullscreen.modified = false; // } --- 1032,1037 ---- // 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; // } *************** *** 1071,1089 **** else { if (err == rserr_invalid_fullscreen) { ! ri.Cvar_SetValue("vid_fullscreen", 0); vid_fullscreen.modified = false; ! ri.Con_Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - fullscreen unavailable in this mode\n"); if ((err = GLimp_SetMode(dim, (int) gl_mode.value, false)) == rserr_ok) return true; } else if (err == rserr_invalid_mode) { ! ri.Cvar_SetValue("gl_mode", gl_state.prev_mode); gl_mode.modified = false; ! ri.Con_Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - invalid mode\n"); } // try setting it back to something safe if ((err = GLimp_SetMode(dim, gl_state.prev_mode, false)) != rserr_ok) { ! ri.Con_Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - could not revert to safe mode\n"); return false; } --- 1049,1067 ---- else { if (err == rserr_invalid_fullscreen) { ! Cvar.SetValue("vid_fullscreen", 0); vid_fullscreen.modified = false; ! VID.Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - fullscreen unavailable in this mode\n"); if ((err = GLimp_SetMode(dim, (int) gl_mode.value, false)) == rserr_ok) return true; } else if (err == rserr_invalid_mode) { ! Cvar.SetValue("gl_mode", gl_state.prev_mode); gl_mode.modified = false; ! VID.Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - invalid mode\n"); } // try setting it back to something safe if ((err = GLimp_SetMode(dim, gl_state.prev_mode, false)) != rserr_ok) { ! VID.Printf(Defines.PRINT_ALL, "ref_gl::R_SetMode() - could not revert to safe mode\n"); return false; } *************** *** 1108,1112 **** } ! ri.Con_Printf(Defines.PRINT_ALL, "ref_gl version: " + REF_VERSION + '\n'); Draw_GetPalette(); --- 1086,1090 ---- } ! VID.Printf(Defines.PRINT_ALL, "ref_gl version: " + REF_VERSION + '\n'); Draw_GetPalette(); *************** *** 1114,1130 **** R_Register(); - // initialize our QGL dynamic bindings - if (!QGL_Init(gl_driver.string)) { - QGL_Shutdown(); - ri.Con_Printf(Defines.PRINT_ALL, "ref_gl::R_Init() - could not load \"" + gl_driver.string + "\"\n"); - return false; - } - - // initialize OS-specific parts of OpenGL - if (!GLimp_Init(vid_xpos, vid_ypos)) { - QGL_Shutdown(); - return false; - } - // set our "safe" modes gl_state.prev_mode = 3; --- 1092,1095 ---- *************** *** 1132,1137 **** // create the window and set up the context if (!R_SetMode()) { ! QGL_Shutdown(); ! ri.Con_Printf(Defines.PRINT_ALL, "ref_gl::R_Init() - could not R_SetMode()\n"); return false; } --- 1097,1101 ---- // create the window and set up the context if (!R_SetMode()) { ! VID.Printf(Defines.PRINT_ALL, "ref_gl::R_Init() - could not R_SetMode()\n"); return false; } *************** *** 1139,1144 **** } ! boolean R_Init2() { ! ri.Vid_MenuInit(); /* --- 1103,1108 ---- } ! protected boolean R_Init2() { ! VID.MenuInit(); /* *************** *** 1146,1156 **** */ gl_config.vendor_string = gl.glGetString(GL.GL_VENDOR); ! ri.Con_Printf(Defines.PRINT_ALL, "GL_VENDOR: " + gl_config.vendor_string + '\n'); gl_config.renderer_string = gl.glGetString(GL.GL_RENDERER); ! ri.Con_Printf(Defines.PRINT_ALL, "GL_RENDERER: " + gl_config.renderer_string + '\n'); gl_config.version_string = gl.glGetString(GL.GL_VERSION); ! ri.Con_Printf(Defines.PRINT_ALL, "GL_VERSION: " + gl_config.version_string + '\n'); gl_config.extensions_string = gl.glGetString(GL.GL_EXTENSIONS); ! ri.Con_Printf(Defines.PRINT_ALL, "GL_EXTENSIONS: " + gl_config.extensions_string + '\n'); String renderer_buffer = gl_config.renderer_string.toLowerCase(); --- 1110,1120 ---- */ gl_config.vendor_string = gl.glGetString(GL.GL_VENDOR); ! VID.Printf(Defines.PRINT_ALL, "GL_VENDOR: " + gl_config.vendor_string + '\n'); gl_config.renderer_string = gl.glGetString(GL.GL_RENDERER); ! VID.Printf(Defines.PRINT_ALL, "GL_RENDERER: " + gl_config.renderer_string + '\n'); gl_config.version_string = gl.glGetString(GL.GL_VERSION); ! VID.Printf(Defines.PRINT_ALL, "GL_VERSION: " + gl_config.version_string + '\n'); gl_config.extensions_string = gl.glGetString(GL.GL_EXTENSIONS); ! VID.Printf(Defines.PRINT_ALL, "GL_EXTENSIONS: " + gl_config.extensions_string + '\n'); String renderer_buffer = gl_config.renderer_string.toLowerCase(); *************** *** 1183,1194 **** if (monolightmap.length() < 2 || monolightmap.charAt(1) != 'F') { if (gl_config.renderer == GL_RENDERER_PERMEDIA2) { ! ri.Cvar_Set("gl_monolightmap", "A"); ! ri.Con_Printf(Defines.PRINT_ALL, "...using gl_monolightmap 'a'\n"); } else if ((gl_config.renderer & GL_RENDERER_POWERVR) != 0) { ! ri.Cvar_Set("gl_monolightmap", "0"); } else { ! ri.Cvar_Set("gl_monolightmap", "0"); } } --- 1147,1158 ---- if (monolightmap.length() < 2 || monolightmap.charAt(1) != 'F') { if (gl_config.renderer == GL_RENDERER_PERMEDIA2) { ! Cvar.Set("gl_monolightmap", "A"); ! VID.Printf(Defines.PRINT_ALL, "...using gl_monolightmap 'a'\n"); } else if ((gl_config.renderer & GL_RENDERER_POWERVR) != 0) { ! Cvar.Set("gl_monolightmap", "0"); } else { ! Cvar.Set("gl_monolightmap", "0"); } } *************** *** 1197,1213 **** // the screen needs to redraw the tiled background every frame if ((gl_config.renderer & GL_RENDERER_POWERVR) != 0) { ! ri.Cvar_Set("scr_drawall", "1"); } else { ! ri.Cvar_Set("scr_drawall", "0"); } // #ifdef __linux__ ! ri.Cvar_SetValue("gl_finish", 1); // #endif // MCD has buffering issues if (gl_config.renderer == GL_RENDERER_MCD) { ! ri.Cvar_SetValue("gl_finish", 1); } --- 1161,1177 ---- // the screen needs to redraw the tiled background every frame if ((gl_config.renderer & GL_RENDERER_POWERVR) != 0) { ! Cvar.Set("scr_drawall", "1"); } else { ! Cvar.Set("scr_drawall", "0"); } // #ifdef __linux__ ! Cvar.SetValue("gl_finish", 1); // #endif // MCD has buffering issues if (gl_config.renderer == GL_RENDERER_MCD) { ! Cvar.SetValue("gl_finish", 1); } *************** *** 1223,1229 **** if (gl_config.allow_cds) ! ri.Con_Printf(Defines.PRINT_ALL, "...allowing CDS\n"); else ! ri.Con_Printf(Defines.PRINT_ALL, "...disabling CDS\n"); /* --- 1187,1193 ---- if (gl_config.allow_cds) ! VID.Printf(Defines.PRINT_ALL, "...allowing CDS\n"); else ! VID.Printf(Defines.PRINT_ALL, "...disabling CDS\n"); /* *************** *** 1232,1236 **** if (gl_config.extensions_string.indexOf("GL_EXT_compiled_vertex_array") >= 0 || gl_config.extensions_string.indexOf("GL_SGI_compiled_vertex_... [truncated message content] |
From: Holger Z. <hz...@us...> - 2004-09-06 19:40:04
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/render/fastjogl Modified Files: Tag: r_0_9 Misc.java Surf.java Light.java Mesh.java Draw.java Warp.java Image.java Anorms.java Base.java Model.java Main.java Removed Files: Tag: r_0_9 Impl.java Log Message: merge changes for 0.9.3 Index: Image.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Image.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Image.java 9 Jul 2004 08:38:27 -0000 1.1.2.1 --- Image.java 6 Sep 2004 19:39:17 -0000 1.1.2.2 *************** *** 27,32 **** --- 27,34 ---- import jake2.Defines; + import jake2.client.VID; import jake2.client.particle_t; import jake2.game.cvar_t; + import jake2.qcommon.*; import jake2.qcommon.longjmpException; import jake2.qcommon.qfiles; *************** *** 246,250 **** if (i == NUM_GL_MODES) { ! ri.Con_Printf(Defines.PRINT_ALL, "bad filter name: [" + string + "]\n"); return; } --- 248,252 ---- if (i == NUM_GL_MODES) { ! VID.Printf(Defines.PRINT_ALL, "bad filter name: [" + string + "]\n"); return; } *************** *** 280,284 **** if (i == NUM_GL_ALPHA_MODES) { ! ri.Con_Printf(Defines.PRINT_ALL, "bad alpha texture mode name: [" + string + "]\n"); return; } --- 282,286 ---- if (i == NUM_GL_ALPHA_MODES) { ! VID.Printf(Defines.PRINT_ALL, "bad alpha texture mode name: [" + string + "]\n"); return; } *************** *** 300,304 **** if (i == NUM_GL_SOLID_MODES) { ! ri.Con_Printf(Defines.PRINT_ALL, "bad solid texture mode name: [" + string + "]\n"); return; } --- 302,306 ---- if (i == NUM_GL_SOLID_MODES) { ! VID.Printf(Defines.PRINT_ALL, "bad solid texture mode name: [" + string + "]\n"); return; } *************** *** 318,322 **** final String[] palstrings = { "RGB", "PAL" }; ! ri.Con_Printf(Defines.PRINT_ALL, "------------------\n"); texels = 0; --- 320,324 ---- final String[] palstrings = { "RGB", "PAL" }; ! VID.Printf(Defines.PRINT_ALL, "------------------\n"); texels = 0; *************** *** 329,349 **** switch (image.type) { case it_skin : ! ri.Con_Printf(Defines.PRINT_ALL, "M"); break; case it_sprite : ! ri.Con_Printf(Defines.PRINT_ALL, "S"); break; case it_wall : ! ri.Con_Printf(Defines.PRINT_ALL, "W"); break; case it_pic : ! ri.Con_Printf(Defines.PRINT_ALL, "P"); break; default : ! ri.Con_Printf(Defines.PRINT_ALL, " "); break; } ! ri.Con_Printf( Defines.PRINT_ALL, " %3i %3i %s: %s\n", --- 331,351 ---- switch (image.type) { case it_skin : ! VID.Printf(Defines.PRINT_ALL, "M"); break; case it_sprite : ! VID.Printf(Defines.PRINT_ALL, "S"); break; case it_wall : ! VID.Printf(Defines.PRINT_ALL, "W"); break; case it_pic : ! VID.Printf(Defines.PRINT_ALL, "P"); break; default : ! VID.Printf(Defines.PRINT_ALL, " "); break; } ! VID.Printf( Defines.PRINT_ALL, " %3i %3i %s: %s\n", *************** *** 351,355 **** image.name)); } ! ri.Con_Printf(Defines.PRINT_ALL, "Total texel count (not counting mipmaps): " + texels + '\n'); } --- 353,357 ---- image.name)); } ! VID.Printf(Defines.PRINT_ALL, "Total texel count (not counting mipmaps): " + texels + '\n'); } *************** *** 447,454 **** // load the file // ! byte[] raw = ri.FS_LoadFile(filename); if (raw == null) { ! ri.Con_Printf(Defines.PRINT_DEVELOPER, "Bad pcx file " + filename + '\n'); return null; } --- 449,456 ---- // load the file // ! byte[] raw = FS.LoadFile(filename); if (raw == null) { ! VID.Printf(Defines.PRINT_DEVELOPER, "Bad pcx file " + filename + '\n'); return null; } *************** *** 466,470 **** || pcx.ymax >= 480) { ! ri.Con_Printf(Defines.PRINT_ALL, "Bad pcx file " + filename + '\n'); return null; } --- 468,472 ---- || pcx.ymax >= 480) { ! VID.Printf(Defines.PRINT_ALL, "Bad pcx file " + filename + '\n'); return null; } *************** *** 542,550 **** // load the file // ! raw = ri.FS_LoadFile (name); if (raw == null) { ! ri.Con_Printf(Defines.PRINT_DEVELOPER, "Bad tga file "+ name +'\n'); return null; } --- 544,552 ---- // load the file // ! raw = FS.LoadFile(name); if (raw == null) { ! VID.Printf(Defines.PRINT_DEVELOPER, "Bad tga file "+ name +'\n'); return null; } *************** *** 553,560 **** if (targa_header.image_type != 2 && targa_header.image_type != 10) ! ri.Sys_Error(Defines.ERR_DROP, "LoadTGA: Only type 2 and 10 targa RGB images supported\n"); if (targa_header.colormap_type != 0 || (targa_header.pixel_size != 32 && targa_header.pixel_size != 24)) ! ri.Sys_Error (Defines.ERR_DROP, "LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n"); columns = targa_header.width; --- 555,562 ---- if (targa_header.image_type != 2 && targa_header.image_type != 10) ! Com.Error(Defines.ERR_DROP, "LoadTGA: Only type 2 and 10 targa RGB images supported\n"); if (targa_header.colormap_type != 0 || (targa_header.pixel_size != 32 && targa_header.pixel_size != 24)) ! Com.Error (Defines.ERR_DROP, "LoadTGA: Only 32 or 24 bit images supported (no colormaps)\n"); columns = targa_header.width; *************** *** 744,760 **** // else if (pos[off] != 255) fdc = pos[off]; // } ! // TODO check this: R_FloodFillSkin( byte[] skin, int skinwidth, int skinheight) void R_FloodFillSkin(byte[] skin, int skinwidth, int skinheight) { // byte fillcolor = *skin; // assume this is the pixel to fill int fillcolor = skin[0] & 0xff; ! floodfill_t[] fifo = new floodfill_t[FLOODFILL_FIFO_SIZE]; int inpt = 0, outpt = 0; int filledcolor = -1; int i; ! for (int j = 0; j < fifo.length; j++) { ! fifo[j] = new floodfill_t(); ! } if (filledcolor == -1) { --- 746,767 ---- // else if (pos[off] != 255) fdc = pos[off]; // } ! static floodfill_t[] fifo = new floodfill_t[FLOODFILL_FIFO_SIZE]; ! static { ! for (int j = 0; j < fifo.length; j++) { ! fifo[j] = new floodfill_t(); ! } ! } // TODO check this: R_FloodFillSkin( byte[] skin, int skinwidth, int skinheight) void R_FloodFillSkin(byte[] skin, int skinwidth, int skinheight) { // byte fillcolor = *skin; // assume this is the pixel to fill int fillcolor = skin[0] & 0xff; ! // floodfill_t[] fifo = new floodfill_t[FLOODFILL_FIFO_SIZE]; int inpt = 0, outpt = 0; int filledcolor = -1; int i; ! // for (int j = 0; j < fifo.length; j++) { ! // fifo[j] = new floodfill_t(); ! // } if (filledcolor == -1) { *************** *** 1084,1088 **** if (scaled_width * scaled_height > 256 * 256) ! ri.Sys_Error(Defines.ERR_DROP, "GL_Upload32: too big"); // scan the texture for any non-255 alpha --- 1091,1095 ---- if (scaled_width * scaled_height > 256 * 256) ! Com.Error(Defines.ERR_DROP, "GL_Upload32: too big"); // scan the texture for any non-255 alpha *************** *** 1102,1106 **** comp = gl_tex_alpha_format; else { ! ri.Con_Printf(Defines.PRINT_ALL, "Unknown number of texture components " + samples + '\n'); comp = samples; } --- 1109,1113 ---- comp = gl_tex_alpha_format; else { ! VID.Printf(Defines.PRINT_ALL, "Unknown number of texture components " + samples + '\n'); comp = samples; } *************** *** 1244,1248 **** if (s > trans.length) ! ri.Sys_Error(Defines.ERR_DROP, "GL_Upload8: too large"); if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f && is_sky) { --- 1251,1255 ---- if (s > trans.length) ! Com.Error(Defines.ERR_DROP, "GL_Upload8: too large"); if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f && is_sky) { *************** *** 1311,1315 **** { if (numgltextures == MAX_GLTEXTURES) ! ri.Sys_Error (Defines.ERR_DROP, "MAX_GLTEXTURES"); numgltextures++; --- 1318,1322 ---- { if (numgltextures == MAX_GLTEXTURES) ! Com.Error (Defines.ERR_DROP, "MAX_GLTEXTURES"); numgltextures++; *************** *** 1318,1322 **** if (name.length() > Defines.MAX_QPATH) ! ri.Sys_Error(Defines.ERR_DROP, "Draw_LoadPic: \"" + name + "\" is too long"); image.name = name; --- 1325,1329 ---- if (name.length() > Defines.MAX_QPATH) ! Com.Error(Defines.ERR_DROP, "Draw_LoadPic: \"" + name + "\" is too long"); image.name = name; *************** *** 1434,1440 **** image_t image = null; ! byte[] raw = ri.FS_LoadFile(name); if (raw == null) { ! ri.Con_Printf(Defines.PRINT_ALL, "GL_FindImage: can't load " + name + '\n'); return r_notexture; } --- 1441,1447 ---- image_t image = null; ! byte[] raw = FS.LoadFile(name); if (raw == null) { ! VID.Printf(Defines.PRINT_ALL, "GL_FindImage: can't load " + name + '\n'); return r_notexture; } *************** *** 1459,1473 **** image_t GL_FindImage(String name, int type) { image_t image = null; ! ! // TODO loest das grossschreibungs problem ! name = name.toLowerCase(); ! // bughack for bad strings (fuck \0) ! int index = name.indexOf('\0'); ! if (index != -1) ! name = name.substring(0, index); if (name == null || name.length() < 5) ! return null; // ri.Sys_Error (ERR_DROP, "GL_FindImage: NULL name"); ! // ri.Sys_Error (ERR_DROP, "GL_FindImage: bad name: %s", name); // look for it --- 1466,1480 ---- image_t GL_FindImage(String name, int type) { image_t image = null; ! ! // // TODO loest das grossschreibungs problem ! // name = name.toLowerCase(); ! // // bughack for bad strings (fuck \0) ! // int index = name.indexOf('\0'); ! // if (index != -1) ! // name = name.substring(0, index); if (name == null || name.length() < 5) ! return null; // Com.Error (ERR_DROP, "GL_FindImage: NULL name"); ! // Com.Error (ERR_DROP, "GL_FindImage: bad name: %s", name); // look for it *************** *** 1485,1488 **** --- 1492,1496 ---- // load the pic from disk // + image = null; byte[] pic = null; Dimension dim = new Dimension(); *************** *** 1511,1516 **** } - else - return null; return image; --- 1519,1522 ---- *************** *** 1577,1581 **** if (palette[0] == null || palette[0].length != 768) ! ri.Sys_Error(Defines.ERR_FATAL, "Couldn't load pics/colormap.pcx"); byte[] pal = palette[0]; --- 1583,1587 ---- if (palette[0] == null || palette[0].length != 768) ! Com.Error(Defines.ERR_FATAL, "Couldn't load pics/colormap.pcx"); byte[] pal = palette[0]; *************** *** 1607,1614 **** // init intensity conversions ! intensity = ri.Cvar_Get("intensity", "2", 0); if (intensity.value <= 1) ! ri.Cvar_Set("intensity", "1"); gl_state.inverse_intensity = 1 / intensity.value; --- 1613,1620 ---- // init intensity conversions ! intensity = Cvar.Get("intensity", "2", 0); if (intensity.value <= 1) ! Cvar.Set("intensity", "1"); gl_state.inverse_intensity = 1 / intensity.value; *************** *** 1617,1623 **** if (qglColorTableEXT) { ! gl_state.d_16to8table = ri.FS_LoadFile("pics/16to8.dat"); if (gl_state.d_16to8table == null) ! ri.Sys_Error(Defines.ERR_FATAL, "Couldn't load pics/16to8.pcx"); } --- 1623,1629 ---- if (qglColorTableEXT) { ! gl_state.d_16to8table = FS.LoadFile("pics/16to8.dat"); if (gl_state.d_16to8table == null) ! Com.Error(Defines.ERR_FATAL, "Couldn't load pics/16to8.pcx"); } Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Surf.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Surf.java 9 Jul 2004 08:38:27 -0000 1.1.2.1 --- Surf.java 6 Sep 2004 19:39:17 -0000 1.1.2.2 *************** *** 29,32 **** --- 29,33 ---- import jake2.client.*; import jake2.game.cplane_t; + import jake2.qcommon.Com; import jake2.render.*; import jake2.util.Lib; *************** *** 912,915 **** --- 913,919 ---- { 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) *************** *** 923,931 **** Math3D.VectorCopy(r_newrefdef.vieworg, modelorg); - // auto cycle the world frame for texture animation - // memset (&ent, 0, sizeof(ent)); - ent.frame = (int)(r_newrefdef.time*2); - currententity = ent; - gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; --- 927,930 ---- *************** *** 975,982 **** void R_MarkLeaves() { ! byte[] vis; //byte[] fatvis = new byte[Defines.MAX_MAP_LEAFS / 8]; ! Arrays.fill(fatvis, (byte)0); mnode_t node; --- 974,981 ---- void R_MarkLeaves() { ! //byte[] vis; //byte[] fatvis = new byte[Defines.MAX_MAP_LEAFS / 8]; ! //Arrays.fill(fatvis, (byte)0); mnode_t node; *************** *** 1007,1011 **** } ! vis = Mod_ClusterPVS(r_viewcluster, r_worldmodel); // may have to combine two clusters because of solid water boundaries if (r_viewcluster2 != r_viewcluster) --- 1006,1010 ---- } ! byte[] vis = Mod_ClusterPVS(r_viewcluster, r_worldmodel); // may have to combine two clusters because of solid water boundaries if (r_viewcluster2 != r_viewcluster) *************** *** 1108,1112 **** gl_lms.lightmap_buffer ); if ( ++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS ) ! ri.Sys_Error( Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n" ); --- 1107,1111 ---- gl_lms.lightmap_buffer ); if ( ++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS ) ! Com.Error( Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n" ); *************** *** 1261,1265 **** if ( !LM_AllocBlock( smax, tmax, lightPos ) ) { ! ri.Sys_Error( Defines.ERR_FATAL, "Consecutive calls to LM_AllocBlock(" + smax +"," + tmax +") failed\n"); } } --- 1260,1264 ---- if ( !LM_AllocBlock( smax, tmax, lightPos ) ) { ! Com.Error( Defines.ERR_FATAL, "Consecutive calls to LM_AllocBlock(" + smax +"," + tmax +") failed\n"); } } Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Light.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Light.java 9 Jul 2004 08:38:27 -0000 1.1.2.1 --- Light.java 6 Sep 2004 19:39:17 -0000 1.1.2.2 *************** *** 29,35 **** import jake2.Globals; import jake2.client.dlight_t; - import jake2.client.lightstyle_t; import jake2.game.GameBase; import jake2.game.cplane_t; import jake2.qcommon.longjmpException; import jake2.render.*; --- 29,35 ---- import jake2.Globals; import jake2.client.dlight_t; import jake2.game.GameBase; import jake2.game.cplane_t; + import jake2.qcommon.Com; import jake2.qcommon.longjmpException; import jake2.render.*; *************** *** 224,235 **** cplane_t lightplane; // used as shadow plane float[] lightspot = {0, 0, 0}; // vec3_t ! int RecursiveLightPoint (mnode_t node, float[] start, float[] end) { ! float front, back, frac; ! boolean side; ! int sideIndex; ! cplane_t plane; ! float[] mid = {0, 0, 0}; msurface_t surf; int s, t, ds, dt; --- 224,233 ---- cplane_t lightplane; // used as shadow plane float[] lightspot = {0, 0, 0}; // vec3_t ! int RecursiveLightPoint (mnode_t node, float[] start, float[] end) { ! if (node.contents != -1) ! return -1; // didn't hit anything ! msurface_t surf; int s, t, ds, dt; *************** *** 238,259 **** ByteBuffer lightmap; int maps; ! int r; ! ! if (node.contents != -1) ! return -1; // didn't hit anything // calculate mid point // FIXME: optimize for axial ! plane = node.plane; ! front = Math3D.DotProduct (start, plane.normal) - plane.dist; ! back = Math3D.DotProduct (end, plane.normal) - plane.dist; ! side = (front < 0); ! sideIndex = (side) ? 1 : 0; if ( (back < 0) == side) return RecursiveLightPoint (node.children[sideIndex], start, end); ! frac = front / (front-back); mid[0] = start[0] + (end[0] - start[0])*frac; mid[1] = start[1] + (end[1] - start[1])*frac; --- 236,254 ---- ByteBuffer lightmap; int maps; ! float[] mid = {0, 0, 0}; // calculate mid point // FIXME: optimize for axial ! cplane_t plane = node.plane; ! float front = Math3D.DotProduct (start, plane.normal) - plane.dist; ! float back = Math3D.DotProduct (end, plane.normal) - plane.dist; ! boolean side = (front < 0); ! int sideIndex = (side) ? 1 : 0; if ( (back < 0) == side) return RecursiveLightPoint (node.children[sideIndex], start, end); ! float frac = front / (front-back); mid[0] = start[0] + (end[0] - start[0])*frac; mid[1] = start[1] + (end[1] - start[1])*frac; *************** *** 261,265 **** // go down front side ! r = RecursiveLightPoint (node.children[sideIndex], start, mid); if (r >= 0) return r; // hit something --- 256,260 ---- // go down front side ! int r = RecursiveLightPoint (node.children[sideIndex], start, mid); if (r >= 0) return r; // hit something *************** *** 273,276 **** --- 268,272 ---- int surfIndex = node.firstsurface; + float[] scale = {0, 0, 0}; for (i=0 ; i<node.numsurfaces ; i++, surfIndex++) { *************** *** 306,310 **** if (lightmap != null) { ! float[] scale = {0, 0, 0}; float[] rgb; lightmapIndex += 3 * (dt * ((surf.extents[0] >> 4) + 1) + ds); --- 302,306 ---- if (lightmap != null) { ! //float[] scale = {0, 0, 0}; float[] rgb; lightmapIndex += 3 * (dt * ((surf.extents[0] >> 4) + 1) + ds); *************** *** 341,349 **** float[] end = {0, 0, 0}; - float r; - int lnum; dlight_t dl; - float light; - float[] dist = {0, 0, 0}; float add; --- 337,341 ---- *************** *** 358,362 **** end[2] = p[2] - 2048; ! r = RecursiveLightPoint(r_worldmodel.nodes[0], p, end); if (r == -1) --- 350,354 ---- end[2] = p[2] - 2048; ! float r = RecursiveLightPoint(r_worldmodel.nodes[0], p, end); if (r == -1) *************** *** 372,382 **** // add dynamic lights // ! light = 0; ! for (lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++) { dl = r_newrefdef.dlights[lnum]; ! Math3D.VectorSubtract (currententity.origin, dl.origin, dist); ! add = dl.intensity - Math3D.VectorLength(dist); add *= (1.0f/256); if (add > 0) --- 364,373 ---- // add dynamic lights // ! for (int lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++) { dl = r_newrefdef.dlights[lnum]; ! Math3D.VectorSubtract (currententity.origin, dl.origin, end); ! add = dl.intensity - Math3D.VectorLength(end); add *= (1.0f/256); if (add > 0) *************** *** 389,393 **** } - // =================================================================== --- 380,383 ---- *************** *** 399,405 **** =============== */ void R_AddDynamicLights(msurface_t surf) { - int lnum; int sd, td; float fdist, frad, fminlight; --- 389,395 ---- =============== */ + // TODO sync with jogl renderer. hoz void R_AddDynamicLights(msurface_t surf) { int sd, td; float fdist, frad, fminlight; *************** *** 407,422 **** float[] local = {0, 0, 0}; int s, t; - int i; - int smax, tmax; - mtexinfo_t tex; dlight_t dl; float[] pfBL; float fsacc, ftacc; ! smax = (surf.extents[0]>>4)+1; ! tmax = (surf.extents[1]>>4)+1; ! tex = surf.texinfo; ! for (lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++) { if ( (surf.dlightbits & (1<<lnum)) == 0 ) --- 397,409 ---- float[] local = {0, 0, 0}; int s, t; dlight_t dl; float[] pfBL; float fsacc, ftacc; ! int smax = (surf.extents[0]>>4)+1; ! int tmax = (surf.extents[1]>>4)+1; ! mtexinfo_t tex = surf.texinfo; ! for (int lnum=0 ; lnum<r_newrefdef.num_dlights ; lnum++) { if ( (surf.dlightbits & (1<<lnum)) == 0 ) *************** *** 435,439 **** fminlight = frad - fminlight; ! for (i=0 ; i<3 ; i++) { impact[i] = dl.origin[i] - --- 422,426 ---- fminlight = frad - fminlight; ! for (int i=0 ; i<3 ; i++) { impact[i] = dl.origin[i] - *************** *** 452,456 **** td = -td; ! for ( s=0, fsacc = 0 ; s<smax ; s++, fsacc += 16, pfBLindex += 3) { sd = (int)( local[0] - fsacc ); --- 439,443 ---- td = -td; ! for (s=0, fsacc = 0 ; s<smax ; s++, fsacc += 16, pfBLindex += 3) { sd = (int)( local[0] - fsacc ); *************** *** 481,488 **** void R_SetCacheState( msurface_t surf ) { ! int maps; ! ! for (maps = 0 ; maps < Defines.MAXLIGHTMAPS && surf.styles[maps] != (byte)255 ; ! maps++) { surf.cached_light[maps] = r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].white; --- 468,472 ---- void R_SetCacheState( msurface_t surf ) { ! for (int maps = 0 ; maps < Defines.MAXLIGHTMAPS && surf.styles[maps] != (byte)255 ; maps++) { surf.cached_light[maps] = r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].white; *************** *** 497,520 **** =============== */ void R_BuildLightMap(msurface_t surf, IntBuffer dest, int stride) { - int smax, tmax; int r, g, b, a, max; ! int i, j, size; ByteBuffer lightmap; ! float[] scale = {0, 0, 0, 0}; int nummaps; float[] bl; ! lightstyle_t style; ! int monolightmap; if ( (surf.texinfo.flags & (Defines.SURF_SKY | Defines.SURF_TRANS33 | Defines.SURF_TRANS66 | Defines.SURF_WARP)) != 0 ) ! ri.Sys_Error(Defines.ERR_DROP, "R_BuildLightMap called for non-lit surface"); ! smax = (surf.extents[0] >> 4) + 1; ! tmax = (surf.extents[1] >> 4) + 1; ! size = smax * tmax; if (size > ((s_blocklights.length * Defines.SIZE_OF_FLOAT) >> 4) ) ! ri.Sys_Error(Defines.ERR_DROP, "Bad s_blocklights size"); try { --- 481,503 ---- =============== */ + // TODO sync with jogl renderer. hoz void R_BuildLightMap(msurface_t surf, IntBuffer dest, int stride) { int r, g, b, a, max; ! int i, j; ByteBuffer lightmap; ! float[] scale = {0, 0, 0}; int nummaps; float[] bl; ! //lightstyle_t style; if ( (surf.texinfo.flags & (Defines.SURF_SKY | Defines.SURF_TRANS33 | Defines.SURF_TRANS66 | Defines.SURF_WARP)) != 0 ) ! Com.Error(Defines.ERR_DROP, "R_BuildLightMap called for non-lit surface"); ! int smax = (surf.extents[0] >> 4) + 1; ! int tmax = (surf.extents[1] >> 4) + 1; ! int size = smax * tmax; if (size > ((s_blocklights.length * Defines.SIZE_OF_FLOAT) >> 4) ) ! Com.Error(Defines.ERR_DROP, "Bad s_blocklights size"); try { *************** *** 526,534 **** for (i=0 ; i<size*3 ; i++) s_blocklights[i] = 255; ! ! for (maps = 0 ; maps < Defines.MAXLIGHTMAPS && surf.styles[maps] != (byte)255; maps++) ! { ! style = r_newrefdef.lightstyles[surf.styles[maps] & 0xFF]; ! } // goto store; throw new longjmpException(); --- 509,519 ---- for (i=0 ; i<size*3 ; i++) s_blocklights[i] = 255; ! ! // TODO useless? hoz ! // for (maps = 0 ; maps < Defines.MAXLIGHTMAPS && surf.styles[maps] != (byte)255; maps++) ! // { ! // style = r_newrefdef.lightstyles[surf.styles[maps] & 0xFF]; ! // } ! // goto store; throw new longjmpException(); *************** *** 633,637 **** int blp = 0; ! monolightmap = gl_monolightmap.string.charAt(0); int destp = 0; --- 618,622 ---- int blp = 0; ! int monolightmap = gl_monolightmap.string.charAt(0); int destp = 0; *************** *** 688,692 **** a = (int)(a*t); } ! r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; dest.put(destp++, (a << 24) | (b << 16) | (g << 8) | (r << 0)); } --- 673,677 ---- a = (int)(a*t); } ! //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; dest.put(destp++, (a << 24) | (b << 16) | (g << 8) | (r << 0)); } *************** *** 769,773 **** break; } ! r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; dest.put(destp++, (a << 24) | (b << 16) | (g << 8) | (r << 0)); } --- 754,758 ---- break; } ! //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; dest.put(destp++, (a << 24) | (b << 16) | (g << 8) | (r << 0)); } --- Impl.java DELETED --- Index: Base.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Base.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Base.java 9 Jul 2004 08:38:27 -0000 1.1.2.1 --- Base.java 6 Sep 2004 19:39:17 -0000 1.1.2.2 *************** *** 26,29 **** --- 26,30 ---- package jake2.render.fastjogl; + import jake2.render.JoglBase; import net.java.games.jogl.GL; *************** *** 33,37 **** * @author cwei */ ! public class Base { static final int GL_COLOR_INDEX8_EXT = GL.GL_COLOR_INDEX; --- 34,38 ---- * @author cwei */ ! public abstract class Base extends JoglBase { static final int GL_COLOR_INDEX8_EXT = GL.GL_COLOR_INDEX; *************** *** 76,85 **** // =================================================================== - // enum rserr_t - static final int rserr_ok = 0; - static final int rserr_invalid_fullscreen = 1; - static final int rserr_invalid_mode = 2; - static final int rserr_unknown = 3; - // // #include "gl_model.h" --- 77,80 ---- Index: Draw.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Draw.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Draw.java 9 Jul 2004 08:38:27 -0000 1.1.2.1 --- Draw.java 6 Sep 2004 19:39:17 -0000 1.1.2.2 *************** *** 27,31 **** import jake2.Defines; ! import jake2.Globals; import jake2.render.image_t; --- 27,32 ---- import jake2.Defines; ! import jake2.client.VID; ! import jake2.qcommon.Com; import jake2.render.image_t; *************** *** 33,37 **** import net.java.games.jogl.GL; - import net.java.games.jogl.util.GLUT; /** --- 34,37 ---- *************** *** 139,143 **** if (image == null) { ! ri.Con_Printf (Defines.PRINT_ALL, "Can't find pic: " + pic +'\n'); return; } --- 139,143 ---- if (image == null) { ! VID.Printf (Defines.PRINT_ALL, "Can't find pic: " + pic +'\n'); return; } *************** *** 178,182 **** if (image == null) { ! ri.Con_Printf(Defines.PRINT_ALL, "Can't find pic: " +pic + '\n'); return; } --- 178,182 ---- if (image == null) { ! VID.Printf(Defines.PRINT_ALL, "Can't find pic: " +pic + '\n'); return; } *************** *** 218,222 **** if (image == null) { ! ri.Con_Printf(Defines.PRINT_ALL, "Can't find pic: " + pic + '\n'); return; } --- 218,222 ---- if (image == null) { ! VID.Printf(Defines.PRINT_ALL, "Can't find pic: " + pic + '\n'); return; } *************** *** 252,256 **** if ( colorIndex > 255) ! ri.Sys_Error(Defines.ERR_FATAL, "Draw_Fill: bad color"); gl.glDisable(GL.GL_TEXTURE_2D); --- 252,256 ---- if ( colorIndex > 255) ! Com.Error(Defines.ERR_FATAL, "Draw_Fill: bad color"); gl.glDisable(GL.GL_TEXTURE_2D); *************** *** 276,280 **** } ! // ============================================================================= /* --- 276,280 ---- } ! //============================================================================= /* Index: Model.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Model.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Model.java 9 Jul 2004 08:38:27 -0000 1.1.2.1 --- Model.java 6 Sep 2004 19:39:17 -0000 1.1.2.2 *************** *** 27,30 **** --- 27,31 ---- import jake2.Defines; + import jake2.client.VID; import jake2.game.cplane_t; import jake2.game.cvar_t; *************** *** 75,79 **** if (model == null || model.nodes == null) ! ri.Sys_Error (Defines.ERR_DROP, "Mod_PointInLeaf: bad model"); node = model.nodes[0]; // root node --- 76,80 ---- if (model == null || model.nodes == null) ! Com.Error (Defines.ERR_DROP, "Mod_PointInLeaf: bad model"); node = model.nodes[0]; // root node *************** *** 172,176 **** total = 0; ! ri.Con_Printf(Defines.PRINT_ALL,"Loaded models:\n"); for (i=0; i < mod_numknown ; i++) { --- 173,177 ---- total = 0; ! VID.Printf(Defines.PRINT_ALL,"Loaded models:\n"); for (i=0; i < mod_numknown ; i++) { *************** *** 179,186 **** continue; ! ri.Con_Printf (Defines.PRINT_ALL, "%8i : %s\n", new Vargs(2).add(mod.extradatasize).add(mod.name)); total += mod.extradatasize; } ! ri.Con_Printf (Defines.PRINT_ALL, "Total resident: " + total +'\n'); } --- 180,187 ---- continue; ! VID.Printf (Defines.PRINT_ALL, "%8i : %s\n", new Vargs(2).add(mod.extradatasize).add(mod.name)); total += mod.extradatasize; } ! VID.Printf (Defines.PRINT_ALL, "Total resident: " + total +'\n'); } *************** *** 214,218 **** if (name == null || name.length() == 0) ! ri.Sys_Error(Defines.ERR_DROP, "Mod_ForName: NULL name"); // --- 215,219 ---- if (name == null || name.length() == 0) ! Com.Error(Defines.ERR_DROP, "Mod_ForName: NULL name"); // *************** *** 223,227 **** i = Integer.parseInt(name.substring(1)); if (i < 1 || r_worldmodel == null || i >= r_worldmodel.numsubmodels) ! ri.Sys_Error (Defines.ERR_DROP, "bad inline model number"); return mod_inline[i]; } --- 224,228 ---- i = Integer.parseInt(name.substring(1)); if (i < 1 || r_worldmodel == null || i >= r_worldmodel.numsubmodels) ! Com.Error (Defines.ERR_DROP, "bad inline model number"); return mod_inline[i]; } *************** *** 253,257 **** { if (mod_numknown == MAX_MOD_KNOWN) ! ri.Sys_Error (Defines.ERR_DROP, "mod_numknown == MAX_MOD_KNOWN"); mod_numknown++; mod = mod_known[i]; --- 254,258 ---- { if (mod_numknown == MAX_MOD_KNOWN) ! Com.Error (Defines.ERR_DROP, "mod_numknown == MAX_MOD_KNOWN"); mod_numknown++; mod = mod_known[i]; *************** *** 263,272 **** // load the file // ! fileBuffer = ri.FS_LoadFile(name); if (fileBuffer == null) { if (crash) ! ri.Sys_Error(Defines.ERR_DROP, "Mod_NumForName: " + mod.name + " not found"); mod.name = ""; --- 264,273 ---- // load the file // ! fileBuffer = FS.LoadFile(name); if (fileBuffer == null) { if (crash) ! Com.Error(Defines.ERR_DROP, "Mod_NumForName: " + mod.name + " not found"); mod.name = ""; *************** *** 303,307 **** break; default: ! ri.Sys_Error(Defines.ERR_DROP,"Mod_NumForName: unknown fileid for " + mod.name); break; } --- 304,308 ---- break; default: ! Com.Error(Defines.ERR_DROP,"Mod_NumForName: unknown fileid for " + mod.name); break; } *************** *** 385,389 **** if ( (l.filelen % mvertex_t.DISK_SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / mvertex_t.DISK_SIZE; --- 386,390 ---- if ( (l.filelen % mvertex_t.DISK_SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / mvertex_t.DISK_SIZE; *************** *** 432,436 **** if ((l.filelen % qfiles.dmodel_t.SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dmodel_t.SIZE; --- 433,437 ---- if ((l.filelen % qfiles.dmodel_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dmodel_t.SIZE; *************** *** 472,476 **** if ( (l.filelen % medge_t.DISK_SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / medge_t.DISK_SIZE; --- 473,477 ---- if ( (l.filelen % medge_t.DISK_SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / medge_t.DISK_SIZE; *************** *** 505,513 **** if ((l.filelen % texinfo_t.SIZE) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / texinfo_t.SIZE; // out = Hunk_Alloc ( count*sizeof(*out)); out = new mtexinfo_t[count]; loadmodel.texinfo = out; --- 506,517 ---- if ((l.filelen % texinfo_t.SIZE) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / texinfo_t.SIZE; // out = Hunk_Alloc ( count*sizeof(*out)); out = new mtexinfo_t[count]; + for ( i=0 ; i<count ; i++) { + out[i] = new mtexinfo_t(); + } loadmodel.texinfo = out; *************** *** 517,527 **** bb.order(ByteOrder.LITTLE_ENDIAN); ! for ( i=0 ; i<count ; i++) ! { in = new texinfo_t(bb); ! out[i] = new mtexinfo_t(); ! //for (j=0 ; j<8 ; j++) ! out[i].vecs = in.vecs; ! out[i].flags = in.flags; next = in.nexttexinfo; --- 521,528 ---- bb.order(ByteOrder.LITTLE_ENDIAN); ! for ( i=0 ; i<count ; i++) { ! in = new texinfo_t(bb); ! out[i].vecs = in.vecs; out[i].flags = in.flags; next = in.nexttexinfo; *************** *** 534,540 **** out[i].image = GL_FindImage(name, it_wall); ! if (out[i].image == null) ! { ! ri.Con_Printf(Defines.PRINT_ALL, "Couldn't load " + name + '\n'); out[i].image = r_notexture; } --- 535,540 ---- out[i].image = GL_FindImage(name, it_wall); ! if (out[i].image == null) { ! VID.Printf(Defines.PRINT_ALL, "Couldn't load " + name + '\n'); out[i].image = r_notexture; } *************** *** 542,548 **** // count animation frames ! for (i=0 ; i<count ; i++) ! { ! // out = &loadmodel.texinfo[i]; out[i].numframes = 1; for (step = out[i].next ; (step != null) && (step != out[i]) ; step=step.next) --- 542,546 ---- // count animation frames ! for (i=0 ; i<count ; i++) { out[i].numframes = 1; for (step = out[i].next ; (step != null) && (step != out[i]) ; step=step.next) *************** *** 564,570 **** float val; ! int i, j, e; mvertex_t v; - mtexinfo_t tex; int[] bmins = {0, 0}; int[] bmaxs = {0, 0}; --- 562,567 ---- float val; ! int j, e; mvertex_t v; int[] bmins = {0, 0}; int[] bmaxs = {0, 0}; *************** *** 573,579 **** maxs[0] = maxs[1] = -99999; ! tex = s.texinfo; ! for (i=0 ; i<s.numedges ; i++) { e = loadmodel.surfedges[s.firstedge+i]; --- 570,576 ---- maxs[0] = maxs[1] = -99999; ! mtexinfo_t tex = s.texinfo; ! for (int i=0 ; i<s.numedges ; i++) { e = loadmodel.surfedges[s.firstedge+i]; *************** *** 596,600 **** } ! for (i=0 ; i<2 ; i++) { bmins[i] = (int)Math.floor(mins[i]/16); --- 593,597 ---- } ! for (int i=0 ; i<2 ; i++) { bmins[i] = (int)Math.floor(mins[i]/16); *************** *** 621,625 **** if ((l.filelen % qfiles.dface_t.SIZE) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dface_t.SIZE; --- 618,622 ---- if ((l.filelen % qfiles.dface_t.SIZE) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dface_t.SIZE; *************** *** 655,659 **** ti = in.texinfo; if (ti < 0 || ti >= loadmodel.numtexinfo) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: bad texinfo number"); out[surfnum].texinfo = loadmodel.texinfo[ti]; --- 652,656 ---- ti = in.texinfo; if (ti < 0 || ti >= loadmodel.numtexinfo) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: bad texinfo number"); out[surfnum].texinfo = loadmodel.texinfo[ti]; *************** *** 727,731 **** if ((l.filelen % qfiles.dnode_t.SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dnode_t.SIZE; --- 724,728 ---- if ((l.filelen % qfiles.dnode_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dnode_t.SIZE; *************** *** 784,788 **** if ((l.filelen % qfiles.dleaf_t.SIZE) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dleaf_t.SIZE; --- 781,785 ---- if ((l.filelen % qfiles.dleaf_t.SIZE) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dleaf_t.SIZE; *************** *** 829,833 **** if ((l.filelen % Defines.SIZE_OF_SHORT) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_SHORT; // out = Hunk_Alloc ( count*sizeof(*out)); --- 826,830 ---- if ((l.filelen % Defines.SIZE_OF_SHORT) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_SHORT; // out = Hunk_Alloc ( count*sizeof(*out)); *************** *** 844,848 **** j = bb.getShort(); if (j < 0 || j >= loadmodel.numsurfaces) ! ri.Sys_Error(Defines.ERR_DROP, "Mod_ParseMarksurfaces: bad surface number"); out[i] = loadmodel.surfaces[j]; --- 841,845 ---- j = bb.getShort(); if (j < 0 || j >= loadmodel.numsurfaces) ! Com.Error(Defines.ERR_DROP, "Mod_ParseMarksurfaces: bad surface number"); out[i] = loadmodel.surfaces[j]; *************** *** 862,870 **** if ( (l.filelen % Defines.SIZE_OF_INT) != 0) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_INT; if (count < 1 || count >= Defines.MAX_MAP_SURFEDGES) ! ri.Sys_Error (Defines.ERR_DROP, "MOD_LoadBmodel: bad surfedges count in " + loadmodel.name + ": " + count); offsets = new int[count]; --- 859,867 ---- if ( (l.filelen % Defines.SIZE_OF_INT) != 0) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / Defines.SIZE_OF_INT; if (count < 1 || count >= Defines.MAX_MAP_SURFEDGES) ! Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: bad surfedges count in " + loadmodel.name + ": " + count); offsets = new int[count]; *************** *** 894,898 **** if ((l.filelen % qfiles.dplane_t.SIZE) != 0) ! ri.Sys_Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dplane_t.SIZE; --- 891,895 ---- if ((l.filelen % qfiles.dplane_t.SIZE) != 0) ! Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name); count = l.filelen / qfiles.dplane_t.SIZE; *************** *** 937,941 **** loadmodel.type = mod_brush; if (loadmodel != mod_known[0]) ! ri.Sys_Error(Defines.ERR_DROP, "Loaded a brush model after the world"); header = new qfiles.dheader_t(buffer); --- 934,938 ---- loadmodel.type = mod_brush; if (loadmodel != mod_known[0]) ! Com.Error(Defines.ERR_DROP, "Loaded a brush model after the world"); header = new qfiles.dheader_t(buffer); *************** *** 943,947 **** i = header.version; if (i != Defines.BSPVERSION) ! ri.Sys_Error (Defines.ERR_DROP, "Mod_LoadBrushModel: " + mod.name + " has wrong version number (" + i + " should be " + Defines.BSPVERSION + ")"); mod_base = fileBuffer; //(byte *)header; --- 940,944 ---- i = header.version; if (i != Defines.BSPVERSION) ! Com.Error (Defines.ERR_DROP, "Mod_LoadBrushModel: " + mod.name + " has wrong version number (" + i + " should be " + Defines.BSPVERSION + ")"); mod_base = fileBuffer; //(byte *)header; *************** *** 977,981 **** starmod.firstnode = bm.headnode; if (starmod.firstnode >= loadmodel.numnodes) ! ri.Sys_Error(Defines.ERR_DROP, "Inline model " + i + " has bad firstnode"); Math3D.VectorCopy(bm.maxs, starmod.maxs); --- 974,978 ---- starmod.firstnode = bm.headnode; if (starmod.firstnode >= loadmodel.numnodes) ! Com.Error(Defines.ERR_DROP, "Inline model " + i + " has bad firstnode"); Math3D.VectorCopy(bm.maxs, starmod.maxs); *************** *** 1015,1038 **** if (pheader.version != qfiles.ALIAS_VERSION) ! ri.Sys_Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(pheader.version).add(qfiles.ALIAS_VERSION)); if (pheader.skinheight > MAX_LBM_HEIGHT) ! ri.Sys_Error(Defines.ERR_DROP, "model "+ mod.name +" has a skin taller than " + MAX_LBM_HEIGHT); if (pheader.num_xyz <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no vertices"); if (pheader.num_xyz > qfiles.MAX_VERTS) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name +" has too many vertices"); if (pheader.num_st <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no st vertices"); if (pheader.num_tris <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no triangles"); if (pheader.num_frames <= 0) ! ri.Sys_Error(Defines.ERR_DROP, "model " + mod.name + " has no frames"); // --- 1012,1035 ---- if (pheader.version != qfiles.ALIAS_VERSION) ! Com.Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(pheader.version).add(qfiles.ALIAS_VERSION)); if (pheader.skinheight > MAX_LBM_HEIGHT) ! Com.Error(Defines.ERR_DROP, "model "+ mod.name +" has a skin taller than " + MAX_LBM_HEIGHT); if (pheader.num_xyz <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no vertices"); if (pheader.num_xyz > qfiles.MAX_VERTS) ! Com.Error(Defines.ERR_DROP, "model " + mod.name +" has too many vertices"); if (pheader.num_st <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no st vertices"); if (pheader.num_tris <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no triangles"); if (pheader.num_frames <= 0) ! Com.Error(Defines.ERR_DROP, "model " + mod.name + " has no frames"); // *************** *** 1088,1092 **** { buffer.get(nameBuf); ! skinNames[i] = new String(nameBuf).trim(); mod.skins[i] = GL_FindImage(skinNames[i], it_skin); } --- 1085,1093 ---- { buffer.get(nameBuf); ! skinNames[i] = new String(nameBuf); ! int n = skinNames[i].indexOf('\0'); ! if (n > -1) { ! skinNames[i] = skinNames[i].substring(0, n); ! } mod.skins[i] = GL_FindImage(skinNames[i], it_skin); } *************** *** 1129,1137 **** if (sprout.version != qfiles.SPRITE_VERSION) ! ri.Sys_Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(sprout.version).add(qfiles.SPRITE_VERSION)); if (sprout.numframes > qfiles.MAX_MD2SKINS) ! ri.Sys_Error(Defines.ERR_DROP, "%s has too many frames (%i > %i)", new Vargs(3).add(mod.name).add(sprout.numframes).add(qfiles.MAX_MD2SKINS)); --- 1130,1138 ---- if (sprout.version != qfiles.SPRITE_VERSION) ! Com.Error(Defines.ERR_DROP, "%s has wrong version number (%i should be %i)", new Vargs(3).add(mod.name).add(sprout.version).add(qfiles.SPRITE_VERSION)); if (sprout.numframes > qfiles.MAX_MD2SKINS) ! Com.Error(Defines.ERR_DROP, "%s has too many frames (%i > %i)", new Vargs(3).add(mod.name).add(sprout.numframes).add(qfiles.MAX_MD2SKINS)); *************** *** 1168,1172 **** // explicitly free the old map if different // this guarantees that mod_known[0] is the world map ! flushmap = ri.Cvar_Get("flushmap", "0", 0); if ( !mod_known[0].name.equals(fullname) || flushmap.value != 0.0f) Mod_Free(mod_known[0]); --- 1169,1173 ---- // explicitly free the old map if different // this guarantees that mod_known[0] is the world map ! flushmap = Cvar.Get("flushmap", "0", 0); if ( !mod_known[0].name.equals(fullname) || flushmap.value != 0.0f) Mod_Free(mod_known[0]); Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Main.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Main.java 9 Jul 2004 08:38:27 -0000 1.1.2.1 --- Main.java 6 Sep 2004 19:39:17 -0000 1.1.2.2 *************** *** 26,33 **** package jake2.render.fastjogl; ! import jake2.*; import jake2.client.*; import jake2.game.cplane_t; import jake2.game.cvar_t; import jake2.qcommon.qfiles; import jake2.qcommon.xcommand_t; --- 26,36 ---- package jake2.render.fastjogl; ! import jake2.Defines; ! import jake2.Globals; import jake2.client.*; + import jake2.game.*; import jake2.game.cplane_t; import jake2.game.cvar_t; + import jake2.qcommon.*; import jake2.qcommon.qfiles; import jake2.qcommon.xcommand_t; *************** *** 41,47 **** import net.java.games.jogl.GL; - import net.java.games.jogl.GLU; - import net.java.games.jogl.util.BufferUtils; - import net.java.games.jogl.util.GLUT; /** --- 44,47 ---- *************** *** 52,58 **** public abstract class Main extends Base { - GL gl; - GLU glu; - GLUT glut = new GLUT(); public static int[] d_8to24table = new int[256]; --- 52,55 ---- *************** *** 84,96 **** abstract mleaf_t Mod_PointInLeaf(float[] point, model_t model); - abstract boolean QGL_Init(String dll_name); - abstract void QGL_Shutdown(); - abstract boolean GLimp_Init(int xpos, int ypos); - abstract void GLimp_BeginFrame(float camera_separation); - abstract int GLimp_SetMode(Dimension dim, int mode, boolean fullscreen); - abstract void GLimp_Shutdown(); - abstract void GLimp_EnableLogging(boolean enable); - abstract void GLimp_LogNewFrame(); - abstract void GL_SetDefaultState(); --- 81,84 ---- *************** *** 126,136 **** */ - // IMPORTED FUNCTIONS - protected refimport_t ri = null; - int GL_TEXTURE0 = GL.GL_TEXTURE0; int GL_TEXTURE1 = GL.GL_TEXTURE1; - viddef_t vid = new viddef_t(); model_t r_worldmodel; --- 114,120 ---- *************** *** 236,240 **** cvar_t gl_3dlabs_broken; - cvar_t vid_fullscreen; cvar_t vid_gamma; cvar_t vid_ref; --- 220,223 ---- *************** *** 440,444 **** break; default : ! ri.Sys_Error(Defines.ERR_DROP, "Bad modeltype"); break; } --- 423,427 ---- break; default : ! Com.Error(Defines.ERR_DROP, "Bad modeltype"); break; } *************** *** 474,478 **** break; default : ! ri.Sys_Error(Defines.ERR_DROP, "Bad modeltype"); break; } --- 457,461 ---- break; default : ! Com.Error(Defines.ERR_DROP, "Bad modeltype"); break; } *************** *** 520,528 **** color = sourceColors.get(i); gl.glColor4ub( ! (byte)((color >> 0) & 0xFF), (byte)((color >> 8) & 0xFF), (byte)((color >> 16) & 0xFF), ! (byte)((color >> 24) & 0xFF) ); // first vertex --- 503,512 ---- color = sourceColors.get(i); + gl.glColor4ub( ! (byte)((color) & 0xFF), (byte)((color >> 8) & 0xFF), (byte)((color >> 16) & 0xFF), ! (byte)((color >>> 24)) ); // first vertex *************** *** 736,752 **** */ void R_SetupGL() { - float screenaspect; - int x, x2, y2, y, w, h; // // set up viewport // ! x = (int) Math.floor(r_newrefdef.x * vid.width / vid.width); ! x2 = (int) Math.ceil((r_newrefdef.x + r_newrefdef.width) * vid.width / vid.width); ! y = (int) Math.floor(vid.height - r_newrefdef.y * vid.height / vid.height); ! y2 = (int) Math.ceil(vid.height - (r_newrefdef.y + r_newrefdef.height) * vid.height / vid.height); ! w = x2 - x; ! h = y - y2; gl.glViewport(x, y2, w, h); --- 720,738 ---- */ void R_SetupGL() { // // set up viewport // ! //int x = (int) Math.floor(r_newrefdef.x * vid.width / vid.width); ! int x = r_newrefdef.x; ! //int x2 = (int) Math.ceil((r_newrefdef.x + r_newrefdef.width) * vid.width / vid.width); ! int x2 = r_newrefdef.x + r_newrefdef.width; ! //int y = (int) Math.floor(vid.height - r_newrefdef.y * vid.height / vid.height); ! int y = vid.height - r_newrefdef.y; ! //int y2 = (int) Math.ceil(vid.height - (r_newrefdef.y + r_newrefdef.height) * vid.height / vid.height); ! int y2 = vid.height - (r_newrefdef.y + r_newrefdef.height); ! int w = x2 - x; ! int h = y - y2; gl.glViewport(x, y2, w, h); *************** *** 755,759 **** // set up projection matrix // ! screenaspect = (float) r_newrefdef.width / r_newrefdef.height; gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); --- 741,745 ---- // set up projection matrix // ! float screenaspect = (float) r_newrefdef.width / r_newrefdef.height; gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); *************** *** 846,854 **** // included by cwei if (r_newrefdef == null) { ! ri.Sys_Error(Defines.ERR_DROP, "R_RenderView: refdef_t fd is null"); } if (r_worldmodel == null && (r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) == 0) ! ri.Sys_Error(Defines.ERR_DROP, "R_RenderView: NULL worldmodel"); if (r_speeds.value != 0.0f) { --- 832,840 ---- // included by cwei if (r_newrefdef == null) { ! Com.Error(Defines.ERR_DROP, "R_RenderView: refdef_t fd is null"); } if (r_worldmodel == null && (r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) == 0) ! Com.Error(Defines.ERR_DROP, "R_RenderView: NULL worldmodel"); if (r_speeds.value != 0.0f) { *************** *** 883,887 **** if (r_speeds.value != 0.0f) { ! ri.Con_Printf( Defines.PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n", --- 869,873 ---- if (r_speeds.value != 0.0f) { ! VID.Printf( Defines.PRINT_ALL, "%4i wpoly %4i epoly %i tex %i lmaps\n", *************** *** 950,1021 **** protected void R_Register() { ! r_lefthand = ri.Cvar_Get("hand", "0", Globals.CVAR_USERINFO | Globals.CVAR_ARCHIVE); ! r_norefresh = ri.Cvar_Get("r_norefresh", "0", 0); ! r_fullbright = ri.Cvar_Get("r_fullbright", "0", 0); ! r_drawentities = ri.Cvar_Get("r_drawentities", "1", 0); ! r_drawworld = ri.Cvar_Get("r_drawworld", "1", 0); ! r_novis = ri.Cvar_Get("r_novis", "0", 0); ! r_nocull = ri.Cvar_Get("r_nocull", "0", 0); ! r_lerpmodels = ri.Cvar_Get("r_lerpmodels", "1", 0); ! r_speeds = ri.Cvar_Get("r_speeds", "0", 0); ! r_lightlevel = ri.Cvar_Get("r_lightlevel", "1", 0); ! gl_nosubimage = ri.Cvar_Get("gl_nosubimage", "0", 0); ! gl_allow_software = ri.Cvar_Get("gl_allow_software", "0", 0); ! gl_particle_min_size = ri.Cvar_Get("gl_particle_min_size", "2", Globals.CVAR_ARCHIVE); ! gl_particle_max_size = ri.Cvar_Get("gl_particle_max_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_size = ri.Cvar_Get("gl_particle_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_att_a = ri.Cvar_Get("gl_particle_att_a", "0.01", Globals.CVAR_ARCHIVE); ! gl_particle_att_b = ri.Cvar_Get("gl_particle_att_b", "0.0", Globals.CVAR_ARCHIVE); ! gl_particle_att_c = ri.Cvar_Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = ri.Cvar_Get("gl_modulate", "1", Globals.CVAR_ARCHIVE); ! gl_log = ri.Cvar_Get("gl_log", "0", 0); ! gl_bitdepth = ri.Cvar_Get("gl_bitdepth", "0", 0); ! gl_mode = ri.Cvar_Get("gl_mode", "3", Globals.CVAR_ARCHIVE); // 640x480 ! gl_lightmap = ri.Cvar_Get("gl_lightmap", "0", 0); ! gl_shadows = ri.Cvar_Get("gl_shadows", "0", Globals.CVAR_ARCHIVE); ! gl_dynamic = ri.Cvar_Get("gl_dynamic", "1", 0); ! gl_nobind = ri.Cvar_Get("gl_nobind", "0", 0); ! gl_round_down = ri.Cvar_Get("gl_round_down", "1", 0); ! gl_picmip = ri.Cvar_Get("gl_picmip", "0", 0); ! gl_skymip = ri.Cvar_Get("gl_skymip", "0", 0); ! gl_showtris = ri.Cvar_Get("gl_showtris", "0", 0); ! gl_ztrick = ri.Cvar_Get("gl_ztrick", "0", 0); ! gl_finish = ri.Cvar_Get("gl_finish", "0", Globals.CVAR_ARCHIVE); ! gl_clear = ri.Cvar_Get("gl_clear", "0", 0); ! gl_cull = ri.Cvar_Get("gl_cull", "1", 0); ! gl_polyblend = ri.Cvar_Get("gl_polyblend", "1", 0); ! gl_flashblend = ri.Cvar_Get("gl_flashblend", "0", 0); ! gl_playermip = ri.Cvar_Get("gl_playermip", "0", 0); ! gl_monolightmap = ri.Cvar_Get("gl_monolightmap", "0", 0); ! gl_driver = ri.Cvar_Get("gl_driver", "opengl32", Globals.CVAR_ARCHIVE); ! gl_texturemode = ri.Cvar_Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", Globals.CVAR_ARCHIVE); ! gl_texturealphamode = ri.Cvar_Get("gl_texturealphamode", "default", Globals.CVAR_ARCHIVE); ! gl_texturesolidmode = ri.Cvar_Get("gl_texturesolidmode", "default", Globals.CVAR_ARCHIVE); ! gl_lockpvs = ri.Cvar_Get("gl_lockpvs", "0", 0); ! gl_vertex_arrays = ri.Cvar_Get("gl_vertex_arrays", "1", Globals.CVAR_ARCHIVE); ! gl_ext_swapinterval = ri.Cvar_Get("gl_ext_swapinterval", "1", Globals.CVAR_ARCHIVE); ! gl_ext_palettedtexture = ri.Cvar_Get("gl_ext_palettedtexture", "0", Globals.CVAR_ARCHIVE); ! gl_ext_multitexture = ri.Cvar_Get("gl_ext_multitexture", "1", Globals.CVAR_ARCHIVE); ! gl_ext_pointparameters = ri.Cvar_Get("gl_ext_pointparameters", "1", Globals.CVAR_ARCHIVE); ! gl_ext_compiled_vertex_array = ri.Cvar_Get("gl_ext_compiled_vertex_array", "1", Globals.CVAR_ARCHIVE); ! gl_drawbuffer = ri.Cvar_Get("gl_drawbuffer", "GL_BACK", 0); ! gl_swapinterval = ri.Cvar_Get("gl_swapinterval", "0", Globals.CVAR_ARCHIVE); ! gl_saturatelighting = ri.Cvar_Get("gl_saturatelighting", "0", 0); ! gl_3dlabs_broken = ri.Cvar_Get("gl_3dlabs_broken", "1", Globals.CVAR_ARCHIVE); ! vid_fullscreen = ri.Cvar_Get("vid_fullscreen", "0", Globals.CVAR_ARCHIVE); ! vid_gamma = ri.Cvar_Get("vid_gamma", "1.0", Globals.CVAR_ARCHIVE); ! vid_ref = ri.Cvar_Get("vid_ref", "fastjogl", Globals.CVAR_ARCHIVE); ! ri.Cmd_AddCommand("imagelist", new xcommand_t() { public void execute() { GL_ImageList_f(); --- 936,1007 ---- protected void R_Register() { ! r_lefthand = Cvar.Get("hand", "0", Globals.CVAR_USERINFO | Globals.CVAR_ARCHIVE); ! r_norefresh = Cvar.Get("r_norefresh", "0", 0); ! r_fullbright = Cvar.Get("r_fullbright", "0", 0); ! r_drawentities = Cvar.Get("r_drawentities", "1", 0); ! r_drawworld = Cvar.Get("r_drawworld", "1", 0); ! r_novis = Cvar.Get("r_novis", "0", 0); ! r_nocull = Cvar.Get("r_nocull", "0", 0); ! r_lerpmodels = Cvar.Get("r_lerpmodels", "1", 0); ! r_speeds = Cvar.Get("r_speeds", "0", 0); ! r_lightlevel = Cvar.Get("r_lightlevel", "1", 0); ! gl_nosubimage = Cvar.Get("gl_nosubimage", "0", 0); ! gl_allow_software = Cvar.Get("gl_allow_software", "0", 0); ! gl_particle_min_size = Cvar.Get("gl_particle_min_size", "2", Globals.CVAR_ARCHIVE); ! gl_particle_max_size = Cvar.Get("gl_particle_max_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_size = Cvar.Get("gl_particle_size", "40", Globals.CVAR_ARCHIVE); ! gl_particle_att_a = Cvar.Get("gl_particle_att_a", "0.01", Globals.CVAR_ARCHIVE); ! gl_particle_att_b = Cvar.Get("gl_particle_att_b", "0.0", Globals.CVAR_ARCHIVE); ! gl_particle_att_c = Cvar.Get("gl_particle_att_c", "0.01", Globals.CVAR_ARCHIVE); ! gl_modulate = Cvar.Get("gl_modulate", "1", Globals.CVAR_ARCHIVE); ! gl_log = Cvar.Get("gl_log", "0", 0); ! gl_bitdepth = Cvar.Get("gl_bitdepth", "0", 0); ! gl_mode = Cvar.Get("gl_mode", "3", Globals.CVAR_ARCHIVE); // 640x480 ! gl_lightmap = Cvar.Get("gl_lightmap", "0", 0); ! gl_shadows = Cvar.Get("gl_shadows", "0", Globals.CVAR_ARCHIVE); ! gl_dynamic = Cvar.Get("gl_dynamic", "1", 0); ! gl_nobind = Cvar.Get("gl_nobind", "0", 0); ! gl_round_down = Cvar.Get("gl_round_down", "1", 0); ! gl_picmip = Cvar.Get("gl_picmip", "0", 0); ! gl_skymip = Cvar.Get("gl_skymip", "0", 0); ! gl_showtris = Cvar.Get("gl_showtris", "0", 0); ! gl_ztrick = Cvar.Get("gl_ztrick", "0", 0); ! gl_finish = Cvar.Get("gl_finish", "0", Globals.CVAR_ARCHIVE); ! gl_clear = Cvar.Get("gl_clear", "0", 0); ! gl_cull = Cvar.Get("gl_cull", "1", 0); ! gl_polyblend = Cvar.Get("gl_polyblend", "1", 0); ! gl_flashblend = Cvar.Get("gl_flashblend", "0", 0); ! gl_playermip = Cvar.Get("gl_playermip", "0", 0); ! gl_monolightmap = Cvar.Get("gl_monolightmap", "0", 0); ! gl_driver = Cvar.Get("gl_driver", "opengl32", Globals.CVAR_ARCHIVE); ! gl_texturemode = Cvar.Get("gl_texturemode", "GL_LINEAR_MIPMAP_NEAREST", Globals.CVAR_ARCHIVE); ! gl_texturealphamode = Cvar.Get("gl_texturealphamode", "default", Globals.CVAR_ARCHIVE); ! gl_texturesolidmode = Cvar.Get("gl_texturesolidmode", "default", Globals.CVAR_ARCHIVE); ! gl_lockpvs = Cvar.Get("gl_lockpvs", "0", 0); ! gl_vertex_arrays = Cvar.Get("gl_vertex_arrays", "1", Globals.CVAR_ARCHIVE); ! gl_ext_swapinterval = Cvar.Get("gl_ext_swapinterval", "1", Globals.CVAR_ARCHIVE); ! gl_ext_palettedtexture = Cvar.Get("gl_ext_palettedtexture", "0", Globals.CVAR_ARCHIVE); ! gl_ext_multitexture = Cvar.Get("gl_ext_multitexture", "1", Globals.CVAR_ARCHIVE); ! gl_ext_pointparameters = Cvar.Get("gl_ext_pointparameters", "1", Globals.CVAR_ARCHIVE); ! gl_ext_compiled_vertex_array = Cvar.Get("gl_ext_compiled_vertex_array", "1", Globals.CVAR_ARCHIVE); ! gl_drawbuffer = Cvar.Get("gl_drawbuffer", "GL_BACK", 0); ! gl_swapinterval = Cvar.Get("gl_swapinterval", "0", Globals.CVAR_ARCHIVE); ! gl_saturatelighting = Cvar.Get("gl_saturatelighting", "0", 0); ! gl_3dlabs_broken = Cvar.Get("gl_3dlabs_broken", "1", Globals.CVAR_ARCHIVE); ! 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() { public void execute() { GL_ImageList_f(); *************** *** 1023,1037 **** }); ! ri.Cmd_AddCommand("screenshot", new xcommand_t() { public void execute() { GL_ScreenShot_f(); } }); ! ri.Cmd_AddCommand("modellist", new xcommand_t() { public void execute() { Mod_Modellist_f(); } }); ! ri.Cmd_AddCommand("gl_strings", new xcommand_t() { public void execute() { GL_Strings_f(); --- 1009,1023 ---- }); ! Cmd.AddCommand("screenshot", new xcommand_t() { public void execute() { GL_ScreenShot_f(); } }); ! Cmd.AddCommand("modellist", new xcommand_t() { public void execute() { Mod_Modellist_f(); } }); ! Cmd.AddCommand("gl_strings", new xcommand_t() { public void execute() { GL_Strings_f(); *************** *** 1051,1056 **** // if (vid_fullscreen.modified && !gl_config.allow_cds) { ! // ri.Con_Printf(Defines.PRINT_ALL, "R_SetMode() - CDS not allowed with this driver\n"); ! // ri.Cvar_SetValue("vid_fullscree... [truncated message content] |
From: Holger Z. <hz...@us...> - 2004-09-06 19:40:04
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/server Modified Files: Tag: r_0_9 SV_CCMDS.java SV_MAIN.java SV_WORLD.java SV_INIT.java SV_GAME.java SV_SEND.java SV_ENTS.java client_t.java SV.java SV_USER.java Removed Files: Tag: r_0_9 scrap.jpage Log Message: merge changes for 0.9.3 Index: SV_WORLD.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_WORLD.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 *** SV_WORLD.java 9 Jul 2004 08:38:25 -0000 1.3.2.1 --- SV_WORLD.java 6 Sep 2004 19:39:18 -0000 1.3.2.2 *************** *** 24,36 **** package jake2.server; - import jake2.game.edict_t; - import jake2.game.trace_t; - - import jake2.*; - import jake2.client.*; import jake2.game.*; ! import jake2.qcommon.*; ! import jake2.render.*; ! import jake2.util.Vargs; public class SV_WORLD extends SV_CCMDS --- 24,30 ---- package jake2.server; import jake2.game.*; ! import jake2.qcommon.CM; ! import jake2.qcommon.Com; public class SV_WORLD extends SV_CCMDS *************** *** 177,180 **** --- 171,175 ---- if (null == ent.area.prev) return; // not linked in anywhere + RemoveLink(ent.area); ent.area.prev= ent.area.next= null; *************** *** 202,206 **** SV_UnlinkEdict(ent); // unlink from old position ! if (ent == ge.edicts[0]) return; // don't add the world --- 197,201 ---- SV_UnlinkEdict(ent); // unlink from old position ! if (ent == GameBase.g_edicts[0]) return; // don't add the world *************** *** 213,217 **** // encode the size into the entity_state for client prediction if (ent.solid == SOLID_BBOX && 0 == (ent.svflags & SVF_DEADMONSTER)) ! { // assume that x/y are equal and symetric int i= (int) (ent.maxs[0] / 8); if (i < 1) --- 208,213 ---- // encode the size into the entity_state for client prediction if (ent.solid == SOLID_BBOX && 0 == (ent.svflags & SVF_DEADMONSTER)) ! { ! // assume that x/y are equal and symetric int i= (int) (ent.maxs[0] / 8); if (i < 1) *************** *** 245,249 **** // set the abs box if (ent.solid == SOLID_BSP && (ent.s.angles[0] != 0 || ent.s.angles[1] != 0 || ent.s.angles[2] != 0)) ! { // expand for rotation float max, v; --- 241,246 ---- // set the abs box if (ent.solid == SOLID_BSP && (ent.s.angles[0] != 0 || ent.s.angles[1] != 0 || ent.s.angles[2] != 0)) ! { ! // expand for rotation float max, v; *************** *** 265,269 **** } else ! { // normal VectorAdd(ent.s.origin, ent.mins, ent.absmin); VectorAdd(ent.s.origin, ent.maxs, ent.absmax); --- 262,267 ---- } else ! { ! // normal VectorAdd(ent.s.origin, ent.mins, ent.absmin); VectorAdd(ent.s.origin, ent.maxs, ent.absmax); *************** *** 285,289 **** ent.areanum2= 0; ! //get all leafs, including solids int iw[] = {topnode}; --- 283,287 ---- ent.areanum2= 0; ! // get all leafs, including solids int iw[] = {topnode}; *************** *** 660,664 **** // clip to world clip.trace= CM.BoxTrace(start, end, mins, maxs, 0, contentmask); ! clip.trace.ent= ge.edicts[0]; if (clip.trace.fraction == 0) return clip.trace; // blocked by the world --- 658,662 ---- // clip to world clip.trace= CM.BoxTrace(start, end, mins, maxs, 0, contentmask); ! clip.trace.ent= GameBase.g_edicts[0]; if (clip.trace.fraction == 0) return clip.trace; // blocked by the world Index: SV_MAIN.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_MAIN.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 *** SV_MAIN.java 9 Jul 2004 08:38:25 -0000 1.2.2.1 --- SV_MAIN.java 6 Sep 2004 19:39:18 -0000 1.2.2.2 *************** *** 90,94 **** // call the prog function for removing a client // this will remove the body, among other things ! SV_GAME.ge.ClientDisconnect(drop.edict); } --- 90,94 ---- // call the prog function for removing a client // this will remove the body, among other things ! PlayerClient.ClientDisconnect(drop.edict); } *************** *** 364,373 **** //edictnum = (newcl-svs.clients)+1; int edictnum = i + 1; ! edict_t ent = ge.edicts[edictnum]; svs.clients[i].edict = ent; svs.clients[i].challenge = challenge; // save challenge for checksumming // get the game a chance to reject this connection or modify the userinfo ! if (!(ge.ClientConnect(ent, userinfo))) { if (Info.Info_ValueForKey(userinfo, "rejmsg") != null) Netchan.OutOfBandPrint( --- 364,373 ---- //edictnum = (newcl-svs.clients)+1; int edictnum = i + 1; ! edict_t ent = GameBase.g_edicts[edictnum]; svs.clients[i].edict = ent; svs.clients[i].challenge = challenge; // save challenge for checksumming // get the game a chance to reject this connection or modify the userinfo ! if (!(PlayerClient.ClientConnect(ent, userinfo))) { if (Info.Info_ValueForKey(userinfo, "rejmsg") != null) Netchan.OutOfBandPrint( *************** *** 445,450 **** for (i = 2; i < Cmd.Argc(); i++) { ! strcat(remaining, Cmd.Argv(i)); ! strcat(remaining, " "); } --- 445,450 ---- for (i = 2; i < Cmd.Argc(); i++) { ! remaining += Cmd.Argv(i); ! remaining += " "; } *************** *** 671,676 **** int i; ! for (i = 0; i < ge.num_edicts; i++) { ! ent = SV_GAME.ge.edicts[i]; // events only last for a single message ent.s.event = 0; --- 671,676 ---- int i; ! for (i = 0; i < GameBase.num_edicts; i++) { ! ent = GameBase.g_edicts[i]; // events only last for a single message ent.s.event = 0; *************** *** 697,701 **** // don't run if paused if (0 == sv_paused.value || maxclients.value > 1) { ! ge.RunFrame(); // never get more than one tic behind --- 697,701 ---- // don't run if paused if (0 == sv_paused.value || maxclients.value > 1) { ! Game.G_RunFrame(); // never get more than one tic behind *************** *** 863,867 **** // call prog code to allow overrides ! SV_GAME.ge.ClientUserinfoChanged(cl.edict, cl.userinfo); // name for C code --- 863,867 ---- // call prog code to allow overrides ! PlayerClient.ClientUserinfoChanged(cl.edict, cl.userinfo); // name for C code *************** *** 1007,1013 **** //memset (&sv, 0, sizeof(sv)); sv = new server_t(); - ! Com.SetServerState (sv.state); // free server static data --- 1007,1012 ---- //memset (&sv, 0, sizeof(sv)); sv = new server_t(); ! Globals.server_state= sv.state; // free server static data Index: SV_INIT.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_INIT.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 *** SV_INIT.java 9 Jul 2004 08:38:24 -0000 1.3.2.1 --- SV_INIT.java 6 Sep 2004 19:39:18 -0000 1.3.2.2 *************** *** 24,42 **** package jake2.server; ! import java.io.IOException; ! import java.io.RandomAccessFile; ! ! import jake2.*; ! import jake2.client.*; import jake2.game.*; import jake2.qcommon.*; - import jake2.render.*; import jake2.sys.NET; - import jake2.util.Lib; ! public class SV_INIT extends Globals { ! public static server_static_t svs = new server_static_t(); // persistant server info ! public static server_t sv = new server_t(); // local server /* --- 24,41 ---- package jake2.server; ! import jake2.Globals; ! import jake2.client.CL; ! import jake2.client.SCR; import jake2.game.*; import jake2.qcommon.*; import jake2.sys.NET; ! import java.io.IOException; ! import java.io.RandomAccessFile; ! public class SV_INIT extends Globals { ! ! public static server_static_t svs= new server_static_t(); // persistant server info ! public static server_t sv= new server_t(); // local server /* *************** *** 52,56 **** return 0; ! for (i = 1; i < max && sv.configstrings[start + i] != null; i++) if (0 == strcmp(sv.configstrings[start + i], name)) return i; --- 51,55 ---- return 0; ! for (i= 1; i < max && sv.configstrings[start + i] != null; i++) if (0 == strcmp(sv.configstrings[start + i], name)) return i; *************** *** 63,67 **** //strncpy (sv.configstrings[start+i], name, sizeof(sv.configstrings[i])); ! sv.configstrings[start + i] = name; if (sv.state != ss_loading) { // send the update to everyone --- 62,66 ---- //strncpy (sv.configstrings[start+i], name, sizeof(sv.configstrings[i])); ! sv.configstrings[start + i]= name; if (sv.state != ss_loading) { // send the update to everyone *************** *** 101,107 **** int entnum; ! for (entnum = 1; entnum < SV_GAME.ge.num_edicts; entnum++) { //svent = EDICT_NUM(entnum); ! svent = SV_GAME.ge.edicts[entnum]; if (!svent.inuse) --- 100,106 ---- int entnum; ! for (entnum= 1; entnum < GameBase.num_edicts; entnum++) { //svent = EDICT_NUM(entnum); ! svent= GameBase.g_edicts[entnum]; if (!svent.inuse) *************** *** 109,113 **** if (0 == svent.s.modelindex && 0 == svent.s.sound && 0 == svent.s.effects) continue; ! svent.s.number = entnum; // --- 108,112 ---- if (0 == svent.s.modelindex && 0 == svent.s.sound && 0 == svent.s.effects) continue; ! svent.s.number= entnum; // *************** *** 116,120 **** VectorCopy(svent.s.origin, svent.s.old_origin); // rst: bugfix ! sv.baselines[entnum].set(svent.s);// = svent.s.getClone(); } } --- 115,119 ---- VectorCopy(svent.s.origin, svent.s.old_origin); // rst: bugfix ! sv.baselines[entnum].set(svent.s); // = svent.s.getClone(); } } *************** *** 126,132 **** */ public static void SV_CheckForSavegame() { ! //char name[MAX_OSPATH]; String name; - //FILE *f; RandomAccessFile f; --- 125,130 ---- */ public static void SV_CheckForSavegame() { ! String name; RandomAccessFile f; *************** *** 139,149 **** return; ! name = FS.Gamedir() + "/save/current/" + sv.name + ".sav"; try { ! f = new RandomAccessFile(name, "r"); } catch (Exception e) { ! return; // no savegame } --- 137,147 ---- return; ! name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; try { ! f= new RandomAccessFile(name, "r"); } catch (Exception e) { ! return; } *************** *** 168,177 **** int previousState; // PGM ! previousState = sv.state; // PGM ! sv.state = ss_loading; // PGM ! for (i = 0; i < 100; i++) ! SV_GAME.ge.RunFrame(); ! sv.state = previousState; // PGM } } --- 166,175 ---- int previousState; // PGM ! previousState= sv.state; // PGM ! sv.state= ss_loading; // PGM ! for (i= 0; i < 100; i++) ! Game.G_RunFrame(); ! sv.state= previousState; // PGM } } *************** *** 186,197 **** ================ */ ! public static void SV_SpawnServer( ! String server, ! String spawnpoint, ! int serverstate, ! boolean attractloop, ! boolean loadgame) { int i; ! int checksum = 0; if (attractloop) --- 184,190 ---- ================ */ ! public static void SV_SpawnServer(String server, String spawnpoint, int serverstate, boolean attractloop, boolean loadgame) { int i; ! int checksum= 0; if (attractloop) *************** *** 210,265 **** svs.spawncount++; // any partially connected client will be // restarted ! sv.state = ss_dead; ! ! Com.SetServerState(sv.state); // wipe the entire per-level structure //memset(sv, 0, sizeof(sv)); ! sv = new server_t(); ! ! svs.realtime = 0; ! sv.loadgame = loadgame; ! sv.attractloop = attractloop; // save name for levels that don't set message sv.configstrings[CS_NAME]= server; ! ! if (Cvar.VariableValue("deathmatch")!=0) { ! sv.configstrings[CS_AIRACCEL] = ""+SV_MAIN.sv_airaccelerate.value; ! PMove.pm_airaccelerate = SV_MAIN.sv_airaccelerate.value; } else { ! sv.configstrings[CS_AIRACCEL] = "0"; ! PMove.pm_airaccelerate = 0; } SZ.Init(sv.multicast, sv.multicast_buf, sv.multicast_buf.length); ! sv.name = server; // leave slots at start for clients only ! for (i = 0; i < SV_MAIN.maxclients.value; i++) { // needs to reconnect if (svs.clients[i].state > cs_connected) ! svs.clients[i].state = cs_connected; ! svs.clients[i].lastframe = -1; } ! sv.time = 1000; ! sv.name=server; ! sv.configstrings[CS_NAME] = server; ! ! int iw[] = {checksum}; if (serverstate != ss_game) { ! sv.models[1] = CM.CM_LoadMap("", false, iw); // no real map } else { ! sv.configstrings[CS_MODELS + 1] = "maps/" + server + ".bsp"; ! sv.models[1] = CM.CM_LoadMap(sv.configstrings[CS_MODELS + 1], false, iw); } ! checksum = iw[0]; ! sv.configstrings[CS_MAPCHECKSUM] = "" + checksum; // --- 203,259 ---- svs.spawncount++; // any partially connected client will be // restarted ! ! sv.state= ss_dead; ! ! Globals.server_state= sv.state; // wipe the entire per-level structure //memset(sv, 0, sizeof(sv)); ! sv= new server_t(); ! ! svs.realtime= 0; ! sv.loadgame= loadgame; ! sv.attractloop= attractloop; // save name for levels that don't set message sv.configstrings[CS_NAME]= server; ! ! if (Cvar.VariableValue("deathmatch") != 0) { ! sv.configstrings[CS_AIRACCEL]= "" + SV_MAIN.sv_airaccelerate.value; ! PMove.pm_airaccelerate= SV_MAIN.sv_airaccelerate.value; } else { ! sv.configstrings[CS_AIRACCEL]= "0"; ! PMove.pm_airaccelerate= 0; } SZ.Init(sv.multicast, sv.multicast_buf, sv.multicast_buf.length); ! sv.name= server; // leave slots at start for clients only ! for (i= 0; i < SV_MAIN.maxclients.value; i++) { // needs to reconnect if (svs.clients[i].state > cs_connected) ! svs.clients[i].state= cs_connected; ! svs.clients[i].lastframe= -1; } ! sv.time= 1000; ! sv.name= server; ! sv.configstrings[CS_NAME]= server; ! ! int iw[]= { checksum }; if (serverstate != ss_game) { ! sv.models[1]= CM.CM_LoadMap("", false, iw); // no real map } else { ! sv.configstrings[CS_MODELS + 1]= "maps/" + server + ".bsp"; ! sv.models[1]= CM.CM_LoadMap(sv.configstrings[CS_MODELS + 1], false, iw); } ! checksum= iw[0]; ! sv.configstrings[CS_MAPCHECKSUM]= "" + checksum; // *************** *** 268,275 **** SV_WORLD.SV_ClearWorld(); ! for (i = 1; i < CM.CM_NumInlineModels(); i++) { ! sv.configstrings[CS_MODELS + 1 + i] = "*" + i; // copy references ! sv.models[i + 1] = CM.InlineModel(sv.configstrings[CS_MODELS + 1 + i]); } --- 262,269 ---- SV_WORLD.SV_ClearWorld(); ! for (i= 1; i < CM.CM_NumInlineModels(); i++) { ! sv.configstrings[CS_MODELS + 1 + i]= "*" + i; // copy references ! sv.models[i + 1]= CM.InlineModel(sv.configstrings[CS_MODELS + 1 + i]); } *************** *** 280,296 **** // precache and static commands can be issued during // map initialization ! sv.state = ss_loading; ! Com.SetServerState(sv.state); // load and spawn all other entities ! SV_GAME.ge.SpawnEntities(sv.name, CM.CM_EntityString(), spawnpoint); // run two frames to allow everything to settle ! SV_GAME.ge.RunFrame(); ! SV_GAME.ge.RunFrame(); // all precaches are complete ! sv.state = serverstate; ! Com.SetServerState(sv.state); // create a baseline for more efficient communications --- 274,291 ---- // precache and static commands can be issued during // map initialization ! ! sv.state= ss_loading; ! Globals.server_state= sv.state; // load and spawn all other entities ! Game.SpawnEntities(sv.name, CM.CM_EntityString(), spawnpoint); // run two frames to allow everything to settle ! Game.G_RunFrame(); ! Game.G_RunFrame(); // all precaches are complete ! sv.state= serverstate; ! Globals.server_state= sv.state; // create a baseline for more efficient communications *************** *** 315,319 **** public static void SV_InitGame() { int i; ! edict_t ent; //char idmaster[32]; String idmaster; --- 310,314 ---- public static void SV_InitGame() { int i; ! edict_t ent; //char idmaster[32]; String idmaster; *************** *** 332,338 **** Cvar.GetLatchedVars(); ! svs.initialized = true; ! if (Cvar.VariableValue("coop")!=0 && Cvar.VariableValue("deathmatch")!=0) { Com.Printf("Deathmatch and Coop both set, disabling Coop\n"); Cvar.FullSet("coop", "0", CVAR_SERVERINFO | CVAR_LATCH); --- 327,333 ---- Cvar.GetLatchedVars(); ! svs.initialized= true; ! if (Cvar.VariableValue("coop") != 0 && Cvar.VariableValue("deathmatch") != 0) { Com.Printf("Deathmatch and Coop both set, disabling Coop\n"); Cvar.FullSet("coop", "0", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 341,357 **** // dedicated servers are can't be single player and are usually DM // so unless they explicity set coop, force it to deathmatch ! if (dedicated.value!=0) { ! if (0==Cvar.VariableValue("coop")) Cvar.FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH); } // init clients ! if (Cvar.VariableValue("deathmatch")!=0) { if (SV_MAIN.maxclients.value <= 1) Cvar.FullSet("maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH); else if (SV_MAIN.maxclients.value > MAX_CLIENTS) ! Cvar.FullSet("maxclients", "" + MAX_CLIENTS, CVAR_SERVERINFO | CVAR_LATCH); } ! else if (Cvar.VariableValue("coop")!=0) { if (SV_MAIN.maxclients.value <= 1 || SV_MAIN.maxclients.value > 4) Cvar.FullSet("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); --- 336,352 ---- // dedicated servers are can't be single player and are usually DM // so unless they explicity set coop, force it to deathmatch ! if (dedicated.value != 0) { ! if (0 == Cvar.VariableValue("coop")) Cvar.FullSet("deathmatch", "1", CVAR_SERVERINFO | CVAR_LATCH); } // init clients ! if (Cvar.VariableValue("deathmatch") != 0) { if (SV_MAIN.maxclients.value <= 1) Cvar.FullSet("maxclients", "8", CVAR_SERVERINFO | CVAR_LATCH); else if (SV_MAIN.maxclients.value > MAX_CLIENTS) ! Cvar.FullSet("maxclients", "" + MAX_CLIENTS, CVAR_SERVERINFO | CVAR_LATCH); } ! else if (Cvar.VariableValue("coop") != 0) { if (SV_MAIN.maxclients.value <= 1 || SV_MAIN.maxclients.value > 4) Cvar.FullSet("maxclients", "4", CVAR_SERVERINFO | CVAR_LATCH); *************** *** 363,378 **** } ! svs.spawncount = rand(); //svs.clients = Z_Malloc(sizeof(client_t) * maxclients.value); ! svs.clients = new client_t[(int) SV_MAIN.maxclients.value]; ! for (int n=0; n < svs.clients.length; n++) svs.clients[n]= new client_t(); ! ! svs.num_client_entities = ((int) SV_MAIN.maxclients.value) * UPDATE_BACKUP * 64; //ok. ! //svs.client_entities = Z_Malloc(sizeof(entity_state_t) * svs.num_client_entities); ! svs.client_entities = new entity_state_t[svs.num_client_entities]; ! for (int n=0; n < svs.client_entities.length; n++) ! svs.client_entities[n] = new entity_state_t(null); // init network stuff --- 358,373 ---- } ! svs.spawncount= rand(); //svs.clients = Z_Malloc(sizeof(client_t) * maxclients.value); ! svs.clients= new client_t[(int) SV_MAIN.maxclients.value]; ! for (int n= 0; n < svs.clients.length; n++) svs.clients[n]= new client_t(); ! ! svs.num_client_entities= ((int) SV_MAIN.maxclients.value) * UPDATE_BACKUP * 64; //ok. ! //svs.client_entities = Z_Malloc(sizeof(entity_state_t) * svs.num_client_entities); ! svs.client_entities= new entity_state_t[svs.num_client_entities]; ! for (int n= 0; n < svs.client_entities.length; n++) ! svs.client_entities[n]= new entity_state_t(null); // init network stuff *************** *** 380,397 **** // heartbeats will always be sent to the id master ! svs.last_heartbeat = -99999; // send immediately ! idmaster = "192.246.40.37:" + PORT_MASTER; NET.StringToAdr(idmaster, SV_MAIN.master_adr[0]); // init game SV_GAME.SV_InitGameProgs(); // bis hier alles ok! ! ! for (i = 0; i < SV_MAIN.maxclients.value; i++) { ! ent = SV_GAME.ge.edicts[i + 1]; ! //ent.s.number = i + 1; //dont need this, ent.s.number already set. ! svs.clients[i].edict = ent; //memset(& svs.clients[i].lastcmd, 0, sizeof(svs.clients[i].lastcmd)); ! svs.clients[i].lastcmd = new usercmd_t(); } } --- 375,392 ---- // heartbeats will always be sent to the id master ! svs.last_heartbeat= -99999; // send immediately ! idmaster= "192.246.40.37:" + PORT_MASTER; NET.StringToAdr(idmaster, SV_MAIN.master_adr[0]); // init game SV_GAME.SV_InitGameProgs(); // bis hier alles ok! ! ! for (i= 0; i < SV_MAIN.maxclients.value; i++) { ! ent= GameBase.g_edicts[i + 1]; ! //ent.s.number = i + 1; //dont need this, ent.s.number already set. ! svs.clients[i].edict= ent; //memset(& svs.clients[i].lastcmd, 0, sizeof(svs.clients[i].lastcmd)); ! svs.clients[i].lastcmd= new usercmd_t(); } } *************** *** 421,431 **** String level, ch, spawnpoint; ! sv.loadgame = loadgame; ! sv.attractloop = attractloop; if (sv.state == ss_dead && !sv.loadgame) SV_InitGame(); // the game is just starting ! level = levelstring; // bis hier her ok. // if there is a + in the map, set nextserver to the remainder --- 416,426 ---- String level, ch, spawnpoint; ! sv.loadgame= loadgame; ! sv.attractloop= attractloop; if (sv.state == ss_dead && !sv.loadgame) SV_InitGame(); // the game is just starting ! level= levelstring; // bis hier her ok. // if there is a + in the map, set nextserver to the remainder *************** *** 441,448 **** // Cvar_Set ("nextserver", ""); ! int c = level.indexOf('+'); if (c != -1) { ! Cvar.Set("nextserver","gamemap \"" + level.substring(c+1) + "\""); ! level = level.substring(0, c); } else { --- 436,443 ---- // Cvar_Set ("nextserver", ""); ! int c= level.indexOf('+'); if (c != -1) { ! Cvar.Set("nextserver", "gamemap \"" + level.substring(c + 1) + "\""); ! level= level.substring(0, c); } else { *************** *** 451,474 **** //ZOID special hack for end game screen in coop mode ! if (Cvar.VariableValue("coop")!=0 && !level.equals( "victory.pcx")) Cvar.Set("nextserver", "gamemap \"*base1\""); // if there is a $, use the remainder as a spawnpoint ! int pos = level.indexOf('$'); ! if (pos!=-1) { //* ch = 0; ! spawnpoint = level.substring(pos + 1); ! level = level.substring(0,pos); ! } else //spawnpoint[0] = 0; ! spawnpoint = ""; // skip the end-of-unit flag if necessary if (level.charAt(0) == '*') ! level = level.substring(1); ! l = level.length(); if (l > 4 && level.endsWith(".cin")) { SCR.BeginLoadingPlaque(); // for local system --- 446,469 ---- //ZOID special hack for end game screen in coop mode ! if (Cvar.VariableValue("coop") != 0 && !level.equals("victory.pcx")) Cvar.Set("nextserver", "gamemap \"*base1\""); // if there is a $, use the remainder as a spawnpoint ! int pos= level.indexOf('$'); ! if (pos != -1) { //* ch = 0; ! spawnpoint= level.substring(pos + 1); ! level= level.substring(0, pos); ! } else //spawnpoint[0] = 0; ! spawnpoint= ""; // skip the end-of-unit flag if necessary if (level.charAt(0) == '*') ! level= level.substring(1); ! l= level.length(); if (l > 4 && level.endsWith(".cin")) { SCR.BeginLoadingPlaque(); // for local system Index: SV.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** SV.java 8 Jul 2004 15:58:45 -0000 1.2 --- SV.java 6 Sep 2004 19:39:18 -0000 1.2.2.1 *************** *** 5,9 **** * $Id$ */ ! /* Copyright (C) 1997-2001 Id Software, Inc. --- 5,9 ---- * $Id$ */ ! /* Copyright (C) 1997-2001 Id Software, Inc. [...2073 lines suppressed...] ====================== ! *///ok ! public static boolean SV_CloseEnough(edict_t ent, edict_t goal, float dist) { int i; ! ! for (i = 0; i < 3; i++) { if (goal.absmin[i] > ent.absmax[i] + dist) return false; --- 1193,1203 ---- ====================== ! */ //ok ! public static boolean SV_CloseEnough(edict_t ent, edict_t goal, float dist) ! { int i; ! ! for (i= 0; i < 3; i++) ! { if (goal.absmin[i] > ent.absmax[i] + dist) return false; Index: SV_CCMDS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_CCMDS.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 *** SV_CCMDS.java 9 Jul 2004 08:38:25 -0000 1.2.2.1 --- SV_CCMDS.java 6 Sep 2004 19:39:18 -0000 1.2.2.2 *************** *** 29,37 **** import jake2.sys.NET; import jake2.sys.Sys; ! import jake2.util.Lib; import jake2.util.Vargs; import java.io.*; ! import java.util.Date; public class SV_CCMDS extends SV_ENTS { --- 29,37 ---- [...1043 lines suppressed...] } *************** *** 1082,1091 **** */ public static void SV_ServerCommand_f() { - if (SV_GAME.ge == null) { - Com.Printf("No game loaded.\n"); - return; - } ! SV_GAME.ge.ServerCommand(); } --- 1052,1057 ---- */ public static void SV_ServerCommand_f() { ! Game.ServerCommand(); } Index: SV_ENTS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_ENTS.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** SV_ENTS.java 8 Jul 2004 15:58:45 -0000 1.2 --- SV_ENTS.java 6 Sep 2004 19:39:18 -0000 1.2.2.1 *************** *** 24,35 **** package jake2.server; - import java.io.IOException; - - import jake2.*; - import jake2.client.*; import jake2.game.*; import jake2.qcommon.*; ! import jake2.render.*; ! import jake2.util.Vargs; public class SV_ENTS extends SV_USER { --- 24,31 ---- package jake2.server; import jake2.game.*; import jake2.qcommon.*; ! ! import java.io.IOException; public class SV_ENTS extends SV_USER { *************** *** 384,388 **** leafs[i] = CM.CM_LeafCluster(leafs[i]); ! memcpy(fatpvs, CM.CM_ClusterPVS(leafs[0]), longs << 2); // or in all the other leaf bits for (i = 1; i < count; i++) { --- 380,384 ---- leafs[i] = CM.CM_LeafCluster(leafs[i]); ! System.arraycopy(CM.CM_ClusterPVS(leafs[0]), 0, fatpvs, 0, longs << 2); // or in all the other leaf bits for (i = 1; i < count; i++) { *************** *** 461,466 **** c_fullsend = 0; ! for (e = 1; e < SV_GAME.ge.num_edicts; e++) { ! ent = SV_GAME.ge.edicts[e]; // ignore ents without visible models --- 457,462 ---- c_fullsend = 0; ! for (e = 1; e < GameBase.num_edicts; e++) { ! ent = GameBase.g_edicts[e]; // ignore ents without visible models *************** *** 572,578 **** e = 1; ! ent = SV_GAME.ge.edicts[e]; ! while (e < SV_GAME.ge.num_edicts) { // ignore ents without visible models unless they have an effect if (ent.inuse --- 568,574 ---- e = 1; ! ent = GameBase.g_edicts[e]; ! while (e < GameBase.num_edicts) { // ignore ents without visible models unless they have an effect if (ent.inuse *************** *** 583,587 **** e++; ! ent = SV_GAME.ge.edicts[e]; } --- 579,583 ---- e++; ! ent = GameBase.g_edicts[e]; } Index: SV_SEND.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_SEND.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** SV_SEND.java 8 Jul 2004 20:56:54 -0000 1.3 --- SV_SEND.java 6 Sep 2004 19:39:18 -0000 1.3.2.1 *************** *** 41,49 **** */ ! public static byte sv_outputbuf[] = new byte[SV_OUTPUTBUF_LENGTH]; public static void SV_FlushRedirect(int sv_redirected, byte outputbuf[]) { if (sv_redirected == RD_PACKET) { ! String s = ("print\n" + outputbuf); Netchan.Netchan_OutOfBand(NS_SERVER, Netchan.net_from, s.length(), s.getBytes()); } --- 41,49 ---- */ ! public static byte sv_outputbuf[]= new byte[SV_OUTPUTBUF_LENGTH]; public static void SV_FlushRedirect(int sv_redirected, byte outputbuf[]) { if (sv_redirected == RD_PACKET) { ! String s= ("print\n" + outputbuf); Netchan.Netchan_OutOfBand(NS_SERVER, Netchan.net_from, s.length(), s.getBytes()); } *************** *** 104,124 **** // echo to console ! if (dedicated.value!=0) ! { ! ! //char copy[1024]; ! //int i; ! ! // mask off high bits ! //for (i=0 ; i<1023 && string[i] ; i++) ! //copy[i] = string[i]&127; ! //copy[i] = 0; ! //Com_Printf ("%s", copy); ! ! Com.Printf(s); ! } ! for (int i = 0; i < SV_MAIN.maxclients.value; i++) { ! cl = SV_MAIN.svs.clients[i]; if (level < cl.messagelevel) continue; --- 104,123 ---- // echo to console ! if (dedicated.value != 0) { ! //char copy[1024]; ! //int i; ! ! // mask off high bits ! //for (i=0 ; i<1023 && string[i] ; i++) ! //copy[i] = string[i]&127; ! //copy[i] = 0; ! //Com_Printf ("%s", copy); ! ! Com.Printf(s); ! } ! ! for (int i= 0; i < SV_MAIN.maxclients.value; i++) { ! cl= SV_MAIN.svs.clients[i]; if (level < cl.messagelevel) continue; *************** *** 174,186 **** int area1, area2; ! reliable = false; if (to != MULTICAST_ALL_R && to != MULTICAST_ALL) { ! leafnum = CM.CM_PointLeafnum(origin); ! area1 = CM.CM_LeafArea(leafnum); } else { ! leafnum = 0; // just to avoid compiler warnings ! area1 = 0; } --- 173,185 ---- int area1, area2; ! reliable= false; if (to != MULTICAST_ALL_R && to != MULTICAST_ALL) { ! leafnum= CM.CM_PointLeafnum(origin); ! area1= CM.CM_LeafArea(leafnum); } else { ! leafnum= 0; // just to avoid compiler warnings ! area1= 0; } *************** *** 191,224 **** switch (to) { case MULTICAST_ALL_R : ! reliable = true; // intentional fallthrough, no break here case MULTICAST_ALL : ! leafnum = 0; ! mask = null; break; case MULTICAST_PHS_R : ! reliable = true; // intentional fallthrough case MULTICAST_PHS : ! leafnum = CM.CM_PointLeafnum(origin); ! cluster = CM.CM_LeafCluster(leafnum); ! mask = CM.CM_ClusterPHS(cluster); break; case MULTICAST_PVS_R : ! reliable = true; // intentional fallthrough case MULTICAST_PVS : ! leafnum = CM.CM_PointLeafnum(origin); ! cluster = CM.CM_LeafCluster(leafnum); ! mask = CM.CM_ClusterPVS(cluster); break; default : ! mask = null; Com.Error(ERR_FATAL, "SV_Multicast: bad to:" + to + "\n"); } // send the data to all relevent clients ! for (j = 0; j < maxclients.value; j++) { ! client = svs.clients[j]; if (client.state == cs_free || client.state == cs_zombie) --- 190,223 ---- switch (to) { case MULTICAST_ALL_R : ! reliable= true; // intentional fallthrough, no break here case MULTICAST_ALL : ! leafnum= 0; ! mask= null; break; case MULTICAST_PHS_R : ! reliable= true; // intentional fallthrough case MULTICAST_PHS : ! leafnum= CM.CM_PointLeafnum(origin); ! cluster= CM.CM_LeafCluster(leafnum); ! mask= CM.CM_ClusterPHS(cluster); break; case MULTICAST_PVS_R : ! reliable= true; // intentional fallthrough case MULTICAST_PVS : ! leafnum= CM.CM_PointLeafnum(origin); ! cluster= CM.CM_LeafCluster(leafnum); ! mask= CM.CM_ClusterPVS(cluster); break; default : ! mask= null; Com.Error(ERR_FATAL, "SV_Multicast: bad to:" + to + "\n"); } // send the data to all relevent clients ! for (j= 0; j < maxclients.value; j++) { ! client= svs.clients[j]; if (client.state == cs_free || client.state == cs_zombie) *************** *** 228,237 **** if (mask != null) { ! leafnum = CM.CM_PointLeafnum(client.edict.s.origin); ! cluster = CM.CM_LeafCluster(leafnum); ! area2 = CM.CM_LeafArea(leafnum); if (!CM.CM_AreasConnected(area1, area2)) continue; ! // quake2 bugfix if (cluster == -1) --- 227,236 ---- if (mask != null) { ! leafnum= CM.CM_PointLeafnum(client.edict.s.origin); ! cluster= CM.CM_LeafCluster(leafnum); ! area2= CM.CM_LeafArea(leafnum); if (!CM.CM_AreasConnected(area1, area2)) continue; ! // quake2 bugfix if (cluster == -1) *************** *** 288,292 **** int i; int ent; ! float[] origin_v = {0,0,0}; boolean use_phs; --- 287,291 ---- int i; int ent; ! float[] origin_v= { 0, 0, 0 }; boolean use_phs; *************** *** 303,321 **** Com.Error(ERR_FATAL, "SV_StartSound: timeofs = " + timeofs); ! //ent = NUM_FOR_EDICT(entity); ! //TODO: somehow risky (dont know if constant correct index) ! ent = entity.index; ! if ((channel & 8) != 0) // no PHS flag ! { ! use_phs = false; channel &= 7; } else ! use_phs = true; ! sendchan = (ent << 3) | (channel & 7); ! flags = 0; if (volume != Defines.DEFAULT_SOUND_PACKET_VOLUME) flags |= SND_VOLUME; --- 302,318 ---- Com.Error(ERR_FATAL, "SV_StartSound: timeofs = " + timeofs); ! ent= entity.index; ! // no PHS flag ! if ((channel & 8) != 0) { ! use_phs= false; channel &= 7; } else ! use_phs= true; ! sendchan= (ent << 3) | (channel & 7); ! flags= 0; if (volume != Defines.DEFAULT_SOUND_PACKET_VOLUME) flags |= SND_VOLUME; *************** *** 336,343 **** // use the entity origin unless it is a bmodel or explicitly specified if (origin == null) { ! origin = origin_v; if (entity.solid == SOLID_BSP) { ! for (i = 0; i < 3; i++) ! origin_v[i] = entity.s.origin[i] + 0.5f * (entity.mins[i] + entity.maxs[i]); } else { --- 333,340 ---- // use the entity origin unless it is a bmodel or explicitly specified if (origin == null) { ! origin= origin_v; if (entity.solid == SOLID_BSP) { ! for (i= 0; i < 3; i++) ! origin_v[i]= entity.s.origin[i] + 0.5f * (entity.mins[i] + entity.maxs[i]); } else { *************** *** 366,370 **** // (global radio chatter, voiceovers, etc) if (attenuation == ATTN_NONE) ! use_phs = false; if ((channel & CHAN_RELIABLE) != 0) { --- 363,367 ---- // (global radio chatter, voiceovers, etc) if (attenuation == ATTN_NONE) ! use_phs= false; if ((channel & CHAN_RELIABLE) != 0) { *************** *** 396,410 **** */ public static boolean SV_SendClientDatagram(client_t client) { ! byte msg_buf[] = new byte[MAX_MSGLEN]; ! sizebuf_t msg = new sizebuf_t(); SV_ENTS.SV_BuildClientFrame(client); SZ.Init(msg, msg_buf, msg_buf.length); ! msg.allowoverflow = true; // send over all the relevant entity_state_t // and the player_state_t ! SV_CCMDS.SV_WriteFrameToClient (client, msg); // copy the accumulated multicast datagram --- 393,407 ---- */ public static boolean SV_SendClientDatagram(client_t client) { ! byte msg_buf[]= new byte[MAX_MSGLEN]; ! sizebuf_t msg= new sizebuf_t(); SV_ENTS.SV_BuildClientFrame(client); SZ.Init(msg, msg_buf, msg_buf.length); ! msg.allowoverflow= true; // send over all the relevant entity_state_t // and the player_state_t ! SV_CCMDS.SV_WriteFrameToClient(client, msg); // copy the accumulated multicast datagram *************** *** 427,431 **** // record the size for rate estimation ! client.message_size[sv.framenum % RATE_MESSAGES] = msg.cursize; return true; --- 424,428 ---- // record the size for rate estimation ! client.message_size[sv.framenum % RATE_MESSAGES]= msg.cursize; return true; *************** *** 445,449 **** Com.Printf("IOError closing d9emo fiele:" + e); } ! sv.demofile = null; } SV_ENTS.SV_Nextserver(); --- 442,446 ---- Com.Printf("IOError closing d9emo fiele:" + e); } ! sv.demofile= null; } SV_ENTS.SV_Nextserver(); *************** *** 466,472 **** return false; ! total = 0; ! for (i = 0; i < RATE_MESSAGES; i++) { total += c.message_size[i]; } --- 463,469 ---- return false; ! total= 0; ! for (i= 0; i < RATE_MESSAGES; i++) { total += c.message_size[i]; } *************** *** 474,478 **** if (total > c.rate) { c.surpressCount++; ! c.message_size[sv.framenum % RATE_MESSAGES] = 0; return true; } --- 471,475 ---- if (total > c.rate) { c.surpressCount++; ! c.message_size[sv.framenum % RATE_MESSAGES]= 0; return true; } *************** *** 490,507 **** client_t c; int msglen; ! byte msgbuf[] = new byte[MAX_MSGLEN]; int r; ! msglen = 0; // read the next demo message if needed if (sv.state == ss_demo && sv.demofile != null) { if (sv_paused.value != 0) ! msglen = 0; else { // get the next message //r = fread (&msglen, 4, 1, sv.demofile); try { ! msglen = EndianHandler.swapInt(sv.demofile.readInt()); } catch (Exception e) { --- 487,504 ---- client_t c; int msglen; ! byte msgbuf[]= new byte[MAX_MSGLEN]; int r; ! msglen= 0; // read the next demo message if needed if (sv.state == ss_demo && sv.demofile != null) { if (sv_paused.value != 0) ! msglen= 0; else { // get the next message //r = fread (&msglen, 4, 1, sv.demofile); try { ! msglen= EndianHandler.swapInt(sv.demofile.readInt()); } catch (Exception e) { *************** *** 519,525 **** //r = fread (msgbuf, msglen, 1, sv.demofile); ! r = 0; try { ! r = sv.demofile.read(msgbuf, 0, msglen); } catch (IOException e1) { --- 516,522 ---- //r = fread (msgbuf, msglen, 1, sv.demofile); ! r= 0; try { ! r= sv.demofile.read(msgbuf, 0, msglen); } catch (IOException e1) { *************** *** 534,539 **** // send a message to each connected client ! for (i = 0; i < maxclients.value; i++) { ! c = svs.clients[i]; if (c.state == 0) --- 531,536 ---- // send a message to each connected client ! for (i= 0; i < maxclients.value; i++) { ! c= svs.clients[i]; if (c.state == 0) Index: client_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/client_t.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** client_t.java 7 Jul 2004 19:59:50 -0000 1.1 --- client_t.java 6 Sep 2004 19:39:18 -0000 1.1.2.1 *************** *** 44,48 **** int state; - //char userinfo[MAX_INFO_STRING]; // name, etc String userinfo = ""; --- 44,47 ---- *************** *** 86,90 **** netchan_t netchan = new netchan_t(); ! //TODO: this was introduced by rst, since java can't calculate the index out of the address. int serverindex; } --- 85,89 ---- netchan_t netchan = new netchan_t(); ! //this was introduced by rst, since java can't calculate the index out of the address. int serverindex; } Index: SV_USER.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_USER.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 *** SV_USER.java 9 Jul 2004 08:38:25 -0000 1.3.2.1 --- SV_USER.java 6 Sep 2004 19:39:18 -0000 1.3.2.2 *************** *** 125,129 **** { // set up the entity for the client ! ent= SV_GAME.ge.edicts[playernum + 1]; ent.s.number= playernum + 1; sv_client.edict= ent; --- 125,129 ---- { // set up the entity for the client ! ent= GameBase.g_edicts[playernum + 1]; ent.s.number= playernum + 1; sv_client.edict= ent; *************** *** 270,274 **** // call the game begin function ! SV_GAME.ge.ClientBegin(sv_player); Cbuf.InsertFromDefer(); --- 270,274 ---- // call the game begin function ! PlayerClient.ClientBegin(sv_player); Cbuf.InsertFromDefer(); *************** *** 553,557 **** if (i == ucmds.length && sv.state == ss_game) ! SV_GAME.ge.ClientCommand(sv_player); // SV_EndRedirect (); --- 553,557 ---- if (i == ucmds.length && sv.state == ss_game) ! PlayerClient.ClientCommand(sv_player); // SV_EndRedirect (); *************** *** 576,580 **** } ! SV_GAME.ge.ClientThink(cl.edict, cmd); } --- 576,580 ---- } ! PlayerClient.ClientThink(cl.edict, cmd); } Index: SV_GAME.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_GAME.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 *** SV_GAME.java 9 Jul 2004 08:38:25 -0000 1.4.2.1 --- SV_GAME.java 6 Sep 2004 19:39:18 -0000 1.4.2.2 *************** *** 24,39 **** package jake2.server; - import jake2.*; - import jake2.client.*; import jake2.game.*; import jake2.qcommon.*; - import jake2.render.*; - import jake2.sys.Sys; public class SV_GAME extends SV_INIT { - // sv_game.c -- interface to the game dll - - public static game_export_t ge; /* --- 24,32 ---- *************** *** 51,55 **** return; - //p = NUM_FOR_EDICT(ent); p = ent.index; if (p < 1 || p > SV_MAIN.maxclients.value) --- 44,47 ---- *************** *** 74,87 **** */ public static void PF_dprintf(String fmt) { - /* - char msg[1024]; - va_list argptr; - - va_start (argptr,fmt); - vsprintf (msg, fmt, argptr); - va_end (argptr); - - */ - Com.Printf(fmt); } --- 66,69 ---- *************** *** 95,105 **** */ public static void PF_cprintf(edict_t ent, int level, String fmt) { ! //char msg[1024]; ! //va_list argptr; int n = 0; if (ent != null) { - - //n = NUM_FOR_EDICT(ent); n = ent.index; if (n < 1 || n > SV_MAIN.maxclients.value) --- 77,84 ---- */ public static void PF_cprintf(edict_t ent, int level, String fmt) { ! int n = 0; if (ent != null) { n = ent.index; if (n < 1 || n > SV_MAIN.maxclients.value) *************** *** 107,114 **** } - // va_start (argptr,fmt); - // vsprintf (msg, fmt, argptr); - // va_end (argptr); - if (ent != null) SV_SEND.SV_ClientPrintf(svs.clients[n - 1], level, fmt); --- 86,89 ---- *************** *** 125,142 **** */ public static void PF_centerprintf(edict_t ent, String fmt) { - //char msg[1024]; - //va_list argptr; int n; - //TODO: NUM_FOR_EDICT - //n = NUM_FOR_EDICT(ent); n = ent.index; if (n < 1 || n > SV_MAIN.maxclients.value) return; // Com_Error (ERR_DROP, "centerprintf to a non-client"); - // va_start (argptr,fmt); - // vsprintf (msg, fmt, argptr); - // va_end (argptr); - MSG.WriteByte(sv.multicast, svc_centerprint); MSG.WriteString(sv.multicast, fmt); --- 100,109 ---- *************** *** 175,179 **** i = SV_ModelIndex(name); - //ent.model = name; ent.s.modelindex = i; --- 142,145 ---- *************** *** 327,335 **** */ public static void SV_ShutdownGameProgs() { ! if (ge == null) ! return; ! ge.Shutdown(); ! Sys.UnloadGame(); ! ge = null; } --- 293,297 ---- */ public static void SV_ShutdownGameProgs() { ! Game.ShutdownGame(); } *************** *** 345,362 **** // unload anything we have now ! if (ge != null) ! SV_ShutdownGameProgs(); game_import_t gimport = new game_import_t(); // all functions set in game_export_t (rst) ! ge = GameBase.GetGameApi(gimport); ! ! if (ge == null) ! Com.Error(ERR_DROP, "failed to load game DLL"); ! if (ge.apiversion != GAME_API_VERSION) ! Com.Error(ERR_DROP, "game is version " + ge.apiversion + " not " + GAME_API_VERSION); ! ge.Init(); } } --- 307,318 ---- // unload anything we have now ! SV_ShutdownGameProgs(); game_import_t gimport = new game_import_t(); // all functions set in game_export_t (rst) ! GameBase.GetGameApi(gimport); ! Game.InitGame(); } } --- scrap.jpage DELETED --- |
From: Holger Z. <hz...@us...> - 2004-09-06 19:39:56
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/client Modified Files: Tag: r_0_9 CL_pred.java CL_tent.java CL_ents.java Menu.java SCR.java VID.java CL.java Console.java CL_fx.java refexport_t.java CL_parse.java Key.java Removed Files: Tag: r_0_9 refimport_t.java Log Message: merge changes for 0.9.3 --- refimport_t.java DELETED --- Index: CL_parse.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_parse.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 *** CL_parse.java 9 Jul 2004 08:38:23 -0000 1.4.2.1 --- CL_parse.java 6 Sep 2004 19:39:13 -0000 1.4.2.2 *************** *** 27,30 **** --- 27,31 ---- import jake2.Defines; + import jake2.Globals; import jake2.game.Cmd; import jake2.game.entity_state_t; *************** *** 104,108 **** // to the real name when done, so if interrupted // a runt file wont be left ! Com.StripExtension(cls.downloadname, cls.downloadtempname); cls.downloadtempname += ".tmp"; --- 105,109 ---- // to the real name when done, so if interrupted // a runt file wont be left ! cls.downloadtempname = Com.StripExtension(cls.downloadname); cls.downloadtempname += ".tmp"; *************** *** 176,180 **** // to the real name when done, so if interrupted // a runt file wont be left ! Com.StripExtension(cls.downloadname, cls.downloadtempname); cls.downloadtempname += ".tmp"; --- 177,181 ---- // to the real name when done, so if interrupted // a runt file wont be left ! cls.downloadtempname = Com.StripExtension(cls.downloadname); cls.downloadtempname += ".tmp"; *************** *** 219,223 **** if (cls.download != null) { // if here, we tried to resume a file but the server said no ! fclose(cls.download); cls.download = null; } --- 220,226 ---- if (cls.download != null) { // if here, we tried to resume a file but the server said no ! try { ! cls.download.close(); ! } catch (IOException e) {} cls.download = null; } *************** *** 263,267 **** // Com.Printf ("100%%\n"); ! fclose(cls.download); // rename the temp file to it's final name --- 266,272 ---- // Com.Printf ("100%%\n"); ! try { ! cls.download.close(); ! } catch (IOException e) {} // rename the temp file to it's final name *************** *** 312,316 **** // BIG HACK to let demos from release work with the 3.0x patch!!! ! if (Com.ServerState() != 0 && PROTOCOL_VERSION == 34) { } else if (i != PROTOCOL_VERSION) --- 317,321 ---- // BIG HACK to let demos from release work with the 3.0x patch!!! ! if (Globals.server_state != 0 && PROTOCOL_VERSION == 34) { } else if (i != PROTOCOL_VERSION) *************** *** 694,698 **** if (cls.download != null) { //ZOID, close download ! fclose(cls.download); cls.download = null; } --- 699,705 ---- if (cls.download != null) { //ZOID, close download ! try { ! cls.download.close(); ! } catch (IOException e) {} cls.download = null; } Index: VID.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/VID.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 *** VID.java 9 Jul 2004 08:38:24 -0000 1.4.2.1 --- VID.java 6 Sep 2004 19:39:13 -0000 1.4.2.2 *************** *** 32,36 **** import jake2.qcommon.*; import jake2.render.Renderer; ! import jake2.sound.*; import jake2.sys.IN; import jake2.sys.KBD; --- 32,36 ---- import jake2.qcommon.*; import jake2.render.Renderer; ! import jake2.sound.S; import jake2.sys.IN; import jake2.sys.KBD; *************** *** 38,41 **** --- 38,42 ---- import java.awt.Dimension; + import java.awt.DisplayMode; /** *************** *** 63,66 **** --- 64,69 ---- static cvar_t vid_xpos; // X coordinate of window position static cvar_t vid_ypos; // Y coordinate of window position + static cvar_t vid_width; + static cvar_t vid_height; static cvar_t vid_fullscreen; *************** *** 78,81 **** --- 81,88 ---- */ + public static void Printf(int print_level, String fmt) { + Printf(print_level, fmt, null); + } + public static void Printf(int print_level, String fmt, Vargs vargs) { // static qboolean inupdate; *************** *** 86,95 **** } - public static void Error(int err_level, String fmt, Vargs vargs) - { - //static qboolean inupdate; - Com.Error(err_level, fmt, vargs); - } - // ========================================================================== --- 93,96 ---- *************** *** 103,108 **** ============ */ ! static void Restart_f() ! { vid_ref.modified = true; } --- 104,111 ---- ============ */ ! static void Restart_f() { ! vid_modes[11].width = (int) vid_width.value; ! vid_modes[11].height = (int) vid_height.value; ! vid_ref.modified = true; } *************** *** 111,115 **** ** VID_GetModeInfo */ ! static final vidmode_t vid_modes[] = { new vidmode_t("Mode 0: 320x240", 320, 240, 0), --- 114,118 ---- ** VID_GetModeInfo */ ! static vidmode_t vid_modes[] = { new vidmode_t("Mode 0: 320x240", 320, 240, 0), *************** *** 123,136 **** new vidmode_t("Mode 8: 1280x1024", 1280, 1024, 8), new vidmode_t("Mode 9: 1600x1200", 1600, 1200, 9), ! new vidmode_t("Mode 10: 2048x1536", 2048, 1536, 10)}; ! ! static final int NUM_MODES = vid_modes.length; public static boolean GetModeInfo(Dimension dim, int mode) { ! if (mode < 0 || mode >= NUM_MODES) ! return false; ! dim.width = vid_modes[mode].width; ! dim.height = vid_modes[mode].height; return true; } --- 126,145 ---- new vidmode_t("Mode 8: 1280x1024", 1280, 1024, 8), new vidmode_t("Mode 9: 1600x1200", 1600, 1200, 9), ! new vidmode_t("Mode 10: 2048x1536", 2048, 1536, 10), ! new vidmode_t("Mode 11: user", 640, 480, 11)}; ! static vidmode_t fs_modes[]; public static boolean GetModeInfo(Dimension dim, int mode) { ! if (fs_modes == null) initModeList(); ! vidmode_t[] modes = vid_modes; ! if (vid_fullscreen.value != 0.0f) modes = fs_modes; ! ! if (mode < 0 || mode >= modes.length) ! return false; ! ! dim.width = modes[mode].width; ! dim.height = modes[mode].height; ! return true; } *************** *** 190,272 **** Com.Printf( "LoadLibrary(\"" + name +"\")\n" ); ! refimport_t ri = new refimport_t() { ! public void Sys_Error(int err_level, String str) { ! VID.Error(err_level, str, null); ! } ! ! public void Sys_Error(int err_level, String str, Vargs vargs) { ! VID.Error(err_level, str, vargs); ! } ! ! public void Cmd_AddCommand(String name, xcommand_t cmd) { ! Cmd.AddCommand(name, cmd); ! } ! ! public void Cmd_RemoveCommand(String name) { ! Cmd.RemoveCommand(name); ! } ! ! public int Cmd_Argc() { ! return Cmd.Argc(); ! } ! ! public String Cmd_Argv(int i) { ! return Cmd.Argv(i); ! } ! ! public void Cmd_ExecuteText(int exec_when, String text) { ! Cbuf.ExecuteText(exec_when, text); ! } ! ! public void Con_Printf(int print_level, String str) { ! VID.Printf(print_level, str, null); ! } ! ! public void Con_Printf(int print_level, String str, Vargs vargs) { ! VID.Printf(print_level, str, vargs); ! } ! ! public byte[] FS_LoadFile(String name) { ! return FS.LoadFile(name); ! } ! ! public int FS_FileLength(String name) { ! return FS.FileLength(name); ! } ! ! public void FS_FreeFile(byte[] buf) { ! FS.FreeFile(buf); ! } ! ! public String FS_Gamedir() { ! return FS.Gamedir(); ! } ! ! public cvar_t Cvar_Get(String name, String value, int flags) { ! return Cvar.Get(name, value, flags); ! } ! ! public cvar_t Cvar_Set(String name, String value) { ! return Cvar.Set(name, value); ! } ! ! public void Cvar_SetValue(String name, float value) { ! Cvar.SetValue(name, value); ! } ! ! public boolean Vid_GetModeInfo(Dimension dim, int mode) { ! return VID.GetModeInfo(dim, mode); ! } ! ! public void Vid_MenuInit() { ! VID.MenuInit(); ! } ! ! public void Vid_NewWindow(int width, int height) { ! VID.NewWindow(width, height); ! } ! }; ! ! Globals.re = Renderer.getDriver( name, ri ); if (Globals.re == null) --- 199,203 ---- Com.Printf( "LoadLibrary(\"" + name +"\")\n" ); ! Globals.re = Renderer.getDriver(name); if (Globals.re == null) *************** *** 281,290 **** } - /* Init IN (Mouse) */ - // in_state.IN_CenterView_fp = IN_CenterView; - // in_state.Key_Event_fp = Do_Key_Event; - // in_state.viewangles = cl.viewangles; - // in_state.in_strafe_state = &in_strafe.state; - IN.Real_IN_Init(); --- 212,215 ---- *************** *** 374,380 **** --- 299,310 ---- vid_xpos = Cvar.Get("vid_xpos", "3", CVAR_ARCHIVE); vid_ypos = Cvar.Get("vid_ypos", "22", CVAR_ARCHIVE); + vid_width = Cvar.Get("vid_width", "640", CVAR_ARCHIVE); + vid_height = Cvar.Get("vid_height", "480", CVAR_ARCHIVE); vid_fullscreen = Cvar.Get("vid_fullscreen", "0", CVAR_ARCHIVE); vid_gamma = Cvar.Get( "vid_gamma", "1", CVAR_ARCHIVE ); + vid_modes[11].width = (int)vid_width.value; + vid_modes[11].height = (int)vid_height.value; + /* Add some console commands that we want to handle */ Cmd.AddCommand ("vid_restart", new xcommand_t() { *************** *** 414,430 **** // ========================================================================== - // #define REF_SOFT 0 - // #define REF_SOFTX11 1 - // #define REF_MESA3D 2 - // #define REF_3DFXGL 3 - // #define REF_OPENGLX 4 static final int REF_OPENGL_JOGL = 0; static final int REF_OPENGL_FASTJOGL =1; - // #define REF_MESA3DGLX 5 - - // extern cvar_t *vid_ref; - // extern cvar_t *vid_fullscreen; - // extern cvar_t *vid_gamma; - // extern cvar_t *scr_viewsize; static cvar_t gl_mode; --- 344,349 ---- *************** *** 631,636 **** --- 550,559 ---- "[1600 1200]", "[2048 1536]", + "user mode", null }; + static String[] fs_resolutions; + static int mode_x; + static final String[] refs = { *************** *** 652,662 **** }; /* ** VID_MenuInit */ ! public static void MenuInit() ! { ! int i; ! if ( gl_driver == null ) gl_driver = Cvar.Get( "gl_driver", "jogl", 0 ); --- 575,608 ---- }; + static void initModeList() { + DisplayMode[] modes = re.getModeList(); + fs_resolutions = new String[modes.length + 1]; + fs_modes = new vidmode_t[modes.length]; + for (int i = 0; i < modes.length; i++) { + DisplayMode m = modes[i]; + StringBuffer sb = new StringBuffer(18); + sb.append('['); + sb.append(m.getWidth()); + sb.append(' '); + sb.append(m.getHeight()); + while (sb.length() < 10) sb.append(' '); + sb.append(']'); + fs_resolutions[i] = sb.toString(); + sb.setLength(0); + sb.append("Mode "); + sb.append(i); + sb.append(':'); + sb.append(m.getWidth()); + sb.append('x'); + sb.append(m.getHeight()); + fs_modes[i] = new vidmode_t(sb.toString(), m.getWidth(), m.getHeight(), i); + } + } + /* ** VID_MenuInit */ ! public static void MenuInit() { ! if ( gl_driver == null ) gl_driver = Cvar.Get( "gl_driver", "jogl", 0 ); *************** *** 678,681 **** --- 624,640 ---- s_mode_list[SOFTWARE_MENU].curvalue = (int)sw_mode.value; s_mode_list[OPENGL_MENU].curvalue = (int)gl_mode.value; + if (vid_fullscreen.value != 0.0f) { + s_mode_list[OPENGL_MENU].itemnames = fs_resolutions; + if (s_mode_list[OPENGL_MENU].curvalue >= fs_resolutions.length - 1) { + s_mode_list[OPENGL_MENU].curvalue = 0; + } + mode_x = fs_modes[s_mode_list[OPENGL_MENU].curvalue].width; + } else { + s_mode_list[OPENGL_MENU].itemnames = resolutions; + if (s_mode_list[OPENGL_MENU].curvalue >= resolutions.length - 1) { + s_mode_list[OPENGL_MENU].curvalue = 0; + } + mode_x = vid_modes[s_mode_list[OPENGL_MENU].curvalue].width; + } if ( SCR.scr_viewsize == null ) *************** *** 727,731 **** s_opengl_menu.nitems = 0; ! for ( i = 0; i < 2; i++ ) { s_ref_list[i].type = MTYPE_SPINCONTROL; --- 686,690 ---- s_opengl_menu.nitems = 0; ! for (int i = 0; i < 2; i++ ) { s_ref_list[i].type = MTYPE_SPINCONTROL; *************** *** 744,748 **** s_mode_list[i].x = 0; s_mode_list[i].y = 10; - s_mode_list[i].itemnames = resolutions; s_screensize_slider[i].type = MTYPE_SLIDER; --- 703,706 ---- *************** *** 776,779 **** --- 734,753 ---- s_fs_box[i].itemnames = yesno_names; s_fs_box[i].curvalue = (int)vid_fullscreen.value; + s_fs_box[i].callback = new Menu.mcallback() { + public void execute(Object o) { + int fs = ((Menu.menulist_s)o).curvalue; + if (fs == 0) { + s_mode_list[1].itemnames = resolutions; + int i = vid_modes.length - 2; + while (i > 0 && vid_modes[i].width > mode_x) i--; + s_mode_list[1].curvalue = i; + } else { + s_mode_list[1].itemnames = fs_resolutions; + int i = fs_modes.length - 1; + while (i > 0 && fs_modes[i].width > mode_x) i--; + s_mode_list[1].curvalue = i; + } + } + }; s_defaults_action[i].type = MTYPE_ACTION; Index: Menu.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Menu.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 *** Menu.java 9 Jul 2004 08:38:24 -0000 1.3.2.1 --- Menu.java 6 Sep 2004 19:39:13 -0000 1.3.2.2 *************** *** 35,40 **** --- 35,42 ---- import jake2.util.Lib; import jake2.util.Math3D; + import jake2.util.QuakeFile; import java.awt.Dimension; + import java.io.IOException; import java.io.RandomAccessFile; import java.util.Arrays; *************** [...6312 lines suppressed...] ! line2 = Lib.rightFrom(s.itemnames[s.curvalue], '\n'); ! int pos = line2.indexOf('\n'); if (pos != -1) ! line2 = line2.substring(0, pos); Menu_DrawString(RCOLUMN_OFFSET + s.x + s.parent.x, s.y + s.parent.y + 10, line2); --- 4998,5009 ---- else { String line1, line2; ! line1= Lib.leftFrom(s.itemnames[s.curvalue], '\n'); Menu_DrawString(RCOLUMN_OFFSET + s.x + s.parent.x, s.y + s.parent.y, line1); ! line2= Lib.rightFrom(s.itemnames[s.curvalue], '\n'); ! int pos= line2.indexOf('\n'); if (pos != -1) ! line2= line2.substring(0, pos); Menu_DrawString(RCOLUMN_OFFSET + s.x + s.parent.x, s.y + s.parent.y + 10, line2); Index: CL_fx.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_fx.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** CL_fx.java 8 Jul 2004 20:56:50 -0000 1.4 --- CL_fx.java 6 Sep 2004 19:39:13 -0000 1.4.2.1 *************** *** 46,54 **** float radius; float die; // stop lighting after this time ! float decay; // drop this each second float minlight; // don't add when contributing less void clear() { ! radius = ! decay = die = minlight = color[0] = color[1] = color[2] = origin[0] = origin[1] = origin[2] = key = 0; } } --- 46,53 ---- float radius; float die; // stop lighting after this time ! //float decay; // drop this each second float minlight; // don't add when contributing less void clear() { ! radius = minlight = color[0] = color[1] = color[2] = 0; } } *************** *** 101,122 **** */ static void RunLightStyles() { ! int ofs; ! int i; ! clightstyle_t[] ls; ! ofs = cl.time / 100; if (ofs == lastofs) return; lastofs = ofs; ! ls = cl_lightstyle; ! for (i = 0; i < ls.length; i++) { ! if (ls[i].length == 0) { ! ls[i].value[0] = ls[i].value[1] = ls[i].value[2] = 1.0f; continue; } if (ls.length == 1) ! ls[i].value[0] = ls[i].value[1] = ls[i].value[2] = ls[i].map[0]; else ! ls[i].value[0] = ls[i].value[1] = ls[i].value[2] = ls[i].map[ofs % ls[i].length]; } } --- 100,120 ---- */ static void RunLightStyles() { ! clightstyle_t ls; ! int ofs = cl.time / 100; if (ofs == lastofs) return; lastofs = ofs; ! ! for (int i = 0; i < cl_lightstyle.length; i++) { ! ls = cl_lightstyle[i]; ! if (ls.length == 0) { ! ls.value[0] = ls.value[1] = ls.value[2] = 1.0f; continue; } if (ls.length == 1) ! ls.value[0] = ls.value[1] = ls.value[2] = ls.map[0]; else ! ls.value[0] = ls.value[1] = ls.value[2] = ls.map[ofs % ls.length]; } } *************** *** 144,153 **** */ static void AddLightStyles() { ! int i; ! clightstyle_t[] ls; ! ls = cl_lightstyle; ! for (i = 0; i < ls.length; i++) ! V.AddLightStyle(i, ls[i].value[0], ls[i].value[1], ls[i].value[2]); } --- 142,151 ---- */ static void AddLightStyles() { ! clightstyle_t ls; ! for (int i = 0; i < cl_lightstyle.length; i++) { ! ls = cl_lightstyle[i]; ! V.AddLightStyle(i, ls.value[0], ls.value[1], ls.value[2]); ! } } *************** *** 186,200 **** static cdlight_t AllocDlight(int key) { int i; ! cdlight_t[] dl; // first look for an exact key match ! if (key != 0) { ! dl = cl_dlights; for (i = 0; i < MAX_DLIGHTS; i++) { ! if (dl[i].key == key) { //memset (dl, 0, sizeof(*dl)); ! dl[i].clear(); ! dl[i].key = key; ! return dl[i]; } } --- 184,198 ---- static cdlight_t AllocDlight(int key) { int i; ! cdlight_t dl; // first look for an exact key match ! if (key != 0) { for (i = 0; i < MAX_DLIGHTS; i++) { ! dl = cl_dlights[i]; ! if (dl.key == key) { //memset (dl, 0, sizeof(*dl)); ! dl.clear(); ! dl.key = key; ! return dl; } } *************** *** 202,212 **** // then look for anything else - dl = cl_dlights; for (i = 0; i < MAX_DLIGHTS; i++) { ! if (dl[i].die < cl.time) { //memset (dl, 0, sizeof(*dl)); ! dl[i].clear(); ! dl[i].key = key; ! return dl[i]; } } --- 200,210 ---- // then look for anything else for (i = 0; i < MAX_DLIGHTS; i++) { ! dl = cl_dlights[i]; ! if (dl.die < cl.time) { //memset (dl, 0, sizeof(*dl)); ! dl.clear(); ! dl.key = key; ! return dl; } } *************** *** 214,220 **** //dl = &cl_dlights[0]; //memset (dl, 0, sizeof(*dl)); ! dl[0].clear(); ! dl[0].key = key; ! return dl[0]; } --- 212,219 ---- //dl = &cl_dlights[0]; //memset (dl, 0, sizeof(*dl)); ! dl = cl_dlights[0]; ! dl.clear(); ! dl.key = key; ! return dl; } *************** *** 242,259 **** */ static void RunDLights() { ! cdlight_t[] dl; - dl = cl_dlights; for (int i = 0; i < MAX_DLIGHTS; i++) { ! if (dl[i].radius == 0.0f) continue; ! if (dl[i].die < cl.time) { ! dl[i].radius = 0; return; } ! dl[i].radius -= cls.frametime * dl[i].decay; ! if (dl[i].radius < 0) ! dl[i].radius = 0; } } --- 241,258 ---- */ static void RunDLights() { ! cdlight_t dl; for (int i = 0; i < MAX_DLIGHTS; i++) { ! dl = cl_dlights[i]; ! if (dl.radius == 0.0f) continue; ! if (dl.die < cl.time) { ! dl.radius = 0.0f; return; } ! //dl[i].radius -= cls.frametime * dl[i].decay; ! //if (dl[i].radius < 0) ! // dl[i].radius = 0; } } *************** *** 954,982 **** */ static void AddDLights() { ! int i; ! ! cdlight_t[] dl = cl_dlights; // ===== // PGM if (vidref_val == VIDREF_GL) { ! for (i = 0; i < MAX_DLIGHTS; i++) { ! if (dl[i].radius == 0.0f) continue; ! V.AddLight(dl[i].origin, dl[i].radius, dl[i].color[0], dl[i].color[1], dl[i].color[2]); } } else { ! for (i = 0; i < MAX_DLIGHTS; i++) { ! if (dl[i].radius == 0.0f) continue; // negative light in software. only black allowed ! if ((dl[i].color[0] < 0) || (dl[i].color[1] < 0) || (dl[i].color[2] < 0)) { ! dl[i].radius = - (dl[i].radius); ! dl[i].color[0] = 1; ! dl[i].color[1] = 1; ! dl[i].color[2] = 1; } ! V.AddLight(dl[i].origin, dl[i].radius, dl[i].color[0], dl[i].color[1], dl[i].color[2]); } } --- 953,981 ---- */ static void AddDLights() { ! cdlight_t dl; // ===== // PGM if (vidref_val == VIDREF_GL) { ! for (int i = 0; i < MAX_DLIGHTS; i++) { ! dl = cl_dlights[i]; ! if (dl.radius == 0.0f) continue; ! V.AddLight(dl.origin, dl.radius, dl.color[0], dl.color[1], dl.color[2]); } } else { ! for (int i = 0; i < MAX_DLIGHTS; i++) { ! dl = cl_dlights[i]; ! if (dl.radius == 0.0f) continue; // negative light in software. only black allowed ! if ((dl.color[0] < 0) || (dl.color[1] < 0) || (dl.color[2] < 0)) { ! dl.radius = - (dl.radius); ! dl.color[0] = 1; ! dl.color[1] = 1; ! dl.color[2] = 1; } ! V.AddLight(dl.origin, dl.radius, dl.color[0], dl.color[1], dl.color[2]); } } *************** *** 1508,1515 **** float[] move = new float[3]; float[] vec = new float[3]; - float len; - int j; cparticle_t p; - float dec; float orgscale; float velscale; --- 1507,1511 ---- *************** *** 1517,1523 **** VectorCopy(start, move); VectorSubtract(end, start, vec); ! len = VectorNormalize(vec); ! dec = 0.5f; VectorScale(vec, dec, vec); --- 1513,1519 ---- VectorCopy(start, move); VectorSubtract(end, start, vec); ! float len = VectorNormalize(vec); ! float dec = 0.5f; VectorScale(vec, dec, vec); *************** *** 1553,1557 **** p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.4f); p.color = 0xe8 + (rand() & 7); ! for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * orgscale; p.vel[j] = crand() * velscale; --- 1549,1553 ---- p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.4f); p.color = 0xe8 + (rand() & 7); ! for (int j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * orgscale; p.vel[j] = crand() * velscale; *************** *** 1563,1567 **** p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.4f); p.color = 0xdb + (rand() & 7); ! for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * orgscale; p.vel[j] = crand() * velscale; --- 1559,1563 ---- p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.4f); p.color = 0xdb + (rand() & 7); ! for (int j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * orgscale; p.vel[j] = crand() * velscale; *************** *** 1573,1577 **** p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.2f); p.color = 4 + (rand() & 7); ! for (j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * orgscale; p.vel[j] = crand() * velscale; --- 1569,1573 ---- p.alphavel = -1.0f / (1.0f + Globals.rnd.nextFloat() * 0.2f); p.color = 4 + (rand() & 7); ! for (int j = 0; j < 3; j++) { p.org[j] = move[j] + crand() * orgscale; p.vel[j] = crand() * velscale; Index: Console.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Console.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Console.java 8 Jul 2004 15:58:42 -0000 1.2 --- Console.java 6 Sep 2004 19:39:13 -0000 1.2.2.1 *************** *** 67,71 **** Globals.cls.key_dest = Defines.key_console; ! if (Cvar.VariableValue("maxclients") == 1 && Com.ServerState()!= 0) Cvar.Set("paused", "1"); } --- 67,71 ---- Globals.cls.key_dest = Defines.key_console; ! if (Cvar.VariableValue("maxclients") == 1 && Globals.server_state!= 0) Cvar.Set("paused", "1"); } *************** *** 168,175 **** */ public static void CheckResize() { ! int i, j, width, oldwidth, oldtotallines, numlines, numchars; ! byte[] tbuf = new byte[Defines.CON_TEXTSIZE]; ! ! width = (Globals.viddef.width >> 3) - 2; if (width == Globals.con.linewidth) --- 168,173 ---- */ public static void CheckResize() { ! ! int width = (Globals.viddef.width >> 3) - 2; if (width == Globals.con.linewidth) *************** *** 183,205 **** } else { ! oldwidth = Globals.con.linewidth; Globals.con.linewidth = width; ! oldtotallines = Globals.con.totallines; Globals.con.totallines = Defines.CON_TEXTSIZE / Globals.con.linewidth; ! numlines = oldtotallines; if (Globals.con.totallines < numlines) numlines = Globals.con.totallines; ! numchars = oldwidth; if (Globals.con.linewidth < numchars) numchars = Globals.con.linewidth; ! System.arraycopy(Globals.con.text, 0, tbuf, 0, Defines.CON_TEXTSIZE); Arrays.fill(Globals.con.text, (byte)' '); ! for (i=0 ; i<numlines ; i++) { ! for (j=0 ; j<numchars ; j++) { Globals.con.text[(Globals.con.totallines - 1 - i) * Globals.con.linewidth + j] = tbuf[((Globals.con.current - i + oldtotallines) % oldtotallines) * oldwidth + j]; --- 181,204 ---- } else { ! int oldwidth = Globals.con.linewidth; Globals.con.linewidth = width; ! int oldtotallines = Globals.con.totallines; Globals.con.totallines = Defines.CON_TEXTSIZE / Globals.con.linewidth; ! int numlines = oldtotallines; if (Globals.con.totallines < numlines) numlines = Globals.con.totallines; ! int numchars = oldwidth; if (Globals.con.linewidth < numchars) numchars = Globals.con.linewidth; ! ! byte[] tbuf = new byte[Defines.CON_TEXTSIZE]; System.arraycopy(Globals.con.text, 0, tbuf, 0, Defines.CON_TEXTSIZE); Arrays.fill(Globals.con.text, (byte)' '); ! for (int i=0 ; i<numlines ; i++) { ! for (int j=0 ; j<numchars ; j++) { Globals.con.text[(Globals.con.totallines - 1 - i) * Globals.con.linewidth + j] = tbuf[((Globals.con.current - i + oldtotallines) % oldtotallines) * oldwidth + j]; Index: CL.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL.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 *** CL.java 9 Jul 2004 08:38:24 -0000 1.4.2.1 --- CL.java 6 Sep 2004 19:39:13 -0000 1.4.2.2 *************** *** 38,41 **** --- 38,42 ---- import java.io.RandomAccessFile; import java.nio.ByteBuffer; + import java.nio.ByteOrder; /** *************** *** 250,254 **** // never pause in multiplayer ! if (Cvar.VariableValue("maxclients") > 1 || Com.ServerState() == 0) { Cvar.SetValue("paused", 0); return; --- 251,255 ---- // never pause in multiplayer ! if (Cvar.VariableValue("maxclients") > 1 || Globals.server_state == 0) { Cvar.SetValue("paused", 0); return; *************** *** 313,317 **** // if the local server is running and we aren't // then connect ! if (cls.state == ca_disconnected && Com.ServerState() != 0) { cls.state = ca_connecting; cls.servername = "localhost"; --- 314,318 ---- // if the local server is running and we aren't // then connect ! if (cls.state == ca_disconnected && Globals.server_state != 0) { cls.state = ca_connecting; cls.servername = "localhost"; *************** *** 359,363 **** } ! if (Com.ServerState() != 0) { // if running a local server, kill it and reissue SV_MAIN.SV_Shutdown("Server quit\n", false); --- 360,364 ---- } ! if (Globals.server_state != 0) { // if running a local server, kill it and reissue SV_MAIN.SV_Shutdown("Server quit\n", false); *************** *** 949,953 **** } ByteBuffer bb = ByteBuffer.wrap(precache_model); ! int header = Globals.endian.LittleLong(bb.getInt()); if (header != qfiles.IDALIASHEADER) { --- 950,956 ---- } ByteBuffer bb = ByteBuffer.wrap(precache_model); ! bb.order(ByteOrder.LITTLE_ENDIAN); ! ! int header = bb.getInt(); if (header != qfiles.IDALIASHEADER) { *************** *** 959,964 **** continue; } ! pheader = new qfiles.dmdl_t(ByteBuffer.wrap(precache_model)); ! if (Globals.endian.LittleLong(pheader.version) != ALIAS_VERSION) { precache_check++; precache_model_skin = 0; --- 962,967 ---- continue; } ! pheader = new qfiles.dmdl_t(ByteBuffer.wrap(precache_model).order(ByteOrder.LITTLE_ENDIAN)); ! if (pheader.version != ALIAS_VERSION) { precache_check++; precache_model_skin = 0; *************** *** 967,981 **** } ! pheader = new qfiles.dmdl_t(ByteBuffer.wrap(precache_model)); ! int num_skins = Globals.endian.LittleLong(pheader.num_skins); while (precache_model_skin - 1 < num_skins) { ! Com.Printf("critical code section because of endian mess!"); String name = new String( precache_model, ! Globals.endian.LittleLong(pheader.ofs_skins) + (precache_model_skin - 1) * MAX_SKINNAME, MAX_SKINNAME * num_skins); --- 970,984 ---- } ! pheader = new qfiles.dmdl_t(ByteBuffer.wrap(precache_model).order(ByteOrder.LITTLE_ENDIAN)); ! int num_skins = pheader.num_skins; while (precache_model_skin - 1 < num_skins) { ! //Com.Printf("critical code section because of endian mess!\n"); String name = new String( precache_model, ! pheader.ofs_skins + (precache_model_skin - 1) * MAX_SKINNAME, MAX_SKINNAME * num_skins); *************** *** 1547,1550 **** --- 1550,1558 ---- cls.framecount++; + if (cls.state != ca_active || cls.key_dest != key_game) { + try { + Thread.sleep(20); + } catch (InterruptedException e) {} + } } Index: Key.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Key.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 *** Key.java 9 Jul 2004 08:38:24 -0000 1.3.2.1 --- Key.java 6 Sep 2004 19:39:13 -0000 1.3.2.2 *************** *** 26,40 **** package jake2.client; - import java.io.IOException; - import java.io.RandomAccessFile; - import jake2.Defines; import jake2.Globals; import jake2.game.Cmd; import jake2.qcommon.*; - import jake2.qcommon.Cbuf; - import jake2.qcommon.Com; import jake2.util.Lib; /** * Key --- 26,39 ---- package jake2.client; import jake2.Defines; import jake2.Globals; import jake2.game.Cmd; import jake2.qcommon.*; import jake2.util.Lib; + import java.io.IOException; + import java.io.RandomAccessFile; + import java.util.Vector; + /** * Key *************** *** 616,620 **** if (history_line == Globals.edit_line) history_line = (Globals.edit_line + 1) & 31; ! Lib.strcpy(Globals.key_lines[Globals.edit_line], Globals.key_lines[history_line]); Globals.key_linepos = Lib.strlen(Globals.key_lines[Globals.edit_line]); return; --- 615,620 ---- if (history_line == Globals.edit_line) history_line = (Globals.edit_line + 1) & 31; ! //Lib.strcpy(Globals.key_lines[Globals.edit_line], Globals.key_lines[history_line]); ! System.arraycopy(Globals.key_lines[history_line], 0, Globals.key_lines[Globals.edit_line], 0, Globals.key_lines[Globals.edit_line].length); Globals.key_linepos = Lib.strlen(Globals.key_lines[Globals.edit_line]); return; *************** *** 633,637 **** } else { ! Lib.strcpy(Globals.key_lines[Globals.edit_line], Globals.key_lines[history_line]); Globals.key_linepos = Lib.strlen(Globals.key_lines[Globals.edit_line]); } --- 633,638 ---- } else { ! //Lib.strcpy(Globals.key_lines[Globals.edit_line], Globals.key_lines[history_line]); ! System.arraycopy(Globals.key_lines[history_line], 0, Globals.key_lines[Globals.edit_line], 0, Globals.key_lines[Globals.edit_line].length); Globals.key_linepos = Lib.strlen(Globals.key_lines[Globals.edit_line]); } *************** *** 672,695 **** } static void CompleteCommand() { ! // 00166 char *cmd, *s; ! // 00167 ! // 00168 s = key_lines[edit_line]+1; ! // 00169 if (*s == '\\' || *s == '/') ! // 00170 s++; ! // 00171 ! // 00172 cmd = Cmd_CompleteCommand (s); ! // 00173 if (!cmd) ! // 00174 cmd = Cvar_CompleteVariable (s); ! // 00175 if (cmd) ! // 00176 { ! // 00177 key_lines[edit_line][1] = '/'; ! // 00178 strcpy (key_lines[edit_line]+2, cmd); ! // 00179 key_linepos = strlen(cmd)+2; ! // 00180 key_lines[edit_line][key_linepos] = ' '; ! // 00181 key_linepos++; ! // 00182 key_lines[edit_line][key_linepos] = 0; ! // 00183 return; ! // 00184 } } --- 673,719 ---- } + private static void printCompletions(String type, Vector compl) { + Com.Printf(type); + for (int i = 0; i < compl.size(); i++) { + Com.Printf((String)compl.get(i) + " "); + } + Com.Printf("\n"); + } + static void CompleteCommand() { ! ! int start = 1; ! if (key_lines[edit_line][start] == '\\' || key_lines[edit_line][start] == '/') ! start++; ! ! int end = start; ! while (key_lines[edit_line][end] != 0) end++; ! ! String s = new String(key_lines[edit_line], start, end-start); ! ! Vector cmds = Cmd.CompleteCommand(s); ! Vector vars = Cvar.CompleteVariable(s); ! ! int c = cmds.size(); ! int v = vars.size(); ! ! if ((c + v) > 1) { ! if (c > 0) printCompletions("\nCommands:\n", cmds); ! if (v > 0) printCompletions("\nVariables:\n", vars); ! return; ! } else if (c == 1) { ! s = (String)cmds.get(0); ! } else if (v == 1) { ! s = (String)vars.get(0); ! } else return; ! ! key_lines[edit_line][1] = '/'; ! byte[] bytes = s.getBytes(); ! System.arraycopy(bytes, 0, key_lines[edit_line], 2, bytes.length); ! key_linepos = bytes.length + 2; ! key_lines[edit_line][key_linepos++] = ' '; ! key_lines[edit_line][key_linepos] = 0; ! ! return; } Index: CL_tent.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_tent.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** CL_tent.java 8 Jul 2004 20:56:50 -0000 1.3 --- CL_tent.java 6 Sep 2004 19:39:13 -0000 1.3.2.1 *************** *** 1359,1364 **** */ static void AddPlayerBeams() { - int i, j; - beam_t[] b; float[] dist = new float[3]; float[] org = new float[3]; --- 1359,1362 ---- *************** *** 1389,1397 **** // update beams ! b = cl_playerbeams; ! for (i = 0; i < MAX_BEAMS; i++) { ! float[] f = new float[3]; ! float[] u = new float[3]; ! float[] r = new float[3]; if (b[i].model == null || b[i].endtime < cl.time) continue; --- 1387,1396 ---- // 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++) { ! if (b[i].model == null || b[i].endtime < cl.time) continue; *************** *** 1405,1409 **** // code straight out of CL_AddViewWeapon ps = cl.frame.playerstate; ! j = (cl.frame.serverframe - 1) & UPDATE_MASK; oldframe = cl.frames[j]; --- 1404,1408 ---- // code straight out of CL_AddViewWeapon ps = cl.frame.playerstate; ! int j = (cl.frame.serverframe - 1) & UPDATE_MASK; oldframe = cl.frames[j]; *************** *** 1514,1518 **** //memset (&ent, 0, sizeof(ent)); ! ent = new entity_t(); if (b[i].model == cl_mod_heatbeam) { model_length = 32.0f; --- 1513,1519 ---- //memset (&ent, 0, sizeof(ent)); ! //ent = new entity_t(); ! // this is not required. hoz ! if (b[i].model == cl_mod_heatbeam) { model_length = 32.0f; *************** *** 1570,1574 **** V.AddEntity(ent); ! for (j = 0; j < 3; j++) org[j] += dist[j] * len; d -= model_length; --- 1571,1575 ---- V.AddEntity(ent); ! for (int j = 0; j < 3; j++) org[j] += dist[j] * len; d -= model_length; Index: refexport_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/refexport_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** refexport_t.java 7 Jul 2004 19:58:52 -0000 1.1.1.1 --- refexport_t.java 6 Sep 2004 19:39:13 -0000 1.1.1.1.2.1 *************** *** 32,35 **** --- 32,36 ---- import java.awt.Dimension; + import java.awt.DisplayMode; /** *************** *** 105,107 **** --- 106,110 ---- int apiVersion(); + + DisplayMode[] getModeList(); } Index: CL_ents.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_ents.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 *** CL_ents.java 9 Jul 2004 08:38:24 -0000 1.3.2.1 --- CL_ents.java 6 Sep 2004 19:39:13 -0000 1.3.2.2 *************** *** 235,239 **** entity_state_t oldstate=null; ! int oldindex, oldnum; newframe.parse_entities = cl.parse_entities; --- 235,239 ---- entity_state_t oldstate=null; ! int oldnum; newframe.parse_entities = cl.parse_entities; *************** *** 241,254 **** // delta from the entities present in oldframe ! oldindex = 0; if (oldframe == null) oldnum = 99999; else { ! if (oldindex >= oldframe.num_entities) ! oldnum = 99999; ! else { oldstate = cl_parse_entities[(oldframe.parse_entities + oldindex) & (MAX_PARSE_ENTITIES - 1)]; oldnum = oldstate.number; ! } } --- 241,255 ---- // delta from the entities present in oldframe ! int oldindex = 0; if (oldframe == null) oldnum = 99999; else { ! // oldindex == 0. hoz ! // if (oldindex >= oldframe.num_entities) ! // oldnum = 99999; ! // else { oldstate = cl_parse_entities[(oldframe.parse_entities + oldindex) & (MAX_PARSE_ENTITIES - 1)]; oldnum = oldstate.number; ! // } } Index: SCR.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/SCR.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 *** SCR.java 9 Jul 2004 08:38:24 -0000 1.4.2.1 --- SCR.java 6 Sep 2004 19:39:13 -0000 1.4.2.2 *************** *** 40,49 **** * SCR */ ! public final class SCR extends Globals ! { // cl_scrn.c -- master for refresh, status bar, console, chat, notify, etc ! static String[][] sb_nums = { { "num_0", "num_1", "num_2", "num_3", "num_4", "num_5", "num_6", "num_7", "num_8", "num_9", "num_minus" }, { "anum_0", "anum_1", "anum_2", "anum_3", "anum_4", "anum_5", "anum_6", "anum_7", "anum_8", "anum_9", "anum_minus" } [...3377 lines suppressed...] ! // cin.s_channels = LittleLong(cin.s_channels); ! // ! // Huff1TableInit (); ! // ! // // switch up to 22 khz sound if necessary ! // old_khz = Cvar_VariableValue ("s_khz"); ! // if (old_khz != cin.s_rate/1000) ! // { ! // cin.restart_sound = true; ! // Cvar_SetValue ("s_khz", cin.s_rate/1000); ! // CL_Snd_Restart_f (); ! // Cvar_SetValue ("s_khz", old_khz); ! // } ! // ! // cl.cinematicframe = 0; ! // cin.pic = SCR_ReadNextFrame (); ! // cl.cinematictime = Sys_Milliseconds (); } } \ No newline at end of file Index: CL_pred.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_pred.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** CL_pred.java 8 Jul 2004 20:24:28 -0000 1.3 --- CL_pred.java 6 Sep 2004 19:39:13 -0000 1.3.2.1 *************** *** 244,248 **** }; ! PMove.pm_airaccelerate = atof(cl.configstrings[CS_AIRACCEL]); // bugfix (rst) yeah !!!!!!!! found the solution to the B E W E G U N G S P R O B L E M. --- 244,252 ---- }; ! try { ! PMove.pm_airaccelerate = Float.parseFloat(cl.configstrings[CS_AIRACCEL]); ! } catch (Exception e) { ! PMove.pm_airaccelerate = 0; ! } // bugfix (rst) yeah !!!!!!!! found the solution to the B E W E G U N G S P R O B L E M. |
From: Holger Z. <hz...@us...> - 2004-09-06 19:39:55
|
Update of /cvsroot/jake2/jake2/src/jake2/sound In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/sound Modified Files: Tag: r_0_9 WaveLoader.java sfx_t.java Log Message: merge changes for 0.9.3 Index: sfx_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/sfx_t.java,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** sfx_t.java 8 Jul 2004 20:56:49 -0000 1.1 --- sfx_t.java 6 Sep 2004 19:39:16 -0000 1.1.2.1 *************** *** 29,41 **** package jake2.sound; - public class sfx_t { ! public String name; //mem public int registration_sequence; ! public sfxcache_t cache; //ptr ! public String truename; //ptr ! // cwei ! public int id = -1; public void clear() { --- 29,40 ---- package jake2.sound; public class sfx_t { ! public String name; public int registration_sequence; ! public sfxcache_t cache; ! public String truename; ! // is used for AL buffers ! public int bufferId = -1; public void clear() { *************** *** 43,49 **** cache = null; registration_sequence = 0; ! ! // cwei ! id = -1; } } --- 42,46 ---- cache = null; registration_sequence = 0; ! bufferId = -1; } } |
From: Holger Z. <hz...@us...> - 2004-09-06 19:39:54
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/render Modified Files: Tag: r_0_9 Renderer.java FastJoglRenderer.java JoglRenderer.java Ref.java Added Files: Tag: r_0_9 JoglBase.java Log Message: merge changes for 0.9.3 Index: JoglRenderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/JoglRenderer.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 *** JoglRenderer.java 9 Jul 2004 08:38:23 -0000 1.2.2.1 --- JoglRenderer.java 6 Sep 2004 19:39:14 -0000 1.2.2.2 *************** *** 29,33 **** import jake2.client.*; import jake2.qcommon.xcommand_t; ! import jake2.render.jogl.Impl; import java.awt.Dimension; --- 29,33 ---- import jake2.client.*; import jake2.qcommon.xcommand_t; ! import jake2.render.jogl.Misc; import java.awt.Dimension; *************** *** 38,42 **** * @author cwei */ ! final class JoglRenderer extends Impl implements refexport_t, Ref { static { --- 38,44 ---- * @author cwei */ ! final class JoglRenderer extends Misc implements refexport_t, Ref { ! ! public static final String DRIVER_NAME = "jogl"; static { *************** *** 297,302 **** } ! public refexport_t GetRefAPI(refimport_t rimp) { ! this.ri = rimp; return this; } --- 299,303 ---- } ! public refexport_t GetRefAPI() { return this; } Index: FastJoglRenderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/FastJoglRenderer.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** FastJoglRenderer.java 9 Jul 2004 08:38:23 -0000 1.1.2.1 --- FastJoglRenderer.java 6 Sep 2004 19:39:14 -0000 1.1.2.2 *************** *** 29,33 **** import jake2.client.*; import jake2.qcommon.xcommand_t; ! import jake2.render.fastjogl.Impl; import java.awt.Dimension; --- 29,33 ---- import jake2.client.*; import jake2.qcommon.xcommand_t; ! import jake2.render.fastjogl.Misc; import java.awt.Dimension; *************** *** 38,43 **** * @author cwei */ ! final class FastJoglRenderer extends Impl implements refexport_t, Ref { ! static { Renderer.register(new FastJoglRenderer()); --- 38,45 ---- * @author cwei */ ! final class FastJoglRenderer extends Misc implements refexport_t, Ref { ! ! public static final String DRIVER_NAME = "fastjogl"; ! static { Renderer.register(new FastJoglRenderer()); *************** *** 299,304 **** } ! public refexport_t GetRefAPI(refimport_t rimp) { ! this.ri = rimp; return this; } --- 301,305 ---- } ! public refexport_t GetRefAPI() { return this; } Index: Ref.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/Ref.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** Ref.java 7 Jul 2004 19:59:34 -0000 1.1.1.1 --- Ref.java 6 Sep 2004 19:39:14 -0000 1.1.1.1.2.1 *************** *** 27,31 **** import jake2.client.refexport_t; - import jake2.client.refimport_t; /** --- 27,30 ---- *************** *** 39,43 **** // extensions (cwei) // ============================================================================ ! refexport_t GetRefAPI(refimport_t rimp); String getName(); } --- 38,42 ---- // extensions (cwei) // ============================================================================ ! refexport_t GetRefAPI(); String getName(); } Index: Renderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/Renderer.java,v retrieving revision 1.1.1.1.2.2 retrieving revision 1.1.1.1.2.3 diff -C2 -d -r1.1.1.1.2.2 -r1.1.1.1.2.3 *** Renderer.java 9 Jul 2004 08:38:11 -0000 1.1.1.1.2.2 --- Renderer.java 6 Sep 2004 19:39:14 -0000 1.1.1.1.2.3 *************** *** 29,33 **** import jake2.client.refexport_t; - import jake2.client.refimport_t; /** --- 29,32 ---- *************** *** 66,72 **** * @return refexport_t (Renderer singleton) */ ! public static refexport_t getDriver(String driverName, refimport_t rimp) { ! if (rimp == null) ! throw new IllegalArgumentException("refimport_t can't be null"); // find a driver Ref driver = null; --- 65,69 ---- * @return refexport_t (Renderer singleton) */ ! public static refexport_t getDriver(String driverName) { // find a driver Ref driver = null; *************** *** 75,79 **** driver = (Ref) drivers.get(i); if (driver.getName().equals(driverName)) { ! return driver.GetRefAPI(rimp); } } --- 72,76 ---- driver = (Ref) drivers.get(i); if (driver.getName().equals(driverName)) { ! return driver.GetRefAPI(); } } --- NEW FILE: JoglBase.java --- /* * JoglCommon.java * Copyright (C) 2004 * * $Id: JoglBase.java,v 1.7.2.1 2004/09/06 19:39:14 hzi Exp $ */ /* 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.render; import jake2.Defines; import jake2.client.*; import jake2.game.cvar_t; import jake2.qcommon.Cbuf; import jake2.qcommon.xcommand_t; import jake2.sys.KBD; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.LinkedList; import javax.swing.JFrame; import net.java.games.jogl.*; import net.java.games.jogl.util.GLUT; /** * JoglCommon */ public abstract class JoglBase implements GLEventListener { // IMPORTED FUNCTIONS protected GraphicsDevice device; protected DisplayMode oldDisplayMode; protected GLCanvas canvas; JFrame window; protected GL gl; protected GLU glu; protected GLUT glut = new GLUT(); // window position on the screen int window_xpos, window_ypos; protected viddef_t vid = new viddef_t(); // handles the post initialization with JoglRenderer protected boolean post_init = false; protected boolean contextInUse = false; protected abstract boolean R_Init2(); protected final xcommand_t INIT_CALLBACK = new xcommand_t() { public void execute() { // only used for the first run (initialization) // clear the screen gl.glClearColor(0, 0, 0, 0); gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // // check the post init process // if (!post_init) { VID.Printf(Defines.PRINT_ALL, "Missing multi-texturing for FastJOGL renderer\n"); } GLimp_EndFrame(); } }; protected xcommand_t callback = INIT_CALLBACK; protected cvar_t vid_fullscreen; // enum rserr_t protected static final int rserr_ok = 0; protected static final int rserr_invalid_fullscreen = 1; protected static final int rserr_invalid_mode = 2; protected static final int rserr_unknown = 3; public DisplayMode[] getModeList() { DisplayMode[] modes = device.getDisplayModes(); LinkedList l = new LinkedList(); l.add(oldDisplayMode); for (int i = 0; i < modes.length; i++) { DisplayMode m = modes[i]; if (m.getBitDepth() != oldDisplayMode.getBitDepth()) continue; if (m.getRefreshRate() > oldDisplayMode.getRefreshRate()) continue; if (m.getHeight() < 240 || m.getWidth() < 320) continue; int j = 0; DisplayMode ml = null; for (j = 0; j < l.size(); j++) { ml = (DisplayMode)l.get(j); if (ml.getWidth() > m.getWidth()) break; if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; } if (j == l.size()) { l.addLast(m); } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { l.add(j, m); } else if (m.getRefreshRate() > ml.getRefreshRate()){ l.remove(j); l.add(j, m); } } DisplayMode[] ma = new DisplayMode[l.size()]; l.toArray(ma); return ma; } DisplayMode findDisplayMode(Dimension dim) { DisplayMode mode = null; DisplayMode m = null; DisplayMode[] modes = getModeList(); int w = dim.width; int h = dim.height; for (int i = 0; i < modes.length; i++) { m = modes[i]; if (m.getWidth() == w && m.getHeight() == h) { mode = m; break; } } if (mode == null) mode = oldDisplayMode; return mode; } String getModeString(DisplayMode m) { StringBuffer sb = new StringBuffer(); sb.append(m.getWidth()); sb.append('x'); sb.append(m.getHeight()); sb.append('x'); sb.append(m.getBitDepth()); sb.append('@'); sb.append(m.getRefreshRate()); sb.append("Hz"); return sb.toString(); } /** * @param dim * @param mode * @param fullscreen * @return enum rserr_t */ protected int GLimp_SetMode(Dimension dim, int mode, boolean fullscreen) { Dimension newDim = new Dimension(); VID.Printf(Defines.PRINT_ALL, "Initializing OpenGL display\n"); VID.Printf(Defines.PRINT_ALL, "...setting mode " + mode + ":"); /* * fullscreen handling */ GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); device = env.getDefaultScreenDevice(); if (oldDisplayMode == null) { oldDisplayMode = device.getDisplayMode(); } if (!VID.GetModeInfo(newDim, mode)) { VID.Printf(Defines.PRINT_ALL, " invalid mode\n"); return rserr_invalid_mode; } VID.Printf(Defines.PRINT_ALL, " " + newDim.width + " " + newDim.height + '\n'); // destroy the existing window GLimp_Shutdown(); window = new JFrame("Jake2"); GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); // we want keypressed events for TAB key canvas.setFocusTraversalKeysEnabled(false); // TODO Use debug pipeline //canvas.setGL(new DebugGL(canvas.getGL())); canvas.setNoAutoRedrawMode(true); // TODO this and a new JOGL-release solves the flickering bug (Loading) // change also GLimp_EndFrame() // canvas.setAutoSwapBufferMode(false); canvas.addGLEventListener(this); window.getContentPane().add(canvas); canvas.setSize(newDim.width, newDim.height); // register event listener window.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { Cbuf.ExecuteText(Defines.EXEC_APPEND, "quit"); } }); // D I F F E R E N T J A K E 2 E V E N T P R O C E S S I N G window.addComponentListener(KBD.listener); canvas.addKeyListener(KBD.listener); canvas.addMouseListener(KBD.listener); canvas.addMouseMotionListener(KBD.listener); if (fullscreen) { DisplayMode displayMode = findDisplayMode(newDim); newDim.width = displayMode.getWidth(); newDim.height = displayMode.getHeight(); window.setUndecorated(true); window.setResizable(false); device.setFullScreenWindow(window); if (device.isFullScreenSupported()) device.setDisplayMode(displayMode); window.setLocation(0, 0); window.setSize(displayMode.getWidth(), displayMode.getHeight()); canvas.setSize(displayMode.getWidth(), displayMode.getHeight()); VID.Printf(Defines.PRINT_ALL, "...setting fullscreen " + getModeString(displayMode) + '\n'); } else { window.setLocation(window_xpos, window_ypos); window.pack(); window.setResizable(false); window.setVisible(true); } while (!canvas.isDisplayable()) { try { Thread.sleep(50); } catch (InterruptedException e) {} } canvas.requestFocus(); this.canvas = canvas; vid.width = newDim.width; vid.height = newDim.height; // let the sound and input subsystems know about the new window VID.NewWindow(vid.width, vid.height); return rserr_ok; } protected void GLimp_Shutdown() { if (oldDisplayMode != null && device.getFullScreenWindow() != null) { try { if (device.isFullScreenSupported()) device.setDisplayMode(oldDisplayMode); device.setFullScreenWindow(null); } catch (Exception e) { e.printStackTrace(); } } if (this.window != null) { window.dispose(); } post_init = false; callback = INIT_CALLBACK; } /** * @return true */ protected boolean GLimp_Init(int xpos, int ypos) { // do nothing window_xpos = xpos; window_ypos = ypos; return true; } protected void GLimp_EndFrame() { gl.glFlush(); // swap buffer // TODO this and a new JOGL-release solves the flickering bug (Loading) // canvas.swapBuffers(); } protected void GLimp_BeginFrame(float camera_separation) { // do nothing } protected void GLimp_AppActivate(boolean activate) { // do nothing } protected void GLimp_EnableLogging(boolean enable) { // doesn't need jogl logging // do nothing } protected void GLimp_LogNewFrame() { // doesn't need jogl logging // do nothing } /* * @see jake2.client.refexport_t#updateScreen() */ public void updateScreen() { this.callback = INIT_CALLBACK; canvas.display(); } public void updateScreen(xcommand_t callback) { this.callback = callback; canvas.display(); } // ============================================================================ // GLEventListener interface // ============================================================================ /* * @see net.java.games.jogl.GLEventListener#init(net.java.games.jogl.GLDrawable) */ public void init(GLDrawable drawable) { this.gl = drawable.getGL(); this.glu = drawable.getGLU(); // this is a hack to run R_init() in gl context post_init = R_Init2(); } /* * @see net.java.games.jogl.GLEventListener#display(net.java.games.jogl.GLDrawable) */ public void display(GLDrawable drawable) { this.gl = drawable.getGL(); this.glu = drawable.getGLU(); contextInUse = true; callback.execute(); contextInUse = false; } /* * @see net.java.games.jogl.GLEventListener#displayChanged(net.java.games.jogl.GLDrawable, boolean, boolean) */ public void displayChanged(GLDrawable drawable, boolean arg1, boolean arg2) { // do nothing } /* * @see net.java.games.jogl.GLEventListener#reshape(net.java.games.jogl.GLDrawable, int, int, int, int) */ public void reshape(GLDrawable drawable, int x, int y, int width, int height) { // do nothing } } |
From: Holger Z. <hz...@us...> - 2004-09-06 19:39:32
|
Update of /cvsroot/jake2/jake2/src/jake2/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/util Modified Files: Tag: r_0_9 Lib.java Math3D.java Added Files: Tag: r_0_9 QuakeFile.java Log Message: merge changes for 0.9.3 Index: Lib.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/util/Lib.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 *** Lib.java 9 Jul 2004 08:38:23 -0000 1.2.2.1 --- Lib.java 6 Sep 2004 19:39:20 -0000 1.2.2.2 *************** *** 24,27 **** --- 24,28 ---- package jake2.util; + import jake2.Defines; import jake2.Globals; import jake2.qcommon.Com; *************** *** 30,36 **** import java.io.*; import java.nio.*; - import java.nio.ByteBuffer; - import java.nio.FloatBuffer; - import java.util.Arrays; import java.util.StringTokenizer; --- 31,34 ---- *************** *** 78,85 **** } - public static int stricmp(String in1, String in2) { - return in1.compareToIgnoreCase(in2); - } - public static boolean strstr(String i1, String i2) { return (i1.indexOf(i2) != -1); --- 76,79 ---- *************** *** 126,133 **** } - // public static int strlen(String in) { - // return in.length(); - // } - public static int strlen(char in[]) { for (int i = 0; i < in.length; i++) --- 120,123 ---- *************** *** 144,173 **** } ! public static void strcat(String in, String i) { ! in += i; ! } ! ! public static void strcpy(byte dest[], byte src[]) { ! for (int i = 0; i < dest.length && i < src.length; i++) ! if (src[i] == 0) { ! dest[i] = 0; ! return; ! } ! else ! dest[i] = src[i]; ! ! } ! ! public static String readString(RandomAccessFile file, int len) throws IOException { ! byte buf[] = new byte[len]; ! ! file.read(buf, 0, len); ! return new String(buf, 0, strlen(buf)); ! } ! ! public static String readString(ByteBuffer bb, int len) throws IOException { ! byte buf[] = new byte[len]; ! bb.get(buf); ! return new String(buf, 0, strlen(buf)); } --- 134,141 ---- } ! static byte[] buffer = new byte[Defines.MAX_INFO_STRING]; ! public static String readString(ByteBuffer bb, int len) { ! bb.get(buffer, 0, len); ! return new String(buffer, 0, len); } *************** *** 237,253 **** } ! public static void memset(byte[] dest, byte c, int len) { ! Arrays.fill(dest, 0, len, c); ! } ! ! public static void memset(byte[] dest, int c, int len) { ! Arrays.fill(dest, 0, len, (byte) c); ! } ! ! public static void memcpy(byte[] bs, byte[] bs2, int i) { ! System.arraycopy(bs2, 0, bs, 0, i); ! } ! ! static byte nullfiller[] = new byte[8192]; public static void fwriteString(String s, int len, RandomAccessFile f) throws IOException { --- 205,209 ---- } ! static final byte nullfiller[] = new byte[8192]; public static void fwriteString(String s, int len, RandomAccessFile f) throws IOException { *************** *** 264,275 **** } - public static String cut(String in, char c) { - int pos = in.indexOf(c); - - if (pos != -1) - return in.substring(0, pos); - return in; - } - public static RandomAccessFile fopen(String name, String mode) { try { --- 220,223 ---- *************** *** 367,415 **** } - public static long[] clone(long in[]) { - long out[] = new long[in.length]; - - if (in.length != 0) - System.arraycopy(in, 0, out, 0, in.length); - - return out; - } - - public static boolean[] clone(boolean in[]) { - boolean out[] = new boolean[in.length]; - - if (in.length != 0) - System.arraycopy(in, 0, out, 0, in.length); - - return out; - } - - public static int[] clone(int in[]) { - int out[] = new int[in.length]; - - if (in.length != 0) - System.arraycopy(in, 0, out, 0, in.length); - - return out; - } - - public static double[] clone(double in[]) { - double out[] = new double[in.length]; - - if (in.length != 0) - System.arraycopy(in, 0, out, 0, in.length); - - return out; - } - - // this works with Strings also. - public static String[] clone(String in[]) { - String out[] = new String[in.length]; - if (in.length != 0) - System.arraycopy(in, 0, out, 0, in.length); - - return out; - } - /* * java.nio.* Buffer util functions --- 315,318 ---- Index: Math3D.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/util/Math3D.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** Math3D.java 8 Jul 2004 20:56:54 -0000 1.4 --- Math3D.java 6 Sep 2004 19:39:20 -0000 1.4.2.1 *************** *** 316,334 **** public static void ProjectPointOnPlane(float[] dst, float[] p, float[] normal) { - float d; - float[] n = { 0.0f, 0.0f, 0.0f }; - float inv_denom; ! inv_denom = 1.0F / Math3D.DotProduct(normal, normal); ! d = Math3D.DotProduct(normal, p) * inv_denom; ! n[0] = normal[0] * inv_denom; ! n[1] = normal[1] * inv_denom; ! n[2] = normal[2] * inv_denom; ! dst[0] = p[0] - d * n[0]; ! dst[1] = p[1] - d * n[1]; ! dst[2] = p[2] - d * n[2]; } --- 316,331 ---- public static void ProjectPointOnPlane(float[] dst, float[] p, float[] normal) { ! float inv_denom = 1.0F / Math3D.DotProduct(normal, normal); ! float d = Math3D.DotProduct(normal, p) * inv_denom; ! dst[0] = normal[0] * inv_denom; ! dst[1] = normal[1] * inv_denom; ! dst[2] = normal[2] * inv_denom; ! dst[0] = p[0] - d * dst[0]; ! dst[1] = p[1] - d * dst[1]; ! dst[2] = p[2] - d * dst[2]; } *************** *** 362,366 **** durch Entfernung und Senkrechten-Normale gegeben ist. erste Version mit vec3_t... */ - public static final int BoxOnPlaneSide(float emins[], float emaxs[], cplane_t p) { --- 359,362 ---- *************** *** 428,432 **** return sides; ! } // this is the slow, general version --- 424,428 ---- return sides; ! } // this is the slow, general version *************** *** 457,473 **** public static void AngleVectors(float[] angles, float[] forward, float[] right, float[] up) { - float angle; - float sr, sp, sy, cr, cp, cy; ! cr = 2.0f * piratio; ! angle = (float) (angles[Defines.YAW] * (cr)); ! sy = (float) Math.sin(angle); ! cy = (float) Math.cos(angle); angle = (float) (angles[Defines.PITCH] * (cr)); ! sp = (float) Math.sin(angle); ! cp = (float) Math.cos(angle); ! angle = (float) (angles[Defines.ROLL] * (cr)); ! sr = (float) Math.sin(angle); ! cr = (float) Math.cos(angle); if (forward != null) { --- 453,464 ---- public static void AngleVectors(float[] angles, float[] forward, float[] right, float[] up) { ! float cr = 2.0f * piratio; ! float angle = (float) (angles[Defines.YAW] * (cr)); ! float sy = (float) Math.sin(angle); ! float cy = (float) Math.cos(angle); angle = (float) (angles[Defines.PITCH] * (cr)); ! float sp = (float) Math.sin(angle); ! float cp = (float) Math.cos(angle); if (forward != null) { *************** *** 476,488 **** forward[2] = -sp; } ! if (right != null) { ! right[0] = (-sr * sp * cy + cr * sy); ! right[1] = (-sr * sp * sy + -cr * cy); ! right[2] = -sr * cp; ! } ! if (up != null) { ! up[0] = (cr * sp * cy + -sr * -sy); ! up[1] = (cr * sp * sy + -sr * cy); ! up[2] = cr * cp; } } --- 467,486 ---- forward[2] = -sp; } ! ! if (right != null || up != null) { ! angle = (float) (angles[Defines.ROLL] * (cr)); ! float sr = (float) Math.sin(angle); ! cr = (float) Math.cos(angle); ! ! if (right != null) { ! right[0] = (-sr * sp * cy + cr * sy); ! right[1] = (-sr * sp * sy + -cr * cy); ! right[2] = -sr * cp; ! } ! if (up != null) { ! up[0] = (cr * sp * cy + sr * sy); ! up[1] = (cr * sp * sy + -sr * cy); ! up[2] = cr * cp; ! } } } --- NEW FILE: QuakeFile.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 24.07.2004 by RST. // $Id: QuakeFile.java,v 1.2.2.1 2004/09/06 19:39:20 hzi Exp $ package jake2.util; import jake2.game.Game; import jake2.game.SuperAdapter; import jake2.game.edict_t; import jake2.game.gitem_t; import jake2.qcommon.Com; import java.io.*; /** RandomAccessFile, bur handles readString/WriteString specially and * offers other helper functions */ public class QuakeFile extends RandomAccessFile { /** Standard Constructor.*/ public QuakeFile(String filename, String mode) throws FileNotFoundException { super(filename, mode); } /** Writes a Vector to a RandomAccessFile. */ public void writeVector(float v[]) throws IOException { for (int n= 0; n < 3; n++) writeFloat(v[n]); } /** Writes a Vector to a RandomAccessFile. */ public float[] readVector() throws IOException { float res[]= { 0, 0, 0 }; for (int n= 0; n < 3; n++) res[n]= readFloat(); return res; } /** Reads a length specified string from a file. */ public String readString() throws IOException { int len= readInt(); if (len == -1) return null; if (len == 0) return ""; byte bb[]= new byte[len]; super.read(bb, 0, len); return new String(bb, 0, len); } /** Writes a length specified string to a file. */ public void writeString(String s) throws IOException { if (s == null) { writeInt(-1); return; } writeInt(s.length()); if (s.length() != 0) writeBytes(s); } /** Writes the edict reference. */ public void writeEdictRef(edict_t ent) throws IOException { if (ent == null) writeInt(-1); else { writeInt(ent.s.number); } } /** * Reads an edict index from a file and returns the edict. */ public edict_t readEdictRef() throws IOException { int i= readInt(); // handle -1 if (i < 0) return null; if (i > Game.g_edicts.length) { Com.DPrintf("jake2: illegal edict num:" + i + "\n"); return null; } // valid edict. return Game.g_edicts[i]; } /** Writes the Adapter-ID to the file. */ public void writeAdapter(SuperAdapter a) throws IOException { writeInt(3988); if (a == null) writeString(null); else { String str= a.getID(); if (a == null) { Com.DPrintf("writeAdapter: invalid Adapter id for " + a + "\n"); } writeString(str); } } /** Reads the adapter id and returns the adapter. */ public SuperAdapter readAdapter() throws IOException { if (readInt() != 3988) Com.DPrintf("wrong read position: readadapter 3988 \n"); String id= readString(); if (id == null) { // null adapter. :-) return null; } return SuperAdapter.getFromID(id); } /** Writes an item reference. */ public void writeItem(gitem_t item) throws IOException { if (item == null) writeInt(-1); else writeInt(item.index); } /** Reads the item index and returns the game item. */ public gitem_t readItem() throws IOException { int ndx= readInt(); if (ndx == -1) return null; else return Game.itemlist[ndx]; } } |
From: Holger Z. <hz...@us...> - 2004-09-06 19:39:31
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/qcommon Modified Files: Tag: r_0_9 Qcommon.java PMove.java Cvar.java MSG.java FS.java Netchan.java CRC.java CM.java Com.java Cbuf.java Log Message: merge changes for 0.9.3 Index: PMove.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/PMove.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** PMove.java 8 Jul 2004 15:58:46 -0000 1.2 --- PMove.java 6 Sep 2004 19:39:18 -0000 1.2.2.1 *************** *** 161,164 **** --- 161,165 ---- if (pm.numtouch < MAXTOUCH && trace.ent != null) { + //rst: just for debugging touches. //if (trace.ent.index != -1 && trace.ent.index != 0) //Com.p("touch: " + trace.ent.classname + " (" + trace.ent.index + ")" ); *************** *** 1257,1260 **** PM_SnapPosition(); } - } --- 1258,1260 ---- Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.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 *** Com.java 9 Jul 2004 08:38:29 -0000 1.2.2.1 --- Com.java 6 Sep 2004 19:39:19 -0000 1.2.2.2 *************** *** 87,96 **** public static class ParseHelp { - - public ParseHelp(String in, int offset) - { - this(in.toCharArray(), offset); - } - public ParseHelp(String in) { --- 87,90 ---- *************** *** 113,120 **** public ParseHelp(char in[], int offset) { ! if (in == null || in.length == 0) ! data= null; ! else ! data= in; index= offset; } --- 107,111 ---- public ParseHelp(char in[], int offset) { ! data= in; index= offset; } *************** *** 152,155 **** --- 143,155 ---- } } + + public char prevchar() { + if (index > 0) + { + index--; + return data[index]; + } + return 0; + } public boolean isEof() *************** *** 189,247 **** // See GameSpanw.ED_ParseEdict() to see how to use it now. ! // works perfect ! ! public static String Parse(ParseHelp hlp) ! { ! int c; ! int len= 0; ! len= 0; ! ! com_token[0]= 0; ! if (hlp.data == null) ! { return ""; } ! // skip whitespace ! hlp.skipwhites(); ! ! if (hlp.isEof()) ! { ! return ""; ! } ! // skip // comments ! if (hlp.getchar() == '/') ! { ! if (hlp.nextchar() == '/') ! { ! if ((hlp.skiptoeol() == 0) || (hlp.skipwhites() == 0)) ! { return ""; } ! } ! else ! { ! com_token[len]= '/'; ! len++; ! } } - // handle quoted strings specially - if (hlp.getchar() == '\"') - { - while (true) - { - c= hlp.nextchar(); - if (c == '\"' || c == 0) - { ! hlp.nextchar(); ! com_token[len]= '?'; return new String(com_token, 0, len); } ! if (len < Defines.MAX_TOKEN_CHARS) ! { ! com_token[len]= hlp.getchar(); len++; } --- 189,230 ---- // See GameSpanw.ED_ParseEdict() to see how to use it now. ! public static String Parse(ParseHelp hlp) { int c; ! int len = 0; ! if (hlp.data == null) { return ""; } ! while (true) { ! // skip whitespace ! hlp.skipwhites(); ! if (hlp.isEof()) ! return ""; ! // skip // comments ! if (hlp.getchar() == '/') { ! if (hlp.nextchar() == '/') { ! hlp.skiptoeol(); return ""; + } else { + hlp.prevchar(); + break; } ! } else ! break; } ! // handle quoted strings specially ! if (hlp.getchar() == '\"') { ! hlp.nextchar(); ! while (true) { ! c = hlp.getchar(); ! hlp.nextchar(); ! if (c == '\"' || c == 0) { return new String(com_token, 0, len); } ! if (len < Defines.MAX_TOKEN_CHARS) { ! com_token[len] = (char) c; len++; } *************** *** 249,275 **** } ! // parse a regular word ! do ! { ! if (len < Defines.MAX_TOKEN_CHARS) ! { ! com_token[len]= hlp.getchar(); len++; } ! c= hlp.nextchar(); ! } ! while (c > 32); ! ! if (len == Defines.MAX_TOKEN_CHARS) ! { ! Printf("Token exceeded " + Defines.MAX_TOKEN_CHARS + " chars, discarded.\n"); ! len= 0; } - // trigger the eof - hlp.skipwhites(); - - com_token[len]= 0; return new String(com_token, 0, len); } --- 232,250 ---- } ! // parse a regular word ! c = hlp.getchar(); ! do { ! if (len < Defines.MAX_TOKEN_CHARS) { ! com_token[len] = (char) c; len++; } + c = hlp.nextchar(); + } while (c > 32); ! if (len == Defines.MAX_TOKEN_CHARS) { ! Com.Printf("Token exceeded " + Defines.MAX_TOKEN_CHARS + " chars, discarded.\n"); ! len = 0; } return new String(com_token, 0, len); } *************** *** 351,359 **** } - public static void d(String fmt) - { - DPrintf(fmt + "\n", null); - } - public static void Printf(String fmt) { --- 326,329 ---- *************** *** 462,470 **** } - public static int ServerState() - { - return Globals.server_state; - } - public static int Argc() { --- 432,435 ---- *************** *** 516,522 **** } ! public static void StripExtension(String string, String string2) ! { ! // TODO implement StripExtension } --- 481,489 ---- } ! public static String StripExtension(String string) { ! int i = string.lastIndexOf('.'); ! if (i < 0) ! return string; ! return string.substring(0, i); } *************** *** 524,528 **** * CRC table. */ - static int chktbl[]= { --- 491,494 ---- Index: MSG.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/MSG.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** MSG.java 8 Jul 2004 20:24:48 -0000 1.3 --- MSG.java 6 Sep 2004 19:39:18 -0000 1.3.2.1 *************** *** 478,487 **** } while (l < 2047); - //readbuf[l] = 0; return new String(readbuf, 0, l); } - // 2k read buffer. - public static byte readbuf1[] = new byte[2048]; public static String ReadStringLine(sizebuf_t msg_read) { --- 478,484 ---- *************** *** 494,505 **** if (c == -1 || c == 0 || c == 0x0a) break; ! readbuf1[l] = c; l++; ! } ! while (l < 2047); ! ! readbuf1[l] = 0; ! return new String(readbuf1, 0, l).trim(); } --- 491,499 ---- if (c == -1 || c == 0 || c == 0x0a) break; ! readbuf[l] = c; l++; ! } while (l < 2047); ! return new String(readbuf, 0, l).trim(); } *************** *** 563,572 **** public static void ReadData(sizebuf_t msg_read, byte data[], int len) { ! int i; ! ! for (i = 0; i < len; i++) data[i] = (byte) ReadByte(msg_read); } - - //============================================================================ } --- 557,562 ---- public static void ReadData(sizebuf_t msg_read, byte data[], int len) { ! for (int i = 0; i < len; i++) data[i] = (byte) ReadByte(msg_read); } } Index: Qcommon.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Qcommon.java,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -C2 -d -r1.3.2.2 -r1.3.2.3 *** Qcommon.java 9 Jul 2004 08:38:29 -0000 1.3.2.2 --- Qcommon.java 6 Sep 2004 19:39:18 -0000 1.3.2.3 *************** *** 29,33 **** import jake2.client.*; import jake2.game.Cmd; - import jake2.game.Swap; import jake2.server.SV_MAIN; import jake2.sys.NET; --- 29,32 ---- *************** *** 60,64 **** Com.InitArgv(args); - Swap.Init(); Cbuf.Init(); --- 59,62 ---- Index: Cbuf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Cbuf.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Cbuf.java 8 Jul 2004 15:58:46 -0000 1.2 --- Cbuf.java 6 Sep 2004 19:39:19 -0000 1.2.2.1 *************** *** 29,33 **** import jake2.Globals; import jake2.game.Cmd; - import jake2.util.Lib; /** --- 29,32 ---- *************** *** 230,234 **** */ public static void CopyToDefer() { ! Lib.memcpy(Globals.defer_text_buf, Globals.cmd_text_buf, Globals.cmd_text.cursize); Globals.defer_text_buf[Globals.cmd_text.cursize] = 0; Globals.cmd_text.cursize = 0; --- 229,233 ---- */ public static void CopyToDefer() { ! System.arraycopy(Globals.cmd_text_buf, 0, Globals.defer_text_buf, 0, Globals.cmd_text.cursize); Globals.defer_text_buf[Globals.cmd_text.cursize] = 0; Globals.cmd_text.cursize = 0; Index: FS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/FS.java,v retrieving revision 1.2.2.2 retrieving revision 1.2.2.3 diff -C2 -d -r1.2.2.2 -r1.2.2.3 *** FS.java 9 Jul 2004 08:38:29 -0000 1.2.2.2 --- FS.java 6 Sep 2004 19:39:18 -0000 1.2.2.3 *************** *** 117,121 **** File f = new File(path.substring(0, index)); if (!f.mkdirs()) { ! Com.Printf("can't create path \"" + path + '"' + "\n" ); } } --- 117,121 ---- File f = new File(path.substring(0, index)); if (!f.mkdirs()) { ! //Com.Printf("can't create path \"" + path + '"' + "\n" ); } } Index: CM.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/CM.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 *** CM.java 9 Jul 2004 08:38:29 -0000 1.2.2.1 --- CM.java 6 Sep 2004 19:39:18 -0000 1.2.2.2 *************** *** 199,203 **** map_noareas = Cvar.Get("map_noareas", "0", 0); ! if (0 == strcmp(map_name, name) && (clientload || 0 == Cvar.VariableValue("flushmap"))) { checksum[0] = last_checksum; --- 199,203 ---- map_noareas = Cvar.Get("map_noareas", "0", 0); ! if (map_name.equals(name) && (clientload || 0 == Cvar.VariableValue("flushmap"))) { checksum[0] = last_checksum; *************** *** 1704,1708 **** public static byte[] CM_ClusterPVS(int cluster) { if (cluster == -1) ! Lib.memset(pvsrow, (byte) 0, (numclusters + 7) >> 3); else CM_DecompressVis(map_visibility, map_vis.bitofs[cluster][DVIS_PVS], pvsrow); --- 1704,1708 ---- public static byte[] CM_ClusterPVS(int cluster) { if (cluster == -1) ! Arrays.fill(pvsrow, 0, (numclusters + 7) >> 3, (byte)0); else CM_DecompressVis(map_visibility, map_vis.bitofs[cluster][DVIS_PVS], pvsrow); *************** *** 1712,1716 **** public static byte[] CM_ClusterPHS(int cluster) { if (cluster == -1) ! Lib.memset(phsrow, (byte) 0, (numclusters + 7) >> 3); else CM_DecompressVis(map_visibility, map_vis.bitofs[cluster][Defines.DVIS_PHS], phsrow); --- 1712,1716 ---- public static byte[] CM_ClusterPHS(int cluster) { if (cluster == -1) ! Arrays.fill(phsrow, 0, (numclusters + 7) >> 3, (byte)0); else CM_DecompressVis(map_visibility, map_vis.bitofs[cluster][Defines.DVIS_PHS], phsrow); *************** *** 1823,1830 **** if (map_noareas.value != 0) { // for debugging, send everything ! Lib.memset(buffer, 255, bytes); } else { ! Lib.memset(buffer, 0, bytes); floodnum = map_areas[area].floodnum; for (i = 0; i < numareas; i++) { --- 1823,1830 ---- if (map_noareas.value != 0) { // for debugging, send everything ! Arrays.fill(buffer, 0, bytes, (byte)255); } else { ! Arrays.fill(buffer, 0, bytes, (byte)0); floodnum = map_areas[area].floodnum; for (i = 0; i < numareas; i++) { Index: Netchan.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Netchan.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Netchan.java 8 Jul 2004 15:58:46 -0000 1.2 --- Netchan.java 6 Sep 2004 19:39:18 -0000 1.2.2.1 *************** *** 26,38 **** package jake2.qcommon; ! import sun.applet.resources.MsgAppletViewer; ! import jake2.*; ! import jake2.client.*; ! import jake2.game.*; ! import jake2.render.*; ! import jake2.server.*; import jake2.sys.NET; import jake2.sys.Sys; - import jake2.util.Lib; /** --- 26,35 ---- package jake2.qcommon; ! import jake2.Defines; ! import jake2.Globals; ! import jake2.game.cvar_t; ! import jake2.server.SV_MAIN; import jake2.sys.NET; import jake2.sys.Sys; /** *************** *** 225,229 **** if (chan.reliable_length == 0 && chan.message.cursize != 0) { ! Lib.memcpy(chan.reliable_buf, chan.message_buf, chan.message.cursize); chan.reliable_length = chan.message.cursize; chan.message.cursize = 0; --- 222,226 ---- if (chan.reliable_length == 0 && chan.message.cursize != 0) { ! System.arraycopy(chan.message_buf, 0, chan.reliable_buf, 0, chan.message.cursize); chan.reliable_length = chan.message.cursize; chan.message.cursize = 0; Index: Cvar.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Cvar.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** Cvar.java 7 Jul 2004 19:59:30 -0000 1.1.1.1 --- Cvar.java 6 Sep 2004 19:39:18 -0000 1.1.1.1.2.1 *************** *** 29,32 **** --- 29,33 ---- import java.io.IOException; import java.io.RandomAccessFile; + import java.util.Vector; import jake2.Defines; *************** *** 133,137 **** var.string = value; ! var.value = Lib.atof(var.string); var.flags = flags; --- 134,143 ---- var.string = value; ! try { ! var.value = Float.parseFloat(var.string); ! } catch (Exception e) { ! var.value = 0.0f; ! } ! var.flags = flags; *************** *** 185,197 **** } ! if (Com.ServerState() != 0) { Com.Printf(var_name + " will be changed for next game.\n"); - //var.latched_string = CopyString(value); var.latched_string = value; } else { - //var.string = CopyString(value); var.string = value; ! var.value = Lib.atof(var.string); if (var.name.equals("game")) { FS.SetGamedir(var.string); --- 191,205 ---- } ! if (Globals.server_state != 0) { Com.Printf(var_name + " will be changed for next game.\n"); var.latched_string = value; } else { var.string = value; ! try { ! var.value = Float.parseFloat(var.string); ! } catch (Exception e) { ! var.value = 0.0f; ! } if (var.name.equals("game")) { FS.SetGamedir(var.string); *************** *** 217,225 **** Globals.userinfo_modified = true; // transmit at next oportunity - //Z_Free(var.string); // free the old value string - - //var.string = CopyString(value); var.string = value; ! var.value = Lib.atof(var.string); return var; --- 225,234 ---- Globals.userinfo_modified = true; // transmit at next oportunity var.string = value; ! try { ! var.value = Float.parseFloat(var.string); ! } catch (Exception e) { ! var.value = 0.0f; ! } return var; *************** *** 312,316 **** if (var == null) return 0; ! return Lib.atof(var.string); } --- 321,329 ---- if (var == null) return 0; ! float val = 0.0f; ! try { ! val = Float.parseFloat(var.string); ! } catch (Exception e) {} ! return val; } *************** *** 419,437 **** ============ */ ! static String CompleteVariable(String partial) { ! cvar_t cvar; ! int len; ! ! len = partial.length(); ! ! if (len == 0) ! return null; // check match ! for (cvar = Globals.cvar_vars; cvar != null; cvar = cvar.next) if (cvar.name.startsWith(partial)) ! return cvar.name; ! ! return null; } --- 432,445 ---- ============ */ ! public static Vector CompleteVariable(String partial) { ! ! Vector vars = new Vector(); // check match ! for (cvar_t cvar = Globals.cvar_vars; cvar != null; cvar = cvar.next) if (cvar.name.startsWith(partial)) ! vars.add(cvar.name); ! ! return vars; } |
From: Holger Z. <hz...@us...> - 2004-09-06 19:39:31
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/joal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/sound/joal Modified Files: Tag: r_0_9 JOALSoundImpl.java Channel.java Log Message: merge changes for 0.9.3 Index: JOALSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/JOALSoundImpl.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** JOALSoundImpl.java 9 Jul 2004 08:38:28 -0000 1.1.2.1 --- JOALSoundImpl.java 6 Sep 2004 19:39:21 -0000 1.1.2.2 *************** *** 7,11 **** package jake2.sound.joal; - import jake2.Defines; import jake2.Globals; --- 7,10 ---- *************** *** 14,25 **** import jake2.qcommon.*; import jake2.sound.*; ! import jake2.util.Math3D; ! import jake2.util.Vargs; import java.io.IOException; import java.io.RandomAccessFile; import java.util.*; import net.java.games.joal.*; /** --- 13,26 ---- import jake2.qcommon.*; import jake2.sound.*; ! import jake2.util.*; import java.io.IOException; import java.io.RandomAccessFile; + import java.nio.IntBuffer; import java.util.*; import net.java.games.joal.*; + import net.java.games.joal.eax.EAX; + import net.java.games.joal.eax.EAXFactory; /** *************** *** 34,37 **** --- 35,39 ---- static AL al; static ALC alc; + static EAX eax; cvar_t s_volume; *************** *** 43,51 **** private int[] sources = new int[MAX_CHANNELS]; private Channel[] channels = null; private JOALSoundImpl() { } - /* (non-Javadoc) * @see jake2.sound.SoundImpl#Init() --- 45,54 ---- private int[] sources = new int[MAX_CHANNELS]; private Channel[] channels = null; + private int num_channels = 0; + // singleton private JOALSoundImpl() { } /* (non-Javadoc) * @see jake2.sound.SoundImpl#Init() *************** *** 57,73 **** al = ALFactory.getAL(); checkError(); } catch (OpenALException e) { Com.Printf(e.getMessage() + '\n'); return false; } - - checkError(); al.alGenBuffers(MAX_SFX, buffers); - al.alGenSources(MAX_CHANNELS, sources); - checkError(); s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE); initChannels(); al.alDistanceModel(AL.AL_INVERSE_DISTANCE_CLAMPED); - // al.alDistanceModel(AL.AL_INVERSE_DISTANCE); Cmd.AddCommand("play", new xcommand_t() { public void execute() { --- 60,75 ---- al = ALFactory.getAL(); checkError(); + initOpenALExtensions(); } catch (OpenALException e) { Com.Printf(e.getMessage() + '\n'); return false; + } catch (Exception e) { + Com.DPrintf(e.getMessage() + '\n'); + return false; } al.alGenBuffers(MAX_SFX, buffers); s_volume = Cvar.Get("s_volume", "0.7", Defines.CVAR_ARCHIVE); initChannels(); al.alDistanceModel(AL.AL_INVERSE_DISTANCE_CLAMPED); Cmd.AddCommand("play", new xcommand_t() { public void execute() { *************** *** 125,128 **** --- 127,141 ---- } + private void initOpenALExtensions() throws OpenALException { + if (al.alIsExtensionPresent("EAX2.0")) { + Com.Printf("... using EAX2.0\n"); + eax = EAXFactory.getEAX(); + } else { + Com.Printf("... EAX2.0 not found\n"); + eax = null; + } + } + + void exitOpenAL() { // Get the current context. *************** *** 143,149 **** int sourceId; for (int i = 0; i < MAX_CHANNELS; i++) { ! sourceId = sources[i]; channels[i] = new Channel(sourceId); // set default values for AL sources --- 156,173 ---- int sourceId; + int[] tmp = {0}; + int error; for (int i = 0; i < MAX_CHANNELS; i++) { ! ! al.alGenSources(1, tmp); ! sourceId = tmp[0]; ! ! //if ((error = al.alGetError()) != AL.AL_NO_ERROR) break; ! if (sourceId <= 0) break; ! ! sources[i] = sourceId; ! channels[i] = new Channel(sourceId); + num_channels++; // set default values for AL sources *************** *** 157,160 **** --- 181,185 ---- al.alSourcef (sourceId, AL.AL_MAX_GAIN, 1.0f); } + Com.Printf("... using " + num_channels + " channels\n"); } *************** *** 163,168 **** * @see jake2.sound.SoundImpl#RegisterSound(jake2.sound.sfx_t) */ ! private void initBuffer(sfx_t sfx) ! { if (sfx.cache == null ) { //System.out.println(sfx.name + " " + sfx.cache.length+ " " + sfx.cache.loopstart + " " + sfx.cache.speed + " " + sfx.cache.stereo + " " + sfx.cache.width); --- 188,192 ---- * @see jake2.sound.SoundImpl#RegisterSound(jake2.sound.sfx_t) */ ! private void initBuffer(sfx_t sfx) { if (sfx.cache == null ) { //System.out.println(sfx.name + " " + sfx.cache.length+ " " + sfx.cache.loopstart + " " + sfx.cache.speed + " " + sfx.cache.stereo + " " + sfx.cache.width); *************** *** 175,205 **** int size = data.length; ! // if (buffers[sfx.id] != 0) ! // al.alDeleteBuffers(1, new int[] {buffers[sfx.id] }); ! // ! // int[] bid = new int[1]; ! // al.alBufferData( bid[0], format, data, size, freq); ! // buffers[sfx.id] = bid[0]; ! // al.alBufferData( bid[0], format, data, size, freq); ! ! al.alBufferData( buffers[sfx.id], format, data, size, freq); ! // int error; ! // if ((error = al.alGetError()) != AL.AL_NO_ERROR) { ! // String message; ! // switch(error) { ! // case AL.AL_INVALID_OPERATION: message = "invalid operation"; break; ! // case AL.AL_INVALID_VALUE: message = "invalid value"; break; ! // case AL.AL_INVALID_ENUM: message = "invalid enum"; break; ! // case AL.AL_INVALID_NAME: message = "invalid name"; break; ! // default: message = "" + error; ! // } ! // Com.DPrintf("Error Buffer " + sfx.id + ": " + sfx.name + " (" + size + ") --> " + message + '\n'); ! // } } private void checkError() { int error; if ((error = al.alGetError()) != AL.AL_NO_ERROR) { - String message; switch(error) { case AL.AL_INVALID_OPERATION: message = "invalid operation"; break; --- 199,213 ---- int size = data.length; ! al.alBufferData( buffers[sfx.bufferId], format, data, size, freq); } private void checkError() { + Com.DPrintf("AL Error: " + alErrorString() +'\n'); + } + + private String alErrorString(){ int error; + String message = ""; if ((error = al.alGetError()) != AL.AL_NO_ERROR) { switch(error) { case AL.AL_INVALID_OPERATION: message = "invalid operation"; break; *************** *** 209,217 **** default: message = "" + error; } - Com.DPrintf("AL Error: " + message +'\n'); } } - /* (non-Javadoc) * @see jake2.sound.SoundImpl#Shutdown() --- 217,224 ---- default: message = "" + error; } } + return message; } /* (non-Javadoc) * @see jake2.sound.SoundImpl#Shutdown() *************** *** 222,226 **** al.alDeleteBuffers(buffers.length, buffers); exitOpenAL(); ! //ALut.alutExit(); Cmd.RemoveCommand("play"); Cmd.RemoveCommand("stopsound"); --- 229,233 ---- al.alDeleteBuffers(buffers.length, buffers); exitOpenAL(); ! Cmd.RemoveCommand("play"); Cmd.RemoveCommand("stopsound"); *************** *** 235,238 **** --- 242,246 ---- } num_sfx = 0; + num_channels = 0; } *************** *** 258,262 **** attenuation *= 0.5f; ! Channel ch = pickChannel(entnum, entchannel, buffers[sfx.id], attenuation); if (ch == null) return; --- 266,270 ---- attenuation *= 0.5f; ! Channel ch = pickChannel(entnum, entchannel, buffers[sfx.bufferId], attenuation); if (ch == null) return; *************** *** 277,281 **** int i; ! for (i = 0; i < MAX_CHANNELS; i++) { ch = channels[i]; --- 285,289 ---- int i; ! for (i = 0; i < num_channels; i++) { ch = channels[i]; *************** *** 295,299 **** } ! if (i == MAX_CHANNELS) return null; --- 303,307 ---- } ! if (i == num_channels) return null; *************** *** 313,316 **** --- 321,333 ---- private float[] listenerOrigin = {0, 0, 0}; private float[] listenerOrientation = {0, 0, 0, 0, 0, 0}; + private IntBuffer eaxEnv = Lib.newIntBuffer(1); + private int currentEnv = -1; + private boolean changeEnv = true; + + // TODO workaround for JOAL-bug + // should be EAX.LISTENER + private final static int EAX_LISTENER = 0; + // should be EAX.SOURCE + private final static int EAX_SOURCE = 1; /* (non-Javadoc) *************** *** 325,333 **** al.alListenerfv(AL.AL_ORIENTATION, listenerOrientation); AddLoopSounds(origin); playChannels(listenerOrigin); } ! Map looptable = new Hashtable(2 * MAX_CHANNELS); /* --- 342,371 ---- al.alListenerfv(AL.AL_ORIENTATION, listenerOrientation); + if (eax != null) { + // workaround for environment initialisation + if (currentEnv == -1) { + eaxEnv.put(0, EAX.EAX_ENVIRONMENT_UNDERWATER); + eax.EAXSet(EAX_LISTENER, EAX.DSPROPERTY_EAXLISTENER_ENVIRONMENT | EAX.DSPROPERTY_EAXLISTENER_DEFERRED, 0, eaxEnv, 4); + changeEnv = true; + } + + if ((Game.gi.pointcontents.pointcontents(origin)& Defines.MASK_WATER)!= 0) { + changeEnv = currentEnv != EAX.EAX_ENVIRONMENT_UNDERWATER; + currentEnv = EAX.EAX_ENVIRONMENT_UNDERWATER; + } else { + changeEnv = currentEnv != EAX.EAX_ENVIRONMENT_GENERIC; + currentEnv = EAX.EAX_ENVIRONMENT_GENERIC; + } + if (changeEnv) { + eaxEnv.put(0, currentEnv); + eax.EAXSet(EAX_LISTENER, EAX.DSPROPERTY_EAXLISTENER_ENVIRONMENT | EAX.DSPROPERTY_EAXLISTENER_DEFERRED, 0, eaxEnv, 4); + } + } + AddLoopSounds(origin); playChannels(listenerOrigin); } ! Map looptable = new Hashtable(MAX_CHANNELS); /* *************** *** 391,395 **** // allocate a channel ! ch = pickChannel(0, 0, buffers[sfx.id], 6); if (ch == null) break; --- 429,433 ---- // allocate a channel ! ch = pickChannel(0, 0, buffers[sfx.bufferId], 6); if (ch == null) break; *************** *** 428,432 **** int state; ! for (int i = 0; i < MAX_CHANNELS; i++) { ch = channels[i]; if (ch.active) { --- 466,470 ---- int state; ! for (int i = 0; i < num_channels; i++) { ch = channels[i]; if (ch.active) { *************** *** 467,471 **** } } - /* (non-Javadoc) --- 505,508 ---- *************** *** 473,477 **** */ public void StopAllSounds() { ! for (int i = 0; i < MAX_CHANNELS; i++) { al.alSourceStop(sources[i]); al.alSourcei(sources[i], AL.AL_BUFFER, 0); --- 510,514 ---- */ public void StopAllSounds() { ! for (int i = 0; i < num_channels; i++) { al.alSourceStop(sources[i]); al.alSourcei(sources[i], AL.AL_BUFFER, 0); *************** *** 562,565 **** --- 599,603 ---- // determine what model the client is using + // TODO configstrings for player male and female are wrong String model = "male"; int n = Globals.CS_PLAYERSKINS + ent.number - 1; *************** *** 598,608 **** } else { // no, revert to the male sound in the pak0.pak - //Com_sprintf (maleFilename, sizeof(maleFilename), "player/%s/%s", "male", base+1); String maleFilename = "player/male/" + base.substring(1); sfx = AliasName(sexedFilename, maleFilename); } } - - //System.out.println(sfx.name); return sfx; } --- 636,643 ---- *************** *** 653,658 **** sfx.name = name; sfx.registration_sequence = s_registration_sequence; ! // cwei ! sfx.id = i; return sfx; --- 688,692 ---- sfx.name = name; sfx.registration_sequence = s_registration_sequence; ! sfx.bufferId = i; return sfx; *************** *** 690,695 **** sfx.registration_sequence = s_registration_sequence; sfx.truename = s; ! // cwei ! sfx.id = i; return sfx; --- 724,729 ---- sfx.registration_sequence = s_registration_sequence; sfx.truename = s; ! // set the AL bufferId ! sfx.bufferId = i; return sfx; |
From: Holger Z. <hz...@us...> - 2004-09-06 19:39:31
|
Update of /cvsroot/jake2/jake2/src/jake2/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2/sys Modified Files: Tag: r_0_9 IN.java Sys.java InputListener.java Log Message: merge changes for 0.9.3 Index: InputListener.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/InputListener.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.2.1 *** InputListener.java 7 Jul 2004 19:59:51 -0000 1.1.1.1 --- InputListener.java 6 Sep 2004 19:39:20 -0000 1.1.1.1.2.1 *************** *** 44,52 **** static Jake2InputEvent nextEvent() { ! Jake2InputEvent ev = null; synchronized (eventQueue) { ! try { ! ev = (Jake2InputEvent)eventQueue.removeFirst(); ! } catch (Exception e) {} } return ev; --- 44,50 ---- static Jake2InputEvent nextEvent() { ! Jake2InputEvent ev; synchronized (eventQueue) { ! ev = (!eventQueue.isEmpty())?(Jake2InputEvent)eventQueue.removeFirst():null; } return ev; Index: IN.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/IN.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** IN.java 8 Jul 2004 15:58:46 -0000 1.2 --- IN.java 6 Sep 2004 19:39:20 -0000 1.2.2.1 *************** *** 91,95 **** public static void toggleMouse() { ! if (mouse_active) { mouse_avail=false; DeactivateMouse(); --- 91,95 ---- public static void toggleMouse() { ! if (mouse_avail) { mouse_avail=false; DeactivateMouse(); Index: Sys.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/Sys.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 *** Sys.java 9 Jul 2004 08:38:25 -0000 1.3.2.1 --- Sys.java 6 Sep 2004 19:39:20 -0000 1.3.2.2 *************** *** 26,42 **** package jake2.sys; - import java.io.File; - import java.io.FilenameFilter; - import java.util.regex.Pattern; - import java.util.regex.PatternSyntaxException; - import jake2.Defines; import jake2.Globals; import jake2.client.CL; - import jake2.game.Game; - import jake2.game.game_export_t; - import jake2.game.game_import_t; import jake2.qcommon.Com; ! import jake2.util.Lib; /** --- 26,38 ---- package jake2.sys; import jake2.Defines; import jake2.Globals; import jake2.client.CL; import jake2.qcommon.Com; ! ! import java.io.File; ! import java.io.FilenameFilter; ! import java.util.regex.Pattern; ! import java.util.regex.PatternSyntaxException; /** *************** *** 180,184 **** String name = dir.getName(); ! if (Lib.strcmp(name, ".") == 0 || Lib.strcmp(name, "..") == 0) return false; --- 176,180 ---- String name = dir.getName(); ! if (name.equals(".") || name.equals("..")) return false; *************** *** 188,200 **** } ! private static long secbase = 0; public static int Milliseconds() { ! if (secbase == 0) { ! secbase = System.currentTimeMillis(); ! return 0; ! } ! ! return Globals.curtime = (int) (System.currentTimeMillis() - secbase); ! } --- 184,190 ---- } ! private static long secbase = System.currentTimeMillis(); public static int Milliseconds() { ! return Globals.curtime = (int) (System.currentTimeMillis() - secbase); } *************** *** 236,247 **** } - - - public static void UnloadGame() - { - //TODO:implement UnloadGame - //Com.Error(Defines.ERR_FATAL, "UnloadGame not implemented!"); - - } public static void SendKeyEvents() { --- 226,229 ---- |
From: Holger Z. <hz...@us...> - 2004-09-06 19:39:29
|
Update of /cvsroot/jake2/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637 Modified Files: Tag: r_0_9 build.xml ChangeLog Log Message: merge changes for 0.9.3 Index: build.xml =================================================================== RCS file: /cvsroot/jake2/jake2/build.xml,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -C2 -d -r1.3.2.3 -r1.3.2.4 *** build.xml 9 Jul 2004 08:38:28 -0000 1.3.2.3 --- build.xml 6 Sep 2004 19:39:19 -0000 1.3.2.4 *************** *** 9,13 **** <!-- properties --> ! <property name="version" value="0.9.2"/> <property name="src" location="src"/> <property name="test" location="test"/> --- 9,13 ---- <!-- properties --> ! <property name="version" value="0.9.3"/> <property name="src" location="src"/> <property name="test" location="test"/> Index: ChangeLog =================================================================== RCS file: /cvsroot/jake2/jake2/ChangeLog,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** ChangeLog 9 Jul 2004 08:38:28 -0000 1.1.2.2 --- ChangeLog 6 Sep 2004 19:39:20 -0000 1.1.2.3 *************** *** 1,2 **** --- 1,10 ---- + 0.9.3 2004-09-06 + + - savegames + - command line completion in console + - better fullscreen vidmode selection + - memory footprint reduced + - bugfixes + 0.9.2 2004-06-28 |
From: Holger Z. <hz...@us...> - 2004-09-06 19:39:28
|
Update of /cvsroot/jake2/jake2/src/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2637/src/jake2 Modified Files: Tag: r_0_9 Globals.java Defines.java Log Message: merge changes for 0.9.3 Index: Defines.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/Defines.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Defines.java 8 Jul 2004 15:58:46 -0000 1.2 --- Defines.java 6 Sep 2004 19:39:19 -0000 1.2.2.1 *************** *** 1368,1380 **** public final static String NO_SERVER_STRING = "<no server>"; public final static int NUM_ADDRESSBOOK_ENTRIES = 9; - - // // rserr_t - static final int rserr_ok = 0; - - static final int rserr_invalid_fullscreen = 1; - - static final int rserr_invalid_mode = 2; - - static final int rserr_unknown = 3; - } --- 1368,1370 ---- Index: Globals.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/Globals.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** Globals.java 8 Jul 2004 20:24:48 -0000 1.3 --- Globals.java 6 Sep 2004 19:39:19 -0000 1.3.2.1 *************** *** 129,134 **** public static FileWriter log_stats_file = null; - public static EndianHandler endian = null; - public static cvar_t m_pitch; public static cvar_t m_yaw; --- 129,132 ---- |
From: Rene S. <sa...@us...> - 2004-09-04 19:08:41
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv596/src/jake2/server Modified Files: SV_CCMDS.java Log Message: some debug messages removed. Index: SV_CCMDS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_CCMDS.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SV_CCMDS.java 4 Sep 2004 09:01:01 -0000 1.9 --- SV_CCMDS.java 4 Sep 2004 19:08:30 -0000 1.10 *************** *** 386,390 **** name= FS.Gamedir() + "/save/current/" + sv.name + ".sav"; GameSave.ReadLevel(name); - System.out.println("all done!"); } --- 386,389 ---- *************** *** 511,515 **** catch (Exception e) { Com.Printf("Couldn't read file " + name + "\n"); - System.err.println(e); e.printStackTrace(); } --- 510,513 ---- |
From: Rene S. <sa...@us...> - 2004-09-04 19:08:39
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv596/src/jake2/game Modified Files: game_locals_t.java GameSave.java edict_t.java GameSpawn.java Log Message: some debug messages removed. Index: game_locals_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/game_locals_t.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** game_locals_t.java 20 Aug 2004 21:29:58 -0000 1.4 --- game_locals_t.java 4 Sep 2004 19:08:29 -0000 1.5 *************** *** 84,88 **** // rst's checker :-) if (f.readInt()!=1928) ! System.err.println("error in loading game_locals."); } --- 84,88 ---- // rst's checker :-) if (f.readInt()!=1928) ! Com.DPrintf("error in loading game_locals, 1928\n"); } Index: GameSpawn.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSpawn.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GameSpawn.java 29 Aug 2004 21:39:24 -0000 1.6 --- GameSpawn.java 4 Sep 2004 19:08:30 -0000 1.7 *************** *** 167,213 **** gi.dprintf("??? The key [" + key + "] is not a field\n"); - - - /** OLD CODE, delegated to ent.set(...) and st.set(...) - - for (f = fields; f.name; f++) { - if (!(f.flags & FFL_NOSPAWN) && !Q_stricmp(f.name, key)) { - // found it - if (f.flags & FFL_SPAWNTEMP) - b = (byte *) & st; - else - b = (byte *) ent; - - switch (f.type) { - case F_LSTRING : - * (String *) (b + f.ofs) = ED_NewString(value); - break; - case F_VECTOR : - sscanf(value, "%f %f %f", & vec[0], & vec[1], & vec[2]); - ((float *) (b + f.ofs))[0] = vec[0]; - ((float *) (b + f.ofs))[1] = vec[1]; - ((float *) (b + f.ofs))[2] = vec[2]; - break; - case F_INT : - * (int *) (b + f.ofs) = atoi(value); - break; - case F_FLOAT : - * (float *) (b + f.ofs) = atof(value); - break; - case F_ANGLEHACK : - v = atof(value); - ((float *) (b + f.ofs))[0] = 0; - ((float *) (b + f.ofs))[1] = v; - ((float *) (b + f.ofs))[2] = 0; - break; - case F_IGNORE : - break; - } - return; - } - } - gi.dprintf("%s is not a field\n", key); - - */ } --- 167,170 ---- Index: GameSave.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSave.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GameSave.java 29 Aug 2004 21:39:24 -0000 1.4 --- GameSave.java 4 Sep 2004 19:08:30 -0000 1.5 *************** *** 189,193 **** f= new QuakeFile(filename, "r"); - Com.Printf("loading game:" + filename); CreateEdicts(); --- 189,192 ---- *************** *** 289,293 **** ent= g_edicts[entnum]; - System.out.println("readint ent" + entnum); ent.read(f); ent.cleararealinks(); --- 288,291 ---- Index: edict_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/edict_t.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** edict_t.java 22 Aug 2004 14:25:12 -0000 1.4 --- edict_t.java 4 Sep 2004 19:08:30 -0000 1.5 *************** *** 665,670 **** activator= f.readEdictRef(); groundentity= f.readEdictRef(); ! if (index == 145) ! System.out.println("loadground:" + groundentity); groundentity_linkcount= f.readInt(); teamchain= f.readEdictRef(); --- 665,669 ---- activator= f.readEdictRef(); groundentity= f.readEdictRef(); ! groundentity_linkcount= f.readInt(); teamchain= f.readEdictRef(); |
From: Rene S. <sa...@us...> - 2004-09-04 19:08:39
|
Update of /cvsroot/jake2/jake2/src/jake2/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv596/src/jake2/util Modified Files: QuakeFile.java Log Message: some debug messages removed. Index: QuakeFile.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/util/QuakeFile.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QuakeFile.java 20 Aug 2004 21:29:57 -0000 1.1 --- QuakeFile.java 4 Sep 2004 19:08:30 -0000 1.2 *************** *** 28,31 **** --- 28,32 ---- import jake2.game.edict_t; import jake2.game.gitem_t; + import jake2.qcommon.Com; import java.io.*; *************** *** 116,120 **** if (i > Game.g_edicts.length) { ! System.err.println("jake2: illegal edict num:" + i); return null; } --- 117,121 ---- if (i > Game.g_edicts.length) { ! Com.DPrintf("jake2: illegal edict num:" + i + "\n"); return null; } *************** *** 135,141 **** if (a == null) { ! System.err.println("writeAdapter: invalid Adapter id for" + a); } - System.out.println("writing adapter:" + str); writeString(str); } --- 136,141 ---- if (a == null) { ! Com.DPrintf("writeAdapter: invalid Adapter id for " + a + "\n"); } writeString(str); } *************** *** 146,150 **** { if (readInt() != 3988) ! System.err.println("wrong read position: readadapter."); String id= readString(); --- 146,150 ---- { if (readInt() != 3988) ! Com.DPrintf("wrong read position: readadapter 3988 \n"); String id= readString(); |
From: Rene S. <sa...@us...> - 2004-09-04 19:08:38
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv596/src/jake2/client Modified Files: CL.java Log Message: some debug messages removed. Index: CL.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CL.java 27 Aug 2004 21:05:04 -0000 1.8 --- CL.java 4 Sep 2004 19:08:29 -0000 1.9 *************** *** 975,979 **** while (precache_model_skin - 1 < num_skins) { ! Com.Printf("critical code section because of endian mess!"); String name = --- 975,979 ---- while (precache_model_skin - 1 < num_skins) { ! //Com.Printf("critical code section because of endian mess!\n"); String name = |
From: Carsten W. <ca...@us...> - 2004-09-04 14:25:44
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/joal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12828/src/jake2/sound/joal Modified Files: JOALSoundImpl.java Log Message: fallback to dummy if the /dev/dsp is locked (linux) Index: JOALSoundImpl.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/joal/JOALSoundImpl.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** JOALSoundImpl.java 13 Jul 2004 11:20:28 -0000 1.2 --- JOALSoundImpl.java 4 Sep 2004 14:25:32 -0000 1.3 *************** *** 64,67 **** --- 64,70 ---- Com.Printf(e.getMessage() + '\n'); return false; + } catch (Exception e) { + Com.DPrintf(e.getMessage() + '\n'); + return false; } al.alGenBuffers(MAX_SFX, buffers); |