From: Carsten W. <ca...@us...> - 2005-11-13 12:58:04
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4443/src/jake2/qcommon Modified Files: Tag: render-refactoring FS.java Com.java Log Message: code cleanup. use Defines instead of Globals (Defines contains all constants) Index: FS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/FS.java,v retrieving revision 1.14 retrieving revision 1.14.4.1 diff -C2 -d -r1.14 -r1.14.4.1 *** FS.java 26 May 2005 16:56:32 -0000 1.14 --- FS.java 13 Nov 2005 12:57:56 -0000 1.14.4.1 *************** *** 26,29 **** --- 26,30 ---- package jake2.qcommon; + import jake2.Defines; import jake2.Globals; import jake2.game.Cmd; *************** *** 204,208 **** File file = new File(pak.filename); if (!file.canRead()) { ! Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + pak.filename); } --- 205,209 ---- File file = new File(pak.filename); if (!file.canRead()) { ! Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); } *************** *** 279,283 **** file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { --- 280,284 ---- file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { *************** *** 332,342 **** read = f.read(buffer, offset, block); } catch (IOException e) { ! Com.Error(Globals.ERR_FATAL, e.toString()); } if (read == 0) { ! Com.Error(Globals.ERR_FATAL, "FS_Read: 0 bytes read"); } else if (read == -1) { ! Com.Error(Globals.ERR_FATAL, "FS_Read: -1 bytes read"); } // --- 333,343 ---- read = f.read(buffer, offset, block); } catch (IOException e) { ! Com.Error(Defines.ERR_FATAL, e.toString()); } if (read == 0) { ! Com.Error(Defines.ERR_FATAL, "FS_Read: 0 bytes read"); } else if (read == -1) { ! Com.Error(Defines.ERR_FATAL, "FS_Read: -1 bytes read"); } // *************** *** 378,382 **** file.close(); } catch (IOException e) { ! Com.Error(Globals.ERR_FATAL, e.toString()); } return buf; --- 379,383 ---- file.close(); } catch (IOException e) { ! Com.Error(Defines.ERR_FATAL, e.toString()); } return buf; *************** *** 443,447 **** file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { --- 444,448 ---- file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { *************** *** 548,557 **** if (header.ident != IDPAKHEADER) ! Com.Error(Globals.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 + " files"); --- 549,558 ---- if (header.ident != IDPAKHEADER) ! Com.Error(Defines.ERR_FATAL, packfile + " is not a packfile"); numpackfiles = header.dirlen / packfile_t.SIZE; if (numpackfiles > MAX_FILES_IN_PACK) ! Com.Error(Defines.ERR_FATAL, packfile + " has " + numpackfiles + " files"); *************** *** 670,675 **** } ! int canthave = Globals.SFF_SUBDIR | Globals.SFF_HIDDEN ! | Globals.SFF_SYSTEM; if (Sys.FindAll(name, 0, canthave) != null) { --- 671,676 ---- } ! int canthave = Defines.SFF_SUBDIR | Defines.SFF_HIDDEN ! | Defines.SFF_SYSTEM; if (Sys.FindAll(name, 0, canthave) != null) { Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.java,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -C2 -d -r1.12 -r1.12.4.1 *** Com.java 11 Jun 2005 17:21:21 -0000 1.12 --- Com.java 13 Nov 2005 12:57:56 -0000 1.12.4.1 *************** *** 274,278 **** public void execute() throws longjmpException { ! Error(Globals.ERR_FATAL, Cmd.Argv(1)); } }; --- 274,278 ---- public void execute() throws longjmpException { ! Error(Defines.ERR_FATAL, Cmd.Argv(1)); } }; *************** *** 326,332 **** { ! if (args.length > Globals.MAX_NUM_ARGVS) { ! Com.Error(Globals.ERR_FATAL, "argc > MAX_NUM_ARGVS"); } --- 326,332 ---- { ! if (args.length > Defines.MAX_NUM_ARGVS) { ! Com.Error(Defines.ERR_FATAL, "argc > MAX_NUM_ARGVS"); } *************** *** 334,338 **** for (int i= 0; i < Com.com_argc; i++) { ! if (args[i].length() >= Globals.MAX_TOKEN_CHARS) Com.com_argv[i]= ""; else --- 334,338 ---- for (int i= 0; i < Com.com_argc; i++) { ! if (args[i].length() >= Defines.MAX_TOKEN_CHARS) Com.com_argv[i]= ""; else |