guint _base_tilex = -5;
guint _base_tiley = -5;
+static guint map_max_zoom=MAX_ZOOM;
guint _zoom = 3; /* zoom level, from 0 to MAX_ZOOM. */
Point _min_center = { -1, -1 };
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) {
+for (zoff = (_curr_repo->double_size ? 1 : 0); !pixbuf && (_zoom + zoff) <= map_max_zoom && zoff <= TILE_SIZE_P2; zoff += 1) {
pixbuf=map_tile_load(tilex, tiley, zoff, !fast_fail);
if (!pixbuf) {
if (!fast_fail)
{
/* Note that, since new_zoom is a guint and MIN_ZOOM is 0, this if
* condition also checks for new_zoom >= MIN_ZOOM. */
-if (new_zoom > (MAX_ZOOM - 1))
+if (new_zoom > (map_max_zoom - 1))
return FALSE;
if (new_zoom == _zoom)
return FALSE;
if (_key_zoom_new < _zoom) {
/* We're currently zooming in (_zoom is decreasing). */
guint test = _key_zoom_new - _curr_repo->view_zoom_steps;
- if (test < MAX_ZOOM)
+ if (test < map_max_zoom)
_key_zoom_new = test;
else
return FALSE;
} else {
/* We're currently zooming out (_zoom is increasing). */
guint test = _key_zoom_new + _curr_repo->view_zoom_steps;
- if (test < MAX_ZOOM)
+ if (test < map_max_zoom)
_key_zoom_new = test;
else
return FALSE;
gint nzoom;
nzoom=_zoom+zdir;
-if ((nzoom > 0) && (nzoom < MAX_ZOOM - 1)) {
+if ((nzoom >= 0) && (nzoom < map_max_zoom - 1)) {
map_set_zoom(nzoom);
}
return nzoom;