From: Rene S. <sa...@us...> - 2004-08-20 21:30:09
|
Update of /cvsroot/jake2/jake2/src/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1597/src/jake2 Modified Files: Jake2.java Log Message: savegames now seem to work. Index: Jake2.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/Jake2.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Jake2.java 9 Jul 2004 06:50:51 -0000 1.3 --- Jake2.java 20 Aug 2004 21:29:59 -0000 1.4 *************** *** 27,30 **** --- 27,31 ---- import jake2.client.SCR; + import jake2.qcommon.Com; import jake2.qcommon.Cvar; import jake2.qcommon.Qcommon; *************** *** 34,39 **** * Jake2 is the main class of Quake2 for Java. */ ! public final class Jake2 { /** --- 35,83 ---- * Jake2 is the main class of Quake2 for Java. */ ! public final class Jake2 ! { ! ! /** This class is just for debugging the memory consumption second by ! * second (rst). ! */ ! static class MemMonitor implements Runnable ! { ! public void run() ! { ! while (memdebugthread != null) ! { ! Com.Printf("Memory:" + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory() + "\n")); ! try ! { ! Thread.sleep(1000); ! } ! catch (Exception e) ! { ! } ! } ! } ! } ! ! /** Holds the mem debugger thread.*/ ! static Thread memdebugthread= null; ! ! /** ! * Run the MEM-Debugger (rst). ! */ ! static void startMemDebug() ! { ! if (memdebugthread == null) ! { ! (memdebugthread= new Thread(new MemMonitor())).start(); ! } ! } + /** + * Terminate the MEM-Debugger (rst). + */ + static void stopMemDebug() + { + memdebugthread= null; + } /** *************** *** 42,75 **** * @param args */ ! public static void main(String[] args) { // 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; } } --- 86,123 ---- * @param args */ ! public static void main(String[] args) ! { // 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; } } |