Resources, resources

· by Steve · Read in about 2 min · (344 Words)

Man, this resource work is taking longer than I expected. I’ve designed and implemented the main changes to the resource infrastructure, which means things like this are possible: resource grouping, unloading and reloading of groups, manual loader callbacks (for repeatable loading when resources are populated using code rather than coming from files), pre-declaring resources and receiving loading progress callbacks, file streaming.

However, going through all the old resources and resource managers to implement this design is taking a lot of time, and it’s actually very dull. I also had to do a lot of other supporting things, like rewriting the Archive class (since it was a bit of a mess), changing the raw Resource pointers to shared reference counted pointers, phasing out DataChunk in favour of DataStream. The equivalent of the old DataChunk is now the subclass MemoryDataStream, which can wrap an existing memory block, or wrap another DataStream and cache it in memory.

It’s all turning out rather well, I’m much happier with the structures now, but it’s extremely time consuming, and so destructive that I can’t even test any of it properly yet - it really is a case of pulling everything apart and putting it all back together; there’s no half-measures. I’ll keep hammering away, and look forward to the time when I can throw the switch on this and watch to see if it explodes 😉

In addition to this, I’ve been trying not to play Half Life 2 too much (great game, if a little too linear), and I’ve started looking at an example XSI exporter. Mesh exporting doesn’t look difficult at all, that shouldn’t take me long once I actually get time to sit down and do it. The SDK doesn’t seem to have an animation example, so I’ll have to spend a little more time on that - but then again I’ve only learned mesh editing in XSI so far so I’ll need to do some rigging / animation tutorials to get my head around how it’s supposed to work from an artist’s point of view first.