Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2004:
[Freeciv-Dev] (PR#8999) RFC: removing partial tile drawing
Home

[Freeciv-Dev] (PR#8999) RFC: removing partial tile drawing

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#8999) RFC: removing partial tile drawing
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Jun 2004 18:43:19 -0700
Reply-to: rt@xxxxxxxxxxx

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

The attached image shows descriptions of two different drawing 
algorithms: tricky buffered drawing versus partial tile drawing.  I made 
this a _long_ time ago during the unification of mapview code 
(update_map_canvas or thereabouts).

In both cases we want to update a part of the mapview while leaving the 
rest untouched.  In the past this part of the mapview was represented by 
a map rectangle (a (map_x,map_y) and (width,height) parameters).  Now it 
is represented directly in canvas coordinates.  In both cases we want to 
fully update (redraw) the portions of the mapview specified by the 
parameters to update_map_canvas, and leave the rest of the mapview 
untouched.

The original code to do this (written by Thue for gui-gtk, then copied 
into gui-mui, gui-win32, gui-gtk-2,0, later partially merged back into 
mapview_common) follows a "partial tile drawing" algorithm, as described 
in the diagram.  In this algorithm, when we draw a part of a tile it is 
done by passing those parameters to the tile drawing code, which in turn 
passes them to the sprite drawing code, so that sprites are themselves 
only partially copied to the backing store.

By comparison the tricky buffered drawing method draws the entire sprite 
to an intermediate backing store, then does a second copy to move just 
the desired parts of the intermediate backing store over to the main 
backing store.  Then yet another draw is needed to copy this to the screen.

The tricky buffered method has the disadvantage that only rectangular 
areas may be updated.  However the partial tiled method has the 
disadvantage that it only works for sprites, not other drawing elements 
like text, rectangles, or lines.  This means that using partial tile 
only it is impossible to have a fully "correct" mapview.  So as part of 
the mapview fixups we started using a tricky buffered method so that 
goto lines, citydlg overlays, and city description text could be drawn 
correctly.

However this means the partial tile method is no longer needed; it is 
redundant since we use tricky buffering already.  Removing it cuts out 
about 200 lines of code (some of which is comments) and simplifies the 
logic substantially in some places.

Is there any reason we would want to keep partial tile drawing?

jason

PNG image


[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#8999) RFC: removing partial tile drawing, Jason Short <=