From 2ec0afa2667a3d24c9b33253eb3050262b1576f5 Mon Sep 17 00:00:00 2001 From: normen667 Date: Tue, 3 May 2011 22:23:54 +0000 Subject: [PATCH] - add disable warning option to Natives.jar extraction git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@7419 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/desktop/com/jme3/system/Natives.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/engine/src/desktop/com/jme3/system/Natives.java b/engine/src/desktop/com/jme3/system/Natives.java index 697eeea62..4f204c95d 100644 --- a/engine/src/desktop/com/jme3/system/Natives.java +++ b/engine/src/desktop/com/jme3/system/Natives.java @@ -58,17 +58,21 @@ public class Natives { } protected static void extractNativeLib(String sysName, String name) throws IOException { - extractNativeLib(sysName, name, false); + extractNativeLib(sysName, name, false, true); } protected static void extractNativeLib(String sysName, String name, boolean load) throws IOException { + extractNativeLib(sysName, name, load, true); + } + + protected static void extractNativeLib(String sysName, String name, boolean load, boolean warning) throws IOException { String fullname = System.mapLibraryName(name); String path = "native/" + sysName + "/" + fullname; InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); //InputStream in = Natives.class.getResourceAsStream(); if (in == null) { - if (name != "bulletjme") { + if (!warning) { logger.log(Level.WARNING, "Cannot locate native library: {0}/{1}", new String[]{sysName, fullname}); } @@ -159,7 +163,7 @@ public class Natives { extractNativeLib("windows", "jinput-raw_64"); } if (needNativeBullet) { - extractNativeLib("windows", "bulletjme", true); + extractNativeLib("windows", "bulletjme", true, false); } break; case Windows32: @@ -174,7 +178,7 @@ public class Natives { extractNativeLib("windows", "jinput-raw"); } if (needNativeBullet) { - extractNativeLib("windows", "bulletjme", true); + extractNativeLib("windows", "bulletjme", true, false); } break; case Linux64: @@ -188,7 +192,7 @@ public class Natives { extractNativeLib("linux", "openal64"); } if (needNativeBullet) { - extractNativeLib("linux", "bulletjme", true); + extractNativeLib("linux", "bulletjme", true, false); } break; case Linux32: @@ -202,7 +206,7 @@ public class Natives { extractNativeLib("linux", "openal"); } if (needNativeBullet) { - extractNativeLib("linux", "bulletjme", true); + extractNativeLib("linux", "bulletjme", true, false); } break; case MacOSX_PPC32: @@ -218,7 +222,7 @@ public class Natives { extractNativeLib("macosx", "jinput-osx"); } if (needNativeBullet) { - extractNativeLib("macosx", "bulletjme", true); + extractNativeLib("macosx", "bulletjme", true, false); } break; } -- 2.11.0