wavelength 1.0.0
Loading...
Searching...
No Matches
RndLightAnim Class Reference

Animation of the colour of a light. More...

#include <rndlightanim.h>

Inheritance diagram for RndLightAnim:
Collaboration diagram for RndLightAnim:

Public Member Functions

 RndLightAnim (const char *pszName)
 Construct an animation of nothing without keys.
 ~RndLightAnim () override
 Drop the references on the light and the keys owner.
float EndFrame () override
 Report the frame of the last colour key of the keys owner.
void ListAnimObjects (std::list< RndObject * > &objects) override
 Add the light to a list, then the objects of the children.
int SetFrameSelf (float fFrame) override
 Set the colour of the light from the keys of the keys owner.
void DumpText (PrnStream &stream) override
 Write a description of the animation and its base.
void Save (BinStream &stream) override
 Write the animation and its base.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace the light or the keys owner with another object.
const char * ClassName () const override
 Report the class name.
void Copy (const RndObject *pSource, int nFlags) override
 Copy another animation and its base.
void Load (BinStream &stream) override
 Read what Save() wrote, or an earlier version of it.
Public Member Functions inherited from RndAnimatable
 RndAnimatable ()
 Construct an animatable at frame 0 without children or filters.
 ~RndAnimatable () override
 Drop the references on the children and delete the filters.
RndAnimatable * Parent ()
 Find the animatable whose children include this one.
void SetFrame (float fFrame)
 Filter a frame, apply it, and pass the result on to the children.
float FilterFrame (float fValue)
 Run a frame through the filters.
float UnfilterFrame (float fValue)
 Run a filtered frame back through the filters, last first.
float ChildrenEndFrame ()
 Report the latest end frame of the children, unfiltered through this animatable.
bool AddAnim (RndAnimatable *pAnim)
 Append a child.
void RemoveAnim (RndAnimatable *pAnim)
 Remove a child.
void RemoveAllAnims ()
 Remove every child.
const std::list< Filter * > & GetFilters () const
float GetFrame () const
float GetFilteredFrame () const
const std::list< RndAnimatable * > & GetAnims () const
std::list< Filter * > & GetFilters ()
Public Member Functions inherited from RndObject
 RndObject (const char *pszName)
 Construct an object and register it under a name.
virtual ~RndObject ()
 Notify every referrer, then erase the registration.
void SetName (const char *pszName)
 Register the object under a different name.
void AddRef (RndObject *pReferrer)
 Register an object as a store of a pointer to this one.
void RemoveRef (RndObject *pReferrer)
 Drop the first registration AddRef() made for a referrer.
const char * GetName () const
const std::list< RndObject * > & GetRefs () const
int GetInternal () const
void SetInternal (int nInternal)

Static Public Member Functions

static RndObject * New (const char *pszName)
 Create an animation.
Static Public Member Functions inherited from RndAnimatable
static Filter * NewFilter (int nType)
 Create a filter stage of a type, with its parameters unset.
static void CollectChildren (std::list< RndObject * > &objects, RndAnimatable *pAnimatable)
 Append every animation descendant of an animatable, depth first, each before its descendants.

Static Public Attributes

static constexpr int kCopyShareKeys = 2
 The bit of the Copy() flags that shares the source's keys rather than copying them.
static const char * sClassName
 The class name a .rnd file writes, LightAnim.
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndAnimatable
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndObject
static constexpr int kCopyChildLists = 0x200
 The bit of the Copy() flags that copies the child lists of the mix-ins.

Protected Member Functions

void ReleaseRefs ()
 Drop the references on the light and the keys owner.
void AcquireRefs ()
 Take references on the light and the keys owner.
Protected Member Functions inherited from RndAnimatable
void ReleaseObjects ()
 Drop the references on the children without emptying the list, and delete the filters.
void AcquireAnimRefs ()
 Take a reference on every child.

Additional Inherited Members

Public Types inherited from RndAnimatable
enum  FilterType {
  kFilterScaleOffset = 0 , kFilterMinMaxLoop = 1 , kFilterZeroOrder = 2 , kFilterFirstOrder = 3 ,
  kFilterSecondOrder = 4
}
 The type tags of the filters, as Save() writes them. More...
Protected Attributes inherited from RndAnimatable
std::list< RndAnimatable * > mAnims
std::list< Filter * > mFilters
float mFrame
float mFilteredFrame
Protected Attributes inherited from RndObject
std::list< RndObject * > mRefs
String mName

Detailed Description

Animation of the colour of a light.

The RTTI includes the class name and records RndAnimatable as the one base. The keys may belong to another animation, the keys owner. Several animations then share one set.

Constructor & Destructor Documentation

◆ RndLightAnim()

RndLightAnim::RndLightAnim ( const char * pszName)
explicit

Construct an animation of nothing without keys.

The animation is its own keys owner. The binary expands the constructor inline in New().

Parameters
pszNameThe registry key.

◆ ~RndLightAnim()

RndLightAnim::~RndLightAnim ( )
override

Drop the references on the light and the keys owner.

Ghidra address:
NTSC-U/C: 0x00395a78
Ghidra address:
PAL: 0x00404168

Member Function Documentation

◆ EndFrame()

float RndLightAnim::EndFrame ( )
overridevirtual

Report the frame of the last colour key of the keys owner.

Returns
The frame, or 0 without keys.
Ghidra address:
NTSC-U/C: 0x0024b980
Ghidra address:
PAL: 0x002543e8

Reimplemented from RndAnimatable.

◆ ListAnimObjects()

void RndLightAnim::ListAnimObjects ( std::list< RndObject * > & objects)
overridevirtual

Add the light to a list, then the objects of the children.

Parameters
objectsThe list to add to.
Ghidra address:
NTSC-U/C: 0x0024b8c0
Ghidra address:
PAL: 0x00254328

Reimplemented from RndAnimatable.

◆ SetFrameSelf()

int RndLightAnim::SetFrameSelf ( float fFrame)
overridevirtual

Set the colour of the light from the keys of the keys owner.

Without keys the light receives its own colour again.

Parameters
fFrameThe frame.
Returns
1, to pass the frame on to the children.
Ghidra address:
NTSC-U/C: 0x0024b9a8
Ghidra address:
PAL: 0x00254410

Reimplemented from RndAnimatable.

◆ DumpText()

void RndLightAnim::DumpText ( PrnStream & stream)
overridevirtual

Write a description of the animation and its base.

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

Reimplemented from RndAnimatable.

◆ Save()

void RndLightAnim::Save ( BinStream & stream)
overridevirtual

Write the animation and its base.

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

Reimplemented from RndAnimatable.

◆ Replace()

void RndLightAnim::Replace ( RndObject * pFrom,
RndObject * pTo )
overridevirtual

Replace the light or the keys owner with another object.

A replacement of another class, or null, clears the light. A keys owner replaced by null becomes the animation itself.

Parameters
pFromThe object being replaced.
pToThe replacement, or null.
Ghidra address:
NTSC-U/C: 0x0024b138
Ghidra address:
PAL: 0x00253ba0

Reimplemented from RndAnimatable.

◆ ClassName()

const char * RndLightAnim::ClassName ( ) const
inlineoverridevirtual

Report the class name.

Returns
sClassName.
Ghidra address:
NTSC-U/C: 0x00395d18
Ghidra address:
PAL: 0x00404408

Implements RndObject.

◆ Copy()

void RndLightAnim::Copy ( const RndObject * pSource,
int nFlags )
overridevirtual

Copy another animation and its base.

The keys are copied when the source has its own and the flags do not include kCopyShareKeys. Otherwise the source's keys owner becomes this one's.

Parameters
pSourceThe animation to copy from.
nFlagsThe set of fields to copy.
Ghidra address:
NTSC-U/C: 0x0024b7f0
Ghidra address:
PAL: 0x00254258

Reimplemented from RndAnimatable.

◆ Load()

void RndLightAnim::Load ( BinStream & stream)
overridevirtual

Read what Save() wrote, or an earlier version of it.

Version 0 stores a further colour key list before the diffuse keys and another after them, which are read and discarded.

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

Reimplemented from RndAnimatable.

◆ New()

RndObject * RndLightAnim::New ( const char * pszName)
inlinestatic

Create an animation.

Parameters
pszNameThe registry key.
Returns
The animation.
Ghidra address:
NTSC-U/C: 0x00395d30
Ghidra address:
PAL: 0x00404420

◆ ReleaseRefs()

void RndLightAnim::ReleaseRefs ( )
protected

Drop the references on the light and the keys owner.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0024b478
Ghidra address:
PAL: 0x00253ee0

◆ AcquireRefs()

void RndLightAnim::AcquireRefs ( )
protected

Take references on the light and the keys owner.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x0024b4c8
Ghidra address:
PAL: 0x00253f30

Member Data Documentation

◆ kCopyShareKeys

int RndLightAnim::kCopyShareKeys = 2
staticconstexpr

The bit of the Copy() flags that shares the source's keys rather than copying them.

◆ sClassName

const char* RndLightAnim::sClassName
static

The class name a .rnd file writes, LightAnim.

Ghidra address:
NTSC-U/C: 0x003b0a7c
Ghidra address:
PAL: 0x0042f914

◆ sRev

int RndLightAnim::sRev
static

The format version Save() writes and Load() accepts.

Ghidra address:
NTSC-U/C: 0x003b0a80
Ghidra address:
PAL: 0x0042f918

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