diff options
author | Carsten Weisse <[email protected]> | 2005-11-13 13:36:00 +0000 |
---|---|---|
committer | Carsten Weisse <[email protected]> | 2005-11-13 13:36:00 +0000 |
commit | 27be0694ee6c53ab645dd027a41b310a9226c027 (patch) | |
tree | aea9f3fa9451f37b8e417c8dab7112fe1a59e206 /src/jake2 | |
parent | d8dbe6ea319b4974157c62ffa38baa6672f12f39 (diff) |
up merge from branch render-refactoring
code cleanup. use Defines instead of Globals
(Defines contains all constants)
Diffstat (limited to 'src/jake2')
-rw-r--r-- | src/jake2/client/VID.java | 4 | ||||
-rw-r--r-- | src/jake2/game/Cmd.java | 6 | ||||
-rw-r--r-- | src/jake2/qcommon/Com.java | 10 | ||||
-rw-r--r-- | src/jake2/qcommon/FS.java | 25 |
4 files changed, 23 insertions, 22 deletions
diff --git a/src/jake2/client/VID.java b/src/jake2/client/VID.java index 4b39403..b04b943 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.16 2005-05-26 16:56:33 hzi Exp $ + * $Id: VID.java,v 1.17 2005-11-13 13:36:00 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -284,7 +284,7 @@ public class VID extends Globals { /* * drop the console if we fail to load a refresh */ - if ( Globals.cls.key_dest != Globals.key_console ) + if ( Globals.cls.key_dest != Defines.key_console ) { try { Console.ToggleConsole_f.execute(); diff --git a/src/jake2/game/Cmd.java b/src/jake2/game/Cmd.java index d82bffd..fa070e3 100644 --- a/src/jake2/game/Cmd.java +++ b/src/jake2/game/Cmd.java @@ -2,7 +2,7 @@ * Cmd.java * Copyright (C) 2003 * - * $Id: Cmd.java,v 1.13 2005-03-13 20:52:05 salomo Exp $ + * $Id: Cmd.java,v 1.14 2005-11-13 13:36:00 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -95,7 +95,7 @@ public final class Cmd { } String s = Cmd.Argv(1); - if (s.length() > Globals.MAX_ALIAS_NAME) { + if (s.length() > Defines.MAX_ALIAS_NAME) { Com.Printf("Alias name is too long\n"); return; } @@ -1107,7 +1107,7 @@ public final class Cmd { && GameBase.level.time - cl.flood_when[i] < GameBase.flood_persecond.value) { cl.flood_locktill = GameBase.level.time + GameBase.flood_waitdelay.value; - SV_GAME.PF_cprintf(ent, Globals.PRINT_CHAT, + SV_GAME.PF_cprintf(ent, Defines.PRINT_CHAT, "Flood protection: You can't talk for " + (int) GameBase.flood_waitdelay.value + " seconds.\n"); diff --git a/src/jake2/qcommon/Com.java b/src/jake2/qcommon/Com.java index 9ff3a99..bb85942 100644 --- a/src/jake2/qcommon/Com.java +++ b/src/jake2/qcommon/Com.java @@ -2,7 +2,7 @@ * Com.java * Copyright (C) 2003 * - * $Id: Com.java,v 1.12 2005-06-11 17:21:21 hzi Exp $ + * $Id: Com.java,v 1.13 2005-11-13 13:36:00 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -273,7 +273,7 @@ public final class Com { public void execute() throws longjmpException { - Error(Globals.ERR_FATAL, Cmd.Argv(1)); + Error(Defines.ERR_FATAL, Cmd.Argv(1)); } }; @@ -325,15 +325,15 @@ public final class Com static void InitArgv(String[] args) throws longjmpException { - if (args.length > Globals.MAX_NUM_ARGVS) + if (args.length > Defines.MAX_NUM_ARGVS) { - Com.Error(Globals.ERR_FATAL, "argc > MAX_NUM_ARGVS"); + Com.Error(Defines.ERR_FATAL, "argc > MAX_NUM_ARGVS"); } Com.com_argc= args.length; for (int i= 0; i < Com.com_argc; i++) { - if (args[i].length() >= Globals.MAX_TOKEN_CHARS) + if (args[i].length() >= Defines.MAX_TOKEN_CHARS) Com.com_argv[i]= ""; else Com.com_argv[i]= args[i]; diff --git a/src/jake2/qcommon/FS.java b/src/jake2/qcommon/FS.java index 0bea72b..b4888f1 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.14 2005-05-26 16:56:32 hzi Exp $ + * $Id: FS.java,v 1.15 2005-11-13 13:36:00 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. @@ -25,6 +25,7 @@ */ package jake2.qcommon; +import jake2.Defines; import jake2.Globals; import jake2.game.Cmd; import jake2.game.cvar_t; @@ -203,7 +204,7 @@ public final class FS extends Globals { // open a new file on the pakfile File file = new File(pak.filename); if (!file.canRead()) { - Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); } return entry.filelen; @@ -278,7 +279,7 @@ public final class FS extends Globals { // filename + '\n'); file = new File(pak.filename); if (!file.canRead()) - Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { // hold the pakfile handle open @@ -331,13 +332,13 @@ public final class FS extends Globals { try { read = f.read(buffer, offset, block); } catch (IOException e) { - Com.Error(Globals.ERR_FATAL, e.toString()); + Com.Error(Defines.ERR_FATAL, e.toString()); } if (read == 0) { - Com.Error(Globals.ERR_FATAL, "FS_Read: 0 bytes read"); + Com.Error(Defines.ERR_FATAL, "FS_Read: 0 bytes read"); } else if (read == -1) { - Com.Error(Globals.ERR_FATAL, "FS_Read: -1 bytes read"); + Com.Error(Defines.ERR_FATAL, "FS_Read: -1 bytes read"); } // // do some progress bar thing here... @@ -377,7 +378,7 @@ public final class FS extends Globals { file.readFully(buf); file.close(); } catch (IOException e) { - Com.Error(Globals.ERR_FATAL, e.toString()); + Com.Error(Defines.ERR_FATAL, e.toString()); } return buf; } @@ -442,7 +443,7 @@ public final class FS extends Globals { // filename + '\n'); file = new File(pak.filename); if (!file.canRead()) - Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { // hold the pakfile handle open @@ -547,12 +548,12 @@ public final class FS extends Globals { header.dirlen = packhandle.getInt(); if (header.ident != IDPAKHEADER) - Com.Error(Globals.ERR_FATAL, packfile + " is not a packfile"); + Com.Error(Defines.ERR_FATAL, packfile + " is not a packfile"); numpackfiles = header.dirlen / packfile_t.SIZE; if (numpackfiles > MAX_FILES_IN_PACK) - Com.Error(Globals.ERR_FATAL, packfile + " has " + numpackfiles + Com.Error(Defines.ERR_FATAL, packfile + " has " + numpackfiles + " files"); newfiles = new Hashtable(numpackfiles); @@ -669,8 +670,8 @@ public final class FS extends Globals { + "/autoexec.cfg"; } - int canthave = Globals.SFF_SUBDIR | Globals.SFF_HIDDEN - | Globals.SFF_SYSTEM; + int canthave = Defines.SFF_SUBDIR | Defines.SFF_HIDDEN + | Defines.SFF_SYSTEM; if (Sys.FindAll(name, 0, canthave) != null) { Cbuf.AddText("exec autoexec.cfg\n"); |