Parcourir la source

Refactoring: removed dependency to org.lwjgl.opengl.GL11.GL_MAX_TEXTURE_SIZE from BlenderKey.java

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10956 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
Kae..pl il y a 11 ans
Parent
commit
dd276faa31
1 fichiers modifiés avec 7 ajouts et 14 suppressions
  1. 7 14
      engine/src/blender/com/jme3/asset/BlenderKey.java

+ 7 - 14
engine/src/blender/com/jme3/asset/BlenderKey.java

@@ -36,8 +36,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Queue;
 
-import org.lwjgl.opengl.GL11;
-
 import com.jme3.bounding.BoundingVolume;
 import com.jme3.collision.Collidable;
 import com.jme3.collision.CollisionResults;
@@ -100,8 +98,11 @@ public class BlenderKey extends ModelKey {
     protected int                      layersToLoad              = -1;
     /** A variable that toggles the object custom properties loading. */
     protected boolean                  loadObjectProperties      = true;
-    /** Maximum texture size. Might be dependant on the graphic card. */
-    protected int                      maxTextureSize            = -1;
+    /**
+     * Maximum texture size. Might be dependant on the graphic card.
+     * This value is taken from <b>org.lwjgl.opengl.GL11.GL_MAX_TEXTURE_SIZE</b>.
+     */
+    protected int                      maxTextureSize            = 8192;
     /** Allows to toggle generated textures loading. Disabled by default because it very often takes too much memory and needs to be used wisely. */
     protected boolean                  loadGeneratedTextures;
     /** Tells if the mipmaps will be generated by jme or not. By default generation is dependant on the blender settings. */
@@ -205,17 +206,11 @@ public class BlenderKey extends ModelKey {
     }
 
     /**
+     * The default value for this parameter is the same as defined by: org.lwjgl.opengl.GL11.GL_MAX_TEXTURE_SIZE.
+     * If by any means this is too large for user's hardware configuration use the 'setMaxTextureSize' method to change that.
      * @return maximum texture size (width/height)
      */
     public int getMaxTextureSize() {
-        if (maxTextureSize <= 0) {
-            try {
-                maxTextureSize = GL11.glGetInteger(GL11.GL_MAX_TEXTURE_SIZE);
-            } catch (Exception e) {
-                // this is in case this method was called before openGL initialization
-                return 8192;
-            }
-        }
         return maxTextureSize;
     }
 
@@ -626,8 +621,6 @@ public class BlenderKey extends ModelKey {
         return true;
     }
 
-
-
     /**
      * This enum tells the importer if the mipmaps for textures will be generated by jme. <li>NEVER_GENERATE and ALWAYS_GENERATE are quite understandable <li>GENERATE_WHEN_NEEDED is an option that checks if the texture had 'Generate mipmaps' option set in blender, mipmaps are generated only when the option is set
      * @author Marcin Roguski (Kaelthas)