aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2005-01-22 22:30:35 +0000
committerCarsten Weisse <[email protected]>2005-01-22 22:30:35 +0000
commitcb9b3075796ae9a522efdc84536de2e3f709ba5f (patch)
tree2b5dcff761c7c08ff21d13f85470578284ad18d9 /src/jake2
parent7bb01ab7abb251897a16ed43572b5fe22859a019 (diff)
simplified
Diffstat (limited to 'src/jake2')
-rw-r--r--src/jake2/render/fastjogl/Mesh.java10
-rw-r--r--src/jake2/render/fastjogl/Model.java3
-rw-r--r--src/jake2/render/lwjgl/Mesh.java14
-rw-r--r--src/jake2/render/lwjgl/Model.java3
4 files changed, 12 insertions, 18 deletions
diff --git a/src/jake2/render/fastjogl/Mesh.java b/src/jake2/render/fastjogl/Mesh.java
index a5b86b6..670722e 100644
--- a/src/jake2/render/fastjogl/Mesh.java
+++ b/src/jake2/render/fastjogl/Mesh.java
@@ -2,7 +2,7 @@
* Mesh.java
* Copyright (C) 2003
*
- * $Id: Mesh.java,v 1.7 2005-01-16 15:24:50 cawe Exp $
+ * $Id: Mesh.java,v 1.8 2005-01-22 22:30:35 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -226,7 +226,6 @@ public abstract class Mesh extends Light {
FloatBuffer dstTextureCoords = textureArrayBuf;
FloatBuffer srcTextureCoords = paliashdr.textureCoordBuf;
- int size = 0;
int dstIndex = 0;
int srcIndex = 0;
@@ -244,10 +243,9 @@ public abstract class Mesh extends Light {
mode = GL.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
diff --git a/src/jake2/render/fastjogl/Model.java b/src/jake2/render/fastjogl/Model.java
index cdba057..9b42fd0 100644
--- a/src/jake2/render/fastjogl/Model.java
+++ b/src/jake2/render/fastjogl/Model.java
@@ -2,7 +2,7 @@
* Model.java
* Copyright (C) 2003
*
- * $Id: Model.java,v 1.7 2005-01-10 00:14:32 cawe Exp $
+ * $Id: Model.java,v 1.8 2005-01-22 22:30:35 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -1237,6 +1237,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;
}
}
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;
}
}