Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#3936) introducing native coordinates
Home

[Freeciv-Dev] Re: (PR#3936) introducing native coordinates

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3936) introducing native coordinates
From: Jason Dorje Short <vze49r5w@xxxxxxxxxxx>
Date: Mon, 07 Apr 2003 13:06:17 -0500
Reply-to: jdorje@xxxxxxxxxxxxxxxxxxxxx

Raimar Falke wrote:
On Sun, Apr 06, 2003 at 04:08:42PM -0500, Jason Dorje Short wrote:
Raimar Falke wrote:

The directions *are* rotated, yes. Note that the DIR_D[XY] arrays would have to be changed for native coordinates, and they would be different between iso and non-iso maps. The conclusion is that native coordinates are not good for local operations like moving in a single direction, and these are best done in map coordinates.


So what do you think about the following proposal: - we leave the storage of the map tiles unchanged
 - we add an iso bit to the map struct (save and transfer it)
 - we change DIRSTEP, MAPSTEP, is_cardinal (trivial)
 - we doesn't need to change is_normal_map_pos, is_real_map_pos,
 whole_map_iterate and is_border_map_pos
 - we change normalize_map_pos (seems trivial)
 - we change the mapview to do the rotation (non-trivial)

How does this differ from the use of iso-maps you have in mind? What
did I miss? For the mapview changes the notation of native coordinates
help a lot but these is limited to only one set of files
(mapview_common).

I don't quite understand your suggestion. Are you saying all operations be done in native coordinates, and "map" coordinates be dropped? The problem with this is most local operations become much more difficult, since the local tile geometry is not preserved. For instance adjc_dir_iterate (via DIR_D[XY]), square_iterate, map_to_city_map, map_distance, etc. This will require many changes to the code, and will be error-prone.

Ross any my idea is that the map struct gets three bits of information: xwrap, ywrap, and iso. The iso bit only needs to be checked in a few places: map_to_native_pos, native_to_map_pos, unnormalize_map_pos, and clip_mapview_window (or whatever this operation ends up being called).

The xwrap and ywrap bit is checked in a few other places: particularly normalize_map_pos nearest_real_pos.

Native positions are only used for a few operations (the vast majority continue to use map or indexed positions):

  - whole_map_iterate
  - gamelog
  - savegames
  - mapgen, all over the place
  - normalize_map_pos, nearest_real_pos
  - the map overview

jason



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