Generalised the tile-drawing code to draw arbitrary tile types.