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: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: the directional system
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 Sep 2001 22:51:34 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Wed, Sep 12, 2001 at 04:09:04PM -0400, Jason Dorje Short wrote:
> Raimar Falke wrote:
> > 
> > On Mon, Sep 10, 2001 at 12:43:03PM +0200, Raimar Falke wrote:
> > > On Mon, Sep 10, 2001 at 06:33:48AM -0400, Jason Dorje Short wrote:
> 
> > > > >  - 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.
> > >
> > > Who makes the patch?
> > 
> > I made it. Objections?
> 
> I think you should keep the loop in tilespec.c rather than hard-coding
> all 8 directions.  Something like:
> 
>     for (dir=0; dir<8; dir++) {
>       my_snprintf(buffer, sizeof(buffer), "r.road%s",
> get_dir_name(dir));
>       SET_SPRITE(road.dir[dir], buffer);
>       my_snprintf(buffer, sizeof(buffer), "r.rail%s",
> get_dir_name(dir));
>       SET_SPRITE(rail.dir[dir], buffer);
>     }

Yes. I replaced it for my original plan to save them at different
names in the named_sprites struct.

> The only problem is that get_dir_name returns a capitalized name. 
> However I think it'd be better to change get_dir_name, write a new
> function that does lowercase, or use uppercase for the sprite names than
> hard-code this loop.

I have used tolower().

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Python 2.0 beta 1 is now available [...]. There is a long list of new 
  features since Python 1.6, released earlier today. We don't plan on 
  any new releases in the next 24 hours."
    -- Jeremy Hylton at Slashdot

Attachment: dir_dx2-2.diff
Description: Text document


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