More VectorStorm API comments

Newly developed for Lord (this will eventually be migrated back into VectorStorm trunk, in case anyone’s actually using that code for anything), I’ve made a minor adjustment to the file parsing API, such that if you have a file with a block like this:

a b
c d

Then you’d get a single fsRecord with a label of “Field”, followed by six fsTokens ( {, a, b, c, d, and } ).

Now, you get a single fsRecord with a label of “Field”, and no fsTokens.  Instead, the fsRecord has two “child” records, each of which have two fsTokens ( ‘a’ and ‘b’ for the first child record, and ‘c’ and ‘d’ for the second child record).  If you have file reading code which assumed the old file parsing logic, you’ll need to update to the new system once it’s been merged into the trunk codebase.

There are a few benefits to this change.  For one thing, it now means that you can put parsed data inside blocks, for logical or organisational reasons, and not lose the benefits of being able to load things based upon the label.

The other big benefit is that it’s allowed me to make the .vec file format use a single “VertexArray” block for either 2D or 3D vertices;  now that it knows where linebreaks are, it can just do the right thing, based upon whether the data file provides 2 or 3 vertex coordinates.

…and I promise that my next blog update will be less scarily technical.