B
Borde
Guest
Hello everyone.
I'm currently having a look at the S files stored at magic.lgp. It's obvious by now they define 2D animated sprites used during battles. I'm finding hard to understand how it all works, though. I'm starting this thread to compile the knowledge we currently have about them.
Based on Aali's and NFITC1 job, so far this is what I've got about the format:
Code: [Select]
The contents of the sprite is defined by the rectangle starting at (XSource, YSource) and with dimensions (SourceWidth, SourceHeight). These values aren't in standard texture coordinates, they are in pixels instead.
XTargetOffset and YTargetOffset define position of the first pixel of the image on the target surface (most likely a QUAD), being (0,0) the center of said surface.
Although usually these coordinates point directly to regions in TEX files (some are very easy to identify due to file names), sometimes they don't. My guess is here is what Aali called TexturePage comes into play. I think some of the TEX files are compiled by the engine in a single TexturePage (provably they have fixed dimensions, because they will be needed to generate texture coordinates). I don't know where these pages are defined though.
Attributes W2 and H2 are also pretty puzzling. They are usually equal or very similar to SourceWidth and SourceHeight, but sometimes their value is 0. Maybe their purpose is to stretch the sprites?
I hope someone around here can shed any light about this.
Thanks.
I'm currently having a look at the S files stored at magic.lgp. It's obvious by now they define 2D animated sprites used during battles. I'm finding hard to understand how it all works, though. I'm starting this thread to compile the knowledge we currently have about them.
Based on Aali's and NFITC1 job, so far this is what I've got about the format:
Code: [Select]
Code:
File header: unsigned char FileType unsigned char Version unsigned short UnknownField_2 unsigned int NumFramesFrame header: unsigned short UnknownField_0 unsigned short NumSpritesSprite definition: unsigned int Flags signed short XTargetOffset signed short YTargetOffset short XSource short YSource unsigned short TexturePageIndex short UnknowField_E unsigned char SourceWidth unsigned char W2 unsigned char SourceHeight unsigned char H2
XTargetOffset and YTargetOffset define position of the first pixel of the image on the target surface (most likely a QUAD), being (0,0) the center of said surface.
Although usually these coordinates point directly to regions in TEX files (some are very easy to identify due to file names), sometimes they don't. My guess is here is what Aali called TexturePage comes into play. I think some of the TEX files are compiled by the engine in a single TexturePage (provably they have fixed dimensions, because they will be needed to generate texture coordinates). I don't know where these pages are defined though.
Attributes W2 and H2 are also pretty puzzling. They are usually equal or very similar to SourceWidth and SourceHeight, but sometimes their value is 0. Maybe their purpose is to stretch the sprites?
I hope someone around here can shed any light about this.
Thanks.
Last edited: