From b3e8bf87754b729be57df8626bf7631b5b8718a0 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Mon, 6 Aug 2007 16:20:14 +0000 Subject: Fixed Issue 307: Rectangular (but still pow2) dds textures with mipmaps incorrectly loaded Clamped several divisions of width and height to 1 as per bug description. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1328 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/util/texture/Texture.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/classes') diff --git a/src/classes/com/sun/opengl/util/texture/Texture.java b/src/classes/com/sun/opengl/util/texture/Texture.java index a9511dc49..3518d8c38 100755 --- a/src/classes/com/sun/opengl/util/texture/Texture.java +++ b/src/classes/com/sun/opengl/util/texture/Texture.java @@ -502,8 +502,8 @@ public class Texture { updateSubImageImpl(data, texTarget, i, 0, 0, 0, 0, data.getWidth(), data.getHeight()); } - width /= 2; - height /= 2; + width = Math.max(width / 2, 1); + height = Math.max(height / 2, 1); } } else { if (data.isDataCompressed()) { @@ -834,11 +834,11 @@ public class Texture { // Note we do not support specification of the row length for // mipmapped textures at this point for (int i = 0; i < mipmapLevel; i++) { - width /= 2; - height /= 2; + width = Math.max(width / 2, 1); + height = Math.max(height / 2, 1); - dataWidth /= 2; - dataHeight /= 2; + dataWidth = Math.max(dataWidth / 2, 1); + dataHeight = Math.max(dataHeight / 2, 1); } rowlen = 0; buffer = data.getMipmapData()[mipmapLevel]; -- cgit v1.2.3