From dd276faa31c36ebfb2c7b5a8bbb4b4c8371664ab Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Sat, 4 Jan 2014 19:08:27 +0000 Subject: [PATCH] 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 --- .../blender/com/jme3/asset/BlenderKey.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/engine/src/blender/com/jme3/asset/BlenderKey.java b/engine/src/blender/com/jme3/asset/BlenderKey.java index 0ceabe305..dd153e393 100644 --- a/engine/src/blender/com/jme3/asset/BlenderKey.java +++ b/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 org.lwjgl.opengl.GL11.GL_MAX_TEXTURE_SIZE. + */ + 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.
  • NEVER_GENERATE and ALWAYS_GENERATE are quite understandable
  • 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)