Skip to content

Random TAE stuff - #291

Open
axd1x8a wants to merge 3 commits into
mainfrom
feat/tae
Open

Random TAE stuff#291
axd1x8a wants to merge 3 commits into
mainfrom
feat/tae

Conversation

@axd1x8a

@axd1x8a axd1x8a commented May 8, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@axd1x8a
axd1x8a requested review from nex3 and vswarte May 8, 2026 06:51
@@ -0,0 +1,18 @@
#[repr(C)]
#[derive(Copy, Clone)]
/// Tae Event Args for [`EnableTwistModifier`]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Tae Event Args for [`EnableTwistModifier`]
/// TAE event args for [`EnableTwistModifier`].

DebugDecal2 = 10138,
}

/// Root TAE file header. `magic` is the base address used for pointer fixups.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Root TAE file header. `magic` is the base address used for pointer fixups.
/// The TAE file header.
///
/// `magic` is the base address used for pointer fixups.

I'm not sure what this second line means. Isn't the first element of a repr(C) struct always its base address? What sorts of "pointer fixups" are you describing here?


/// Root TAE file header. `magic` is the base address used for pointer fixups.
#[repr(C)]
pub struct TAE_Header_Main {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these names come from the game's metadata? If so, document that. If not, make them Rust-style and camel-cased.

Comment on lines +180 to +183
pub unk_a00: [u8; 10],
pub unk_a0a: u8,
pub unk_a0b: u8,
pub unk_a0c: u32,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These shouldn't have underscores; they should be numbered relative to this struct, not the parent struct; and they should be private. Same goes for other unks below.

pub unk_a0c: u32,
}

/// Groups a range of file IDs to their [`TAE_Header_FileInfo`] entries.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Groups a range of file IDs to their [`TAE_Header_FileInfo`] entries.
/// A mapping between file IDs and their [`TAE_Header_FileInfo`] entries.

pub anim_containers: [HvkAnimContainer; 2],
/// Total animation count loaded for this character
pub animation_count: u32,
/// Pointer to `HvkAnimTaeBinding` of `animation_count` amount

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Pointer to `HvkAnimTaeBinding` of `animation_count` amount
/// Pointer to `animation_count` instances of `HvkAnimTaeBinding`

/// Pointer to `HvkAnimTaeBinding` of `animation_count` amount
animations: NonNull<()>,
pub tae_dat: OwnedPtr<TaeDat>,
/// Name of the animbnd data belongs to, eg `c0000` for the player

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// Name of the animbnd data belongs to, eg `c0000` for the player
/// Name of the animbnd that the data belongs to, eg `c0000` for the player

animations: NonNull<()>,
pub tae_dat: OwnedPtr<TaeDat>,
/// Name of the animbnd data belongs to, eg `c0000` for the player
pub name: NonNull<u16>,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a method to get this as a Rust string and using that to implement Debug.

pub struct TaeFileResolver {
vftable: usize,
/// Resolved tae file with most offsets replaced with actuall pointers,
/// safe to read and traverse if non-null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Safe" is kind of a loaded word... even if the memory is initialized, but it's not "safe" in the Rust sense of being valid to create a reference to it unless there are no mutable references to it elsewhere, which isn't necessarily always going to be the case.

Comment on lines +36 to 40
pub prev_local_time: f32,
/// Time in seconds since the animation started up to the current frame.
pub local_time: f32,
/// Total length of the animation in seconds.
pub anim_length: f32,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider providing methods that expose these as Rust Durations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants