Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: the directional system
Home

[Freeciv-Dev] Re: the directional system

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: rf13@xxxxxxxxxxxxxxxxxxxxxx, jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: the directional system
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Fri, 07 Sep 2001 23:35:45 -0400

At 08:50 AM 01/09/07 -0400, Jason Dorje Short wrote:
>Raimar Falke wrote:
[...]
>One other clarification: I've removed the DIR_D[XY]2 arrays, but I've
>changed the DIR_D[XY] arrays to use that directional system so really
>it's everything else that has changed.  Trying to find magic code by
>searching for DIR_D[XY] usages is pretty futile; the use of DIR_D[XY]
>itself is quite safe but the problem is when the code tries to
>manipulate the directions directly.  This often occurs several levels
>down (for instance in straightest_direction() and get_char() which don't
>use the arrays at all).  So, it will be difficult to tell by inspecting
>the code that all "magic" has been removed.

This is worth repeating ... people need to understand, and so far I think
too few actually do.

Actually, there are two points here. Changing DIR_DX under the covers
can cause lots of problems, because you really don't look at each case
where it is used when you just change the semantics/data - the existing
code has not really been cleaned to use a standard approach where such
changes can be done. Also, there are lots of places that assume things 
about directions and magic numbers or algorithms like 7-dir.

>jason

Cheers,
RossW
=====



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