Sign in to follow this  
  • entries
    455
  • comments
    639
  • views
    422570

GTL Part 8 : The Great Refactor

Sign in to follow this  

122 views

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]
Sign in to follow this  


2 Comments


Recommended Comments

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.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now