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: Thue <thue@xxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: the directional system
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 9 Sep 2001 18:59:29 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sun, Sep 09, 2001 at 05:29:01PM +0200, Thue wrote:
> On Sunday 09 September 2001 12:33, Thue wrote:
> > On Sunday 09 September 2001 10:08, Raimar Falke wrote:
> > > > The DIR_DX2 system, by the way, was recently introduced to
> > > > FreeCiv by (IIRC) Thue.  But, he didn't get very far in
> > > > converting FreeCiv over to its use: it's only used in one place.
> > >
> > > Exactly. And even at this one place it provides no advantage. Thue?
> > >
> > >   Raimar
> >
> > The advantages of the DIR_D[XY] arrays is:
> > -It is easy to find the opposite direction as (7-dir). This is the
> > DIR_REVERSE macro.
> > ­The first 3 directions are above the center, and the last 3 are
> > below. So you could potentially optimize an iteration. (I don't know
> > if this is used.)
> >
> > Most uses of iterations don't case which of the adjacent tiles it
> > uses, it just needs to be fed them all one at a time, so the
> > unintuitive sequence doesn't do any harm there. (The fact that
> > DIR_D[XY]2 is only used one place seems to support this argument)
> >
> > The DIR_D[XY]2 was used that place because we actually needed to map
> > array indices to their direction. Using the new "enum direction8"
> > with DIR_D[XY] would be a cleaner solution here, and allow you to
> > remove DIR_D[XY]2.
> >
> > -Thue
> 
> Umm, looking a bit closer, the roads and rails in isometric view are 
> also arranged according to DIR_D[XY]2.

This must be the point Ross is referring to. So the comment in
hires/terrain1.spec ";roads - we follow the the numbering of the
DIR_D[XY] arrays" is wrong?!

> If you want to use the current DIR_D[XY] there will have to be some
> kind of mapping.

For example in the spec file.

> Or you could transform the sprites on load time to
> non-isometric-style setup.  

> (Or you could change the rest of freeciv to use DIR_DX2 as
> suggested, which may just require changing DIR_REVERSE)

This is the plan Justin and Ross currently follow.

Changing the spec file looks like the easiest solution to me.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
    1) Customers cause problems.
    2) Marketing is trying to create more customers.
  Therefore:
    3) Marketing is evil.


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