diff options
author | Carsten Weisse <[email protected]> | 2005-01-10 00:05:23 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2005-01-10 00:05:23 +0000 |
commit | 5776bf3a21d9ed5b9fe438c9bb79b8c5cba7ae31 (patch) | |
tree | c5e692376f9265ce0b35e4d781a566cfe52ba504 /src/jake2/render/lwjgl/Warp.java | |
parent | 16127433f99df634d924cf8d0ddff2e526fcdda1 (diff) |
replaces the local float[][];
code clean up
Diffstat (limited to 'src/jake2/render/lwjgl/Warp.java')
-rw-r--r-- | src/jake2/render/lwjgl/Warp.java | 70 |
1 files changed, 26 insertions, 44 deletions
diff --git a/src/jake2/render/lwjgl/Warp.java b/src/jake2/render/lwjgl/Warp.java index 1c96980..57e25d5 100644 --- a/src/jake2/render/lwjgl/Warp.java +++ b/src/jake2/render/lwjgl/Warp.java @@ -2,7 +2,7 @@ * Warp.java * Copyright (C) 2003 * - * $Id: Warp.java,v 1.3 2005-01-09 22:35:31 cawe Exp $ + * $Id: Warp.java,v 1.4 2005-01-10 00:05:22 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -28,15 +28,9 @@ package jake2.render.lwjgl; import jake2.Defines; import jake2.Globals; import jake2.qcommon.Com; -import jake2.render.glpoly_t; -import jake2.render.image_t; -import jake2.render.msurface_t; +import jake2.render.*; import jake2.util.Math3D; -import java.nio.FloatBuffer; - -import net.java.games.jogl.GL; - import org.lwjgl.opengl.GL11; /** @@ -225,7 +219,6 @@ public abstract class Warp extends Model { poly.s1(0, total_s * scale); poly.t1(0, total_t * scale); - // memcpy (poly.verts[i+1], poly.verts[1], sizeof(poly.verts[0])); poly.x(i + 1, poly.x(1)); poly.y(i + 1, poly.y(1)); poly.z(i + 1, poly.z(1)); @@ -244,35 +237,28 @@ public abstract class Warp extends Model { 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) - vec = loadmodel.vertexes[loadmodel.edges[lindex].v[0]].position; - else - vec = loadmodel.vertexes[loadmodel.edges[-lindex].v[1]].position; - Math3D.VectorCopy(vec, verts[numverts]); - numverts++; - } - - SubdividePolygon(numverts, verts); - } + 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) + vec = loadmodel.vertexes[loadmodel.edges[lindex].v[0]].position; + else + vec = loadmodel.vertexes[loadmodel.edges[-lindex].v[1]].position; + Math3D.VectorCopy(vec, verts[numverts]); + numverts++; + } + SubdividePolygon(numverts, verts); + } // ========================================================= @@ -559,7 +545,7 @@ public abstract class Warp extends Model { */ void R_AddSkySurface(msurface_t fa) { - // calculate vertex values for sky box + // 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]; @@ -578,9 +564,7 @@ public abstract class Warp extends Model { */ void R_ClearSkyBox() { - int i; - - for (i=0 ; i<6 ; i++) + for (int i=0 ; i<6 ; i++) { skymins[0][i] = skymins[1][i] = 9999; skymaxs[0][i] = skymaxs[1][i] = -9999; @@ -729,6 +713,4 @@ public abstract class Warp extends Model { } } } - - } |