Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2576) enum citizen_type and get_citizen_sprite use
Home

[Freeciv-Dev] Re: (PR#2576) enum citizen_type and get_citizen_sprite use

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bursig@xxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2576) enum citizen_type and get_citizen_sprite used by SDLClient
From: "Raimar Falke via RT" <rt@xxxxxxxxxxxxxx>
Date: Sun, 15 Dec 2002 04:05:13 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sat, Dec 14, 2002 at 05:32:50PM -0800, Rafa³ Bursig via RT wrote:
> 
> This patch sync. SDLClient with last citizens code.

> -    pWidget->gfx = pCity_Icon->pBIG_Spec_Tax;
> +    pWidget->gfx = (SDL_Surface *)get_citizen_sprite( CITIZEN_TAXMAN, 0, 
> pCityDlg->pCity );

Please follow the style guide.

Why do you have to cast the result? *looking*

struct Sprite {
  struct SDL_Surface;
};

*shudder*

Please change this to

struct Sprite {
  struct SDL_Surface surface;
};

And then the line above will become

    pWidget->gfx =
        &get_citizen_sprite(CITIZEN_TAXMAN, 0, pCityDlg->pCity)->surface;

You may want to add an access macro for this if you with.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Like the ad says, at 300 dpi you can tell she's wearing a
  swimsuit. At 600 dpi you can tell it's wet. At 1200 dpi you
  can tell it's painted on. I suppose at 2400 dpi you can tell
  if the paint is giving her a rash."
    -- Joshua R. Poulson




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