resonance 1.0.1
Loading...
Searching...
No Matches
Rnd::MatAnim::Stage Class Reference

Animation of one texture stage of the material. More...

#include <matanim.h>

Classes

class  TexKey
 One keyframe of the texture channel of a stage. More...

Public Member Functions

 Stage ()=default
 Construct a stage animation with four empty channels.
 Stage (const Stage &other)=default
 Copy the four channels and the owner of another stage animation.
 ~Stage ()=default
 Release the four channels.
Stage & operator= (const Stage &other)=default
 Copy the four channels and the owner of another stage animation over this one.
void Save (Stream &stream)
 Serialise the stage animation.
void Load (Stream &stream)
 Load the stage animation.
void Dump (Dbg &sink)
 Write the four channels and the owner to the engine text sink.
void AddTexKey (Tex *pTex, float flFrame)
 Add a texture key and sort the channel by frame.
void RemoveTexKey (int nIndex)
 Remove the texture key at a position and sort the channel by frame.
void SetTexKeyFrame (int nIndex, float flFrame)
 Move the texture key at a position to a new frame and sort the channel by frame.

Friends

class MatAnim

Detailed Description

Animation of one texture stage of the material.

The record is 0x14 bytes, which the stride of every walk over the vector pins, and the walk in SetFrameSelf() runs it against mMat->mStages with the material's stage count as the bound. The three vector channels are Rnd::Vector3Key records. Their writer, reader, and dump move three components and the frame, and SetFrameSelf() blends them through vmulax.xyz rather than vmulax.xyzw. The dump labels the channels " transKeys:", " scaleKeys:", " rotKeys:", " texKeys:", and " matAnim:" in offset order.

The record has behaviour, so it is a class with private members rather than a plain data record. Rnd::MatAnim is the only code that touches the four channels, through the nested access a member of the enclosing class has.

Constructor & Destructor Documentation

◆ Stage() [1/2]

Rnd::MatAnim::Stage::Stage ( )
default

Construct a stage animation with four empty channels.

The compiler generates the body. mOwner is left as it was, and Rnd::MatAnim writes it after every resize.

Ghidra address:
NTSC-U/C: 0x004dbe38
Ghidra address:
PAL: 0x0051a3d8

◆ Stage() [2/2]

Rnd::MatAnim::Stage::Stage ( const Stage & other)
default

Copy the four channels and the owner of another stage animation.

The compiler generates the body, which copies the three vector channels through 0x004d84f8 and the texture channel through 0x004d85e8.

Parameters
otherThe stage animation to copy.
Ghidra address:
NTSC-U/C: 0x004d86d8
Ghidra address:
PAL: 0x00516bf0

◆ ~Stage()

Rnd::MatAnim::Stage::~Stage ( )
default

Release the four channels.

The compiler generates the body, which destroys the channels in reverse order and frees the record when the in-charge flag asks it to. The textures keep their references.

Ghidra address:
NTSC-U/C: 0x004dbd88
Ghidra address:
PAL: 0x0051a328

Member Function Documentation

◆ operator=()

Stage & Rnd::MatAnim::Stage::operator= ( const Stage & other)
default

Copy the four channels and the owner of another stage animation over this one.

Parameters
otherThe stage animation to copy.
Returns
This stage animation.

◆ Save()

void Rnd::MatAnim::Stage::Save ( Stream & stream)

Serialise the stage animation.

Writes the translation, scale, and rotation channels through the Rnd::Stream insertion operator and then the texture channel, each texture as its name.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x004dd500
Ghidra address:
PAL: 0x0051baa0

◆ Load()

void Rnd::MatAnim::Stage::Load ( Stream & stream)

Load the stage animation.

The shared material revision decides the layout. Below revision 2 the texture channel arrives as a bare list of textures, which becomes one key per texture at frames 0, 1, 2, and so on, and the channel is sorted again after every key. From revision 1 the three vector channels follow. From revision 2 the texture channel follows as keys.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x004d4068
Ghidra address:
PAL: 0x00512558

◆ Dump()

void Rnd::MatAnim::Stage::Dump ( Dbg & sink)

Write the four channels and the owner to the engine text sink.

Parameters
sinkThe text sink.
Ghidra address:
NTSC-U/C: 0x004d3f70
Ghidra address:
PAL: 0x00512460

◆ AddTexKey()

void Rnd::MatAnim::Stage::AddTexKey ( Tex * pTex,
float flFrame )

Add a texture key and sort the channel by frame.

The texture takes a reference for the owning animation, or for no object while the stage has no owner. The routine has no caller in the shipped build. The name is inferred.

Parameters
pTexThe texture, or null.
flFrameThe frame of the new key.
Ghidra address:
NTSC-U/C: 0x004d3d30
Ghidra address:
PAL: 0x00512220

◆ RemoveTexKey()

void Rnd::MatAnim::Stage::RemoveTexKey ( int nIndex)

Remove the texture key at a position and sort the channel by frame.

The texture drops the reference of the owning animation. The index is not checked. The routine has no caller in the shipped build. The name is inferred.

Parameters
nIndexThe position of the key.
Ghidra address:
NTSC-U/C: 0x004d3e30
Ghidra address:
PAL: 0x00512320

◆ SetTexKeyFrame()

void Rnd::MatAnim::Stage::SetTexKeyFrame ( int nIndex,
float flFrame )

Move the texture key at a position to a new frame and sort the channel by frame.

The index is not checked. The routine has no caller in the shipped build. The name is inferred.

Parameters
nIndexThe position of the key.
flFrameThe new frame.
Ghidra address:
NTSC-U/C: 0x004dd4a0
Ghidra address:
PAL: 0x0051ba40

◆ MatAnim

friend class MatAnim
friend

The documentation for this class was generated from the following file: