[Kde-games-devel] Review Request: Port KNetWalk to use QGraphicsView and KGameRenderer

Stefan Majewsky majewsky at gmx.net
Fri Sep 17 20:29:18 CEST 2010



> On 2010-09-17 16:19:26, Stefan Majewsky wrote:
> > I will commit this. Re the default theme problems:
> > 
> > "Following KMines, the patch simply passes in Settings::theme() when constructing the KGameRenderer, however kblocks.kcfg has no default value for the theme, so no theme is loaded. I believe that the proper fix for this is to add a default value to the config file, correct? Alternatively, should KGameRendererPrivate::setTheme() call KGameTheme::loadDefault() when it receives 0-length theme string instead of just bailing?"
> > 
> > KGameRenderer explicitly wants the *default* theme when it is constructed, to be able to fallback to the default in broken themes. If one uses a Settings class (i.e. a KConfigSkeleton), as most to all KDE games do, the proper solution thus is to obtain the default value from this Settings class. KPat demoes how to do this, and I'll now adapt this to all other games.

Done committing. Please close review.


- Stefan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5238/#review7666
-----------------------------------------------------------


On 2010-09-11 14:45:36, Brian Croom wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5238/
> -----------------------------------------------------------
> 
> (Updated 2010-09-11 14:45:36)
> 
> 
> Review request for KDE Games and Stefan Majewsky.
> 
> 
> Summary
> -------
> 
> As KNetWalk's use of QWidget as its graphics stack was marked in red on the porting status wiki page, and because I wanted to see if I had acquired a good enough working understanding of the QGraphicsView framework to be able to accomplish it, I decided to attempt a full port of this game. I referred to the KMines source while restructuring the code, as it has various conceptually similar elements (a grid with square cells that are activated by the user during gameplay, etc.)
> 
> Doing this required some rather invasive changes to the GUI code. In addition to switching to QGraphicsView, this patch also:
> - Removes the distinction between mouse and keyboard input modes. They now work together nicely, as they should.
> - Adds the ability to pause the game, and hide the puzzle while it is paused.
> - Cleans up code in various places and removes a number of obsolete class members that I presume to have been vestiges from before the KDE port.
> 
> My only disappointment is that switching to QGraphicsView did not get rid of the rendering artifacts that often appear when the cables are being rotated. Particularly on the cells with T-shaped cable junctions, white pixels often appear at the edge of the pixmap during the rotation animation. I would greatly appreciate any suggestions for how to avoid that happening.
> 
> 
> Diffs
> -----
> 
>   /trunk/KDE/kdegames/knetwalk/src/CMakeLists.txt 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/abstractgrid.h 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/abstractgrid.cpp 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/cell.h 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/cell.cpp 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/fielditem.h PRE-CREATION 
>   /trunk/KDE/kdegames/knetwalk/src/fielditem.cpp PRE-CREATION 
>   /trunk/KDE/kdegames/knetwalk/src/globals.h 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/knetwalk.kcfg 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/knetwalkui.rc 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/main.cpp 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/mainwindow.h 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/mainwindow.cpp 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/renderer.h 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/renderer.cpp 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/scene.h PRE-CREATION 
>   /trunk/KDE/kdegames/knetwalk/src/scene.cpp PRE-CREATION 
>   /trunk/KDE/kdegames/knetwalk/src/view.h 1173706 
>   /trunk/KDE/kdegames/knetwalk/src/view.cpp PRE-CREATION 
> 
> Diff: http://svn.reviewboard.kde.org/r/5238/diff
> 
> 
> Testing
> -------
> 
> I have come to enjoy playing this game quite a lot, and have given it considerable testing. All the usual things seem to work well including resizing, theme changes, changing difficulty level, and pausing/resuming.
> 
> 
> Thanks,
> 
> Brian
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-games-devel/attachments/20100917/b681611e/attachment-0001.htm 


More information about the kde-games-devel mailing list