But, it requires a separate program
And what do you think dat2c was .
only works with bitmaps and simple data/text
It works for any file type. The only issue is that you have to use it through the Allegro file routines. This means it can be any file Allegro can read, but also any file other libraries can read as long as you can override their file interface.
(because you have to #include it to reference it).
Ever heard of header files? It'll work for this method too, I just didn't include a header generation code in my code. It'll just contain the ALLEGRO_FILE* load_foo(); function.
read them through Allegro's normal functions without anything more complicated than setting an RC definition.
So it'll have the same limitations as my method .
EDIT: Also, are these resource scripts even available under Linux? The method I presented is 100% cross-platform as far as I can tell.
I also looked around a bit, and turns out there is a Linux program does more or less what my little code snipped did:
xdd -i some_file out.c
It'll produce the same static array (and a length variable) as my code, but without the nice loading function.
Lastly, it turns out you can directly encode a file into an object file bypassing the compilation step. This time the exact procedure is compiler specific, so if you're not using GCC it might be a bit too much: linky.