[Freeciv-Dev] Re: the directional system
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
>
> On Sun, Sep 09, 2001 at 03:39:51AM -0400, Jason Dorje Short wrote:
> > Raimar Falke wrote:
> >
> > > I still don't understand it. DIR_DX2 is only used in one method. Why
> > > not just convert this and be fine (at least as an immediate step) with
> > > one system. Why to switch all over to the DIR_DX2 system? Why is the
> > > DIR_DX2 inferior to the DIR_DX system (not the naming but the
> > > ordering)?
The log entry by Thue says:
revision 1.42
date: 2001/02/06 20:30:58; author: thue; state: Exp; lines: +154
-125
Layer view; you can choose not to display some map info.
Patch by Daniel M Church <dchurch@xxxxxxxxxxxxxxxxxxx> and me.
Which is not particularly useful.
I'll let Ross cover the theoretical aspects; all I have to say is one
thing:
#define DIR_ADJACENT(dir1, dir2) ((dir1+1)%8==dir2 || (dir2+1)%8==dir1)
versus
#define DIR_ADJACENT(dir1, dir2) \
( dir1 == DIR8_NORTH ? (dir2==DIR8_NORTHEAST || dir2==DIR8_NORTHWEST)
:
( dir1 == DIR8_NORTHEAST ? (dir2==DIR8_NORTH || dir2==DIR8_EAST) :
( dir1 == DIR8_EAST ? (dir2==DIR8_NORTHEAST || dir2==DIR8_SOUTHEAST) :
( dir1 == DIR8_SOUTHEAST ? (dir2=DIR8_EAST || dir2==DIR8_SOUTH) :
( dir1 == DIR8_SOUTH ? (dir2==DIR8_SOUTHEAST || dir2==DIR8_SOUTHWEST) :
( dir1 == DIR8_SOUTHWEST ? (dir2==DIR8_SOUTH || dir2==DIR8_WEST) :
( dir1 == DIR8_WEST ? (dir2==DIR8_SOUTHWEST || dir2==DIR8_NORTHWEST) :
( dir1 == DIR8_NORTHWEST ? (dir2==DIR8_WEST ||
dir2==DIR8_NORTH)))))))))
This particular macro would take almost all of the work out of
straightest_direction and dir_ok.
I really don't see how you can argue the rotational system isn't
better. You may claim it's not worth the trouble to fix, but I believe
cleaning up the code is worth doing in its own right.
jason
- [Freeciv-Dev] Re: the directional system, (continued)
- [Freeciv-Dev] Re: the directional system, Ross W. Wetmore, 2001/09/07
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/08
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system,
Jason Dorje Short <=
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Thue, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Ross W. Wetmore, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Thue, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Thue, 2001/09/09
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/10
|
|