[Freeciv-Dev] Re: the directional system
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
dir_dx2-2.diff
Description: Text document
- [Freeciv-Dev] Re: the directional system, (continued)
- [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
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/12
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/12
- [Freeciv-Dev] Re: the directional system,
Raimar Falke <=
- [Freeciv-Dev] Re: the directional system, Ross W. Wetmore, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/11
- [Freeciv-Dev] Re: the directional system, Ross W. Wetmore, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Ross W. Wetmore, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Thue, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Ross W. Wetmore, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Thue, 2001/09/11
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Jason Dorje Short, 2001/09/10
- [Freeciv-Dev] Re: the directional system, Raimar Falke, 2001/09/10
|
|