aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-core/src/main
diff options
context:
space:
mode:
authorJoshua Slack <[email protected]>2017-09-29 17:25:24 -0500
committerJoshua Slack <[email protected]>2017-09-29 17:25:24 -0500
commit496263aac829dd0837ba65997b41ef2851022b3c (patch)
tree5c2b8d75939705e4a1c63c8ff68ccc648b9c38cc /ardor3d-core/src/main
parente647796e2aef9a2088baab606520e7c32aacc03f (diff)
Added centerOn method to UIComponent to make it simpler to center a component on another component or the hud.
Fixed issue in sliders when min value is not 0. Clean up warnings.
Diffstat (limited to 'ardor3d-core/src/main')
-rw-r--r--ardor3d-core/src/main/java/com/ardor3d/image/Texture1D.java19
-rw-r--r--ardor3d-core/src/main/java/com/ardor3d/image/Texture2D.java17
2 files changed, 24 insertions, 12 deletions
diff --git a/ardor3d-core/src/main/java/com/ardor3d/image/Texture1D.java b/ardor3d-core/src/main/java/com/ardor3d/image/Texture1D.java
index 5ba42cd..20d3866 100644
--- a/ardor3d-core/src/main/java/com/ardor3d/image/Texture1D.java
+++ b/ardor3d-core/src/main/java/com/ardor3d/image/Texture1D.java
@@ -3,7 +3,7 @@
*
* This file is part of Ardor3D.
*
- * Ardor3D is free software: you can redistribute it and/or modify it
+ * Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <http://www.ardor3d.com/LICENSE>.
*/
@@ -32,13 +32,13 @@ public class Texture1D extends Texture {
/**
* <code>setWrap</code> sets the wrap mode of this texture for a particular axis.
- *
+ *
* @param axis
* the texture axis to define a wrapmode on.
* @param mode
* the wrap mode for the given axis of the texture.
* @throws IllegalArgumentException
- * if axis or mode are null
+ * if axis or mode are null or invalid
*/
@Override
public void setWrap(final WrapAxis axis, final WrapMode mode) {
@@ -51,12 +51,16 @@ public class Texture1D extends Texture {
case S:
_wrapS = mode;
break;
+ case R:
+ case T:
+ default:
+ throw new IllegalArgumentException("invalid WrapAxis: " + axis);
}
}
/**
* <code>setWrap</code> sets the wrap mode of this texture for all axis.
- *
+ *
* @param mode
* the wrap mode for the given axis of the texture.
* @throws IllegalArgumentException
@@ -72,7 +76,7 @@ public class Texture1D extends Texture {
/**
* <code>getWrap</code> returns the wrap mode for a given coordinate axis on this texture.
- *
+ *
* @param axis
* the axis to return for
* @return the wrap mode of the texture.
@@ -84,8 +88,11 @@ public class Texture1D extends Texture {
switch (axis) {
case S:
return _wrapS;
+ case R:
+ case T:
+ default:
+ throw new IllegalArgumentException("invalid WrapAxis: " + axis);
}
- throw new IllegalArgumentException("invalid WrapAxis: " + axis);
}
@Override
diff --git a/ardor3d-core/src/main/java/com/ardor3d/image/Texture2D.java b/ardor3d-core/src/main/java/com/ardor3d/image/Texture2D.java
index dc54a94..61e9b3e 100644
--- a/ardor3d-core/src/main/java/com/ardor3d/image/Texture2D.java
+++ b/ardor3d-core/src/main/java/com/ardor3d/image/Texture2D.java
@@ -3,7 +3,7 @@
*
* This file is part of Ardor3D.
*
- * Ardor3D is free software: you can redistribute it and/or modify it
+ * Ardor3D is free software: you can redistribute it and/or modify it
* under the terms of its license which may be found in the accompanying
* LICENSE file or at <http://www.ardor3d.com/LICENSE>.
*/
@@ -34,13 +34,13 @@ public class Texture2D extends Texture {
/**
* <code>setWrap</code> sets the wrap mode of this texture for a particular axis.
- *
+ *
* @param axis
* the texture axis to define a wrapmode on.
* @param mode
* the wrap mode for the given axis of the texture.
* @throws IllegalArgumentException
- * if axis or mode are null
+ * if axis or mode are null or invalid
*/
@Override
public void setWrap(final WrapAxis axis, final WrapMode mode) {
@@ -56,12 +56,15 @@ public class Texture2D extends Texture {
case T:
_wrapT = mode;
break;
+ case R:
+ default:
+ throw new IllegalArgumentException("invalid WrapAxis: " + axis);
}
}
/**
* <code>setWrap</code> sets the wrap mode of this texture for all axis.
- *
+ *
* @param mode
* the wrap mode for the given axis of the texture.
* @throws IllegalArgumentException
@@ -78,7 +81,7 @@ public class Texture2D extends Texture {
/**
* <code>getWrap</code> returns the wrap mode for a given coordinate axis on this texture.
- *
+ *
* @param axis
* the axis to return for
* @return the wrap mode of the texture.
@@ -92,8 +95,10 @@ public class Texture2D extends Texture {
return _wrapS;
case T:
return _wrapT;
+ case R:
+ default:
+ throw new IllegalArgumentException("invalid WrapAxis: " + axis);
}
- throw new IllegalArgumentException("invalid WrapAxis: " + axis);
}
@Override