Deal gracefully with images that we can't usefully tile (which includes

the default 1x1 transparent image we're given if the image manager failed
to load an image successfully.)


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1821 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Walter Korman
2002-10-22 02:02:40 +00:00
parent a0e9044e93
commit 2a26c76006
@@ -1,5 +1,5 @@
//
// $Id: BackgroundTiler.java,v 1.3 2002/09/25 21:49:53 shaper Exp $
// $Id: BackgroundTiler.java,v 1.4 2002/10/22 02:02:40 shaper Exp $
package com.threerings.media.util;
@@ -36,6 +36,13 @@ public class BackgroundTiler
_h3 = _height/3;
_ch3 = _height-2*_h3;
// make sure the image suits our minimum useful dimensions
if (_w3 <= 0 || _cw3 <= 0 || _h3 <= 0 || _ch3 <= 0) {
Log.warning("Backgrounder given source image of insufficient " +
"size for tiling [src=" + src + "].");
return;
}
// create our sub-divided images
_tiles = new BufferedImage[9];
int[] sy = { 0, _h3, _h3+_ch3 };