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: Carsten W. <ca...@us...> - 2005-01-17 23:06:27
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5315/src/jake2/qcommon Modified Files: SZ.java Log Message: readcount should be 0 Index: SZ.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/SZ.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SZ.java 10 Sep 2004 19:02:53 -0000 1.3 --- SZ.java 17 Jan 2005 23:05:57 -0000 1.4 *************** *** 40,44 **** public static void Init(sizebuf_t buf, byte data[], int length) { ! buf.data = data; buf.maxsize = length; buf.cursize = 0; --- 40,47 ---- public static void Init(sizebuf_t buf, byte data[], int length) { ! // TODO check this. cwei ! buf.readcount = 0; ! ! buf.data = data; buf.maxsize = length; buf.cursize = 0; |
From: Carsten W. <ca...@us...> - 2005-01-17 22:00:24
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23650/src/jake2/server Modified Files: SV_SEND.java Log Message: garbage optimized with static buffer and float[] Index: SV_SEND.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_SEND.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SV_SEND.java 22 Sep 2004 19:22:12 -0000 1.6 --- SV_SEND.java 17 Jan 2005 22:00:09 -0000 1.7 *************** *** 218,221 **** --- 218,223 ---- SZ.Clear(SV_INIT.sv.multicast); } + + private static final float[] origin_v = { 0, 0, 0 }; /* ================== *************** *** 256,260 **** int i; int ent; - float[] origin_v = { 0, 0, 0 }; boolean use_phs; --- 258,261 ---- *************** *** 361,370 **** */ public static boolean SV_SendClientDatagram(client_t client) { ! byte msg_buf[] = new byte[Defines.MAX_MSGLEN]; sizebuf_t msg = new sizebuf_t(); SV_ENTS.SV_BuildClientFrame(client); ! SZ.Init(msg, msg_buf, msg_buf.length); msg.allowoverflow = true; --- 362,371 ---- */ public static boolean SV_SendClientDatagram(client_t client) { ! //byte msg_buf[] = new byte[Defines.MAX_MSGLEN]; sizebuf_t msg = new sizebuf_t(); SV_ENTS.SV_BuildClientFrame(client); ! SZ.Init(msg, msgbuf, msgbuf.length); msg.allowoverflow = true; *************** *** 443,446 **** --- 444,449 ---- return false; } + + private static final byte msgbuf[] = new byte[Defines.MAX_MSGLEN]; /* ======================= *************** *** 452,456 **** client_t c; int msglen; - byte msgbuf[] = new byte[Defines.MAX_MSGLEN]; int r; --- 455,458 ---- |
From: Carsten W. <ca...@us...> - 2005-01-17 21:55:57
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22563/src/jake2/qcommon Modified Files: Netchan.java Log Message: garbage optimized with static buffers Index: Netchan.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Netchan.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Netchan.java 22 Sep 2004 19:22:09 -0000 1.4 --- Netchan.java 17 Jan 2005 21:55:45 -0000 1.5 *************** *** 119,122 **** --- 119,124 ---- } + private static final byte send_buf[] = new byte[Defines.MAX_MSGLEN]; + private static final sizebuf_t send = new sizebuf_t(); /* * =============== Netchan_OutOfBand *************** *** 127,132 **** public static void Netchan_OutOfBand(int net_socket, netadr_t adr, int length, byte data[]) { - sizebuf_t send = new sizebuf_t(); - byte send_buf[] = new byte[Defines.MAX_MSGLEN]; // write the packet header --- 129,132 ---- *************** *** 195,198 **** --- 195,200 ---- } + // private static final byte send_buf[] = new byte[Defines.MAX_MSGLEN]; + // private static final sizebuf_t send = new sizebuf_t(); /* * =============== Netchan_Transmit *************** *** 205,210 **** */ public static void Transmit(netchan_t chan, int length, byte data[]) { - sizebuf_t send = new sizebuf_t(); - byte send_buf[] = new byte[Defines.MAX_MSGLEN]; int send_reliable; int w1, w2; --- 207,210 ---- |
From: Carsten W. <ca...@us...> - 2005-01-17 21:54:53
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22355/src/jake2/qcommon Modified Files: Cbuf.java Log Message: garbage optimized with static buffers Index: Cbuf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Cbuf.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Cbuf.java 22 Sep 2004 19:22:09 -0000 1.5 --- Cbuf.java 17 Jan 2005 21:54:38 -0000 1.6 *************** *** 36,39 **** --- 36,42 ---- public final class Cbuf { + private static final byte[] line = new byte[1024]; + private static final byte[] tmp = new byte[8192]; + /** * *************** *** 46,50 **** public static void InsertText(String text) { - byte[] temp = null; int templen = 0; --- 49,52 ---- *************** *** 52,57 **** templen = Globals.cmd_text.cursize; if (templen != 0) { ! temp = new byte[templen]; ! System.arraycopy(Globals.cmd_text.data, 0, temp, 0, templen); SZ.Clear(Globals.cmd_text); } --- 54,58 ---- templen = Globals.cmd_text.cursize; if (templen != 0) { ! System.arraycopy(Globals.cmd_text.data, 0, tmp, 0, templen); SZ.Clear(Globals.cmd_text); } *************** *** 62,67 **** // add the copied off data if (templen != 0) { ! SZ.Write(Globals.cmd_text, temp, templen); ! temp = null; } } --- 63,67 ---- // add the copied off data if (templen != 0) { ! SZ.Write(Globals.cmd_text, tmp, templen); } } *************** *** 157,161 **** byte[] text = null; - byte[] line = new byte[1024]; Globals.alias_count = 0; // don't allow infinite alias loops --- 157,160 ---- *************** *** 191,195 **** i++; Globals.cmd_text.cursize -= i; ! byte[] tmp = new byte[Globals.cmd_text.cursize]; System.arraycopy(text, i, tmp, 0, Globals.cmd_text.cursize); --- 190,194 ---- i++; Globals.cmd_text.cursize -= i; ! //byte[] tmp = new byte[Globals.cmd_text.cursize]; System.arraycopy(text, i, tmp, 0, Globals.cmd_text.cursize); |
From: Carsten W. <ca...@us...> - 2005-01-17 21:51:04
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21475/src/jake2/client Modified Files: CL_newfx.java CL_fx.java Log Message: garbage optimized (float[]) Index: CL_fx.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_fx.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CL_fx.java 11 Oct 2004 14:04:16 -0000 1.7 --- CL_fx.java 17 Jan 2005 21:50:42 -0000 1.8 *************** *** 251,254 **** --- 251,257 ---- } + // stack variable + private static final float[] fv = {0, 0, 0}; + private static final float[] rv = {0, 0, 0}; /* * ============== *************** *** 257,262 **** */ static void ParseMuzzleFlash() { - float[] fv = new float[3]; - float[] rv = new float[3]; float volume; String soundname; --- 260,263 ---- *************** *** 505,515 **** } /* * ============== CL_ParseMuzzleFlash2 ============== */ static void ParseMuzzleFlash2() { - float[] origin = new float[3]; - float[] forward = new float[3]; - float[] right = new float[3]; String soundname; --- 506,517 ---- } + // stack variable + private static final float[] origin = {0, 0, 0}; + private static final float[] forward = {0, 0, 0}; + private static final float[] right = {0, 0, 0}; /* * ============== CL_ParseMuzzleFlash2 ============== */ static void ParseMuzzleFlash2() { String soundname; *************** *** 981,990 **** */ static void ClearParticles() { - int i; - free_particles = particles[0]; active_particles = null; ! for (i = 0; i < particles.length - 1; i++) particles[i].next = particles[i + 1]; particles[particles.length - 1].next = null; --- 983,990 ---- */ static void ClearParticles() { free_particles = particles[0]; active_particles = null; ! for (int i = 0; i < particles.length - 1; i++) particles[i].next = particles[i + 1]; particles[particles.length - 1].next = null; *************** *** 997,1005 **** */ static void ParticleEffect(float[] org, float[] dir, int color, int count) { ! int i, j; cparticle_t p; float d; ! ! for (i = 0; i < count; i++) { if (free_particles == null) return; --- 997,1005 ---- */ static void ParticleEffect(float[] org, float[] dir, int color, int count) { ! int j; cparticle_t p; float d; ! ! for (int i = 0; i < count; i++) { if (free_particles == null) return; *************** *** 1030,1038 **** */ static void ParticleEffect2(float[] org, float[] dir, int color, int count) { ! int i, j; cparticle_t p; float d; ! for (i = 0; i < count; i++) { if (free_particles == null) return; --- 1030,1038 ---- */ static void ParticleEffect2(float[] org, float[] dir, int color, int count) { ! int j; cparticle_t p; float d; ! for (int i = 0; i < count; i++) { if (free_particles == null) return; *************** *** 1064,1072 **** */ static void ParticleEffect3(float[] org, float[] dir, int color, int count) { ! int i, j; cparticle_t p; float d; ! for (i = 0; i < count; i++) { if (free_particles == null) return; --- 1064,1072 ---- */ static void ParticleEffect3(float[] org, float[] dir, int color, int count) { ! int j; cparticle_t p; float d; ! for (int i = 0; i < count; i++) { if (free_particles == null) return; *************** *** 1097,1104 **** */ static void TeleporterParticles(entity_state_t ent) { ! int i, j; cparticle_t p; ! for (i = 0; i < 8; i++) { if (free_particles == null) return; --- 1097,1104 ---- */ static void TeleporterParticles(entity_state_t ent) { ! int j; cparticle_t p; ! for (int i = 0; i < 8; i++) { if (free_particles == null) return; *************** *** 1133,1140 **** */ static void LogoutEffect(float[] org, int type) { ! int i, j; cparticle_t p; ! for (i = 0; i < 500; i++) { if (free_particles == null) return; --- 1133,1140 ---- */ static void LogoutEffect(float[] org, int type) { ! int j; cparticle_t p; ! for (int i = 0; i < 500; i++) { if (free_particles == null) return; *************** *** 1174,1181 **** */ static void ItemRespawnParticles(float[] org) { ! int i, j; cparticle_t p; ! for (i = 0; i < 64; i++) { if (free_particles == null) return; --- 1174,1181 ---- */ static void ItemRespawnParticles(float[] org) { ! int j; cparticle_t p; ! for (int i = 0; i < 64; i++) { if (free_particles == null) return; *************** *** 1208,1215 **** */ static void ExplosionParticles(float[] org) { ! int i, j; cparticle_t p; ! for (i = 0; i < 256; i++) { if (free_particles == null) return; --- 1208,1215 ---- */ static void ExplosionParticles(float[] org) { ! int j; cparticle_t p; ! for (int i = 0; i < 256; i++) { if (free_particles == null) return; *************** *** 1236,1244 **** static void BigTeleportParticles(float[] org) { - int i; cparticle_t p; float angle, dist; ! for (i = 0; i < 4096; i++) { if (free_particles == null) return; --- 1236,1243 ---- static void BigTeleportParticles(float[] org) { cparticle_t p; float angle, dist; ! for (int i = 0; i < 4096; i++) { if (free_particles == null) return; *************** *** 1277,1287 **** */ static void BlasterParticles(float[] org, float[] dir) { ! int i, j; cparticle_t p; float d; - int count; ! count = 40; ! for (i = 0; i < count; i++) { if (free_particles == null) return; --- 1276,1285 ---- */ static void BlasterParticles(float[] org, float[] dir) { ! int j; cparticle_t p; float d; ! int count = 40; ! for (int i = 0; i < count; i++) { if (free_particles == null) return; *************** *** 1308,1311 **** --- 1306,1312 ---- } + // stack variable + private static final float[] move = {0, 0, 0}; + private static final float[] vec = {0, 0, 0}; /* * =============== CL_BlasterTrail *************** *** 1314,1319 **** */ static void BlasterTrail(float[] start, float[] end) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 1315,1318 ---- *************** *** 1355,1359 **** } ! /* * =============== --- 1354,1359 ---- } ! // stack variable ! // move, vec /* * =============== *************** *** 1362,1367 **** */ static void FlagTrail(float[] start, float[] end, float color) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 1362,1365 ---- *************** *** 1402,1405 **** --- 1400,1405 ---- } + // stack variable + // move, vec /* * =============== CL_DiminishingTrail *************** *** 1408,1413 **** */ static void DiminishingTrail(float[] start, float[] end, centity_t old, int flags) { - float[] move = new float[3]; - float[] vec = new float[3]; cparticle_t p; float orgscale; --- 1408,1411 ---- *************** *** 1487,1490 **** --- 1485,1490 ---- } + // stack variable + // move, vec /* * =============== CL_RocketTrail *************** *** 1493,1498 **** */ static void RocketTrail(float[] start, float[] end, centity_t old) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 1493,1496 ---- *************** *** 1539,1542 **** --- 1537,1542 ---- } + // stack variable + // move, vec /* * =============== CL_RailTrail *************** *** 1545,1550 **** */ static void RailTrail(float[] start, float[] end) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 1545,1548 ---- *************** *** 1625,1635 **** } ! // RAFAEL /* * =============== CL_IonripperTrail =============== */ static void IonripperTrail(float[] start, float[] ent) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 1623,1632 ---- } ! // stack variable ! // move, vec /* * =============== CL_IonripperTrail =============== */ static void IonripperTrail(float[] start, float[] ent) { float len; int j; *************** *** 1680,1683 **** --- 1677,1682 ---- } + // stack variable + // move, vec /* * =============== CL_BubbleTrail *************** *** 1686,1691 **** */ static void BubbleTrail(float[] start, float[] end) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int i, j; --- 1685,1688 ---- *************** *** 1725,1728 **** --- 1722,1727 ---- } + // stack variable + // forward /* * =============== CL_FlyParticles =============== *************** *** 1733,1737 **** float angle; float sp, sy, cp, cy; - float[] forward = new float[3]; float dist = 64; float ltime; --- 1732,1735 ---- *************** *** 1813,1816 **** --- 1811,1817 ---- } + // stack variable + private static final float[] v = {0, 0, 0}; + // forward /* * =============== CL_BfgParticles =============== *************** *** 1822,1828 **** float angle; float sp, sy, cp, cy; - float[] forward = new float[3]; float dist = 64; - float[] v = new float[3]; float ltime; --- 1823,1827 ---- *************** *** 1876,1879 **** --- 1875,1882 ---- } + // stack variable + // move, vec + private static final float[] start = {0, 0, 0}; + private static final float[] end = {0, 0, 0}; /* * =============== CL_TrapParticles =============== *************** *** 1881,1888 **** // RAFAEL static void TrapParticles(entity_t ent) { - float[] move = new float[3]; - float[] vec = new float[3]; - float[] start = new float[3]; - float[] end = new float[3]; float len; int j; --- 1884,1887 ---- *************** *** 1977,1984 **** // FIXME combined with CL_ExplosionParticles static void BFGExplosionParticles(float[] org) { ! int i, j; cparticle_t p; ! for (i = 0; i < 256; i++) { if (free_particles == null) return; --- 1976,1983 ---- // FIXME combined with CL_ExplosionParticles static void BFGExplosionParticles(float[] org) { ! int j; cparticle_t p; ! for (int i = 0; i < 256; i++) { if (free_particles == null) return; *************** *** 2004,2007 **** --- 2003,2008 ---- } + // stack variable + private static final float[] dir = {0, 0, 0}; /* * =============== CL_TeleportParticles *************** *** 2010,2017 **** */ static void TeleportParticles(float[] org) { - cparticle_t p; float vel; - float[] dir = new float[3]; for (int i = -16; i <= 16; i += 4) --- 2011,2016 ---- *************** *** 2048,2051 **** --- 2047,2052 ---- } + // stack variable + private static final float[] org = {0, 0, 0}; /* * =============== CL_AddParticles =============== *************** *** 2056,2060 **** float time = 0.0f; float time2; - float[] org = new float[3]; int color; cparticle_t active, tail; --- 2057,2060 ---- Index: CL_newfx.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_newfx.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CL_newfx.java 11 Oct 2004 14:04:16 -0000 1.6 --- CL_newfx.java 17 Jan 2005 21:50:42 -0000 1.7 *************** *** 76,92 **** } /* * ====== CL_DebugTrail ====== */ static void DebugTrail(float[] start, float[] end) { - float[] move = new float[3]; - float[] vec = new float[3]; - float len; // int j; cparticle_t p; float dec; - float[] right = new float[3]; - float[] up = new float[3]; // int i; // float d, c, s; --- 76,92 ---- } + // stack variable + private static final float[] move = {0, 0, 0}; + private static final float[] vec = {0, 0, 0}; + private static final float[] right = {0, 0, 0}; + private static final float[] up = {0, 0, 0}; /* * ====== CL_DebugTrail ====== */ static void DebugTrail(float[] start, float[] end) { float len; // int j; cparticle_t p; float dec; // int i; // float d, c, s; *************** *** 134,141 **** } static void ForceWall(float[] start, float[] end, int color) { - float[] move = new float[3]; - float[] vec = new float[3]; - ; float len; int j; --- 134,140 ---- } + // stack variable + // move, vec static void ForceWall(float[] start, float[] end, int color) { float len; int j; *************** *** 180,183 **** --- 179,184 ---- } + // stack variable + // move, vec /* * =============== CL_BubbleTrail2 (lets you control the # of bubbles by *************** *** 187,193 **** */ static void BubbleTrail2(float[] start, float[] end, int dist) { - float[] move = new float[3]; - float[] vec = new float[3]; - ; float len; int i, j; --- 188,191 ---- *************** *** 229,243 **** } static void Heatbeam(float[] start, float[] forward) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; cparticle_t p; - float[] right = new float[3]; - float[] up = new float[3]; int i; float c, s; - float[] dir = new float[3]; float ltime; float step = 32.0f, rstep; --- 227,241 ---- } + // stack variable + // move, vec, right, up + private static final float[] dir = {0, 0, 0}; + private static final float[] end = {0, 0, 0}; + static void Heatbeam(float[] start, float[] forward) { float len; int j; cparticle_t p; int i; float c, s; float ltime; float step = 32.0f, rstep; *************** *** 245,249 **** float rot; float variance; - float[] end = new float[3]; Math3D.VectorMA(start, 4096, forward, end); --- 243,246 ---- *************** *** 320,323 **** --- 317,323 ---- } + // stack variable + private static final float[] r = {0, 0, 0}; + private static final float[] u = {0, 0, 0}; /* * =============== CL_ParticleSteamEffect *************** *** 331,336 **** cparticle_t p; float d; - float[] r = new float[3]; - float[] u = new float[3]; // vectoangles2 (dir, angle_dir); --- 331,334 ---- *************** *** 368,371 **** --- 366,371 ---- } + // stack variable + // r, u, dir static void ParticleSteamEffect2(cl_sustain_t self) // float[] org, float[] dir, int color, int count, int magnitude) *************** *** 374,380 **** cparticle_t p; float d; - float[] r = new float[3]; - float[] u = new float[3]; - float[] dir = new float[3]; // vectoangles2 (dir, angle_dir); --- 374,377 ---- *************** *** 414,427 **** } /* * =============== CL_TrackerTrail =============== */ static void TrackerTrail(float[] start, float[] end, int particleColor) { - float[] move = new float[3]; - float[] vec = new float[3]; - float[] forward = new float[3]; - float[] right = new float[3]; - float[] up = new float[3]; - float[] angle_dir = new float[3]; float len; cparticle_t p; --- 411,422 ---- } + // stack variable + // move, vec, right, up + private static final float[] forward = {0, 0, 0}; + private static final float[] angle_dir = {0, 0, 0}; /* * =============== CL_TrackerTrail =============== */ static void TrackerTrail(float[] start, float[] end, int particleColor) { float len; cparticle_t p; *************** *** 469,478 **** } static void Tracker_Shell(float[] origin) { - float[] dir = new float[3]; - int i; cparticle_t p; ! for (i = 0; i < 300; i++) { if (CL_fx.free_particles == null) return; --- 464,473 ---- } + // stack variable + // dir static void Tracker_Shell(float[] origin) { cparticle_t p; ! for (int i = 0; i < 300; i++) { if (CL_fx.free_particles == null) return; *************** *** 498,507 **** } static void MonsterPlasma_Shell(float[] origin) { - float[] dir = new float[3]; - int i; cparticle_t p; ! for (i = 0; i < 40; i++) { if (CL_fx.free_particles == null) return; --- 493,502 ---- } + // stack variable + // dir static void MonsterPlasma_Shell(float[] origin) { cparticle_t p; ! for (int i = 0; i < 40; i++) { if (CL_fx.free_particles == null) return; *************** *** 531,536 **** private static int[] wb_colortable = { 2 * 8, 13 * 8, 21 * 8, 18 * 8 }; static void Widowbeamout(cl_sustain_t self) { - float[] dir = new float[3]; int i; cparticle_t p; --- 526,532 ---- private static int[] wb_colortable = { 2 * 8, 13 * 8, 21 * 8, 18 * 8 }; + // stack variable + // dir static void Widowbeamout(cl_sustain_t self) { int i; cparticle_t p; *************** *** 568,573 **** private static int[] nb_colortable = { 110, 112, 114, 116 }; static void Nukeblast(cl_sustain_t self) { - float[] dir = new float[3]; int i; cparticle_t p; --- 564,570 ---- private static int[] nb_colortable = { 110, 112, 114, 116 }; + // stack variable + // dir static void Nukeblast(cl_sustain_t self) { int i; cparticle_t p; *************** *** 605,612 **** private static int[] ws_colortable = { 2 * 8, 13 * 8, 21 * 8, 18 * 8 }; static void WidowSplash(float[] org) { int i; cparticle_t p; - float[] dir = new float[3]; for (i = 0; i < 256; i++) { --- 602,610 ---- private static int[] ws_colortable = { 2 * 8, 13 * 8, 21 * 8, 18 * 8 }; + // stack variable + // dir static void WidowSplash(float[] org) { int i; cparticle_t p; for (i = 0; i < 256; i++) { *************** *** 636,639 **** --- 634,639 ---- } + // stack variable + // move, vec /* * =============== *************** *** 642,647 **** */ static void TagTrail(float[] start, float[] end, float color) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 642,645 ---- *************** *** 713,716 **** --- 711,716 ---- } + // stack variable + // r, u /* * =============== CL_ParticleSmokeEffect - like the steam effect, but *************** *** 722,727 **** cparticle_t p; float d; - float[] r = new float[3]; - float[] u = new float[3]; Math3D.MakeNormalVectors(dir, r, u); --- 722,725 ---- *************** *** 792,795 **** --- 790,795 ---- } + // stack variable + // move, vec /* * =============== CL_BlasterTrail2 *************** *** 798,803 **** */ static void BlasterTrail2(float[] start, float[] end) { - float[] move = new float[3]; - float[] vec = new float[3]; float len; int j; --- 798,801 ---- |
From: Carsten W. <ca...@us...> - 2005-01-17 21:50:09
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21291/src/jake2/client Modified Files: CL_parse.java Log Message: garbage optimized Index: CL_parse.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_parse.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CL_parse.java 29 Oct 2004 16:35:00 -0000 1.18 --- CL_parse.java 17 Jan 2005 21:49:40 -0000 1.19 *************** *** 35,38 **** --- 35,39 ---- import jake2.sys.Sys; import jake2.util.Lib; + import jake2.util.Math3D; import java.io.IOException; *************** *** 507,511 **** ci = Globals.cl.clientinfo[player]; ! LoadClientinfo(ci, new String(s)); } --- 508,512 ---- ci = Globals.cl.clientinfo[player]; ! LoadClientinfo(ci, s); } *************** *** 526,530 **** olds = Globals.cl.configstrings[i]; ! Globals.cl.configstrings[i] = new String(s); // do something apropriate --- 527,531 ---- olds = Globals.cl.configstrings[i]; ! Globals.cl.configstrings[i] = s; // do something apropriate *************** *** 569,577 **** */ /* * ================== CL_ParseStartSoundPacket ================== */ public static void ParseStartSoundPacket() { - float[] pos_v = { 0, 0, 0 }; float pos[]; int channel, ent; --- 570,578 ---- */ + private static final float[] pos_v = { 0, 0, 0 }; /* * ================== CL_ParseStartSoundPacket ================== */ public static void ParseStartSoundPacket() { float pos[]; int channel, ent; *************** *** 615,619 **** if ((flags & Defines.SND_POS) != 0) { // positioned in space MSG.ReadPos(Globals.net_message, pos_v); ! pos = pos_v; } else --- 616,620 ---- if ((flags & Defines.SND_POS) != 0) { // positioned in space MSG.ReadPos(Globals.net_message, pos_v); ! // is ok. sound driver copies pos = pos_v; } else |
From: Carsten W. <ca...@us...> - 2005-01-17 21:43:46
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20165/src/jake2/client Modified Files: CL_ents.java Log Message: garbage optimized Index: CL_ents.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_ents.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CL_ents.java 11 Oct 2004 14:04:16 -0000 1.7 --- CL_ents.java 17 Jan 2005 21:43:13 -0000 1.8 *************** *** 221,224 **** --- 221,226 ---- } + // call by reference + private static final int[] iw = {0}; /* * ================== CL_ParsePacketEntities *************** *** 252,256 **** while (true) { ! int iw[] = { bits }; newnum = ParseEntityBits(iw); bits = iw[0]; --- 254,259 ---- while (true) { ! //int iw[] = { bits }; ! iw[0] = bits; newnum = ParseEntityBits(iw); bits = iw[0]; |
From: Carsten W. <ca...@us...> - 2005-01-17 17:37:21
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3613/src/jake2/render/lwjgl Modified Files: Light.java Log Message: local float[] optimize; code clean up Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Light.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Light.java 14 Dec 2004 12:56:59 -0000 1.2 --- Light.java 17 Jan 2005 17:37:02 -0000 1.3 *************** *** 37,40 **** --- 37,41 ---- import jake2.render.mtexinfo_t; import jake2.util.Math3D; + import jake2.util.Vec3Cache; import java.nio.ByteBuffer; *************** *** 64,75 **** */ [...1014 lines suppressed...] ! float af = a / 255.0f; ! r *= af; ! g *= af; ! b *= af; ! break; ! case 'A': ! default: ! r = g = b = 0; ! a = 255 - a; ! break; ! } ! //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; ! dest.put(destp++, (a << 24) | (b << 16) | (g << 8) | r); ! } ! } ! } ! } ! ! } \ No newline at end of file |
From: Carsten W. <ca...@us...> - 2005-01-17 17:06:27
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29628/src/jake2/render/lwjgl Modified Files: Mesh.java Log Message: local float[] optimize; code clean up Index: Mesh.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Mesh.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Mesh.java 14 Dec 2004 12:56:59 -0000 1.2 --- Mesh.java 17 Jan 2005 17:06:08 -0000 1.3 *************** *** 47,51 **** // g_mesh.c: triangle model functions - /* ============================================================= --- 47,50 ---- *************** *** 69,72 **** --- 68,80 ---- float[] shadedots = r_avertexnormal_dots[0]; + /** + * GL_LerpVerts + * @param nverts + * @param ov + * @param verts + * @param move + * @param frontv + * @param backv + */ void GL_LerpVerts(int nverts, qfiles.dtrivertx_t[] ov, qfiles.dtrivertx_t[] verts, float[] move, float[] frontv, float[] backv ) { *************** *** 115,136 **** }; ! /* ! ============= ! GL_DrawAliasFrameLerp ! ! interpolates between two frames and origins ! FIXME: batch lerp all vertexes ! ============= ! */ ! void GL_DrawAliasFrameLerp(qfiles.dmdl_t paliashdr, float backlerp) { - int count; - float alpha; - - float[] move = {0, 0, 0}; // vec3_t - float[] frontv = {0, 0, 0}; // vec3_t - float[] backv = {0, 0, 0}; // vec3_t - qfiles.daliasframe_t frame = paliashdr.aliasFrames[currententity.frame]; --- 123,138 ---- }; ! // stack variable ! private final float[] move = {0, 0, 0}; // vec3_t ! private final float[] frontv = {0, 0, 0}; // vec3_t ! private final float[] backv = {0, 0, 0}; // vec3_t ! /** ! * GL_DrawAliasFrameLerp ! * ! * interpolates between two frames and origins ! * FIXME: batch lerp all vertexes ! */ void GL_DrawAliasFrameLerp(qfiles.dmdl_t paliashdr, float backlerp) { qfiles.daliasframe_t frame = paliashdr.aliasFrames[currententity.frame]; *************** *** 141,144 **** --- 143,147 ---- qfiles.dtrivertx_t[] ov = oldframe.verts; + float alpha; if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) alpha = currententity.alpha; *************** *** 217,221 **** int dstIndex = 0; int srcIndex = 0; ! for (int j = 0; j < counts.length; j++) { --- 220,224 ---- int dstIndex = 0; int srcIndex = 0; ! int count; for (int j = 0; j < counts.length; j++) { *************** *** 253,284 **** gl.glDisableClientState( GL11.GL_COLOR_ARRAY ); - } ! /* ! ============= ! GL_DrawAliasShadow ! ============= ! */ void GL_DrawAliasShadow(qfiles.dmdl_t paliashdr, int posenum) { ! qfiles.dtrivertx_t[] verts; ! int[] order; ! float[] point = {0, 0, 0}; ! float height, lheight; ! int count; ! qfiles.daliasframe_t frame; ! ! lheight = currententity.origin[2] - lightspot[2]; ! ! frame = paliashdr.aliasFrames[currententity.frame]; ! ! verts = frame.verts; ! ! height = 0; ! ! order = paliashdr.glCmds; ! ! height = -lheight + 1.0f; int orderIndex = 0; --- 256,272 ---- gl.glDisableClientState( GL11.GL_COLOR_ARRAY ); } ! private final float[] point = {0, 0, 0}; ! /** ! * GL_DrawAliasShadow ! */ void GL_DrawAliasShadow(qfiles.dmdl_t paliashdr, int posenum) { ! float lheight = currententity.origin[2] - lightspot[2]; ! qfiles.daliasframe_t frame = paliashdr.aliasFrames[currententity.frame]; ! qfiles.dtrivertx_t[] verts = frame.verts; ! int[] order = paliashdr.glCmds; ! float height = -lheight + 1.0f; int orderIndex = 0; *************** *** 287,290 **** --- 275,279 ---- // TODO shadow drawing with vertex arrays + int count; while (true) { *************** *** 321,333 **** } - - /* - ** R_CullAliasModel - */ // TODO sync with jogl renderer. hoz boolean R_CullAliasModel(entity_t e) { - float[] mins = { 0, 0, 0 }; - float[] maxs = { 0, 0, 0 }; - qfiles.dmdl_t paliashdr = (qfiles.dmdl_t) currentmodel.extradata; --- 310,321 ---- } // TODO sync with jogl renderer. hoz + // stack variable + private final float[] mins = { 0, 0, 0 }; + private final float[] maxs = { 0, 0, 0 }; + /** + * R_CullAliasModel + */ boolean R_CullAliasModel(entity_t e) { qfiles.dmdl_t paliashdr = (qfiles.dmdl_t) currentmodel.extradata; *************** *** 442,460 **** }; - /* - ================= - R_DrawAliasModel - - ================= - */ // TODO sync with jogl renderer. hoz void R_DrawAliasModel(entity_t e) { - int i; - //qfiles.dmdl_t paliashdr; - //float an; - - image_t skin; - if ( ( e.flags & Defines.RF_WEAPONMODEL ) == 0) { --- 430,439 ---- }; // TODO sync with jogl renderer. hoz + /** + * R_DrawAliasModel + */ void R_DrawAliasModel(entity_t e) { if ( ( e.flags & Defines.RF_WEAPONMODEL ) == 0) { *************** *** 477,480 **** --- 456,460 ---- // PMM - 3.20 code .. replaced with original way of doing it to keep mod authors happy // + int i; if ( (currententity.flags & ( Defines.RF_SHELL_HALF_DAM | Defines.RF_SHELL_GREEN | Defines.RF_SHELL_RED | Defines.RF_SHELL_BLUE | Defines.RF_SHELL_DOUBLE )) != 0 ) { *************** *** 621,624 **** --- 601,607 ---- e.angles[PITCH] = -e.angles[PITCH]; // sigh. + + + image_t skin; // select skin if (currententity.skin != null) *************** *** 706,709 **** gl.glColor4f (1,1,1,1); } ! ! } --- 689,691 ---- gl.glColor4f (1,1,1,1); } ! } \ No newline at end of file |
From: Carsten W. <ca...@us...> - 2005-01-17 16:50:43
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26541/src/jake2/render/lwjgl Modified Files: Surf.java Log Message: local float[] optimize; code clean up Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Surf.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Surf.java 10 Jan 2005 00:12:00 -0000 1.6 --- Surf.java 17 Jan 2005 16:50:24 -0000 1.7 *************** *** 115,133 **** */ ! /* ! =============== ! R_TextureAnimation ! ! Returns the proper texture for a given time and base texture ! =============== ! */ image_t R_TextureAnimation(mtexinfo_t tex) { - int c; - if (tex.next == null) return tex.image; ! c = currententity.frame % tex.numframes; while (c != 0) { --- 115,128 ---- */ ! /** ! * R_TextureAnimation ! * Returns the proper texture for a given time and base texture ! */ image_t R_TextureAnimation(mtexinfo_t tex) { if (tex.next == null) return tex.image; ! int c = currententity.frame % tex.numframes; while (c != 0) { *************** *** 139,147 **** } ! /* ! ================ ! DrawGLPoly ! ================ ! */ void DrawGLPoly(glpoly_t p) { --- 134,140 ---- } ! /** ! * DrawGLPoly ! */ void DrawGLPoly(glpoly_t p) { *************** *** 149,165 **** } ! // ============ ! // PGM ! /* ! ================ ! DrawGLFlowingPoly -- version of DrawGLPoly that handles scrolling texture ! ================ ! */ void DrawGLFlowingPoly(glpoly_t p) { ! int i; ! float scroll; ! ! scroll = -64 * ( (r_newrefdef.time / 40.0f) - (int)(r_newrefdef.time / 40.0f) ); if(scroll == 0.0f) scroll = -64.0f; --- 142,152 ---- } ! /** ! * DrawGLFlowingPoly ! * version that handles scrolling texture ! */ void DrawGLFlowingPoly(glpoly_t p) { ! float scroll = -64 * ( (r_newrefdef.time / 40.0f) - (int)(r_newrefdef.time / 40.0f) ); if(scroll == 0.0f) scroll = -64.0f; *************** *** 168,176 **** p.endScrolling(); } - // PGM - // ============ ! /* ! ** R_DrawTriangleOutlines */ void R_DrawTriangleOutlines() --- 155,161 ---- p.endScrolling(); } ! /** ! * R_DrawTriangleOutlines */ void R_DrawTriangleOutlines() *************** *** 183,190 **** gl.glColor4f(1, 1, 1, 1); for (int i = 0; i < MAX_LIGHTMAPS; i++) { ! for (msurface_t surf = gl_lms.lightmap_surfaces[i]; surf != null; surf = surf.lightmapchain) { ! for (glpoly_t p = surf.polys; p != null; p = p.chain) { ! for (int j = 2; j < p.numverts; j++) { gl.glBegin(GL11.GL_LINE_STRIP); gl.glVertex3f(p.x(0), p.y(0), p.z(0)); --- 168,178 ---- gl.glColor4f(1, 1, 1, 1); + msurface_t surf; + glpoly_t p; + int j; for (int i = 0; i < MAX_LIGHTMAPS; i++) { ! for (surf = gl_lms.lightmap_surfaces[i]; surf != null; surf = surf.lightmapchain) { ! for (p = surf.polys; p != null; p = p.chain) { ! for (j = 2; j < p.numverts; j++) { gl.glBegin(GL11.GL_LINE_STRIP); gl.glVertex3f(p.x(0), p.y(0), p.z(0)); *************** *** 202,221 **** } ! private IntBuffer temp2 = Lib.newIntBuffer(34 * 34, ByteOrder.LITTLE_ENDIAN); ! /* ! ================ ! R_RenderBrushPoly ! ================ ! */ void R_RenderBrushPoly(msurface_t fa) { - int maps; - image_t image; - boolean is_dynamic = false; - c_brush_polys++; ! image = R_TextureAnimation(fa.texinfo); if ((fa.flags & Defines.SURF_DRAWTURB) != 0) --- 190,203 ---- } ! private final IntBuffer temp2 = Lib.newIntBuffer(34 * 34, ByteOrder.LITTLE_ENDIAN); ! /** ! * R_RenderBrushPoly ! */ void R_RenderBrushPoly(msurface_t fa) { c_brush_polys++; ! image_t image = R_TextureAnimation(fa.texinfo); if ((fa.flags & Defines.SURF_DRAWTURB) != 0) *************** *** 254,257 **** --- 236,240 ---- ** check for lightmap modification */ + int maps; for ( maps = 0; maps < Defines.MAXLIGHTMAPS && fa.styles[maps] != (byte)255; maps++ ) { *************** *** 266,269 **** --- 249,253 ---- // dynamic this frame or dynamic previously + boolean is_dynamic = false; if ( gotoDynamic || ( fa.dlightframe == r_framecount ) ) { *************** *** 316,333 **** ! /* ! ================ ! R_DrawAlphaSurfaces ! ! Draw water surfaces and windows. ! The BSP tree is waled front to back, so unwinding the chain ! of alpha_surfaces will draw back to front, giving proper ordering. ! ================ ! */ void R_DrawAlphaSurfaces() { - msurface_t s; - float intens; - r_world_matrix.clear(); // --- 300,311 ---- ! /** ! * R_DrawAlphaSurfaces ! * Draw water surfaces and windows. ! * The BSP tree is waled front to back, so unwinding the chain ! * of alpha_surfaces will draw back to front, giving proper ordering. ! */ void R_DrawAlphaSurfaces() { r_world_matrix.clear(); // *************** *** 342,350 **** // the textures are prescaled up for a better lighting range, // so scale it back down ! intens = gl_state.inverse_intensity; gl.glInterleavedArrays(GL11.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); ! for (s=r_alpha_surfaces ; s != null ; s=s.texturechain) { GL_Bind(s.texinfo.image.texnum); --- 320,328 ---- // the textures are prescaled up for a better lighting range, // so scale it back down ! float intens = gl_state.inverse_intensity; gl.glInterleavedArrays(GL11.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); ! for (msurface_t s = r_alpha_surfaces ; s != null ; s=s.texturechain) { GL_Bind(s.texinfo.image.texnum); *************** *** 371,387 **** } ! /* ! ================ ! DrawTextureChains ! ================ ! */ void DrawTextureChains() { - int i; - msurface_t s; - image_t image; - c_visible_textures = 0; for (i = 0; i < numgltextures ; i++) { --- 349,362 ---- } ! /** ! * DrawTextureChains ! */ void DrawTextureChains() { c_visible_textures = 0; + msurface_t s; + image_t image; + int i; for (i = 0; i < numgltextures ; i++) { *************** *** 425,445 **** // direct buffer ! private IntBuffer temp = Lib.newIntBuffer(128 * 128, ByteOrder.LITTLE_ENDIAN); ! void GL_RenderLightmappedPoly( msurface_t surf ) { - int i, nv = surf.polys.numverts; - int map = 0; - int index; - float[][] v; - FloatBuffer texCoord = globalPolygonInterleavedBuf; - image_t image = R_TextureAnimation( surf.texinfo ); - boolean is_dynamic = false; - int lmtex = surf.lightmaptexturenum; - glpoly_t p; // ersetzt goto boolean gotoDynamic = false; ! for ( map = 0; map < Defines.MAXLIGHTMAPS && (surf.styles[map] != (byte)255); map++ ) { --- 400,415 ---- // direct buffer ! private final IntBuffer temp = Lib.newIntBuffer(128 * 128, ByteOrder.LITTLE_ENDIAN); ! ! /** ! * GL_RenderLightmappedPoly ! * @param surf ! */ void GL_RenderLightmappedPoly( msurface_t surf ) { // ersetzt goto boolean gotoDynamic = false; ! int map; for ( map = 0; map < Defines.MAXLIGHTMAPS && (surf.styles[map] != (byte)255); map++ ) { *************** *** 454,457 **** --- 424,428 ---- // dynamic this frame or dynamic previously + boolean is_dynamic = false; if ( gotoDynamic || ( surf.dlightframe == r_framecount ) ) { *************** *** 466,469 **** --- 437,445 ---- } + glpoly_t p; + FloatBuffer texCoord = globalPolygonInterleavedBuf; + image_t image = R_TextureAnimation( surf.texinfo ); + int lmtex = surf.lightmaptexturenum; + if ( is_dynamic ) { *************** *** 582,602 **** } ! /* ! ================= ! R_DrawInlineBModel ! ================= ! */ void R_DrawInlineBModel() { - int i, k; - cplane_t pplane; - float dot; - msurface_t psurf; - dlight_t lt; - // calculate dynamic lighting for bmodel if ( gl_flashblend.value == 0 ) { ! for (k=0 ; k<r_newrefdef.num_dlights ; k++) { lt = r_newrefdef.dlights[k]; --- 558,571 ---- } ! /** ! * R_DrawInlineBModel ! */ void R_DrawInlineBModel() { // calculate dynamic lighting for bmodel if ( gl_flashblend.value == 0 ) { ! dlight_t lt; ! for (int k=0 ; k<r_newrefdef.num_dlights ; k++) { lt = r_newrefdef.dlights[k]; *************** *** 607,612 **** // psurf = ¤tmodel->surfaces[currentmodel->firstmodelsurface]; int psurfp = currentmodel.firstmodelsurface; ! msurface_t[] surfaces; ! surfaces = currentmodel.surfaces; //psurf = surfaces[psurfp]; --- 576,580 ---- // psurf = ¤tmodel->surfaces[currentmodel->firstmodelsurface]; int psurfp = currentmodel.firstmodelsurface; ! msurface_t[] surfaces = currentmodel.surfaces; //psurf = surfaces[psurfp]; *************** *** 621,625 **** // draw texture // ! for (i=0 ; i<currentmodel.nummodelsurfaces ; i++) { psurf = surfaces[psurfp++]; --- 589,596 ---- // draw texture // ! msurface_t psurf; ! cplane_t pplane; ! float dot; ! for (int i=0 ; i<currentmodel.nummodelsurfaces ; i++) { psurf = surfaces[psurfp++]; *************** *** 658,673 **** } ! /* ! ================= ! R_DrawBrushModel ! ================= ! */ void R_DrawBrushModel(entity_t e) { - float[] mins = {0, 0, 0}; - float[] maxs = {0, 0, 0}; - int i; - boolean rotated; - if (currentmodel.nummodelsurfaces == 0) return; --- 629,644 ---- } ! // stack variable ! private final float[] mins = {0, 0, 0}; ! private final float[] maxs = {0, 0, 0}; ! private final float[] org = {0, 0, 0}; ! private final float[] forward = {0, 0, 0}; ! private final float[] right = {0, 0, 0}; ! private final float[] up = {0, 0, 0}; ! /** ! * R_DrawBrushModel ! */ void R_DrawBrushModel(entity_t e) { if (currentmodel.nummodelsurfaces == 0) return; *************** *** 676,683 **** gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; if (e.angles[0] != 0 || e.angles[1] != 0 || e.angles[2] != 0) { rotated = true; ! for (i=0 ; i<3 ; i++) { mins[i] = e.origin[i] - currentmodel.radius; --- 647,655 ---- gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; + boolean rotated; if (e.angles[0] != 0 || e.angles[1] != 0 || e.angles[2] != 0) { rotated = true; ! for (int i=0 ; i<3 ; i++) { mins[i] = e.origin[i] - currentmodel.radius; *************** *** 704,717 **** if (rotated) { ! float[] temp = {0, 0, 0}; ! float[] forward = {0, 0, 0}; ! float[] right = {0, 0, 0}; ! float[] up = {0, 0, 0}; ! ! Math3D.VectorCopy (modelorg, temp); Math3D.AngleVectors (e.angles, forward, right, up); ! modelorg[0] = Math3D.DotProduct (temp, forward); ! modelorg[1] = -Math3D.DotProduct (temp, right); ! modelorg[2] = Math3D.DotProduct (temp, up); } --- 676,684 ---- if (rotated) { ! Math3D.VectorCopy (modelorg, org); Math3D.AngleVectors (e.angles, forward, right, up); ! modelorg[0] = Math3D.DotProduct (org, forward); ! modelorg[1] = -Math3D.DotProduct (org, right); ! modelorg[2] = Math3D.DotProduct (org, up); } *************** *** 751,769 **** */ ! /* ! ================ ! R_RecursiveWorldNode ! ================ ! */ void R_RecursiveWorldNode (mnode_t node) { - int c, side, sidebit; - cplane_t plane; - msurface_t surf; - msurface_t mark; - mleaf_t pleaf; - float dot = 0; - image_t image; - if (node.contents == Defines.CONTENTS_SOLID) return; // solid --- 718,726 ---- */ ! /** ! * R_RecursiveWorldNode ! */ void R_RecursiveWorldNode (mnode_t node) { if (node.contents == Defines.CONTENTS_SOLID) return; // solid *************** *** 775,782 **** return; // if a leaf node, draw stuff if (node.contents != -1) { ! pleaf = (mleaf_t)node; // check for door connected areas --- 732,741 ---- return; + int c; + msurface_t mark; // if a leaf node, draw stuff if (node.contents != -1) { ! mleaf_t pleaf = (mleaf_t)node; // check for door connected areas *************** *** 807,812 **** // find which side of the node we are on ! plane = node.plane; ! switch (plane.type) { --- 766,771 ---- // find which side of the node we are on ! cplane_t plane = node.plane; ! float dot; switch (plane.type) { *************** *** 825,828 **** --- 784,788 ---- } + int side, sidebit; if (dot >= 0.0f) { *************** *** 840,843 **** --- 800,805 ---- // draw stuff + msurface_t surf; + image_t image; //for ( c = node.numsurfaces, surf = r_worldmodel.surfaces[node.firstsurface]; c != 0 ; c--, surf++) for ( c = 0; c < node.numsurfaces; c++) *************** *** 876,897 **** } } - // recurse down the back side R_RecursiveWorldNode(node.children[1 - side]); } ! ! /* ! ============= ! R_DrawWorld ! ============= ! */ void R_DrawWorld() { - entity_t ent = new entity_t(); - // auto cycle the world frame for texture animation - ent.frame = (int)(r_newrefdef.time*2); - currententity = ent; - if (r_drawworld.value == 0) return; --- 838,852 ---- } } // recurse down the back side R_RecursiveWorldNode(node.children[1 - side]); } ! private final entity_t worldEntity = new entity_t(); ! ! /** ! * R_DrawWorld ! */ void R_DrawWorld() { if (r_drawworld.value == 0) return; *************** *** 904,907 **** --- 859,868 ---- Math3D.VectorCopy(r_newrefdef.vieworg, modelorg); + entity_t ent = worldEntity; + // auto cycle the world frame for texture animation + ent.clear(); + ent.frame = (int)(r_newrefdef.time*2); + currententity = ent; + gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; *************** *** 939,964 **** } ! byte[] fatvis = new byte[Defines.MAX_MAP_LEAFS / 8]; ! ! /* ! =============== ! R_MarkLeaves ! Mark the leaves and nodes that are in the PVS for the current ! cluster ! =============== ! */ void R_MarkLeaves() { - //byte[] vis; - //byte[] fatvis = new byte[Defines.MAX_MAP_LEAFS / 8]; - - //Arrays.fill(fatvis, (byte)0); - - mnode_t node; - int i, c; - mleaf_t leaf; - int cluster; - if (r_oldviewcluster == r_viewcluster && r_oldviewcluster2 == r_viewcluster2 && r_novis.value == 0 && r_viewcluster != -1) return; --- 900,912 ---- } ! final byte[] fatvis = new byte[Defines.MAX_MAP_LEAFS / 8]; ! /** ! * R_MarkLeaves ! * Mark the leaves and nodes that are in the PVS for the current ! * cluster ! */ void R_MarkLeaves() { if (r_oldviewcluster == r_viewcluster && r_oldviewcluster2 == r_viewcluster2 && r_novis.value == 0 && r_viewcluster != -1) return; *************** *** 973,976 **** --- 921,925 ---- r_oldviewcluster2 = r_viewcluster2; + int i; if (r_novis.value != 0 || r_viewcluster == -1 || r_worldmodel.vis == null) { *************** *** 984,987 **** --- 933,937 ---- byte[] vis = Mod_ClusterPVS(r_viewcluster, r_worldmodel); + int c; // may have to combine two clusters because of solid water boundaries if (r_viewcluster2 != r_viewcluster) *************** *** 1001,1005 **** vis = fatvis; } ! for ( i=0; i < r_worldmodel.numleafs; i++) { --- 951,958 ---- vis = fatvis; } ! ! mnode_t node; ! mleaf_t leaf; ! int cluster; for ( i=0; i < r_worldmodel.numleafs; i++) { *************** *** 1022,1027 **** } - - /* ============================================================================= --- 975,978 ---- *************** *** 1032,1035 **** --- 983,989 ---- */ + /** + * LM_InitBlock + */ void LM_InitBlock() { *************** *** 1037,1053 **** } void LM_UploadBlock( boolean dynamic ) { ! int texture; ! int height = 0; ! ! if ( dynamic ) ! { ! texture = 0; ! } ! else ! { ! texture = gl_lms.current_lightmap_texture; ! } GL_Bind( gl_state.lightmap_textures + texture ); --- 991,1001 ---- } + /** + * LM_UploadBlock + * @param dynamic + */ void LM_UploadBlock( boolean dynamic ) { ! int texture = ( dynamic ) ? 0 : gl_lms.current_lightmap_texture; GL_Bind( gl_state.lightmap_textures + texture ); *************** *** 1058,1064 **** if ( dynamic ) { ! int i; ! ! for ( i = 0; i < BLOCK_WIDTH; i++ ) { if ( gl_lms.allocated[i] > height ) --- 1006,1011 ---- if ( dynamic ) { ! int height = 0; ! for (int i = 0; i < BLOCK_WIDTH; i++ ) { if ( gl_lms.allocated[i] > height ) *************** *** 1087,1106 **** Com.Error( Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n" ); - //debugLightmap(gl_lms.lightmap_buffer, 128, 128, 4); - } } ! // returns a texture number and the position inside it boolean LM_AllocBlock (int w, int h, pos_t pos) { int x = pos.x; int y = pos.y; - int i, j; - int best, best2; - - best = BLOCK_HEIGHT; for (i=0 ; i<BLOCK_WIDTH-w ; i++) { --- 1034,1056 ---- Com.Error( Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n" ); //debugLightmap(gl_lms.lightmap_buffer, 128, 128, 4); } } ! /** ! * LM_AllocBlock ! * @param w ! * @param h ! * @param pos ! * @return a texture number and the position inside it ! */ boolean LM_AllocBlock (int w, int h, pos_t pos) { + int best = BLOCK_HEIGHT; int x = pos.x; int y = pos.y; + int best2; + int i, j; for (i=0 ; i<BLOCK_WIDTH-w ; i++) { *************** *** 1130,1154 **** } ! /* ! ================ ! GL_BuildPolygonFromSurface ! ================ ! */ void GL_BuildPolygonFromSurface(msurface_t fa) { - int i, lindex, lnumverts; - medge_t[] pedges; - medge_t r_pedge; - int vertpage; - float[] vec; - float s, t; - float[] total = {0, 0, 0}; - // reconstruct the polygon ! pedges = currentmodel.edges; ! lnumverts = fa.numedges; ! vertpage = 0; ! ! Math3D.VectorClear(total); // // draw texture --- 1080,1092 ---- } ! /** ! * GL_BuildPolygonFromSurface ! */ void GL_BuildPolygonFromSurface(msurface_t fa) { // reconstruct the polygon ! medge_t[] pedges = currentmodel.edges; ! int lnumverts = fa.numedges; ! int vertpage = 0; // // draw texture *************** *** 1161,1165 **** fa.polys = poly; ! for (i=0 ; i<lnumverts ; i++) { lindex = currentmodel.surfedges[fa.firstedge + i]; --- 1099,1107 ---- fa.polys = poly; ! int lindex; ! float[] vec; ! medge_t r_pedge; ! float s, t; ! for (int i=0 ; i<lnumverts ; i++) { lindex = currentmodel.surfedges[fa.firstedge + i]; *************** *** 1181,1185 **** t /= fa.texinfo.image.height; - Math3D.VectorAdd (total, vec, total); poly.x(i, vec[0]); poly.y(i, vec[1]); --- 1123,1126 ---- *************** *** 1209,1227 **** } ! /* ! ======================== ! GL_CreateSurfaceLightmap ! ======================== ! */ void GL_CreateSurfaceLightmap(msurface_t surf) { - int smax, tmax; - IntBuffer base; - if ( (surf.flags & (Defines.SURF_DRAWSKY | Defines.SURF_DRAWTURB)) != 0) return; ! smax = (surf.extents[0]>>4)+1; ! tmax = (surf.extents[1]>>4)+1; pos_t lightPos = new pos_t(surf.light_s, surf.light_t); --- 1150,1163 ---- } ! /** ! * GL_CreateSurfaceLightmap ! */ void GL_CreateSurfaceLightmap(msurface_t surf) { if ( (surf.flags & (Defines.SURF_DRAWSKY | Defines.SURF_DRAWTURB)) != 0) return; ! int smax = (surf.extents[0]>>4)+1; ! int tmax = (surf.extents[1]>>4)+1; pos_t lightPos = new pos_t(surf.light_s, surf.light_t); *************** *** 1244,1248 **** surf.lightmaptexturenum = gl_lms.current_lightmap_texture; ! base = gl_lms.lightmap_buffer; base.position(surf.light_t * BLOCK_WIDTH + surf.light_s); --- 1180,1184 ---- surf.lightmaptexturenum = gl_lms.current_lightmap_texture; ! IntBuffer base = gl_lms.lightmap_buffer; base.position(surf.light_t * BLOCK_WIDTH + surf.light_s); *************** *** 1252,1263 **** lightstyle_t[] lightstyles; ! IntBuffer dummy = BufferUtils.createIntBuffer(128*128); ! ! /* ! ================== ! GL_BeginBuildingLightmaps ! ================== ! */ void GL_BeginBuildingLightmaps(model_t m) { --- 1188,1196 ---- lightstyle_t[] lightstyles; ! private final IntBuffer dummy = BufferUtils.createIntBuffer(128*128); ! /** ! * GL_BeginBuildingLightmaps ! */ void GL_BeginBuildingLightmaps(model_t m) { *************** *** 1358,1366 **** } ! /* ! ======================= ! GL_EndBuildingLightmaps ! ======================= ! */ void GL_EndBuildingLightmaps() { --- 1291,1297 ---- } ! /** ! * GL_EndBuildingLightmaps ! */ void GL_EndBuildingLightmaps() { |
From: Carsten W. <ca...@us...> - 2005-01-17 15:42:39
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12727/src/jake2/render/lwjgl Modified Files: Warp.java Log Message: local float[] optimize; code clean up Index: Warp.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Warp.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Warp.java 10 Jan 2005 00:05:22 -0000 1.4 --- Warp.java 17 Jan 2005 15:42:29 -0000 1.5 *************** *** 31,34 **** --- 31,35 ---- import jake2.render.*; import jake2.util.Math3D; + import jake2.util.Vec3Cache; import org.lwjgl.opengl.GL11; *************** *** 40,45 **** */ public abstract class Warp extends Model { - - // warpsin.h public static final float[] SIN = { --- 41,44 ---- *************** *** 78,84 **** }; - // gl_warp.c -- sky and water polygons - //extern model_t *loadmodel; // Model.java - String skyname; float skyrotate; --- 77,80 ---- *************** *** 90,105 **** static final int SUBDIVIDE_SIZE = 64; ! void BoundPoly(int numverts, float[][] verts, float[] mins, float[] maxs) ! { ! int i, j; ! float[] v; ! mins[0] = mins[1] = mins[2] = 9999; maxs[0] = maxs[1] = maxs[2] = -9999; ! for (i=0 ; i<numverts ; i++) ! { v = verts[i]; ! for (j=0 ; j<3 ; j++) ! { if (v[j] < mins[j]) mins[j] = v[j]; --- 86,105 ---- static final int SUBDIVIDE_SIZE = 64; ! /** ! * BoundPoly ! * @param numverts ! * @param verts ! * @param mins ! * @param maxs ! */ ! void BoundPoly(int numverts, float[][] verts, float[] mins, float[] maxs) { mins[0] = mins[1] = mins[2] = 9999; maxs[0] = maxs[1] = maxs[2] = -9999; ! ! int j; ! float[] v; ! for (int i=0 ; i<numverts ; i++) { v = verts[i]; ! for (j=0 ; j<3 ; j++) { if (v[j] < mins[j]) mins[j] = v[j]; *************** *** 110,120 **** } void SubdividePolygon(int numverts, float[][] verts) { int i, j, k; - float[] mins = {0, 0, 0}; - float[] maxs = {0, 0, 0}; float m; - float[] v = {0, 0, 0}; float[][] front = new float[64][3]; float[][] back = new float[64][3]; --- 110,122 ---- } + /** + * SubdividePolygon + * @param numverts + * @param verts + */ void SubdividePolygon(int numverts, float[][] verts) { int i, j, k; float m; float[][] front = new float[64][3]; float[][] back = new float[64][3]; *************** *** 123,135 **** float[] dist = new float[64]; float frac; - float s, t; - float[] total = {0, 0, 0}; - float total_s, total_t; if (numverts > 60) Com.Error(Defines.ERR_DROP, "numverts = " + numverts); ! BoundPoly(numverts, verts, mins, maxs); // x,y und z for (i=0 ; i<3 ; i++) --- 125,137 ---- float[] dist = new float[64]; float frac; if (numverts > 60) Com.Error(Defines.ERR_DROP, "numverts = " + numverts); ! float[] mins = Vec3Cache.get(); ! float[] maxs = Vec3Cache.get(); + BoundPoly(numverts, verts, mins, maxs); + float[] v; // x,y und z for (i=0 ; i<3 ; i++) *************** *** 151,155 **** Math3D.VectorCopy(verts[0], verts[numverts]); ! f = b = 0; for (j=0 ; j<numverts ; j++) --- 153,157 ---- Math3D.VectorCopy(verts[0], verts[numverts]); ! f = b = 0; for (j=0 ; j<numverts ; j++) *************** *** 182,188 **** SubdividePolygon(f, front); SubdividePolygon(b, back); return; } ! // add a point in the center to help keep warp valid --- 184,194 ---- SubdividePolygon(f, front); SubdividePolygon(b, back); + + Vec3Cache.release(2); // mins, maxs return; } ! ! Vec3Cache.release(2); // mins, maxs ! // add a point in the center to help keep warp valid *************** *** 195,202 **** poly.next = warpface.polys; warpface.polys = poly; Math3D.VectorClear(total); ! total_s = 0; ! total_t = 0; ! for (i = 0; i < numverts; i++) { poly.x(i + 1, verts[i][0]); poly.y(i + 1, verts[i][1]); --- 201,211 ---- poly.next = warpface.polys; warpface.polys = poly; + + float[] total = Vec3Cache.get(); Math3D.VectorClear(total); ! float total_s = 0; ! float total_t = 0; ! float s, t; ! for (i = 0; i < numverts; i++) { poly.x(i + 1, verts[i][0]); poly.y(i + 1, verts[i][1]); *************** *** 227,243 **** poly.s2(i + 1, poly.s2(1)); poly.t2(i + 1, poly.t2(1)); } ! /* ! ================ ! GL_SubdivideSurface ! ! Breaks a polygon up along axial 64 unit ! boundaries so that turbulent and sky warps ! can be done reasonably. ! ================ ! */ ! float[][] tmpVerts = new float[64][3]; ! void GL_SubdivideSurface(msurface_t fa) { float[][] verts = tmpVerts; --- 236,250 ---- poly.s2(i + 1, poly.s2(1)); poly.t2(i + 1, poly.t2(1)); + + Vec3Cache.release(); // total } ! private final float[][] tmpVerts = new float[64][3]; ! /** ! * GL_SubdivideSurface ! * Breaks a polygon up along axial 64 unit ! * boundaries so that turbulent and sky warps ! * can be done reasonably. ! */ void GL_SubdivideSurface(msurface_t fa) { float[][] verts = tmpVerts; *************** *** 261,293 **** } ! // ========================================================= ! ! ! ! //// speed up sin calculations - Ed ! // float r_turbsin[] = ! // { ! // #include "warpsin.h" ! // }; static final float TURBSCALE = (float)(256.0f / (2 * Math.PI)); ! /* ! ============= ! EmitWaterPolys ! ! Does a water warp on the pre-fragmented glpoly_t chain ! ============= ! */ void EmitWaterPolys(msurface_t fa) { - glpoly_t p, bp; - float[] v; - int i; - float s = 0; - float t = 0; - float os, ot; - float scroll; float rdt = r_newrefdef.time; if ((fa.texinfo.flags & Defines.SURF_FLOWING) != 0) scroll = -64 * ( (r_newrefdef.time*0.5f) - (int)(r_newrefdef.time*0.5f) ); --- 268,283 ---- } ! // ========================================================= static final float TURBSCALE = (float)(256.0f / (2 * Math.PI)); ! /** ! * EmitWaterPolys ! * Does a water warp on the pre-fragmented glpoly_t chain ! */ void EmitWaterPolys(msurface_t fa) { float rdt = r_newrefdef.time; + float scroll; if ((fa.texinfo.flags & Defines.SURF_FLOWING) != 0) scroll = -64 * ( (r_newrefdef.time*0.5f) - (int)(r_newrefdef.time*0.5f) ); *************** *** 295,298 **** --- 285,291 ---- scroll = 0; + int i; + float s, t, os, ot; + glpoly_t p, bp; for (bp = fa.polys; bp != null; bp = bp.next) { p = bp; *************** *** 321,325 **** // =================================================================== - float[][] skyclip = { { 1, 1, 0}, --- 314,317 ---- *************** *** 364,379 **** float sky_min, sky_max; ! void DrawSkyPolygon (int nump, float[][] vecs) { - int i,j; - float[] v = {0, 0, 0}; - float[] av = {0, 0, 0}; - float s, t, dv; - int axis; - float[] vp; - c_sky++; // decide which face it maps to Math3D.VectorCopy(Globals.vec3_origin, v); for (i=0; i<nump ; i++) { --- 356,373 ---- float sky_min, sky_max; ! // stack variable ! private final float[] v = {0, 0, 0}; ! private final float[] av = {0, 0, 0}; ! /** ! * DrawSkyPolygon ! * @param nump ! * @param vecs ! */ ! void DrawSkyPolygon(int nump, float[][] vecs) { c_sky++; // decide which face it maps to Math3D.VectorCopy(Globals.vec3_origin, v); + int i, axis; for (i=0; i<nump ; i++) { *************** *** 406,409 **** --- 400,405 ---- // project new texture coords + float s, t, dv; + int j; for (i=0 ; i<nump ; i++) { *************** *** 448,460 **** float[][][][] newv = new float[6][2][MAX_CLIP_VERTS][3]; void ClipSkyPolygon(int nump, float[][] vecs, int stage) { - float[] norm; - float[] v; - boolean front, back; - float d, e; - int[] newc = { 0, 0 }; - int i, j; - if (nump > MAX_CLIP_VERTS-2) Com.Error(Defines.ERR_DROP, "ClipSkyPolygon: MAX_CLIP_VERTS"); --- 444,455 ---- float[][][][] newv = new float[6][2][MAX_CLIP_VERTS][3]; + /** + * ClipSkyPolygon + * @param nump + * @param vecs + * @param stage + */ void ClipSkyPolygon(int nump, float[][] vecs, int stage) { if (nump > MAX_CLIP_VERTS-2) Com.Error(Defines.ERR_DROP, "ClipSkyPolygon: MAX_CLIP_VERTS"); *************** *** 465,470 **** } ! front = back = false; ! norm = skyclip[stage]; for (i=0 ; i<nump ; i++) { --- 460,469 ---- } ! boolean front = false; ! boolean back = false; ! float[] norm = skyclip[stage]; ! ! int i; ! float d; for (i=0 ; i<nump ; i++) { *************** *** 495,500 **** dists[i] = dists[0]; Math3D.VectorCopy(vecs[0], vecs[i]); - newc[0] = newc[1] = 0; for (i=0; i<nump ; i++) { --- 494,502 ---- dists[i] = dists[0]; Math3D.VectorCopy(vecs[0], vecs[i]); + int newc0 = 0; int newc1 = 0; + float[] v; + float e; + int j; for (i=0; i<nump ; i++) { *************** *** 503,518 **** { case SIDE_FRONT: ! Math3D.VectorCopy(v, newv[stage][0][newc[0]]); ! newc[0]++; break; case SIDE_BACK: ! Math3D.VectorCopy(v, newv[stage][1][newc[1]]); ! newc[1]++; break; case SIDE_ON: ! Math3D.VectorCopy(v, newv[stage][0][newc[0]]); ! newc[0]++; ! Math3D.VectorCopy (v, newv[stage][1][newc[1]]); ! newc[1]++; break; } --- 505,520 ---- { case SIDE_FRONT: ! Math3D.VectorCopy(v, newv[stage][0][newc0]); ! newc0++; break; case SIDE_BACK: ! Math3D.VectorCopy(v, newv[stage][1][newc1]); ! newc1++; break; case SIDE_ON: ! Math3D.VectorCopy(v, newv[stage][0][newc0]); ! newc0++; ! Math3D.VectorCopy (v, newv[stage][1][newc1]); ! newc1++; break; } *************** *** 525,547 **** { e = v[j] + d * (vecs[i + 1][j] - v[j]); ! newv[stage][0][newc[0]][j] = e; ! newv[stage][1][newc[1]][j] = e; } ! newc[0]++; ! newc[1]++; } // continue ! ClipSkyPolygon(newc[0], newv[stage][0], stage+1); ! ClipSkyPolygon(newc[1], newv[stage][1], stage+1); } float[][] verts = new float[MAX_CLIP_VERTS][3]; ! /* ! ================= ! R_AddSkySurface ! ================= ! */ void R_AddSkySurface(msurface_t fa) { --- 527,547 ---- { e = v[j] + d * (vecs[i + 1][j] - v[j]); ! newv[stage][0][newc0][j] = e; ! newv[stage][1][newc1][j] = e; } ! newc0++; ! newc1++; } // continue ! ClipSkyPolygon(newc0, newv[stage][0], stage+1); ! ClipSkyPolygon(newc1, newv[stage][1], stage+1); } float[][] verts = new float[MAX_CLIP_VERTS][3]; ! /** ! * R_AddSkySurface ! */ void R_AddSkySurface(msurface_t fa) { *************** *** 557,593 **** } ! ! /* ! ============== ! R_ClearSkyBox ! ============== ! */ void R_ClearSkyBox() { for (int i=0 ; i<6 ; i++) { ! skymins[0][i] = skymins[1][i] = 9999; ! skymaxs[0][i] = skymaxs[1][i] = -9999; } } ! ! ! void MakeSkyVec (float s, float t, int axis) { - float[] v = {0, 0, 0}; - float[] b = {0, 0, 0}; - int j, k; - b[0] = s*2300; b[1] = t*2300; b[2] = 2300; for (j=0 ; j<3 ; j++) { k = st_to_vec[axis][j]; if (k < 0) ! v[j] = -b[-k - 1]; else ! v[j] = b[k - 1]; } --- 557,600 ---- } ! /** ! * R_ClearSkyBox ! */ void R_ClearSkyBox() { + float[] skymins0 = skymins[0]; + float[] skymins1 = skymins[1]; + float[] skymaxs0 = skymaxs[0]; + float[] skymaxs1 = skymaxs[1]; + for (int i=0 ; i<6 ; i++) { ! skymins0[i] = skymins1[i] = 9999; ! skymaxs0[i] = skymaxs1[i] = -9999; } } ! ! // stack variable ! private final float[] v1 = {0, 0, 0}; ! private final float[] b = {0, 0, 0}; ! /** ! * MakeSkyVec ! * @param s ! * @param t ! * @param axis ! */ ! void MakeSkyVec(float s, float t, int axis) { b[0] = s*2300; b[1] = t*2300; b[2] = 2300; + int j, k; for (j=0 ; j<3 ; j++) { k = st_to_vec[axis][j]; if (k < 0) ! v1[j] = -b[-k - 1]; else ! v1[j] = b[k - 1]; } *************** *** 607,620 **** t = 1.0f - t; gl.glTexCoord2f (s, t); ! gl.glVertex3f(v[0], v[1], v[2]); } - /* - ============== - R_DrawSkyBox - ============== - */ int[] skytexorder = {0,2,1,3,4,5}; void R_DrawSkyBox() { --- 614,625 ---- t = 1.0f - t; gl.glTexCoord2f (s, t); ! gl.glVertex3f(v1[0], v1[1], v1[2]); } int[] skytexorder = {0,2,1,3,4,5}; + /** + * R_DrawSkyBox + */ void R_DrawSkyBox() { *************** *** 661,680 **** } - - /* - ============ - R_SetSky - ============ - */ // 3dstudio environment map names String[] suf = {"rt", "bk", "lf", "ft", "up", "dn"}; protected void R_SetSky(String name, float rotate, float[] axis) { assert (axis.length == 3) : "vec3_t bug"; - int i; String pathname; - - // strncpy (skyname, name, sizeof(skyname)-1); skyname = name; --- 666,682 ---- } // 3dstudio environment map names String[] suf = {"rt", "bk", "lf", "ft", "up", "dn"}; + /** + * R_SetSky + * @param name + * @param rotate + * @param axis + */ protected void R_SetSky(String name, float rotate, float[] axis) { assert (axis.length == 3) : "vec3_t bug"; String pathname; skyname = name; *************** *** 682,686 **** Math3D.VectorCopy(axis, skyaxis); ! for (i=0 ; i<6 ; i++) { // chop down rotating skies for less memory --- 684,688 ---- Math3D.VectorCopy(axis, skyaxis); ! for (int i=0 ; i<6 ; i++) { // chop down rotating skies for less memory *************** *** 714,716 **** } } ! } --- 716,718 ---- } } ! } \ No newline at end of file |
From: Carsten W. <ca...@us...> - 2005-01-17 13:30:49
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19611/src/jake2/render/lwjgl Modified Files: Main.java Log Message: local float[] otimize; code clean up Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Main.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Main.java 14 Dec 2004 12:56:58 -0000 1.2 --- Main.java 17 Jan 2005 13:30:38 -0000 1.3 *************** *** 63,67 **** public abstract class Main extends Base { - public static int[] d_8to24table = new int[256]; --- 63,66 ---- *************** *** 128,132 **** int GL_TEXTURE1 = GL13.GL_TEXTURE1; - model_t r_worldmodel; --- 127,130 ---- *************** *** 240,250 **** // ============================================================================ ! /* ! ================= ! R_CullBox ! ! Returns true if the box is completely outside the frustom ! ================= ! */ final boolean R_CullBox(float[] mins, float[] maxs) { assert(mins.length == 3 && maxs.length == 3) : "vec3_t bug"; --- 238,245 ---- // ============================================================================ ! /** ! * R_CullBox ! * Returns true if the box is completely outside the frustum ! */ final boolean R_CullBox(float[] mins, float[] maxs) { assert(mins.length == 3 && maxs.length == 3) : "vec3_t bug"; *************** *** 260,265 **** } final void R_RotateForEntity(entity_t e) { - gl.glTranslatef(e.origin[0], e.origin[1], e.origin[2]); --- 255,262 ---- } + /** + * R_RotateForEntity + */ final void R_RotateForEntity(entity_t e) { gl.glTranslatef(e.origin[0], e.origin[1], e.origin[2]); *************** *** 277,289 **** */ ! /* ! ================= ! R_DrawSpriteModel ! ! ================= ! */ void R_DrawSpriteModel(entity_t e) { float alpha = 1.0F; - float[] point = { 0, 0, 0 }; qfiles.dsprframe_t frame; --- 274,284 ---- */ ! // stack variable ! private final float[] point = { 0, 0, 0 }; ! /** ! * R_DrawSpriteModel ! */ void R_DrawSpriteModel(entity_t e) { float alpha = 1.0F; qfiles.dsprframe_t frame; *************** *** 351,363 **** // ================================================================================== ! /* ! ============= ! R_DrawNullModel ! ============= ! cwei :-) */ void R_DrawNullModel() { - float[] shadelight = { 0, 0, 0 }; - if ((currententity.flags & Defines.RF_FULLBRIGHT) != 0) { // cwei wollte blau: shadelight[0] = shadelight[1] = shadelight[2] = 1.0F; --- 346,355 ---- // ================================================================================== ! // stack variable ! private final float[] shadelight = { 0, 0, 0 }; ! /** ! * R_DrawNullModel */ void R_DrawNullModel() { if ((currententity.flags & Defines.RF_FULLBRIGHT) != 0) { // cwei wollte blau: shadelight[0] = shadelight[1] = shadelight[2] = 1.0F; *************** *** 399,414 **** } ! /* ! ============= ! R_DrawEntitiesOnList ! ============= ! */ void R_DrawEntitiesOnList() { - int i; - if (r_drawentities.value == 0.0f) return; // draw non-transparent first for (i = 0; i < r_newrefdef.num_entities; i++) { currententity = r_newrefdef.entities[i]; --- 391,403 ---- } ! /** ! * R_DrawEntitiesOnList ! */ void R_DrawEntitiesOnList() { if (r_drawentities.value == 0.0f) return; // draw non-transparent first + int i; for (i = 0; i < r_newrefdef.num_entities; i++) { currententity = r_newrefdef.entities[i]; *************** *** 478,491 **** } ! /* ! ** GL_DrawParticles ! ** ! */ void GL_DrawParticles(int num_particles) { - float[] up = { 0, 0, 0 }; - float[] right = { 0, 0, 0 }; - float scale; - int color; - float origin_x, origin_y, origin_z; --- 467,477 ---- } ! // stack variable ! private final float[] up = { 0, 0, 0 }; ! private final float[] right = { 0, 0, 0 }; ! /** ! * GL_DrawParticles ! */ void GL_DrawParticles(int num_particles) { float origin_x, origin_y, origin_z; *************** *** 502,505 **** --- 488,493 ---- FloatBuffer sourceVertices = particle_t.vertexArray; IntBuffer sourceColors = particle_t.colorArray; + float scale; + int color; for (int j = 0, i = 0; i < num_particles; i++) { origin_x = sourceVertices.get(j++); *************** *** 541,549 **** } ! /* ! =============== ! R_DrawParticles ! =============== ! */ void R_DrawParticles() { --- 529,535 ---- } ! /** ! * R_DrawParticles ! */ void R_DrawParticles() { *************** *** 576,584 **** } ! /* ! ============ ! R_PolyBlend ! ============ ! */ void R_PolyBlend() { if (gl_polyblend.value == 0.0f) --- 562,568 ---- } ! /** ! * R_PolyBlend ! */ void R_PolyBlend() { if (gl_polyblend.value == 0.0f) *************** *** 618,621 **** --- 602,608 ---- // ======================================================================= + /** + * SignbitsForPlane + */ int SignbitsForPlane(cplane_t out) { // for fast box on planeside test *************** *** 628,631 **** --- 615,621 ---- } + /** + * R_SetFrustum + */ void R_SetFrustum() { // rotate VPN right by FOV_X/2 degrees *************** *** 647,659 **** // ======================================================================= ! /* ! =============== ! R_SetupFrame ! =============== ! */ void R_SetupFrame() { - int i; - mleaf_t leaf; - r_framecount++; --- 637,646 ---- // ======================================================================= ! // stack variable ! private final float[] temp = {0, 0, 0}; ! /** ! * R_SetupFrame ! */ void R_SetupFrame() { r_framecount++; *************** *** 664,667 **** --- 651,655 ---- // current viewcluster + mleaf_t leaf; if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) == 0) { r_oldviewcluster = r_viewcluster; *************** *** 672,677 **** // check above and below so crossing solid water doesn't draw wrong if (leaf.contents == 0) { // look down a bit - float[] temp = { 0, 0, 0 }; - Math3D.VectorCopy(r_origin, temp); temp[2] -= 16; --- 660,663 ---- *************** *** 681,686 **** } else { // look up a bit - float[] temp = { 0, 0, 0 }; - Math3D.VectorCopy(r_origin, temp); temp[2] += 16; --- 667,670 ---- *************** *** 691,695 **** } ! for (i = 0; i < 4; i++) v_blend[i] = r_newrefdef.blend[i]; --- 675,679 ---- } ! for (int i = 0; i < 4; i++) v_blend[i] = r_newrefdef.blend[i]; *************** *** 712,723 **** } void MYgluPerspective(double fovy, double aspect, double zNear, double zFar) { ! double xmin, xmax, ymin, ymax; ! ! ymax = zNear * Math.tan(fovy * Math.PI / 360.0); ! ymin = -ymax; ! xmin = ymin * aspect; ! xmax = ymax * aspect; xmin += - (2 * gl_state.camera_separation) / zNear; --- 696,713 ---- } + /** + * MYgluPerspective + * + * @param fovy + * @param aspect + * @param zNear + * @param zFar + */ void MYgluPerspective(double fovy, double aspect, double zNear, double zFar) { ! double ymax = zNear * Math.tan(fovy * Math.PI / 360.0); ! double ymin = -ymax; ! double xmin = ymin * aspect; ! double xmax = ymax * aspect; xmin += - (2 * gl_state.camera_separation) / zNear; *************** *** 727,735 **** } ! /* ! ============= ! R_SetupGL ! ============= ! */ void R_SetupGL() { --- 717,723 ---- } ! /** ! * R_SetupGL ! */ void R_SetupGL() { *************** *** 787,797 **** } - /* - ============= - R_Clear - ============= - */ int trickframe = 0; void R_Clear() { if (gl_ztrick.value != 0.0f) { --- 775,783 ---- } int trickframe = 0; + /** + * R_Clear + */ void R_Clear() { if (gl_ztrick.value != 0.0f) { *************** *** 826,840 **** } void R_Flash() { R_PolyBlend(); } ! /* ! ================ ! R_RenderView ! ! r_newrefdef must be set before the first call ! ================ ! */ void R_RenderView(refdef_t fd) { --- 812,826 ---- } + /** + * R_Flash + */ void R_Flash() { R_PolyBlend(); } ! /** ! * R_RenderView ! * r_newrefdef must be set before the first call ! */ void R_RenderView(refdef_t fd) { *************** *** 890,893 **** --- 876,882 ---- } + /** + * R_SetGL2D + */ void R_SetGL2D() { // set 2D virtual screen size *************** *** 905,917 **** } ! /* ! ==================== ! R_SetLightLevel ! ! ==================== ! */ void R_SetLightLevel() { - float[] shadelight = { 0, 0, 0 }; - if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0) return; --- 894,903 ---- } ! // stack variable ! private final float[] shadelight1 = { 0, 0, 0 }; ! /** ! * R_SetLightLevel ! */ void R_SetLightLevel() { if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0) return; *************** *** 923,946 **** // pick the greatest component, which should be the same // as the mono value returned by software ! if (shadelight[0] > shadelight[1]) { ! if (shadelight[0] > shadelight[2]) ! r_lightlevel.value = 150 * shadelight[0]; else ! r_lightlevel.value = 150 * shadelight[2]; } else { ! if (shadelight[1] > shadelight[2]) ! r_lightlevel.value = 150 * shadelight[1]; else ! r_lightlevel.value = 150 * shadelight[2]; } } ! /* ! @@@@@@@@@@@@@@@@@@@@@ ! R_RenderFrame ! ! @@@@@@@@@@@@@@@@@@@@@ ! */ protected void R_RenderFrame(refdef_t fd) { R_RenderView(fd); --- 909,929 ---- // pick the greatest component, which should be the same // as the mono value returned by software ! if (shadelight1[0] > shadelight1[1]) { ! if (shadelight1[0] > shadelight1[2]) ! r_lightlevel.value = 150 * shadelight1[0]; else ! r_lightlevel.value = 150 * shadelight1[2]; } else { ! if (shadelight1[1] > shadelight1[2]) ! r_lightlevel.value = 150 * shadelight1[1]; else ! r_lightlevel.value = 150 * shadelight1[2]; } } ! /** ! * R_RenderFrame ! */ protected void R_RenderFrame(refdef_t fd) { R_RenderView(fd); *************** *** 949,952 **** --- 932,938 ---- } + /** + * R_Register + */ protected void R_Register() { r_lefthand = Cvar.Get("hand", "0", Globals.CVAR_USERINFO | Globals.CVAR_ARCHIVE); *************** *** 1040,1060 **** } ! /* ! ================== ! R_SetMode ! ================== ! */ protected boolean R_SetMode() { ! ! int err; // enum rserr_t ! boolean fullscreen; ! ! // if (vid_fullscreen.modified && !gl_config.allow_cds) { ! // VID.Printf(Defines.PRINT_ALL, "R_SetMode() - CDS not allowed with this driver\n"); ! // Cvar.SetValue("vid_fullscreen", (vid_fullscreen.value > 0.0f) ? 0.0f : 1.0f); ! // vid_fullscreen.modified = false; ! // } ! ! fullscreen = (vid_fullscreen.value > 0.0f); vid_fullscreen.modified = false; --- 1026,1034 ---- } ! /** ! * R_SetMode ! */ protected boolean R_SetMode() { ! boolean fullscreen = (vid_fullscreen.value > 0.0f); vid_fullscreen.modified = false; *************** *** 1063,1066 **** --- 1037,1041 ---- Dimension dim = new Dimension(vid.width, vid.height); + int err; // enum rserr_t if ((err = GLimp_SetMode(dim, (int) gl_mode.value, fullscreen)) == rserr_ok) { gl_state.prev_mode = (int) gl_mode.value; *************** *** 1089,1099 **** } - /* - =============== - R_Init - =============== - */ float[] r_turbsin = new float[256]; protected boolean R_Init(int vid_xpos, int vid_ypos) { --- 1064,1072 ---- } float[] r_turbsin = new float[256]; + /** + * R_Init + */ protected boolean R_Init(int vid_xpos, int vid_ypos) { *************** *** 1122,1125 **** --- 1095,1101 ---- } + /** + * R_Init2 + */ protected boolean R_Init2() { VID.MenuInit(); *************** *** 1314,1322 **** } ! /* ! =============== ! R_Shutdown ! =============== ! */ protected void R_Shutdown() { Cmd.RemoveCommand("modellist"); --- 1290,1296 ---- } ! /** ! * R_Shutdown ! */ protected void R_Shutdown() { Cmd.RemoveCommand("modellist"); *************** *** 1335,1343 **** } ! /* ! @@@@@@@@@@@@@@@@@@@@@ ! R_BeginFrame ! @@@@@@@@@@@@@@@@@@@@@ ! */ protected void R_BeginFrame(float camera_separation) { --- 1309,1315 ---- } ! /** ! * R_BeginFrame ! */ protected void R_BeginFrame(float camera_separation) { *************** *** 1450,1458 **** int[] r_rawpalette = new int[256]; ! /* ! ============= ! R_SetPalette ! ============= ! */ protected void R_SetPalette(byte[] palette) { // 256 RGB values (768 bytes) --- 1422,1428 ---- int[] r_rawpalette = new int[256]; ! /** ! * R_SetPalette ! */ protected void R_SetPalette(byte[] palette) { // 256 RGB values (768 bytes) *************** *** 1488,1506 **** float[][] end_points = new float[NUM_BEAM_SEGS][3]; // array of vec3_t ! /* ! ** R_DrawBeam ! */ void R_DrawBeam(entity_t e) { - - int i; - float r, g, b; - - float[] perpvec = { 0, 0, 0 }; // vec3_t - float[] direction = { 0, 0, 0 }; // vec3_t - float[] normalized_direction = { 0, 0, 0 }; // vec3_t - - float[] oldorigin = { 0, 0, 0 }; // vec3_t - float[] origin = { 0, 0, 0 }; // vec3_t - oldorigin[0] = e.oldorigin[0]; oldorigin[1] = e.oldorigin[1]; --- 1458,1471 ---- float[][] end_points = new float[NUM_BEAM_SEGS][3]; // array of vec3_t ! // stack variable ! private final float[] perpvec = { 0, 0, 0 }; // vec3_t ! private final float[] direction = { 0, 0, 0 }; // vec3_t ! private final float[] normalized_direction = { 0, 0, 0 }; // vec3_t ! private final float[] oldorigin = { 0, 0, 0 }; // vec3_t ! private final float[] origin = { 0, 0, 0 }; // vec3_t ! /** ! * R_DrawBeam ! */ void R_DrawBeam(entity_t e) { oldorigin[0] = e.oldorigin[0]; oldorigin[1] = e.oldorigin[1]; *************** *** 1521,1525 **** Math3D.VectorScale(perpvec, e.frame / 2, perpvec); ! for (i = 0; i < 6; i++) { Math3D.RotatePointAroundVector( start_points[i], --- 1486,1490 ---- Math3D.VectorScale(perpvec, e.frame / 2, perpvec); ! for (int i = 0; i < 6; i++) { Math3D.RotatePointAroundVector( start_points[i], *************** *** 1536,1542 **** gl.glDepthMask(false); ! r = (d_8to24table[e.skinnum & 0xFF]) & 0xFF; ! g = (d_8to24table[e.skinnum & 0xFF] >> 8) & 0xFF; ! b = (d_8to24table[e.skinnum & 0xFF] >> 16) & 0xFF; r *= 1 / 255.0f; --- 1501,1507 ---- gl.glDepthMask(false); ! float r = (d_8to24table[e.skinnum & 0xFF]) & 0xFF; ! float g = (d_8to24table[e.skinnum & 0xFF] >> 8) & 0xFF; ! float b = (d_8to24table[e.skinnum & 0xFF] >> 16) & 0xFF; r *= 1 / 255.0f; *************** *** 1550,1554 **** float[] v; ! for (i = 0; i < NUM_BEAM_SEGS; i++) { v = start_points[i]; gl.glVertex3f(v[0], v[1], v[2]); --- 1515,1519 ---- float[] v; ! for (int i = 0; i < NUM_BEAM_SEGS; i++) { v = start_points[i]; gl.glVertex3f(v[0], v[1], v[2]); *************** *** 1566,1569 **** gl.glDepthMask(true); } ! ! } --- 1531,1533 ---- gl.glDepthMask(true); } ! } \ No newline at end of file |
From: Rene S. <sa...@us...> - 2005-01-16 21:22:02
|
Update of /cvsroot/jake2/jake2/webstart In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/webstart Modified Files: Tag: RST jake2_jogl11ATI.jnlp jake2_jogl11.jnlp jake2.jnlp Added Files: Tag: RST jake2_lwjgl.jnlp Log Message: This has vec3-optimize and the OAK bot. Index: jake2.jnlp =================================================================== RCS file: /cvsroot/jake2/jake2/webstart/jake2.jnlp,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** jake2.jnlp 3 Nov 2004 16:16:16 -0000 1.5 --- jake2.jnlp 16 Jan 2005 21:21:06 -0000 1.5.2.1 *************** *** 40,44 **** </resources> ! <application-desc main-class="jake2.Jake2"/> ! </jnlp> --- 40,51 ---- </resources> ! <application-desc main-class="jake2.Jake2"> ! <argument>+set</argument> ! <argument>vid_ref</argument> ! <argument>fastjogl</argument> ! <argument>+set</argument> ! <argument>s_impl</argument> ! <argument>joal</argument> ! </application-desc> ! </jnlp> --- NEW FILE: jake2_lwjgl.jnlp --- <?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.0+" codebase="http://www.bytonic.de/downloads" href="jake2_lwjgl.jnlp"> <information> <title>Jake2</title> <vendor>Bytonic Software</vendor> <homepage href="http://www.bytonic.de/html/jake2.html"/> <description>Java port of the Quake2 game engine</description> <icon href="http://jake2.sourceforge.net/icon.gif"/> <offline-allowed/> </information> <security> <all-permissions/> </security> <resources> <j2se version="1.4+" max-heap-size="128M"/> <jar href="http://jake2.sourceforge.net/lib/jake2.jar"/> <jar href="http://jake2.sourceforge.net/lib/lwjgl.jar"/> <jar href="http://jake2.sourceforge.net/lib/lwjgl_util.jar"/> <property name="sun.java2d.noddraw" value="true"/> </resources> <resources os="Linux"> <j2se version="1.4+" max-heap-size="128M"/> <nativelib href="http://jake2.sourceforge.net/lib/linux/lwjgl-native.jar"/> </resources> <resources os="Windows"> <j2se version="1.4+" max-heap-size="128M"/> <nativelib href="http://jake2.sourceforge.net/lib/windows/lwjgl-native.jar"/> </resources> <resources os="Mac OS X"> <j2se version="1.4+" max-heap-size="128M"/> <nativelib href="http://jake2.sourceforge.net/lib/osx/lwjgl-native.jar"/> </resources> <application-desc main-class="jake2.Jake2"> <argument>+set</argument> <argument>vid_ref</argument> <argument>lwjgl</argument> <argument>+set</argument> <argument>s_impl</argument> <argument>lwjgl</argument> </application-desc> </jnlp> Index: jake2_jogl11.jnlp =================================================================== RCS file: /cvsroot/jake2/jake2/webstart/jake2_jogl11.jnlp,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** jake2_jogl11.jnlp 3 Nov 2004 16:16:16 -0000 1.4 --- jake2_jogl11.jnlp 16 Jan 2005 21:21:06 -0000 1.4.2.1 *************** *** 45,49 **** </resources> ! <application-desc main-class="jake2.Jake2"/> ! </jnlp> --- 45,56 ---- </resources> ! <application-desc main-class="jake2.Jake2"> ! <argument>+set</argument> ! <argument>vid_ref</argument> ! <argument>fastjogl</argument> ! <argument>+set</argument> ! <argument>s_impl</argument> ! <argument>joal</argument> ! </application-desc> ! </jnlp> Index: jake2_jogl11ATI.jnlp =================================================================== RCS file: /cvsroot/jake2/jake2/webstart/jake2_jogl11ATI.jnlp,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** jake2_jogl11ATI.jnlp 3 Nov 2004 16:16:16 -0000 1.4 --- jake2_jogl11ATI.jnlp 16 Jan 2005 21:21:06 -0000 1.4.2.1 *************** *** 2,6 **** <jnlp spec="1.0+" codebase="http://www.bytonic.de/downloads" ! href="jake2_jogl11.jnlp"> <information> --- 2,6 ---- <jnlp spec="1.0+" codebase="http://www.bytonic.de/downloads" ! href="jake2_jogl11ATI.jnlp"> <information> *************** *** 45,49 **** </resources> ! <application-desc main-class="jake2.Jake2"/> </jnlp> --- 45,56 ---- </resources> ! <application-desc main-class="jake2.Jake2"> ! <argument>+set</argument> ! <argument>vid_ref</argument> ! <argument>fastjogl</argument> ! <argument>+set</argument> ! <argument>s_impl</argument> ! <argument>joal</argument> ! </application-desc> </jnlp> |
From: Rene S. <sa...@us...> - 2005-01-16 21:22:02
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/qcommon Modified Files: Tag: RST PMove.java Qcommon.java CM.java Com.java Log Message: This has vec3-optimize and the OAK bot. Index: PMove.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/PMove.java,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -C2 -d -r1.5 -r1.5.6.1 *** PMove.java 22 Sep 2004 19:22:09 -0000 1.5 --- PMove.java 16 Jan 2005 21:20:58 -0000 1.5.6.1 *************** *** 23,31 **** package jake2.qcommon; ! import jake2.*; ! import jake2.client.*; import jake2.game.*; - import jake2.render.*; - import jake2.server.*; import jake2.util.Math3D; --- 23,29 ---- package jake2.qcommon; ! import jake2.Defines; ! import jake2.Globals; import jake2.game.*; import jake2.util.Math3D; *************** *** 48,53 **** public csurface_t groundsurface; - public cplane_t groundplane = new cplane_t(); - public int groundcontents; --- 46,49 ---- *************** *** 619,623 **** trace = PMove.pm.trace.trace(PMove.pml.origin, PMove.pm.mins, PMove.pm.maxs, point); - PMove.pml.groundplane = trace.plane; PMove.pml.groundsurface = trace.surface; PMove.pml.groundcontents = trace.contents; --- 615,618 ---- *************** *** 1070,1075 **** PMove.pm.waterlevel = 0; ! // clear all pmove local vars ! PMove.pml = new PMove.pml_t(); // convert origin and velocity to float values --- 1065,1070 ---- PMove.pm.waterlevel = 0; ! PMove.pml.groundsurface = null; ! PMove.pml.groundcontents = 0; // convert origin and velocity to float values Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.java,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** Com.java 22 Aug 2004 18:30:15 -0000 1.6 --- Com.java 16 Jan 2005 21:20:59 -0000 1.6.6.1 *************** *** 92,99 **** --- 92,101 ---- { data= null; + length = 0; } else { data= in.toCharArray(); + length = data.length; } index= 0; *************** *** 109,127 **** data= in; index= offset; } public char getchar() { ! // faster than if ! try ! { ! return data[index]; ! } ! catch (Exception e) ! { ! data= null; ! // last char ! return 0; ! } } --- 111,135 ---- data= in; index= offset; + if (data != null) length = data.length; + else length = 0; } public char getchar() { ! if (index < length) { ! return data[index]; ! } ! return 0; ! // // faster than if ! // try ! // { ! // return data[index]; ! // } ! // catch (Exception e) ! // { ! // data= null; ! // // last char ! // return 0; ! // } } *************** *** 129,145 **** { // faster than if ! try ! { ! index++; ! return data[index]; ! } ! catch (Exception e) ! { ! data= null; ! // avoid int wraps; ! index--; ! // last char ! return 0; ! } } --- 137,158 ---- { // faster than if ! index++; ! if (index < length) { ! return data[index]; ! } ! return 0; ! // try ! // { ! // index++; ! // return data[index]; ! // } ! // catch (Exception e) ! // { ! // data= null; ! // // avoid int wraps; ! // index--; ! // // last char ! // return 0; ! // } } *************** *** 155,168 **** public boolean isEof() { ! return data == null; } public int index; public char data[]; public char skipwhites() { ! char c; ! while (((c= getchar()) <= ' ') && c != 0) index++; return c; --- 168,182 ---- public boolean isEof() { ! return index >= length; } public int index; public char data[]; + private int length; public char skipwhites() { ! char c = 0; ! while ( index < length && ((c= data[index]) <= ' ') && c != 0) index++; return c; *************** *** 171,176 **** public char skipwhitestoeol() { ! char c; ! while (((c= getchar()) <= ' ') && c != '\n' && c != 0) index++; return c; --- 185,190 ---- public char skipwhitestoeol() { ! char c = 0; ! while ( index < length &&((c= data[index]) <= ' ') && c != '\n' && c != 0) index++; return c; *************** *** 179,184 **** public char skiptoeol() { ! char c; ! while ((c= getchar()) != '\n' && c != 0) index++; return c; --- 193,198 ---- public char skiptoeol() { ! char c = 0; ! while ( index < length &&(c= data[index]) != '\n' && c != 0) index++; return c; *************** *** 408,419 **** public static void Println(String fmt) { ! Printf(fmt); ! Printf("\n"); ! } ! ! public static void p(String fmt) ! { ! Printf(fmt); ! Printf("\n"); } --- 422,426 ---- public static void Println(String fmt) { ! Printf(fmt + "\n"); } |
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/render/fastjogl Modified Files: Tag: RST Model.java Surf.java Main.java Light.java Mesh.java Warp.java Added Files: Tag: RST Polygon.java Log Message: This has vec3-optimize and the OAK bot. Index: Model.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Model.java,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -C2 -d -r1.5 -r1.5.6.1 *** Model.java 22 Sep 2004 19:22:10 -0000 1.5 --- Model.java 16 Jan 2005 21:21:04 -0000 1.5.6.1 *************** *** 30,54 **** import jake2.game.cplane_t; import jake2.game.cvar_t; ! import jake2.qcommon.Com; ! import jake2.qcommon.Cvar; ! import jake2.qcommon.FS; ! 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; ! import java.nio.ByteBuffer; ! import java.nio.ByteOrder; ! import java.nio.FloatBuffer; ! import java.nio.IntBuffer; import java.util.Arrays; import java.util.Vector; --- 30,39 ---- 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.*; import java.util.Arrays; import java.util.Vector; *************** *** 1090,1094 **** protected void R_BeginRegistration(String model) { resetModelArrays(); ! resetPolygonArrays(); cvar_t flushmap; --- 1075,1080 ---- protected void R_BeginRegistration(String model) { resetModelArrays(); ! // resetPolygonArrays(); ! Polygon.reset(); cvar_t flushmap; Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Main.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** Main.java 8 Dec 2004 09:58:34 -0000 1.5 --- Main.java 16 Jan 2005 21:21:04 -0000 1.5.2.1 *************** *** 29,38 **** 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; import jake2.render.*; import jake2.util.Math3D; --- 29,36 ---- import jake2.Globals; import jake2.client.*; ! import jake2.game.Cmd; import jake2.game.cplane_t; import jake2.game.cvar_t; import jake2.qcommon.*; import jake2.render.*; import jake2.util.Math3D; *************** *** 640,643 **** --- 638,644 ---- =============== */ + + private final float[] temp = { 0, 0, 0 }; + void R_SetupFrame() { int i; *************** *** 660,665 **** // check above and below so crossing solid water doesn't draw wrong if (leaf.contents == 0) { // look down a bit - float[] temp = { 0, 0, 0 }; - Math3D.VectorCopy(r_origin, temp); temp[2] -= 16; --- 661,664 ---- *************** *** 669,674 **** } else { // look up a bit - float[] temp = { 0, 0, 0 }; - Math3D.VectorCopy(r_origin, temp); temp[2] += 16; --- 668,671 ---- *************** *** 898,904 **** ==================== */ void R_SetLightLevel() { - float[] shadelight = { 0, 0, 0 }; - if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0) return; --- 895,901 ---- ==================== */ + private final float[] shadelight = { 0, 0, 0 }; + void R_SetLightLevel() { if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0) return; Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Surf.java,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -C2 -d -r1.5 -r1.5.6.1 *** Surf.java 22 Sep 2004 19:22:11 -0000 1.5 --- Surf.java 16 Jan 2005 21:21:04 -0000 1.5.6.1 *************** *** 27,49 **** import jake2.Defines; ! import jake2.client.dlight_t; ! import jake2.client.entity_t; ! import jake2.client.lightstyle_t; import jake2.game.cplane_t; import jake2.qcommon.Com; ! import jake2.render.glpoly_t; ! import jake2.render.image_t; ! import jake2.render.medge_t; ! import jake2.render.mleaf_t; ! import jake2.render.mnode_t; ! import jake2.render.model_t; ! import jake2.render.msurface_t; ! import jake2.render.mtexinfo_t; import jake2.util.Lib; import jake2.util.Math3D; ! import java.nio.ByteOrder; ! import java.nio.FloatBuffer; ! import java.nio.IntBuffer; import java.util.Arrays; --- 27,39 ---- import jake2.Defines; ! import jake2.client.*; import jake2.game.cplane_t; import jake2.qcommon.Com; ! import jake2.render.*; ! import jake2.util.*; import jake2.util.Lib; import jake2.util.Math3D; ! import java.nio.*; import java.util.Arrays; *************** *** 173,192 **** */ void DrawGLFlowingPoly(glpoly_t p) { ! int i; ! float scroll; ! ! scroll = -64 * ((r_newrefdef.time / 40.0f) - (int) (r_newrefdef.time / 40.0f)); if (scroll == 0.0f) scroll = -64.0f; ! FloatBuffer texCoord = globalPolygonInterleavedBuf; ! float[][] v = p.verts; ! int index = p.pos * POLYGON_STRIDE; ! for (i = 0; i < p.numverts; i++) { ! texCoord.put(index, v[i][3] + scroll); ! index += POLYGON_STRIDE; ! } gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); } --- 163,174 ---- */ void DrawGLFlowingPoly(glpoly_t p) { ! float scroll = -64 * ((r_newrefdef.time / 40.0f) - (int) (r_newrefdef.time / 40.0f)); if (scroll == 0.0f) scroll = -64.0f; ! p.beginScrolling(scroll); gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); + p.endScrolling(); } *************** *** 198,205 **** */ void R_DrawTriangleOutlines() { ! int i, j; ! glpoly_t p; ! ! if (gl_showtris.value == 0) return; --- 180,184 ---- */ void R_DrawTriangleOutlines() { ! if (gl_showtris.value == 0) return; *************** *** 208,223 **** gl.glColor4f(1, 1, 1, 1); ! for (i = 0; i < MAX_LIGHTMAPS; i++) { ! msurface_t surf; ! ! for (surf = gl_lms.lightmap_surfaces[i]; surf != null; surf = surf.lightmapchain) { ! p = surf.polys; ! for (; p != null; p = p.chain) { ! for (j = 2; j < p.numverts; j++) { gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3fv(p.verts[0]); ! gl.glVertex3fv(p.verts[j - 1]); ! gl.glVertex3fv(p.verts[j]); ! gl.glVertex3fv(p.verts[0]); gl.glEnd(); } --- 187,199 ---- gl.glColor4f(1, 1, 1, 1); ! for (int i = 0; i < MAX_LIGHTMAPS; i++) { ! for (msurface_t surf = gl_lms.lightmap_surfaces[i]; surf != null; surf = surf.lightmapchain) { ! for (glpoly_t p = surf.polys; p != null; p = p.chain) { ! for (int j = 2; j < p.numverts; j++) { gl.glBegin(GL.GL_LINE_STRIP); ! gl.glVertex3f(p.x(0), p.y(0), p.z(0)); ! gl.glVertex3f(p.x(j-1), p.y(j-1), p.z(j-1)); ! gl.glVertex3f(p.x(j), p.y(j), p.z(j)); ! gl.glVertex3f(p.x(0), p.y(0), p.z(0)); gl.glEnd(); } *************** *** 352,356 **** intens = gl_state.inverse_intensity; ! gl.glInterleavedArrays(GL.GL_T2F_V3F, POLYGON_BYTE_STRIDE, globalPolygonInterleavedBuf); --- 328,332 ---- intens = gl_state.inverse_intensity; ! gl.glInterleavedArrays(GL.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); *************** *** 520,530 **** for (p = surf.polys; p != null; p = p.chain) { ! v = p.verts; ! index = p.pos * POLYGON_STRIDE; ! for (i = 0; i < p.numverts; i++) { ! texCoord.put(index, v[i][3] + scroll); ! index += POLYGON_STRIDE; ! } gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); } } else { --- 496,502 ---- for (p = surf.polys; p != null; p = p.chain) { ! p.beginScrolling(scroll); gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); + p.endScrolling(); } } else { *************** *** 552,562 **** for (p = surf.polys; p != null; p = p.chain) { ! v = p.verts; ! index = p.pos * POLYGON_STRIDE; ! for (i = 0; i < p.numverts; i++) { ! texCoord.put(index, v[i][3] + scroll); ! index += POLYGON_STRIDE; ! } gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); } } else { --- 524,530 ---- for (p = surf.polys; p != null; p = p.chain) { ! p.beginScrolling(scroll); gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); + p.endScrolling(); } } else { *************** *** 644,652 **** */ void R_DrawBrushModel(entity_t e) { - float[] mins = { 0, 0, 0 }; - float[] maxs = { 0, 0, 0 }; - int i; - boolean rotated; - if (currentmodel.nummodelsurfaces == 0) return; --- 612,615 ---- *************** *** 655,661 **** gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; if (e.angles[0] != 0 || e.angles[1] != 0 || e.angles[2] != 0) { rotated = true; ! for (i = 0; i < 3; i++) { mins[i] = e.origin[i] - currentmodel.radius; maxs[i] = e.origin[i] + currentmodel.radius; --- 618,627 ---- gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; + float[] mins = Vec3Cache.get(); + float[] maxs = Vec3Cache.get(); + boolean rotated; if (e.angles[0] != 0 || e.angles[1] != 0 || e.angles[2] != 0) { rotated = true; ! for (int i = 0; i < 3; i++) { mins[i] = e.origin[i] - currentmodel.radius; maxs[i] = e.origin[i] + currentmodel.radius; *************** *** 667,672 **** } ! if (R_CullBox(mins, maxs)) return; gl.glColor3f(1, 1, 1); --- 633,642 ---- } ! if (R_CullBox(mins, maxs)) { ! Vec3Cache.release(2); // mins, maxs return; + } + + Vec3Cache.release(2); // mins, maxs gl.glColor3f(1, 1, 1); *************** *** 680,687 **** Math3D.VectorSubtract(r_newrefdef.vieworg, e.origin, modelorg); if (rotated) { ! float[] temp = { 0, 0, 0 }; ! float[] forward = { 0, 0, 0 }; ! float[] right = { 0, 0, 0 }; ! float[] up = { 0, 0, 0 }; Math3D.VectorCopy(modelorg, temp); --- 650,657 ---- Math3D.VectorSubtract(r_newrefdef.vieworg, e.origin, modelorg); if (rotated) { ! float[] temp = Vec3Cache.get(); ! float[] forward = Vec3Cache.get(); ! float[] right = Vec3Cache.get(); ! float[] up = Vec3Cache.get(); Math3D.VectorCopy(modelorg, temp); *************** *** 690,693 **** --- 660,665 ---- modelorg[1] = -Math3D.DotProduct(temp, right); modelorg[2] = Math3D.DotProduct(temp, up); + + Vec3Cache.release(4); // temp, forward, right, up } *************** *** 703,711 **** GL_SelectTexture(GL_TEXTURE0); GL_TexEnv(GL.GL_REPLACE); ! gl.glInterleavedArrays(GL.GL_T2F_V3F, POLYGON_BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture(GL_TEXTURE1); GL_TexEnv(GL.GL_MODULATE); ! gl.glTexCoordPointer(2, GL.GL_FLOAT, POLYGON_BYTE_STRIDE, globalPolygonTexCoord1Buf); gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY); --- 675,683 ---- GL_SelectTexture(GL_TEXTURE0); GL_TexEnv(GL.GL_REPLACE); ! gl.glInterleavedArrays(GL.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture(GL_TEXTURE1); GL_TexEnv(GL.GL_MODULATE); ! gl.glTexCoordPointer(2, GL.GL_FLOAT, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY); *************** *** 846,854 **** * ============= R_DrawWorld ============= */ void R_DrawWorld() { - entity_t ent = new entity_t(); - // auto cycle the world frame for texture animation - ent.frame = (int) (r_newrefdef.time * 2); - currententity = ent; if (r_drawworld.value == 0) --- 818,824 ---- * ============= R_DrawWorld ============= */ + entity_t worldEnt = new entity_t(); + void R_DrawWorld() { if (r_drawworld.value == 0) *************** *** 861,864 **** --- 831,840 ---- Math3D.VectorCopy(r_newrefdef.vieworg, modelorg); + + entity_t ent = worldEnt; + // auto cycle the world frame for texture animation + ent.clear(); + ent.frame = (int) (r_newrefdef.time * 2); + currententity = ent; gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; *************** *** 876,883 **** GL_SelectTexture(GL_TEXTURE0); GL_TexEnv(GL.GL_REPLACE); ! gl.glInterleavedArrays(GL.GL_T2F_V3F, POLYGON_BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture(GL_TEXTURE1); ! gl.glTexCoordPointer(2, GL.GL_FLOAT, POLYGON_BYTE_STRIDE, globalPolygonTexCoord1Buf); gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY); --- 852,859 ---- GL_SelectTexture(GL_TEXTURE0); GL_TexEnv(GL.GL_REPLACE); ! gl.glInterleavedArrays(GL.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture(GL_TEXTURE1); ! gl.glTexCoordPointer(2, GL.GL_FLOAT, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY); *************** *** 1075,1098 **** float[] vec; float s, t; ! glpoly_t poly; ! float[] total = { 0, 0, 0 }; ! ! // reconstruct the polygon pedges = currentmodel.edges; lnumverts = fa.numedges; vertpage = 0; - Math3D.VectorClear(total); // // draw texture // ! // poly = Hunk_Alloc (sizeof(glpoly_t) + (lnumverts-4) * ! // VERTEXSIZE*sizeof(float)); ! poly = new glpoly_t(lnumverts); poly.next = fa.polys; poly.flags = fa.flags; fa.polys = poly; - poly.numverts = lnumverts; for (i = 0; i < lnumverts; i++) { --- 1051,1067 ---- float[] vec; float s, t; ! // reconstruct the polygon pedges = currentmodel.edges; lnumverts = fa.numedges; vertpage = 0; // // draw texture // ! glpoly_t poly = Polygon.create(lnumverts); poly.next = fa.polys; poly.flags = fa.flags; fa.polys = poly; for (i = 0; i < lnumverts; i++) { *************** *** 1114,1121 **** t /= fa.texinfo.image.height; ! Math3D.VectorAdd(total, vec, total); ! Math3D.VectorCopy(vec, poly.verts[i]); ! poly.verts[i][3] = s; ! poly.verts[i][4] = t; // --- 1083,1091 ---- t /= fa.texinfo.image.height; ! poly.x(i, vec[0]); ! poly.y(i, vec[1]); ! poly.z(i, vec[2]); ! poly.s1(i, s); ! poly.t1(i, t); // *************** *** 1136,1147 **** t /= BLOCK_HEIGHT * 16; //fa.texinfo.texture.height; ! poly.verts[i][5] = s; ! poly.verts[i][6] = t; } - - poly.numverts = lnumverts; - - precompilePolygon(poly); - } --- 1106,1112 ---- t /= BLOCK_HEIGHT * 16; //fa.texinfo.texture.height; ! poly.s2(i, s); ! poly.t2(i, t); } } *************** *** 1197,1206 **** void GL_BeginBuildingLightmaps(model_t m) { // static lightstyle_t lightstyles[MAX_LIGHTSTYLES]; ! int i; ! ! // init lightstyles if (lightstyles == null) { lightstyles = new lightstyle_t[Defines.MAX_LIGHTSTYLES]; ! for (i = 0; i < lightstyles.length; i++) { lightstyles[i] = new lightstyle_t(); } --- 1162,1169 ---- void GL_BeginBuildingLightmaps(model_t m) { // static lightstyle_t lightstyles[MAX_LIGHTSTYLES]; ! // init lightstyles if (lightstyles == null) { lightstyles = new lightstyle_t[Defines.MAX_LIGHTSTYLES]; ! for (int i = 0; i < lightstyles.length; i++) { lightstyles[i] = new lightstyle_t(); } *************** *** 1219,1223 **** * regenerated * the first time they're seen */ ! for (i = 0; i < Defines.MAX_LIGHTSTYLES; i++) { lightstyles[i].rgb[0] = 1; lightstyles[i].rgb[1] = 1; --- 1182,1186 ---- * regenerated * the first time they're seen */ ! for (int i = 0; i < Defines.MAX_LIGHTSTYLES; i++) { lightstyles[i].rgb[0] = 1; lightstyles[i].rgb[1] = 1; *************** *** 1285,1337 **** /* ! * new functions for vertex array handling */ ! static final int POLYGON_BUFFER_SIZE = 120000; ! ! static final int POLYGON_STRIDE = 7; ! ! static final int POLYGON_BYTE_STRIDE = POLYGON_STRIDE ! * BufferUtils.SIZEOF_FLOAT; ! ! static FloatBuffer globalPolygonInterleavedBuf = BufferUtils ! .newFloatBuffer(POLYGON_BUFFER_SIZE * 7); static FloatBuffer globalPolygonTexCoord1Buf = null; static { ! globalPolygonInterleavedBuf.position(POLYGON_STRIDE - 2); globalPolygonTexCoord1Buf = globalPolygonInterleavedBuf.slice(); globalPolygonInterleavedBuf.position(0); }; ! void precompilePolygon(glpoly_t p) { ! ! p.pos = globalPolygonInterleavedBuf.position() / POLYGON_STRIDE; ! ! float[] v; ! FloatBuffer buffer = globalPolygonInterleavedBuf; ! ! for (int i = 0; i < p.verts.length; i++) { ! v = p.verts[i]; ! // textureCoord0 ! buffer.put(v[3]); ! buffer.put(v[4]); ! ! // vertex ! buffer.put(v[0]); ! buffer.put(v[1]); ! buffer.put(v[2]); ! ! // textureCoord1 ! buffer.put(v[5]); ! buffer.put(v[6]); ! } ! } ! ! public static void resetPolygonArrays() { ! globalPolygonInterleavedBuf.rewind(); ! } ! ! //ImageFrame frame; // void debugLightmap(byte[] buf, int w, int h, float scale) { --- 1248,1264 ---- /* ! * new buffers for vertex array handling */ ! static FloatBuffer globalPolygonInterleavedBuf = Polygon.getInterleavedBuffer(); static FloatBuffer globalPolygonTexCoord1Buf = null; static { ! globalPolygonInterleavedBuf.position(Polygon.STRIDE - 2); globalPolygonTexCoord1Buf = globalPolygonInterleavedBuf.slice(); globalPolygonInterleavedBuf.position(0); }; ! //ImageFrame frame; // void debugLightmap(byte[] buf, int w, int h, float scale) { --- NEW FILE: Polygon.java --- /* * Polygon.java * Copyright (C) 2003 * * $Id: Polygon.java,v 1.2.2.1 2005/01/16 21:21:04 salomo 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.fastjogl; import jake2.render.glpoly_t; import jake2.util.Lib; import java.nio.FloatBuffer; /** * Polygon * * @author cwei */ public final class Polygon extends glpoly_t { private final static int MAX_POLYS = 20000; private final static int MAX_BUFFER_VERTICES = 120000; // backup for s1 scrolling private static float[] s1_old = new float[MAX_VERTICES]; private static FloatBuffer buffer = Lib.newFloatBuffer(MAX_BUFFER_VERTICES * STRIDE); private static int bufferIndex = 0; private static int polyCount = 0; private static Polygon[] polyCache = new Polygon[MAX_POLYS]; static { for (int i = 0; i < polyCache.length; i++) { polyCache[i] = new Polygon(); } } static glpoly_t create(int numverts) { Polygon poly = polyCache[polyCount++]; poly.clear(); poly.numverts = numverts; poly.pos = bufferIndex; bufferIndex += numverts; return poly; } static void reset() { polyCount = 0; bufferIndex = 0; } static FloatBuffer getInterleavedBuffer() { return (FloatBuffer)buffer.rewind(); } private Polygon() { } private final void clear() { next = null; chain = null; numverts = 0; flags = 0; } // the interleaved buffer has the format: // textureCoord0 (index 0, 1) // vertex (index 2, 3, 4) // textureCoord1 (index 5, 6) public final float x(int index) { return buffer.get((index + pos) * 7 + 2); } public final void x(int index, float value) { buffer.put((index + pos) * 7 + 2, value); } public final float y(int index) { return buffer.get((index + pos) * 7 + 3); } public final void y(int index, float value) { buffer.put((index + pos) * 7 + 3, value); } public final float z(int index) { return buffer.get((index + pos) * 7 + 4); } public final void z(int index, float value) { buffer.put((index + pos) * 7 + 4, value); } public final float s1(int index) { return buffer.get((index + pos) * 7 + 0); } public final void s1(int index, float value) { buffer.put((index + pos) * 7 + 0, value); } public final float t1(int index) { return buffer.get((index + pos) * 7 + 1); } public final void t1(int index, float value) { buffer.put((index + pos) * 7 + 1, value); } public final float s2(int index) { return buffer.get((index + pos) * 7 + 5); } public final void s2(int index, float value) { buffer.put((index + pos) * 7 + 5, value); } public final float t2(int index) { return buffer.get((index + pos) * 7 + 6); } public final void t2(int index, float value) { buffer.put((index + pos) * 7 + 6, value); } public final void beginScrolling(float scroll) { int index = pos * 7; for (int i = 0; i < numverts; i++, index+=7) { scroll += s1_old[i] = buffer.get(index); buffer.put(index, scroll); } } public final void endScrolling() { int index = pos * 7; for (int i = 0; i < numverts; i++, index+=7) { buffer.put(index, s1_old[i]); } } } Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Light.java,v retrieving revision 1.9 retrieving revision 1.9.6.1 diff -C2 -d -r1.9 -r1.9.6.1 *** Light.java 22 Sep 2004 19:22:11 -0000 1.9 --- Light.java 16 Jan 2005 21:21:04 -0000 1.9.6.1 *************** *** 32,39 **** import jake2.qcommon.Com; import jake2.qcommon.longjmpException; ! import jake2.render.mnode_t; ! import jake2.render.msurface_t; ! import jake2.render.mtexinfo_t; import jake2.util.Math3D; import java.nio.ByteBuffer; --- 32,38 ---- import jake2.qcommon.Com; import jake2.qcommon.longjmpException; ! import jake2.render.*; import jake2.util.Math3D; + import jake2.util.Vec3Cache; import java.nio.ByteBuffer; *************** *** 64,74 **** void R_RenderDlight(dlight_t light) { ! int i, j; ! float a; ! float[] v = { 0, 0, 0 }; ! float rad; ! ! rad = light.intensity * 0.35f; ! Math3D.VectorSubtract(light.origin, r_origin, v); --- 63,68 ---- void R_RenderDlight(dlight_t light) { ! float rad = light.intensity * 0.35f; ! float[] v = Vec3Cache.get(); Math3D.VectorSubtract(light.origin, r_origin, v); *************** *** 76,86 **** gl.glColor3f(light.color[0] * 0.2f, light.color[1] * 0.2f, light.color[2] * 0.2f); ! for (i = 0; i < 3; i++) v[i] = light.origin[i] - vpn[i] * rad; gl.glVertex3f(v[0], v[1], v[2]); gl.glColor3f(0, 0, 0); ! for (i = 16; i >= 0; i--) { a = (float) (i / 16.0f * Math.PI * 2); ! for (j = 0; j < 3; j++) v[j] = (float) (light.origin[j] + vright[j] * Math.cos(a) * rad + vup[j] * Math.sin(a) * rad); --- 70,82 ---- gl.glColor3f(light.color[0] * 0.2f, light.color[1] * 0.2f, light.color[2] * 0.2f); ! for (int i = 0; i < 3; i++) v[i] = light.origin[i] - vpn[i] * rad; + gl.glVertex3f(v[0], v[1], v[2]); gl.glColor3f(0, 0, 0); ! float a; ! for (int i = 16; i >= 0; i--) { a = (float) (i / 16.0f * Math.PI * 2); ! for (int j = 0; j < 3; j++) v[j] = (float) (light.origin[j] + vright[j] * Math.cos(a) * rad + vup[j] * Math.sin(a) * rad); *************** *** 88,91 **** --- 84,88 ---- } gl.glEnd(); + Vec3Cache.release(); } *************** *** 128,142 **** */ void R_MarkLights(dlight_t light, int bit, mnode_t node) { - cplane_t splitplane; - float dist; - msurface_t surf; - int i; - int sidebit; - if (node.contents != -1) return; ! splitplane = node.plane; ! dist = Math3D.DotProduct(light.origin, splitplane.normal) - splitplane.dist; --- 125,133 ---- */ void R_MarkLights(dlight_t light, int bit, mnode_t node) { if (node.contents != -1) return; ! cplane_t splitplane = node.plane; ! float dist = Math3D.DotProduct(light.origin, splitplane.normal) - splitplane.dist; *************** *** 150,155 **** } // mark the polygons ! for (i = 0; i < node.numsurfaces; i++) { surf = r_worldmodel.surfaces[node.firstsurface + i]; --- 141,148 ---- } + msurface_t surf; + int sidebit; // mark the polygons ! for (int i = 0; i < node.numsurfaces; i++) { surf = r_worldmodel.surfaces[node.firstsurface + i]; *************** *** 182,194 **** */ void R_PushDlights() { - int i; - dlight_t l; - if (gl_flashblend.value != 0) return; r_dlightframecount = r_framecount + 1; // because the count hasn't // advanced yet for this frame ! for (i = 0; i < r_newrefdef.num_dlights; i++) { l = r_newrefdef.dlights[i]; R_MarkLights(l, 1 << i, r_worldmodel.nodes[0]); --- 175,186 ---- */ void R_PushDlights() { if (gl_flashblend.value != 0) return; r_dlightframecount = r_framecount + 1; // because the count hasn't + // advanced yet for this frame ! dlight_t l; ! for (int i = 0; i < r_newrefdef.num_dlights; i++) { l = r_newrefdef.dlights[i]; R_MarkLights(l, 1 << i, r_worldmodel.nodes[0]); *************** *** 209,224 **** 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; ! int i; ! mtexinfo_t tex; ! ByteBuffer lightmap; ! int maps; ! float[] mid = { 0, 0, 0 }; // calculate mid point --- 201,213 ---- float[] lightspot = { 0, 0, 0 }; // vec3_t ! ! float scalef = 1.0f/255; ! int RecursiveLightPoint(mnode_t node, float[] start, float[] end) { if (node.contents != -1) return -1; // didn't hit anything ! // ByteBuffer lightmap; ! // int maps; // calculate mid point *************** *** 235,238 **** --- 224,228 ---- float frac = front / (front - back); + float[] mid = Vec3Cache.get(); mid[0] = start[0] + (end[0] - start[0]) * frac; mid[1] = start[1] + (end[1] - start[1]) * frac; *************** *** 241,249 **** // go down front side int r = RecursiveLightPoint(node.children[sideIndex], start, mid); ! if (r >= 0) return r; // hit something ! if ((back < 0) == side) return -1; // didn't hit anuthing // check for impact on this node --- 231,243 ---- // go down front side int r = RecursiveLightPoint(node.children[sideIndex], start, mid); ! if (r >= 0) { ! Vec3Cache.release(); return r; // hit something + } ! if ((back < 0) == side) { ! Vec3Cache.release(); return -1; // didn't hit anuthing + } // check for impact on this node *************** *** 252,257 **** int surfIndex = node.firstsurface; ! float[] scale = { 0, 0, 0 }; ! for (i = 0; i < node.numsurfaces; i++, surfIndex++) { surf = r_worldmodel.surfaces[surfIndex]; --- 246,260 ---- int surfIndex = node.firstsurface; ! ! msurface_t surf; ! mtexinfo_t tex; ! float scale0; ! float scale1; ! float scale2; ! int s, t, ds, dt; ! ByteBuffer lightmap; ! int maps; ! ! for (int i = 0; i < node.numsurfaces; i++, surfIndex++) { surf = r_worldmodel.surfaces[surfIndex]; *************** *** 284,288 **** Math3D.VectorCopy(Globals.vec3_origin, pointcolor); if (lightmap != null) { - //float[] scale = {0, 0, 0}; float[] rgb; lightmapIndex += 3 * (dt * ((surf.extents[0] >> 4) + 1) + ds); --- 287,290 ---- *************** *** 291,313 **** && 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); pointcolor[1] += (lightmap.get(lightmapIndex + 1) & 0xFF) ! * scale[1] * (1.0f / 255); pointcolor[2] += (lightmap.get(lightmapIndex + 2) & 0xFF) ! * scale[2] * (1.0f / 255); lightmapIndex += 3 * ((surf.extents[0] >> 4) + 1) * ((surf.extents[1] >> 4) + 1); } } return 1; } // go down back side ! return RecursiveLightPoint(node.children[1 - sideIndex], mid, end); } --- 293,318 ---- && surf.styles[maps] != (byte) 255; maps++) { rgb = r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb; ! scale0 = gl_modulate.value * rgb[0]; ! scale1 = gl_modulate.value * rgb[1]; ! scale2 = gl_modulate.value * rgb[2]; pointcolor[0] += (lightmap.get(lightmapIndex + 0) & 0xFF) ! * scale0 * scalef; pointcolor[1] += (lightmap.get(lightmapIndex + 1) & 0xFF) ! * scale1 * scalef; pointcolor[2] += (lightmap.get(lightmapIndex + 2) & 0xFF) ! * scale2 * scalef; lightmapIndex += 3 * ((surf.extents[0] >> 4) + 1) * ((surf.extents[1] >> 4) + 1); } } + Vec3Cache.release(); return 1; } // go down back side ! r = RecursiveLightPoint(node.children[1 - sideIndex], mid, end); ! Vec3Cache.release(); ! return r; } *************** *** 319,331 **** assert (color.length == 3) : "rgb bug"; - float[] end = { 0, 0, 0 }; - dlight_t dl; - float add; - if (r_worldmodel.lightdata == null) { color[0] = color[1] = color[2] = 1.0f; return; } ! end[0] = p[0]; end[1] = p[1]; --- 324,333 ---- assert (color.length == 3) : "rgb bug"; if (r_worldmodel.lightdata == null) { color[0] = color[1] = color[2] = 1.0f; return; } ! ! float[] end = Vec3Cache.get(); end[0] = p[0]; end[1] = p[1]; *************** *** 343,358 **** // 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) { ! Math3D.VectorMA(color, add, dl.color, color); } } Math3D.VectorScale(color, gl_modulate.value, color); } --- 345,363 ---- // add dynamic lights // + float add; + dlight_t dl; 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)); ! if (add > 0) { ! Math3D.VectorMA(color, add * scalef, dl.color, color); } } Math3D.VectorScale(color, gl_modulate.value, color); + Vec3Cache.release(); } *************** *** 368,373 **** int sd, td; float fdist, frad, fminlight; ! float[] impact = { 0, 0, 0 }; ! float[] local = { 0, 0, 0 }; int s, t; dlight_t dl; --- 373,377 ---- int sd, td; float fdist, frad, fminlight; ! float[] impact = Vec3Cache.get(); int s, t; dlight_t dl; *************** *** 379,382 **** --- 383,388 ---- mtexinfo_t tex = surf.texinfo; + float local0; + float local1; for (int lnum = 0; lnum < r_newrefdef.num_dlights; lnum++) { if ((surf.dlightbits & (1 << lnum)) == 0) *************** *** 399,405 **** } ! local[0] = Math3D.DotProduct(impact, tex.vecs[0]) + tex.vecs[0][3] - surf.texturemins[0]; ! local[1] = Math3D.DotProduct(impact, tex.vecs[1]) + tex.vecs[1][3] - surf.texturemins[1]; --- 405,411 ---- } ! local0 = Math3D.DotProduct(impact, tex.vecs[0]) + tex.vecs[0][3] - surf.texturemins[0]; ! local1 = Math3D.DotProduct(impact, tex.vecs[1]) + tex.vecs[1][3] - surf.texturemins[1]; *************** *** 407,416 **** int pfBLindex = 0; for (t = 0, ftacc = 0; t < tmax; t++, ftacc += 16) { ! td = (int) (local[1] - ftacc); if (td < 0) td = -td; for (s = 0, fsacc = 0; s < smax; s++, fsacc += 16, pfBLindex += 3) { ! sd = (int) (local[0] - fsacc); if (sd < 0) --- 413,422 ---- int pfBLindex = 0; for (t = 0, ftacc = 0; t < tmax; t++, ftacc += 16) { ! td = (int) (local1 - ftacc); if (td < 0) td = -td; for (s = 0, fsacc = 0; s < smax; s++, fsacc += 16, pfBLindex += 3) { ! sd = (int) (local0 - fsacc); if (sd < 0) *************** *** 430,433 **** --- 436,440 ---- } } + Vec3Cache.release(); } *************** *** 452,457 **** int r, g, b, a, max; int i, j; - ByteBuffer lightmap; - float[] scale = { 0, 0, 0 }; int nummaps; float[] bl; --- 459,462 ---- *************** *** 493,500 **** ; ! lightmap = surf.samples; int lightmapIndex = 0; // add all the lightmaps if (nummaps == 1) { int maps; --- 498,508 ---- ; ! ByteBuffer lightmap = surf.samples; int lightmapIndex = 0; // add all the lightmaps + float scale0; + float scale1; + float scale2; if (nummaps == 1) { int maps; *************** *** 505,514 **** int blp = 0; ! for (i = 0; i < 3; i++) ! scale[i] = gl_modulate.value ! * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[i]; ! if (scale[0] == 1.0F && scale[1] == 1.0F ! && scale[2] == 1.0F) { for (i = 0; i < size; i++) { bl[blp++] = lightmap.get(lightmapIndex++) & 0xFF; --- 513,525 ---- int blp = 0; ! // for (i = 0; i < 3; i++) ! // scale[i] = gl_modulate.value ! // * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[i]; ! scale0 = gl_modulate.value * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[0]; ! scale1 = gl_modulate.value * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[1]; ! scale2 = gl_modulate.value * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[2]; ! if (scale0 == 1.0F && scale1 == 1.0F ! && scale2 == 1.0F) { for (i = 0; i < size; i++) { bl[blp++] = lightmap.get(lightmapIndex++) & 0xFF; *************** *** 519,527 **** for (i = 0; i < size; i++) { bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[0]; bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[1]; bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[2]; } } --- 530,538 ---- for (i = 0; i < size; i++) { bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale0; bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale1; bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale2; } } *************** *** 541,550 **** int blp = 0; ! for (i = 0; i < 3; i++) ! scale[i] = gl_modulate.value ! * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[i]; ! if (scale[0] == 1.0F && scale[1] == 1.0F ! && scale[2] == 1.0F) { for (i = 0; i < size; i++) { bl[blp++] += lightmap.get(lightmapIndex++) & 0xFF; --- 552,570 ---- int blp = 0; ! // for (i = 0; i < 3; i++) ! // scale[i] = gl_modulate.value ! // * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[i]; ! scale0 = gl_modulate.value ! * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[0]; ! scale1 = gl_modulate.value ! * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[1]; ! scale2 = gl_modulate.value ! * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[2]; ! ! ! ! if (scale0 == 1.0F && scale1 == 1.0F ! && scale2 == 1.0F) { for (i = 0; i < size; i++) { bl[blp++] += lightmap.get(lightmapIndex++) & 0xFF; *************** *** 555,563 **** for (i = 0; i < size; i++) { bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[0]; bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[1]; bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[2]; } } --- 575,583 ---- for (i = 0; i < size; i++) { bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale0; bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale1; bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale2; } } *************** *** 631,636 **** } //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; ! dest.put(destp++, (a << 24) | (b << 16) | (g << 8) ! | (r << 0)); } } --- 651,655 ---- } //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; ! dest.put(destp++, (a << 24) | (b << 16) | (g << 8) | r); } } *************** *** 697,703 **** // try faking colored lighting a = 255 - ((r + g + b) / 3); ! r *= a / 255.0f; ! g *= a / 255.0f; ! b *= a / 255.0f; break; case 'A': --- 716,723 ---- // try faking colored lighting a = 255 - ((r + g + b) / 3); ! float af = a / 255.0f; ! r *= af; ! g *= af; ! b *= af; break; case 'A': *************** *** 708,713 **** } //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; ! dest.put(destp++, (a << 24) | (b << 16) | (g << 8) ! | (r << 0)); } } --- 728,732 ---- } //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; ! dest.put(destp++, (a << 24) | (b << 16) | (g << 8) | r); } } Index: Warp.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Warp.java,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** Warp.java 22 Sep 2004 19:22:11 -0000 1.4 --- Warp.java 16 Jan 2005 21:21:05 -0000 1.4.6.1 *************** *** 29,39 **** import jake2.Globals; import jake2.qcommon.Com; ! import jake2.render.glpoly_t; ! import jake2.render.image_t; ! import jake2.render.msurface_t; import jake2.util.Math3D; ! ! import java.nio.FloatBuffer; ! import net.java.games.jogl.GL; --- 29,35 ---- import jake2.Globals; import jake2.qcommon.Com; ! import jake2.render.*; import jake2.util.Math3D; ! import jake2.util.Vec3Cache; import net.java.games.jogl.GL; *************** *** 201,214 **** // init polys ! glpoly_t poly = new glpoly_t(numverts + 2); poly.next = warpface.polys; warpface.polys = poly; - poly.numverts = numverts + 2; Math3D.VectorClear(total); total_s = 0; total_t = 0; for (i = 0; i < numverts; i++) { ! Math3D.VectorCopy(verts[i], poly.verts[i + 1]); s = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[0]); t = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[1]); --- 197,211 ---- // init polys ! glpoly_t poly = Polygon.create(numverts + 2); poly.next = warpface.polys; warpface.polys = poly; Math3D.VectorClear(total); total_s = 0; total_t = 0; for (i = 0; i < numverts; i++) { ! poly.x(i + 1, verts[i][0]); ! poly.y(i + 1, verts[i][1]); ! poly.z(i + 1, verts[i][2]); s = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[0]); t = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[1]); *************** *** 218,258 **** Math3D.VectorAdd(total, verts[i], total); ! poly.verts[i + 1][3] = s; ! poly.verts[i + 1][4] = t; } ! Math3D.VectorScale(total, (1.0f / numverts), poly.verts[0]); ! poly.verts[0][3] = total_s / numverts; ! poly.verts[0][4] = total_t / numverts; ! ! // memcpy (poly.verts[i+1], poly.verts[1], sizeof(poly.verts[0])); ! System.arraycopy(poly.verts[1], 0, poly.verts[i + 1], 0, ! poly.verts[1].length); // :-) ! ! precompilePolygon(poly); } /* ! * ================ GL_SubdivideSurface * * Breaks a polygon up along axial 64 unit boundaries so that turbulent and ! * sky warps can be done reasonably. ================ */ ! void GL_SubdivideSurface(msurface_t fa) { ! float[][] verts = new float[64][3]; ! int numverts; ! int i; ! int lindex; float[] vec; - warpface = fa; - // // convert edges back to a normal polygon // ! numverts = 0; ! for (i = 0; i < fa.numedges; i++) { ! lindex = loadmodel.surfedges[fa.firstedge + i]; if (lindex > 0) --- 215,256 ---- Math3D.VectorAdd(total, verts[i], total); ! poly.s1(i + 1, s); ! poly.t1(i + 1, t); } + + float scale = 1.0f / numverts; + poly.x(0, total[0] * scale); + poly.y(0, total[1] * scale); + poly.z(0, total[2] * scale); + poly.s1(0, total_s * scale); + poly.t1(0, total_t * scale); ! poly.x(i + 1, poly.x(1)); ! poly.y(i + 1, poly.y(1)); ! poly.z(i + 1, poly.z(1)); ! poly.s1(i + 1, poly.s1(1)); ! poly.t1(i + 1, poly.t1(1)); ! poly.s2(i + 1, poly.s2(1)); ! poly.t2(i + 1, poly.t2(1)); } /* ! * GL_SubdivideSurface * * Breaks a polygon up along axial 64 unit boundaries so that turbulent and ! * sky warps can be done reasonably. */ ! float[][] tmpVerts = new float[64][3]; ! void GL_SubdivideSurface(msurface_t fa) { ! float[][] verts = tmpVerts; float[] vec; warpface = fa; // // convert edges back to a normal polygon // ! int numverts = 0; ! for (int i = 0; i < fa.numedges; i++) { ! int lindex = loadmodel.surfedges[fa.firstedge + i]; if (lindex > 0) *************** *** 263,267 **** numverts++; } - SubdividePolygon(numverts, verts); } --- 261,264 ---- *************** *** 283,288 **** void EmitWaterPolys(msurface_t fa) { glpoly_t p, bp; - float[] v; - int i; float s = 0; float t = 0; --- 280,283 ---- *************** *** 297,310 **** scroll = 0; - int index; - FloatBuffer texCoord = globalPolygonInterleavedBuf; for (bp = fa.polys; bp != null; bp = bp.next) { p = bp; ! index = p.pos * POLYGON_STRIDE; ! for (i = 0; i < p.numverts; i++) { ! v = p.verts[i]; ! os = v[3]; ! ot = v[4]; s = os --- 292,302 ---- scroll = 0; for (bp = fa.polys; bp != null; bp = bp.next) { p = bp; ! gl.glBegin(GL.GL_TRIANGLE_FAN); ! for (int i = 0; i < p.numverts; i++) { ! os = p.s1(i); ! ot = p.t1(i); s = os *************** *** 317,325 **** t *= (1.0f / 64); ! texCoord.put(index, s); ! texCoord.put(index + 1, t); ! index += POLYGON_STRIDE; } ! gl.glDrawArrays(GL.GL_TRIANGLE_FAN, p.pos, p.numverts); } } --- 309,316 ---- t *= (1.0f / 64); ! gl.glTexCoord2f(s, t); ! gl.glVertex3f(p.x(i), p.y(i), p.z(i)); } ! gl.glEnd(); } } *************** *** 358,363 **** void DrawSkyPolygon(int nump, float[][] vecs) { int i, j; - float[] v = { 0, 0, 0 }; - float[] av = { 0, 0, 0 }; float s, t, dv; int axis; --- 349,352 ---- *************** *** 366,373 **** --- 355,364 ---- c_sky++; // decide which face it maps to + float[] v = Vec3Cache.get(); Math3D.VectorCopy(Globals.vec3_origin, v); for (i = 0; i < nump; i++) { Math3D.VectorAdd(vecs[i], v, v); } + float[] av = Vec3Cache.get(); av[0] = Math.abs(v[0]); av[1] = Math.abs(v[1]); *************** *** 389,392 **** --- 380,385 ---- axis = 4; } + + Vec3Cache.release(2); // v, av // project new texture coords *************** *** 522,532 **** */ void R_AddSkySurface(msurface_t fa) { - int i; - glpoly_t p; - // calculate vertex values for sky box ! for (p = fa.polys; p != null; p = p.next) { ! for (i = 0; i < p.numverts; i++) { ! Math3D.VectorSubtract(p.verts[i], r_origin, verts[i]); } ClipSkyPolygon(p.numverts, verts, 0); --- 515,524 ---- */ void R_AddSkySurface(msurface_t fa) { // calculate vertex values for sky box ! for (glpoly_t p = fa.polys; p != null; p = p.next) { ! for (int i = 0; i < p.numverts; i++) { ! verts[i][0] = p.x(i) - r_origin[0]; ! verts[i][1] = p.y(i) - r_origin[1]; ! verts[i][2] = p.z(i) - r_origin[2]; } ClipSkyPolygon(p.numverts, verts, 0); *************** *** 538,544 **** */ void R_ClearSkyBox() { ! int i; ! ! for (i = 0; i < 6; i++) { skymins[0][i] = skymins[1][i] = 9999; skymaxs[0][i] = skymaxs[1][i] = -9999; --- 530,534 ---- */ void R_ClearSkyBox() { ! for (int i = 0; i < 6; i++) { skymins[0][i] = skymins[1][i] = 9999; skymaxs[0][i] = skymaxs[1][i] = -9999; *************** *** 547,559 **** void MakeSkyVec(float s, float t, int axis) { ! float[] v = { 0, 0, 0 }; ! float[] b = { 0, 0, 0 }; ! int j, k; ! b[0] = s * 2300; b[1] = t * 2300; b[2] = 2300; ! for (j = 0; j < 3; j++) { k = st_to_vec[axis][j]; if (k < 0) --- 537,549 ---- void MakeSkyVec(float s, float t, int axis) { ! float[] b = Vec3Cache.get(); b[0] = s * 2300; b[1] = t * 2300; b[2] = 2300; ! float[] v = Vec3Cache.get(); ! int k; ! ! for (int j = 0; j < 3; j++) { k = st_to_vec[axis][j]; if (k < 0) *************** *** 579,582 **** --- 569,574 ---- gl.glTexCoord2f(s, t); gl.glVertex3f(v[0], v[1], v[2]); + + Vec3Cache.release(2); // b, v } *************** *** 588,592 **** void R_DrawSkyBox() { int i; ! if (skyrotate != 0) { // check for no sky at all for (i = 0; i < 6; i++) --- 580,584 ---- void R_DrawSkyBox() { int i; ! if (skyrotate != 0) { // check for no sky at all for (i = 0; i < 6; i++) Index: Mesh.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Mesh.java,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** Mesh.java 22 Sep 2004 19:22:11 -0000 1.6 --- Mesh.java 16 Jan 2005 21:21:04 -0000 1.6.6.1 *************** *** 32,35 **** --- 32,36 ---- import jake2.render.image_t; import jake2.util.Math3D; + import jake2.util.Vec3Cache; import java.nio.FloatBuffer; *************** *** 138,144 **** float alpha; - float[] move = { 0, 0, 0 }; // vec3_t - float[] frontv = { 0, 0, 0 }; // vec3_t - float[] backv = { 0, 0, 0 }; // vec3_t qfiles.daliasframe_t frame = paliashdr.aliasFrames[currententity.frame]; --- 139,142 ---- *************** *** 163,166 **** --- 161,165 ---- float frontlerp = 1.0f - backlerp; + float[] frontv = Vec3Cache.get(); // vec3_t // move should be the delta back to the previous frame * backlerp Math3D.VectorSubtract(currententity.oldorigin, currententity.origin, *************** *** 169,172 **** --- 168,172 ---- vectors[2]); + float[] move = Vec3Cache.get(); // vec3_t move[0] = Math3D.DotProduct(frontv, vectors[0]); // forward move[1] = -Math3D.DotProduct(frontv, vectors[1]); // left *************** *** 175,178 **** --- 175,179 ---- Math3D.VectorAdd(move, oldframe.translate, move); + float[] backv = Vec3Cache.get(); // vec3_t for (int i = 0; i < 3; i++) { move[i] = backlerp * move[i] + frontlerp * frame.translate[i]; *************** *** 184,187 **** --- 185,190 ---- GL_LerpVerts(paliashdr.num_xyz, ov, verts, move, frontv, backv); + + Vec3Cache.release(3); // frontv, move, backv //gl.glEnableClientState( GL.GL_VERTEX_ARRAY ); *************** *** 273,277 **** qfiles.dtrivertx_t[] verts; int[] order; - float[] point = { 0, 0, 0 }; float height, lheight; int count; --- 276,279 ---- *************** *** 295,298 **** --- 297,301 ---- // TODO shadow drawing with vertex arrays + float[] point = Vec3Cache.get(); while (true) { // get the vertex count and primitive type *************** *** 323,326 **** --- 326,330 ---- gl.glEnd(); } + Vec3Cache.release(); // point } *************** *** 330,336 **** // TODO sync with jogl renderer. hoz boolean R_CullAliasModel(entity_t e) { - float[] mins = { 0, 0, 0 }; - float[] maxs = { 0, 0, 0 }; - qfiles.dmdl_t paliashdr = (qfiles.dmdl_t) currentmodel.extradata; --- 334,337 ---- *************** *** 353,356 **** --- 354,360 ---- * * compute axially aligned mins and maxs */ + float[] mins = Vec3Cache.get(); + float[] maxs = Vec3Cache.get(); + if (pframe == poldframe) { for (int i = 0; i < 3; i++) { *************** *** 416,419 **** --- 420,425 ---- Math3D.VectorAdd(e.origin, bbox[i], bbox[i]); } + + Vec3Cache.release(2); // mins, maxs int f, mask; |
From: Rene S. <sa...@us...> - 2005-01-16 21:22:01
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/client Modified Files: Tag: RST Menu.java entity_t.java SCR.java VID.java CL_fx.java Log Message: This has vec3-optimize and the OAK bot. Index: Menu.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Menu.java,v retrieving revision 1.12.6.1 retrieving revision 1.12.6.2 diff -C2 -d -r1.12.6.1 -r1.12.6.2 *** Menu.java 31 Dec 2004 14:08:34 -0000 1.12.6.1 --- Menu.java 16 Jan 2005 21:20:56 -0000 1.12.6.2 *************** *** 1313,1320 **** //s_options_quality_list.curvalue = 1 - ((int) // Cvar.VariableValue("s_loadas8bit")); ! if ("joal".equals(Cvar.VariableString("s_impl"))) { ! s_options_quality_list.curvalue = 0; ! } else { ! s_options_quality_list.curvalue = 1; } --- 1313,1321 ---- //s_options_quality_list.curvalue = 1 - ((int) // Cvar.VariableValue("s_loadas8bit")); ! String s = Cvar.VariableString("s_impl"); ! for (int i = 0; i < s_drivers.length; i++) { ! if (s.equals(s_drivers[i])) { ! s_options_quality_list.curvalue = i; ! } } *************** *** 1391,1405 **** static void UpdateSoundQualityFunc(Object unused) { boolean driverNotChanged = false; ! if (s_options_quality_list.curvalue != 0) { ! // Cvar.SetValue("s_khz", 22); ! // Cvar.SetValue("s_loadas8bit", 0); ! driverNotChanged = S.getDriverName().equals("dummy"); ! Cvar.Set("s_impl", "dummy"); ! } else { ! // Cvar.SetValue("s_khz", 11); ! // Cvar.SetValue("s_loadas8bit", 1); ! driverNotChanged = S.getDriverName().equals("joal"); ! Cvar.Set("s_impl", "joal"); ! } //Cvar.SetValue("s_primary", s_options_compatibility_list.curvalue); --- 1392,1408 ---- static void UpdateSoundQualityFunc(Object unused) { boolean driverNotChanged = false; ! String current = s_drivers[s_options_quality_list.curvalue]; ! driverNotChanged = S.getDriverName().equals(current); ! // if (s_options_quality_list.curvalue != 0) { ! // // Cvar.SetValue("s_khz", 22); ! // // Cvar.SetValue("s_loadas8bit", 0); ! // driverNotChanged = S.getDriverName().equals("dummy"); ! // Cvar.Set("s_impl", "dummy"); ! // } else { ! // // Cvar.SetValue("s_khz", 11); ! // // Cvar.SetValue("s_loadas8bit", 1); ! // driverNotChanged = S.getDriverName().equals("joal"); ! // Cvar.Set("s_impl", "joal"); ! // } //Cvar.SetValue("s_primary", s_options_compatibility_list.curvalue); *************** *** 1409,1413 **** return; } else { ! DrawTextBox(8, 120 - 48, 36, 3); Print(16 + 16, 120 - 48 + 8, "Restarting the sound system. This"); --- 1412,1417 ---- return; } else { ! Cvar.Set("s_impl", current); ! DrawTextBox(8, 120 - 48, 36, 3); Print(16 + 16, 120 - 48 + 8, "Restarting the sound system. This"); *************** *** 1422,1438 **** } ! static String cd_music_items[] = { "disabled", "enabled", null }; ! ! static String soundstate_items[] = { "on", "off", null }; static String compatibility_items[] = { "max compatibility", ! "max performance", null }; ! static String yesno_names[] = { "no", "yes", null }; ! static String crosshair_names[] = { "none", "cross", "dot", "angle", null }; static void Options_MenuInit() { win_noalttab = Cvar.Get("win_noalttab", "0", CVAR_ARCHIVE); --- 1426,1453 ---- } ! static String cd_music_items[] = { "disabled", "enabled" }; static String compatibility_items[] = { "max compatibility", ! "max performance" }; ! static String yesno_names[] = { "no", "yes" }; ! static String crosshair_names[] = { "none", "cross", "dot", "angle" }; + static String[] s_labels; + static String[] s_drivers; + static void Options_MenuInit() { + s_drivers = S.getDriverNames(); + s_labels = new String[s_drivers.length]; + for (int i = 0; i < s_drivers.length; i++) { + if ("dummy".equals(s_drivers[i])) { + s_labels[i] = "off"; + } else { + s_labels[i] = s_drivers[i]; + } + } + win_noalttab = Cvar.Get("win_noalttab", "0", CVAR_ARCHIVE); *************** *** 1480,1499 **** } }; ! s_options_quality_list.itemnames = soundstate_items; ! //s_options_quality_list.curvalue = 1 - (int) ! // Cvar.VariableValue("s_loadas8bit"); ! ! // s_options_compatibility_list.type = MTYPE_SPINCONTROL; ! // s_options_compatibility_list.x = 0; ! // s_options_compatibility_list.y = 30; ! // s_options_compatibility_list.name = "sound compatibility"; ! // s_options_compatibility_list.callback = new mcallback() { ! // public void execute(Object o) { ! // UpdateSoundQualityFunc(o); ! // } ! // }; ! // s_options_compatibility_list.itemnames = compatibility_items; ! // s_options_compatibility_list.curvalue = (int) ! // Cvar.VariableValue("s_primary"); s_options_sensitivity_slider.type = MTYPE_SLIDER; --- 1495,1499 ---- } }; ! s_options_quality_list.itemnames = s_labels; s_options_sensitivity_slider.type = MTYPE_SLIDER; *************** *** 2013,2017 **** static String difficulty_names[] = { "easy", "medium", ! "fuckin shitty hard", null }; static void Game_MenuInit() { --- 2013,2017 ---- static String difficulty_names[] = { "easy", "medium", ! "fuckin shitty hard" }; static void Game_MenuInit() { *************** *** 2688,2696 **** } ! static String dm_coop_names[] = { "deathmatch", "cooperative", null }; ! static String dm_coop_names_rogue[] = { "deathmatch", "cooperative", "tag", ! // "deathball", ! null }; static void StartServer_MenuInit() { --- 2688,2694 ---- } ! static String dm_coop_names[] = { "deathmatch", "cooperative" }; ! static String dm_coop_names_rogue[] = { "deathmatch", "cooperative", "tag" }; static void StartServer_MenuInit() { *************** *** 2735,2739 **** Com.Error(ERR_DROP, "no maps in maps.lst\n"); ! mapnames = new String[nummaps + 1]; for (i = 0; i < nummaps; i++) { --- 2733,2737 ---- Com.Error(ERR_DROP, "no maps in maps.lst\n"); ! mapnames = new String[nummaps]; for (i = 0; i < nummaps; i++) { *************** *** 2747,2751 **** mapnames[i] = scratch; } - mapnames[nummaps] = null; if (fp != null) { --- 2745,2748 ---- *************** *** 3086,3090 **** //static String yes_no_names[] = { "no", "yes", 0 }; ! static String teamplay_names[] = { "disabled", "by skin", "by model", null }; static void DMOptions_MenuInit() { --- 3083,3087 ---- //static String yes_no_names[] = { "no", "yes", 0 }; ! static String teamplay_names[] = { "disabled", "by skin", "by model" }; static void DMOptions_MenuInit() { *************** *** 3441,3445 **** } ! static String yes_no_names[] = { "no", "yes", null }; static void DownloadOptions_MenuInit() { --- 3438,3442 ---- } ! static String yes_no_names[] = { "no", "yes" }; static void DownloadOptions_MenuInit() { *************** *** 3711,3715 **** static String rate_names[] = { "28.8 Modem", "33.6 Modem", "Single ISDN", ! "Dual ISDN/Cable", "T1/LAN", "User defined", null }; static void DownloadOptionsFunc(Object self) { --- 3708,3712 ---- static String rate_names[] = { "28.8 Modem", "33.6 Modem", "Single ISDN", ! "Dual ISDN/Cable", "T1/LAN", "User defined" }; static void DownloadOptionsFunc(Object self) { *************** *** 3917,3921 **** } ! static String handedness[] = { "right", "left", "center", null }; static boolean PlayerConfig_MenuInit() { --- 3914,3918 ---- } ! static String handedness[] = { "right", "left", "center" }; static boolean PlayerConfig_MenuInit() { *************** *** 4891,4895 **** if (s.curvalue < 0) s.curvalue = 0; ! else if (s.itemnames[s.curvalue] == null) s.curvalue--; --- 4888,4892 ---- if (s.curvalue < 0) s.curvalue = 0; ! else if (s.curvalue >= s.itemnames.length || s.itemnames[s.curvalue] == null) s.curvalue--; Index: VID.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/VID.java,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** VID.java 14 Dec 2004 12:54:25 -0000 1.11 --- VID.java 16 Jan 2005 21:20:58 -0000 1.11.2.1 *************** *** 256,262 **** Globals.cls.disable_screen = 1.0f; // true; if ( !LoadRefresh( vid_ref.string ) ) { ! if ( vid_ref.string.equals("jogl") ) { Com.Printf("Refresh failed\n"); gl_mode = Cvar.Get( "gl_mode", "0", 0 ); --- 256,264 ---- Globals.cls.disable_screen = 1.0f; // true; + String defaultName = Renderer.getDefaultName(); + if ( !LoadRefresh( vid_ref.string ) ) { ! if ( vid_ref.string.equals(defaultName) ) { Com.Printf("Refresh failed\n"); gl_mode = Cvar.Get( "gl_mode", "0", 0 ); *************** *** 265,274 **** Cvar.SetValue("gl_mode", 0); if ( !LoadRefresh( vid_ref.string ) ) ! Com.Error(Defines.ERR_FATAL, "Couldn't fall back to jogl refresh!"); } else ! Com.Error(Defines.ERR_FATAL, "Couldn't fall back to jogl refresh!"); } ! Cvar.Set( "vid_ref", "jogl" ); /* --- 267,276 ---- Cvar.SetValue("gl_mode", 0); if ( !LoadRefresh( vid_ref.string ) ) ! Com.Error(Defines.ERR_FATAL, "Couldn't fall back to " + defaultName +" refresh!"); } else ! Com.Error(Defines.ERR_FATAL, "Couldn't fall back to " + defaultName +" refresh!"); } ! Cvar.Set("vid_ref", defaultName); /* *************** *** 295,299 **** { /* Create the video variables so we know how to start the graphics drivers */ ! vid_ref = Cvar.Get("vid_ref", "fastjogl", CVAR_ARCHIVE); vid_xpos = Cvar.Get("vid_xpos", "3", CVAR_ARCHIVE); vid_ypos = Cvar.Get("vid_ypos", "22", CVAR_ARCHIVE); --- 297,301 ---- { /* Create the video variables so we know how to start the graphics drivers */ ! vid_ref = Cvar.Get("vid_ref", Renderer.getPreferedName(), CVAR_ARCHIVE); vid_xpos = Cvar.Get("vid_xpos", "3", CVAR_ARCHIVE); vid_ypos = Cvar.Get("vid_ypos", "22", CVAR_ARCHIVE); *************** *** 364,430 **** ==================================================================== */ - static final int SOFTWARE_MENU = 0; - static final int OPENGL_MENU = 1; - static Menu.menuframework_s s_software_menu = new Menu.menuframework_s(); static Menu.menuframework_s s_opengl_menu = new Menu.menuframework_s(); static Menu.menuframework_s s_current_menu; // referenz - static int s_current_menu_index = 1; // default is the openGL menu ! static Menu.menulist_s[] s_mode_list = new Menu.menulist_s[2]; ! static { ! s_mode_list[0] = new Menu.menulist_s(); ! s_mode_list[1] = new Menu.menulist_s(); ! } ! static Menu.menulist_s[] s_ref_list = new Menu.menulist_s[2]; ! static { ! s_ref_list[0] = new Menu.menulist_s(); ! s_ref_list[1] = new Menu.menulist_s(); ! } static Menu.menuslider_s s_tq_slider = new Menu.menuslider_s(); ! static Menu.menuslider_s[] s_screensize_slider = new Menu.menuslider_s[2]; ! static { ! s_screensize_slider[0] = new Menu.menuslider_s(); ! s_screensize_slider[1] = new Menu.menuslider_s(); ! } ! static Menu.menuslider_s[] s_brightness_slider = new Menu.menuslider_s[2]; ! static { ! s_brightness_slider[0] = new Menu.menuslider_s(); ! s_brightness_slider[1] = new Menu.menuslider_s(); ! } ! static Menu.menulist_s[] s_fs_box = new Menu.menulist_s[2]; ! static { ! s_fs_box[0] = new Menu.menulist_s(); ! s_fs_box[1] = new Menu.menulist_s(); ! } static Menu.menulist_s s_stipple_box = new Menu.menulist_s(); static Menu.menulist_s s_paletted_texture_box = new Menu.menulist_s(); static Menu.menulist_s s_windowed_mouse = new Menu.menulist_s(); ! static Menu.menuaction_s[] s_apply_action = new Menu.menuaction_s[2]; ! static { ! s_apply_action[0] = new Menu.menuaction_s(); ! s_apply_action[1] = new Menu.menuaction_s(); ! } ! static Menu.menuaction_s[] s_defaults_action= new Menu.menuaction_s[2]; ! static { ! s_defaults_action[0] = new Menu.menuaction_s(); ! s_defaults_action[1] = new Menu.menuaction_s(); ! } static void DriverCallback( Object unused ) { ! s_ref_list[1 - s_current_menu_index].curvalue = s_ref_list[s_current_menu_index].curvalue; ! ! if ( s_ref_list[s_current_menu_index].curvalue < 2 ) ! { ! // we only use opengl today ! s_current_menu = s_opengl_menu; // s_software_menu; ! s_current_menu_index = 1; // 0; ! } ! else ! { ! s_current_menu = s_opengl_menu; ! s_current_menu_index = 1; ! } } --- 366,394 ---- ==================================================================== */ static Menu.menuframework_s s_opengl_menu = new Menu.menuframework_s(); static Menu.menuframework_s s_current_menu; // referenz ! static Menu.menulist_s s_mode_list = new Menu.menulist_s(); ! ! static Menu.menulist_s s_ref_list = new Menu.menulist_s(); ! static Menu.menuslider_s s_tq_slider = new Menu.menuslider_s(); ! static Menu.menuslider_s s_screensize_slider = new Menu.menuslider_s(); ! ! static Menu.menuslider_s s_brightness_slider = new Menu.menuslider_s(); ! ! static Menu.menulist_s s_fs_box = new Menu.menulist_s(); ! static Menu.menulist_s s_stipple_box = new Menu.menulist_s(); static Menu.menulist_s s_paletted_texture_box = new Menu.menulist_s(); static Menu.menulist_s s_windowed_mouse = new Menu.menulist_s(); ! static Menu.menuaction_s s_apply_action = new Menu.menuaction_s(); ! ! static Menu.menuaction_s s_defaults_action= new Menu.menuaction_s(); static void DriverCallback( Object unused ) { ! s_current_menu = s_opengl_menu; // s_software_menu; } *************** *** 440,448 **** Menu.menuslider_s slider = (Menu.menuslider_s) s; - if ( s_current_menu_index == 0) - s_brightness_slider[1].curvalue = s_brightness_slider[0].curvalue; - else - s_brightness_slider[0].curvalue = s_brightness_slider[1].curvalue; - // if ( stricmp( vid_ref.string, "soft" ) == 0 || // stricmp( vid_ref.string, "softx" ) == 0 ) --- 404,407 ---- *************** *** 463,543 **** static void ApplyChanges( Object unused ) { - /* - ** make values consistent - */ - s_fs_box[1 - s_current_menu_index].curvalue = s_fs_box[s_current_menu_index].curvalue; - s_brightness_slider[1 - s_current_menu_index].curvalue = s_brightness_slider[s_current_menu_index].curvalue; - s_ref_list[1 - s_current_menu_index].curvalue = s_ref_list[s_current_menu_index].curvalue; /* ** invert sense so greater = brighter, and scale to a range of 0.5 to 1.3 */ ! float gamma = ( 0.8f - ( s_brightness_slider[s_current_menu_index].curvalue/10.0f - 0.5f ) ) + 0.5f; Cvar.SetValue( "vid_gamma", gamma ); Cvar.SetValue( "sw_stipplealpha", s_stipple_box.curvalue ); Cvar.SetValue( "gl_picmip", 3 - s_tq_slider.curvalue ); ! Cvar.SetValue( "vid_fullscreen", s_fs_box[s_current_menu_index].curvalue ); Cvar.SetValue( "gl_ext_palettedtexture", s_paletted_texture_box.curvalue ); ! Cvar.SetValue( "sw_mode", s_mode_list[SOFTWARE_MENU].curvalue ); ! Cvar.SetValue( "gl_mode", s_mode_list[OPENGL_MENU].curvalue ); Cvar.SetValue( "_windowed_mouse", s_windowed_mouse.curvalue); ! switch ( s_ref_list[s_current_menu_index].curvalue ) ! { ! // case REF_SOFT: ! // Cvar_Set( "vid_ref", "soft" ); ! // break; ! // case REF_SOFTX11: ! // Cvar_Set( "vid_ref", "softx" ); ! // break; ! // ! // case REF_MESA3D : ! // Cvar_Set( "vid_ref", "gl" ); ! // Cvar_Set( "gl_driver", "libMesaGL.so.2" ); ! // if (gl_driver->modified) ! // vid_ref->modified = true; ! // break; ! // ! // case REF_OPENGLX : ! // Cvar_Set( "vid_ref", "glx" ); ! // Cvar_Set( "gl_driver", "libGL.so" ); ! // if (gl_driver->modified) ! // vid_ref->modified = true; ! // break; ! // ! // case REF_MESA3DGLX : ! // Cvar_Set( "vid_ref", "glx" ); ! // Cvar_Set( "gl_driver", "libMesaGL.so.2" ); ! // if (gl_driver->modified) ! // vid_ref->modified = true; ! // break; ! // ! // case REF_3DFXGL : ! // Cvar_Set( "vid_ref", "gl" ); ! // Cvar_Set( "gl_driver", "lib3dfxgl.so" ); ! // if (gl_driver->modified) ! // vid_ref->modified = true; ! // break; ! case REF_OPENGL_JOGL : ! Cvar.Set( "vid_ref", "jogl" ); ! Cvar.Set( "gl_driver", "jogl" ); ! if (gl_driver.modified) ! vid_ref.modified = true; ! break; ! case REF_OPENGL_FASTJOGL : ! Cvar.Set( "vid_ref", "fastjogl" ); ! Cvar.Set( "gl_driver", "fastjogl" ); ! if (gl_driver.modified) ! vid_ref.modified = true; ! break; ! case REF_OPENGL_LWJGL : ! Cvar.Set( "vid_ref", "lwjgl" ); ! Cvar.Set( "gl_driver", "lwjgl" ); ! if (gl_driver.modified) ! vid_ref.modified = true; ! break; ! } ! Menu.ForceMenuOff(); } --- 422,444 ---- static void ApplyChanges( Object unused ) { /* ** invert sense so greater = brighter, and scale to a range of 0.5 to 1.3 */ ! float gamma = ( 0.8f - ( s_brightness_slider.curvalue/10.0f - 0.5f ) ) + 0.5f; Cvar.SetValue( "vid_gamma", gamma ); Cvar.SetValue( "sw_stipplealpha", s_stipple_box.curvalue ); Cvar.SetValue( "gl_picmip", 3 - s_tq_slider.curvalue ); ! Cvar.SetValue( "vid_fullscreen", s_fs_box.curvalue ); Cvar.SetValue( "gl_ext_palettedtexture", s_paletted_texture_box.curvalue ); ! Cvar.SetValue( "gl_mode", s_mode_list.curvalue ); Cvar.SetValue( "_windowed_mouse", s_windowed_mouse.curvalue); ! Cvar.Set( "vid_ref", drivers[s_ref_list.curvalue] ); ! Cvar.Set( "gl_driver", drivers[s_ref_list.curvalue] ); ! if (gl_driver.modified) ! vid_ref.modified = true; ! Menu.ForceMenuOff(); } *************** *** 557,588 **** "[2048 1536]", "user mode", - null }; static String[] fs_resolutions; static int mode_x; ! static final String[] refs = ! { ! // "[software ]", ! // "[software X11 ]", ! // "[Mesa 3-D 3DFX ]", ! // "[3DFXGL Miniport]", ! // "[OpenGL glX ]", ! // "[Mesa 3-D glX ]", ! "[OpenGL jogl ]", ! "[OpenGL fastjogl]", ! "[OpenGL lwjgl ]", ! null ! }; static final String[] yesno_names = { "no", "yes", - null }; 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++) { --- 458,477 ---- "[2048 1536]", "user mode", }; static String[] fs_resolutions; static int mode_x; ! static String[] refs; ! static String[] drivers; ! static final String[] yesno_names = { "no", "yes", }; static void initModeList() { DisplayMode[] modes = re.getModeList(); ! fs_resolutions = new String[modes.length]; fs_modes = new vidmode_t[modes.length]; for (int i = 0; i < modes.length; i++) { *************** *** 607,610 **** --- 496,512 ---- } + private static void initRefs() { + drivers = Renderer.getDriverNames(); + refs = new String[drivers.length]; + StringBuffer sb = new StringBuffer(); + for (int i = 0; i < drivers.length; i++) { + sb.setLength(0); + sb.append("[OpenGL ").append(drivers[i]); + while (sb.length() < 16) sb.append(" "); + sb.append("]"); + refs[i] = sb.toString(); + } + } + /* ** VID_MenuInit *************** *** 612,617 **** public static void MenuInit() { if ( gl_driver == null ) ! gl_driver = Cvar.Get( "gl_driver", "jogl", 0 ); if ( gl_picmip == null ) gl_picmip = Cvar.Get( "gl_picmip", "0", 0 ); --- 514,521 ---- public static void MenuInit() { + initRefs(); + if ( gl_driver == null ) ! gl_driver = Cvar.Get( "gl_driver", Renderer.getPreferedName(), 0 ); if ( gl_picmip == null ) gl_picmip = Cvar.Get( "gl_picmip", "0", 0 ); *************** *** 629,646 **** _windowed_mouse = Cvar.Get( "_windowed_mouse", "0", CVAR_ARCHIVE ); ! 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; } --- 533,549 ---- _windowed_mouse = Cvar.Get( "_windowed_mouse", "0", CVAR_ARCHIVE ); ! s_mode_list.curvalue = (int)gl_mode.value; if (vid_fullscreen.value != 0.0f) { ! s_mode_list.itemnames = fs_resolutions; ! if (s_mode_list.curvalue >= fs_resolutions.length - 1) { ! s_mode_list.curvalue = 0; } ! mode_x = fs_modes[s_mode_list.curvalue].width; } else { ! s_mode_list.itemnames = resolutions; ! if (s_mode_list.curvalue >= resolutions.length - 1) { ! s_mode_list.curvalue = 0; } ! mode_x = vid_modes[s_mode_list.curvalue].width; } *************** *** 648,786 **** SCR.scr_viewsize = Cvar.Get ("viewsize", "100", CVAR_ARCHIVE); ! s_screensize_slider[SOFTWARE_MENU].curvalue = (int)(SCR.scr_viewsize.value/10); ! s_screensize_slider[OPENGL_MENU].curvalue = (int)(SCR.scr_viewsize.value/10); ! // if ( strcmp( vid_ref->string, "soft" ) == 0) ! // { ! // s_current_menu_index = SOFTWARE_MENU; ! // s_ref_list[0].curvalue = s_ref_list[1].curvalue = REF_SOFT; ! // } ! if ( vid_ref.string.equalsIgnoreCase("jogl")) ! { ! s_current_menu_index = OPENGL_MENU; ! s_ref_list[0].curvalue = s_ref_list[1].curvalue = REF_OPENGL_JOGL; ! } ! else if ( vid_ref.string.equalsIgnoreCase("fastjogl")) ! { ! s_current_menu_index = OPENGL_MENU; ! s_ref_list[0].curvalue = s_ref_list[1].curvalue = REF_OPENGL_FASTJOGL; ! } ! else if ( vid_ref.string.equalsIgnoreCase("lwjgl")) ! { ! s_current_menu_index = OPENGL_MENU; ! s_ref_list[0].curvalue = s_ref_list[1].curvalue = REF_OPENGL_LWJGL; } ! // else if (strcmp( vid_ref->string, "softx" ) == 0 ) ! // { ! // s_current_menu_index = SOFTWARE_MENU; ! // s_ref_list[0].curvalue = s_ref_list[1].curvalue = REF_SOFTX11; ! // } ! // else if ( strcmp( vid_ref->string, "gl" ) == 0 ) ! // { ! // s_current_menu_index = OPENGL_MENU; ! // if ( strcmp( gl_driver->string, "lib3dfxgl.so" ) == 0 ) ! // s_ref_list[s_current_menu_index].curvalue = REF_3DFXGL; ! // else ! // s_ref_list[s_current_menu_index].curvalue = REF_MESA3D; ! // } ! // else if ( strcmp( vid_ref->string, "glx" ) == 0 ) ! // { ! // s_current_menu_index = OPENGL_MENU; ! // if ( strcmp( gl_driver->string, "libMesaGL.so.2" ) == 0 ) ! // s_ref_list[s_current_menu_index].curvalue = REF_MESA3DGLX; ! // else ! // s_ref_list[s_current_menu_index].curvalue = REF_OPENGLX; ! // } ! // ! s_software_menu.x = (int)(viddef.width * 0.50f); ! s_software_menu.nitems = 0; s_opengl_menu.x = (int)(viddef.width * 0.50f); s_opengl_menu.nitems = 0; ! for (int i = 0; i < 2; i++ ) ! { ! s_ref_list[i].type = MTYPE_SPINCONTROL; ! s_ref_list[i].name = "driver"; ! s_ref_list[i].x = 0; ! s_ref_list[i].y = 0; ! s_ref_list[i].callback = new Menu.mcallback() { ! public void execute(Object self) { ! DriverCallback(self); ! } ! }; ! s_ref_list[i].itemnames = refs; ! ! s_mode_list[i].type = MTYPE_SPINCONTROL; ! s_mode_list[i].name = "video mode"; ! s_mode_list[i].x = 0; ! s_mode_list[i].y = 10; ! s_screensize_slider[i].type = MTYPE_SLIDER; ! s_screensize_slider[i].x = 0; ! s_screensize_slider[i].y = 20; ! s_screensize_slider[i].name = "screen size"; ! s_screensize_slider[i].minvalue = 3; ! s_screensize_slider[i].maxvalue = 12; ! s_screensize_slider[i].callback = new Menu.mcallback() { ! public void execute(Object self) { ! ScreenSizeCallback(self); ! } ! }; ! s_brightness_slider[i].type = MTYPE_SLIDER; ! s_brightness_slider[i].x = 0; ! s_brightness_slider[i].y = 30; ! s_brightness_slider[i].name = "brightness"; ! s_brightness_slider[i].callback = new Menu.mcallback() { ! public void execute(Object self) { ! BrightnessCallback(self); ! } ! }; ! s_brightness_slider[i].minvalue = 5; ! s_brightness_slider[i].maxvalue = 13; ! s_brightness_slider[i].curvalue = ( 1.3f - vid_gamma.value + 0.5f ) * 10; ! s_fs_box[i].type = MTYPE_SPINCONTROL; ! s_fs_box[i].x = 0; ! s_fs_box[i].y = 40; ! s_fs_box[i].name = "fullscreen"; ! 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; ! s_defaults_action[i].name = "reset to default"; ! s_defaults_action[i].x = 0; ! s_defaults_action[i].y = 90; ! s_defaults_action[i].callback = new Menu.mcallback() { ! public void execute(Object self) { ! ResetDefaults(self); ! } ! }; ! s_apply_action[i].type = MTYPE_ACTION; ! s_apply_action[i].name = "apply"; ! s_apply_action[i].x = 0; ! s_apply_action[i].y = 100; ! s_apply_action[i].callback = new Menu.mcallback() { ! public void execute(Object self) { ! ApplyChanges(self); ! } ! }; ! } s_stipple_box.type = MTYPE_SPINCONTROL; --- 551,648 ---- SCR.scr_viewsize = Cvar.Get ("viewsize", "100", CVAR_ARCHIVE); ! s_screensize_slider.curvalue = (int)(SCR.scr_viewsize.value/10); ! for (int i = 0; i < drivers.length; i++) { ! if (vid_ref.string.equals(drivers[i])) { ! s_ref_list.curvalue = i; ! } } ! s_opengl_menu.x = (int)(viddef.width * 0.50f); s_opengl_menu.nitems = 0; + + s_ref_list.type = MTYPE_SPINCONTROL; + s_ref_list.name = "driver"; + s_ref_list.x = 0; + s_ref_list.y = 0; + s_ref_list.callback = new Menu.mcallback() { + public void execute(Object self) { + DriverCallback(self); + } + }; + s_ref_list.itemnames = refs; ! s_mode_list.type = MTYPE_SPINCONTROL; ! s_mode_list.name = "video mode"; ! s_mode_list.x = 0; ! s_mode_list.y = 10; ! s_screensize_slider.type = MTYPE_SLIDER; ! s_screensize_slider.x = 0; ! s_screensize_slider.y = 20; ! s_screensize_slider.name = "screen size"; ! s_screensize_slider.minvalue = 3; ! s_screensize_slider.maxvalue = 12; ! s_screensize_slider.callback = new Menu.mcallback() { ! public void execute(Object self) { ! ScreenSizeCallback(self); ! } ! }; ! s_brightness_slider.type = MTYPE_SLIDER; ! s_brightness_slider.x = 0; ! s_brightness_slider.y = 30; ! s_brightness_slider.name = "brightness"; ! s_brightness_slider.callback = new Menu.mcallback() { ! public void execute(Object self) { ! BrightnessCallback(self); ! } ! }; ! s_brightness_slider.minvalue = 5; ! s_brightness_slider.maxvalue = 13; ! s_brightness_slider.curvalue = ( 1.3f - vid_gamma.value + 0.5f ) * 10; ! s_fs_box.type = MTYPE_SPINCONTROL; ! s_fs_box.x = 0; ! s_fs_box.y = 40; ! s_fs_box.name = "fullscreen"; ! s_fs_box.itemnames = yesno_names; ! s_fs_box.curvalue = (int)vid_fullscreen.value; ! s_fs_box.callback = new Menu.mcallback() { ! public void execute(Object o) { ! int fs = ((Menu.menulist_s)o).curvalue; ! if (fs == 0) { ! s_mode_list.itemnames = resolutions; ! int i = vid_modes.length - 2; ! while (i > 0 && vid_modes[i].width > mode_x) i--; ! s_mode_list.curvalue = i; ! } else { ! s_mode_list.itemnames = fs_resolutions; ! int i = fs_modes.length - 1; ! while (i > 0 && fs_modes[i].width > mode_x) i--; ! s_mode_list.curvalue = i; } ! } ! }; ! s_defaults_action.type = MTYPE_ACTION; ! s_defaults_action.name = "reset to default"; ! s_defaults_action.x = 0; ! s_defaults_action.y = 90; ! s_defaults_action.callback = new Menu.mcallback() { ! public void execute(Object self) { ! ResetDefaults(self); ! } ! }; ! s_apply_action.type = MTYPE_ACTION; ! s_apply_action.name = "apply"; ! s_apply_action.x = 0; ! s_apply_action.y = 100; ! s_apply_action.callback = new Menu.mcallback() { ! public void execute(Object self) { ! ApplyChanges(self); ! } ! }; ! s_stipple_box.type = MTYPE_SPINCONTROL; *************** *** 813,841 **** s_paletted_texture_box.curvalue = (int)gl_ext_palettedtexture.value; ! Menu.Menu_AddItem( s_software_menu, s_ref_list[SOFTWARE_MENU] ); ! Menu.Menu_AddItem( s_software_menu, s_mode_list[SOFTWARE_MENU] ); ! Menu.Menu_AddItem( s_software_menu, s_screensize_slider[SOFTWARE_MENU] ); ! Menu.Menu_AddItem( s_software_menu, s_brightness_slider[SOFTWARE_MENU] ); ! Menu.Menu_AddItem( s_software_menu, s_fs_box[SOFTWARE_MENU] ); ! Menu.Menu_AddItem( s_software_menu, s_stipple_box ); ! Menu.Menu_AddItem( s_software_menu, s_windowed_mouse ); ! ! Menu.Menu_AddItem( s_opengl_menu, s_ref_list[OPENGL_MENU] ); ! Menu.Menu_AddItem( s_opengl_menu, s_mode_list[OPENGL_MENU] ); ! Menu.Menu_AddItem( s_opengl_menu, s_screensize_slider[OPENGL_MENU] ); ! Menu.Menu_AddItem( s_opengl_menu, s_brightness_slider[OPENGL_MENU] ); ! Menu.Menu_AddItem( s_opengl_menu, s_fs_box[OPENGL_MENU] ); Menu.Menu_AddItem( s_opengl_menu, s_tq_slider ); Menu.Menu_AddItem( s_opengl_menu, s_paletted_texture_box ); ! Menu.Menu_AddItem( s_software_menu, s_defaults_action[SOFTWARE_MENU] ); ! Menu.Menu_AddItem( s_software_menu, s_apply_action[SOFTWARE_MENU] ); ! Menu.Menu_AddItem( s_opengl_menu, s_defaults_action[OPENGL_MENU] ); ! Menu.Menu_AddItem( s_opengl_menu, s_apply_action[OPENGL_MENU] ); - Menu.Menu_Center( s_software_menu ); Menu.Menu_Center( s_opengl_menu ); s_opengl_menu.x -= 8; - s_software_menu.x -= 8; } --- 675,691 ---- s_paletted_texture_box.curvalue = (int)gl_ext_palettedtexture.value; ! Menu.Menu_AddItem( s_opengl_menu, s_ref_list ); ! Menu.Menu_AddItem( s_opengl_menu, s_mode_list ); ! Menu.Menu_AddItem( s_opengl_menu, s_screensize_slider ); ! Menu.Menu_AddItem( s_opengl_menu, s_brightness_slider ); ! Menu.Menu_AddItem( s_opengl_menu, s_fs_box ); Menu.Menu_AddItem( s_opengl_menu, s_tq_slider ); Menu.Menu_AddItem( s_opengl_menu, s_paletted_texture_box ); ! Menu.Menu_AddItem( s_opengl_menu, s_defaults_action ); ! Menu.Menu_AddItem( s_opengl_menu, s_apply_action ); Menu.Menu_Center( s_opengl_menu ); s_opengl_menu.x -= 8; } *************** *** 847,855 **** static void MenuDraw() { ! ! if ( s_current_menu_index == 0 ) ! s_current_menu = s_software_menu; ! else ! s_current_menu = s_opengl_menu; /* --- 697,701 ---- static void MenuDraw() { ! s_current_menu = s_opengl_menu; /* Index: SCR.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/SCR.java,v retrieving revision 1.8 retrieving revision 1.8.6.1 diff -C2 -d -r1.8 -r1.8.6.1 *** SCR.java 22 Sep 2004 19:22:08 -0000 1.8 --- SCR.java 16 Jan 2005 21:20:58 -0000 1.8.6.1 *************** *** 1176,1184 **** * text to the screen. ================== */ static void UpdateScreen2() { int numframes; int i; - float[] separation = { 0, 0 }; - // if the screen is disabled (loading plaque is up, or vid mode // changing) --- 1176,1184 ---- * text to the screen. ================== */ + private static final float[] separation = { 0, 0 }; + static void UpdateScreen2() { int numframes; int i; // if the screen is disabled (loading plaque is up, or vid mode // changing) Index: entity_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/entity_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.10.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.10.1 *** entity_t.java 7 Jul 2004 19:58:52 -0000 1.1.1.1 --- entity_t.java 16 Jan 2005 21:20:58 -0000 1.1.1.1.10.1 *************** *** 73,76 **** --- 73,91 ---- this.flags = src.flags; } + + public void clear() { + model = null; + Math3D.VectorClear(angles); + Math3D.VectorClear(origin); + frame = 0; + Math3D.VectorClear(oldorigin); + oldframe = 0; + backlerp = 0; + skinnum = 0; + lightstyle = 0; + alpha = 0; + skin = null; + flags = 0; + } } Index: CL_fx.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_fx.java,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -C2 -d -r1.7 -r1.7.6.1 *** CL_fx.java 11 Oct 2004 14:04:16 -0000 1.7 --- CL_fx.java 16 Jan 2005 21:20:58 -0000 1.7.6.1 *************** *** 28,33 **** import jake2.Defines; import jake2.Globals; - import jake2.game.M_Flash; import jake2.game.entity_state_t; import jake2.qcommon.Com; import jake2.qcommon.MSG; --- 28,33 ---- import jake2.Defines; import jake2.Globals; import jake2.game.entity_state_t; + import jake2.game.monsters.M_Flash; import jake2.qcommon.Com; import jake2.qcommon.MSG; |
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/game Modified Files: Tag: RST Cmd.java PlayerView.java GamePWeapon.java trace_t.java GameSpawn.java GameTurret.java cplane_t.java GameUtil.java Monster.java EdictIterator.java GameAI.java Removed Files: Tag: RST M_Brain.java M_Flash.java M_Boss32.java M_Gunner.java M_Mutant.java M_Boss2.java M_Flyer.java M_Float.java M_Hover.java M_Actor.java M_Chick.java M_Tank.java M_Berserk.java M_Medic.java M_Player.java M_Insane.java M_Soldier.java M_Supertank.java M_Boss3.java M_Parasite.java M_Gladiator.java M_Flipper.java M_Infantry.java M_Boss31.java Log Message: This has vec3-optimize and the OAK bot. --- M_Insane.java DELETED --- --- M_Soldier.java DELETED --- --- M_Parasite.java DELETED --- --- M_Player.java DELETED --- Index: EdictIterator.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/EdictIterator.java,v retrieving revision 1.2 retrieving revision 1.2.10.1 diff -C2 -d -r1.2 -r1.2.10.1 *** EdictIterator.java 8 Jul 2004 15:58:44 -0000 1.2 --- EdictIterator.java 16 Jan 2005 21:21:03 -0000 1.2.10.1 *************** *** 32,36 **** this.i = i; } ! edict_t o; int i; } \ No newline at end of file --- 32,36 ---- this.i = i; } ! public edict_t o; int i; } \ No newline at end of file --- M_Float.java DELETED --- Index: GameSpawn.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameSpawn.java,v retrieving revision 1.9 retrieving revision 1.9.6.1 diff -C2 -d -r1.9 -r1.9.6.1 *** GameSpawn.java 22 Sep 2004 19:22:05 -0000 1.9 --- GameSpawn.java 16 Jan 2005 21:21:02 -0000 1.9.6.1 *************** *** 24,27 **** --- 24,28 ---- import jake2.Defines; + import jake2.game.monsters.*; import jake2.qcommon.Com; import jake2.util.Lib; *************** *** 350,354 **** if (key.equals("nextmap")) ! Com.p("nextmap: " + value); if (!GameBase.st.set(key, value)) if (!ent.set(key, value)) --- 351,355 ---- if (key.equals("nextmap")) ! Com.Println("nextmap: " + value); if (!GameBase.st.set(key, value)) if (!ent.set(key, value)) --- M_Actor.java DELETED --- --- M_Tank.java DELETED --- --- M_Supertank.java DELETED --- --- M_Boss32.java DELETED --- Index: Monster.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Monster.java,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** Monster.java 22 Sep 2004 19:22:06 -0000 1.4 --- Monster.java 16 Jan 2005 21:21:03 -0000 1.4.6.1 *************** *** 349,353 **** public boolean think(edict_t self) { if (self.index == 312) ! Com.p("monster_triggered_start"); self.solid = Defines.SOLID_NOT; self.movetype = Defines.MOVETYPE_NONE; --- 349,353 ---- public boolean think(edict_t self) { if (self.index == 312) ! Com.Printf("monster_triggered_start\n"); self.solid = Defines.SOLID_NOT; self.movetype = Defines.MOVETYPE_NONE; Index: GameUtil.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameUtil.java,v retrieving revision 1.7.6.1 retrieving revision 1.7.6.2 diff -C2 -d -r1.7.6.1 -r1.7.6.2 *** GameUtil.java 31 Dec 2004 14:08:33 -0000 1.7.6.1 --- GameUtil.java 16 Jan 2005 21:21:03 -0000 1.7.6.2 *************** *** 783,787 **** * triggered by damage ============= */ ! static int range(edict_t self, edict_t other) { float[] v = { 0, 0, 0 }; float len; --- 783,787 ---- * triggered by damage ============= */ ! public static int range(edict_t self, edict_t other) { float[] v = { 0, 0, 0 }; float len; *************** *** 830,834 **** return it; } ! Com.p("Item not found:" + pickup_name); return null; } --- 830,834 ---- return it; } ! Com.Println("Item not found:" + pickup_name); return null; } *************** *** 902,906 **** * returns true if the entity is in front (in sight) of self ============= */ ! static boolean infront(edict_t self, edict_t other) { float[] vec = { 0, 0, 0 }; float dot; --- 902,906 ---- * returns true if the entity is in front (in sight) of self ============= */ ! public static boolean infront(edict_t self, edict_t other) { float[] vec = { 0, 0, 0 }; float dot; *************** *** 1686,1690 **** // } // ============================================================================ ! static EntThinkAdapter M_CheckAttack = new EntThinkAdapter() { public boolean think(edict_t self) { --- 1686,1690 ---- // } // ============================================================================ ! public static EntThinkAdapter M_CheckAttack = new EntThinkAdapter() { public boolean think(edict_t self) { --- M_Chick.java DELETED --- --- M_Medic.java DELETED --- Index: PlayerView.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/PlayerView.java,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -C2 -d -r1.2 -r1.2.6.1 *** PlayerView.java 22 Sep 2004 19:22:03 -0000 1.2 --- PlayerView.java 16 Jan 2005 21:21:01 -0000 1.2.6.1 *************** *** 25,28 **** --- 25,29 ---- import jake2.Defines; import jake2.Globals; + import jake2.game.monsters.M_Player; import jake2.util.Lib; import jake2.util.Math3D; --- M_Flipper.java DELETED --- --- M_Gladiator.java DELETED --- --- M_Boss3.java DELETED --- --- M_Infantry.java DELETED --- --- M_Berserk.java DELETED --- --- M_Boss31.java DELETED --- Index: trace_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/trace_t.java,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** trace_t.java 12 Jul 2004 20:47:01 -0000 1.4 --- trace_t.java 16 Jan 2005 21:21:02 -0000 1.4.6.1 *************** *** 27,31 **** //a trace is returned when a box is swept through the world ! public class trace_t implements Cloneable { public boolean allsolid; // if true, plane is not valid public boolean startsolid; // if true, the initial point was in a solid area --- 27,31 ---- //a trace is returned when a box is swept through the world ! public class trace_t { public boolean allsolid; // if true, plane is not valid public boolean startsolid; // if true, the initial point was in a solid area *************** *** 39,45 **** // pointer public edict_t ent; // not set by CM_*() functions ! ! public void set(trace_t from) ! { allsolid = from.allsolid; startsolid = from.allsolid; --- 39,44 ---- // pointer public edict_t ent; // not set by CM_*() functions ! ! public void set(trace_t from) { allsolid = from.allsolid; startsolid = from.allsolid; *************** *** 51,53 **** --- 50,63 ---- ent = from.ent; } + + public void clear() { + allsolid = false; + startsolid = false; + fraction = 0; + Math3D.VectorClear(endpos); + plane.clear(); + surface = null; + contents = 0; + ent = null; + } } Index: GameAI.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameAI.java,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -C2 -d -r1.5 -r1.5.6.1 *** GameAI.java 22 Sep 2004 19:22:06 -0000 1.5 --- GameAI.java 16 Jan 2005 21:21:03 -0000 1.5.6.1 *************** *** 26,29 **** --- 26,31 ---- import jake2.Globals; import jake2.client.M; + import jake2.game.bots.OAK; + import jake2.game.monsters.M_Player; import jake2.qcommon.Com; import jake2.server.SV_WORLD; *************** *** 1770,1773 **** --- 1772,1777 ---- else if (Lib.Q_stricmp(cmd, "wave") == 0) Cmd.Wave_f(ent); + else if (Lib.Q_stricmp (cmd, "oak") == 0) + OAK.OAK_Check_SP(ent); else if (Lib.Q_stricmp(cmd, "playerlist") == 0) Cmd.PlayerList_f(ent); --- M_Hover.java DELETED --- Index: cplane_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/cplane_t.java,v retrieving revision 1.3 retrieving revision 1.3.10.1 diff -C2 -d -r1.3 -r1.3.10.1 *** cplane_t.java 8 Jul 2004 20:24:29 -0000 1.3 --- cplane_t.java 16 Jan 2005 21:21:03 -0000 1.3.10.1 *************** *** 34,54 **** public byte signbits; // signx + (signy<<1) + (signz<<1) public byte pad[] = { 0, 0 }; ! ! // public cplane_t getClone() ! // { ! // cplane_t out = new cplane_t(); ! // Math3D.set(out.normal, normal); ! // out.dist = dist; ! // out.type = type; ! // out.signbits = signbits; ! // out.pad[0] = pad[0]; ! // out.pad[1] = pad[1]; ! // ! // return out; ! // } ! ! public void set(cplane_t c) ! { ! Math3D.set(normal, c.normal); dist = c.dist; --- 34,39 ---- public byte signbits; // signx + (signy<<1) + (signz<<1) public byte pad[] = { 0, 0 }; ! ! public void set(cplane_t c) { Math3D.set(normal, c.normal); dist = c.dist; *************** *** 58,60 **** --- 43,54 ---- pad[1] = c.pad[1]; } + + public void clear() { + Math3D.VectorClear(normal); + dist = 0; + type = 0; + signbits = 0; + pad[0] = 0; + pad[1] = 0; + } } --- M_Flyer.java DELETED --- --- M_Flash.java DELETED --- --- M_Boss2.java DELETED --- Index: Cmd.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Cmd.java,v retrieving revision 1.8 retrieving revision 1.8.2.1 diff -C2 -d -r1.8 -r1.8.2.1 *** Cmd.java 29 Oct 2004 00:20:05 -0000 1.8 --- Cmd.java 16 Jan 2005 21:21:00 -0000 1.8.2.1 *************** *** 28,31 **** --- 28,32 ---- import jake2.Defines; import jake2.Globals; + import jake2.game.monsters.M_Player; import jake2.qcommon.*; import jake2.server.SV_GAME; Index: GamePWeapon.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GamePWeapon.java,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** GamePWeapon.java 22 Sep 2004 19:22:03 -0000 1.6 --- GamePWeapon.java 16 Jan 2005 21:21:02 -0000 1.6.6.1 *************** *** 25,28 **** --- 25,29 ---- import jake2.Defines; import jake2.Globals; + import jake2.game.monsters.M_Player; import jake2.util.Lib; import jake2.util.Math3D; *************** *** 230,233 **** --- 231,236 ---- radius_damage); + GameUtil.T_Damage(ent, ent, ent.owner, ent.velocity, ent.s.origin, ent.s.origin, 25, 0, 0, 0); + // send muzzle flash GameBase.gi.WriteByte(Defines.svc_muzzleflash); --- M_Gunner.java DELETED --- --- M_Mutant.java DELETED --- --- M_Brain.java DELETED --- Index: GameTurret.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/GameTurret.java,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** GameTurret.java 22 Sep 2004 19:22:05 -0000 1.3 --- GameTurret.java 16 Jan 2005 21:21:03 -0000 1.3.6.1 *************** *** 25,28 **** --- 25,29 ---- import jake2.*; import jake2.client.*; + import jake2.game.monsters.M_Infantry; import jake2.qcommon.*; import jake2.render.*; |
From: Rene S. <sa...@us...> - 2005-01-16 21:22:01
|
Update of /cvsroot/jake2/jake2/src/jake2/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/util Modified Files: Tag: RST Lib.java Math3D.java Added Files: Tag: RST Vec3Cache.java Log Message: This has vec3-optimize and the OAK bot. Index: Lib.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/util/Lib.java,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** Lib.java 16 Dec 2004 19:46:49 -0000 1.11 --- Lib.java 16 Jan 2005 21:21:11 -0000 1.11.2.1 *************** *** 211,215 **** FS.Read(buffer, len, f); ! return new String(buffer).trim(); } public static String rightFrom(String in, char c) { --- 211,215 ---- FS.Read(buffer, len, f); ! return Lib.CtoJava(buffer); } public static String rightFrom(String in, char c) { *************** *** 267,272 **** } public static String CtoJava(byte[] old, int offset, int maxLenght) { ! int i; for (i = offset; old[i] != 0 && (i - offset) < maxLenght; i++); return new String(old, offset, i - offset); --- 267,277 ---- } + public static String CtoJava(byte[] old) { + return CtoJava(old, 0, old.length); + } + public static String CtoJava(byte[] old, int offset, int maxLenght) { ! if (old.length == 0 || old[0] == 0) return ""; ! int i; for (i = offset; old[i] != 0 && (i - offset) < maxLenght; i++); return new String(old, offset, i - offset); Index: Math3D.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/util/Math3D.java,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -C2 -d -r1.7 -r1.7.6.1 *** Math3D.java 22 Sep 2004 19:22:13 -0000 1.7 --- Math3D.java 16 Jan 2005 21:21:11 -0000 1.7.6.1 *************** *** 175,184 **** private static float tmpmat[][] = new float[3][3]; private static float zrot[][] = new float[3][3]; ! public static void RotatePointAroundVector(float[] dst, float[] dir, float[] point, float degrees) { ! ! float[] vr = { 0.0f, 0.0f, 0.0f }; ! float[] vup = { 0.0f, 0.0f, 0.0f }; ! float[] vf = { 0.0f, 0.0f, 0.0f }; vf[0] = dir[0]; vf[1] = dir[1]; --- 175,185 ---- private static float tmpmat[][] = new float[3][3]; private static float zrot[][] = new float[3][3]; ! ! // to reduce garbage ! private static final float[] vr = {0, 0, 0}; ! private static final float[] vup = {0, 0, 0}; ! private static final float[] vf = {0, 0, 0}; + public static void RotatePointAroundVector(float[] dst, float[] dir, float[] point, float degrees) { vf[0] = dir[0]; vf[1] = dir[1]; *************** *** 225,228 **** --- 226,230 ---- } } + public static void MakeNormalVectors(float[] forward, float[] right, float[] up) { // this rotate and negat guarantees a vector *************** *** 287,290 **** --- 289,295 ---- dst[2] = p[2] - d * dst[2]; } + + private static final float[][] PLANE_XYZ = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; + /** assumes "src" is normalized */ public static void PerpendicularVector(float[] dst, float[] src) { *************** *** 300,308 **** } } - float tempvec[] = { 0.0f, 0.0f, 0.0f }; - tempvec[pos] = 1.0F; - // project the point onto the plane defined by src ! ProjectPointOnPlane(dst, tempvec, src); //normalize the result --- 305,310 ---- } } // project the point onto the plane defined by src ! ProjectPointOnPlane(dst, PLANE_XYZ[pos], src); //normalize the result --- NEW FILE: Vec3Cache.java --- /* * Vec3Cache.java * Copyright (C) 2003 * * $Id: Vec3Cache.java,v 1.1.2.1 2005/01/16 21:21:11 salomo Exp $ */ package jake2.util; /** * Vec3Cache contains float[3] for temporary usage. * The usage can reduce the garbage at runtime. * * @author cwei */ public final class Vec3Cache { //private static Stack cache = new Stack(); private static final float[][] cache = new float[64][3]; private static int index = 0; private static int max = 0; public static final float[] get() { //max = Math.max(index, max); return cache[index++]; } public static final void release() { index--; } public static final void release(int count) { index-=count; } public static final void debug() { System.err.println("Vec3Cache: max. " + (max + 1) + " vectors used."); } } |
From: Rene S. <sa...@us...> - 2005-01-16 21:22:01
|
Update of /cvsroot/jake2/jake2/src/jake2/render/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/render/jogl Modified Files: Tag: RST Warp.java Model.java Surf.java Added Files: Tag: RST Polygon.java Log Message: This has vec3-optimize and the OAK bot. Index: Warp.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Warp.java,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -C2 -d -r1.7 -r1.7.6.1 *** Warp.java 22 Sep 2004 19:22:16 -0000 1.7 --- Warp.java 16 Jan 2005 21:21:10 -0000 1.7.6.1 *************** *** 29,35 **** import jake2.Globals; import jake2.qcommon.Com; ! import jake2.render.glpoly_t; ! import jake2.render.image_t; ! import jake2.render.msurface_t; import jake2.util.Math3D; import net.java.games.jogl.GL; --- 29,33 ---- import jake2.Globals; import jake2.qcommon.Com; ! import jake2.render.*; import jake2.util.Math3D; import net.java.games.jogl.GL; *************** *** 198,211 **** // init polys ! glpoly_t poly = new glpoly_t(numverts + 2); poly.next = warpface.polys; warpface.polys = poly; - poly.numverts = numverts + 2; Math3D.VectorClear(total); total_s = 0; total_t = 0; for (i = 0; i < numverts; i++) { ! Math3D.VectorCopy(verts[i], poly.verts[i + 1]); s = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[0]); t = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[1]); --- 196,210 ---- // init polys ! glpoly_t poly = Polygon.create(numverts + 2); poly.next = warpface.polys; warpface.polys = poly; Math3D.VectorClear(total); total_s = 0; total_t = 0; for (i = 0; i < numverts; i++) { ! poly.x(i + 1, verts[i][0]); ! poly.y(i + 1, verts[i][1]); ! poly.z(i + 1, verts[i][2]); s = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[0]); t = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[1]); *************** *** 215,253 **** Math3D.VectorAdd(total, verts[i], total); ! poly.verts[i + 1][3] = s; ! poly.verts[i + 1][4] = t; } ! Math3D.VectorScale(total, (1.0f / numverts), poly.verts[0]); ! poly.verts[0][3] = total_s / numverts; ! poly.verts[0][4] = total_t / numverts; ! ! // memcpy (poly.verts[i+1], poly.verts[1], sizeof(poly.verts[0])); ! System.arraycopy(poly.verts[1], 0, poly.verts[i + 1], 0, ! poly.verts[1].length); // :-) } /* ! * ================ GL_SubdivideSurface * * Breaks a polygon up along axial 64 unit boundaries so that turbulent and ! * sky warps can be done reasonably. ================ */ ! void GL_SubdivideSurface(msurface_t fa) { ! float[][] verts = new float[64][3]; ! int numverts; ! int i; ! int lindex; float[] vec; - warpface = fa; - // // convert edges back to a normal polygon // ! numverts = 0; ! for (i = 0; i < fa.numedges; i++) { ! lindex = loadmodel.surfedges[fa.firstedge + i]; if (lindex > 0) --- 214,255 ---- Math3D.VectorAdd(total, verts[i], total); ! poly.s1(i + 1, s); ! poly.t1(i + 1, t); } + + float scale = 1.0f / numverts; + poly.x(0, total[0] * scale); + poly.y(0, total[1] * scale); + poly.z(0, total[2] * scale); + poly.s1(0, total_s * scale); + poly.t1(0, total_t * scale); ! poly.x(i + 1, poly.x(1)); ! poly.y(i + 1, poly.y(1)); ! poly.z(i + 1, poly.z(1)); ! poly.s1(i + 1, poly.s1(1)); ! poly.t1(i + 1, poly.t1(1)); ! poly.s2(i + 1, poly.s2(1)); ! poly.t2(i + 1, poly.t2(1)); } /* ! * GL_SubdivideSurface * * Breaks a polygon up along axial 64 unit boundaries so that turbulent and ! * sky warps can be done reasonably. */ ! float[][] tmpVerts = new float[64][3]; ! void GL_SubdivideSurface(msurface_t fa) { ! float[][] verts = tmpVerts; float[] vec; warpface = fa; // // convert edges back to a normal polygon // ! int numverts = 0; ! for (int i = 0; i < fa.numedges; i++) { ! int lindex = loadmodel.surfedges[fa.firstedge + i]; if (lindex > 0) *************** *** 258,262 **** numverts++; } - SubdividePolygon(numverts, verts); } --- 260,263 ---- *************** *** 278,282 **** void EmitWaterPolys(msurface_t fa) { glpoly_t p, bp; - float[] v; int i; float s = 0; --- 279,282 ---- *************** *** 296,302 **** gl.glBegin(GL.GL_TRIANGLE_FAN); for (i = 0; i < p.numverts; i++) { ! v = p.verts[i]; ! os = v[3]; ! ot = v[4]; s = os --- 296,301 ---- gl.glBegin(GL.GL_TRIANGLE_FAN); for (i = 0; i < p.numverts; i++) { ! os = p.s1(i); ! ot = p.t1(i); s = os *************** *** 310,314 **** gl.glTexCoord2f(s, t); ! gl.glVertex3f(v[0], v[1], v[2]); } gl.glEnd(); --- 309,313 ---- gl.glTexCoord2f(s, t); ! gl.glVertex3f(p.x(i), p.y(i), p.z(i)); } gl.glEnd(); *************** *** 510,523 **** /* ! * ================= R_AddSkySurface ================= */ void R_AddSkySurface(msurface_t fa) { - int i; - glpoly_t p; - // calculate vertex values for sky box ! for (p = fa.polys; p != null; p = p.next) { ! for (i = 0; i < p.numverts; i++) { ! Math3D.VectorSubtract(p.verts[i], r_origin, verts[i]); } ClipSkyPolygon(p.numverts, verts, 0); --- 509,521 ---- /* ! * R_AddSkySurface */ void R_AddSkySurface(msurface_t fa) { // calculate vertex values for sky box ! for (glpoly_t p = fa.polys; p != null; p = p.next) { ! for (int i = 0; i < p.numverts; i++) { ! verts[i][0] = p.x(i) - r_origin[0]; ! verts[i][1] = p.y(i) - r_origin[1]; ! verts[i][2] = p.z(i) - r_origin[2]; } ClipSkyPolygon(p.numverts, verts, 0); Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Surf.java,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -C2 -d -r1.5 -r1.5.6.1 *** Surf.java 16 Jul 2004 10:11:35 -0000 1.5 --- Surf.java 16 Jan 2005 21:21:11 -0000 1.5.6.1 *************** *** 155,167 **** void DrawGLPoly(glpoly_t p) { - int i; - float[] v; - gl.glBegin(GL.GL_POLYGON); ! for (i=0 ; i<p.numverts ; i++) { ! v = p.verts[i]; ! gl.glTexCoord2f(v[3], v[4]); ! gl.glVertex3f(v[0], v[1], v[2]); } gl.glEnd(); --- 155,163 ---- void DrawGLPoly(glpoly_t p) { gl.glBegin(GL.GL_POLYGON); ! for (int i=0 ; i<p.numverts ; i++) { ! gl.glTexCoord2f(p.s1(i), p.t1(i)); ! gl.glVertex3f(p.x(i), p.y(i), p.z(i)); } gl.glEnd(); *************** *** 177,197 **** void DrawGLFlowingPoly(msurface_t fa) { ! int i; ! float[] v; ! glpoly_t p; ! float scroll; ! ! p = fa.polys; ! ! scroll = -64 * ( (r_newrefdef.time / 40.0f) - (int)(r_newrefdef.time / 40.0f) ); if(scroll == 0.0f) scroll = -64.0f; gl.glBegin (GL.GL_POLYGON); ! for (i=0 ; i<p.numverts ; i++) { ! v = p.verts[i]; ! gl.glTexCoord2f ((v[3] + scroll), v[4]); ! gl.glVertex3f(v[0], v[1], v[2]); } gl.glEnd (); --- 173,186 ---- void DrawGLFlowingPoly(msurface_t fa) { ! float scroll = -64 * ( (r_newrefdef.time / 40.0f) - (int)(r_newrefdef.time / 40.0f) ); if(scroll == 0.0f) scroll = -64.0f; gl.glBegin (GL.GL_POLYGON); ! glpoly_t p = fa.polys; ! for (int i=0 ; i<p.numverts ; i++) { ! gl.glTexCoord2f(p.s1(i) + scroll, p.t1(i)); ! gl.glVertex3f(p.x(i), p.y(i), p.z(i)); } gl.glEnd (); *************** *** 205,211 **** void R_DrawTriangleOutlines() { - int i, j; - glpoly_t p; - if (gl_showtris.value == 0) return; --- 194,197 ---- *************** *** 215,219 **** gl.glColor4f (1,1,1,1); ! for (i=0 ; i<MAX_LIGHTMAPS ; i++) { msurface_t surf; --- 201,205 ---- gl.glColor4f (1,1,1,1); ! for (int i=0 ; i<MAX_LIGHTMAPS ; i++) { msurface_t surf; *************** *** 221,234 **** for ( surf = gl_lms.lightmap_surfaces[i]; surf != null; surf = surf.lightmapchain ) { ! p = surf.polys; for ( ; p != null ; p=p.chain) { ! for (j=2 ; j<p.numverts ; j++ ) { gl.glBegin (GL.GL_LINE_STRIP); ! gl.glVertex3fv (p.verts[0]); ! gl.glVertex3fv (p.verts[j-1]); ! gl.glVertex3fv (p.verts[j]); ! gl.glVertex3fv (p.verts[0]); gl.glEnd (); } --- 207,220 ---- for ( surf = gl_lms.lightmap_surfaces[i]; surf != null; surf = surf.lightmapchain ) { ! glpoly_t p = surf.polys; for ( ; p != null ; p=p.chain) { ! for (int j=2 ; j<p.numverts ; j++ ) { gl.glBegin (GL.GL_LINE_STRIP); ! gl.glVertex3f(p.x(0), p.y(0), p.z(0)); ! gl.glVertex3f(p.x(j-1), p.y(j-1), p.z(j-1)); ! gl.glVertex3f(p.x(j), p.y(j), p.z(j)); ! gl.glVertex3f(p.x(0), p.y(0), p.z(0)); gl.glEnd (); } *************** *** 236,240 **** } } - gl.glEnable (GL.GL_DEPTH_TEST); gl.glEnable (GL.GL_TEXTURE_2D); --- 222,225 ---- *************** *** 250,262 **** for ( ; p != null; p = p.chain ) { - float[] v; - int j; - gl.glBegin(GL.GL_POLYGON); ! for (j=0 ; j<p.numverts ; j++) { ! v = p.verts[j]; ! gl.glTexCoord2f (v[5], v[6] ); ! gl.glVertex3f(v[0], v[1], v[2]); } gl.glEnd(); --- 235,243 ---- for ( ; p != null; p = p.chain ) { gl.glBegin(GL.GL_POLYGON); ! for (int j=0 ; j<p.numverts ; j++) { ! gl.glTexCoord2f (p.s2(j), p.t2(j)); ! gl.glVertex3f(p.x(j), p.y(j), p.z(j)); } gl.glEnd(); *************** *** 267,279 **** for ( ; p != null; p = p.chain ) { - float[] v; - int j; - gl.glBegin(GL.GL_POLYGON); ! for (j=0 ; j<p.numverts ; j++) { ! v = p.verts[j]; ! gl.glTexCoord2f (v[5] - soffset, v[6] - toffset ); ! gl.glVertex3f(v[0], v[1], v[2]); } gl.glEnd(); --- 248,256 ---- for ( ; p != null; p = p.chain ) { gl.glBegin(GL.GL_POLYGON); ! for (int j=0 ; j<p.numverts ; j++) { ! gl.glTexCoord2f (p.s2(j) - soffset, p.t2(j) - toffset); ! gl.glVertex3f(p.x(j), p.y(j), p.z(j)); } gl.glEnd(); *************** *** 804,814 **** for (i=0 ; i< nv; i++) { ! v = p.verts[i]; ! ! gl.glMultiTexCoord2fARB(GL_TEXTURE0, (v[3] + scroll), v[4]); ! gl.glMultiTexCoord2fARB(GL_TEXTURE1, v[5], v[6]); ! //gglMTexCoord2fSGIS( GL_TEXTURE0, v[3], v[4]); //gglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); ! gl.glVertex3f(v[0], v[1], v[2]); } gl.glEnd (); --- 781,789 ---- for (i=0 ; i< nv; i++) { ! gl.glMultiTexCoord2fARB(GL_TEXTURE0, p.s1(i) + scroll, p.t1(i)); ! gl.glMultiTexCoord2fARB(GL_TEXTURE1, p.s2(i), p.t2(i)); ! //gglMTexCoord2fSGIS( GL_TEXTURE0, v[3] + scroll, v[4]); //gglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); ! gl.glVertex3f(p.x(i), p.y(i), p.z(i)); } gl.glEnd (); *************** *** 822,832 **** for (i=0 ; i< nv; i++) { ! v = p.verts[i]; ! ! gl.glMultiTexCoord2fARB(GL_TEXTURE0, v[3], v[4]); ! gl.glMultiTexCoord2fARB(GL_TEXTURE1, v[5], v[6]); //gglMTexCoord2fSGIS( GL_TEXTURE0, v[3], v[4]); //gglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); ! gl.glVertex3f(v[0], v[1], v[2]); } gl.glEnd (); --- 797,805 ---- for (i=0 ; i< nv; i++) { ! gl.glMultiTexCoord2fARB(GL_TEXTURE0, p.s1(i), p.t1(i)); ! gl.glMultiTexCoord2fARB(GL_TEXTURE1, p.s2(i), p.t2(i)); //gglMTexCoord2fSGIS( GL_TEXTURE0, v[3], v[4]); //gglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); ! gl.glVertex3f(p.x(i), p.y(i), p.z(i)); } gl.glEnd (); *************** *** 858,868 **** for (i=0 ; i< nv; i++) { ! v = p.verts[i]; ! ! gl.glMultiTexCoord2fARB(GL_TEXTURE0, (v[3]+scroll), v[4]); ! gl.glMultiTexCoord2fARB(GL_TEXTURE1, v[5], v[6]); ! // qglMTexCoord2fSGIS( GL_TEXTURE0, (v[3]+scroll), v[4]); ! // qglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); ! gl.glVertex3f(v[0], v[1], v[2]); } gl.glEnd(); --- 831,839 ---- for (i=0 ; i< nv; i++) { ! gl.glMultiTexCoord2fARB(GL_TEXTURE0, p.s1(i) + scroll, p.t1(i)); ! gl.glMultiTexCoord2fARB(GL_TEXTURE1, p.s2(i), p.t2(i)); ! //gglMTexCoord2fSGIS( GL_TEXTURE0, v[3] + scroll, v[4]); ! //gglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); ! gl.glVertex3f(p.x(i), p.y(i), p.z(i)); } gl.glEnd(); *************** *** 878,888 **** for (i=0 ; i< nv; i++) { ! v = p.verts[i]; ! ! gl.glMultiTexCoord2fARB(GL_TEXTURE0, v[3], v[4]); ! gl.glMultiTexCoord2fARB(GL_TEXTURE1, v[5], v[6]); //gglMTexCoord2fSGIS( GL_TEXTURE0, v[3], v[4]); //gglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); ! gl.glVertex3f(v[0], v[1], v[2]); } gl.glEnd (); --- 849,857 ---- for (i=0 ; i< nv; i++) { ! gl.glMultiTexCoord2fARB(GL_TEXTURE0, p.s1(i), p.t1(i)); ! gl.glMultiTexCoord2fARB(GL_TEXTURE1, p.s2(i), p.t2(i)); //gglMTexCoord2fSGIS( GL_TEXTURE0, v[3], v[4]); //gglMTexCoord2fSGIS( GL_TEXTURE1, v[5], v[6]); ! gl.glVertex3f(p.x(i), p.y(i), p.z(i)); } gl.glEnd (); *************** *** 1478,1487 **** // // poly = Hunk_Alloc (sizeof(glpoly_t) + (lnumverts-4) * VERTEXSIZE*sizeof(float)); ! poly = new glpoly_t(lnumverts); poly.next = fa.polys; poly.flags = fa.flags; fa.polys = poly; - poly.numverts = lnumverts; for (i=0 ; i<lnumverts ; i++) --- 1447,1455 ---- // // poly = Hunk_Alloc (sizeof(glpoly_t) + (lnumverts-4) * VERTEXSIZE*sizeof(float)); ! poly = Polygon.create(lnumverts); poly.next = fa.polys; poly.flags = fa.flags; fa.polys = poly; for (i=0 ; i<lnumverts ; i++) *************** *** 1506,1512 **** Math3D.VectorAdd (total, vec, total); ! Math3D.VectorCopy (vec, poly.verts[i]); ! poly.verts[i][3] = s; ! poly.verts[i][4] = t; // --- 1474,1486 ---- Math3D.VectorAdd (total, vec, total); ! //Math3D.VectorCopy (vec, poly.verts[i]); ! poly.x(i, vec[0]); ! poly.y(i, vec[1]); ! poly.z(i, vec[2]); ! ! //poly.verts[i][3] = s; ! //poly.verts[i][4] = t; ! poly.s1(i, s); ! poly.t1(i, t); // *************** *** 1525,1534 **** t /= BLOCK_HEIGHT*16; //fa.texinfo.texture.height; ! poly.verts[i][5] = s; ! poly.verts[i][6] = t; } - - poly.numverts = lnumverts; - } --- 1499,1507 ---- t /= BLOCK_HEIGHT*16; //fa.texinfo.texture.height; ! //poly.verts[i][5] = s; ! //poly.verts[i][6] = t; ! poly.s2(i, s); ! poly.t2(i, t); } } --- NEW FILE: Polygon.java --- /* * Polygon.java * Copyright (C) 2003 * * $Id: Polygon.java,v 1.1.2.1 2005/01/16 21:21:10 salomo 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.jogl; import jake2.render.glpoly_t; /** * Polygon * * @author cwei */ public final class Polygon extends glpoly_t { private final static int MAXPOLYS = 20000; private final static int MAX_BUFFER_VERTICES = 120000; private static float[] buffer = new float[MAX_BUFFER_VERTICES * STRIDE]; private static int bufferIndex = 0; private static int polyCount = 0; private static Polygon[] polyCache = new Polygon[MAXPOLYS]; static { for (int i = 0; i < polyCache.length; i++) { polyCache[i] = new Polygon(); } } public static glpoly_t create(int numverts) { Polygon poly = polyCache[polyCount++]; poly.clear(); poly.numverts = numverts; poly.pos = bufferIndex; bufferIndex += numverts; return poly; } public static void reset() { polyCount = 0; bufferIndex = 0; } private Polygon() { } private final void clear() { next = null; chain = null; numverts = 0; flags = 0; } public final float x(int index) { return buffer[(index + pos) * 7 + 0]; } public final void x(int index, float value) { buffer[(index + pos) * 7 + 0] = value; } public final float y(int index) { return buffer[(index + pos) * 7 + 1]; } public final void y(int index, float value) { buffer[(index + pos) * 7 + 1] = value; } public final float z(int index) { return buffer[(index + pos) * 7 + 2]; } public final void z(int index, float value) { buffer[(index + pos) * 7 + 2] = value; } public final float s1(int index) { return buffer[(index + pos) * 7 + 3]; } public final void s1(int index, float value) { buffer[(index + pos) * 7 + 3] = value; } public final float t1(int index) { return buffer[(index + pos) * 7 + 4]; } public final void t1(int index, float value) { buffer[(index + pos) * 7 + 4] = value; } public final float s2(int index) { return buffer[(index + pos) * 7 + 5]; } public final void s2(int index, float value) { buffer[(index + pos) * 7 + 5] = value; } public final float t2(int index) { return buffer[(index + pos) * 7 + 6]; } public final void t2(int index, float value) { buffer[(index + pos) * 7 + 6] = value; } public final void beginScrolling(float value) { // not in use } public final void endScrolling() { // not in use } } Index: Model.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Model.java,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** Model.java 16 Jul 2004 10:11:35 -0000 1.4 --- Model.java 16 Jan 2005 21:21:10 -0000 1.4.6.1 *************** *** 1150,1153 **** --- 1150,1155 ---- { cvar_t flushmap; + + Polygon.reset(); registration_sequence++; |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:58
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/joal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/sound/joal Modified Files: Tag: RST PlaySound.java Log Message: This has vec3-optimize and the OAK bot. |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:57
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/render Modified Files: Tag: RST glpoly_t.java LWJGLRenderer.java Renderer.java msurface_t.java Log Message: This has vec3-optimize and the OAK bot. Index: msurface_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/msurface_t.java,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** msurface_t.java 9 Jul 2004 06:50:47 -0000 1.3 --- msurface_t.java 16 Jan 2005 21:21:07 -0000 1.3.6.1 *************** *** 69,74 **** public void clear() { visframe = 0; ! plane = null; ! plane = new cplane_t(); flags = 0; --- 69,73 ---- public void clear() { visframe = 0; ! plane.clear(); flags = 0; Index: glpoly_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/glpoly_t.java,v retrieving revision 1.2 retrieving revision 1.2.6.1 diff -C2 -d -r1.2 -r1.2.6.1 *** glpoly_t.java 9 Jul 2004 06:50:47 -0000 1.2 --- glpoly_t.java 16 Jan 2005 21:21:07 -0000 1.2.6.1 *************** *** 24,46 **** package jake2.render; ! public class glpoly_t { ! public final static int VERTEXSIZE = 7; public glpoly_t next; public glpoly_t chain; public int numverts; public int flags; // for SURF_UNDERWATER (not needed anymore?) - public float verts[][] = null; // variable sized (xyz s1t1 s2t2) - public glpoly_t(int numverts) { - this.verts = new float[numverts][VERTEXSIZE]; - } - - /* - * vertex array extension - */ - // the array position (glDrawArrays) public int pos = 0; ! } --- 24,75 ---- package jake2.render; ! import jake2.util.Lib; + public abstract class glpoly_t { + public final static int STRIDE = 7; + public final static int BYTE_STRIDE = 7 * Lib.SIZEOF_FLOAT; + public final static int MAX_VERTICES = 64; + public glpoly_t next; public glpoly_t chain; public int numverts; public int flags; // for SURF_UNDERWATER (not needed anymore?) // the array position (glDrawArrays) public int pos = 0; ! protected glpoly_t() { ! } ! ! public abstract float x(int index); ! ! public abstract void x(int index, float value); ! ! public abstract float y(int index); ! ! public abstract void y(int index, float value); ! ! public abstract float z(int index); ! ! public abstract void z(int index, float value); ! ! public abstract float s1(int index); ! ! public abstract void s1(int index, float value); ! ! public abstract float t1(int index); ! ! public abstract void t1(int index, float value); ! ! public abstract float s2(int index); ! ! public abstract void s2(int index, float value); ! ! public abstract float t2(int index); ! ! public abstract void t2(int index, float value); ! ! public abstract void beginScrolling(float s1); ! ! public abstract void endScrolling(); ! } \ No newline at end of file Index: Renderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/Renderer.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** Renderer.java 16 Dec 2004 21:13:06 -0000 1.5 --- Renderer.java 16 Jan 2005 21:21:07 -0000 1.5.2.1 *************** *** 44,48 **** Class.forName("net.java.games.jogl.GL"); Class.forName("jake2.render.JoglRenderer"); - Class.forName("jake2.render.FastJoglRenderer"); } catch (ClassNotFoundException e) { // ignore the jogl drivers if runtime not in classpath --- 44,47 ---- *************** *** 54,57 **** --- 53,62 ---- // ignore the lwjgl driver if runtime not in classpath } + try { + Class.forName("net.java.games.jogl.GL"); + Class.forName("jake2.render.FastJoglRenderer"); + } catch (ClassNotFoundException e) { + // ignore the fastjogl drivers if runtime not in classpath + } } catch (Throwable e) { e.printStackTrace(); *************** *** 85,90 **** --- 90,104 ---- return null; } + + public static String getDefaultName() { + return (drivers.isEmpty()) ? null : ((Ref) drivers.firstElement()).getName(); + } + + public static String getPreferedName() { + return (drivers.isEmpty()) ? null : ((Ref) drivers.lastElement()).getName(); + } public static String[] getDriverNames() { + if (drivers.isEmpty()) return null; int count = drivers.size(); String[] names = new String[count]; |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:57
|
Update of /cvsroot/jake2/jake2/src/jake2/sound/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/sound/lwjgl Modified Files: Tag: RST Channel.java LWJGLSoundImpl.java PlaySound.java Log Message: This has vec3-optimize and the OAK bot. |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:54
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/render/lwjgl Modified Files: Tag: RST Warp.java LWJGLBase.java Surf.java Model.java Added Files: Tag: RST Polygon.java Log Message: This has vec3-optimize and the OAK bot. Index: Warp.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Warp.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** Warp.java 14 Dec 2004 12:56:59 -0000 1.2 --- Warp.java 16 Jan 2005 21:21:08 -0000 1.2.2.1 *************** *** 29,39 **** import jake2.Globals; import jake2.qcommon.Com; ! import jake2.render.glpoly_t; ! import jake2.render.image_t; ! import jake2.render.msurface_t; import jake2.util.Math3D; - import java.nio.FloatBuffer; - import org.lwjgl.opengl.GL11; --- 29,35 ---- import jake2.Globals; import jake2.qcommon.Com; ! import jake2.render.*; import jake2.util.Math3D; import org.lwjgl.opengl.GL11; *************** *** 195,228 **** // init polys ! glpoly_t poly = new glpoly_t(numverts + 2); poly.next = warpface.polys; warpface.polys = poly; - poly.numverts = numverts + 2; Math3D.VectorClear(total); total_s = 0; total_t = 0; ! for (i=0 ; i<numverts ; i++) ! { ! Math3D.VectorCopy(verts[i], poly.verts[i+1]); ! s = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[0]); ! t = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[1]); ! ! total_s += s; ! total_t += t; ! Math3D.VectorAdd(total, verts[i], total); ! poly.verts[i+1][3] = s; ! poly.verts[i+1][4] = t; ! } ! Math3D.VectorScale(total, (1.0f/numverts), poly.verts[0]); ! poly.verts[0][3] = total_s/numverts; ! poly.verts[0][4] = total_t/numverts; ! // memcpy (poly.verts[i+1], poly.verts[1], sizeof(poly.verts[0])); ! System.arraycopy(poly.verts[1], 0, poly.verts[i+1], 0, poly.verts[1].length); // :-) ! ! precompilePolygon(poly); } --- 191,230 ---- // init polys ! glpoly_t poly = Polygon.create(numverts + 2); poly.next = warpface.polys; warpface.polys = poly; Math3D.VectorClear(total); total_s = 0; total_t = 0; ! for (i = 0; i < numverts; i++) { ! poly.x(i + 1, verts[i][0]); ! poly.y(i + 1, verts[i][1]); ! poly.z(i + 1, verts[i][2]); ! s = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[0]); ! t = Math3D.DotProduct(verts[i], warpface.texinfo.vecs[1]); ! total_s += s; ! total_t += t; ! Math3D.VectorAdd(total, verts[i], total); ! poly.s1(i + 1, s); ! poly.t1(i + 1, t); ! } ! ! float scale = 1.0f / numverts; ! poly.x(0, total[0] * scale); ! poly.y(0, total[1] * scale); ! poly.z(0, total[2] * scale); ! poly.s1(0, total_s * scale); ! poly.t1(0, total_t * scale); ! poly.x(i + 1, poly.x(1)); ! poly.y(i + 1, poly.y(1)); ! poly.z(i + 1, poly.z(1)); ! poly.s1(i + 1, poly.s1(1)); ! poly.t1(i + 1, poly.t1(1)); ! poly.s2(i + 1, poly.s2(1)); ! poly.t2(i + 1, poly.t2(1)); } *************** *** 236,268 **** ================ */ ! void GL_SubdivideSurface(msurface_t fa) ! { ! float[][] verts = new float[64][3]; ! ! int numverts; ! int i; ! int lindex; ! float[] vec; ! ! warpface = fa; ! ! // ! // convert edges back to a normal polygon ! // ! numverts = 0; ! for (i=0 ; i < fa.numedges ; i++) ! { ! lindex = loadmodel.surfedges[fa.firstedge + i]; ! if (lindex > 0) ! vec = loadmodel.vertexes[loadmodel.edges[lindex].v[0]].position; ! else ! vec = loadmodel.vertexes[loadmodel.edges[-lindex].v[1]].position; ! Math3D.VectorCopy(vec, verts[numverts]); ! numverts++; ! } ! SubdividePolygon(numverts, verts); ! } // ========================================================= --- 238,263 ---- ================ */ ! float[][] tmpVerts = new float[64][3]; ! void GL_SubdivideSurface(msurface_t fa) { ! float[][] verts = tmpVerts; ! float[] vec; ! warpface = fa; ! // ! // convert edges back to a normal polygon ! // ! int numverts = 0; ! for (int i = 0; i < fa.numedges; i++) { ! int lindex = loadmodel.surfedges[fa.firstedge + i]; ! if (lindex > 0) ! vec = loadmodel.vertexes[loadmodel.edges[lindex].v[0]].position; ! else ! vec = loadmodel.vertexes[loadmodel.edges[-lindex].v[1]].position; ! Math3D.VectorCopy(vec, verts[numverts]); ! numverts++; ! } ! SubdividePolygon(numverts, verts); ! } // ========================================================= *************** *** 300,329 **** scroll = 0; ! int index; ! FloatBuffer texCoord = globalPolygonInterleavedBuf; ! for (bp=fa.polys ; bp != null ; bp=bp.next) ! { ! p = bp; ! index = p.pos * POLYGON_STRIDE; ! for (i=0; i<p.numverts ; i++) ! { ! v = p.verts[i]; ! os = v[3]; ! ot = v[4]; ! s = os + Warp.SIN[(int)((ot * 0.125f + r_newrefdef.time) * TURBSCALE) & 255]; ! s += scroll; ! s *= (1.0f/64); ! t = ot + Warp.SIN[(int)((os * 0.125f + rdt) * TURBSCALE) & 255]; ! t *= (1.0f/64); ! texCoord.put(index, s); ! texCoord.put(index + 1, t); ! index += POLYGON_STRIDE; ! } ! gl.glDrawArrays(GL11.GL_TRIANGLE_FAN, p.pos, p.numverts); ! } } --- 295,320 ---- scroll = 0; ! for (bp = fa.polys; bp != null; bp = bp.next) { ! p = bp; ! gl.glBegin(GL11.GL_TRIANGLE_FAN); ! for (i = 0; i < p.numverts; i++) { ! os = p.s1(i); ! ot = p.t1(i); ! s = os ! + Warp.SIN[(int) ((ot * 0.125f + r_newrefdef.time) * TURBSCALE) & 255]; ! s += scroll; ! s *= (1.0f / 64); ! t = ot ! + Warp.SIN[(int) ((os * 0.125f + rdt) * TURBSCALE) & 255]; ! t *= (1.0f / 64); ! gl.glTexCoord2f(s, t); ! gl.glVertex3f(p.x(i), p.y(i), p.z(i)); ! } ! gl.glEnd(); ! } } *************** *** 555,571 **** void R_AddSkySurface(msurface_t fa) { ! int i; ! glpoly_t p; ! ! // calculate vertex values for sky box ! for (p=fa.polys ; p != null ; p=p.next) ! { ! for (i=0 ; i < p.numverts ; i++) ! { ! Math3D.VectorSubtract(p.verts[i], r_origin, verts[i]); ! } ! ClipSkyPolygon (p.numverts, verts, 0); ! } ! } --- 546,559 ---- void R_AddSkySurface(msurface_t fa) { ! // calculate vertex values for sky box ! for (glpoly_t p = fa.polys; p != null; p = p.next) { ! for (int i = 0; i < p.numverts; i++) { ! verts[i][0] = p.x(i) - r_origin[0]; ! verts[i][1] = p.y(i) - r_origin[1]; ! verts[i][2] = p.z(i) - r_origin[2]; ! } ! ClipSkyPolygon(p.numverts, verts, 0); ! } ! } *************** *** 577,583 **** void R_ClearSkyBox() { ! int i; ! ! for (i=0 ; i<6 ; i++) { skymins[0][i] = skymins[1][i] = 9999; --- 565,569 ---- void R_ClearSkyBox() { ! for (int i=0 ; i<6 ; i++) { skymins[0][i] = skymins[1][i] = 9999; *************** *** 728,732 **** } } - - } --- 714,716 ---- Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Surf.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** Surf.java 16 Dec 2004 21:55:58 -0000 1.4 --- Surf.java 16 Jan 2005 21:21:08 -0000 1.4.2.1 *************** *** 27,49 **** import jake2.Defines; ! import jake2.client.dlight_t; ! import jake2.client.entity_t; ! import jake2.client.lightstyle_t; import jake2.game.cplane_t; import jake2.qcommon.Com; ! import jake2.render.glpoly_t; ! import jake2.render.image_t; ! import jake2.render.medge_t; ! import jake2.render.mleaf_t; ! import jake2.render.mnode_t; ! import jake2.render.model_t; ! import jake2.render.msurface_t; ! import jake2.render.mtexinfo_t; import jake2.util.Lib; import jake2.util.Math3D; ! import java.nio.ByteOrder; ! import java.nio.FloatBuffer; ! import java.nio.IntBuffer; import java.util.Arrays; --- 27,38 ---- import jake2.Defines; ! import jake2.client.*; import jake2.game.cplane_t; import jake2.qcommon.Com; ! import jake2.render.*; import jake2.util.Lib; import jake2.util.Math3D; ! import java.nio.*; import java.util.Arrays; *************** *** 175,187 **** if(scroll == 0.0f) scroll = -64.0f; ! ! FloatBuffer texCoord = globalPolygonInterleavedBuf; ! float[][] v = p.verts; ! int index = p.pos * POLYGON_STRIDE; ! for (i=0 ; i<p.numverts ; i++) { ! texCoord.put(index, v[i][3] + scroll); ! index += POLYGON_STRIDE; ! } gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); } // PGM --- 164,170 ---- if(scroll == 0.0f) scroll = -64.0f; ! p.beginScrolling(scroll); gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); + p.endScrolling(); } // PGM *************** *** 193,235 **** void R_DrawTriangleOutlines() { ! int i, j; ! glpoly_t p; ! ! if (gl_showtris.value == 0) ! return; ! ! gl.glDisable (GL11.GL_TEXTURE_2D); ! gl.glDisable (GL11.GL_DEPTH_TEST); ! gl.glColor4f (1,1,1,1); ! for (i=0 ; i<MAX_LIGHTMAPS ; i++) ! { ! msurface_t surf; ! for ( surf = gl_lms.lightmap_surfaces[i]; surf != null; surf = surf.lightmapchain ) ! { ! p = surf.polys; ! for ( ; p != null ; p=p.chain) ! { ! for (j=2 ; j<p.numverts ; j++ ) ! { ! float[] pverts0=p.verts[0]; ! float[] pvertsjm1=p.verts[j-1]; ! float[] pvertsj=p.verts[j]; ! ! ! gl.glBegin (GL11.GL_LINE_STRIP); ! gl.glVertex3f (pverts0[0],pverts0[1],pverts0[2]); ! gl.glVertex3f (pvertsjm1[0],pvertsjm1[1],pvertsjm1[2]); ! gl.glVertex3f (pvertsj[0],pvertsj[1],pvertsj[2]); ! gl.glVertex3f (pverts0[0],pverts0[1],pverts0[2]); ! gl.glEnd (); ! } ! } ! } ! } ! gl.glEnable (GL11.GL_DEPTH_TEST); ! gl.glEnable (GL11.GL_TEXTURE_2D); } --- 176,203 ---- void R_DrawTriangleOutlines() { ! if (gl_showtris.value == 0) ! return; ! gl.glDisable(GL11.GL_TEXTURE_2D); ! gl.glDisable(GL11.GL_DEPTH_TEST); ! gl.glColor4f(1, 1, 1, 1); ! for (int i = 0; i < MAX_LIGHTMAPS; i++) { ! for (msurface_t surf = gl_lms.lightmap_surfaces[i]; surf != null; surf = surf.lightmapchain) { ! for (glpoly_t p = surf.polys; p != null; p = p.chain) { ! for (int j = 2; j < p.numverts; j++) { ! gl.glBegin(GL11.GL_LINE_STRIP); ! gl.glVertex3f(p.x(0), p.y(0), p.z(0)); ! gl.glVertex3f(p.x(j-1), p.y(j-1), p.z(j-1)); ! gl.glVertex3f(p.x(j), p.y(j), p.z(j)); ! gl.glVertex3f(p.x(0), p.y(0), p.z(0)); ! gl.glEnd(); ! } ! } ! } ! } ! gl.glEnable(GL11.GL_DEPTH_TEST); ! gl.glEnable(GL11.GL_TEXTURE_2D); } *************** *** 376,380 **** intens = gl_state.inverse_intensity; ! gl.glInterleavedArrays(GL11.GL_T2F_V3F, POLYGON_BYTE_STRIDE, globalPolygonInterleavedBuf); for (s=r_alpha_surfaces ; s != null ; s=s.texturechain) --- 344,348 ---- intens = gl_state.inverse_intensity; ! gl.glInterleavedArrays(GL11.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); for (s=r_alpha_surfaces ; s != null ; s=s.texturechain) *************** *** 558,568 **** for ( p = surf.polys; p != null; p = p.chain ) { ! v = p.verts; ! index = p.pos * POLYGON_STRIDE; ! for (i=0 ; i<p.numverts ; i++) { ! texCoord.put(index, v[i][3] + scroll); ! index += POLYGON_STRIDE; ! } gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); } } --- 526,532 ---- for ( p = surf.polys; p != null; p = p.chain ) { ! p.beginScrolling(scroll); gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); + p.endScrolling(); } } *************** *** 596,606 **** for ( p = surf.polys; p != null; p = p.chain ) { ! v = p.verts; ! index = p.pos * POLYGON_STRIDE; ! for (i=0 ; i<p.numverts ; i++) { ! texCoord.put(index, v[i][3] + scroll); ! index += POLYGON_STRIDE; ! } gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); } } --- 560,566 ---- for ( p = surf.polys; p != null; p = p.chain ) { ! p.beginScrolling(scroll); gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); + p.endScrolling(); } } *************** *** 767,774 **** GL_SelectTexture(GL_TEXTURE0); GL_TexEnv( GL11.GL_REPLACE ); ! gl.glInterleavedArrays(GL11.GL_T2F_V3F, POLYGON_BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture(GL_TEXTURE1); GL_TexEnv( GL11.GL_MODULATE ); ! gl.glTexCoordPointer(2, POLYGON_BYTE_STRIDE, globalPolygonTexCoord1Buf); gl.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); --- 727,734 ---- GL_SelectTexture(GL_TEXTURE0); GL_TexEnv( GL11.GL_REPLACE ); ! gl.glInterleavedArrays(GL11.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture(GL_TEXTURE1); GL_TexEnv( GL11.GL_MODULATE ); ! gl.glTexCoordPointer(2, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); gl.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); *************** *** 957,963 **** GL_SelectTexture( GL_TEXTURE0); GL_TexEnv( GL11.GL_REPLACE ); ! gl.glInterleavedArrays(GL11.GL_T2F_V3F, POLYGON_BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture( GL_TEXTURE1); ! gl.glTexCoordPointer(2, POLYGON_BYTE_STRIDE, globalPolygonTexCoord1Buf); gl.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); --- 917,923 ---- GL_SelectTexture( GL_TEXTURE0); GL_TexEnv( GL11.GL_REPLACE ); ! gl.glInterleavedArrays(GL11.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture( GL_TEXTURE1); ! gl.glTexCoordPointer(2, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); gl.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); *************** *** 1183,1187 **** float[] vec; float s, t; - glpoly_t poly; float[] total = {0, 0, 0}; --- 1143,1146 ---- *************** *** 1196,1205 **** // // poly = Hunk_Alloc (sizeof(glpoly_t) + (lnumverts-4) * VERTEXSIZE*sizeof(float)); ! poly = new glpoly_t(lnumverts); poly.next = fa.polys; poly.flags = fa.flags; fa.polys = poly; - poly.numverts = lnumverts; for (i=0 ; i<lnumverts ; i++) --- 1155,1163 ---- // // poly = Hunk_Alloc (sizeof(glpoly_t) + (lnumverts-4) * VERTEXSIZE*sizeof(float)); ! glpoly_t poly = Polygon.create(lnumverts); poly.next = fa.polys; poly.flags = fa.flags; fa.polys = poly; for (i=0 ; i<lnumverts ; i++) *************** *** 1224,1230 **** Math3D.VectorAdd (total, vec, total); ! Math3D.VectorCopy (vec, poly.verts[i]); ! poly.verts[i][3] = s; ! poly.verts[i][4] = t; // --- 1182,1191 ---- Math3D.VectorAdd (total, vec, total); ! poly.x(i, vec[0]); ! poly.y(i, vec[1]); ! poly.z(i, vec[2]); ! ! poly.s1(i, s); ! poly.t1(i, t); // *************** *** 1243,1254 **** t /= BLOCK_HEIGHT*16; //fa.texinfo.texture.height; ! poly.verts[i][5] = s; ! poly.verts[i][6] = t; } - - poly.numverts = lnumverts; - - precompilePolygon(poly); - } --- 1204,1210 ---- t /= BLOCK_HEIGHT*16; //fa.texinfo.texture.height; ! poly.s2(i, s); ! poly.t2(i, t); } } *************** *** 1414,1461 **** /* ! * new functions for vertex array handling */ ! static final int POLYGON_BUFFER_SIZE = 120000; ! static final int POLYGON_STRIDE = 7; ! static final int POLYGON_BYTE_STRIDE = POLYGON_STRIDE * Lib.SIZEOF_FLOAT; ! ! static FloatBuffer globalPolygonInterleavedBuf = BufferUtils.createFloatBuffer(POLYGON_BUFFER_SIZE * 7); static FloatBuffer globalPolygonTexCoord1Buf = null; static { ! globalPolygonInterleavedBuf.position(POLYGON_STRIDE - 2); globalPolygonTexCoord1Buf = globalPolygonInterleavedBuf.slice(); globalPolygonInterleavedBuf.position(0); }; - void precompilePolygon(glpoly_t p) { - - p.pos = globalPolygonInterleavedBuf.position() / POLYGON_STRIDE; - - float[] v; - FloatBuffer buffer = globalPolygonInterleavedBuf; - - for (int i = 0; i < p.verts.length; i++) { - v = p.verts[i]; - // textureCoord0 - buffer.put(v[3]); - buffer.put(v[4]); - - // vertex - buffer.put(v[0]); - buffer.put(v[1]); - buffer.put(v[2]); - - // textureCoord1 - buffer.put(v[5]); - buffer.put(v[6]); - } - } - - public static void resetPolygonArrays() { - globalPolygonInterleavedBuf.rewind(); - globalPolygonTexCoord1Buf.rewind(); - } - //ImageFrame frame; --- 1370,1384 ---- /* ! * new buffers for vertex array handling */ ! static FloatBuffer globalPolygonInterleavedBuf = Polygon.getInterleavedBuffer(); static FloatBuffer globalPolygonTexCoord1Buf = null; static { ! globalPolygonInterleavedBuf.position(Polygon.STRIDE - 2); globalPolygonTexCoord1Buf = globalPolygonInterleavedBuf.slice(); globalPolygonInterleavedBuf.position(0); }; //ImageFrame frame; --- NEW FILE: Polygon.java --- /* * Polygon.java * Copyright (C) 2003 * * $Id: Polygon.java,v 1.2.2.1 2005/01/16 21:21:08 salomo 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.lwjgl; import jake2.render.glpoly_t; import jake2.util.Lib; import java.nio.FloatBuffer; /** * Polygon * * @author cwei */ public final class Polygon extends glpoly_t { private final static int MAX_POLYS = 20000; private final static int MAX_BUFFER_VERTICES = 120000; // backup for s1 scrolling private static float[] s1_old = new float[MAX_VERTICES]; private static FloatBuffer buffer = Lib.newFloatBuffer(MAX_BUFFER_VERTICES * STRIDE); private static int bufferIndex = 0; private static int polyCount = 0; private static Polygon[] polyCache = new Polygon[MAX_POLYS]; static { for (int i = 0; i < polyCache.length; i++) { polyCache[i] = new Polygon(); } } static glpoly_t create(int numverts) { Polygon poly = polyCache[polyCount++]; poly.clear(); poly.numverts = numverts; poly.pos = bufferIndex; bufferIndex += numverts; return poly; } static void reset() { polyCount = 0; bufferIndex = 0; } static FloatBuffer getInterleavedBuffer() { return (FloatBuffer)buffer.rewind(); } private Polygon() { } private final void clear() { next = null; chain = null; numverts = 0; flags = 0; } // the interleaved buffer has the format: // textureCoord0 (index 0, 1) // vertex (index 2, 3, 4) // textureCoord1 (index 5, 6) public final float x(int index) { return buffer.get((index + pos) * 7 + 2); } public final void x(int index, float value) { buffer.put((index + pos) * 7 + 2, value); } public final float y(int index) { return buffer.get((index + pos) * 7 + 3); } public final void y(int index, float value) { buffer.put((index + pos) * 7 + 3, value); } public final float z(int index) { return buffer.get((index + pos) * 7 + 4); } public final void z(int index, float value) { buffer.put((index + pos) * 7 + 4, value); } public final float s1(int index) { return buffer.get((index + pos) * 7 + 0); } public final void s1(int index, float value) { buffer.put((index + pos) * 7 + 0, value); } public final float t1(int index) { return buffer.get((index + pos) * 7 + 1); } public final void t1(int index, float value) { buffer.put((index + pos) * 7 + 1, value); } public final float s2(int index) { return buffer.get((index + pos) * 7 + 5); } public final void s2(int index, float value) { buffer.put((index + pos) * 7 + 5, value); } public final float t2(int index) { return buffer.get((index + pos) * 7 + 6); } public final void t2(int index, float value) { buffer.put((index + pos) * 7 + 6, value); } public final void beginScrolling(float scroll) { int index = pos * 7; for (int i = 0; i < numverts; i++, index+=7) { scroll += s1_old[i] = buffer.get(index); buffer.put(index, scroll); } } public final void endScrolling() { int index = pos * 7; for (int i = 0; i < numverts; i++, index+=7) { buffer.put(index, s1_old[i]); } } } Index: Model.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Model.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** Model.java 16 Dec 2004 21:55:58 -0000 1.3 --- Model.java 16 Jan 2005 21:21:08 -0000 1.3.2.1 *************** *** 30,54 **** import jake2.game.cplane_t; import jake2.game.cvar_t; ! import jake2.qcommon.Com; ! import jake2.qcommon.Cvar; ! import jake2.qcommon.FS; ! 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; ! import java.nio.ByteBuffer; ! import java.nio.ByteOrder; ! import java.nio.FloatBuffer; ! import java.nio.IntBuffer; import java.util.Arrays; import java.util.Vector; --- 30,39 ---- 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.*; import java.util.Arrays; import java.util.Vector; *************** *** 1173,1178 **** { resetModelArrays(); ! resetPolygonArrays(); ! cvar_t flushmap; --- 1158,1163 ---- { resetModelArrays(); ! Polygon.reset(); ! cvar_t flushmap; *************** *** 1262,1267 **** } GL_FreeUnusedImages(); - resetPolygonArrays(); - //modelMemoryUsage(); } --- 1247,1250 ---- |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:54
|
Update of /cvsroot/jake2/jake2/lib/lwjgl/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/lib/lwjgl/windows Modified Files: Tag: RST lwjgl.dll Log Message: This has vec3-optimize and the OAK bot. Index: lwjgl.dll =================================================================== RCS file: /cvsroot/jake2/jake2/lib/lwjgl/windows/lwjgl.dll,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 Binary files /tmp/cvsnJYUNZ and /tmp/cvsEMD7jn differ |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:53
|
Update of /cvsroot/jake2/jake2/lib/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/lib/lwjgl Modified Files: Tag: RST lwjgl.jar lwjgl_util.jar Log Message: This has vec3-optimize and the OAK bot. Index: lwjgl.jar =================================================================== RCS file: /cvsroot/jake2/jake2/lib/lwjgl/lwjgl.jar,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 Binary files /tmp/cvs7G40lx and /tmp/cvsHtPxRT differ Index: lwjgl_util.jar =================================================================== RCS file: /cvsroot/jake2/jake2/lib/lwjgl/lwjgl_util.jar,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 Binary files /tmp/cvsbxvy1F and /tmp/cvsbYR6m3 differ |