Browse Source

* Allow loading non-square power-of-2 textures without resize

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8470 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
sha..rd 14 years ago
parent
commit
afbf8ad69d

+ 1 - 2
engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglGL1Renderer.java

@@ -743,8 +743,7 @@ public class LwjglGL1Renderer implements GL1Renderer {
         if (!GLContext.getCapabilities().GL_ARB_texture_non_power_of_two) {
             if (img.getWidth() != 0 && img.getHeight() != 0) {
                 if (!FastMath.isPowerOfTwo(img.getWidth())
-                        || !FastMath.isPowerOfTwo(img.getHeight())
-                        || img.getWidth() != img.getHeight()) {
+                        || !FastMath.isPowerOfTwo(img.getHeight())) {
 
                     // Resize texture to Power-of-2 size
                     MipMapGenerator.resizeToPowerOf2(img);

+ 1 - 2
engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java

@@ -1871,8 +1871,7 @@ public class LwjglRenderer implements Renderer {
 
             if (img.getWidth() != 0 && img.getHeight() != 0) {
                 if (!FastMath.isPowerOfTwo(img.getWidth())
-                        || !FastMath.isPowerOfTwo(img.getHeight())
-                        || img.getWidth() != img.getHeight()) {
+                        || !FastMath.isPowerOfTwo(img.getHeight())) {
 //                    logger.log(Level.WARNING, "Encountered NPOT texture {0}, "
 //                                            + "it might not display correctly.", img);