From: Rene S. <sa...@us...> - 2004-09-22 19:22:54
|
Update of /cvsroot/jake2/jake2/src/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11556/src/jake2 Modified Files: Jake2.java Defines.java Log Message: major refactoring in game, server and client package Index: Jake2.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/Jake2.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Jake2.java 19 Sep 2004 19:53:51 -0000 1.4 --- Jake2.java 22 Sep 2004 19:22:14 -0000 1.5 *************** *** 6,27 **** */ /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ package jake2; --- 6,27 ---- */ /* ! Copyright (C) 1997-2001 Id Software, Inc. ! This program is free software; you can redistribute it and/or ! modify it under the terms of the GNU General Public License ! as published by the Free Software Foundation; either version 2 ! of the License, or (at your option) any later version. ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ! See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with this program; if not, write to the Free Software ! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ! */ package jake2; *************** *** 37,80 **** public final class Jake2 { ! public static Q2DataDialog Q2Dialog = new Q2DataDialog(); ! ! /** ! * main is used to start the game. Quake2 for Java supports the ! * following command line arguments: ! * @param args ! */ ! public static void main(String[] args) { ! Q2Dialog.setVisible(true); ! ! // in C the first arg is the filename ! int argc = (args == null) ? 1 : args.length + 1; ! String[] c_args = new String[argc]; ! c_args[0] = "Jake2"; ! if (argc > 1) { ! System.arraycopy(args, 0, c_args, 1, argc - 1); ! } ! Qcommon.Init(c_args); ! Globals.nostdout = Cvar.Get("nostdout", "0", 0); ! int oldtime = Sys.Milliseconds(); ! int newtime; ! int time; ! while (true) { ! // find time spending rendering last frame ! newtime = Sys.Milliseconds(); ! time = newtime - oldtime; ! ! // TODO this is a timer hack for Win2000 ! // System.currentTimeMillis() resolution bug ! if (time == 0 && (Globals.cl_timedemo.value != 0 || SCR.fps.value != 0)) { ! time++; ! } ! ! if (time > 0) ! Qcommon.Frame(time); ! oldtime = newtime; ! } ! } ! } --- 37,99 ---- public final class Jake2 { ! static class MemMonitor implements Runnable { ! public void run() { ! while (true) { ! Com.Printf("Memory:" ! + (Runtime.getRuntime().totalMemory() - Runtime ! .getRuntime().freeMemory()) + "\n"); ! try { ! Thread.sleep(1000); ! } catch (Exception e) { ! } ! } ! } ! } ! public static Q2DataDialog Q2Dialog = new Q2DataDialog(); ! /** ! * main is used to start the game. Quake2 for Java supports the following ! * command line arguments: ! * ! * @param args ! */ ! public static void main(String[] args) { ! Q2Dialog.setVisible(true); ! ! // uncomment to have a memory debugger (RST). ! //new Thread(new MemMonitor()).start(); ! ! // in C the first arg is the filename ! int argc = (args == null) ? 1 : args.length + 1; ! String[] c_args = new String[argc]; ! c_args[0] = "Jake2"; ! if (argc > 1) { ! System.arraycopy(args, 0, c_args, 1, argc - 1); ! } ! Qcommon.Init(c_args); ! ! Globals.nostdout = Cvar.Get("nostdout", "0", 0); ! ! int oldtime = Sys.Milliseconds(); ! int newtime; ! int time; ! while (true) { ! // find time spending rendering last frame ! newtime = Sys.Milliseconds(); ! time = newtime - oldtime; ! ! // TODO this is a timer hack for Win2000 ! // System.currentTimeMillis() resolution bug ! if (time == 0 ! && (Globals.cl_timedemo.value != 0 || SCR.fps.value != 0)) { ! time++; ! } ! ! if (time > 0) ! Qcommon.Frame(time); ! oldtime = newtime; ! } ! } ! } \ No newline at end of file Index: Defines.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/Defines.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Defines.java 10 Sep 2004 19:02:57 -0000 1.4 --- Defines.java 22 Sep 2004 19:22:14 -0000 1.5 *************** *** 26,46 **** package jake2; import jake2.util.*; ! public class Defines extends Math3D { ! ! // used by filefinders in Sys ! public final static int FILEISREADABLE = 1; ! public final static int FILEISWRITABLE = 2; ! public final static int FILEISFILE = 4; ! public final static int FILEISDIRECTORY = 8; ! ! // datentyp konstanten ! // groesse in bytes ! public final static int SIZE_OF_SHORT = 2; ! public final static int SIZE_OF_INT = 4; ! public final static int SIZE_OF_LONG = 8; ! public final static int SIZE_OF_FLOAT = 4; ! public final static int SIZE_OF_DOUBLE = 8; public final static int WEAPON_READY = 0; --- 26,33 ---- package jake2; + import jake2.game.pmove_t; import jake2.util.*; ! public class Defines { public final static int WEAPON_READY = 0; *************** *** 170,182 **** public final static int SURF_NODRAW = 0x80; // don't bother referencing the texture - // pmove->pm_flags - public final static int PMF_DUCKED = 1; - public final static int PMF_JUMP_HELD = 2; - public final static int PMF_ON_GROUND = 4; - public final static int PMF_TIME_WATERJUMP = 8; // pm_time is waterjump - public final static int PMF_TIME_LAND = 16; // pm_time is time before rejump - public final static int PMF_TIME_TELEPORT = 32; // pm_time is non-moving time - public final static int PMF_NO_PREDICTION = 64; // temporarily disables prediction (used for grappling hook) - // // button bits --- 157,160 ---- *************** *** 1356,1358 **** public final static String NO_SERVER_STRING = "<no server>"; public final static int NUM_ADDRESSBOOK_ENTRIES = 9; ! } --- 1334,1375 ---- public final static String NO_SERVER_STRING = "<no server>"; public final static int NUM_ADDRESSBOOK_ENTRIES = 9; ! ! public final static int STEPSIZE = 18; ! ! ! public static final float MOVE_STOP_EPSILON = 0.1f; ! ! /* ! ================== ! PM_StepSlideMove ! ! Each intersection will try to step over the obstruction instead of ! sliding along it. ! ! Returns a new origin, velocity, and contact entity ! Does not modify any world state? ! ================== ! */ ! public final static float MIN_STEP_NORMAL = 0.7f; // can't step up onto very steep slopes ! ! ! // used by filefinders in Sys ! public final static int FILEISREADABLE = 1; ! ! public final static int FILEISWRITABLE = 2; ! ! public final static int FILEISFILE = 4; ! ! public final static int FILEISDIRECTORY = 8; ! ! // datentyp konstanten ! // groesse in bytes ! public final static int SIZE_OF_SHORT = 2; ! ! public final static int SIZE_OF_INT = 4; ! ! public final static int SIZE_OF_LONG = 8; ! ! public final static int SIZE_OF_FLOAT = 4; ! ! public final static int SIZE_OF_DOUBLE = 8;} |