KDE Games/Porting: Difference between revisions

From KDE Community Wiki
(→‎Porting status: - cleanup, new "Theme selection" column)
Line 16: Line 16:


{| border="1" cellpadding="1" sortable="true"
{| border="1" cellpadding="1" sortable="true"
|-
|- style="white-space:nowrap"
! Application
! Application
! Graphics stack
! Graphics stack
! Rendering method
! Rendering method
! Theme selection
! Sounds
|-
|-
| bomber
| bomber
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| bovo
| bovo
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="text-align:center" | N/A
|-
|-
| granatier
| granatier
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#FFFFA0" | KgTheme+custom
|-
|-
| kajongg
| kajongg
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | libkmahjongg
| style="background-color:#ABFFAB" | libkmahjongg
| style="text-align:center" | N/A
|-
|-
| kapman
| kapman
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFABAB" | KGameTheme
|-
|-
| katomic
| katomic
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| kbattleship
| colspan="4" | kbattleship ''(see knavalbattle)''
| colspan="2" | see knavalbattle
|-
|-
| kblackbox
| kblackbox
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="text-align:center" | N/A
|-
|-
| kblocks
| kblocks
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFABAB" | KGameTheme
|-
|-
| kbounce
| kbounce
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
| style="text-align:center" | N/A
|-
|-
| kbreakout
| kbreakout
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| kdiamond
| kdiamond
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| kfourinline
| kfourinline
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | PixmapCache (client pattern)
| style="background-color:#FFFFA0" | PixmapCache (client pattern)
| style="text-align:center" | N/A
|-
|-
| kgoldrunner
| kgoldrunner
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
| style="text-align:center" | N/A
|-
|-
| kigo
| kigo
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFABAB" | KGameTheme
|-
|-
| killbots
| killbots
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| kiriki
| kiriki
| colspan="2" style="background-color:#FFFFA0" | QWidget with pre-rendered PNG
| colspan="2" style="background-color:#FFFFA0" | QWidget with pre-rendered PNG
| style="text-align:center" | N/A
|-
|-
| kjumpingcube
| kjumpingcube
| style="background-color:#FFABAB" | QWidget
| style="background-color:#FFABAB" | QWidget
| style="background-color:#FFABAB" | QSvgRenderer
| style="background-color:#FFABAB" | QSvgRenderer
| style="text-align:center" | N/A
|-
|-
| klickety
| klickety
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| klines
| klines
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
| style="text-align:center" | N/A
|-
|-
| kmahjongg
| kmahjongg
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#ABFFAB" | libkmahjongg
| style="background-color:#ABFFAB" | libkmahjongg
| style="text-align:center" | N/A
|-
|-
| kmines
| kmines
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| knavalbattle
| knavalbattle
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | PixmapCache
| style="background-color:#FFFFA0" | PixmapCache
| style="text-align:center" | N/A
|-
|-
| knetwalk
| knetwalk
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| kolf
| kolf
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| kollision
| kollision
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| konquest
| konquest
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
| style="text-align:center" | N/A
|-
|-
| kpat
| kpat
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#FFFFA0" | KgTheme+KCardTheme
|-
|-
| kreversi
| kreversi
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KgTheme
|-
|-
| kshisen
| kshisen
| style="background-color:#FFABAB" | QWidget
| style="background-color:#FFABAB" | QWidget
| style="background-color:#ABFFAB" | libkmahjongg
| style="background-color:#ABFFAB" | libkmahjongg
| style="text-align:center" | N/A
|-
|-
| ksirk
| ksirk
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem and KPixmapCache
| style="background-color:#FFFFA0" | QGraphicsSvgItem+KPixmapCache
| style="text-align:center" | N/A
|-
|-
| kspaceduel
| kspaceduel
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="text-align:center" | N/A
|-
|-
| ksquares
| ksquares
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| N/A
| style="text-align:center" | N/A
| style="text-align:center" | N/A
|-
|-
| ksudoku
| ksudoku
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFABAB" | KGameTheme
|-
|-
| ktron
| ktron
| style="background-color:#FFABAB" | QWidget
| style="background-color:#FFABAB" | QWidget
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFABAB" | KGameTheme
|-
|-
| ktuberling
| ktuberling
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="text-align:center" | N/A
|-
|-
| kubrick
| kubrick
| style="background-color:#ABFFAB" | QGLWidget
| style="background-color:#ABFFAB" | QGLWidget
| N/A
| style="text-align:center" | N/A
| style="text-align:center" | N/A
|-
|-
| libkmahjongg
| libkmahjongg
| N/A
| style="text-align:center" | N/A
| style="background-color:#FFFFA0" | QPixmapCache
| style="background-color:#FFFFA0" | QPixmapCache
| style="text-align:center" | N/A
|-
|-
| lskat
| lskat
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | PixmapCache (client pattern)
| style="background-color:#FFFFA0" | PixmapCache (client pattern)
| style="text-align:center" | N/A
|-
|-
| palapeli
| palapeli
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| N/A
| style="text-align:center" | N/A
| style="text-align:center" | N/A
|}
|}

Revision as of 22:25, 14 April 2012

Targets of porting

  • Graphics stack: QGraphicsView is currently the recommended solution. Some games still use KGameCanvas; these should be ported to QGraphicsView. In the future, we likely want to move to Qt Quick instead, but this needs proper investigation and changes in libkdegames.
  • Rendering method: Current solutions commonly include usage of a QSvgRenderer, combined either with QGraphicsSvgItems or with (Q/K)PixmapCache. It is suggested to migrate to KGameRenderer instead. Integration with QGraphicsView is available through the KGameRenderedItem and KGameRenderedObjectItem classes. Integration with KGameCanvas is available through the KGameCanvasRenderedPixmap.
  • Theme selection: When one game supports multiple themes, the KGameTheme class has commonly been used. Starting with the 4.9 release, the new KgTheme class supersedes KGameTheme.
  • Sounds: Some games used Phonon, some KNotify. Both libraries are bad because of their commonly high playback latencies. The new KgSound classes in libkdegames are specialized on low-latency playback of small sound samples.
  • (more to come)

Porting status

The second column shows which graphics stack (e. g. QGraphicsView, KGameCanvas) is used by the application. The third column shows the rendering method.

If you want to take part in porting, pick an app, contact the author or the kde-games-devel mailing list to coordinate your effort, read into the KGameRenderer APIDOX and start hacking! Please note that this porting effort is mainly about porting rendering code to KGameRenderer. Usage of outdated graphics stacks should not be changed because this might cause severe and non-trivial bugs.

Warning: It is advised not to use the primaryView property of KGameRenderedObjectItem class in new ports. The existing ports using it (KDiamond and Klickety/KSame) made it clear that the primaryView property has design flaws (concerning performance), so it will probably be removed again.

Application Graphics stack Rendering method Theme selection Sounds
bomber KGameCanvas KGameRenderer KgTheme
bovo QGraphicsView QGraphicsSvgItem N/A
granatier QGraphicsView KGameRenderer KgTheme+custom
kajongg QGraphicsView libkmahjongg N/A
kapman QGraphicsView QGraphicsSvgItem KGameTheme
katomic QGraphicsView KGameRenderer KgTheme
kbattleship (see knavalbattle)
kblackbox QGraphicsView QGraphicsSvgItem N/A
kblocks QGraphicsView QGraphicsSvgItem KGameTheme
kbounce KGameCanvas KPixmapCache N/A
kbreakout KGameCanvas KGameRenderer KgTheme
kdiamond QGraphicsView KGameRenderer KgTheme
kfourinline QGraphicsView PixmapCache (client pattern) N/A
kgoldrunner KGameCanvas KPixmapCache N/A
kigo QGraphicsView KPixmapCache KGameTheme
killbots QGraphicsView KGameRenderer KgTheme
kiriki QWidget with pre-rendered PNG N/A
kjumpingcube QWidget QSvgRenderer N/A
klickety QGraphicsView KGameRenderer KgTheme
klines QGraphicsView KPixmapCache N/A
kmahjongg KGameCanvas libkmahjongg N/A
kmines QGraphicsView KGameRenderer KgTheme
knavalbattle QGraphicsView PixmapCache N/A
knetwalk QGraphicsView KGameRenderer KgTheme
kolf QGraphicsView KGameRenderer KgTheme
kollision QGraphicsView KGameRenderer KgTheme
konquest QGraphicsView KPixmapCache N/A
kpat QGraphicsView KGameRenderer KgTheme+KCardTheme
kreversi QGraphicsView KGameRenderer KgTheme
kshisen QWidget libkmahjongg N/A
ksirk QGraphicsView QGraphicsSvgItem+KPixmapCache N/A
kspaceduel QGraphicsView QGraphicsSvgItem N/A
ksquares QGraphicsView N/A N/A
ksudoku QGraphicsView KPixmapCache KGameTheme
ktron QWidget KPixmapCache KGameTheme
ktuberling QGraphicsView QGraphicsSvgItem N/A
kubrick QGLWidget N/A N/A
libkmahjongg N/A QPixmapCache N/A
lskat QGraphicsView PixmapCache (client pattern) N/A
palapeli QGraphicsView N/A N/A