guint _curr_download=0;
static osm_location map_loc = {NULL, NULL, NULL, FALSE, FALSE, 0, 0, 0.0, 0.0 };
-static GHashTable *map_tile_hash = NULL;
typedef struct _map_tile_rdata map_tile_rdata;
struct _map_tile_rdata {
* this method, but I guess it's not general-purpose enough.
*/
static void
-map_pixbuf_scale_inplace(GdkPixbuf * pixbuf, guint ratio_p2,
- guint src_x, guint src_y)
+map_pixbuf_scale_inplace(GdkPixbuf * pixbuf, guint ratio_p2, guint src_x, guint src_y)
{
guint dest_x = 0, dest_y = 0, dest_dim = TILE_SIZE_PIXELS;
guint rowstride = gdk_pixbuf_get_rowstride(pixbuf);
/* Download, if we should. */
if (_auto_download && _curr_repo->type != REPOTYPE_NONE &&
- !((_zoom + zoff -
- (_curr_repo->double_size ? 1 : 0))
- % _curr_repo->dl_zoom_steps)) {
+ !((_zoom + zoff - (_curr_repo->double_size ? 1 : 0)) % _curr_repo->dl_zoom_steps)) {
if (!fast_fail)
map_initiate_download(tilex >> zoff,
tiley >> zoff,
}
} else {
/* Check if we need to trim. */
- if (gdk_pixbuf_get_width(pixbuf) != TILE_SIZE_PIXELS
- || gdk_pixbuf_get_height(pixbuf) != TILE_SIZE_PIXELS)
+ 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));
-#ifdef DEBUG
- g_printf("I: %s (%d)\n", buffer, zoff);
-#endif
+ (tilex - ((tilex >> zoff) << zoff)) << (TILE_SIZE_P2 - zoff),
+ (tiley - ((tiley >> zoff) << zoff)) << (TILE_SIZE_P2 - zoff));
}
}
}
}
+
if (pixbuf) {
gdk_draw_pixbuf(_map_pixmap,
_gc[COLORABLE_MARK],