KDE Games/Porting: Difference between revisions

From KDE Community Wiki
Line 15: Line 15:
'''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.
'''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.


{| border="1" cellpadding="1"
{| border="1" cellpadding="1" sortable="true"
|-
|-
! Application
! Application
! Graphics stack
! Graphics stack
! Rendering method
! Rendering method
! Who does/did the port? (if applicable)
|-
|-
| bomber
| bomber
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Stefan Majewsky
|-
|-
| bovo
| bovo
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
|
|-
|-
| granatier
| granatier
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Mathias Kraus
|-
|-
| kajongg
| kajongg
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | libkmahjongg
| style="background-color:#ABFFAB" | libkmahjongg
|
|-
|-
| kapman
| kapman
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
|
|-
|-
| katomic
| katomic
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Brian Croom
|-
| kbattleship
| 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
|
|-
|-
| kblocks
| kblocks
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| Brian Croom
|-
|-
| kbounce
| kbounce
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
|
|-
|-
| kbreakout
| kbreakout
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Brian Croom
|-
|-
| kdiamond
| kdiamond
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Stefan Majewsky
|-
|-
| kfourinline
| kfourinline
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | PixmapCache (and classes similar to KGameRendererClient)
| style="background-color:#FFFFA0" | PixmapCache (client pattern)
|
|-
|-
| kgoldrunner
| kgoldrunner
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
|
|-
|-
| kigo
| kigo
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
|
|-
|-
| killbots
| killbots
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Parker Coates
|-
|-
| kiriki
| kiriki
| colspan="2" style="background-color:#FFFFA0" | QWidget with pre-rendered PNG
| colspan="2" style="background-color:#FFFFA0" | QWidget with pre-rendered PNG
| N/A
|-
|-
| kjumpingcube
| kjumpingcube
| style="background-color:#FFABAB" | QWidget
| style="background-color:#FFABAB" | QWidget
| style="background-color:#FFABAB" | simple QSvgRenderer::render()
| style="background-color:#FFABAB" | QSvgRenderer
|
|-
|-
| klickety
| klickety
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| ''(native QGV/KGR app)''
|-
|-
| klines
| klines
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
| Lindsay Mathieson (Blackpaw)
|-
|-
| kmahjongg
| kmahjongg
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#FFFFA0" | KGameCanvas
| style="background-color:#ABFFAB" | libkmahjongg
| style="background-color:#ABFFAB" | libkmahjongg
| Christian Krippendorf
|-
|-
| kmines
| kmines
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Brian Croom
|-
|-
| knavalbattle
| knavalbattle
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | PixmapCache
| style="background-color:#FFFFA0" | PixmapCache
|
|-
|-
| knetwalk
| knetwalk
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Brian Croom
|-
|-
| kolf
| kolf
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Stefan Majewsky
|-
|-
| kollision
| kollision
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Brian Croom
|-
|-
| konquest
| konquest
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
|
|-
|-
| kpat
| kpat
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Parker Coates
|-
|-
| kreversi
| kreversi
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | KGameRenderer
| style="background-color:#ABFFAB" | KGameRenderer
| Brian Croom
|-
|-
| kshisen
| kshisen
| style="background-color:#FFABAB" | QWidget
| style="background-color:#FFABAB" | QWidget
| style="background-color:#ABFFAB" | libkmahjongg
| style="background-color:#ABFFAB" | libkmahjongg
|
|-
|-
| ksirk
| ksirk
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem and KPixmapCache
| style="background-color:#FFFFA0" | QGraphicsSvgItem and KPixmapCache
|
|-
| ksnakeduel
| style="background-color:#FFABAB" | QWidget
| style="background-color:#FFFFA0" | KPixmapCache
|
|-
|-
| kspaceduel
| kspaceduel
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
|
|-
|-
| ksquares
| ksquares
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| N/A
| N/A
| N/A
|-
|-
Line 189: Line 154:
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | KPixmapCache
| style="background-color:#FFFFA0" | KPixmapCache
|
|-
| ktron
| style="background-color:#FFABAB" | QWidget
| style="background-color:#FFFFA0" | KPixmapCache
|-
|-
| ktuberling
| ktuberling
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | QGraphicsSvgItem
| style="background-color:#FFFFA0" | QGraphicsSvgItem
|
|-
|-
| kubrick
| kubrick
| style="background-color:#ABFFAB" | QGLWidget
| style="background-color:#ABFFAB" | QGLWidget
| N/A
| N/A
| N/A
|-
|-
Line 204: Line 170:
| N/A
| N/A
| style="background-color:#FFFFA0" | QPixmapCache
| style="background-color:#FFFFA0" | QPixmapCache
| (can now also be ported, with the new capabilities of KgTheme)
|-
|-
| lskat
| lskat
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#FFFFA0" | PixmapCache (and classes similar to KGameRendererClient)
| style="background-color:#FFFFA0" | PixmapCache (client pattern)
|
|-
|-
| palapeli
| palapeli
| style="background-color:#ABFFAB" | QGraphicsView
| style="background-color:#ABFFAB" | QGraphicsView
| N/A
| N/A
| N/A
|}
|}

Revision as of 21:58, 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
bomber KGameCanvas KGameRenderer
bovo QGraphicsView QGraphicsSvgItem
granatier QGraphicsView KGameRenderer
kajongg QGraphicsView libkmahjongg
kapman QGraphicsView QGraphicsSvgItem
katomic QGraphicsView KGameRenderer
kbattleship see knavalbattle
kblackbox QGraphicsView QGraphicsSvgItem
kblocks QGraphicsView QGraphicsSvgItem
kbounce KGameCanvas KPixmapCache
kbreakout KGameCanvas KGameRenderer
kdiamond QGraphicsView KGameRenderer
kfourinline QGraphicsView PixmapCache (client pattern)
kgoldrunner KGameCanvas KPixmapCache
kigo QGraphicsView KPixmapCache
killbots QGraphicsView KGameRenderer
kiriki QWidget with pre-rendered PNG
kjumpingcube QWidget QSvgRenderer
klickety QGraphicsView KGameRenderer
klines QGraphicsView KPixmapCache
kmahjongg KGameCanvas libkmahjongg
kmines QGraphicsView KGameRenderer
knavalbattle QGraphicsView PixmapCache
knetwalk QGraphicsView KGameRenderer
kolf QGraphicsView KGameRenderer
kollision QGraphicsView KGameRenderer
konquest QGraphicsView KPixmapCache
kpat QGraphicsView KGameRenderer
kreversi QGraphicsView KGameRenderer
kshisen QWidget libkmahjongg
ksirk QGraphicsView QGraphicsSvgItem and KPixmapCache
kspaceduel QGraphicsView QGraphicsSvgItem
ksquares QGraphicsView N/A
ksudoku QGraphicsView KPixmapCache
ktron QWidget KPixmapCache
ktuberling QGraphicsView QGraphicsSvgItem
kubrick QGLWidget N/A
libkmahjongg N/A QPixmapCache
lskat QGraphicsView PixmapCache (client pattern)
palapeli QGraphicsView N/A