Struct TagHeader

Source
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).

§tagstruct_count: u32

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

Source

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 implements BufRead from which to read the data.
§Errors

Trait Implementations§

Source§

impl Debug for TagHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TagHeader

Source§

fn default() -> TagHeader

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.