pub struct TagHeader {Show 21 fields
magic: u32,
version: i32,
pub root_struct_guid: i64,
pub checksum: i64,
pub dependency_count: u32,
pub datablock_count: u32,
pub tagstruct_count: u32,
pub data_reference_count: u32,
pub tag_reference_count: u32,
pub string_table_size: u32,
pub zoneset_size: u32,
unknown: u32,
pub header_size: u32,
pub data_size: u32,
pub resource_size: u32,
pub actual_resource_size: u32,
header_alignment: u8,
tag_alignment: u8,
resource_alignment: u8,
actual_resource_alignment: u8,
pub is_resource: bool,
}
Expand description
Tag Header structure containing info on the layout of the tag file.
Fields§
§magic: u32
Has to be “ucsh” (0x68736375)
version: i32
Should be 27. Note: this is also the tag version from Halo 5!
root_struct_guid: i64
Secondary GUID to identify the root structure.
checksum: i64
Checksum generated from unknown algorithm
dependency_count: u32
Number of tags required to load tag.
datablock_count: u32
Number of datablocks that exist within tag (offsets, sections etc).
Number of tag struct definitions that make up the actual structure of the tag.
data_reference_count: u32
Number of “external” data references (to other tags) in tag.
tag_reference_count: u32
Number of internal references to structures.
string_table_size: u32
Size in bytes of string table inside tag. Unused after Halo 5.
zoneset_size: u32
Size in bytes of “zoneset” section of tag. Unknown use.
unknown: u32
Unknown. Possibly used to split something in memory.
header_size: u32
Size of the header and the fields read by it (dependencies, datablocks, etc.). Important as sometimes the offset after reading those fields does not match up to where tag data starts. Might be some sort of internal padding measure.
data_size: u32
Size of actual data in tag, referenced in tag structs.
resource_size: u32
Size of resource in tag (after data!)
actual_resource_size: u32
Size of “external” data, for instance Havok data.
header_alignment: u8
Power of 2 to align the header to.
tag_alignment: u8
Power of 2 to align the tag data to.
resource_alignment: u8
Power of 2 to align resource data to.
actual_resource_alignment: u8
Power of 2 to align actual resource to.
is_resource: bool
Unknown if this is consistent: Indicates if the file is a resource.
Implementations§
Source§impl TagHeader
impl TagHeader
Sourcepub fn read<R: BufRead>(&mut self, reader: &mut R) -> Result<()>
pub fn read<R: BufRead>(&mut self, reader: &mut R) -> Result<()>
Reads the tag header from the given reader implementing BufRead
.
§Arguments
reader
- A mutable reference to a reader that implementsBufRead
from which to read the data.
§Errors
- If the magic number is not equal to
HEADER_MAGIC
TagError::IncorrectMagic
- If the version number is not recognized
TagError::IncorrectVersion
- If the reader fails to read the exact number of bytes
ReadError