From a8aabac1c999ca1605c7308833db438666c0d350 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Sun, 3 Apr 2016 16:25:26 -0400 Subject: [PATCH] fix issue #441 --- .../com/jme3/system/JmeDesktopSystem.java | 22 ++++--------------- .../system/jogl/JoglNewtAbstractDisplay.java | 1 - .../jme3/system/jogl/JoglOffscreenBuffer.java | 3 +-- .../com/jme3/system/lwjgl/LwjglContext.java | 3 --- .../com/jme3/system/lwjgl/LwjglContext.java | 11 ---------- .../com/jme3/system/lwjgl/LwjglWindow.java | 2 -- 6 files changed, 5 insertions(+), 37 deletions(-) diff --git a/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java b/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java index 4fcfa17d5..d02b5d21c 100644 --- a/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java +++ b/jme3-desktop/src/main/java/com/jme3/system/JmeDesktopSystem.java @@ -341,27 +341,13 @@ public class JmeDesktopSystem extends JmeSystemDelegate { if (initialized) { return; } - initialized = true; - try { - if (!lowPermissions) { - // can only modify logging settings - // if permissions are available -// JmeFormatter formatter = new JmeFormatter(); -// Handler fileHandler = new FileHandler("jme.log"); -// fileHandler.setFormatter(formatter); -// Logger.getLogger("").addHandler(fileHandler); -// Handler consoleHandler = new ConsoleHandler(); -// consoleHandler.setFormatter(formatter); -// Logger.getLogger("").removeHandler(Logger.getLogger("").getHandlers()[0]); -// Logger.getLogger("").addHandler(consoleHandler); + logger.log(Level.INFO, getBuildInfo()); + if (!lowPermissions) { + if (NativeLibraryLoader.isUsingNativeBullet()) { + NativeLibraryLoader.loadNativeLibrary("bulletjme", true); } -// } catch (IOException ex){ -// logger.log(Level.SEVERE, "I/O Error while creating log file", ex); - } catch (SecurityException ex) { - logger.log(Level.SEVERE, "Security error in creating log file", ex); } - logger.log(Level.INFO, getBuildInfo()); } @Override diff --git a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java index 9c7a49d17..48f191cb3 100644 --- a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java +++ b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglNewtAbstractDisplay.java @@ -73,7 +73,6 @@ public abstract class JoglNewtAbstractDisplay extends JoglContext implements GLE protected boolean wasAnimating = false; protected void initGLCanvas() { - loadNatives(); GLCapabilities caps; if (settings.getRenderer().equals(AppSettings.JOGL_OPENGL_FORWARD_COMPATIBLE)) { caps = new GLCapabilities(GLProfile.getMaxProgrammable(true)); diff --git a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglOffscreenBuffer.java b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglOffscreenBuffer.java index 56aa2d53f..54fa3b552 100644 --- a/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglOffscreenBuffer.java +++ b/jme3-jogl/src/main/java/com/jme3/system/jogl/JoglOffscreenBuffer.java @@ -123,8 +123,7 @@ public class JoglOffscreenBuffer extends JoglContext implements Runnable { } @Override - public void run(){ - loadNatives(); + public void run() { logger.log(Level.FINE, "Using JOGL {0}", JoglVersion.getInstance().getImplementationVersion()); initInThread(); while (!needClose.get()){ diff --git a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java index d1d2dd91b..be3014da5 100644 --- a/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java +++ b/jme3-lwjgl/src/main/java/com/jme3/system/lwjgl/LwjglContext.java @@ -170,9 +170,6 @@ public abstract class LwjglContext implements JmeContext { NativeLibraryLoader.loadNativeLibrary("jinput", true); NativeLibraryLoader.loadNativeLibrary("jinput-dx8", true); } - if (NativeLibraryLoader.isUsingNativeBullet()) { - NativeLibraryLoader.loadNativeLibrary("bulletjme", true); - } NativeLibraryLoader.loadNativeLibrary("lwjgl", true); } protected int getNumSamplesToUse() { diff --git a/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java b/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java index 0fe8a7b23..20532df36 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java @@ -116,17 +116,6 @@ public abstract class LwjglContext implements JmeContext { return samples; } - protected void loadNatives() { - if (JmeSystem.isLowPermissions()) { - return; - } - - if (NativeLibraryLoader.isUsingNativeBullet()) { - NativeLibraryLoader.loadNativeLibrary("bulletjme", true); - } - } - - protected void initContextFirstTime() { final GLCapabilities capabilities = createCapabilities(settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)); diff --git a/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java b/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java index aaa24ce42..cac8ecdd1 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java @@ -315,8 +315,6 @@ public abstract class LwjglWindow extends LwjglContext implements Runnable { }); } - loadNatives(); - timer = new NanoTimer(); // For canvas, this will create a pbuffer,