From: Carsten W. <ca...@us...> - 2005-02-01 16:55:17
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17956/src/jake2/render/lwjgl Modified Files: Mesh.java Log Message: a little bit faster Index: Mesh.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Mesh.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Mesh.java 22 Jan 2005 22:28:15 -0000 1.4 --- Mesh.java 1 Feb 2005 16:55:07 -0000 1.5 *************** *** 82,85 **** --- 82,86 ---- int[] vv; FloatBuffer lerp = vertexArrayBuf; + lerp.limit((nverts << 2) - nverts); // nverts * 3 //PMM -- added RF_SHELL_DOUBLE, RF_SHELL_HALF_DAM *************** *** 87,91 **** { float[] normal; ! int j = 0; for (int i=0 ; i < nverts; i++/* , v++, ov++, lerp+=4 */) { --- 88,92 ---- { float[] normal; ! int j = -1; for (int i=0 ; i < nverts; i++/* , v++, ov++, lerp+=4 */) { *************** *** 94,105 **** vv = verts[i].v; ! lerp.put(j++, move[0] + ovv[0]*backv[0] + vv[0]*frontv[0] + normal[0] * Defines.POWERSUIT_SCALE); ! lerp.put(j++, move[1] + ovv[1]*backv[1] + vv[1]*frontv[1] + normal[1] * Defines.POWERSUIT_SCALE); ! lerp.put(j++, move[2] + ovv[2]*backv[2] + vv[2]*frontv[2] + normal[2] * Defines.POWERSUIT_SCALE); } } else { ! int j = 0; for (int i=0 ; i < nverts; i++ /* , v++, ov++, lerp+=4 */) { --- 95,106 ---- vv = verts[i].v; ! lerp.put(++j, move[0] + ovv[0]*backv[0] + vv[0]*frontv[0] + normal[0] * Defines.POWERSUIT_SCALE); ! lerp.put(++j, move[1] + ovv[1]*backv[1] + vv[1]*frontv[1] + normal[1] * Defines.POWERSUIT_SCALE); ! lerp.put(++j, move[2] + ovv[2]*backv[2] + vv[2]*frontv[2] + normal[2] * Defines.POWERSUIT_SCALE); } } else { ! int j = -1; for (int i=0 ; i < nverts; i++ /* , v++, ov++, lerp+=4 */) { *************** *** 107,113 **** vv = verts[i].v; ! lerp.put(j++, move[0] + ovv[0]*backv[0] + vv[0]*frontv[0]); ! lerp.put(j++, move[1] + ovv[1]*backv[1] + vv[1]*frontv[1]); ! lerp.put(j++, move[2] + ovv[2]*backv[2] + vv[2]*frontv[2]); } } --- 108,114 ---- vv = verts[i].v; ! lerp.put(++j, move[0] + ovv[0]*backv[0] + vv[0]*frontv[0]); ! lerp.put(++j, move[1] + ovv[1]*backv[1] + vv[1]*frontv[1]); ! lerp.put(++j, move[2] + ovv[2]*backv[2] + vv[2]*frontv[2]); } } *************** *** 193,205 **** // FloatBuffer color = colorArrayBuf; ! int j = 0; float l; ! for (int i = 0; i < paliashdr.num_xyz; i++ ) { l = shadedots[verts[i].lightnormalindex]; ! color.put(j++, l * shadelight[0]); ! color.put(j++, l * shadelight[1]); ! color.put(j++, l * shadelight[2]); ! color.put(j++, alpha); } } --- 194,207 ---- // FloatBuffer color = colorArrayBuf; ! int j = -1; float l; ! int size = paliashdr.num_xyz; ! for (int i = 0; i < size; i++ ) { l = shadedots[verts[i].lightnormalindex]; ! color.put(++j, l * shadelight[0]); ! color.put(++j, l * shadelight[1]); ! color.put(++j, l * shadelight[2]); ! color.put(++j, alpha); } } *************** *** 220,224 **** int srcIndex = 0; int count; ! for (int j = 0; j < counts.length; j++) { // get the vertex count and primitive type --- 222,228 ---- int srcIndex = 0; int count; ! int mode; ! int size = counts.length; ! for (int j = 0; j < size; j++) { // get the vertex count and primitive type *************** *** 229,233 **** srcIndexBuf = paliashdr.indexElements[j]; ! int mode = GL11.GL_TRIANGLE_STRIP; if (count < 0) { mode = GL11.GL_TRIANGLE_FAN; --- 233,237 ---- srcIndexBuf = paliashdr.indexElements[j]; ! mode = GL11.GL_TRIANGLE_STRIP; if (count < 0) { mode = GL11.GL_TRIANGLE_FAN; *************** *** 235,242 **** } srcIndex = pos << 1; for (int k = 0; k < count; k++) { dstIndex = srcIndexBuf.get(k) << 1; ! dstTextureCoords.put(dstIndex++, srcTextureCoords.get(srcIndex++)); ! dstTextureCoords.put(dstIndex, srcTextureCoords.get(srcIndex++)); } --- 239,247 ---- } srcIndex = pos << 1; + srcIndex--; for (int k = 0; k < count; k++) { dstIndex = srcIndexBuf.get(k) << 1; ! dstTextureCoords.put(dstIndex, srcTextureCoords.get(++srcIndex)); ! dstTextureCoords.put(++dstIndex, srcTextureCoords.get(++srcIndex)); } |