[Freeciv-Dev] Re: Core code cleanups [Was: Profiling Civserveragain]
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Trent Piepho wrote:
>
> On Thu, 2 Aug 2001, Jason Dorje Short wrote:
> >
> > I now realize that in this case I meant unreal (or non-real, invalid)
> > coordinates.
>
> Oh, I see what you mean. I think you can create an alternate version of the
> macro that handles this. With my system of wrapping, it would look like this:
Actually, I was thinking of something more like
#define adjc_dir_all_iterate(x, y, x1, y1, dir) \
{ int _border = is_border_tile(x, y), dir; \
for(dir=0; dir<8; dir++) { \
int _valid = 1; \
int x1 = x + DIR_DX2[dir]; \
int y1 = y + DIR_DY2[dir]; \
if (_border) \
_valid = normalize_map_pos(&x1, &y1); \
if (_valid) { \
#define adjc_all_iterate_invalid } else {
#define adjc_all_iterate_end } } }
However, I don't really think this is necessary - the situations where
invalid directions are used are easily handled.
On a separate note, I really don't think your DIR_DX[type][dir] arrays
will work for a lot of wrapping systems that freeciv might like to use.
We're better off just calling normalize_map_pos.
jason
[Freeciv-Dev] Re: Core code cleanups, Ross W. Wetmore, 2001/08/01
Message not available[Freeciv-Dev] Re: Isometric maps, Lino Mastrodomenico, 2001/08/04
|
|