From aa4e003b794af393a6c20a65baee9a050f4f5aee Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Thu, 16 Aug 2007 13:52:41 +0300 Subject: [PATCH] misc --- src/map.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/map.c b/src/map.c index e754687..147a11e 100644 --- a/src/map.c +++ b/src/map.c @@ -62,7 +62,6 @@ guint _num_downloads=0; 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 { @@ -282,8 +281,7 @@ void map_set_mark() * 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); @@ -587,9 +585,7 @@ map_render_tile(guint tilex, guint tiley, guint destx, guint desty, /* 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, @@ -599,21 +595,19 @@ map_render_tile(guint tilex, guint tiley, guint destx, guint desty, } } 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], -- 2.39.5