[Kde-games-devel] Tiles in KShisen

Wolfgang Rohdewald wolfgang at rohdewald.de
Mon Jan 19 18:53:03 CET 2009


On Montag, 19. Januar 2009, Mauricio Piacentini wrote:
> So 
> maybe we need to add a property to the tileset .desktop that controls 
> this, and maybe prevent loading in a given client depending on matching 
> rules. We could then increase the tileset format version and patch 
> KMahjongg/KShisen to recognize this.

in kmj I simply filter out the alphabet tileset. 

Actually none of the tilesets is perfect for kmj - the round wind tiles
are missing and some of the shadows / borders are looking strange. kmj
also needs to rotate tiles by 90/180/270 degrees which makes shadows/borders
look even stranger. I need to use tiles with different angles and combine them
(rotate some of them), but then adjacent borders/shadows can look very
different from each other where they should be identical. I wonder where
the light source is meant to be - there should be no such effects if the angle
is always a multiple of 45 degrees.

Also, in kmj I need to be able to draw reversed tiles (face down). I simulate
that by drawing tiles without faces.

So all in all kmj probably has very different code for drawing tiles compared
to libkmahjongg - I did not read thru all the C++ code.

    def tilesAvailable():
        """returns all available tile sets"""
        Tileset.defineCatalog()
        tilesAvailableQ = kdecore.KGlobal.dirs().findAllResources(
            "kmahjonggtileset", "*.desktop", kdecore.KStandardDirs.Recursive)
        # now we have a list of full paths. Use the base name minus .desktop:
        tilesets = [str(x).rsplit('/')[-1].split('.')[0] for x in tilesAvailableQ ]
        tilesets.remove('alphabet')
        return [Tileset(x) for x in tilesets]

-- 
Wolfgang


More information about the kde-games-devel mailing list