aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2
diff options
context:
space:
mode:
Diffstat (limited to 'src/jake2')
-rw-r--r--src/jake2/client/CL_pred.java8
-rw-r--r--src/jake2/client/Console.java23
-rw-r--r--src/jake2/sys/IN.java4
-rw-r--r--src/jake2/sys/InputListener.java8
-rw-r--r--src/jake2/sys/Sys.java25
5 files changed, 30 insertions, 38 deletions
diff --git a/src/jake2/client/CL_pred.java b/src/jake2/client/CL_pred.java
index 0b0e2ab..7f6a279 100644
--- a/src/jake2/client/CL_pred.java
+++ b/src/jake2/client/CL_pred.java
@@ -2,7 +2,7 @@
* CL_pred.java
* Copyright (C) 2004
*
- * $Id: CL_pred.java,v 1.3 2004-07-08 20:24:28 hzi Exp $
+ * $Id: CL_pred.java,v 1.4 2004-07-19 19:20:22 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -243,7 +243,11 @@ public class CL_pred extends CL_parse {
}
};
- PMove.pm_airaccelerate = atof(cl.configstrings[CS_AIRACCEL]);
+ try {
+ PMove.pm_airaccelerate = Float.parseFloat(cl.configstrings[CS_AIRACCEL]);
+ } catch (Exception e) {
+ PMove.pm_airaccelerate = 0;
+ }
// bugfix (rst) yeah !!!!!!!! found the solution to the B E W E G U N G S P R O B L E M.
pm.s.set(cl.frame.playerstate.pmove);
diff --git a/src/jake2/client/Console.java b/src/jake2/client/Console.java
index 11a7a64..4010eaf 100644
--- a/src/jake2/client/Console.java
+++ b/src/jake2/client/Console.java
@@ -2,7 +2,7 @@
* Con.java
* Copyright (C) 2003
*
- * $Id: Console.java,v 1.2 2004-07-08 15:58:42 hzi Exp $
+ * $Id: Console.java,v 1.3 2004-07-19 19:20:22 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -167,10 +167,8 @@ public final class Console extends Globals {
* If the line width has changed, reformat the buffer.
*/
public static void CheckResize() {
- int i, j, width, oldwidth, oldtotallines, numlines, numchars;
- byte[] tbuf = new byte[Defines.CON_TEXTSIZE];
-
- width = (Globals.viddef.width >> 3) - 2;
+
+ int width = (Globals.viddef.width >> 3) - 2;
if (width == Globals.con.linewidth)
return;
@@ -182,25 +180,26 @@ public final class Console extends Globals {
Arrays.fill(Globals.con.text, (byte)' ');
}
else {
- oldwidth = Globals.con.linewidth;
+ int oldwidth = Globals.con.linewidth;
Globals.con.linewidth = width;
- oldtotallines = Globals.con.totallines;
+ int oldtotallines = Globals.con.totallines;
Globals.con.totallines = Defines.CON_TEXTSIZE / Globals.con.linewidth;
- numlines = oldtotallines;
+ int numlines = oldtotallines;
if (Globals.con.totallines < numlines)
numlines = Globals.con.totallines;
- numchars = oldwidth;
+ int numchars = oldwidth;
if (Globals.con.linewidth < numchars)
numchars = Globals.con.linewidth;
-
+
+ byte[] tbuf = new byte[Defines.CON_TEXTSIZE];
System.arraycopy(Globals.con.text, 0, tbuf, 0, Defines.CON_TEXTSIZE);
Arrays.fill(Globals.con.text, (byte)' ');
- for (i=0 ; i<numlines ; i++) {
- for (j=0 ; j<numchars ; j++) {
+ for (int i=0 ; i<numlines ; i++) {
+ for (int j=0 ; j<numchars ; j++) {
Globals.con.text[(Globals.con.totallines - 1 - i) * Globals.con.linewidth + j] =
tbuf[((Globals.con.current - i + oldtotallines) % oldtotallines) * oldwidth + j];
}
diff --git a/src/jake2/sys/IN.java b/src/jake2/sys/IN.java
index 5935a0a..23f34bf 100644
--- a/src/jake2/sys/IN.java
+++ b/src/jake2/sys/IN.java
@@ -2,7 +2,7 @@
* IN.java
* Copyright (C) 2003
*
- * $Id: IN.java,v 1.2 2004-07-08 15:58:46 hzi Exp $
+ * $Id: IN.java,v 1.3 2004-07-19 19:22:57 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -90,7 +90,7 @@ public final class IN extends Globals {
}
public static void toggleMouse() {
- if (mouse_active) {
+ if (mouse_avail) {
mouse_avail=false;
DeactivateMouse();
} else {
diff --git a/src/jake2/sys/InputListener.java b/src/jake2/sys/InputListener.java
index 52a6d4a..40e58d5 100644
--- a/src/jake2/sys/InputListener.java
+++ b/src/jake2/sys/InputListener.java
@@ -2,7 +2,7 @@
* InputListener.java
* Copyright (C) 2004
*
- * $Id: InputListener.java,v 1.1 2004-07-07 19:59:51 hzi Exp $
+ * $Id: InputListener.java,v 1.2 2004-07-19 19:22:57 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -43,11 +43,9 @@ public final class InputListener implements KeyListener, MouseListener, MouseMot
}
static Jake2InputEvent nextEvent() {
- Jake2InputEvent ev = null;
+ Jake2InputEvent ev;
synchronized (eventQueue) {
- try {
- ev = (Jake2InputEvent)eventQueue.removeFirst();
- } catch (Exception e) {}
+ ev = (!eventQueue.isEmpty())?(Jake2InputEvent)eventQueue.removeFirst():null;
}
return ev;
}
diff --git a/src/jake2/sys/Sys.java b/src/jake2/sys/Sys.java
index b65098c..ddab111 100644
--- a/src/jake2/sys/Sys.java
+++ b/src/jake2/sys/Sys.java
@@ -2,7 +2,7 @@
* Sys.java
* Copyright (C) 2003
*
- * $Id: Sys.java,v 1.4 2004-07-09 06:50:47 hzi Exp $
+ * $Id: Sys.java,v 1.5 2004-07-19 19:22:57 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -25,20 +25,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package jake2.sys;
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
import jake2.Defines;
import jake2.Globals;
import jake2.client.CL;
-import jake2.game.Game;
-import jake2.game.game_export_t;
-import jake2.game.game_import_t;
import jake2.qcommon.Com;
import jake2.util.Lib;
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
/**
* Sys
*/
@@ -187,15 +184,9 @@ public final class Sys extends Defines {
}
- private static long secbase = 0;
+ private static long secbase = System.currentTimeMillis();
public static int Milliseconds() {
- if (secbase == 0) {
- secbase = System.currentTimeMillis();
- return 0;
- }
-
- return Globals.curtime = (int) (System.currentTimeMillis() - secbase);
-
+ return Globals.curtime = (int) (System.currentTimeMillis() - secbase);
}
//============================================