JayK wrote:If you really want to know about the FTEXS Dee, this is how the .1 files work. From the offsets in the FTEX file its basically
{
uint 16 compressedSize
uint 16 uncompressedSize
uint 16 unknown //always seems to be 0x08
uint 16 compressFlag // if its 0x80 its already uncompressed, if it's 0x0 its compressed
}
One thing I never understood is it repeats this block behined it, I don't know why they've made it do it twice. Also the end of the file always contains info for a texture in the next file although the next file has that info as well, that's another thing I found weird. Anyway you should know everything there is to know about tex's after this, hopefully someone else makes a repacker because at this point I can't be bothered :p
The redundant chunk entries are probably so that textures can be continuously streamed in without having to poke into the FTEX file again or something. So when it is done reading one mip map level it immediately knows where to go for the next level mip map and can just chain through until it reaches the null entry(last 8 bytes in the last ftexs file) to know it is done, as if each file was to be appended to the other continously.
Pretty much any file with
s at the end of it is structured with some stream-like behavior.
The weird format of the first entry found in the .1.ftexs files is probably some special format lead-in for the complete stream. With that first 0x08 variable being the offset immediately after the Chunkentry itself. I usually found Compressed/Uncompressed Sizes of 0x8 or 0x10. Probably the lowest mip entry. Not sure about the compress flag but that 0x80 seems to only show for the first entry in .1 files so it's probably just a flag to show that it is at the beginning of a stream and zero just lets it know to continue on. When it reaches a zero entry when all 8 bytes are zero then it knows to stop(By possibly checking if CompressedSize and UncompressedSize are Zero).
If that structure is true then it would be something like
Code: Select all
struct BlockMapEntry
{
unsigned short CompressedSize;
unsigned short UncompressedSize;
unsigned short Offset;
unsigned short StreamFlags;
};