Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] (PR#2328) get_mapview_dimensions
Home

[Freeciv-Dev] (PR#2328) get_mapview_dimensions

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2328) get_mapview_dimensions
From: "Jason Short via RT" <rt@xxxxxxxxxxxxxx>
Date: Wed, 13 Nov 2002 16:20:24 -0800
Reply-to: rt@xxxxxxxxxxxxxx

The attached patch provides a method for the client common code (e.g., 
mapview_common.[ch]) to determine the dimensions of the client's mapview 
area.

All clients have the same sort of information about this, but each 
stores it in a different form.  Ideally this data would instead be 
stored globally (in variables in mapview_common), but this is 
non-trivial for some GUIs.  Doing it this way provides an intermediate step.

This function allows the unification of another set of GUI functions.  I 
haven't looked exhaustively, but I believe get_map_xy, get_canvas_xy, 
tile_visible_mapcanvas, tile_visible_and_not_on_border_mapcanvas, 
get_center_tile_mapcanvas, update_map_canvas_visible, 
show_city_descriptions, and update_city_descriptions can be pulled out 
of gui-xxx/mapview.c and put into mapview_common.c

There are really six values: the top-left corner's (x, y) map 
coordinates, the canvas width and height in pixels, and the mapview 
width and height in tiles.  The last two can be determined by the pixel 
dimensions.  But some might argue that (for efficiency) there should be 
three different functions - to get each pair of values.  That would be 
fine too.

jason




[Prev in Thread] Current Thread [Next in Thread]