* 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
3.0
sha..rd 14 years ago
parent ee7ba81ee3
commit 12fae01a80
  1. 2
      engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java
  2. 29
      engine/src/core/com/jme3/audio/Listener.java
  3. 1
      engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java
  4. 2
      engine/src/test/jme3test/audio/TestMusicPlayer.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

@ -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(){
}
}

@ -774,6 +774,7 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable {
}
this.listener = listener;
this.listener.setRenderer(this);
setListenerParams(listener);
}
}

@ -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

Loading…
Cancel
Save