[Freeciv-Dev] Re: (PR#2509) unification of update_map_canvas
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients:; |
Subject: |
[Freeciv-Dev] Re: (PR#2509) unification of update_map_canvas |
From: |
"Jason Short via RT" <rt@xxxxxxxxxxxxxx> |
Date: |
Sat, 7 Dec 2002 15:14:55 -0800 |
Reply-to: |
rt@xxxxxxxxxxxxxx |
On Sat, 2002-12-07 at 08:05, Rafa³ Bursig via RT wrote:
> I don't like it. (This code extort on sdlclient whorse flush metod )
> I prefer solution when "write_to_screen" go to
> put_one_tile/put_one_tile_iso parms. And each client make his own
> buffering method.
Each client can make its own buffering method. What this change does is
help to separate the flushing of the buffer from the drawing of the
buffer.
We don't want to propogate write_screen to put_one_tile. This will give
bad results when we draw more than one tile at a time.
The drawing system the SDL-client uses is broken. The buffering it does
is fine, but ignoring the write_to_screen parameter will not work. It
makes it impossible to keep everything updated (city names, map grid,
moving units, etc). This problem must be fixed in the core, and to do
so flush_screen can help.
I think if gui-sdl just gives proper implementations of all these
functions, we can address the problems in the core and all clients will
benefit.
The best long-term solution IMO is to get rid of the write_to_screen
parameters entirely (i.e., make them all FALSE). Thus no writes go to
the screen until a flush() is propogated. But this may not work for
animation; we haven't quite gotten that far yet.
In any case, I don't want to give the SDL client special preference just
because it uses a workaround for the current drawing inefficiency in the
core code.
> The additional advantage is that we can call
> put_one_tile/put_one_tile_iso directly from "refresh_tile_mapcanvas(int
> x, int y, bool write_to_screen)"
That gives little advantage, since we need to draw at least 5 tiles
anyway (in the iso case). When compiling with gcc and -O3 I suspect the
code will even be the same.
> flush_mapcanvas(void) funct. shoult replace update_map_canvas_visible()
> in unqueue_mapview_update(void) and be defined in gui-side.
Well, it's not quite that simple. queue_mapview_update provides a more
sophisticated mechanism than just telling the GUI to draw the code. But
the implementation is poor.
jason
|
|