Bugfix: fixed a bug that raised IndexOutOfBounds exception when blending was applied to image with mipmaps.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10862 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
Kae..pl 11 years ago
parent c278b39c82
commit 3dbe5fcec6
  1. 2
      engine/src/blender/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderAWT.java
  2. 2
      engine/src/blender/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderLuminance.java

@ -79,7 +79,7 @@ public class TextureBlenderAWT extends AbstractTextureBlender {
for (int dataLayerIndex = 0; dataLayerIndex < depth; ++dataLayerIndex) { for (int dataLayerIndex = 0; dataLayerIndex < depth; ++dataLayerIndex) {
ByteBuffer data = image.getData(dataLayerIndex); ByteBuffer data = image.getData(dataLayerIndex);
data.rewind(); data.rewind();
ByteBuffer newData = BufferUtils.createByteBuffer(width * height * 4); ByteBuffer newData = BufferUtils.createByteBuffer(data.limit());
int dataIndex = 0, x = 0, y = 0, index = 0; int dataIndex = 0, x = 0, y = 0, index = 0;
while (index < data.limit()) { while (index < data.limit()) {

@ -50,7 +50,7 @@ public class TextureBlenderLuminance extends AbstractTextureBlender {
for (int dataLayerIndex = 0; dataLayerIndex < depth; ++dataLayerIndex) { for (int dataLayerIndex = 0; dataLayerIndex < depth; ++dataLayerIndex) {
ByteBuffer data = image.getData(dataLayerIndex); ByteBuffer data = image.getData(dataLayerIndex);
data.rewind(); data.rewind();
ByteBuffer newData = BufferUtils.createByteBuffer(width * height * 4); ByteBuffer newData = BufferUtils.createByteBuffer(data.limit());
int dataIndex = 0, x = 0, y = 0; int dataIndex = 0, x = 0, y = 0;
while (data.hasRemaining()) { while (data.hasRemaining()) {

Loading…
Cancel
Save