diff options
author | Kenneth Russel <[email protected]> | 2007-08-06 16:20:14 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2007-08-06 16:20:14 +0000 |
commit | b3e8bf87754b729be57df8626bf7631b5b8718a0 (patch) | |
tree | 3271b3a62b94b73926066e3b6287939513460f22 /src/classes/com/sun/opengl/util | |
parent | 26bd70cf045f0b0f8fd0d4ca3880b76a319a3fc3 (diff) |
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
Diffstat (limited to 'src/classes/com/sun/opengl/util')
-rwxr-xr-x | src/classes/com/sun/opengl/util/texture/Texture.java | 12 |
1 files changed, 6 insertions, 6 deletions
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]; |