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: Daniel L Speyer <dspeyer@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Isometric Oil mines, etc. [Patch] (PR#1268)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 22 Feb 2002 10:17:03 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

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 {}

> -  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;
  }
}

        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"


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