Sdlfreegraphics2

New attempt; hopefully this works better

Sorry for the wrong author in most of commits, but fixing them breaks the current branch.

----------------------------------------
Added a description of the patches:

SHA: e555ab9730872badeb5844cd55c7af2e836e928a
Instead of changing the image, change the palette.

SHA: 7fbd5ec77ada7a7cd417f9913673a0f1daf92722
Mega texture is seriously broken, the sheet does not contain sprites that make
sense (just garbled sprites all written on top of each other). The fix is just
a single statement, but the fact that the current code works means the sheet is
not used. This was also confirmed by adding a printf() in the if that sets the
x and Y of the sheet.
I think a different solution for caching textures should be found, this one is
not working and not used.

SHA: ea056d338c899688883467ed3597467c46d8911f
Add the 32bpp decoding function, without using the new code.

SHA: 4d3576e7e60815a04bde679b252ff7c4e8ad0c9a
Convert the 8bpp legacy sprites to 32bpp recoloured sprites using recolour
table 0xFF. For the spritesheet and bitmap loaders. In particular, cursors and
fonts are not changed. Also replace the legacy decoder with the decoder
introduced in the previous commit.

SHA: 97572bd9313baf381bba7dc63469c65d63b4135a
To enable adding new graphics, a 32bpp encoder is needed, which is a separate
program. It uses libpng, and needs flex and bison if the input format is
changed (see also next commit). The directory also has a description of the
file format of the new 32bpp files, and a "mk" script to build it. It still
needs cmake support.

SHA: 1e16f6513f3fad9a9e17f7aabb63822b5048b015
To enable building the 32bpp encoder without flex and bison, this commit
contains the generated files that you need for c++ compilation. (Most users
won't have these generator tools installed.)

SHA: 9a8588817a73dee097a49f3d6e45567a2c83d033
Input file for the about 80 ground sprites created by Zephyris. Those sprites
contained a few errors, which have been commented out for now. Also, the
sprites themselves are not included, since there is not yet agreement on the
license, afaik.

SHA: 504c1d36ae6e2d6414d663eb7cb1c8753f524c5e
Add c++ code to load the new files produced by the new encoder into CTH. As a
paranoia check, it verifies the files that it loads, to ensure they can be
rendered safely without exhaustive checking in the renderer.

SHA: 2db0ae53d10dee906da3346cd075fa162e7c21a9
Add *very* rudimentary Lua code to load the new files. This is just proof of
concept. It needs a nice directory scanner, and loading stuff it finds in
there. Lego was working on this, afaik.

And that's it for now.

What's still missing is recolouring of sprites. The sprite encoder supports it,
and the decoding function supports it too, so it's mostly just glue code that's
missing. However, at this time I don't know what is needed or what sprites even
use recolouring.