I just decided to look back a way through the thread, because 301 was rattling around back there.
HEY GUESS WHAT!
READ THIS POST.The first run of 301 vertices is
exactly how many there are before it runs into double-mode vertices. The first two bytes after the 0x0000002A starting the next run is 0x0968, which offsets us
exactly to the beginning of the first set of double-mode vertices.
Unfortunately, trying to get a count in the same fashion here gives us a total of 450, instead of 210 or 420, slots, so this second run doesn't behave quite how we'd expect. I
think it runs out to 0x02AC, at which point we have a sequence that gives all of five vertices - which happens to be the remaining block of single-mode vertices.
HOWEVER!
The double-mode vertices use
longer entries here than the single-mode vertices do! In fact, the entries here are 12 bytes instead of just 4 - the first four bytes are the number of vertices to count, and the remaining 8 don't just refer to a bone number, but also (I think) include weighting amount for the first and second parts of each vertex, thereby explaining the predominance of the numbers noted in my previous post.
This leaves two ranges of indeterminate purpose, which are fairly close in appearance (but not identical):
0x0294-0x02AB, and 0x0344-0x0357.
So, organization of Section 1-1 is just alternating segments of Type S and Type D:
Type S - Single-mode vertices.
Header: 4 bytes, number of entries minus 1.
Entries: 4 bytes -
* 2 bytes: Number of vertices.
* 2 bytes: Bone # to attach to.
Type D - Double-mode vertices.
Header: 8 bytes -
* 4 bytes, number of entries minus 1.
* 4 bytes, offset to move counter ahead by from last Type D section in this model.
*Entries: 12 bytes -
* 2 bytes: Number of vertices.
* 2 bytes: Zero.
* 2 bytes: ??
* 2 bytes: Weighting value #1?
* 2 bytes: ??
* 2 bytes: Weighting value #2?
Type X - Who knows?
* May simply be a "footer" for Type D sections to resync the counter for the following Type S section.
*I'm not entirely sure if this is actually used, or if it's a throwback to an earlier version of the model loader that required it. If it is used, it's related to the two "Type X" sections more likely than not.Now we just have to figure out what else is being kept track of in the Type D entries, and why they aren't kept track of with the bones (I have my suspicions here - I think they're for interpolation
between bones...).
EDIT: After looking at things in there, I'm an idiot for hedging my bets. Modified version of the Type D entries follows:
* 2 bytes: Number of vertices.
* 2 bytes: Zero.
* 2 bytes: Bone 1 and slot 1.
* 2 bytes: Weighting value for Bone 1 and slot 1.
* 2 bytes: Bone 2 and slot 2.
* 2 bytes: Weighting value for Bone 2 and slot 2.
Note that EVERY pair of weighting values adds up to 0x10000 or 0xFFFF.
NO exceptions.