[Kde-games-devel] QGraphicsScene performance

Ian Wadham ianw2 at optusnet.com.au
Tue Jul 10 14:41:19 CEST 2007


> On 7/9/07, Fela Winkelmolen <nimatar at gmail.com> wrote:
> > This seemed to make most of the difference, unfortunately it becomes a
> > lot slower when there are also a lot of not moving objects (like the
> > bricks in kbreakout), which are repainted unnecessarily, maybe this could
> > be worked around making it part of the background and caching the
> > background or something... but I'm not sure.

On Tue, 10 Jul 2007 04:51 pm, Jeremy Wick wrote:
> So 10 minutes of profiling later i realized that calling the method to
> paint a sprite was expensive, so i did just that
> - render all the fixed sprites into a buffer (such as the floor and
> walls/blocks)
> - animated sprites were rendered on top of this in a second buffer
>
This is however exactly where KGoldrunner first ran into trouble
with QGV.  The predecessor of QGV, in Qt3, was QCanvas and it
handled both sprites and background tiles efficiently, even if a bg
tile changed occasionally (such as from gold to empty space).

QGV hit the wall on KGr, Initiation level 2, where 3 sprites are
moving and there is a lot of gold to pick up, thus changing the
background tiles, but not as often as the sprites move.

I suspect that something similar might happen in KBreakout when
you get several balls destroying bricks and you have to repaint
those bricks - if you use QGV, that is, and if I understand the
game correctly.

Cheers, Ian W.


More information about the kde-games-devel mailing list