Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Core code cleanups [Was: Profiling Civserveragain]
Home

[Freeciv-Dev] Re: Core code cleanups [Was: Profiling Civserveragain]

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Core code cleanups [Was: Profiling Civserveragain]
From: Trent Piepho <xyzzy@xxxxxxxxxxxxx>
Date: Wed, 1 Aug 2001 22:58:57 -0700 (PDT)

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:

/* Iterate over ALL adjacent tiles.  valid will be false if current tile does
   not exist.  x1 and y1 will be meaningless in that case, but dir will be
   correct.  */

#define adjc_dir_all_iterate(x, y, x1, y1, dir, valid)  \
{ int type = map_get_boundary_type(x,y);                \
  for(dir=0;dir<8;dir++) {                              \
    valid = (DIR_DX[type][dir]!=MAX_INT);               \
    x1 = x + DIR_DX[type][dir];                         \
    y1 = y + DIR_DY[type][dir];                         \



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