Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13283/src/jake2/render/fastjogl
Modified Files:
Mesh.java
Log Message:
this reduces the memory footprint massive;
you can now run city3 with 90MB heap
Index: Mesh.java
===================================================================
RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Mesh.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Mesh.java 22 Jan 2005 22:30:35 -0000 1.8
--- Mesh.java 7 May 2005 22:15:05 -0000 1.9
***************
*** 75,80 ****
qfiles.dtrivertx_t[] verts, float[] move, float[] frontv,
float[] backv) {
! int[] ovv;
! int[] vv;
FloatBuffer lerp = vertexArrayBuf;
--- 75,79 ----
qfiles.dtrivertx_t[] verts, float[] move, float[] frontv,
float[] backv) {
! qfiles.dtrivertx_t ovv, vv;
FloatBuffer lerp = vertexArrayBuf;
***************
*** 87,99 ****
for (int i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */
) {
! normal = r_avertexnormals[verts[i].lightnormalindex];
! ovv = ov[i].v;
! vv = verts[i].v;
! lerp.put(j++, move[0] + ovv[0] * backv[0] + vv[0] * frontv[0]
+ normal[0] * Defines.POWERSUIT_SCALE);
! lerp.put(j++, move[1] + ovv[1] * backv[1] + vv[1] * frontv[1]
+ normal[1] * Defines.POWERSUIT_SCALE);
! lerp.put(j++, move[2] + ovv[2] * backv[2] + vv[2] * frontv[2]
+ normal[2] * Defines.POWERSUIT_SCALE);
}
--- 86,98 ----
for (int i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */
) {
! normal = r_avertexnormals[verts[i].lightnormalindex()];
! ovv = ov[i];
! vv = verts[i];
! lerp.put(j++, move[0] + ovv.v0() * backv[0] + vv.v0() * frontv[0]
+ normal[0] * Defines.POWERSUIT_SCALE);
! lerp.put(j++, move[1] + ovv.v1() * backv[1] + vv.v1() * frontv[1]
+ normal[1] * Defines.POWERSUIT_SCALE);
! lerp.put(j++, move[2] + ovv.v2() * backv[2] + vv.v2() * frontv[2]
+ normal[2] * Defines.POWERSUIT_SCALE);
}
***************
*** 102,111 ****
for (int i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */
) {
! ovv = ov[i].v;
! vv = verts[i].v;
! lerp.put(j++, move[0] + ovv[0] * backv[0] + vv[0] * frontv[0]);
! lerp.put(j++, move[1] + ovv[1] * backv[1] + vv[1] * frontv[1]);
! lerp.put(j++, move[2] + ovv[2] * backv[2] + vv[2] * frontv[2]);
}
}
--- 101,110 ----
for (int i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */
) {
! ovv = ov[i];
! vv = verts[i];
! lerp.put(j++, move[0] + ovv.v0() * backv[0] + vv.v0() * frontv[0]);
! lerp.put(j++, move[1] + ovv.v1() * backv[1] + vv.v1() * frontv[1]);
! lerp.put(j++, move[2] + ovv.v2() * backv[2] + vv.v2() * frontv[2]);
}
}
***************
*** 207,211 ****
float l;
for (int i = 0; i < paliashdr.num_xyz; i++) {
! l = shadedots[verts[i].lightnormalindex];
color.put(j++, l * shadelight[0]);
color.put(j++, l * shadelight[1]);
--- 206,210 ----
float l;
for (int i = 0; i < paliashdr.num_xyz; i++) {
! l = shadedots[verts[i].lightnormalindex()];
color.put(j++, l * shadelight[0]);
color.put(j++, l * shadelight[1]);
|