]> err.no Git - mapper/commitdiff
misc
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 16 Aug 2007 10:52:41 +0000 (13:52 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 16 Aug 2007 10:52:41 +0000 (13:52 +0300)
src/map.c

index e754687effe8bc4bdb793ab06cbd95fa5e406e2f..147a11e77f6c8a5176ebba624941a4aaae6cbbd5 100644 (file)
--- 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],