Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: Lazy Bastard on 2012-08-07 19:00:55

Title: (PSX FF7) FIELD\*.BSX files models section
Post by: Lazy Bastard on 2012-08-07 19:00:55
In the wiki, the pseudo-code below is throwing me off.:

Code: [Select]
struct StrModel {
    u16 model_id;          // ID of the model
    u16 scale;             // (12 bix fixed point)
    u32 offset_skeleton;   // Offset to the parts, bones and animations of the model
    byte r, g, b;
    byte unknown[7];
    byte index_bones;      // Start index of bones
    byte unknown;
    byte r1, g1, b1;
    byte num_bones;        // Additionnal number of bones in the model's skeleton
    byte unknown[6];
    byte index_parts;      // Start index of parts
    byte unknown;
    byte r2, g2, b2;
    byte num_parts;        // Additionnal number of parts in the model's skeleton
    byte unknown[6];
    byte index_animations; // Start index of animations
    byte unknown;
    byte r3, g3, b3;
    byte num_animations;   // Additionnal number of animations
} // sizeof = 48

It specifies that this is 48 bytes in size, but I must be missing something. Looking at the above, I see 'unsigned 16-bit' (two bytes), 'unsigned 16-bit' (two bytes), 'unsigned 32-bit' (four bytes), one byte, seven bytes, one byte, one byte, one byte, one byte, six bytes, one byte, one byte, one byte, one byte, six bytes, one byte, one byte, one byte, one byte...which equals 40 bytes total. Where am I missing eight bytes...or is there a mistake in this snippet?
Title: Re: (PSX FF7) FIELD\*.BSX files models section
Post by: Lazy Bastard on 2012-08-07 19:02:51
Ack, I think I just caught my own mistake: 'byte r2, g2, b2;' must reference three bytes. Let me know if I'm wrong.

Update: Yeah, I'm right. I identified this data in entirety in MD1STIN.BSX, per model.
Title: Re: (PSX FF7) FIELD\*.BSX files models section
Post by: lasyan3 on 2012-08-08 05:31:38
You're welcome :-D