I was asked recently to do a relatively simple task: read a TGA file, reduce the size and write it back out. I felt that was too simple so I decided to go a little overboard and also to release my code to the world. A nice bonus is that I have the start of a new tool.

The task was set to only take a few hours.  It ended up taking 24 hours and I decided to keep track of the process and document it.

A long time ago I was researching Compile Time Hashes (crc). I created this Perl script to generate a header file that contains the compile time Hash code.

Download GenConstHash.pl

While testing one of my Perl scripts I needed to have it build a source file for my C++ project. Instead of using a custom build step, which may not run if no other files changes, I decided to create a build rule for Perl scripts. It's still not perfect since it will always run the Perl script, but I got around that by adding intermediate file checking within the script itself. The build rule passes in the intermediate directory of the project as a parameter '-int $(IntDir)'.

Download Perl Script build rule

This is a little perl script I whipped together to convert raw data from multiple files into a header format. This was useful on a project where we needed data during startup but our file system wasn't initialized yet.

DataToSource.pl