Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] Re: (PR#3424) New flush code soplited in 2 parts
Home

[Freeciv-Dev] Re: (PR#3424) New flush code soplited in 2 parts

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bursig@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3424) New flush code soplited in 2 parts
From: "Raimar Falke" <rf13@xxxxxxxxxxxxxxxxx>
Date: Sat, 15 Feb 2003 10:24:25 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Sat, Feb 15, 2003 at 09:20:59AM -0800, Jason Short wrote:
> Raimar Falke wrote:
> > On Sat, Feb 15, 2003 at 02:32:35AM -0800, Rafa? Bursig wrote:
> > 
> >>>Naming: all three function should have the same prefix
> >>>Coding-Style: read the guide.
> >>> +void add_to_flush( int canvas_x , int canvas_y ,
> >>>                    ^            ^  remove these
> >>>                    1             2
> >>
> >>1) I still prefer name "add_to_flush" than "flush_add_to".
> > 
> > 
> > What do you think about:
> > 
> > flush_add_region
> > flush_add_all_as_region
> > flush_all_regions
> 
> I prefer:
> 
> dirty_rect
> dirty_all
> flush_dirty_rects

s/rect/rectangle/ or
s/rect/region/ if you want it short.

Prefix with mapcanvas_?

> which is far more descriptive than "add_to_flush"...

Yes.

> >>If you put flush_rects() at end of update_map_canvas_visible then flush 
> >>is made after redraw map and redraw city descriptions but sdl client 
> >>have additional widget layer which is redrawed with other net packages.
> > 
> > 
> > I know. I proposed to change
> >   void update_map_canvas_visible(void)
> > to
> >   void update_map_canvas_visible(bool write_to_screen)
> > 
> > And add
> >   if(write_to_screen) {
> >     // call flush function
> >   }
> > at the end of it.
> 
> Under these patches, the write_to_screen parameter doesn't really do 
> anything anymore.  Whatever value it has, the client is likely to just 
> mark the area as dirty and flush it later.  The core issue is that every 
> drawing operation should be written to screen; the only qeustion is 
> when.  With the introduction of flush_dirty_rects this question is answered.

I want to add it since a lot of callers of update_map_canvas_visible
would call mapcanvas_flush_dirty afterwards. Another alternative is a
new function update_map_canvas_visible_and_flush. Just look at it as a
chance to channel a common code pattern into a function or parameter.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 Make a software that is foolproof, and only fools will want to use it.




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