GTL Part 8 : The Great Refactor

posted in Not dead...
Published August 30, 2005
Advertisement
So, I've spent the last few days infact working on various bits todo with GTL, infact I've been worryingly productive for me doing a large amount of coding on the monday and a fair amount tonight.

Current state of play is that all inital decoders are pretty much done (BMP, TGA, PNG, DDS, JPG) and working. I've not as yet gotten around to seeing what if anything I need to smooth out with these but they all appear to work nicely.

Filters can now register themelves with a master object so that the library can do an on the fly lookup of what filter to use for what file.

The filters register themselves with an id, extension and creation function, this means (as things stand) that you can either pass the library a filename and have it work out the extension or pass the file name and id and it'll do a direct lookup to find the correct creation object.

I've also added a custom device for loading, a DeviceProxy which is used to act as a wrapper to other devices. Currently the only one which exist is a FileDevice which reads directly from a file, however using this system means that I can add devices to read from other sources, the first of which will be from a PhysFS source.

I've still got a cast in the middle of my code, however right now I still cant see how to get rid of it.
Currently its needed to cast from :
class boost::iostreams::stream_buffer,class std::allocator,struct boost::iostreams::input>
to
class boost::iostreams::stream_buffer,class std::allocator,struct boost::iostreams::seekable>
(I've highlighted the difference in bold).

This cast should always work so I'm not too worried about it for now.

So, things are progressing nicely. Code layout is a bit saner than it was after todays cleanup, as are various interdependancies between headers (I had alot of things including alot of things they didnt need).

On my list pre-inital release is;
* C Interface (inc. SDL support)
* PhysFS device/interface
* Various cases, such as flipping textures so they all point the same way

The C interface shouldnt take too long todo nor should the flipping. PhysFS could be intresting as I've never played with it before however it seemed like a logical thing to add [grin]
0 likes 2 comments

Comments

rick_appleton
I've used PhysFS before, and it's extremely easy to use. I doubt it'll take you more than an hour or two to get it implemented.
August 31, 2005 03:11 AM
paulecoyote
all sounds encouraging!
August 31, 2005 02:25 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Advertisement