Specify the default repeat type as a parameter; model animations should

not loop by default.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@138 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Andrzej Kapolka
2007-02-01 20:03:00 +00:00
parent 7cdebe1912
commit 60abc93638
3 changed files with 10 additions and 7 deletions
@@ -109,19 +109,20 @@ public class JmeUtil
/**
* Attempts to parse a string describing one of the repeat types defined in {@link Controller}:
* "clamp", "cycle", or "wrap". Will return {@link Controller#RT_WRAP} if the type is
* "clamp", "cycle", or "wrap". Will return the specified default if the type is
* <code>null</code> or invalid.
*/
public static int parseRepeatType (String type)
public static int parseRepeatType (String type, int defaultType)
{
if ("clamp".equals(type)) {
return Controller.RT_CLAMP;
} else if ("cycle".equals(type)) {
return Controller.RT_CYCLE;
}
if (type != null && !"wrap".equals(type)) {
} else if ("wrap".equals(type)) {
return Controller.RT_WRAP;
} else if (type != null) {
Log.warning("Invalid repeat type [type=" + type + "].");
}
return Controller.RT_WRAP;
return defaultType;
}
}