[Freeciv-Dev] Re: (PR#6257) recodify map_pos<->index conversion to use n
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, 23 Sep 2003, Jason Short wrote:
> Clever. This is generally the type of thing we want to avoid - since
> most of the time it will only lead to misuse - but here it is helpful.
If you want to discourage people from using the new macros, maybe you
should put a comment above their declaration?
>
> Patch attached.
>
> Note that for for iso-maps the calculation will be something like
>
> y: (map_x + map_y - map.xsize)
> x: (map_x - map_y + map.xsize - (map_x + map_y - map.xsize) & 1) / 2
>
> which is why both map x and y values are needed for the macros (which is
> why taking them individually is generally a bad idea).
>
> I used map_pos_to_native_[xy] for the names - along the lines of
> map_pos_to_index. Making them longer discourages people from using them
> needlessly :-).
>
> jason
>
>
- [Freeciv-Dev] Re: (PR#6257) recodify map_pos<->index conversion to use native positions,
Gregory Berkolaiko <=
|
|