Bläddra i källkod

Fix #1883 (Image class wrongly setting GL mips flags inside the constructor) (#1885)

Ali-RS 2 år sedan
förälder
incheckning
7f927f0cfc
1 ändrade filer med 8 tillägg och 6 borttagningar
  1. 8 6
      jme3-core/src/main/java/com/jme3/texture/Image.java

+ 8 - 6
jme3-core/src/main/java/com/jme3/texture/Image.java

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2009-2021 jMonkeyEngine
+ * Copyright (c) 2009-2022 jMonkeyEngine
  * All rights reserved.
  * All rights reserved.
  *
  *
  * Redistribution and use in source and binary forms, with or without
  * Redistribution and use in source and binary forms, with or without
@@ -807,11 +807,13 @@ public class Image extends NativeObject implements Savable /*, Cloneable*/ {
 
 
         this();
         this();
 
 
-        if (mipMapSizes != null && mipMapSizes.length <= 1) {
-            mipMapSizes = null;
-        } else {
-            needGeneratedMips = false;
-            mipsWereGenerated = true;
+        if (mipMapSizes != null) {
+            if (mipMapSizes.length <= 1) {
+                mipMapSizes = null;
+            } else {
+                needGeneratedMips = false;
+                mipsWereGenerated = true;
+            }
         }
         }
 
 
         setFormat(format);
         setFormat(format);