Try to cope if we were unable to load our tileset image and ended up with

a placeholder image.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2184 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-01-18 03:53:31 +00:00
parent 18c11e90a7
commit bddca90c0d
@@ -1,5 +1,5 @@
//
// $Id: UniformTileSet.java,v 1.11 2003/01/13 22:49:46 mdb Exp $
// $Id: UniformTileSet.java,v 1.12 2003/01/18 03:53:31 mdb Exp $
package com.threerings.media.tile;
@@ -69,6 +69,12 @@ public class UniformTileSet extends TileSet
// figure out from whence to crop the tile
int tilesPerRow = tsimg.getWidth() / _width;
// if we got a bogus image, return bogus tile bounds
if (tilesPerRow == 0) {
return new Rectangle(0, 0, tsimg.getWidth(), tsimg.getHeight());
}
int row = tileIndex / tilesPerRow;
int col = tileIndex % tilesPerRow;