aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2/render/jogl/Light.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jake2/render/jogl/Light.java')
-rw-r--r--src/jake2/render/jogl/Light.java32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/jake2/render/jogl/Light.java b/src/jake2/render/jogl/Light.java
index f6b8e10..68c9839 100644
--- a/src/jake2/render/jogl/Light.java
+++ b/src/jake2/render/jogl/Light.java
@@ -2,7 +2,7 @@
* Light.java
* Copyright (C) 2003
*
- * $Id: Light.java,v 1.7 2004-09-22 19:22:16 salomo Exp $
+ * $Id: Light.java,v 1.7.12.1 2005-07-16 18:25:37 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -41,8 +41,6 @@ import java.nio.ByteBuffer;
import java.nio.IntBuffer;
import java.util.Arrays;
-import net.java.games.jogl.GL;
-
/**
* Light
*
@@ -73,7 +71,7 @@ public abstract class Light extends Warp {
Math3D.VectorSubtract(light.origin, r_origin, v);
- gl.glBegin(GL.GL_TRIANGLE_FAN);
+ gl.glBegin(GL_TRIANGLE_FAN);
gl.glColor3f(light.color[0] * 0.2f, light.color[1] * 0.2f,
light.color[2] * 0.2f);
for (i = 0; i < 3; i++)
@@ -103,10 +101,10 @@ public abstract class Light extends Warp {
r_dlightframecount = r_framecount + 1; // because the count hasn't
// advanced yet for this frame
gl.glDepthMask(false);
- gl.glDisable(GL.GL_TEXTURE_2D);
- gl.glShadeModel(GL.GL_SMOOTH);
- gl.glEnable(GL.GL_BLEND);
- gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE);
+ gl.glDisable(GL_TEXTURE_2D);
+ gl.glShadeModel(GL_SMOOTH);
+ gl.glEnable(GL_BLEND);
+ gl.glBlendFunc(GL_ONE, GL_ONE);
for (i = 0; i < r_newrefdef.num_dlights; i++) {
l = r_newrefdef.dlights[i];
@@ -114,9 +112,9 @@ public abstract class Light extends Warp {
}
gl.glColor3f(1, 1, 1);
- gl.glDisable(GL.GL_BLEND);
- gl.glEnable(GL.GL_TEXTURE_2D);
- gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
+ gl.glDisable(GL_BLEND);
+ gl.glEnable(GL_TEXTURE_2D);
+ gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
gl.glDepthMask(true);
}
@@ -592,9 +590,7 @@ public abstract class Light extends Warp {
if (monolightmap == '0') {
for (i = 0; i < tmax; i++, destp += stride) {
- dest.position(destp);
-
- for (j = 0; j < smax; j++) {
+ for (j = 0; j < smax; j++, destp++) {
r = (int) bl[blp++];
g = (int) bl[blp++];
@@ -641,15 +637,13 @@ public abstract class Light extends Warp {
g &= 0xFF;
b &= 0xFF;
a &= 0xFF;
- dest.put(destp++, (a << 24) | (b << 16) | (g << 8)
+ dest.put(destp, (a << 24) | (b << 16) | (g << 8)
| (r << 0));
}
}
} else {
for (i = 0; i < tmax; i++, destp += stride) {
- dest.position(destp);
-
- for (j = 0; j < smax; j++) {
+ for (j = 0; j < smax; j++, destp++) {
r = (int) bl[blp++];
g = (int) bl[blp++];
@@ -721,7 +715,7 @@ public abstract class Light extends Warp {
g &= 0xFF;
b &= 0xFF;
a &= 0xFF;
- dest.put(destp++, (a << 24) | (b << 16) | (g << 8)
+ dest.put(destp, (a << 24) | (b << 16) | (g << 8)
| (r << 0));
}
}