Fix to 3D texture triangulation procedure that might have caused an image of width or height == 0 to be produced (which caused later errors during textures merging).
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9496 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
8cf238a262
commit
e8762bcf9d
@ -524,7 +524,13 @@ import jme3tools.converters.ImageToAwt;
|
|||||||
// create the result image
|
// create the result image
|
||||||
Format imageFormat = texture.getImage().getFormat();
|
Format imageFormat = texture.getImage().getFormat();
|
||||||
int imageWidth = (int) (envelope.width * blenderContext.getBlenderKey().getGeneratedTexturePPU());
|
int imageWidth = (int) (envelope.width * blenderContext.getBlenderKey().getGeneratedTexturePPU());
|
||||||
|
if(imageWidth == 0) {
|
||||||
|
imageWidth = 1;
|
||||||
|
}
|
||||||
int imageHeight = (int) (envelope.height * blenderContext.getBlenderKey().getGeneratedTexturePPU());
|
int imageHeight = (int) (envelope.height * blenderContext.getBlenderKey().getGeneratedTexturePPU());
|
||||||
|
if(imageHeight == 0) {
|
||||||
|
imageHeight = 1;
|
||||||
|
}
|
||||||
ByteBuffer data = BufferUtils.createByteBuffer(imageWidth * imageHeight * (imageFormat.getBitsPerPixel() >> 3));
|
ByteBuffer data = BufferUtils.createByteBuffer(imageWidth * imageHeight * (imageFormat.getBitsPerPixel() >> 3));
|
||||||
image = new Image(texture.getImage().getFormat(), imageWidth, imageHeight, data);
|
image = new Image(texture.getImage().getFormat(), imageWidth, imageHeight, data);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user