Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: Isometric Oil mines, etc. [Patch] (PR#1268)
Home

[Freeciv-Dev] Re: Isometric Oil mines, etc. [Patch] (PR#1268)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Isometric Oil mines, etc. [Patch] (PR#1268)
From: Daniel L Speyer <dspeyer@xxxxxxxxxxx>
Date: Fri, 22 Feb 2002 08:17:45 -0500 (EST)

On Fri, 22 Feb 2002, Raimar Falke wrote:

> On Thu, Feb 21, 2002 at 05:52:41PM -0800, Daniel L Speyer wrote:
> 
> > --- freeciv-01-26-02/client/tilespec.c      Mon Jan  7 02:03:46 2002
> > +++ freeciv/client/tilespec.c       Thu Feb 21 20:29:41 2002
> > @@ -419,6 +419,16 @@
> >         assert(sprites.field);\
> >      } while(0)
> >  
> > +/* This one lets you pick a sprite *iff* it's there */
> > +#define SET_SPRITE_ALT(field, tag, alt) do { \
> > +       sprites.field = hash_lookup_data(sprite_hash, tag);\
> > +       if (!sprites.field) \
> > +           sprites.field = hash_lookup_data(sprite_hash, alt);\
> > +       assert(sprites.field);\
> > +    } while(0)
> 
> Add {}

OK, braced version attatched.

> 
> > -  if (tspecial & S_MINE && draw_mines) {
> > -    /* We do not have an oil tower in isometric view yet... */
> > +  if (tspecial & S_MINE && draw_mines
> > +                        && (ttype == T_HILLS || ttype == T_MOUNTAINS)) {
> > +    /*Oil mines come later*/
> >      *sprs++ = sprites.tx.mine;
> >    }
> >  
> > @@ -1236,6 +1245,12 @@
> >        *sprs++ = tile_types[ttype].special[0].sprite;
> >      else if (tspecial & S_SPECIAL_2)
> >        *sprs++ = tile_types[ttype].special[1].sprite;
> > +  }
> > +
> > +  if (tspecial & S_MINE && draw_mines 
> > +                        && ttype != T_HILLS && ttype != T_MOUNTAINS) {
> > +    /* Must be Glacier or Dessert -- looks better on top of special*/
> > +    *sprs++ = sprites.tx.oil_mine;
> >    }
> 
> Why can't this be coded as
> 
> if (tspecial & S_MINE && draw_mines) {
>   if(ttype == T_HILLS || ttype == T_MOUNTAINS) {
>     *sprs++ = sprites.tx.mine;
>   } else  {
>     *sprs++ = sprites.tx.oil_mine;
>   }
> }
> 
Because the order of sprs determines the order in which the sprites will
be drawn.  Mines in hills/mountains should appear underneath specials, but
mines in deserts and glaciers should appear above them.  This isn't any
deeply fundamental rule, but it is true for every tileset I've tried (even
Hires, which has no disting oil_mine), and it's how overhead does it, and
it corresponds to coal mines bein dug into the earth and oil wells being
raised above it.

If there's some more elegant way to achieve this, that would be nice, but
I haven't been able to think of one.  Order in that function is the way
order is generally determined.

--Daniel Speyer
If you *don't* consider sharing information to be morally equivalent to 
kidnapping and murder on the high seas, you probably shouldn't use the
phrase "software piracy."

>       Raimar
> 
> -- 
>  email: rf13@xxxxxxxxxxxxxxxxx
>  "I heard if you play the NT-4.0-CD backwards, you get a satanic message."
>  "That's nothing, if you play it forward, it installs NT-4.0"
> 

Attachment: oilmine.patch
Description: Text document


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