[Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7304 >
On Sat, 24 Jan 2004, Jason Short wrote:
>
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7304 >
>
> Adding iso-map support to mapgen is an ugly task. Here's the patch to
> do it.
>
> We must constantly be thinking about whether the positions we're working
> with are in map or native coordinates. Mapgen must generally work with
> both.
>
> A few wrappers (suggested by Marcelo) are used for convenience:
> nat_get_terrain => returns the terrain for a position in native coords
> nat_set_terrain => blah, blah
> do_in_map_pos(map_x, map_y, nat_x, nat_y) {
> => mapgen macro to allow local conversion from native to map coords
> } do_in_map_pos_end;
>
> It's been tested moderately with a variety of generators and topologies.
> However there are a very high number of possibilities so it's possible
> some bugs remain (usually these bugs lead to an immediate segfault and
> so are easy to find).
It looks sane to me. Minor requests:
1. Make sure you format the lines you change.
2. We should agree on a policy where the name of a coordinate would
indicate its type. I am really aginst things like
native_to_map_pos(&x, &y, x, y);
It seems the default is map coords, so native should _always_ be called
(xn, yn).
3. I don't understand the need for the extra layer in do_in_map_pos. Is
it to const the variables?
Now, a big question. I appreciate it's probably too late to ask it and
that I possibly already asked it a couple of times.
It seems that the default coordinates throughout Freeciv will be map
coordinates. Why not native? They are more "natural" for most things.
Where would you ever want to really use the map coordinates, apart from
adjacency calculations which can be hidden in few macros?
In future, when compiled with DEBUG option, which coordinates will clients
display on middle-click? They should be map coordinates (because such
things are used to locate units for debugging), but these would be very
hard to find on a map!
G.
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen,
Gregory Berkolaiko <=
- [Freeciv-Dev] (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/25
- [Freeciv-Dev] (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/25
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Gregory Berkolaiko, 2004/01/25
- [Freeciv-Dev] (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/25
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Gregory Berkolaiko, 2004/01/25
- [Freeciv-Dev] (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/25
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, rwetmore@xxxxxxxxxxxx, 2004/01/26
- [Freeciv-Dev] (PR#7304) iso-map support for mapgen, Jason Short, 2004/01/26
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Gregory Berkolaiko, 2004/01/27
- [Freeciv-Dev] Re: (PR#7304) iso-map support for mapgen, Gregory Berkolaiko, 2004/01/27
|
|