[Freeciv-Dev] Re: Very small patch to start the coordinate generalizati
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Thue wrote:
>
> On Fri, 22 Sep 2000 10:45:35 Erik Sigra wrote:
> > Hi,
> > This 955 byte patch starts the proces of coordinate generalization. It
> > should be completely harmless, not changing anything visible. Since it
> > is so small, it should be easy to audit. It is an important step to
> > build further on.
>
> OK; what you change is actually very little; instead of declairing a map
> position as
> int x, y
> you call it
> struct position {x, y}
>
> While the struct concept is nice, it is not really that important that I
> want to recode half of freeciv for it. I would personally find it
> acceptable, however, for new code to use it (as it really isn't that
> different, it shouldn't cause compatability problems).
Right. No need for a complete recode. Just let new code use it and
accept small paches to change it gradually.
> Note that the admins' position should also be heard.
I'm listening...
> The very first thing to do if you really want to use it is to get the
> support functions right; ie macros and functions like is_real_tile() and
> normalize_map_pos(). Specifically you shouldn't manually iterate over the
> whole map, but use whole_map_iterate in the attached patch... For the same
> reason a generalized map sized struct like the one for height_map should be
> hidden beneth an access layer. (both these are needed for my numbering
> scheme for isometric view, if we ever want to implement it)
> Also the definition of north could also change with numbering, and should be
> isolated in a seperate function. (you used it in the attached patch)
I was planning to release the functions north, east, south and west in
patch number 5. (3 and 4 will be preparations for optional wrapping in
either direction.)
Now that Gaute has posted a patch to clean up some of the mess in mapgen
I will wait for it to get in and then base my patchlet series on it. So
look at Gautes patch first - not this one. I will post a new patch
later. I have tested his patch today and it seemd to generate normal
maps. No playtesting should be needed sice it only affects mapgen. (I
tested it without the redundant pair of parentheses in the macro
definition.)
To get things as right as possible as early as possible I need to ask
about this: There is a struct called map_position defined at
<http://www.freeciv.org/lxr/source/common/map.h?v=cvs#L25>. It is
equivalent to my proposed struct locus, but I think it is to tiresome to
type. It is long and has a '_'. Five letters is more like it I think.
map_position is only used in few places, so perhaps it can be changed to
locus? Or maybe use some typedef? It's up to you.
|
|