aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2
diff options
context:
space:
mode:
authorCarsten Weisse <[email protected]>2007-02-27 14:59:21 +0000
committerCarsten Weisse <[email protected]>2007-02-27 14:59:21 +0000
commit8e9cfb3081da27d55219360771d69265829bc9eb (patch)
tree6fe695a63d0d1846fce521062fe9bb5f19cedbba /src/jake2
parent9de8df15d2a518468e26481c8380dbb3bdda98be (diff)
clean up
Diffstat (limited to 'src/jake2')
-rw-r--r--src/jake2/qcommon/FS.java17
-rw-r--r--src/jake2/render/basic/Image.java18
-rw-r--r--src/jake2/render/basic/Light.java5
-rw-r--r--src/jake2/render/basic/Mesh.java21
-rw-r--r--src/jake2/render/basic/Model.java10
5 files changed, 16 insertions, 55 deletions
diff --git a/src/jake2/qcommon/FS.java b/src/jake2/qcommon/FS.java
index b4888f1..79dda0f 100644
--- a/src/jake2/qcommon/FS.java
+++ b/src/jake2/qcommon/FS.java
@@ -1,8 +1,6 @@
/*
* FS.java
* Copyright (C) 2003
- *
- * $Id: FS.java,v 1.15 2005-11-13 13:36:00 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -166,7 +164,6 @@ public final class FS extends Globals {
searchpath_t search;
String netpath;
pack_t pak;
- int i;
filelink_t link;
file_from_pak = 0;
@@ -239,7 +236,6 @@ public final class FS extends Globals {
searchpath_t search;
String netpath;
pack_t pak;
- int i;
filelink_t link;
File file = null;
@@ -319,13 +315,11 @@ public final class FS extends Globals {
*/
public static void Read(byte[] buffer, int len, RandomAccessFile f) {
- int block, remaining;
int offset = 0;
int read = 0;
- boolean tries = true;
-
// read in chunks for progress bar
- remaining = len;
+ int remaining = len;
+ int block;
while (remaining != 0) {
block = Math.min(remaining, MAX_READ);
@@ -393,7 +387,6 @@ public final class FS extends Globals {
searchpath_t search;
String netpath;
pack_t pak;
- int i;
filelink_t link;
File file = null;
@@ -955,16 +948,10 @@ public final class FS extends Globals {
*/
public static int Developer_searchpath(int who) {
- int ch;
// PMM - warning removal
// char *start;
searchpath_t s;
- if (who == 1) // xatrix
- ch = 'x';
- else if (who == 2)
- ch = 'r';
-
for (s = fs_searchpaths; s != null; s = s.next) {
if (s.filename.indexOf("xatrix") != -1)
return 1;
diff --git a/src/jake2/render/basic/Image.java b/src/jake2/render/basic/Image.java
index cc7f09b..6ec5482 100644
--- a/src/jake2/render/basic/Image.java
+++ b/src/jake2/render/basic/Image.java
@@ -1,8 +1,6 @@
/*
* Image.java
* Copyright (C) 2003
- *
- * $Id: Image.java,v 1.2 2006-11-21 00:50:46 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -29,11 +27,7 @@ import jake2.Defines;
import jake2.client.VID;
import jake2.client.particle_t;
import jake2.game.cvar_t;
-import jake2.qcommon.Com;
-import jake2.qcommon.Cvar;
-import jake2.qcommon.FS;
-import jake2.qcommon.longjmpException;
-import jake2.qcommon.qfiles;
+import jake2.qcommon.*;
import jake2.render.image_t;
import jake2.util.Lib;
import jake2.util.Vargs;
@@ -42,7 +36,9 @@ import java.awt.Dimension;
import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
-import java.nio.*;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.IntBuffer;
import java.util.Arrays;
@@ -548,7 +544,6 @@ public abstract class Image extends Main {
int row, column;
byte[] raw;
ByteBuffer buf_p;
- int length;
qfiles.tga_t targa_header;
byte[] pic = null;
@@ -1258,7 +1253,6 @@ public abstract class Image extends Main {
return false;
} else {
int p;
- int rgb;
for (int i = 0; i < s; i++) {
p = data[i] & 0xff;
trans[i] = d_8to24table[p];
@@ -1564,13 +1558,11 @@ public abstract class Image extends Main {
*/
protected void Draw_GetPalette() {
int r, g, b;
- Dimension dim;
- byte[] pic;
byte[][] palette = new byte[1][]; //new byte[768];
// get the palette
- pic = LoadPCX("pics/colormap.pcx", palette, dim = new Dimension());
+ LoadPCX("pics/colormap.pcx", palette, new Dimension());
if (palette[0] == null || palette[0].length != 768)
Com.Error(Defines.ERR_FATAL, "Couldn't load pics/colormap.pcx");
diff --git a/src/jake2/render/basic/Light.java b/src/jake2/render/basic/Light.java
index e3af95f..6565c73 100644
--- a/src/jake2/render/basic/Light.java
+++ b/src/jake2/render/basic/Light.java
@@ -1,8 +1,6 @@
/*
* Light.java
* Copyright (C) 2003
- *
- * $Id: Light.java,v 1.2 2006-11-21 00:50:46 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -28,7 +26,6 @@ package jake2.render.basic;
import jake2.Defines;
import jake2.Globals;
import jake2.client.dlight_t;
-import jake2.client.lightstyle_t;
import jake2.game.cplane_t;
import jake2.qcommon.Com;
import jake2.qcommon.longjmpException;
@@ -463,7 +460,6 @@ public abstract class Light extends Warp {
float[] scale = { 0, 0, 0, 0 };
int nummaps;
float[] bl;
- lightstyle_t style;
int monolightmap;
if ((surf.texinfo.flags & (Defines.SURF_SKY | Defines.SURF_TRANS33
@@ -487,7 +483,6 @@ public abstract class Light extends Warp {
for (maps = 0; maps < Defines.MAXLIGHTMAPS
&& surf.styles[maps] != (byte) 255; maps++) {
- style = r_newrefdef.lightstyles[surf.styles[maps] & 0xFF];
}
// goto store;
throw new longjmpException();
diff --git a/src/jake2/render/basic/Mesh.java b/src/jake2/render/basic/Mesh.java
index 2566de4..65c500a 100644
--- a/src/jake2/render/basic/Mesh.java
+++ b/src/jake2/render/basic/Mesh.java
@@ -1,8 +1,6 @@
/*
* Mesh.java
* Copyright (C) 2003
- *
- * $Id: Mesh.java,v 1.3 2007-02-27 13:32:34 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -72,17 +70,15 @@ public abstract class Mesh extends Light {
void GL_LerpVerts(int nverts, int[] ov, int[] v,
float[][] lerp, float[] move, float[] frontv, float[] backv) {
- int i;
- int lerpIndex = 0;
-
- int ovv, vv;
+
+ int ovv, vv;
//PMM -- added RF_SHELL_DOUBLE, RF_SHELL_HALF_DAM
if ((currententity.flags & (Defines.RF_SHELL_RED
| Defines.RF_SHELL_GREEN | Defines.RF_SHELL_BLUE
| Defines.RF_SHELL_DOUBLE | Defines.RF_SHELL_HALF_DAM)) != 0) {
float[] normal;
- for (i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */
+ for (int i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */
) {
vv = v[i];
normal = r_avertexnormals[(vv >>> 24) & 0xFF];
@@ -96,7 +92,7 @@ public abstract class Mesh extends Light {
* frontv[2] + normal[2] * Defines.POWERSUIT_SCALE;
}
} else {
- for (i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */
+ for (int i = 0; i < nverts; i++ /* , v++, ov++, lerp+=4 */
) {
vv = v[i];
ovv = ov[i];
@@ -112,9 +108,8 @@ public abstract class Mesh extends Light {
void GL_LerpVerts(int nverts, int[] ov, int[] v, float[] move,
float[] frontv, float[] backv) {
- int lerpIndex = 0;
-
- int ovv, vv;
+
+ int ovv, vv;
FloatBuffer lerp = vertexArrayBuf;
//PMM -- added RF_SHELL_DOUBLE, RF_SHELL_HALF_DAM
@@ -380,12 +375,8 @@ public abstract class Mesh extends Light {
void GL_DrawAliasShadow(qfiles.dmdl_t paliashdr, int posenum) {
float[] point = { 0, 0, 0 };
int count;
- qfiles.daliasframe_t frame;
-
float lheight = currententity.origin[2] - lightspot[2];
- frame = paliashdr.aliasFrames[currententity.frame];
-
int[] order = paliashdr.glCmds;
float height = -lheight + 1.0f;
diff --git a/src/jake2/render/basic/Model.java b/src/jake2/render/basic/Model.java
index 0ee33ab..64809e3 100644
--- a/src/jake2/render/basic/Model.java
+++ b/src/jake2/render/basic/Model.java
@@ -1,8 +1,6 @@
/*
* Model.java
* Copyright (C) 2003
- *
- * $Id: Model.java,v 1.2 2006-11-21 00:50:46 cawe Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -345,8 +343,6 @@ public abstract class Model extends Surf {
*/
void Mod_LoadVisibility(lump_t l)
{
- int i;
-
if (l.filelen == 0)
{
loadmodel.vis = null;
@@ -498,7 +494,7 @@ public abstract class Model extends Surf {
texinfo_t in;
mtexinfo_t[] out;
mtexinfo_t step;
- int i, j, count;
+ int i, count;
int next;
String name;
@@ -775,7 +771,7 @@ public abstract class Model extends Surf {
{
qfiles.dleaf_t in;
mleaf_t[] out;
- int i, j, count, p;
+ int i, j, count;
if ((l.filelen % qfiles.dleaf_t.SIZE) != 0)
Com.Error (Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size in " + loadmodel.name);
@@ -999,7 +995,7 @@ public abstract class Model extends Surf {
*/
void Mod_LoadAliasModel (model_t mod, ByteBuffer buffer)
{
- int i, j;
+ int i;
qfiles.dmdl_t pheader;
qfiles.dstvert_t[] poutst;
qfiles.dtriangle_t[] pouttri;