Ali_RS
December 22, 2022, 6:49pm
1
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)
Edit:
Filled an issue on GitHub
opened 07:09PM - 22 Dec 22 UTC
bug
These two constructors on `Image` class behave differently!
https://github.co… m/jMonkeyEngine/jmonkeyengine/blob/f92a73f91ce1a2852645cd1bb5a4c6b597faf7af/jme3-core/src/main/java/com/jme3/texture/Image.java#L749-L762
https://github.com/jMonkeyEngine/jmonkeyengine/blob/f92a73f91ce1a2852645cd1bb5a4c6b597faf7af/jme3-core/src/main/java/com/jme3/texture/Image.java#L805-L816
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
3 Likes