You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(52) |
Aug
(34) |
Sep
(99) |
Oct
(110) |
Nov
(21) |
Dec
(69) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(117) |
Feb
(90) |
Mar
(1) |
Apr
(22) |
May
(96) |
Jun
(25) |
Jul
(22) |
Aug
|
Sep
|
Oct
(18) |
Nov
(43) |
Dec
(71) |
2006 |
Jan
(20) |
Feb
(10) |
Mar
|
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(60) |
Nov
(63) |
Dec
(35) |
2007 |
Jan
(18) |
Feb
(40) |
Mar
(14) |
Apr
(18) |
May
(33) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(25) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
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; } } |
From: Rene S. <sa...@us...> - 2004-08-20 21:30:09
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1597/src/jake2/client Modified Files: Menu.java Log Message: savegames now seem to work. Index: Menu.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Menu.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Menu.java 30 Jul 2004 06:03:40 -0000 1.6 --- Menu.java 20 Aug 2004 21:29:56 -0000 1.7 *************** *** 35,40 **** --- 35,42 ---- import jake2.util.Lib; import jake2.util.Math3D; + import jake2.util.QuakeFile; import java.awt.Dimension; + import java.io.IOException; import java.io.RandomAccessFile; import java.util.Arrays; *************** [...6290 lines suppressed...] ! line2 = Lib.rightFrom(s.itemnames[s.curvalue], '\n'); ! int pos = line2.indexOf('\n'); if (pos != -1) ! line2 = line2.substring(0, pos); Menu_DrawString(RCOLUMN_OFFSET + s.x + s.parent.x, s.y + s.parent.y + 10, line2); --- 4998,5009 ---- else { String line1, line2; ! line1= Lib.leftFrom(s.itemnames[s.curvalue], '\n'); Menu_DrawString(RCOLUMN_OFFSET + s.x + s.parent.x, s.y + s.parent.y, line1); ! line2= Lib.rightFrom(s.itemnames[s.curvalue], '\n'); ! int pos= line2.indexOf('\n'); if (pos != -1) ! line2= line2.substring(0, pos); Menu_DrawString(RCOLUMN_OFFSET + s.x + s.parent.x, s.y + s.parent.y + 10, line2); |
From: Rene S. <sa...@us...> - 2004-08-20 21:30:08
|
Update of /cvsroot/jake2/jake2/src/jake2/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1597/src/jake2/util Modified Files: Lib.java Added Files: QuakeFile.java Log Message: savegames now seem to work. Index: Lib.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/util/Lib.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Lib.java 23 Jul 2004 10:09:55 -0000 1.5 --- Lib.java 20 Aug 2004 21:29:57 -0000 1.6 *************** *** 35,40 **** import net.java.games.jogl.util.BufferUtils; ! public class Lib { ! /* --- 35,40 ---- import net.java.games.jogl.util.BufferUtils; ! public class Lib ! { /* *************** *** 46,90 **** ============= */ ! public static String vtos(float[] v) { return (int) v[0] + " " + (int) v[1] + " " + (int) v[2]; } ! public static String vtofs(float[] v) { return v[0] + " " + v[1] + " " + v[2]; } ! ! public static String vtofsbeaty(float[] v) { return Com.sprintf("%8.2f %8.2f %8.2f", new Vargs().add(v[0]).add(v[1]).add(v[2])); } ! public static short rand() { //return (short) (Math.random() * 0x8000); ! return (short)Globals.rnd.nextInt(Short.MAX_VALUE+1); } ! public static float crandom() { return (Globals.rnd.nextFloat() - 0.5f) * 2.0f; //return (float) (Math.random() - 0.5) * 2.0f; } ! public static float random() { return Globals.rnd.nextFloat(); } ! public static float crand() { return (Globals.rnd.nextFloat() - 0.5f) * 2.0f; } ! public static int strcmp(String in1, String in2) { return in1.compareTo(in2); } public static boolean strstr(String i1, String i2) { return (i1.indexOf(i2) != -1); } ! public static float atof(String in) { ! float res = 0; ! try { ! res = Float.parseFloat(in); } ! catch (Exception e) { } --- 46,110 ---- ============= */ ! public static String vtos(float[] v) ! { return (int) v[0] + " " + (int) v[1] + " " + (int) v[2]; } ! public static String vtofs(float[] v) ! { return v[0] + " " + v[1] + " " + v[2]; } ! ! public static String vtofsbeaty(float[] v) ! { return Com.sprintf("%8.2f %8.2f %8.2f", new Vargs().add(v[0]).add(v[1]).add(v[2])); } ! public static short rand() ! { //return (short) (Math.random() * 0x8000); ! return (short) Globals.rnd.nextInt(Short.MAX_VALUE + 1); } ! public static float crandom() ! { return (Globals.rnd.nextFloat() - 0.5f) * 2.0f; //return (float) (Math.random() - 0.5) * 2.0f; } ! public static float random() ! { return Globals.rnd.nextFloat(); } ! public static float crand() ! { return (Globals.rnd.nextFloat() - 0.5f) * 2.0f; } ! public static int strcmp(String in1, String in2) ! { return in1.compareTo(in2); } + //<<<<<<< Lib.java + // public static int stricmp(String in1, String in2) + // { + // return in1.compareToIgnoreCase(in2); + // } + // + // public static boolean strstr(String i1, String i2) + // { + //======= public static boolean strstr(String i1, String i2) { return (i1.indexOf(i2) != -1); } ! public static float atof(String in) ! { ! float res= 0; ! try ! { ! res= Float.parseFloat(in); } ! catch (Exception e) ! { } *************** *** 92,123 **** } ! public static int Q_stricmp(String in1, String in2) { return in1.compareToIgnoreCase(in2); } - // ================================================================================= ! public static int atoi(String in) { ! try { return Integer.parseInt(in); } ! catch (Exception e) { return 0; } } ! public static float[] atov(String v) { ! float[] res = { 0, 0, 0 }; ! int i1 = v.indexOf(" "); ! int i2 = v.indexOf(" ", i1 + 1); ! res[0] = atof(v.substring(0, i1)); ! res[1] = atof(v.substring(i1 + 1, i2)); ! res[2] = atof(v.substring(i2 + 1, v.length())); return res; } public static int strlen(char in[]) { for (int i = 0; i < in.length; i++) --- 112,151 ---- } ! // TRASH! ! public static int Q_stricmp(String in1, String in2) ! { return in1.compareToIgnoreCase(in2); } ! /** Converts a string to an int. */ ! public static int atoi(String in) ! { ! try ! { return Integer.parseInt(in); } ! catch (Exception e) ! { return 0; } } ! /** Converts a string to a vector. */ ! public static float[] atov(String v) ! { ! float[] res= { 0, 0, 0 }; ! int i1= v.indexOf(" "); ! int i2= v.indexOf(" ", i1 + 1); ! res[0]= atof(v.substring(0, i1)); ! res[1]= atof(v.substring(i1 + 1, i2)); ! res[2]= atof(v.substring(i2 + 1, v.length())); return res; } + public static int strlen(char in[]) { for (int i = 0; i < in.length; i++) *************** *** 127,132 **** } ! public static int strlen(byte in[]) { ! for (int i = 0; i < in.length; i++) if (in[i] == 0) return i; --- 155,161 ---- } ! public static int strlen(byte in[]) ! { ! for (int i= 0; i < in.length; i++) if (in[i] == 0) return i; *************** *** 134,148 **** } static byte[] buffer = new byte[Defines.MAX_INFO_STRING]; public static String readString(ByteBuffer bb, int len) { bb.get(buffer, 0, len); return new String(buffer, 0, len); } ! public static String hexdumpfile(ByteBuffer bb, int len) throws IOException { ! ByteBuffer bb1 = bb.slice(); ! byte buf[] = new byte[len]; bb1.get(buf); --- 163,204 ---- } + //<<<<<<< Lib.java + // public static void strcat(String in, String i) + // { + // in += i; + // } + // + // public static void strcpy(byte dest[], byte src[]) + // { + // for (int i= 0; i < dest.length && i < src.length; i++) + // if (src[i] == 0) + // { + // dest[i]= 0; + // return; + // } + // else + // dest[i]= src[i]; + // + // } + // + // static byte[] buffer= new byte[Defines.MAX_INFO_STRING]; + // + // public static String readString(ByteBuffer bb, int len) + // { + //======= static byte[] buffer = new byte[Defines.MAX_INFO_STRING]; public static String readString(ByteBuffer bb, int len) { + bb.get(buffer, 0, len); return new String(buffer, 0, len); } ! /** Returns a string containing a hexdump of a bytebuffer content.*/ ! public static String hexdumpfile(ByteBuffer bb, int len) throws IOException ! { ! ByteBuffer bb1= bb.slice(); ! byte buf[]= new byte[len]; bb1.get(buf); *************** *** 151,168 **** } ! // dump data as hexstring ! public static String hexDump(byte data1[], int len, boolean showAddress) { ! StringBuffer result = new StringBuffer(); ! StringBuffer charfield = new StringBuffer(); ! int i = 0; ! while (i < len) { ! if ((i & 0xf) == 0) { ! if (showAddress) { ! String address = Integer.toHexString(i); ! address = ("0000".substring(0, 4 - address.length()) + address).toUpperCase(); result.append(address + ": "); } } ! int v = data1[i]; result.append(hex2(v)); --- 207,228 ---- } ! /** Returns a string containing a hexdump of a byte array.*/ ! public static String hexDump(byte data1[], int len, boolean showAddress) ! { ! StringBuffer result= new StringBuffer(); ! StringBuffer charfield= new StringBuffer(); ! int i= 0; ! while (i < len) ! { ! if ((i & 0xf) == 0) ! { ! if (showAddress) ! { ! String address= Integer.toHexString(i); ! address= ("0000".substring(0, 4 - address.length()) + address).toUpperCase(); result.append(address + ": "); } } ! int v= data1[i]; result.append(hex2(v)); *************** *** 173,177 **** // nach dem letzten, newline einfuegen ! if ((i & 0xf) == 0) { result.append(charfield); result.append("\n"); --- 233,238 ---- // nach dem letzten, newline einfuegen ! if ((i & 0xf) == 0) ! { result.append(charfield); result.append("\n"); *************** *** 179,183 **** } // in der Mitte ein Luecke einfuegen ? ! else if ((i & 0xf) == 8) { result.append(" "); } --- 240,245 ---- } // in der Mitte ein Luecke einfuegen ? ! else if ((i & 0xf) == 8) ! { result.append(" "); } *************** *** 186,196 **** } ! //formats an hex byte ! public static String hex2(int i) { ! String val = Integer.toHexString(i & 0xff); return ("00".substring(0, 2 - val.length()) + val).toUpperCase(); } ! public static char readableChar(int i) { if ((i < 0x20) || (i > 0x7f)) return '.'; --- 248,261 ---- } ! /** Formats a byte into 2 digit hexcode.*/ ! public static String hex2(int i) ! { ! String val= Integer.toHexString(i & 0xff); return ("00".substring(0, 2 - val.length()) + val).toUpperCase(); } ! /** Converts a char into a char suitable for a hexdump. */ ! public static char readableChar(int i) ! { if ((i < 0x20) || (i > 0x7f)) return '.'; *************** *** 199,215 **** } ! public static void printv(String in, float arr[]) { ! for (int n = 0; n < arr.length; n++) { Com.Println(in + "[" + n + "]: " + arr[n]); } } ! static final byte nullfiller[] = new byte[8192]; ! public static void fwriteString(String s, int len, RandomAccessFile f) throws IOException { ! if (s == null) return; ! int diff = len - s.length(); ! if (diff > 0) { f.write(s.getBytes()); --- 264,286 ---- } ! /** Prints a vector to the quake console. */ ! public static void printv(String in, float arr[]) ! { ! for (int n= 0; n < arr.length; n++) ! { Com.Println(in + "[" + n + "]: " + arr[n]); } } ! static final byte nullfiller[]= new byte[8192]; ! /** Trash !*/ ! public static void fwriteString1(String s, int len, RandomAccessFile f) throws IOException ! { ! if (s == null) return; ! int diff= len - s.length(); ! if (diff > 0) ! { f.write(s.getBytes()); *************** *** 220,228 **** } public static RandomAccessFile fopen(String name, String mode) { try { return new RandomAccessFile(name, mode); } ! catch (Exception e) { Com.DPrintf("Could not open file:" + name); return null; --- 291,317 ---- } + //<<<<<<< Lib.java + // /** Trash !*/ + // public static String cut(String in, char c) + // { + // int pos= in.indexOf(c); + // + // if (pos != -1) + // return in.substring(0, pos); + // return in; + // } + // + // /** Trash !*/ + // public static RandomAccessFile fopen(String name, String mode) + // { + // try + // { + //======= public static RandomAccessFile fopen(String name, String mode) { try { return new RandomAccessFile(name, mode); } ! catch (Exception e) ! { Com.DPrintf("Could not open file:" + name); return null; *************** *** 230,250 **** } ! public static void fclose(RandomAccessFile f) { ! try { f.close(); } ! catch (Exception e) { } } ! public static String freadString(RandomAccessFile f, int len) { ! byte buffer[] = new byte[len]; ! FS.Read(buffer, len, f); ! ! return new String(buffer).trim(); ! } ! ! public static String rightFrom(String in, char c) { ! int pos = in.lastIndexOf(c); if (pos == -1) return ""; --- 319,337 ---- } ! /** Trash !*/ ! public static void fclose(RandomAccessFile f) ! { ! try ! { f.close(); } ! catch (Exception e) ! { } } ! public static String rightFrom(String in, char c) ! { ! int pos= in.lastIndexOf(c); if (pos == -1) return ""; *************** *** 254,259 **** } ! public static String leftFrom(String in, char c) { ! int pos = in.lastIndexOf(c); if (pos == -1) return ""; --- 341,347 ---- } ! public static String leftFrom(String in, char c) ! { ! int pos= in.lastIndexOf(c); if (pos == -1) return ""; *************** *** 263,279 **** } ! public static String[] linesplit(String in) { ! ! StringTokenizer tk = new StringTokenizer(in, "\r\n"); ! int count = tk.countTokens(); if (count == 0) return new String[] { }; ! String result[] = new String[count]; ! for (int i = 0; tk.hasMoreTokens(); i++) { ! result[i] = tk.nextToken(); } --- 351,369 ---- } ! /** Splits a line at newline characters and returns a string array. */ ! public static String[] linesplit(String in) ! { ! StringTokenizer tk= new StringTokenizer(in, "\r\n"); ! int count= tk.countTokens(); if (count == 0) return new String[] { }; ! String result[]= new String[count]; ! for (int i= 0; tk.hasMoreTokens(); i++) ! { ! result[i]= tk.nextToken(); } *************** *** 281,311 **** } ! public static int rename(String oldn, String newn) { ! try { ! File f1 = new File(oldn); ! File f2 = new File(newn); f1.renameTo(f2); return 0; } ! catch (Exception e) { return 1; } } ! public static byte[] getIntBytes(int c) { ! byte b[] = new byte[4]; ! b[0] = (byte) ((c & 0xff)); ! b[1] = (byte) ((c >>> 8) & 0xff); ! b[2] = (byte) ((c >>> 16) & 0xff); ! b[3] = (byte) ((c >>> 24) & 0xff); return b; } ! public static int getInt(byte b[]) { return (b[0] & 0xff) | ((b[1] & 0xff) << 8) | ((b[2] & 0xff) << 16) | ((b[3] & 0xff) << 24); } ! ! public static float[] clone(float in[]) { ! float out[] = new float[in.length]; if (in.length != 0) --- 371,408 ---- } ! /** Just renames a file. */ ! public static int rename(String oldn, String newn) ! { ! try ! { ! File f1= new File(oldn); ! File f2= new File(newn); f1.renameTo(f2); return 0; } ! catch (Exception e) ! { return 1; } } ! public static byte[] getIntBytes(int c) ! { ! byte b[]= new byte[4]; ! b[0]= (byte) ((c & 0xff)); ! b[1]= (byte) ((c >>> 8) & 0xff); ! b[2]= (byte) ((c >>> 16) & 0xff); ! b[3]= (byte) ((c >>> 24) & 0xff); return b; } ! public static int getInt(byte b[]) ! { return (b[0] & 0xff) | ((b[1] & 0xff) << 8) | ((b[2] & 0xff) << 16) | ((b[3] & 0xff) << 24); } ! ! public static float[] clone(float in[]) ! { ! float out[]= new float[in.length]; if (in.length != 0) *************** *** 315,355 **** } ! /* ! * java.nio.* Buffer util functions ! */ ! ! public static final int SIZEOF_FLOAT = BufferUtils.SIZEOF_FLOAT; ! public static final int SIZEOF_INT = BufferUtils.SIZEOF_INT; ! public static FloatBuffer newFloatBuffer(int numElements) { ! ByteBuffer bb = newByteBuffer(numElements * SIZEOF_FLOAT); ! return bb.asFloatBuffer(); } ! public static FloatBuffer newFloatBuffer(int numElements, ByteOrder order) { ! ByteBuffer bb = newByteBuffer(numElements * SIZEOF_FLOAT, order); ! return bb.asFloatBuffer(); } ! public static IntBuffer newIntBuffer(int numElements) { ! ByteBuffer bb = newByteBuffer(numElements * SIZEOF_INT); ! return bb.asIntBuffer(); } ! public static IntBuffer newIntBuffer(int numElements, ByteOrder order) { ! ByteBuffer bb = newByteBuffer(numElements * SIZEOF_INT, order); ! return bb.asIntBuffer(); } ! public static ByteBuffer newByteBuffer(int numElements) { ! ByteBuffer bb = ByteBuffer.allocateDirect(numElements); ! bb.order(ByteOrder.nativeOrder()); ! return bb; } ! public static ByteBuffer newByteBuffer(int numElements, ByteOrder order) { ! ByteBuffer bb = ByteBuffer.allocateDirect(numElements); ! bb.order(order); ! return bb; } --- 412,460 ---- } ! private static final int SIZEOF_FLOAT= BufferUtils.SIZEOF_FLOAT; ! private static final int SIZEOF_INT= BufferUtils.SIZEOF_INT; ! /** java.nio.* Buffer util function. */ ! public static FloatBuffer newFloatBuffer(int numElements) ! { ! ByteBuffer bb= newByteBuffer(numElements * SIZEOF_FLOAT); ! return bb.asFloatBuffer(); } ! /** java.nio.* Buffer util function. */ ! public static FloatBuffer newFloatBuffer(int numElements, ByteOrder order) ! { ! ByteBuffer bb= newByteBuffer(numElements * SIZEOF_FLOAT, order); ! return bb.asFloatBuffer(); } ! /** java.nio.* Buffer util function. */ ! public static IntBuffer newIntBuffer(int numElements) ! { ! ByteBuffer bb= newByteBuffer(numElements * SIZEOF_INT); ! return bb.asIntBuffer(); } ! /** java.nio.* Buffer util function. */ ! public static IntBuffer newIntBuffer(int numElements, ByteOrder order) ! { ! ByteBuffer bb= newByteBuffer(numElements * SIZEOF_INT, order); ! return bb.asIntBuffer(); } ! /** java.nio.* Buffer util function. */ ! public static ByteBuffer newByteBuffer(int numElements) ! { ! ByteBuffer bb= ByteBuffer.allocateDirect(numElements); ! bb.order(ByteOrder.nativeOrder()); ! return bb; } ! /** java.nio.* Buffer util function. */ ! public static ByteBuffer newByteBuffer(int numElements, ByteOrder order) ! { ! ByteBuffer bb= ByteBuffer.allocateDirect(numElements); ! bb.order(order); ! return bb; } --- NEW FILE: QuakeFile.java --- /* 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. */ // Created on 24.07.2004 by RST. // $Id: QuakeFile.java,v 1.1 2004/08/20 21:29:57 salomo Exp $ package jake2.util; import jake2.game.Game; import jake2.game.SuperAdapter; import jake2.game.edict_t; import jake2.game.gitem_t; import java.io.*; /** RandomAccessFile, bur handles readString/WriteString specially and * offers other helper functions */ public class QuakeFile extends RandomAccessFile { /** Standard Constructor.*/ public QuakeFile(String filename, String mode) throws FileNotFoundException { super(filename, mode); } /** Writes a Vector to a RandomAccessFile. */ public void writeVector(float v[]) throws IOException { for (int n= 0; n < 3; n++) writeFloat(v[n]); } /** Writes a Vector to a RandomAccessFile. */ public float[] readVector() throws IOException { float res[]= { 0, 0, 0 }; for (int n= 0; n < 3; n++) res[n]= readFloat(); return res; } /** Reads a length specified string from a file. */ public String readString() throws IOException { int len= readInt(); if (len == -1) return null; if (len == 0) return ""; byte bb[]= new byte[len]; super.read(bb, 0, len); return new String(bb, 0, len); } /** Writes a length specified string to a file. */ public void writeString(String s) throws IOException { if (s == null) { writeInt(-1); return; } writeInt(s.length()); if (s.length() != 0) writeBytes(s); } /** Writes the edict reference. */ public void writeEdictRef(edict_t ent) throws IOException { if (ent == null) writeInt(-1); else { writeInt(ent.s.number); } } /** * Reads an edict index from a file and returns the edict. */ public edict_t readEdictRef() throws IOException { int i= readInt(); // handle -1 if (i < 0) return null; if (i > Game.g_edicts.length) { System.err.println("jake2: illegal edict num:" + i); return null; } // valid edict. return Game.g_edicts[i]; } /** Writes the Adapter-ID to the file. */ public void writeAdapter(SuperAdapter a) throws IOException { writeInt(3988); if (a == null) writeString(null); else { String str= a.getID(); if (a == null) { System.err.println("writeAdapter: invalid Adapter id for" + a); } System.out.println("writing adapter:" + str); writeString(str); } } /** Reads the adapter id and returns the adapter. */ public SuperAdapter readAdapter() throws IOException { if (readInt() != 3988) System.err.println("wrong read position: readadapter."); String id= readString(); if (id == null) { // null adapter. :-) return null; } return SuperAdapter.getFromID(id); } /** Writes an item reference. */ public void writeItem(gitem_t item) throws IOException { if (item == null) writeInt(-1); else writeInt(item.index); } /** Reads the item index and returns the game item. */ public gitem_t readItem() throws IOException { int ndx= readInt(); if (ndx == -1) return null; else return Game.itemlist[ndx]; } } |
From: Holger Z. <hz...@us...> - 2004-08-19 20:56:51
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21198/src/jake2/game Modified Files: Cmd.java Log Message: command line completion remove references to GameBase.gi from Cmd Index: Cmd.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Cmd.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Cmd.java 23 Jul 2004 10:07:14 -0000 1.4 --- Cmd.java 19 Aug 2004 20:56:41 -0000 1.5 *************** *** 29,35 **** --- 29,37 ---- import jake2.Globals; import jake2.qcommon.*; + import jake2.server.SV_GAME; import jake2.util.Lib; import java.util.Arrays; + import java.util.Vector; /** *************** *** 505,513 **** if (GameBase.deathmatch.value == 0 && GameBase.sv_cheats.value == 0) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); return; } ! name= GameBase.gi.args(); if (0 == Lib.Q_stricmp(name, "all")) --- 507,515 ---- if (GameBase.deathmatch.value == 0 && GameBase.sv_cheats.value == 0) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); return; } ! name= Cmd.Args(); if (0 == Lib.Q_stricmp(name, "all")) *************** *** 516,523 **** give_all= false; ! if (give_all || 0 == Lib.Q_stricmp(GameBase.gi.argv(1), "health")) { ! if (GameBase.gi.argc() == 3) ! ent.health= Lib.atoi(GameBase.gi.argv(2)); else ent.health= ent.max_health; --- 518,525 ---- give_all= false; ! if (give_all || 0 == Lib.Q_stricmp(Cmd.Argv(1), "health")) { ! if (Cmd.Argc() == 3) ! ent.health= Lib.atoi(Cmd.Argv(2)); else ent.health= ent.max_health; *************** *** 605,613 **** if (it == null) { ! name= GameBase.gi.argv(1); it= GameUtil.FindItem(name); if (it == null) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "unknown item\n"); return; } --- 607,615 ---- if (it == null) { ! name= Cmd.Argv(1); it= GameUtil.FindItem(name); if (it == null) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "unknown item\n"); return; } *************** *** 616,620 **** if (it.pickup == null) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "non-pickup item\n"); return; } --- 618,622 ---- if (it.pickup == null) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "non-pickup item\n"); return; } *************** *** 624,629 **** if ((it.flags & Defines.IT_AMMO) != 0) { ! if (GameBase.gi.argc() == 3) ! ent.client.pers.inventory[index]= Lib.atoi(GameBase.gi.argv(2)); else ent.client.pers.inventory[index] += it.quantity; --- 626,631 ---- if ((it.flags & Defines.IT_AMMO) != 0) { ! if (Cmd.Argc() == 3) ! ent.client.pers.inventory[index]= Lib.atoi(Cmd.Argv(2)); else ent.client.pers.inventory[index] += it.quantity; *************** *** 655,659 **** if (GameBase.deathmatch.value == 0 && GameBase.sv_cheats.value == 0) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); return; } --- 657,661 ---- if (GameBase.deathmatch.value == 0 && GameBase.sv_cheats.value == 0) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); return; } *************** *** 665,669 **** msg= "godmode ON\n"; ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, msg); } --- 667,671 ---- msg= "godmode ON\n"; ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, msg); } *************** *** 683,687 **** if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); return; } --- 685,689 ---- if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); return; } *************** *** 693,697 **** msg= "notarget ON\n"; ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, msg); } --- 695,699 ---- msg= "notarget ON\n"; ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, msg); } *************** *** 709,713 **** if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); return; } --- 711,715 ---- if (GameBase.deathmatch.value != 0 && GameBase.sv_cheats.value == 0) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "You must run the server with '+set cheats 1' to enable this command.\n"); return; } *************** *** 724,728 **** } ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, msg); } --- 726,730 ---- } ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, msg); } *************** *** 740,753 **** String s; ! s= GameBase.gi.args(); it= GameUtil.FindItem(s); if (it == null) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "unknown item: " + s + "\n"); return; } if (it.use == null) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "Item is not usable.\n"); return; } --- 742,755 ---- String s; ! s= Cmd.Args(); it= GameUtil.FindItem(s); if (it == null) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "unknown item: " + s + "\n"); return; } if (it.use == null) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "Item is not usable.\n"); return; } *************** *** 755,759 **** if (0 == ent.client.pers.inventory[index]) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "Out of item: " + s + "\n"); return; } --- 757,761 ---- if (0 == ent.client.pers.inventory[index]) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "Out of item: " + s + "\n"); return; } *************** *** 775,788 **** String s; ! s= GameBase.gi.args(); it= GameUtil.FindItem(s); if (it == null) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "unknown item: " + s + "\n"); return; } if (it.drop == null) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "Item is not dropable.\n"); return; } --- 777,790 ---- String s; ! s= Cmd.Args(); it= GameUtil.FindItem(s); if (it == null) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "unknown item: " + s + "\n"); return; } if (it.drop == null) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "Item is not dropable.\n"); return; } *************** *** 790,794 **** if (0 == ent.client.pers.inventory[index]) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "Out of item: " + s + "\n"); return; } --- 792,796 ---- if (0 == ent.client.pers.inventory[index]) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "Out of item: " + s + "\n"); return; } *************** *** 841,845 **** if (ent.client.pers.selected_item == -1) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "No item to use.\n"); return; } --- 843,847 ---- if (ent.client.pers.selected_item == -1) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "No item to use.\n"); return; } *************** *** 848,852 **** if (it.use == null) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "Item is not usable.\n"); return; } --- 850,854 ---- if (it.use == null) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "Item is not usable.\n"); return; } *************** *** 971,975 **** if (ent.client.pers.selected_item == -1) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "No item to drop.\n"); return; } --- 973,977 ---- if (ent.client.pers.selected_item == -1) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "No item to drop.\n"); return; } *************** *** 978,982 **** if (it.drop == null) { ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "Item is not dropable.\n"); return; } --- 980,984 ---- if (it.drop == null) { ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "Item is not dropable.\n"); return; } *************** *** 1118,1122 **** } ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "" + large + "\n" + count + " players\n"); } --- 1120,1124 ---- } ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "" + large + "\n" + count + " players\n"); } *************** *** 1130,1134 **** int i; ! i= Lib.atoi(GameBase.gi.argv(1)); // can't wave when ducked --- 1132,1136 ---- int i; ! i= Lib.atoi(Cmd.Argv(1)); // can't wave when ducked *************** *** 1144,1163 **** { case 0 : ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "flipoff\n"); ent.s.frame= M_Player.FRAME_flip01 - 1; ent.client.anim_end= M_Player.FRAME_flip12; break; case 1 : ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "salute\n"); ent.s.frame= M_Player.FRAME_salute01 - 1; ent.client.anim_end= M_Player.FRAME_salute11; break; case 2 : ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "taunt\n"); ent.s.frame= M_Player.FRAME_taunt01 - 1; ent.client.anim_end= M_Player.FRAME_taunt17; break; case 3 : ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "wave\n"); ent.s.frame= M_Player.FRAME_wave01 - 1; ent.client.anim_end= M_Player.FRAME_wave11; --- 1146,1165 ---- { case 0 : ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "flipoff\n"); ent.s.frame= M_Player.FRAME_flip01 - 1; ent.client.anim_end= M_Player.FRAME_flip12; break; case 1 : ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "salute\n"); ent.s.frame= M_Player.FRAME_salute01 - 1; ent.client.anim_end= M_Player.FRAME_salute11; break; case 2 : ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "taunt\n"); ent.s.frame= M_Player.FRAME_taunt01 - 1; ent.client.anim_end= M_Player.FRAME_taunt17; break; case 3 : ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "wave\n"); ent.s.frame= M_Player.FRAME_wave01 - 1; ent.client.anim_end= M_Player.FRAME_wave11; *************** *** 1165,1169 **** case 4 : default : ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "point\n"); ent.s.frame= M_Player.FRAME_point01 - 1; ent.client.anim_end= M_Player.FRAME_point12; --- 1167,1171 ---- case 4 : default : ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "point\n"); ent.s.frame= M_Player.FRAME_point01 - 1; ent.client.anim_end= M_Player.FRAME_point12; *************** *** 1185,1189 **** gclient_t cl; ! if (gi.argc() < 2 && !arg0) return; --- 1187,1191 ---- gclient_t cl; ! if (Cmd.Argc() < 2 && !arg0) return; *************** *** 1198,1211 **** if (arg0) { ! text += gi.argv(0); text += " "; ! text += gi.args(); } else { ! if (gi.args().startsWith("\"")) ! text += gi.args().substring(1, gi.args().length() - 1); else ! text += gi.args(); /* p = gi.args(); --- 1200,1213 ---- if (arg0) { ! text += Cmd.Argv(0); text += " "; ! text += Cmd.Args(); } else { ! if (Cmd.Args().startsWith("\"")) ! text += Cmd.Args().substring(1, Cmd.Args().length() - 1); else ! text += Cmd.Args(); /* p = gi.args(); *************** *** 1233,1237 **** if (level.time < cl.flood_locktill) { ! gi.cprintf(ent, PRINT_HIGH, "You can't talk for " + (int) (cl.flood_locktill - level.time) + " more seconds\n"); return; } --- 1235,1239 ---- if (level.time < cl.flood_locktill) { ! SV_GAME.PF_cprintf(ent, PRINT_HIGH, "You can't talk for " + (int) (cl.flood_locktill - level.time) + " more seconds\n"); return; } *************** *** 1243,1247 **** { cl.flood_locktill= level.time + flood_waitdelay.value; ! gi.cprintf(ent, PRINT_CHAT, "Flood protection: You can't talk for " + (int) flood_waitdelay.value + " seconds.\n"); return; } --- 1245,1249 ---- { cl.flood_locktill= level.time + flood_waitdelay.value; ! SV_GAME.PF_cprintf(ent, PRINT_CHAT, "Flood protection: You can't talk for " + (int) flood_waitdelay.value + " seconds.\n"); return; } *************** *** 1252,1256 **** if (dedicated.value != 0) ! gi.cprintf(null, PRINT_CHAT, "" + text + ""); for (j= 1; j <= game.maxclients; j++) --- 1254,1258 ---- if (dedicated.value != 0) ! SV_GAME.PF_cprintf(null, PRINT_CHAT, "" + text + ""); for (j= 1; j <= game.maxclients; j++) *************** *** 1266,1270 **** continue; } ! gi.cprintf(other, PRINT_CHAT, "" + text + ""); } --- 1268,1272 ---- continue; } ! SV_GAME.PF_cprintf(other, PRINT_CHAT, "" + text + ""); } *************** *** 1309,1318 **** { text += "And more...\n"; ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "" + text + ""); return; } text += st; } ! GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, text); } --- 1311,1320 ---- { text += "And more...\n"; ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, "" + text + ""); return; } text += st; } ! SV_GAME.PF_cprintf(ent, Defines.PRINT_HIGH, text); } *************** *** 1346,1350 **** SZ.Print(Globals.cls.netchan.message, Cmd.Args()); } ! }; } --- 1348,1372 ---- SZ.Print(Globals.cls.netchan.message, Cmd.Args()); } ! } ! ! /* ! ============ ! Cmd_CompleteCommand ! ============ ! */ ! public static Vector CompleteCommand(String partial) ! { ! Vector cmds = new Vector(); ! ! // check for match ! for (cmd_function_t cmd = cmd_functions; cmd != null ; cmd = cmd.next) ! if (cmd.name.startsWith(partial)) ! cmds.add(cmd.name); ! for (cmdalias_t a = cmd_alias; a != null; a=a.next) ! if (a.name.startsWith(partial)) ! cmds.add(a.name); ! ! return cmds; ! } } |
From: Holger Z. <hz...@us...> - 2004-08-19 20:56:50
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21198/src/jake2/client Modified Files: Key.java Log Message: command line completion remove references to GameBase.gi from Cmd Index: Key.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Key.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Key.java 23 Jul 2004 10:02:49 -0000 1.5 --- Key.java 19 Aug 2004 20:56:41 -0000 1.6 *************** *** 26,40 **** package jake2.client; - import java.io.IOException; - import java.io.RandomAccessFile; - import jake2.Defines; import jake2.Globals; import jake2.game.Cmd; import jake2.qcommon.*; - import jake2.qcommon.Cbuf; - import jake2.qcommon.Com; import jake2.util.Lib; /** * Key --- 26,39 ---- package jake2.client; import jake2.Defines; import jake2.Globals; import jake2.game.Cmd; import jake2.qcommon.*; import jake2.util.Lib; + import java.io.IOException; + import java.io.RandomAccessFile; + import java.util.Vector; + /** * Key *************** *** 674,697 **** } static void CompleteCommand() { ! // 00166 char *cmd, *s; ! // 00167 ! // 00168 s = key_lines[edit_line]+1; ! // 00169 if (*s == '\\' || *s == '/') ! // 00170 s++; ! // 00171 ! // 00172 cmd = Cmd_CompleteCommand (s); ! // 00173 if (!cmd) ! // 00174 cmd = Cvar_CompleteVariable (s); ! // 00175 if (cmd) ! // 00176 { ! // 00177 key_lines[edit_line][1] = '/'; ! // 00178 strcpy (key_lines[edit_line]+2, cmd); ! // 00179 key_linepos = strlen(cmd)+2; ! // 00180 key_lines[edit_line][key_linepos] = ' '; ! // 00181 key_linepos++; ! // 00182 key_lines[edit_line][key_linepos] = 0; ! // 00183 return; ! // 00184 } } --- 673,719 ---- } + private static void printCompletions(String type, Vector compl) { + Com.Printf(type); + for (int i = 0; i < compl.size(); i++) { + Com.Printf((String)compl.get(i) + " "); + } + Com.Printf("\n"); + } + static void CompleteCommand() { ! ! int start = 1; ! if (key_lines[edit_line][start] == '\\' || key_lines[edit_line][start] == '/') ! start++; ! ! int end = start; ! while (key_lines[edit_line][end] != 0) end++; ! ! String s = new String(key_lines[edit_line], start, end-start); ! ! Vector cmds = Cmd.CompleteCommand(s); ! Vector vars = Cvar.CompleteVariable(s); ! ! int c = cmds.size(); ! int v = vars.size(); ! ! if ((c + v) > 1) { ! if (c > 0) printCompletions("\nCommands:\n", cmds); ! if (v > 0) printCompletions("\nVariables:\n", vars); ! return; ! } else if (c == 1) { ! s = (String)cmds.get(0); ! } else if (v == 1) { ! s = (String)vars.get(0); ! } else return; ! ! key_lines[edit_line][1] = '/'; ! byte[] bytes = s.getBytes(); ! System.arraycopy(bytes, 0, key_lines[edit_line], 2, bytes.length); ! key_linepos = bytes.length + 2; ! key_lines[edit_line][key_linepos++] = ' '; ! key_lines[edit_line][key_linepos] = 0; ! ! return; } |
From: Holger Z. <hz...@us...> - 2004-08-19 20:56:50
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21198/src/jake2/qcommon Modified Files: Cvar.java Log Message: command line completion remove references to GameBase.gi from Cmd Index: Cvar.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Cvar.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Cvar.java 30 Jul 2004 06:08:41 -0000 1.3 --- Cvar.java 19 Aug 2004 20:56:41 -0000 1.4 *************** *** 29,32 **** --- 29,33 ---- import java.io.IOException; import java.io.RandomAccessFile; + import java.util.Vector; import jake2.Defines; *************** *** 431,449 **** ============ */ ! static String CompleteVariable(String partial) { ! cvar_t cvar; ! int len; ! ! len = partial.length(); ! ! if (len == 0) ! return null; // check match ! for (cvar = Globals.cvar_vars; cvar != null; cvar = cvar.next) if (cvar.name.startsWith(partial)) ! return cvar.name; ! ! return null; } --- 432,445 ---- ============ */ ! public static Vector CompleteVariable(String partial) { ! ! Vector vars = new Vector(); // check match ! for (cvar_t cvar = Globals.cvar_vars; cvar != null; cvar = cvar.next) if (cvar.name.startsWith(partial)) ! vars.add(cvar.name); ! ! return vars; } |
From: Holger Z. <hz...@us...> - 2004-08-19 20:50:07
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19923/src/jake2/render Modified Files: JoglBase.java Log Message: disable FocusTraversalKeys for the GLCanvas Index: JoglBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/JoglBase.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JoglBase.java 16 Jul 2004 12:12:29 -0000 1.5 --- JoglBase.java 19 Aug 2004 20:49:56 -0000 1.6 *************** *** 193,199 **** window = new JFrame("Jake2"); - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); // TODO Use debug pipeline //canvas.setGL(new DebugGL(canvas.getGL())); --- 193,201 ---- window = new JFrame("Jake2"); GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + // we want keypressed events for TAB key + canvas.setFocusTraversalKeysEnabled(false); + // TODO Use debug pipeline //canvas.setGL(new DebugGL(canvas.getGL())); *************** *** 206,210 **** window.getContentPane().add(canvas); - canvas.setSize(newDim.width, newDim.height); --- 208,211 ---- |
From: Holger Z. <hz...@us...> - 2004-08-18 20:27:46
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2469/src/jake2/qcommon Modified Files: Qcommon.java Log Message: remove Swap class Index: Qcommon.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Qcommon.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Qcommon.java 9 Jul 2004 06:50:49 -0000 1.4 --- Qcommon.java 18 Aug 2004 20:27:36 -0000 1.5 *************** *** 29,33 **** import jake2.client.*; import jake2.game.Cmd; - import jake2.game.Swap; import jake2.server.SV_MAIN; import jake2.sys.NET; --- 29,32 ---- *************** *** 60,64 **** Com.InitArgv(args); - Swap.Init(); Cbuf.Init(); --- 59,62 ---- |
From: Holger Z. <hz...@us...> - 2004-08-18 20:27:46
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2469/src/jake2/client Modified Files: CL.java Log Message: remove Swap class Index: CL.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CL.java 30 Jul 2004 06:03:40 -0000 1.6 --- CL.java 18 Aug 2004 20:27:35 -0000 1.7 *************** *** 38,41 **** --- 38,42 ---- import java.io.RandomAccessFile; import java.nio.ByteBuffer; + import java.nio.ByteOrder; /** *************** *** 949,953 **** } ByteBuffer bb = ByteBuffer.wrap(precache_model); ! int header = Globals.endian.LittleLong(bb.getInt()); if (header != qfiles.IDALIASHEADER) { --- 950,956 ---- } ByteBuffer bb = ByteBuffer.wrap(precache_model); ! bb.order(ByteOrder.LITTLE_ENDIAN); ! ! int header = bb.getInt(); if (header != qfiles.IDALIASHEADER) { *************** *** 959,964 **** continue; } ! pheader = new qfiles.dmdl_t(ByteBuffer.wrap(precache_model)); ! if (Globals.endian.LittleLong(pheader.version) != ALIAS_VERSION) { precache_check++; precache_model_skin = 0; --- 962,967 ---- continue; } ! pheader = new qfiles.dmdl_t(ByteBuffer.wrap(precache_model).order(ByteOrder.LITTLE_ENDIAN)); ! if (pheader.version != ALIAS_VERSION) { precache_check++; precache_model_skin = 0; *************** *** 967,973 **** } ! pheader = new qfiles.dmdl_t(ByteBuffer.wrap(precache_model)); ! int num_skins = Globals.endian.LittleLong(pheader.num_skins); while (precache_model_skin - 1 < num_skins) { --- 970,976 ---- } ! pheader = new qfiles.dmdl_t(ByteBuffer.wrap(precache_model).order(ByteOrder.LITTLE_ENDIAN)); ! int num_skins = pheader.num_skins; while (precache_model_skin - 1 < num_skins) { *************** *** 977,981 **** new String( precache_model, ! Globals.endian.LittleLong(pheader.ofs_skins) + (precache_model_skin - 1) * MAX_SKINNAME, MAX_SKINNAME * num_skins); --- 980,984 ---- new String( precache_model, ! pheader.ofs_skins + (precache_model_skin - 1) * MAX_SKINNAME, MAX_SKINNAME * num_skins); |
From: Holger Z. <hz...@us...> - 2004-08-18 20:27:46
|
Update of /cvsroot/jake2/jake2/src/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2469/src/jake2 Modified Files: Globals.java Log Message: remove Swap class Index: Globals.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/Globals.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Globals.java 8 Jul 2004 20:24:48 -0000 1.3 --- Globals.java 18 Aug 2004 20:27:36 -0000 1.4 *************** *** 129,134 **** public static FileWriter log_stats_file = null; - public static EndianHandler endian = null; - public static cvar_t m_pitch; public static cvar_t m_yaw; --- 129,132 ---- |
From: Holger Z. <hz...@us...> - 2004-08-18 20:27:46
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2469/src/jake2/game Removed Files: Swap.java Log Message: remove Swap class --- Swap.java DELETED --- |
From: Holger Z. <hz...@us...> - 2004-07-30 06:08:49
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6917/src/jake2/qcommon Modified Files: Cvar.java Log Message: replace serverState functions Index: Cvar.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Cvar.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Cvar.java 20 Jul 2004 11:02:24 -0000 1.2 --- Cvar.java 30 Jul 2004 06:08:41 -0000 1.3 *************** *** 190,194 **** } ! if (Com.ServerState() != 0) { Com.Printf(var_name + " will be changed for next game.\n"); var.latched_string = value; --- 190,194 ---- } ! if (Globals.server_state != 0) { Com.Printf(var_name + " will be changed for next game.\n"); var.latched_string = value; |
From: Holger Z. <hz...@us...> - 2004-07-30 06:07:31
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6757/src/jake2/server Modified Files: SV.java SV_INIT.java SV_MAIN.java Log Message: replace serverState and game_interface functions Index: SV.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SV.java 26 Jul 2004 19:17:06 -0000 1.4 --- SV.java 30 Jul 2004 06:07:23 -0000 1.5 *************** *** 26,36 **** package jake2.server; ! import jake2.*; import jake2.game.*; import jake2.qcommon.Com; ! import jake2.util.*; ! import jake2.client.*; ! import jake2.game.*; ! import jake2.game.trace_t; /** --- 26,35 ---- package jake2.server; ! import jake2.Defines; ! import jake2.client.M; import jake2.game.*; import jake2.qcommon.Com; ! import jake2.util.Lib; ! import jake2.util.Math3D; /** *************** *** 91,95 **** if (ent.think == null) ! GameBase.gi.error("NULL ent.think"); ent.think.think(ent); --- 90,94 ---- if (ent.think == null) ! Com.Error(Defines.ERR_FATAL, "NULL ent.think"); ent.think.think(ent); *************** *** 487,491 **** } if (GameBase.pushed_p > Defines.MAX_EDICTS) ! GameBase.gi.error(Defines.ERR_FATAL, "pushed_p > &pushed[MAX_EDICTS], memory corrupted"); if (part != null) { --- 486,490 ---- } if (GameBase.pushed_p > Defines.MAX_EDICTS) ! SV_GAME.PF_error(Defines.ERR_FATAL, "pushed_p > &pushed[MAX_EDICTS], memory corrupted"); if (part != null) { Index: SV_MAIN.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_MAIN.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SV_MAIN.java 23 Jul 2004 10:09:01 -0000 1.4 --- SV_MAIN.java 30 Jul 2004 06:07:23 -0000 1.5 *************** *** 1007,1013 **** //memset (&sv, 0, sizeof(sv)); sv = new server_t(); - ! Com.SetServerState (sv.state); // free server static data --- 1007,1012 ---- //memset (&sv, 0, sizeof(sv)); sv = new server_t(); ! Globals.server_state= sv.state; // free server static data Index: SV_INIT.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_INIT.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SV_INIT.java 9 Jul 2004 06:50:49 -0000 1.4 --- SV_INIT.java 30 Jul 2004 06:07:23 -0000 1.5 *************** *** 24,37 **** package jake2.server; ! import java.io.IOException; ! import java.io.RandomAccessFile; ! ! import jake2.*; ! import jake2.client.*; import jake2.game.*; import jake2.qcommon.*; - import jake2.render.*; import jake2.sys.NET; ! import jake2.util.Lib; public class SV_INIT extends Globals { --- 24,36 ---- package jake2.server; ! import jake2.Globals; ! import jake2.client.CL; ! import jake2.client.SCR; import jake2.game.*; import jake2.qcommon.*; import jake2.sys.NET; ! ! import java.io.IOException; ! import java.io.RandomAccessFile; public class SV_INIT extends Globals { *************** *** 212,216 **** sv.state = ss_dead; ! Com.SetServerState(sv.state); // wipe the entire per-level structure --- 211,215 ---- sv.state = ss_dead; ! Globals.server_state= sv.state; // wipe the entire per-level structure *************** *** 281,285 **** // map initialization sv.state = ss_loading; ! Com.SetServerState(sv.state); // load and spawn all other entities --- 280,284 ---- // map initialization sv.state = ss_loading; ! Globals.server_state= sv.state; // load and spawn all other entities *************** *** 292,296 **** // all precaches are complete sv.state = serverstate; ! Com.SetServerState(sv.state); // create a baseline for more efficient communications --- 291,295 ---- // all precaches are complete sv.state = serverstate; ! Globals.server_state= sv.state; // create a baseline for more efficient communications |
From: Holger Z. <hz...@us...> - 2004-07-30 06:03:50
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6298/src/jake2/client Modified Files: CL.java CL_parse.java Menu.java Console.java Log Message: replace serverState functions Index: Menu.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Menu.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Menu.java 23 Jul 2004 10:02:49 -0000 1.5 --- Menu.java 30 Jul 2004 06:03:40 -0000 1.6 *************** *** 159,163 **** int i; ! if (Cvar.VariableValue("maxclients") == 1 && Com.ServerState() != 0) Cvar.Set("paused", "1"); --- 159,163 ---- int i; ! if (Cvar.VariableValue("maxclients") == 1 && Globals.server_state != 0) Cvar.Set("paused", "1"); *************** *** 2476,2480 **** }; static void Menu_SaveGame_f() { ! if (0 == Com.ServerState()) return; // not playing a game --- 2476,2480 ---- }; static void Menu_SaveGame_f() { ! if (0 == Globals.server_state) return; // not playing a game *************** *** 2801,2805 **** if (spot != null) { ! if (Com.ServerState() != 0) Cbuf.AddText("disconnect\n"); Cbuf.AddText("gamemap \"*" + startmap + "$" + spot + "\"\n"); --- 2801,2805 ---- if (spot != null) { ! if (Globals.server_state != 0) Cbuf.AddText("disconnect\n"); Cbuf.AddText("gamemap \"*" + startmap + "$" + spot + "\"\n"); Index: Console.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/Console.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Console.java 19 Jul 2004 19:20:22 -0000 1.3 --- Console.java 30 Jul 2004 06:03:40 -0000 1.4 *************** *** 67,71 **** Globals.cls.key_dest = Defines.key_console; ! if (Cvar.VariableValue("maxclients") == 1 && Com.ServerState()!= 0) Cvar.Set("paused", "1"); } --- 67,71 ---- Globals.cls.key_dest = Defines.key_console; ! if (Cvar.VariableValue("maxclients") == 1 && Globals.server_state!= 0) Cvar.Set("paused", "1"); } Index: CL_parse.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_parse.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CL_parse.java 23 Jul 2004 22:38:51 -0000 1.7 --- CL_parse.java 30 Jul 2004 06:03:40 -0000 1.8 *************** *** 27,30 **** --- 27,31 ---- import jake2.Defines; + import jake2.Globals; import jake2.game.Cmd; import jake2.game.entity_state_t; *************** *** 316,320 **** // BIG HACK to let demos from release work with the 3.0x patch!!! ! if (Com.ServerState() != 0 && PROTOCOL_VERSION == 34) { } else if (i != PROTOCOL_VERSION) --- 317,321 ---- // BIG HACK to let demos from release work with the 3.0x patch!!! ! if (Globals.server_state != 0 && PROTOCOL_VERSION == 34) { } else if (i != PROTOCOL_VERSION) Index: CL.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CL.java 9 Jul 2004 06:50:50 -0000 1.5 --- CL.java 30 Jul 2004 06:03:40 -0000 1.6 *************** *** 250,254 **** // never pause in multiplayer ! if (Cvar.VariableValue("maxclients") > 1 || Com.ServerState() == 0) { Cvar.SetValue("paused", 0); return; --- 250,254 ---- // never pause in multiplayer ! if (Cvar.VariableValue("maxclients") > 1 || Globals.server_state == 0) { Cvar.SetValue("paused", 0); return; *************** *** 313,317 **** // if the local server is running and we aren't // then connect ! if (cls.state == ca_disconnected && Com.ServerState() != 0) { cls.state = ca_connecting; cls.servername = "localhost"; --- 313,317 ---- // if the local server is running and we aren't // then connect ! if (cls.state == ca_disconnected && Globals.server_state != 0) { cls.state = ca_connecting; cls.servername = "localhost"; *************** *** 359,363 **** } ! if (Com.ServerState() != 0) { // if running a local server, kill it and reissue SV_MAIN.SV_Shutdown("Server quit\n", false); --- 359,363 ---- } ! if (Globals.server_state != 0) { // if running a local server, kill it and reissue SV_MAIN.SV_Shutdown("Server quit\n", false); |
From: Holger Z. <hz...@us...> - 2004-07-28 12:01:41
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29850/src/jake2/qcommon Modified Files: CM.java Log Message: replace Lib functions Index: CM.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/CM.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CM.java 12 Jul 2004 20:47:00 -0000 1.4 --- CM.java 28 Jul 2004 12:01:27 -0000 1.5 *************** *** 199,203 **** map_noareas = Cvar.Get("map_noareas", "0", 0); ! if (0 == strcmp(map_name, name) && (clientload || 0 == Cvar.VariableValue("flushmap"))) { checksum[0] = last_checksum; --- 199,203 ---- map_noareas = Cvar.Get("map_noareas", "0", 0); ! if (map_name.equals(name) && (clientload || 0 == Cvar.VariableValue("flushmap"))) { checksum[0] = last_checksum; |
From: Holger Z. <hz...@us...> - 2004-07-28 11:59:43
|
Update of /cvsroot/jake2/jake2/src/jake2/sys In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29450/src/jake2/sys Modified Files: Sys.java Log Message: replace Lib functions Index: Sys.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sys/Sys.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Sys.java 19 Jul 2004 19:22:57 -0000 1.5 --- Sys.java 28 Jul 2004 11:59:32 -0000 1.6 *************** *** 177,181 **** String name = dir.getName(); ! if (Lib.strcmp(name, ".") == 0 || Lib.strcmp(name, "..") == 0) return false; --- 177,181 ---- String name = dir.getName(); ! if (name.equals(".") || name.equals("..")) return false; |
From: Holger Z. <hz...@us...> - 2004-07-28 11:58:22
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29321/src/jake2/qcommon Modified Files: MSG.java Log Message: unify string read buffers Index: MSG.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/MSG.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MSG.java 8 Jul 2004 20:24:48 -0000 1.3 --- MSG.java 28 Jul 2004 11:58:10 -0000 1.4 *************** *** 478,487 **** } while (l < 2047); - //readbuf[l] = 0; return new String(readbuf, 0, l); } - // 2k read buffer. - public static byte readbuf1[] = new byte[2048]; public static String ReadStringLine(sizebuf_t msg_read) { --- 478,484 ---- *************** *** 494,505 **** if (c == -1 || c == 0 || c == 0x0a) break; ! readbuf1[l] = c; l++; ! } ! while (l < 2047); ! ! readbuf1[l] = 0; ! return new String(readbuf1, 0, l).trim(); } --- 491,499 ---- if (c == -1 || c == 0 || c == 0x0a) break; ! readbuf[l] = c; l++; ! } while (l < 2047); ! return new String(readbuf, 0, l).trim(); } *************** *** 563,572 **** public static void ReadData(sizebuf_t msg_read, byte data[], int len) { ! int i; ! ! for (i = 0; i < len; i++) data[i] = (byte) ReadByte(msg_read); } - - //============================================================================ } --- 557,562 ---- public static void ReadData(sizebuf_t msg_read, byte data[], int len) { ! for (int i = 0; i < len; i++) data[i] = (byte) ReadByte(msg_read); } } |
From: Holger Z. <hz...@us...> - 2004-07-28 11:54:58
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28905/src/jake2/qcommon Modified Files: Com.java Log Message: fix parser bug Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Com.java 23 Jul 2004 22:38:52 -0000 1.4 --- Com.java 28 Jul 2004 11:54:43 -0000 1.5 *************** *** 87,96 **** public static class ParseHelp { - - public ParseHelp(String in, int offset) - { - this(in.toCharArray(), offset); - } - public ParseHelp(String in) { --- 87,90 ---- *************** *** 113,120 **** public ParseHelp(char in[], int offset) { ! if (in == null || in.length == 0) ! data= null; ! else ! data= in; index= offset; } --- 107,111 ---- public ParseHelp(char in[], int offset) { ! data= in; index= offset; } *************** *** 152,155 **** --- 143,155 ---- } } + + public char prevchar() { + if (index > 0) + { + index--; + return data[index]; + } + return 0; + } public boolean isEof() *************** *** 189,247 **** // See GameSpanw.ED_ParseEdict() to see how to use it now. ! // works perfect ! ! public static String Parse(ParseHelp hlp) ! { ! int c; ! int len= 0; ! len= 0; ! ! com_token[0]= 0; ! if (hlp.data == null) ! { return ""; } ! // skip whitespace ! hlp.skipwhites(); ! ! if (hlp.isEof()) ! { ! return ""; ! } ! // skip // comments ! if (hlp.getchar() == '/') ! { ! if (hlp.nextchar() == '/') ! { ! if ((hlp.skiptoeol() == 0) || (hlp.skipwhites() == 0)) ! { return ""; } ! } ! else ! { ! com_token[len]= '/'; ! len++; ! } } - // handle quoted strings specially - if (hlp.getchar() == '\"') - { - while (true) - { - c= hlp.nextchar(); - if (c == '\"' || c == 0) - { ! hlp.nextchar(); ! com_token[len]= '?'; return new String(com_token, 0, len); } ! if (len < Defines.MAX_TOKEN_CHARS) ! { ! com_token[len]= hlp.getchar(); len++; } --- 189,230 ---- // See GameSpanw.ED_ParseEdict() to see how to use it now. ! public static String Parse(ParseHelp hlp) { int c; ! int len = 0; ! if (hlp.data == null) { return ""; } ! while (true) { ! // skip whitespace ! hlp.skipwhites(); ! if (hlp.isEof()) ! return ""; ! // skip // comments ! if (hlp.getchar() == '/') { ! if (hlp.nextchar() == '/') { ! hlp.skipwhitestoeol(); return ""; + } else { + hlp.prevchar(); + break; } ! } else ! break; } ! // handle quoted strings specially ! if (hlp.getchar() == '\"') { ! hlp.nextchar(); ! while (true) { ! c = hlp.getchar(); ! hlp.nextchar(); ! if (c == '\"' || c == 0) { return new String(com_token, 0, len); } ! if (len < Defines.MAX_TOKEN_CHARS) { ! com_token[len] = (char) c; len++; } *************** *** 249,275 **** } ! // parse a regular word ! do ! { ! if (len < Defines.MAX_TOKEN_CHARS) ! { ! com_token[len]= hlp.getchar(); len++; } ! c= hlp.nextchar(); ! } ! while (c > 32); ! ! if (len == Defines.MAX_TOKEN_CHARS) ! { ! Printf("Token exceeded " + Defines.MAX_TOKEN_CHARS + " chars, discarded.\n"); ! len= 0; } - // trigger the eof - hlp.skipwhites(); - - com_token[len]= 0; return new String(com_token, 0, len); } --- 232,250 ---- } ! // parse a regular word ! c = hlp.getchar(); ! do { ! if (len < Defines.MAX_TOKEN_CHARS) { ! com_token[len] = (char) c; len++; } + c = hlp.nextchar(); + } while (c > 32); ! if (len == Defines.MAX_TOKEN_CHARS) { ! Com.Printf("Token exceeded " + Defines.MAX_TOKEN_CHARS + " chars, discarded.\n"); ! len = 0; } return new String(com_token, 0, len); } |
From: Holger Z. <hz...@us...> - 2004-07-27 11:58:40
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9577/src/jake2/render/fastjogl Modified Files: Light.java Log Message: clear s_blocklights again. Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Light.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Light.java 19 Jul 2004 19:39:57 -0000 1.6 --- Light.java 27 Jul 2004 11:58:29 -0000 1.7 *************** *** 571,575 **** // memset( s_blocklights, 0, sizeof( s_blocklights[0] ) * size * 3 ); ! //Arrays.fill(s_blocklights, 0, size * 3, 0.0f); for (maps = 0 ; maps < Defines.MAXLIGHTMAPS && surf.styles[maps] != (byte)255 ; --- 571,575 ---- // memset( s_blocklights, 0, sizeof( s_blocklights[0] ) * size * 3 ); ! Arrays.fill(s_blocklights, 0, size * 3, 0.0f); for (maps = 0 ; maps < Defines.MAXLIGHTMAPS && surf.styles[maps] != (byte)255 ; |
From: Holger Z. <hz...@us...> - 2004-07-26 19:17:15
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10596/src/jake2/server Modified Files: SV.java Log Message: replace Com.d() Index: SV.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SV.java 26 Jul 2004 18:45:48 -0000 1.3 --- SV.java 26 Jul 2004 19:17:06 -0000 1.4 *************** *** 1019,1023 **** if (enemy == null) { ! Com.DPrintf("SV_NewChaseDir without enemy!"); return; } --- 1019,1023 ---- if (enemy == null) { ! Com.DPrintf("SV_NewChaseDir without enemy!\n"); return; } |
From: Carsten W. <ca...@us...> - 2004-07-26 18:46:12
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4492/src/jake2/server Modified Files: SV.java Log Message: bugfix Index: SV.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SV.java 8 Jul 2004 15:58:45 -0000 1.2 --- SV.java 26 Jul 2004 18:45:48 -0000 1.3 *************** *** 1019,1023 **** if (enemy == null) { ! Com.d("SV_NewChaseDir without enemy!"); return; } --- 1019,1023 ---- if (enemy == null) { ! Com.DPrintf("SV_NewChaseDir without enemy!"); return; } |
From: Holger Z. <hz...@us...> - 2004-07-23 22:39:04
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11377/src/jake2/qcommon Modified Files: Com.java Log Message: fix download bug Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Com.java 9 Jul 2004 06:50:50 -0000 1.3 --- Com.java 23 Jul 2004 22:38:52 -0000 1.4 *************** *** 351,359 **** } - public static void d(String fmt) - { - DPrintf(fmt + "\n", null); - } - public static void Printf(String fmt) { --- 351,354 ---- *************** *** 516,522 **** } ! public static void StripExtension(String string, String string2) ! { ! // TODO implement StripExtension } --- 511,519 ---- } ! public static String StripExtension(String string) { ! int i = string.lastIndexOf('.'); ! if (i < 0) ! return string; ! return string.substring(0, i); } *************** *** 524,528 **** * CRC table. */ - static int chktbl[]= { --- 521,524 ---- |
From: Holger Z. <hz...@us...> - 2004-07-23 22:39:00
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11377/src/jake2/client Modified Files: CL_parse.java Log Message: fix download bug Index: CL_parse.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/CL_parse.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CL_parse.java 12 Jul 2004 20:47:01 -0000 1.6 --- CL_parse.java 23 Jul 2004 22:38:51 -0000 1.7 *************** *** 104,108 **** // to the real name when done, so if interrupted // a runt file wont be left ! Com.StripExtension(cls.downloadname, cls.downloadtempname); cls.downloadtempname += ".tmp"; --- 104,108 ---- // to the real name when done, so if interrupted // a runt file wont be left ! cls.downloadtempname = Com.StripExtension(cls.downloadname); cls.downloadtempname += ".tmp"; *************** *** 176,180 **** // to the real name when done, so if interrupted // a runt file wont be left ! Com.StripExtension(cls.downloadname, cls.downloadtempname); cls.downloadtempname += ".tmp"; --- 176,180 ---- // to the real name when done, so if interrupted // a runt file wont be left ! cls.downloadtempname = Com.StripExtension(cls.downloadname); cls.downloadtempname += ".tmp"; |
From: Holger Z. <hz...@us...> - 2004-07-23 10:10:07
|
Update of /cvsroot/jake2/jake2/src/jake2/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11303/src/jake2/util Modified Files: Lib.java Log Message: replace Lib functions Index: Lib.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/util/Lib.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Lib.java 12 Jul 2004 20:47:01 -0000 1.4 --- Lib.java 23 Jul 2004 10:09:55 -0000 1.5 *************** *** 76,83 **** } - public static int stricmp(String in1, String in2) { - return in1.compareToIgnoreCase(in2); - } - public static boolean strstr(String i1, String i2) { return (i1.indexOf(i2) != -1); --- 76,79 ---- *************** *** 124,131 **** } - // public static int strlen(String in) { - // return in.length(); - // } - public static int strlen(char in[]) { for (int i = 0; i < in.length; i++) --- 120,123 ---- *************** *** 142,160 **** } - public static void strcat(String in, String i) { - in += i; - } - - public static void strcpy(byte dest[], byte src[]) { - for (int i = 0; i < dest.length && i < src.length; i++) - if (src[i] == 0) { - dest[i] = 0; - return; - } - else - dest[i] = src[i]; - - } - static byte[] buffer = new byte[Defines.MAX_INFO_STRING]; public static String readString(ByteBuffer bb, int len) { --- 134,137 ---- *************** *** 243,254 **** } - public static String cut(String in, char c) { - int pos = in.indexOf(c); - - if (pos != -1) - return in.substring(0, pos); - return in; - } - public static RandomAccessFile fopen(String name, String mode) { try { --- 220,223 ---- |
From: Holger Z. <hz...@us...> - 2004-07-23 10:09:11
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11197/src/jake2/server Modified Files: SV_MAIN.java SV_CCMDS.java Log Message: replace Lib functions Index: SV_CCMDS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_CCMDS.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SV_CCMDS.java 14 Jul 2004 15:34:24 -0000 1.4 --- SV_CCMDS.java 23 Jul 2004 10:09:01 -0000 1.5 *************** *** 653,657 **** // if not a pcx, demo, or cinematic, check to make sure the level exists map = Cmd.Argv(1); ! if (!strstr(map, ".")) { expanded = "maps/" + map + ".bsp"; if (FS.LoadFile(expanded) == null) { --- 653,657 ---- // if not a pcx, demo, or cinematic, check to make sure the level exists map = Cmd.Argv(1); ! if (map.indexOf(".") < 0) { expanded = "maps/" + map + ".bsp"; if (FS.LoadFile(expanded) == null) { Index: SV_MAIN.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/SV_MAIN.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SV_MAIN.java 9 Jul 2004 06:50:49 -0000 1.3 --- SV_MAIN.java 23 Jul 2004 10:09:01 -0000 1.4 *************** *** 445,450 **** for (i = 2; i < Cmd.Argc(); i++) { ! strcat(remaining, Cmd.Argv(i)); ! strcat(remaining, " "); } --- 445,450 ---- for (i = 2; i < Cmd.Argc(); i++) { ! remaining += Cmd.Argv(i); ! remaining += " "; } |