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: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: the directional system
From: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Date: Mon, 10 Sep 2001 06:33:48 -0400
Reply-to: jdorje@xxxxxxxxxxxxxxxxxxxxx

Raimar Falke wrote:
> 
> On Sun, Sep 09, 2001 at 07:53:13PM +0200, Thue wrote:
> > On Sunday 09 September 2001 18:59, Raimar Falke wrote:
> > > 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?!
> >
> > Yes, looks like it should be DIR_D[XY]2 arrays.
> >
> > > > (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
> >
> > Both look like acceptable solutions to me, with pros and cons; I don't
> > feel strongly that one is clearly superior. For my sake you can just
> > pick one :).
> 
> Problem: Freeciv's primary direction system (DIR_DX) is used in most
> code places. Freeciv is or will be after a few patches independent in
> this respect of the direction system used.
> 
> Non-isometric tilesets are layouted in INDEX_NSEW. The isometric
> tileset is layouted in DIR_DX2.
> 
> Solutions:
>  - unify the systems

I definitely think we want to unify the systems.

>    * to DIR_DX: the isometric tileset (loading) has to be changed
>      (specfile changing, mapping at some point)
>    * to DIR_DX2: a some of code has to be checked if it works with
>      DIR_DX2 (this is a good thing). However we tie a lot of code to
>      the DIR_DX2 system and so loose flexibility

But, we should unify them to something that is schema-independent. 
Neither of these solutions have that.

>  - one big system and one small system: move all the DIR_DX2 stuff
>  into fill_tile_sprite_array_iso() or at least into tilespec.c

Ross likes to point out that the GUI schema can be independent of the
rest of the code, but IMO it's much simpler just to have one system.

>  - get rid of this problem: change the way the road and rail graphics
>  are handled. Instead of indexes use symbolic names. Change
>  11, 1, "r.road0"
>  11, 2, "r.road1"
> to
>  11, 1, "r.road_n"
>  11, 2, "r.road_ne"
> and
>       struct Sprite *dir[8];
> to
>       struct { struct Sprite *n,*nw,*ne,....;} iso;
> 
> in struct named_sprites.{road,rail}. This may include some extra work
> but leave us with less problems in the long run.

This is a far better solution.  It makes things easier to write and
understand.  It may be wise to allow either "n" or "north" to be used
interchangably for the symbolic name.

jason


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