60 int tile_offset_x = x % tile_width;
61 int tile_offset_y = y % tile_height;
64 if (tile_offset_x + width <= tile_width && tile_offset_y + height <= tile_height) {
69 assert(tile !=
nullptr);
72 auto image = tile->getImage();
73 return image->getChunk(tile_offset_x, tile_offset_y, width, height);
84 int tile_start_x = x / tile_w * tile_w;
85 int tile_start_y = y / tile_h * tile_h;
86 int tile_end_x = (x + width - 1) / tile_w * tile_w;
87 int tile_end_y = (y + height - 1) / tile_h * tile_h;
89 for (
int iy = tile_start_y; iy <= tile_end_y; iy += tile_h) {
90 for (
int ix = tile_start_x; ix <= tile_end_x; ix += tile_w) {