[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-games-devel
Subject:    [Kde-games-devel] best way to get a sprite from current theme?
From:       Viranch Mehta <viranch.mehta () gmail ! com>
Date:       2012-06-19 17:40:41
Message-ID: CADk4OpbT=P5wGFyMMiaeNz1+Uk8drrZCtEfVfAP6NStvMUUVLw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi all,

I've almost completed the QtQuick port of KBreakout (open for alpha
testing, source
can be found here:
http://quickgit.kde.org/index.php?p=scratch%2Fviranch%2Fkbreakout-qml.git), so I
am right now concentrating on retrieving the sprites from theme svgs in
best possible
and fastest manner.

Till now, what I have done is implement a QML element CanvasItem that has
"spriteKey"
property, which is used to retrieve the sprite pixmap using
KGameRenderer::spritePixmap()
method in CanvasItem's paint() method. This is synchronous and slow however.

An alternate I found after digging up the libraries was
KGameRendererClient. I made
CanvasItem its subclass, and reimplemented receivePixmap() to set and paint
the pixmap
received from KGameRendererClient instance. Since this is (as I read in the
docs)
asynchronous, it should be faster than my previous implementation, though
not noticable
on my computer.

I also looked into KGameRenderedPixmap but I think it is intended for use
by QGV.

So I wanted to know if there are any other options like these to even make
the sprite retrieval
faster from the theme svgs.

Thanks,
Viranch

[Attachment #5 (text/html)]

Hi all,<div><br></div><div>I&#39;ve almost completed the QtQuick port of KBreakout \
(open for alpha testing, source</div><div>can be found here:</div><div><a \
href="http://quickgit.kde.org/index.php?p=scratch%2Fviranch%2Fkbreakout-qml.git">http://quickgit.kde.org/index.php?p=scratch%2Fviranch%2Fkbreakout-qml.git</a> \
), so I</div> <div>am right now concentrating on retrieving the sprites from theme \
svgs in best possible</div><div>and fastest manner.</div><div><br></div><div>Till \
now, what I have done is implement a QML element CanvasItem that has \
&quot;spriteKey&quot;</div> <div>property, which is used to retrieve the sprite \
pixmap using KGameRenderer::spritePixmap()</div><div>method in CanvasItem&#39;s \
paint() method. This is synchronous and slow however.</div><div><br></div><div>An \
alternate I found after digging up the libraries was KGameRendererClient. I \
made</div> <div>CanvasItem its subclass, and reimplemented receivePixmap() to set and \
paint the pixmap</div><div>received from KGameRendererClient instance. Since this is \
(as I read in the docs)</div><div>asynchronous, it should be faster than my previous \
implementation, though not noticable</div> <div>on my \
computer.</div><div><br></div><div>I also looked into KGameRenderedPixmap but I think \
it is intended for use by QGV.</div><div><br></div><div>So I wanted to know if there \
are any other options like these to even make the sprite retrieval</div> <div>faster \
from the theme svgs.</div><div><br></div><div>Thanks,</div><div>Viranch</div>



_______________________________________________
kde-games-devel mailing list
kde-games-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-games-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic