public static void draw( TileGrid tg, int x, int y, int scale, Graphics g ) {
		Rectangle clipBounds = g.getClipBounds();
		for( int row=0; row<tg.height; ++row ) {
			if( y+(row+1)*scale <= clipBounds.y ) continue;
			if( y+row*scale >= clipBounds.y+clipBounds.height ) continue;
			for( int col=0; col<tg.width; ++col ) {
				if( x+(col+1)*scale <= clipBounds.x ) continue;
				if( x+col*scale >= clipBounds.x+clipBounds.width ) continue;
				
				TileIcon icon = tg.tileIcons[tg.tiles[row*tg.width+col]];
				g.setColor(icon.color0);
				g.fillRect(x+col*scale, y+row*scale, scale, scale);
			}
		}
	}