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 |