[Kde-games-devel] KGameSvgDocument

Mark A. Taff marktaff at comcast.net
Wed Mar 28 08:22:44 CEST 2007


On Monday 26 March 2007 12:04:58 Mark A. Taff wrote:
> I would very much appreciate any critiques on the class, from my coding
> style, to the api, to help with the d-pointer issue, to anything else
> obvious to an experienced c++ coder, yet oblivious to me. ;-)

Thanks to everyone's help, KGameSvgDocument is about ready to be 
committed. :-)

I've sent away for a kdemail.net email address to use for my copyright.  When 
that arrives, I'll ask for an svn account so I can commit this.

I propose to commit it to kdegames/libkdegames.  I will be using the class in 
my replacement for kgameklcd.  Nicolas Roffet *could* potentially use it in 
KBlackBox to get laser ray colors, to replace his own more specific solution, 
though obviously he hasn't commented on or commited to that yet.

It could also be used in many other games, to change the colors of certain 
elements based on user choices, for example in the color of the numbers in 
KMines, or the color of player pieces in KWin4.

It could also take a single element, render it, then rotate it 36 degrees, and 
re-render it.  Doing that 10 times and cacheing the resulting pixmaps is a 
reasonable way to create some animated effects, like a spinning boomerang or 
something.

It can also be used to make elements selectively render.  Think of a map of 
the US or Europe, with major cities marked as dots, but with the city names 
hidden.  The names could then be revealed by modifiing the DOM and then 
re-rendering the svg map.  Granted, that would be KDE EDU, but you get the 
idea.

The files are at:
http://marktaff.com/tmp/kgamelcd/kapp4/kgamesvgdocument.cpp  and
http://marktaff.com/tmp/kgamelcd/kapp4/kgamesvgdocument.h

API Docs are at:
http://marktaff.com/tmp/kgamelcd/kapp4/html/classKGameSvgDocument.html

There are no issues/bugs in the code known to me at this time.

Regards,

Mark A. Taff


More information about the kde-games-devel mailing list