[Kde-games-devel] Adventures with Palapeli

Stefan Majewsky majewsky at gmx.net
Wed Dec 9 09:54:26 CET 2009


Am Mittwoch, 9. Dezember 2009 00:17:15 schrieb Matthew Woehlke:
> This, at least (slowness dragging 800 pieces) isn't /horribly/
> surprising, though... that gives me a thought; I wonder if the problem
> is Z ordering? Due to how the shadows work, does pala have to repaint
> all 800 pieces to join the 801'st?
> 
> Ian, if you are wanting to play around, I would look if there is Z-order
> changing that happens when joining pieces, and if yes, try turning it
> off. Hmm... but fixing this might take some doing, I'm not sure it's
> trivial to just fiddle with the Z order without introducing other glitches.

I think I'll give a comment on how it's supposed to work. First some 
terminology: A single image is called "piece", while a group of pieces that is 
moved in a group is called "part". That means: A part is a QGraphicsItem that 
contains multiple pieces.

Palapeli makes extensive use of explicit Z-reordering, but only in two 
instances:
1. When you start to drag a part, it's raised above all other parts (see 
Part::mousePressEvent).
2. Inside the part, the shadow items have a lower Z value than the pieces. The 
shadow items are *not* direct childs of the piece items, because this would 
cause some shadows to overlap over pieces in the same part.

I honestly don't see much room for change in this model. The most promising 
optimisation from my POV would be to merge the pieces in one part into a 
single image.

Greetings
Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-games-devel/attachments/20091209/a79afb77/attachment.sig 


More information about the kde-games-devel mailing list