فهرست منبع

MipMapGen: resize to nearest power of 2 in both dimensions
Before it was selecting the largest dimension, but OpenGL does not have such requirement.

Kirill Vainer 10 سال پیش
والد
کامیت
4aa32cd016
1فایلهای تغییر یافته به همراه1 افزوده شده و 2 حذف شده
  1. 1 2
      jme3-core/src/main/java/com/jme3/util/MipMapGenerator.java

+ 1 - 2
jme3-core/src/main/java/com/jme3/util/MipMapGenerator.java

@@ -100,8 +100,7 @@ public class MipMapGenerator {
     public static Image resizeToPowerOf2(Image original){
         int potWidth = FastMath.nearestPowerOfTwo(original.getWidth());
         int potHeight = FastMath.nearestPowerOfTwo(original.getHeight());
-        int potSize = Math.max(potWidth, potHeight);
-        return scaleImage(original, potSize, potSize);
+        return scaleImage(original, potWidth, potHeight);
     }
     
     public static void generateMipMaps(Image image){