There are three files to this project, and since they are rather large, I’ve opted to make them separate files. This time we’ve created a little utility to convert TGA files to BMP’s, and vice versa. You can scale the images to a set size if you want. The program features file logging, so you can see how ASCII text files work, and also features everything else we’ve been talking about recently ;-
Unions of data
And so on. It’s pretty basic, but you can see how you might parse incoming text out, how you load a file quickly, writing stuff out, etc etc etc. Included in the project directories are a couple of documents that cover the BMP and TGA file formats, which helped when I was constructing this. It’s not the most useful of utilities – almost all painting programs now have a converter built into them, however it does get across most of the points that we’ve been covering. If you can figure out what’s wrong and fix all the bugs in here by yourself, you’re ready to take on your own projects.