aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2
diff options
context:
space:
mode:
authorRene Stoeckel <[email protected]>2005-02-20 21:50:52 +0000
committerRene Stoeckel <[email protected]>2005-02-20 21:50:52 +0000
commit82f8c0e24b4630dee032c8f655bb2af7b4d71658 (patch)
tree0cc4688e1c9ac5f63d4ed1cbda2c2e4a84d83872 /src/jake2
parent7b154a2572d67f9bbc20dcbce79cb2b68f038809 (diff)
VectorEquals instead of VectorCompare
Diffstat (limited to 'src/jake2')
-rw-r--r--src/jake2/client/CL_tent.java4
-rw-r--r--src/jake2/game/Fire.java4
-rw-r--r--src/jake2/game/GameBase.java6
-rw-r--r--src/jake2/game/GameFunc.java8
-rw-r--r--src/jake2/game/GameTarget.java4
-rw-r--r--src/jake2/server/SV.java4
-rw-r--r--src/jake2/util/Math3D.java8
7 files changed, 19 insertions, 19 deletions
diff --git a/src/jake2/client/CL_tent.java b/src/jake2/client/CL_tent.java
index 60c1a70..afb3ccb 100644
--- a/src/jake2/client/CL_tent.java
+++ b/src/jake2/client/CL_tent.java
@@ -2,7 +2,7 @@
* java
* Copyright (C) 2004
*
- * $Id: CL_tent.java,v 1.9 2005-01-21 01:14:47 cawe Exp $
+ * $Id: CL_tent.java,v 1.10 2005-02-20 21:50:52 salomo Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -1565,7 +1565,7 @@ public class CL_tent {
// if it's a non-origin offset, it's a player, so use the
// hardcoded player offset
- if (Math3D.VectorCompare(b[i].offset, Globals.vec3_origin) == 0) {
+ if (!Math3D.VectorEquals(b[i].offset, Globals.vec3_origin)) {
Math3D.VectorMA(org, -(b[i].offset[0]) + 1, r, org);
Math3D.VectorMA(org, -(b[i].offset[1]), f, org);
Math3D.VectorMA(org, -(b[i].offset[2]) - 10, u, org);
diff --git a/src/jake2/game/Fire.java b/src/jake2/game/Fire.java
index c5a426e..29254ca 100644
--- a/src/jake2/game/Fire.java
+++ b/src/jake2/game/Fire.java
@@ -19,7 +19,7 @@
*/
// Created on 04.12.2003 by RST.
-// $Id: Fire.java,v 1.4 2004-09-22 19:22:02 salomo Exp $
+// $Id: Fire.java,v 1.5 2005-02-20 21:50:36 salomo Exp $
package jake2.game;
import jake2.Defines;
@@ -145,7 +145,7 @@ public class Fire {
water = true;
Math3D.VectorCopy(tr.endpos, water_start);
- if (0 == Math3D.VectorCompare(start, tr.endpos)) {
+ if (!Math3D.VectorEquals(start, tr.endpos)) {
if ((tr.contents & Defines.CONTENTS_WATER) != 0) {
if (Lib.strcmp(tr.surface.name, "*brwater") == 0)
color = Defines.SPLASH_BROWN_WATER;
diff --git a/src/jake2/game/GameBase.java b/src/jake2/game/GameBase.java
index dc6950e..1bf3c28 100644
--- a/src/jake2/game/GameBase.java
+++ b/src/jake2/game/GameBase.java
@@ -19,7 +19,7 @@
*/
// Created on 30.11.2003 by RST.
-// $Id: GameBase.java,v 1.9 2005-02-13 17:02:45 cawe Exp $
+// $Id: GameBase.java,v 1.10 2005-02-20 21:50:36 salomo Exp $
/** Father of all GameObjects. */
package jake2.game;
@@ -286,9 +286,9 @@ public class GameBase {
public static float[] MOVEDIR_DOWN = { 0, 0, -1 };
public static void G_SetMovedir(float[] angles, float[] movedir) {
- if (Math3D.VectorCompare(angles, VEC_UP) != 0) {
+ if (Math3D.VectorEquals(angles, VEC_UP)) {
Math3D.VectorCopy(MOVEDIR_UP, movedir);
- } else if (Math3D.VectorCompare(angles, VEC_DOWN) != 0) {
+ } else if (Math3D.VectorEquals(angles, VEC_DOWN)) {
Math3D.VectorCopy(MOVEDIR_DOWN, movedir);
} else {
Math3D.AngleVectors(angles, movedir, null, null);
diff --git a/src/jake2/game/GameFunc.java b/src/jake2/game/GameFunc.java
index 9a77e17..014e020 100644
--- a/src/jake2/game/GameFunc.java
+++ b/src/jake2/game/GameFunc.java
@@ -19,7 +19,7 @@
*/
// Created on 18.11.2003 by RST.
-// $Id: GameFunc.java,v 1.5 2004-09-22 19:22:04 salomo Exp $
+// $Id: GameFunc.java,v 1.6 2005-02-20 21:50:36 salomo Exp $
package jake2.game;
import jake2.Defines;
@@ -668,7 +668,7 @@ public class GameFunc {
Math3D.VectorSubtract(ent.moveinfo.start_angles, ent.s.angles,
move);
- if (Math3D.VectorCompare(move, Globals.vec3_origin) != 0) {
+ if (Math3D.VectorEquals(move, Globals.vec3_origin)) {
AngleMove_Done.think(ent);
return true;
}
@@ -881,7 +881,7 @@ public class GameFunc {
static EntUseAdapter rotating_use = new EntUseAdapter() {
public void use(edict_t self, edict_t other, edict_t activator) {
- if (0 == Math3D.VectorCompare(self.avelocity, Globals.vec3_origin)) {
+ if (!Math3D.VectorEquals(self.avelocity, Globals.vec3_origin)) {
self.s.sound = 0;
Math3D.VectorClear(self.avelocity);
self.touch = null;
@@ -1972,7 +1972,7 @@ public class GameFunc {
public void use(edict_t self, edict_t other, edict_t activator) {
// make sure we're not already moving
- if (0 == Math3D.VectorCompare(self.s.origin, Globals.vec3_origin))
+ if (!Math3D.VectorEquals(self.s.origin, Globals.vec3_origin))
return;
GameFunc.Move_Calc(self, self.pos1, door_secret_move1);
diff --git a/src/jake2/game/GameTarget.java b/src/jake2/game/GameTarget.java
index 94b46bb..3357f2b 100644
--- a/src/jake2/game/GameTarget.java
+++ b/src/jake2/game/GameTarget.java
@@ -19,7 +19,7 @@
*/
// Created on 28.12.2003 by RST.
-// $Id: GameTarget.java,v 1.4 2005-02-19 21:18:44 salomo Exp $
+// $Id: GameTarget.java,v 1.5 2005-02-20 21:50:36 salomo Exp $
package jake2.game;
import jake2.Defines;
@@ -608,7 +608,7 @@ public class GameTarget {
point);
Math3D.VectorSubtract(point, self.s.origin, self.movedir);
Math3D.VectorNormalize(self.movedir);
- if (0 == Math3D.VectorCompare(self.movedir, last_movedir))
+ if (!Math3D.VectorEquals(self.movedir, last_movedir))
self.spawnflags |= 0x80000000;
}
diff --git a/src/jake2/server/SV.java b/src/jake2/server/SV.java
index a046ef4..1273025 100644
--- a/src/jake2/server/SV.java
+++ b/src/jake2/server/SV.java
@@ -2,7 +2,7 @@
* SV.java
* Copyright (C) 2003
*
- * $Id: SV.java,v 1.10 2004-09-22 19:22:12 salomo Exp $
+ * $Id: SV.java,v 1.11 2005-02-20 21:50:37 salomo Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -200,7 +200,7 @@ public final class SV {
for (j = 0; j < numplanes; j++)
if ((j != i)
- && Math3D.VectorCompare(planes[i], planes[j]) == 0.0f) {
+ && !Math3D.VectorEquals(planes[i], planes[j])) {
if (Math3D.DotProduct(new_velocity, planes[j]) < 0)
break; // not ok
}
diff --git a/src/jake2/util/Math3D.java b/src/jake2/util/Math3D.java
index 1a2ec51..e92ef51 100644
--- a/src/jake2/util/Math3D.java
+++ b/src/jake2/util/Math3D.java
@@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// Created on 09.12.2003 by RST.
-// $Id: Math3D.java,v 1.8 2005-01-16 17:04:50 cawe Exp $
+// $Id: Math3D.java,v 1.9 2005-02-20 21:50:36 salomo Exp $
package jake2.util;
@@ -74,11 +74,11 @@ public class Math3D {
public static void VectorClear(float[] a) {
a[0] = a[1] = a[2] = 0;
}
- public static int VectorCompare(float[] v1, float[] v2) {
+ public static boolean VectorEquals(float[] v1, float[] v2) {
if (v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2])
- return 0;
+ return false;
- return 1;
+ return true;
}
public static void VectorNegate(float[] from, float[] to) {
to[0] = -from[0];