Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] Re: (PR#7461) move nuke animation into mapview_common
Home

[Freeciv-Dev] Re: (PR#7461) move nuke animation into mapview_common

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7461) move nuke animation into mapview_common
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Sun, 22 Feb 2004 04:40:18 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7461 >

On Sat, Feb 21, 2004 at 03:43:06PM -0800, Jason Short wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7461 >
> 
> This patch accomplishes a few things.
> 
> The main goal is to move the nuke animation (put_nuke_mushroom_pixmaps) 
> into mapview_common.  (Currently the "animation" is just a single sprite 
> left on the screen for 1 second.  However I think Arnstein and Rafal 
> were working on real animation.)
> 
> To do this properly two new GUI functions were needed: 
> get_sprite_dimensions() and gui_flush().  The former just gives the 
> width and height of the sprite (encoded in the sprite structure but not 
> available to the common code).  The latter calls gdk_flush() or whatever 
> other hardware-flush function is available.
> 
> At the same time I changed the non-iso nuke drawing to be the same as 
> the iso-view drawing.  This is easy to do and obviously better (it fits 
> a fixme comment already in place).  It cuts down on code and avoids bugs 
> in the old method (flickering and misplaced nuke images).
> 
> The logic of the function is slightly changed becase we have to copy to 
> the canvas store, then flush to the screen.  This is probably a good 
> thing.  However it means we have to do a full update_map_canvas_visible 
> at the end to restore the original screen (this was being done already, 
> but it was unnecessary).  If we had a second backing store (the same 
> size as the nuke sprite) we could make a backup copy and avoid this 
> update.  But this is unnecessary (a full update is trivial compared to a 
> 1-second wait).
> 
> Support is included for gtk2, gtk, xaw, and win32 clients.  I've tested 
> the gtk2 client in iso and non-iso views.  The others I've compiled but 
> not tested.

Good idea. Two issues: can we please use "width" and "height" as the
parameter names?

The second: It would be good to define in more detail what canvas
store, window and screen are. And that gui_flush() copies the window
to the screen.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "#!/usr/bin/perl -w
  if ( `date +%w` != 1 ) {
    die "This script only works on Mondays." ;
  }"
    -- from chkars.pl by Cornelius Krasel in de.comp.os.linux.misc




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