aap/rwtools — pull request #1 by thelink2012 (2014-12-12 04:15:40+00:00)
Title: Collision importer/extractor

colex - Collision Importer/Extractor
===

Little Story
-------------------
I was wandering and wanted to make all kind of models accept embedded collisions, but first I had to make a utility which imports such collision into the clump... Jesus, why do I need to write a rw io library just for that? WOOO, WAIT! I remember seeing _THEHERO_ posting a kind of rw io library, that'll save me a lot of time my hero.
Done, should I be a good open source citzen and send my improvements to the original repository? I think so. What do you think?

Changes to the Library
-------------------
Well, to accomplish my objective I had to add some stuff to the library, which I think will be useful later on too.

* Added a `rw::Stream` class which allows you to store a entire renderware stream object (dff, txd, whatever). It supports the basic `read`, `write`, `clear` methods.
* Added `bool HeaderInfo::findChunk(std::istream &rw, uint32 type, std::streampos max)`, useful to find a chunk only inside another chunk boundary.
* I also changed the sized typedefs to use cstdint instead.

Possible Issues
-------------------
* I had trouble compiling from your makefile (must be a problem on my side), but I've changed the makefile to reflect my changes, but I guess you should test it to make sure it's fine.
* I tried to wrote code similar to how you write, however I failed on that when declaring iterators, I had to use `auto`! I'm sorry if the code is supposed to compile on older C++ versions, feel free to change my iterator declarations.

Licensing?
-------------------
Eh, I'm not sure what I'm allowed to do with the code in this repository, since there's no license, and usually no license means copyright... So am I allowed to redistribute the _colex_ utility? Really a license on the page would help so nobody needs to ask (Choose it carefully!!!!)

Final Question
-------------------
I've read this from the README:
"Some chunks are not read and thus skipped as of now, though"
What does that really mean for me? Will the dff files I add the collision model extension into break because of those not readen chunks?
Thanks in advanced. Keep up all your good work.