[Kde-games-devel] Tileset format for KMahjongg

Mauricio Piacentini mauricio at tabuleiro.com
Fri Nov 17 22:02:47 CET 2006


Henrique Pinto wrote:
> A desktop file for a theme could look like:
> 
snip
> 
> The translated "Name" entries would be added automatically by scripty, so 
> you won't have to worry about them.
> 
> QString themeName = themeFile.readEntry("Name"); // Returns translated data
> int themeTileWidth = themeFile.readNumEntry("TileWidth");

Your suggestion seems perfect for the localization needs! I would 
probably add a version field to it, just for future compatibility. What 
I am trying to prevent is for example if 3 years down the road (KDE5?) 
we decide to change the specifications for the linked graphics, like we 
are doing now. Current code (KDE4) would not be able to deal with it 
properly. This happens today with the .tileset data for KMahjongg, as 
the KDE3 version crashes if it runs into KDE4 .tileset data. Thankfully 
we will be moving the new tilesets to a shared location, so this will 
eliminate the problem.

> I was thinking of coding a theme selection dialog for KSame this weekend. 
> Perhaps I should try to make it generic and add it to libkdegames?
> 
> I thought of a simple list, contaning, for each theme, the theme name, 
> author, and a preview image. I intended to generate the preview image from 
> the SVG, asynchronously, but, if the dialog is to be made generic, I 
> believe it might be easier to have a pre-rendered PNG as the preview.
> 
> What do you think?

Well, that is something to consider. Ideally I agree that each 
application could generate the preview, as it "knows" how to deal with 
the theme data. This is what KMahjongg is already doing.
But I believe the idea of generating a pre-rendered PNG is a nice way to 
cut down on the amount of code in the app, and at the same time provide 
a standard way for users to render the previews of themes. KNewStuff if 
I am not mistaken uses the PNG approach already.

One idea I would consider was to make it possible to use a 
pre-constructed .svg for preview as well, for the cases where it makes 
sense to do so (svg size < png size). Using the theme .svg directly is 
probably not a good idea, since this is almost always organized in a 
certain way that is not optimal for preview.

And another would be to maybe specify the version you accept (perhaps 
this is already comtemplated by using a version number in the group name?)

I will be away this weekend, it is an extended holiday here in Brazil 
for those that do not know it, but I will be happy to help you with this 
next week, maybe with testing, and adapting KMahjongg to use it as well, 
so we can test the implementation on more than one game.

Thinking about that, are you going to code during the holiday, Henrique? 
Or is Monday a normal work day at Belo Horizonte?

Regards,
Mauricio Piacentini


More information about the kde-games-devel mailing list