From 12fae01a80ba5624868c7a897b893bb8e2717464 Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Sat, 2 Apr 2011 01:50:01 +0000 Subject: [PATCH] * OBJLoader will no longer crash when it cannot find materials in MTL file * Fixed bug where calling any of the Listener methods would have no effect git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7157 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/scene/plugins/OBJLoader.java | 2 +- engine/src/core/com/jme3/audio/Listener.java | 29 ------------------- .../jme3/audio/lwjgl/LwjglAudioRenderer.java | 1 + .../test/jme3test/audio/TestMusicPlayer.java | 2 +- 4 files changed, 3 insertions(+), 31 deletions(-) diff --git a/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java b/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java index 58a13f819..5bb807e8c 100644 --- a/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java +++ b/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java @@ -246,7 +246,7 @@ public final class OBJLoader implements AssetLoader { f.verticies[i] = vertList.get(i); } - if (matList != null){ + if (matList != null && matFaces.containsKey(currentMatName)){ matFaces.get(currentMatName).add(f); }else{ faces.add(f); // faces that belong to the default material diff --git a/engine/src/core/com/jme3/audio/Listener.java b/engine/src/core/com/jme3/audio/Listener.java index 0b405b653..609b0ca50 100644 --- a/engine/src/core/com/jme3/audio/Listener.java +++ b/engine/src/core/com/jme3/audio/Listener.java @@ -60,26 +60,6 @@ public class Listener { this.renderer = renderer; } - /** - * - * @return - * @deprecated Use {@link Listener#getVolume() } - */ - @Deprecated - public float getGain() { - return getVolume(); - } - - /** - * - * @param gain - * @deprecated Use {@link Listener#setVolume(float) } - */ - @Deprecated - public void setGain(float gain) { - setVolume(gain); - } - public float getVolume() { return volume; } @@ -131,13 +111,4 @@ public class Listener { if (renderer != null) renderer.updateListenerParam(this, ListenerParam.Velocity); } - - @Deprecated - public boolean isRefreshNeeded(){ - return true; - } - - public void clearRefreshNeeded(){ - } - } diff --git a/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java b/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java index 6e0f8aeee..97201c79b 100644 --- a/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java +++ b/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java @@ -774,6 +774,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable { } this.listener = listener; + this.listener.setRenderer(this); setListenerParams(listener); } } diff --git a/engine/src/test/jme3test/audio/TestMusicPlayer.java b/engine/src/test/jme3test/audio/TestMusicPlayer.java index 6374b2f50..9f3946732 100644 --- a/engine/src/test/jme3test/audio/TestMusicPlayer.java +++ b/engine/src/test/jme3test/audio/TestMusicPlayer.java @@ -237,7 +237,7 @@ public class TestMusicPlayer extends javax.swing.JFrame { }//GEN-LAST:event_formWindowClosing private void sldVolumeStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_sldVolumeStateChanged - listener.setGain( (float) sldVolume.getValue() / 100f); + listener.setVolume( (float) sldVolume.getValue() / 100f); ar.setListener(listener); }//GEN-LAST:event_sldVolumeStateChanged