浏览代码

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
Kae..pl 13 年之前
父节点
当前提交
e8762bcf9d
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      engine/src/blender/com/jme3/scene/plugins/blender/textures/TriangulatedTexture.java

+ 6 - 0
engine/src/blender/com/jme3/scene/plugins/blender/textures/TriangulatedTexture.java

@@ -524,7 +524,13 @@ import jme3tools.converters.ImageToAwt;
 			// create the result image
 			Format imageFormat = texture.getImage().getFormat();
 			int imageWidth = (int) (envelope.width * blenderContext.getBlenderKey().getGeneratedTexturePPU());
+			if(imageWidth == 0) {
+				imageWidth = 1;
+			}
 			int imageHeight = (int) (envelope.height * blenderContext.getBlenderKey().getGeneratedTexturePPU());
+			if(imageHeight == 0) {
+				imageHeight = 1;
+			}
 			ByteBuffer data = BufferUtils.createByteBuffer(imageWidth * imageHeight * (imageFormat.getBitsPerPixel() >> 3));
 			image = new Image(texture.getImage().getFormat(), imageWidth, imageHeight, data);