Sfoglia il codice sorgente

* Prevent constant exception in FrameBuffer.setTargetIndex()

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9034 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Sha..om 14 anni fa
parent
commit
fc5c7d06d2
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      engine/src/core/com/jme3/texture/FrameBuffer.java

+ 2 - 2
engine/src/core/com/jme3/texture/FrameBuffer.java

@@ -284,9 +284,9 @@ public class FrameBuffer extends NativeObject {
      */
     public void setTargetIndex(int index){
         if (index < 0 || index >= 16)
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("Target index must be between 0 and 16");
 
-        if (colorBufs.size() >= index)
+        if (colorBufs.size() < index)
             throw new IllegalArgumentException("The target at " + index + " is not set!");
 
         colorBufIndex = index;