I'm finishing writing the last section of the tutorial: testing the tiles and maps. I did notice before that gconvert makes int arrays, instead of char arrays like the java tool, and I thought "Oh, different
". But when I actually tried using DrawMap2 to print the maps on the screen, the compiler would complain about the type of the array. I changed all the arrays to chars and it's now working.
Also, I haven't tried converting pngs, but I was following uze's wiki example to convert raws and gconvert would complain about not declaring the width and the height of the image on the xml. I would update the wiki, but I don't really know if it's only needed for raws, as uze's example with pngs does not declare the width and height.
I was way to tired yesterday night when I finished this stuff. I wanted to publish the XML schema into which you would have seen all the possible elements and options that where not part of my examples. So in the mean time, here's a few more details:
-Mode 1 & Megatris uses 16 bits map indexes, hence the map are ints (pointers-size="16"). For all other modes, like mode 3, map indexes are chars, so use pointers-size="8" in your <map> element, i.e:
Code: Select all
<maps pointers-size="8">
...
</maps>
This will also result in having the tool throw an error if, while scanning for unique tiles, the count goes beyond 256.
-PNGs have the image size embedded in its header so it's redundant to specify the size/height in the transformation file. RAW does not, hence the need to specify these attributes. Here's the required element for the two image types:
RAW
Code: Select all
<input file="c:/uze/tetris-tiles.raw" type="raw" width="240" height="368" tile-width="6" tile-height="8" />
PNG (notice no width/height attributes)
Code: Select all
<input file="..\data\graphics.png" type="png" tile-width="6" tile-height="8" />
Hope that helps
-Uze