From: Carsten W. <ca...@us...> - 2005-05-07 22:15:29
|
Update of /cvsroot/jake2/jake2/src/jake2/render/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13283/src/jake2/render/jogl 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/jogl/Mesh.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Mesh.java 8 Apr 2005 14:05:34 -0000 1.8 --- Mesh.java 7 May 2005 22:15:04 -0000 1.9 *************** *** 85,95 **** for (i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */ ) { ! normal = r_avertexnormals[verts[i].lightnormalindex]; ! lerp[i][0] = move[0] + ov[i].v[0] * backv[0] + v[i].v[0] * frontv[0] + normal[0] * Defines.POWERSUIT_SCALE; ! lerp[i][1] = move[1] + ov[i].v[1] * backv[1] + v[i].v[1] * frontv[1] + normal[1] * Defines.POWERSUIT_SCALE; ! lerp[i][2] = move[2] + ov[i].v[2] * backv[2] + v[i].v[2] * frontv[2] + normal[2] * Defines.POWERSUIT_SCALE; } --- 85,95 ---- for (i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */ ) { ! normal = r_avertexnormals[verts[i].lightnormalindex()]; ! lerp[i][0] = move[0] + ov[i].v0() * backv[0] + v[i].v0() * frontv[0] + normal[0] * Defines.POWERSUIT_SCALE; ! lerp[i][1] = move[1] + ov[i].v1() * backv[1] + v[i].v1() * frontv[1] + normal[1] * Defines.POWERSUIT_SCALE; ! lerp[i][2] = move[2] + ov[i].v2() * backv[2] + v[i].v2() * frontv[2] + normal[2] * Defines.POWERSUIT_SCALE; } *************** *** 97,105 **** for (i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */ ) { ! lerp[i][0] = move[0] + ov[i].v[0] * backv[0] + v[i].v[0] * frontv[0]; ! lerp[i][1] = move[1] + ov[i].v[1] * backv[1] + v[i].v[1] * frontv[1]; ! lerp[i][2] = move[2] + ov[i].v[2] * backv[2] + v[i].v[2] * frontv[2]; } --- 97,105 ---- for (i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */ ) { ! lerp[i][0] = move[0] + ov[i].v0() * backv[0] + v[i].v0() * frontv[0]; ! lerp[i][1] = move[1] + ov[i].v1() * backv[1] + v[i].v1() * frontv[1]; ! lerp[i][2] = move[2] + ov[i].v2() * backv[2] + v[i].v2() * frontv[2]; } *************** *** 112,117 **** int lerpIndex = 0; ! int[] ovv; ! int[] vv; FloatBuffer lerp = vertexArrayBuf; --- 112,116 ---- int lerpIndex = 0; ! qfiles.dtrivertx_t ovv, vv; FloatBuffer lerp = vertexArrayBuf; *************** *** 124,136 **** for (int i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */ ) { ! normal = r_avertexnormals[verts[i].lightnormalindex]; ! ovv = ov[i].v; ! vv = v[i].v; ! lerp.put(j, move[0] + ovv[0] * backv[0] + vv[0] * frontv[0] + normal[0] * Defines.POWERSUIT_SCALE); ! lerp.put(j + 1, move[1] + ovv[1] * backv[1] + vv[1] * frontv[1] + normal[1] * Defines.POWERSUIT_SCALE); ! lerp.put(j + 2, move[2] + ovv[2] * backv[2] + vv[2] * frontv[2] + normal[2] * Defines.POWERSUIT_SCALE); j += 3; --- 123,135 ---- for (int i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */ ) { ! normal = r_avertexnormals[verts[i].lightnormalindex()]; ! ovv = ov[i]; ! vv = v[i]; ! lerp.put(j, move[0] + ovv.v0() * backv[0] + vv.v0() * frontv[0] + normal[0] * Defines.POWERSUIT_SCALE); ! lerp.put(j + 1, move[1] + ovv.v1() * backv[1] + vv.v1() * frontv[1] + normal[1] * Defines.POWERSUIT_SCALE); ! lerp.put(j + 2, move[2] + ovv.v2() * backv[2] + vv.v2() * frontv[2] + normal[2] * Defines.POWERSUIT_SCALE); j += 3; *************** *** 140,152 **** for (int i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */ ) { ! ovv = ov[i].v; ! vv = v[i].v; ! lerp.put(j, move[0] + ovv[0] * backv[0] + vv[0] * frontv[0]); lerp ! .put(j + 1, move[1] + ovv[1] * backv[1] + vv[1] * frontv[1]); lerp ! .put(j + 2, move[2] + ovv[2] * backv[2] + vv[2] * frontv[2]); j += 3; --- 139,151 ---- for (int i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */ ) { ! ovv = ov[i]; ! vv = v[i]; ! lerp.put(j, move[0] + ovv.v0() * backv[0] + vv.v0() * frontv[0]); lerp ! .put(j + 1, move[1] + ovv.v1() * backv[1] + vv.v1() * frontv[1]); lerp ! .put(j + 2, move[2] + ovv.v2() * backv[2] + vv.v2() * frontv[2]); j += 3; *************** *** 259,263 **** int j = 0; for (i = 0; i < paliashdr.num_xyz; i++) { ! l = shadedots[verts[i].lightnormalindex]; color.put(j++, l * shadelight[0]); color.put(j++, l * shadelight[1]); --- 258,262 ---- int j = 0; for (i = 0; i < paliashdr.num_xyz; i++) { ! l = shadedots[verts[i].lightnormalindex()]; color.put(j++, l * shadelight[0]); color.put(j++, l * shadelight[1]); *************** *** 359,363 **** // normals and vertexes come from the frame list ! l = shadedots[verts[index_xyz].lightnormalindex]; gl.glColor4f(l * shadelight[0], l * shadelight[1], l --- 358,362 ---- // normals and vertexes come from the frame list ! l = shadedots[verts[index_xyz].lightnormalindex()]; gl.glColor4f(l * shadelight[0], l * shadelight[1], l |