The idea was to make a format that is easier for me to use, because it contains data fields that I need, and removes all of the extraneous ones from the .bmp format
The hardest part making this format was the loader. Upon loading my displayer kept seg-faulting. It turns out, the saver was saving data that was mis-aligned by just a few bytes, screwing up the whole file. I rewrote the saver, and now everything works perfectly.
Here is the file format:
Image file: extension -- .aibp -- Aerial Image Binary Paletted --used to make sure it is loadable float fileFormatVersion int sizeOfImageName int sizeOfCreatorName int sizeOfDescription char imageName[sizeOfImageName] char creatorName[sizeOfCreatorName] char description[sizeOfDescription] unsigned char bitsPerPixel unsigned int width, height unsigned int dataSize --big endian, RGB, omit the reserved member on save SDL_Color palette[256] Uint8 data[dataSize]
The reason I have the 'sizeof' fields instead of just null-terminating my name/creator/description strings, is because the fields make making a loader MUCH faster. I think the loading itself is faster too, because otherwise I would have to write a loop that looks at each byte to see if it's a null terminator. I think being able to be lazy is worth 12-bytes.