From: Carsten W. <ca...@us...> - 2005-01-10 00:05:32
|
Update of /cvsroot/jake2/jake2/src/jake2/render/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20852/src/jake2/render/jogl Modified Files: Warp.java Log Message: replaces the local float[][]; code clean up Index: Warp.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Warp.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Warp.java 9 Jan 2005 22:34:21 -0000 1.8 --- Warp.java 10 Jan 2005 00:05:23 -0000 1.9 *************** *** 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; *************** *** 206,210 **** total_t = 0; for (i = 0; i < numverts; i++) { - //Math3D.VectorCopy(verts[i], poly.verts[i + 1]); poly.x(i + 1, verts[i][0]); poly.y(i + 1, verts[i][1]); --- 204,207 ---- *************** *** 228,234 **** poly.t1(0, total_t * scale); - // 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); // :-) poly.x(i + 1, poly.x(1)); poly.y(i + 1, poly.y(1)); --- 225,228 ---- *************** *** 241,265 **** /* ! * ================ 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) --- 235,255 ---- /* ! * 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) *************** *** 270,274 **** numverts++; } - SubdividePolygon(numverts, verts); } --- 260,263 ---- *************** *** 520,533 **** /* ! * ================= 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]); verts[i][0] = p.x(i) - r_origin[0]; verts[i][1] = p.y(i) - r_origin[1]; --- 509,518 ---- /* ! * 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]; |