UniformTileSets no longer need to have their tileCount set, they will

figure it out from their width/height compared to the source image's
width/height.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2573 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2003-05-13 21:33:58 +00:00
parent c0aacd5f41
commit a323d157dd
6 changed files with 23 additions and 47 deletions
@@ -1,5 +1,5 @@
//
// $Id: IconManager.java,v 1.5 2002/12/07 02:13:00 shaper Exp $
// $Id: IconManager.java,v 1.6 2003/05/13 21:33:58 ray Exp $
package com.threerings.media;
@@ -32,10 +32,10 @@ import com.threerings.media.tile.TileSet;
*
* <pre>
* arrows.path = /rsrc/media/icons/arrows.png
* arrows.metrics = 4, 20, 20 # 4 icons that are 20x20
* arrows.metrics = 20, 25 # icons that are 20 pixels wide and 25 pixels tall
*
* smileys.path = /rsrc/media/icons/smileys.png
* smileys.metrics = 10, 16, 16 # 16 icons that are 16x16
* smileys.metrics = 16, 16 # icons that are 16 pixels square
* </pre>
*
* A user could then request an <code>arrows</code> icon like so:
@@ -107,7 +107,7 @@ public class IconManager
}
int[] metrics = StringUtil.parseIntArray(metstr);
if (metrics == null || metrics.length != 3) {
if (metrics == null || metrics.length != 2) {
throw new Exception("Invalid icon set metrics " +
"[metrics=" + metstr + "]");
}
@@ -115,10 +115,10 @@ public class IconManager
// load up the tileset
if (_rsrcSet == null) {
set = _tilemgr.loadTileSet(
path, metrics[0], metrics[1], metrics[2]);
path, metrics[0], metrics[1]);
} else {
set = _tilemgr.loadTileSet(
_rsrcSet, path, metrics[0], metrics[1], metrics[2]);
_rsrcSet, path, metrics[0], metrics[1]);
}
// cache it