OSDN Git Service

* Allow loading non-square power-of-2 textures without resize
authorshadowislord <shadowislord@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Fri, 21 Oct 2011 01:21:46 +0000 (01:21 +0000)
committershadowislord <shadowislord@75d07b2b-3a1a-0410-a2c5-0572b91ccdca>
Fri, 21 Oct 2011 01:21:46 +0000 (01:21 +0000)
git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@8470 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglGL1Renderer.java
engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java

index b9aa44a..ecd016e 100644 (file)
@@ -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);
index 75cd751..d57a228 100644 (file)
@@ -1871,8 +1871,7 @@ public class LwjglRenderer implements Renderer {
 \r
             if (img.getWidth() != 0 && img.getHeight() != 0) {\r
                 if (!FastMath.isPowerOfTwo(img.getWidth())\r
-                        || !FastMath.isPowerOfTwo(img.getHeight())\r
-                        || img.getWidth() != img.getHeight()) {\r
+                        || !FastMath.isPowerOfTwo(img.getHeight())) {\r
 //                    logger.log(Level.WARNING, "Encountered NPOT texture {0}, "\r
 //                                            + "it might not display correctly.", img);\r
 \r