diff options
author | Chien Yang <[email protected]> | 2007-02-28 23:35:03 +0000 |
---|---|---|
committer | Chien Yang <[email protected]> | 2007-02-28 23:35:03 +0000 |
commit | 1856fc92c798ef83af1fc8695eaf060122dd18ca (patch) | |
tree | 98e8833661feb365a90b8a316060060fde753087 /src/classes/share | |
parent | 537cac28344a39da93b0b2d4900d215bc56cbead (diff) |
1) OGL and JOGL only : Fix to Issue 415 : Need ability to disable NPOT textures for raster/background
2) Minor fix on when to call setHasMultiSample(). At present this method is not called, but getHasMultiSample() is used.
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@781 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src/classes/share')
-rw-r--r-- | src/classes/share/javax/media/j3d/Canvas3D.java | 8 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/Texture.java | 38 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/Texture3D.java | 23 |
3 files changed, 15 insertions, 54 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java index 547c62f..8981551 100644 --- a/src/classes/share/javax/media/j3d/Canvas3D.java +++ b/src/classes/share/javax/media/j3d/Canvas3D.java @@ -3723,12 +3723,8 @@ public class Canvas3D extends Canvas { (textureExtendedFeatures & TEXTURE_LOD_OFFSET) != 0)); keys.add("textureNonPowerOfTwoAvailable"); - if (VirtualUniverse.mc.enforcePowerOfTwo) { - values.add(Boolean.FALSE); - } else { - values.add(new Boolean( - (textureExtendedFeatures & TEXTURE_NON_POWER_OF_TWO) != 0)); - } + values.add(new Boolean( + (textureExtendedFeatures & TEXTURE_NON_POWER_OF_TWO) != 0)); keys.add("textureCoordSetsMax"); values.add(new Integer(maxTexCoordSets)); diff --git a/src/classes/share/javax/media/j3d/Texture.java b/src/classes/share/javax/media/j3d/Texture.java index 883d33a..5d7bc2c 100644 --- a/src/classes/share/javax/media/j3d/Texture.java +++ b/src/classes/share/javax/media/j3d/Texture.java @@ -642,20 +642,10 @@ public abstract class Texture extends NodeComponent { } int widthLevels; - int heightLevels; - - if (VirtualUniverse.mc.enforcePowerOfTwo) { - widthLevels = getPowerOf2(width); - if (widthLevels == -1) - throw new IllegalArgumentException(J3dI18N.getString("Texture2")); - - heightLevels = getPowerOf2(height); - if (heightLevels == -1) - throw new IllegalArgumentException(J3dI18N.getString("Texture3")); - } else { - widthLevels = getLevelsNPOT(width); - heightLevels = getLevelsNPOT(height); - } + int heightLevels; + + widthLevels = getLevelsNPOT(width); + heightLevels = getLevelsNPOT(height); ((TextureRetained)this.retained).initialize(format, width, widthLevels, height, heightLevels, mipMapMode, 0); @@ -716,21 +706,11 @@ public abstract class Texture extends NodeComponent { throw new IllegalArgumentException(J3dI18N.getString("Texture47")); } - int widthLevels; - int heightLevels; - - if (VirtualUniverse.mc.enforcePowerOfTwo) { - widthLevels = getPowerOf2(width); - if (widthLevels == -1) - throw new IllegalArgumentException(J3dI18N.getString("Texture2")); - - heightLevels = getPowerOf2(height); - if (heightLevels == -1) - throw new IllegalArgumentException(J3dI18N.getString("Texture3")); - } else { - widthLevels = getLevelsNPOT(width); - heightLevels = getLevelsNPOT(height); - } + int widthLevels; + int heightLevels; + + widthLevels = getLevelsNPOT(width); + heightLevels = getLevelsNPOT(height); if (boundaryWidth < 0 || boundaryWidth > 1) throw new IllegalArgumentException(J3dI18N.getString("Texture30")); diff --git a/src/classes/share/javax/media/j3d/Texture3D.java b/src/classes/share/javax/media/j3d/Texture3D.java index 73e5a51..fec5886 100644 --- a/src/classes/share/javax/media/j3d/Texture3D.java +++ b/src/classes/share/javax/media/j3d/Texture3D.java @@ -78,15 +78,9 @@ public class Texture3D extends Texture { super(mipmapMode, format, width, height); int depthLevels = -1; - if (VirtualUniverse.mc.enforcePowerOfTwo) { - depthLevels = getPowerOf2(depth); - if (depthLevels == -1) - throw new IllegalArgumentException(J3dI18N.getString("Texture3D1")); - - } else { - depthLevels = getLevelsNPOT(depth); - } - + + depthLevels = getLevelsNPOT(depth); + // TODO : Need to verify whether this is a bug. Why depthLevels isn't // use to determine maxMipMapLevels ? See also Texture.java @@ -131,16 +125,7 @@ public class Texture3D extends Texture { super(mipmapMode, format, width, height, boundaryWidth); int depthLevels = -1; - if (VirtualUniverse.mc.enforcePowerOfTwo) { - depthLevels = getPowerOf2(depth); - - if (depthLevels == -1) - throw new IllegalArgumentException(J3dI18N.getString("Texture3D1")); - } - else { - depthLevels = getLevelsNPOT(depth); - - } + depthLevels = getLevelsNPOT(depth); // TODO : Need to verify whether this is a bug. Why depthLevels isn't // use to determine maxMipMapLevels ? See also Texture.java |