Explorar el Código

* Prevent constant exception in FrameBuffer.setTargetIndex()

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9034 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Sha..om hace 14 años
padre
commit
fc5c7d06d2
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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){
     public void setTargetIndex(int index){
         if (index < 0 || index >= 16)
         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!");
             throw new IllegalArgumentException("The target at " + index + " is not set!");
 
 
         colorBufIndex = index;
         colorBufIndex = index;