optimize tileset drawing