<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39347 >

This is the "magical code snippet"

client/overview_common.c row ~420
---
get_overview_area_dimensions(&w, &h);

  freelog(LOG_DEBUG, "Map size %d,%d - area size %d,%d",
          map.xsize, map.ysize, w, h);

  /* Set the scale of the overview map.  This attempts to limit the
   * overview to the size of the area available.
   *
   * It rounds up since this gives good results with the default settings.
   * It may need tweaking if the panel resizes itself. */
  OVERVIEW_TILE_SIZE = MIN((w - 1) / (map.xsize * xfact) + 1,
                           (h - 1) / map.ysize + 1);
  OVERVIEW_TILE_SIZE = MAX(OVERVIEW_TILE_SIZE, 1);

  overview.width
    = OVERVIEW_TILE_WIDTH * map.xsize + shift * OVERVIEW_TILE_SIZE;
  overview.height = OVERVIEW_TILE_HEIGHT * map.ysize;

---

The information get_overview_area_dimensions(&w, &h); is fetched from
client-specific code. in gtk2 this leads to that the history of games
loaded and played alter the possible outcome of the "magic code". We
should perhaps change this to
+get_overview_area_default_dimensions(&w, &h);
so that clients can put in their preferred approximation of a suitable
overview area. Still this code is far from direct



_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to