[Kde-games-devel] A timer class for games
Parker Coates
parker.coates at gmail.com
Wed Jun 17 04:40:53 CEST 2009
On Tue, Jun 16, 2009 at 6:57 PM, Mauricio Piacentini<piacentini at kde.org> wrote:
>> Sounds good :-)
>>
>> Have you tried comparing it to QTimeline as Alan says?
>>
>
> Last time I looked at it, each QTimeline implicates in an underlying
> QTimer object. I am not saying it is bad, KBlocks for example uses it
> extensively. But for KGoldRunner I think the benefit of having a
> single game-specific timer is a good thing, as the game mechanics are
> really heavily dependant on exact timing. At one time there were some
> comments about this on the dot, and it was vented that in the future
> it might be possible to make all QTimelines share a single QTimer.
> This is important as it decreases the update requests. I think what
> Ian has done looks a lot like this optimization, but specific to a
> game timer.
I remember that discussion about sharing a single timer tick between
multiple QTimeLines. It's a shame to see that nothing came of it.
(Note that QTimeLine doesn't have an internal QTimer, it uses QObjects
timer functions directly.)
Currently in KPat, each card has its own QGraphicsItemAnimation, which
in turn uses its own QTimeline. I suspect performance during complex
animations could be much improved if the QTimeLines were firing all at
once.
Parker
More information about the kde-games-devel
mailing list