Flags for optimisation, errors and C99 mode.
Dumped some TGA-writing code from another project.