Aaaand, 0.8.3

Well that was fast.

Dovoto discovered some quirks in the way names were used under shared data runs and had a nice suggestion to allow images to be added via grit files as well. There was also some other small niggly bits that needed straightening out. So yeah, grit v0.8.3.

grit 0.8.2 / usenti 1.7.10

Apparently, the GRF format didn't quite follow the official RIFF specs, so I had to fix it (thanks for pointing it out, Daniel). While I was at it, I also changed the names of the meta-tile arrays if a meta-map was asked for. In stead of the -Map affix, it now uses the more logical -MetaTiles. Yes, this probably will break something, but in the long run it's better this way and it's a compiler error, so it's easy to fix.

Usenti's been updated to match.

[br]

Grit 0.8.1

Grit 0.8.1 is out now. I've made three somewhat small changes here. First, there was some trouble with shared palettes/tiles if there was no -O or -S option. “Trouble”, as in segmentation fault. This should now be fixed.

I've also reformatted the include guards from __FOO__ to GRIT_FOO_H. GCC uses that format for internal #defines and it is very territorial about such matters. So, say, when you have elf.png, GCC gets cranky because that would hide its own __ELF__, and guess who wins out there? Again, thanks for pointing these things out, Quirky.

The last item is the addition of column-major tiling. This can be useful for horizontal scrolling games, since the data or the columns are all adjacent instead of a whole scanline apart. A second benefit of this mode is that rendering to tiles is made considerably easier (and a little bit faster too).

In case you hadn't noticed yet, I've also put the manual on-line. This shows the basic options for grit and wingrit, and now there's a description of how to use it in makefiles as well. This includes how the building the grit-demo project works. This one's quite interesting, so please check it out.


Project link.

grit 0.8

It's time for another Grit release. There are three important changes compared to previous versions.

First, palette merging is in (and there was much rejoicing). If you use the -pS option, a shared palette will be created and used in the graphics. Note that I still think palette merging should be performed on the images themselves and not in the output phase. If anyone's interested, I do have a small app that can do just this.

Another big change is that handling of shared data is now done correctly. The previous version required two runs for this: one for the non-shared stuff, and then another for the tileset itself. You also had to take care to disable the shared item for the individual runs, otherwise the (useless) intermediates would be exported as well. Grit 0.8 fixes all this. You can provide multiple images and request a shared tileset and/or palette (with -pS, -gS, or -fx) and it should work right. Grit will export the individual parts first and save exporting the shared data for the end. For example, if you have 5 files to be converted to maps with a shared tileset, you'll get 5 maps, and one tileset and palette (instead of 5 of each like 0.7 did). You can tune the shared output names with -S and -O (uppercase s and o) if necessary.

Thirdly, there is a new binary file-type available. I'm calling it GRF, for Grit RIFF File. This places the graphics, maps and palette in RIFF chunks. The idea behind this was to have related data in a single file instead of three different binaries. The chunked data-format also allows easier extension and it's easy to make a generic loader for it too. For details (including such a loader), see the the manual. The -ftr option creates a GRF file, and you can also create GRF-formatted C/asm arrays using -fr.

I've also added something I like to call ‘fake’ compression, -Z0 (Z zero). This adds a header word to the data similar to the ones that the compressed data have. This consistency of data-formats is essential for the generic data-loader.


As I mentioned before, there is also a proper demo project to show how you can use grit and its various options. Take note of how it uses a separate makefile to prepare the graphics. This way you can keep the main makefile pretty clean and it makes it easier to insert customized conversion rules. Note: to build the demo project, make sure GRIT points to the updated binary.


Linkies

A grit demo, part I


Grit demo menu.

I think I finally have a nice demonstration of the capabilities and use of grit again. The figure on the right shows its main menu. Each entry shows one or more capabilities of grit and how to make use of the data it outputs. Pressing start returns to the menu.

The source for the project is included in the demo, as is the most recent tonclib because the demo would not have been possible without it (at least not with a lot more code in the project itself). In a sense, it's a tonclib demo as well.

The way that grit is invoked and how its output is made available is pretty neat. I'm running a separate makefile called gfxmake which runs grit, assembles its output into a library called libgfx.a. It also collects all the separate headers into a main header file called all_gfx.h, so there will be no need to include dozens of graphics headers – just the one. I also have three sets of grit rules in here: for bitmap+.grit pairs, for .grit-less bitmaps (which use the directories main grit file) and fully custom rules for really special occasions. Like I said, pretty neat ^_^. I am pulling a few Clever Tricks in gfxmake to get all of this done and I hope to discuss these in more detail at a later time.

I'll probably add a few more examples in this demo (feel free to suggest some), but the way grit's invoked here will probably stay. Using a secondary makefile means a minimum of interference with the template makefiles and it also makes it easy to customize your projects w.r.t. graphics. As far as I'm concerned, this is the recommended path … until anyone informs me of a better plan.


Download link: /files/gritdemo.zip


Note to quirky: sorry, no palette merging in this demo yet. It will be in its follow-up.