Sfoglia il codice sorgente

Added a guard to ensure setSinglePassLightBatchSize() is set to a minimum of at least 1.

Daniel Johansson 10 anni fa
parent
commit
e0c24cd73a

+ 2 - 1
jme3-core/src/main/java/com/jme3/renderer/RenderManager.java

@@ -784,7 +784,8 @@ public class RenderManager {
      * @param singlePassLightBatchSize the number of lights.
      */
     public void setSinglePassLightBatchSize(int singlePassLightBatchSize) {
-        this.singlePassLightBatchSize = singlePassLightBatchSize;
+        // Ensure the batch size is no less than 1
+        this.singlePassLightBatchSize = singlePassLightBatchSize < 1 ? 1 : singlePassLightBatchSize;
     }