aboutsummaryrefslogtreecommitdiffstats
path: root/src/jake2
diff options
context:
space:
mode:
authorHolger Zickner <[email protected]>2005-05-26 16:56:33 +0000
committerHolger Zickner <[email protected]>2005-05-26 16:56:33 +0000
commitc96baeae8717b80e23afabd4abdfb5aff0e8cbcc (patch)
tree5d0849dc34b79ed36c1f59353ac6ea5ae5361071 /src/jake2
parent152b65e3999ba7a618cdf934c830351f2f76cff2 (diff)
merge last changes from 0.9.4 branch
Diffstat (limited to 'src/jake2')
-rw-r--r--src/jake2/client/VID.java20
-rw-r--r--src/jake2/qcommon/Cvar.java15
-rw-r--r--src/jake2/qcommon/FS.java9
-rw-r--r--src/jake2/qcommon/Q2DataDialog.java12
-rw-r--r--src/jake2/qcommon/Qcommon.java6
-rw-r--r--src/jake2/sound/S.java4
-rw-r--r--src/jake2/util/Lib.java8
7 files changed, 49 insertions, 25 deletions
diff --git a/src/jake2/client/VID.java b/src/jake2/client/VID.java
index b095e74..4b39403 100644
--- a/src/jake2/client/VID.java
+++ b/src/jake2/client/VID.java
@@ -2,7 +2,7 @@
* VID.java
* Copyright (C) 2003
*
- * $Id: VID.java,v 1.15 2005-04-07 15:29:21 cawe Exp $
+ * $Id: VID.java,v 1.16 2005-05-26 16:56:33 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -255,23 +255,31 @@ public class VID extends Globals {
Globals.cl.refresh_prepped = false;
Globals.cls.disable_screen = 1.0f; // true;
- String defaultName = Renderer.getDefaultName();
if ( !LoadRefresh( vid_ref.string ) )
{
- if ( vid_ref.string.equals(defaultName) ) {
+ String renderer;
+ if (vid_ref.string.equals(Renderer.getPreferedName())) {
+ // try the default renderer as fallback after prefered
+ renderer = Renderer.getDefaultName();
+ } else {
+ // try the prefered renderer as first fallback
+ renderer = Renderer.getPreferedName();
+ }
+ if ( vid_ref.string.equals(Renderer.getDefaultName())) {
+ renderer = vid_ref.string;
Com.Printf("Refresh failed\n");
gl_mode = Cvar.Get( "gl_mode", "0", 0 );
if (gl_mode.value != 0.0f) {
Com.Printf("Trying mode 0\n");
Cvar.SetValue("gl_mode", 0);
if ( !LoadRefresh( vid_ref.string ) )
- Com.Error(Defines.ERR_FATAL, "Couldn't fall back to " + defaultName +" refresh!");
+ Com.Error(Defines.ERR_FATAL, "Couldn't fall back to " + renderer +" refresh!");
} else
- Com.Error(Defines.ERR_FATAL, "Couldn't fall back to " + defaultName +" refresh!");
+ Com.Error(Defines.ERR_FATAL, "Couldn't fall back to " + renderer +" refresh!");
}
- Cvar.Set("vid_ref", defaultName);
+ Cvar.Set("vid_ref", renderer);
/*
* drop the console if we fail to load a refresh
diff --git a/src/jake2/qcommon/Cvar.java b/src/jake2/qcommon/Cvar.java
index d14cadd..c0aa6ab 100644
--- a/src/jake2/qcommon/Cvar.java
+++ b/src/jake2/qcommon/Cvar.java
@@ -2,7 +2,7 @@
* Cvar.java
* Copyright (C) 2003
*
- * $Id: Cvar.java,v 1.7 2005-02-08 18:00:02 cawe Exp $
+ * $Id: Cvar.java,v 1.8 2005-05-26 16:56:32 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -294,10 +294,21 @@ public class Cvar extends Globals {
/*
* ============ Cvar_SetValue ============
*/
- public static void SetValue(String var_name, float value) {
+ // the overloading is very important
+ // there was a problem with networt "rate" string
+ // 10000 became "10000.0" and that wasn't right
+ public static void SetValue(String var_name, int value) {
Cvar.Set(var_name, "" + value);
}
+ public static void SetValue(String var_name, float value) {
+ if (value == (int)value) {
+ Cvar.Set(var_name, "" + (int)value);
+ } else {
+ Cvar.Set(var_name, "" + value);
+ }
+ }
+
/*
* ============ Cvar_VariableValue ============
*/
diff --git a/src/jake2/qcommon/FS.java b/src/jake2/qcommon/FS.java
index b4fe7eb..0bea72b 100644
--- a/src/jake2/qcommon/FS.java
+++ b/src/jake2/qcommon/FS.java
@@ -2,7 +2,7 @@
* FS.java
* Copyright (C) 2003
*
- * $Id: FS.java,v 1.13 2005-05-20 15:05:54 cawe Exp $
+ * $Id: FS.java,v 1.14 2005-05-26 16:56:32 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -659,14 +659,11 @@ public final class FS extends Globals {
* ExecAutoexec
*/
public static void ExecAutoexec() {
+ String dir = fs_userdir;
- String dir;
String name;
-
- dir = Cvar.VariableString("gamedir");
-
if (dir != null && dir.length() > 0) {
- name = fs_basedir.string + '/' + dir + "/autoexec.cfg";
+ name = dir + "/autoexec.cfg";
} else {
name = fs_basedir.string + '/' + Globals.BASEDIRNAME
+ "/autoexec.cfg";
diff --git a/src/jake2/qcommon/Q2DataDialog.java b/src/jake2/qcommon/Q2DataDialog.java
index 16c1bf5..2d28629 100644
--- a/src/jake2/qcommon/Q2DataDialog.java
+++ b/src/jake2/qcommon/Q2DataDialog.java
@@ -2,7 +2,7 @@
* Q2DataDialog.java
* Copyright (C) 2003
*
- * $Id: Q2DataDialog.java,v 1.13 2005-05-12 12:52:50 hzi Exp $
+ * $Id: Q2DataDialog.java,v 1.14 2005-05-26 16:56:32 hzi Exp $
*/
package jake2.qcommon;
@@ -35,7 +35,7 @@ public class Q2DataDialog extends javax.swing.JDialog {
int x = (mode.getWidth() - getWidth()) / 2;
int y = (mode.getHeight() - getHeight()) / 2;
setLocation(x, y);
- dir = home + sep + "jake2" + sep + "baseq2";
+ dir = home + sep + "Jake2" + sep + "baseq2";
jTextField1.setText(dir);
}
@@ -183,7 +183,7 @@ public class Q2DataDialog extends javax.swing.JDialog {
}
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {
-
+ dir = jTextField1.getText();
if (dir != null) {
Cvar.Set("cddir", dir);
FS.setCDDir();
@@ -227,7 +227,7 @@ public class Q2DataDialog extends javax.swing.JDialog {
private InstallPanel installPanel;
private NotFoundPanel notFoundPanel;
private JLabel status;
- private javax.swing.JTextField jTextField1;
+ javax.swing.JTextField jTextField1;
private javax.swing.JButton okButton;
// End of variables declaration//GEN-END:variables
@@ -441,7 +441,7 @@ public class Q2DataDialog extends javax.swing.JDialog {
public InstallPanel(Q2DataDialog d) {
initComponents();
- String dir = Q2DataDialog.home + Q2DataDialog.sep + "jake2";
+ String dir = Q2DataDialog.home + Q2DataDialog.sep + "Jake2";
destDir.setText(dir);
initMirrors();
parent = d;
@@ -760,7 +760,7 @@ public class Q2DataDialog extends javax.swing.JDialog {
void endInstall(String message) {
parent.notFoundPanel.message.setText(message);
- parent.dir = destDir + "/baseq2";
+ parent.jTextField1.setText(destDir + "/baseq2");
parent.showChooseDialog();
parent.okButtonActionPerformed(null);
}
diff --git a/src/jake2/qcommon/Qcommon.java b/src/jake2/qcommon/Qcommon.java
index ed81b71..1035b73 100644
--- a/src/jake2/qcommon/Qcommon.java
+++ b/src/jake2/qcommon/Qcommon.java
@@ -2,7 +2,7 @@
* Qcommon.java
* Copyright 2003
*
- * $Id: Qcommon.java,v 1.16 2005-05-14 10:10:45 hzi Exp $
+ * $Id: Qcommon.java,v 1.17 2005-05-26 16:56:32 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -246,6 +246,10 @@ public final class Qcommon extends Globals {
Cbuf.AddText("exec default.cfg\n");
Cbuf.AddText("bind MWHEELUP weapnext\n");
Cbuf.AddText("bind MWHEELDOWN weapprev\n");
+ Cbuf.AddText("bind w +forward\n");
+ Cbuf.AddText("bind s +back\n");
+ Cbuf.AddText("bind a +moveleft\n");
+ Cbuf.AddText("bind d +moveright\n");
Cbuf.Execute();
Cvar.Set("vid_fullscreen", "0");
Cbuf.AddText("exec config.cfg\n");
diff --git a/src/jake2/sound/S.java b/src/jake2/sound/S.java
index 8295c8b..8a3e133 100644
--- a/src/jake2/sound/S.java
+++ b/src/jake2/sound/S.java
@@ -2,7 +2,7 @@
* S.java
* Copyright (C) 2003
*
- * $Id: S.java,v 1.10 2005-02-07 17:23:50 cawe Exp $
+ * $Id: S.java,v 1.11 2005-05-26 16:56:33 hzi Exp $
*/
/*
Copyright (C) 1997-2001 Id Software, Inc.
@@ -92,7 +92,7 @@ public class S {
}
}
// if driver not found use dummy
- impl = (Sound)drivers.firstElement();
+ impl = (Sound)drivers.lastElement();
}
public static void Init() {
diff --git a/src/jake2/util/Lib.java b/src/jake2/util/Lib.java
index 4f709d4..51829c1 100644
--- a/src/jake2/util/Lib.java
+++ b/src/jake2/util/Lib.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: Lib.java,v 1.12 2005-01-09 23:41:53 cawe Exp $
+// $Id: Lib.java,v 1.13 2005-05-26 16:56:31 hzi Exp $
package jake2.util;
@@ -89,7 +89,11 @@ public class Lib {
return Integer.parseInt(in);
}
catch (Exception e) {
- return 0;
+ try {
+ return (int)Double.parseDouble(in);
+ } catch (Exception e1) {
+ return 0;
+ }
}
}
public static float[] atov(String v) {