Model Editor - Custom File Format

posted in owl's Blog
Published February 13, 2011
Advertisement
After a week or so of great procrastination I finally made some progress with the model editor.

As the title prays, it is now capable of loading xsf, xmf and xaf files (Cal3D XML) and saving them in binary format in a custom file of my own.

The file format I implemented is actually quite naive:

FILE_TYPE (1 byte) { 0=skeleton, 1=mesh, 2=animation, 255=eof }
FILE_SIZE (4 bytes)
FILE_DATA (FILE_SIZE bytes)
[repeat per file]
{eof}

As I'm using PHYSFS for loading my files into memory buffers I needed to save the binary files separately first (using Cal3D routines that don't use PHYSFS), then load them into different buffers, deleting those files from the disk and then memcpy the type, the size and the data of each buffer into one big buffer which is the final one that gets saved.

As always, even when it doesn't really makes sense here, the video:
[media]
[/media]


Cheers!
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement