These two constructors on Image class behave differently!
|
public Image(Format format, int width, int height, int depth, ArrayList<ByteBuffer> data, |
|
int[] mipMapSizes, ColorSpace colorSpace) { |
|
|
|
this(); |
|
|
|
if (mipMapSizes != null) { |
|
if (mipMapSizes.length <= 1) { |
|
mipMapSizes = null; |
|
} else { |
|
needGeneratedMips = false; |
|
mipsWereGenerated = true; |
|
} |
|
} |
|
|
|
public Image(Format format, int width, int height, ByteBuffer data, |
|
int[] mipMapSizes, ColorSpace colorSpace) { |
|
|
|
this(); |
|
|
|
if (mipMapSizes != null && mipMapSizes.length <= 1) { |
|
mipMapSizes = null; |
|
} else { |
|
needGeneratedMips = false; |
|
mipsWereGenerated = true; |
|
} |
|
|
Look at needGeneratedMips and mipsWereGenerated flags, if mipMapSizes is null the first one won't modify the flags but the second one will do (I belive it is wrongly setting mipsWereGenerated = true)
Forum post:
https://hub.jmonkeyengine.org/t/issue-in-image-class-bug/46297
These two constructors on
Imageclass behave differently!jmonkeyengine/jme3-core/src/main/java/com/jme3/texture/Image.java
Lines 749 to 762 in f92a73f
jmonkeyengine/jme3-core/src/main/java/com/jme3/texture/Image.java
Lines 805 to 816 in f92a73f
Look at
needGeneratedMipsandmipsWereGeneratedflags, ifmipMapSizesis null the first one won't modify the flags but the second one will do (I belive it is wrongly setting mipsWereGenerated = true)Forum post:
https://hub.jmonkeyengine.org/t/issue-in-image-class-bug/46297