* Fixed issue where using images with pregenerated mips would cause performance loss due to them being generated again and again
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9703 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
96c4b31e0f
commit
9ad757596b
@ -433,6 +433,9 @@ public class Image extends NativeObject implements Savable /*, Cloneable*/ {
|
||||
|
||||
if (mipMapSizes != null && mipMapSizes.length <= 1) {
|
||||
mipMapSizes = null;
|
||||
} else {
|
||||
needGeneratedMips = false;
|
||||
mipsWereGenerated = true;
|
||||
}
|
||||
|
||||
setFormat(format);
|
||||
@ -465,6 +468,9 @@ public class Image extends NativeObject implements Savable /*, Cloneable*/ {
|
||||
|
||||
if (mipMapSizes != null && mipMapSizes.length <= 1) {
|
||||
mipMapSizes = null;
|
||||
} else {
|
||||
needGeneratedMips = false;
|
||||
mipsWereGenerated = true;
|
||||
}
|
||||
|
||||
setFormat(format);
|
||||
@ -616,6 +622,15 @@ public class Image extends NativeObject implements Savable /*, Cloneable*/ {
|
||||
mipMapSizes = null;
|
||||
|
||||
this.mipMapSizes = mipMapSizes;
|
||||
|
||||
if (mipMapSizes != null) {
|
||||
needGeneratedMips = false;
|
||||
mipsWereGenerated = false;
|
||||
} else {
|
||||
needGeneratedMips = false;
|
||||
mipsWereGenerated = true;
|
||||
}
|
||||
|
||||
setUpdateNeeded();
|
||||
}
|
||||
|
||||
@ -837,6 +852,11 @@ public class Image extends NativeObject implements Savable /*, Cloneable*/ {
|
||||
mipMapSizes = capsule.readIntArray("mipMapSizes", null);
|
||||
multiSamples = capsule.readInt("multiSamples", 1);
|
||||
data = (ArrayList<ByteBuffer>) capsule.readByteBufferArrayList("data", null);
|
||||
|
||||
if (mipMapSizes != null) {
|
||||
needGeneratedMips = false;
|
||||
mipsWereGenerated = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user