|
From: Brian M. <ma...@us...> - 2005-03-29 18:10:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6509/java/org/lwjgl Modified Files: J2SESysImplementation.java LWJGLUtil.java Sys.java Log Message: moved Sys.log to LWJGLUtils and renamed property to org.lwjgl.util.Debug Index: J2SESysImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/J2SESysImplementation.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- J2SESysImplementation.java 20 Jan 2005 22:51:26 -0000 1.1 +++ J2SESysImplementation.java 29 Mar 2005 18:09:26 -0000 1.2 @@ -63,7 +63,7 @@ return (String)transferable.getTransferData(java.awt.datatransfer.DataFlavor.stringFlavor); } } catch (Exception e) { - Sys.log("Exception while getting clipboard: " + e); + LWJGLUtil.log("Exception while getting clipboard: " + e); } return null; } Index: LWJGLUtil.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/LWJGLUtil.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- LWJGLUtil.java 28 Mar 2005 12:44:32 -0000 1.1 +++ LWJGLUtil.java 29 Mar 2005 18:09:26 -0000 1.2 @@ -32,7 +32,6 @@ package org.lwjgl; import org.lwjgl.LWJGLException; -import org.lwjgl.Sys; import java.io.File; import java.lang.reflect.Method; @@ -51,7 +50,10 @@ */ public class LWJGLUtil { - /** + /** Debug flag. */ + public static final boolean DEBUG = Boolean.getBoolean("org.lwjgl.util.Debug"); + + /** * Locates the paths required by a library. * * @param libNames List of library names to look for, in the form of Local Library name, Platform library name. @@ -89,13 +91,13 @@ String classloader_path = LWJGLUtil.getPathFromClassLoader(libname, classloader); if (classloader_path != null) { - Sys.log("getPathFromClassLoader: Path found: " + classloader_path); + LWJGLUtil.log("getPathFromClassLoader: Path found: " + classloader_path); possible_paths.add(classloader_path); } String lwjgl_classloader_path = LWJGLUtil.getPathFromClassLoader("lwjgl", classloader); if (lwjgl_classloader_path != null) { - Sys.log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path); + LWJGLUtil.log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path); possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator)) + File.separator + platform_lib_name); } @@ -123,7 +125,7 @@ */ public static String getPathFromClassLoader(String libname, ClassLoader classloader) { try { - Sys.log("getPathFromClassLoader: searching for: " + libname); + LWJGLUtil.log("getPathFromClassLoader: searching for: " + libname); Object o = classloader; Class c = o.getClass(); while (c != null) { @@ -137,8 +139,19 @@ } } } catch (Exception e) { - Sys.log("Failure locating " + e + " using classloader:" + e); + LWJGLUtil.log("Failure locating " + e + " using classloader:" + e); } return null; } + + /** + * Prints the given message to System.err if DEBUG is true. + * + * @param msg Message to print + */ + public static void log(String msg) { + if (LWJGLUtil.DEBUG) { + System.err.println(msg); + } + } } Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- Sys.java 16 Mar 2005 21:18:40 -0000 1.83 +++ Sys.java 29 Mar 2005 18:09:27 -0000 1.84 @@ -53,10 +53,7 @@ /** The native library name */ private static final String LIBRARY_NAME = "lwjgl"; - /** Debug flag. */ - public static final boolean DEBUG = Boolean.getBoolean("org.lwjgl.Sys.debug"); - - /** OS Name */ + /** OS Name */ private final static String OS_NAME = System.getProperty("os.name"); /** The implementation instance to delegate platform specific behavior to */ @@ -69,7 +66,7 @@ if (!native_version.equals(VERSION)) throw new LinkageError("Version mismatch: jar version is '" + VERSION + "', native libary version is '" + native_version + "'"); - implementation.setDebug(DEBUG); + implementation.setDebug(LWJGLUtil.DEBUG); } private static SysImplementation createImplementation() { @@ -101,16 +98,6 @@ } /** - * Prints the given message to System.err if isDebugEnabled() - * is true. - */ - public static void log(String msg) { - if (Sys.DEBUG) { - System.err.println(msg); - } - } - - /** * Initialization. This is just a dummy method to trigger the static constructor. */ public static void initialize() { |