GdkPixbuf *pixbuf=NULL;
gint zoff;
-g_debug("MAP RT: %d %d %d %d (%d, %d)", tilex, tiley, destx, desty, buf_width_tiles, buf_height_tiles);
-
if (destx > buf_width_pixels || desty > buf_height_pixels)
return FALSE;
-if (tilex<_world_size_tiles && tiley<_world_size_tiles) {
- /* The tile is possible. */
- for (zoff = (_curr_repo->double_size ? 1 : 0); !pixbuf && (_zoom + zoff) <= MAX_ZOOM && zoff <= TILE_SIZE_P2; zoff += 1) {
- pixbuf=map_tile_load(tilex, tiley, zoff, !fast_fail);
- if (!pixbuf) {
- if (!fast_fail)
- fast_fail=TRUE;
- } else {
- /* Check if we need to trim. */
- if (gdk_pixbuf_get_width(pixbuf) != TILE_SIZE_PIXELS || gdk_pixbuf_get_height(pixbuf) != TILE_SIZE_PIXELS)
- pixbuf = pixbuf_trim(pixbuf);
-
- /* Check if we need to blit. */
- if (zoff) {
- map_pixbuf_scale_inplace(pixbuf, zoff,
- (tilex - ((tilex >> zoff) << zoff)) << (TILE_SIZE_P2 - zoff),
- (tiley - ((tiley >> zoff) << zoff)) << (TILE_SIZE_P2 - zoff));
- }
+if (tilex > _world_size_tiles || tiley > _world_size_tiles)
+ return FALSE;
+
+g_debug("MAP RT: %u %u (%u) %u %u (%u, %u)", tilex, tiley, _world_size_tiles, destx, desty, buf_width_tiles, buf_height_tiles);
+
+/* The tile is possible. */
+for (zoff = (_curr_repo->double_size ? 1 : 0); !pixbuf && (_zoom + zoff) <= MAX_ZOOM && zoff <= TILE_SIZE_P2; zoff += 1) {
+ pixbuf=map_tile_load(tilex, tiley, zoff, !fast_fail);
+ if (!pixbuf) {
+ if (!fast_fail)
+ fast_fail=TRUE;
+ } else {
+ /* Check if we need to trim. */
+ if (gdk_pixbuf_get_width(pixbuf) != TILE_SIZE_PIXELS || gdk_pixbuf_get_height(pixbuf) != TILE_SIZE_PIXELS)
+ pixbuf = pixbuf_trim(pixbuf);
+
+ /* Check if we need to blit. */
+ if (zoff) {
+ map_pixbuf_scale_inplace(pixbuf, zoff,
+ (tilex - ((tilex >> zoff) << zoff)) << (TILE_SIZE_P2 - zoff),
+ (tiley - ((tiley >> zoff) << zoff)) << (TILE_SIZE_P2 - zoff));
}
}
}