[Kde-games-devel] Group update backtrace

mauricio at tabuleiro.com mauricio at tabuleiro.com
Fri Sep 29 13:10:06 CEST 2006


Hi, Maurizio. Remember the issue that I was seeing, where marking one item
as changed will dirty the entire group? The backtrace is

#0  KGrGameCanvasGroup::changedInternal (this=0x816d1b0)
    at /home/kdedev/kdegames/kgoldrunner/src/kgrgamecanvas.cpp:534
#1  0x0809111e in KGrGameCanvasItem::changed (this=0x816d1b0)
    at kgrgamecanvas.h:149
#2  0x0808cd2d in KGrGameCanvasGroup::ensurePendingUpdate (this=0x816d1b0)
    at /home/kdedev/kdegames/kgoldrunner/src/kgrgamecanvas.cpp:518
#3  0x0808c586 in KGrGameCanvasItem::changedInternal (this=0x8164278)
    at /home/kdedev/kdegames/kgoldrunner/src/kgrgamecanvas.cpp:248
#4  0x0809111e in KGrGameCanvasItem::changed (this=0x8164278)
    at kgrgamecanvas.h:149
#5  0x0808cf82 in KGrGameCanvasPixmap::setPixmap (this=0x8164278,
p=@0x82fb1d8)
    at /home/kdedev/kdegames/kgoldrunner/src/kgrgamecanvas.cpp:660
#6  0x080632d3 in KGrPlayField::setTile (this=0x816d1b0, x=7, y=17,
tilenum=9)
    at /home/kdedev/kdegames/kgoldrunner/src/kgrplayfield.cpp:41
#7  0x0806cb13 in KGrCanvas::paintCell (this=0x8162980, x=7, y=17,
    type=77 'M', offset=1)
    at /home/kdedev/kdegames/kgoldrunner/src/kgrcanvas.cpp:217
#8  0x08084866 in KGrBrick::dig (this=0x82ff558)
    at /home/kdedev/kdegames/kgoldrunner/src/kgrobject.cpp:117
#9  0x08071a20 in KGrHero::digLeft (this=0x823f5e8)
    at /home/kdedev/kdegames/kgoldrunner/src/kgrfigure.cpp:693
#10 0x0807a852 in KGrGame::doDig (this=0x8249c90, button=1)
    at /home/kdedev/kdegames/kgoldrunner/src/kgrgame.cpp:766

So it was not an inheritance or compiler issue, and I was not crazy. This
calling path comes from the fact that m_canvas for my pixmap background
items is really a Group object that is added to the main Canvas (maybe I
should not have created them in that way?), so when one child item is
changed, it calls KGrGameCanvasGroup::ensurePendingUpdate, and this
dirties the whole group rect. It does not affect the runner and enemies,
as these are created as children of the main Canvas object directly, not
chidren of the background group.

I reverted SVN to the version that shows this issue so you can see it, if
you want to. Anyway, I will merge your recent KBoard SVN changes that get
rid of the changeInternal() later today, maybe this is already changed
there. Or maybe I am using groups in a way that they were not originally
designed to be used, which is ok as well. I can change the code so that
everything is a child of the main Canvas, and just lower all background
pixmap items (or better yet, bring the runner/enemies/rectangle borders to
front.)

Regards,
Mauricio Piacentini




More information about the kde-games-devel mailing list