diff options
Diffstat (limited to 'src/jake2/render/lwjgl')
-rw-r--r-- | src/jake2/render/lwjgl/Mesh.java | 14 | ||||
-rw-r--r-- | src/jake2/render/lwjgl/Model.java | 3 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/jake2/render/lwjgl/Mesh.java b/src/jake2/render/lwjgl/Mesh.java index 658e2fd..6bb8f95 100644 --- a/src/jake2/render/lwjgl/Mesh.java +++ b/src/jake2/render/lwjgl/Mesh.java @@ -2,7 +2,7 @@ * Mesh.java * Copyright (C) 2003 * - * $Id: Mesh.java,v 1.3 2005-01-17 17:06:08 cawe Exp $ + * $Id: Mesh.java,v 1.4 2005-01-22 22:28:15 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -216,7 +216,6 @@ public abstract class Mesh extends Light { FloatBuffer dstTextureCoords = textureArrayBuf; FloatBuffer srcTextureCoords = paliashdr.textureCoordBuf; - int size = 0; int dstIndex = 0; int srcIndex = 0; int count; @@ -234,19 +233,14 @@ public abstract class Mesh extends Light { mode = GL11.GL_TRIANGLE_FAN; count = -count; } - size = count + pos; - srcIndex = 2 * pos; - for (int k = pos; k < size; k++) { - dstIndex = 2 * srcIndexBuf.get(k-pos); + 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++)); } - int limit=srcIndexBuf.limit(); - srcIndexBuf.limit(count); gl.glDrawElements(mode, srcIndexBuf); - srcIndexBuf.limit(limit); - pos += count; } diff --git a/src/jake2/render/lwjgl/Model.java b/src/jake2/render/lwjgl/Model.java index 20eb452..d1907b7 100644 --- a/src/jake2/render/lwjgl/Model.java +++ b/src/jake2/render/lwjgl/Model.java @@ -2,7 +2,7 @@ * Model.java * Copyright (C) 2003 * - * $Id: Model.java,v 1.5 2005-01-10 00:12:00 cawe Exp $ + * $Id: Model.java,v 1.6 2005-01-22 22:28:15 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -1335,6 +1335,7 @@ public abstract class Model extends Surf { count = (count < 0) ? -count : count; model.vertexIndexBuf.position(pos); model.indexElements[i] = model.vertexIndexBuf.slice(); + model.indexElements[i].limit(count); pos += count; } } |