2
0
Эх сурвалжийг харах

update to latest Nifty 1.3.1-SNAPSHOT build especially because of consolidation of resource loading (the ResourceLoader inside of Nifty is now a part of the Nifty instance and not static anymore, see https://github.com/void256/nifty-gui/commit/1001faad0cd21cf11f8d64e3a4f2b591d20787ca for details)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8928 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
voi..om 14 жил өмнө
parent
commit
fe521c76ea

BIN
engine/lib/niftygui/nifty-default-controls-javadoc.jar


BIN
engine/lib/niftygui/nifty-default-controls.jar


BIN
engine/lib/niftygui/nifty-examples-javadoc.jar


BIN
engine/lib/niftygui/nifty-examples.jar


BIN
engine/lib/niftygui/nifty-javadoc.jar


BIN
engine/lib/niftygui/nifty-style-black.jar


BIN
engine/lib/niftygui/nifty.jar


+ 4 - 0
engine/src/niftygui/com/jme3/niftygui/InputSystemJme.java

@@ -38,6 +38,7 @@ import com.jme3.input.RawInputListener;
 import com.jme3.input.event.*;
 import de.lessvoid.nifty.Nifty;
 import de.lessvoid.nifty.NiftyInputConsumer;
+import de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader;
 import de.lessvoid.nifty.input.keyboard.KeyboardInputEvent;
 import de.lessvoid.nifty.spi.input.InputSystem;
 import java.util.ArrayList;
@@ -63,6 +64,9 @@ public class InputSystemJme implements InputSystem, RawInputListener {
         this.inputManager = inputManager;
     }
 
+    public void setResourceLoader(NiftyResourceLoader niftyResourceLoader) {
+    }
+
     public void setNifty(Nifty nifty) {
         this.nifty = nifty;
     }

+ 4 - 5
engine/src/niftygui/com/jme3/niftygui/NiftyJmeDisplay.java

@@ -46,7 +46,6 @@ import com.jme3.renderer.queue.RenderQueue;
 import com.jme3.texture.FrameBuffer;
 import de.lessvoid.nifty.Nifty;
 import de.lessvoid.nifty.tools.TimeProvider;
-import de.lessvoid.nifty.tools.resourceloader.ResourceLoader;
 import de.lessvoid.nifty.tools.resourceloader.ResourceLocation;
 import java.io.InputStream;
 import java.net.URL;
@@ -97,10 +96,6 @@ public class NiftyJmeDisplay implements SceneProcessor {
         w = vp.getCamera().getWidth();
         h = vp.getCamera().getHeight();
 
-        resourceLocation = new ResourceLocationJme();
-        ResourceLoader.removeAllResourceLocations();
-        ResourceLoader.addResourceLocation(resourceLocation);
-
         soundDev = new SoundDeviceJme(assetManager, audioRenderer);
         renderDev = new RenderDeviceJme(this);
         inputSys = new InputSystemJme(inputManager);
@@ -109,6 +104,10 @@ public class NiftyJmeDisplay implements SceneProcessor {
         
         nifty = new Nifty(renderDev, soundDev, inputSys, new TimeProvider());
         inputSys.setNifty(nifty);
+
+        resourceLocation = new ResourceLocationJme();
+        nifty.getResourceLoader().removeAllResourceLocations();
+        nifty.getResourceLoader().addResourceLocation(resourceLocation);
     }
 
     public void initialize(RenderManager rm, ViewPort vp) {

+ 4 - 0
engine/src/niftygui/com/jme3/niftygui/RenderDeviceJme.java

@@ -54,6 +54,7 @@ import de.lessvoid.nifty.spi.render.RenderDevice;
 import de.lessvoid.nifty.spi.render.RenderFont;
 import de.lessvoid.nifty.spi.render.RenderImage;
 import de.lessvoid.nifty.tools.Color;
+import de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader;
 import java.nio.ByteBuffer;
 import java.nio.FloatBuffer;
 import java.util.HashMap;
@@ -96,6 +97,9 @@ public class RenderDeviceJme implements RenderDevice {
         niftyMat.getAdditionalRenderState().setDepthTest(false);
     }
 
+    public void setResourceLoader(NiftyResourceLoader niftyResourceLoader) {
+    }
+
     public void setRenderManager(RenderManager rm){
         this.rm = rm;
         this.r = rm.getRenderer();

+ 8 - 0
engine/src/niftygui/com/jme3/niftygui/RenderFontJme.java

@@ -97,6 +97,14 @@ public class RenderFontJme implements RenderFont {
         return result;
     }
 
+    public int getWidth(final String str, final float size) {
+      // Note: This is supposed to return the width of the String when scaled
+      //       with the size factor. Since I don't know how to do that with
+      //       the font rendering in jme this will only work correctly with
+      //       a size value of 1.f and will return inaccurate values otherwise.
+      return getWidth(str);
+    }
+
     /**
      * Return the width of the given character including kerning information.
      * @param currentCharacter current character

+ 4 - 0
engine/src/niftygui/com/jme3/niftygui/SoundDeviceJme.java

@@ -38,6 +38,7 @@ import com.jme3.audio.AudioRenderer;
 import de.lessvoid.nifty.sound.SoundSystem;
 import de.lessvoid.nifty.spi.sound.SoundDevice;
 import de.lessvoid.nifty.spi.sound.SoundHandle;
+import de.lessvoid.nifty.tools.resourceloader.NiftyResourceLoader;
 
 public class SoundDeviceJme implements SoundDevice {
 
@@ -49,6 +50,9 @@ public class SoundDeviceJme implements SoundDevice {
         this.ar = ar;
     }
 
+    public void setResourceLoader(NiftyResourceLoader niftyResourceLoader) {
+    }
+
     public SoundHandle loadSound(SoundSystem soundSystem, String filename) {
         AudioNode an = new AudioNode(assetManager, filename, false);
         an.setPositional(false);