Просмотр исходного кода

* Fix issue 551

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9986 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Sha..rd 13 лет назад
Родитель
Сommit
7dae4d5238
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      engine/src/core/com/jme3/audio/AudioNode.java

+ 6 - 1
engine/src/core/com/jme3/audio/AudioNode.java

@@ -186,6 +186,9 @@ public class AudioNode extends Node {
      * Start playing the audio.
      */
     public void play(){
+        if (positional && data.getChannels() > 1) {
+            throw new IllegalStateException("Only mono audio is supported for positional audio nodes");
+        }
         getRenderer().playSource(this);
     }
 
@@ -196,6 +199,9 @@ public class AudioNode extends Node {
      * instances already playing.
      */
     public void playInstance(){
+        if (positional && data.getChannels() > 1) {
+            throw new IllegalStateException("Only mono audio is supported for positional audio nodes");
+        }
         getRenderer().playSourceInstance(this);
     }
     
@@ -392,7 +398,6 @@ public class AudioNode extends Node {
 
         this.timeOffset = timeOffset;
         if (data instanceof AudioStream) {
-            System.out.println("request setTime");
             ((AudioStream) data).setTime(timeOffset);
         }else if(status == Status.Playing){
             stop();