Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] Re: (PR#2941) RFC: canvas_put_sprite
Home

[Freeciv-Dev] Re: (PR#2941) RFC: canvas_put_sprite

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Dorje Short <vze49r5w@xxxxxxxxxxx>
Cc: "freeciv-dev@xxxxxxxxxxx" <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: (PR#2941) RFC: canvas_put_sprite
From: Rafał Bursig <bursig@xxxxxxxxx>
Date: Sat, 1 Feb 2003 12:31:32 +0100

On Fri, Jan 31, 2003 at 06:34:02PM -0800, Jason Short via RT wrote:
>
> [jdorje - Thu Jan 30 06:32:34 2003]:
>
> > 3.  Introduce a single function, canvas_put_sprite(), that takes a
> > void*
> > (or a struct canvas *) as a parameter.  Now the function just
draws
> > the
> > sprite onto the canvas that is specified.  In the case of the
void*,
> > this will probably just point to the pixmap/surface onto which the
> > sprite will be drawn.  The problem here is that since the
high-level
> > mapview drawing routines are only designed for one mapview, we
would
> > need to introduce the hack that NULL refers to the "default" map
> > canvas.
> >   Later we can work to have all of these functions be passed (by
the
> > GUI) the parameter that specifies which map canvas.  (The city
dialog
> > functions will always be called by the GUI, so there is no trouble
> > there
> > for any of these 3 ideas.)  Using a struct canvas * instead means
an
> > additional level of indirection, but is slightly more type-safe
(the
> > NULL special case would still apply).  We might even be able to
use a
> > struct Sprite * that specifies the drawing target (again, with a
NULL
> > special-case).

> This patch implements it this way, using a void*.  This is
significantly
> better IMO.  I could have introduced a struct canvas, but chose not
to yet.
>
> Does anybody have an opinion on this?

Yes. Don't use void *. Both of "struct canvas { char dummy;};" or
"typedef void *canvas_t." are better.

Hi

If I understand your intention... you want move all draw code to "common" part and leave in "gui" side only "put_sprite" function...

how do you want make correct fog of war drawing ?


IMHO this type of unification give you rather bad aspects.

Rafal

----------------------------------------------------------------------
Poczuj tendencje wzrostowa! >>> http://link.interia.pl/f16c7




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