[Kde-games-devel] Canvas updates

mauricio at tabuleiro.com mauricio at tabuleiro.com
Tue Sep 26 22:11:33 CEST 2006


> Maurizio, if you have time, could you use the technique above and check if
> Pixmap->setPixmap() is not triggering a full redraw of the canvas, and not
> only the lastrect and the new one, just to be sure? I will investigate it
> myself as well later when I am more rested.

OK! Found it, finally! The problem is that if your tile is in a group,
then changed() will invoke Group::changedInternal() (In KGoldrunner this
is KGrGameCanvasGroup). Look at the implementation and this will mark as
members of the groups as changed, which in the case of KGoldRunner means
that marking one tile as changed will dirty the whole field.

A quick fix is in in KGrGameCanvas.h, if you want to use it in KBoard to
test just change the inline implementation of changed to something like

void changed() { KGrGameCanvasItem::changedInternal(); }

Or maybe we should instead change in all item classes

if(visible() && canvas() )
    changed();

to

if(visible() && canvas() )
    KGrGameCanvasItem::changed();

Let me know what you think is the best solution, Maurizio. I am a bit
tired right now, need to take a nap!

Regards,
Mauricio Piacentini

BTW, I was seeing the same in QGV, so maybe it uses a similar design, and
has the same issue? Will investigate it.







More information about the kde-games-devel mailing list