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

Looping track of views, each shown over a window of frames and moved on by a fixed distance every loop. More...

#include <rndarena.h>

Inheritance diagram for RndArena:
Collaboration diagram for RndArena:

Classes

struct  Section
 One view of the track and the window it is shown in. More...
class  Sort
 One entry of the drawing order. More...

Public Member Functions

 RndArena (const char *pszName)
 Construct an empty track that loops every 1000 frames over no distance.
 ~RndArena () override
 Drop the references on the views.
void * operator new (size_t nSize)
 Allocate a track, billed to the class name.
void operator delete (void *pBlock)
 Release a track.
int SetFrameSelf (float fFrame) override
 Place and show the view of each section for the filtered frame, then sort the drawing order.
int UpdateWorldXfm (RndTransformable *pParent, int bForce) override
 Update the world transform, then that of every showing view.
int DrawShowing () override
 Draw the views in the drawing order.
void Collide (const Segment &segment, std::list< Collision > &collisions) override
 Add what each showing view strikes to a list.
void DumpText (PrnStream &stream) override
 Write a description of the track and its bases.
void Save (BinStream &stream) override
 Write the track and its bases.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a view with another object.
const char * ClassName () const override
 Report the class name.
void Copy (const RndObject *pSource, int nFlags) override
 Copy another track and its bases.
void Load (BinStream &stream) override
 Read what Save() wrote, or an earlier version of it.
virtual void Collide (const Vector2 &point, std::list< Collision > &collisions)
 Test a screen point against the collideable and add what it strikes to a list.
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.
virtual float EndFrame ()
 Report the frame at which the animation ends.
virtual void ListAnimObjects (std::list< RndObject * > &objects)
 Add the objects the animation uses to a list.
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)
Public Member Functions inherited from RndCollideable
 RndCollideable ()
 Construct a collideable without children.
 ~RndCollideable () override
 Drop the references on the children.
void DumpText (PrnStream &stream) override
 Write a description of the collideable.
void Save (BinStream &stream) override
 Write the names of the children.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a child with another object.
void Copy (const RndObject *pSource, int nFlags) override
 Copy the children when the flags request them.
void Load (BinStream &stream) override
 Read what Save() wrote.
RndCollideable * Parent ()
 Find the collideable whose children include this one.
bool AddCollide (RndCollideable *pCollide)
 Append a child.
void RemoveCollide (RndCollideable *pCollide)
 Remove a child.
Public Member Functions inherited from RndTransformable
 RndTransformable ()
 Construct a transformable with identity transforms, no origin offset, and no billboard.
 ~RndTransformable () override
 Drop the references on the children.
virtual void SetBillboard (int nBillboard)
 Set the billboard mode.
void DumpText (PrnStream &stream) override
 Write a description of the transformable.
void Save (BinStream &stream) override
 Write the transforms, the names of the children, the billboard mode, and the origin.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a child with another object.
void Copy (const RndObject *pSource, int nFlags) override
 Copy the transforms, the billboard mode, the origin, and the children when the flags request them.
void Load (BinStream &stream) override
 Read what Save() wrote, or an earlier version of it.
void SetOrigin (const Vector3 &origin)
 Set the point the world transform subtracts first when there is no billboard.
RndTransformable * Parent ()
 Find the transformable whose children include this object.
bool AddTrans (RndTransformable *pTrans)
 Append a child and mark its world transform dirty.
void RemoveTrans (RndTransformable *pTrans)
 Remove a child.
void ClearTrans ()
 Remove every child.
const Transform & BillboardXfm ()
 Report the world transform turned to face the current camera.
const Transform & GetLocalXfm () const
Transform & GetLocalXfm ()
void SetLocalXfm (const Transform &xfm)
const Transform & GetWorldXfm () const
Transform & GetWorldXfm ()
int GetDirty () const
void SetDirty (int nDirty)
const std::list< RndTransformable * > & GetTransList () const
Public Member Functions inherited from RndDrawable
 RndDrawable ()
 Construct a showing drawable without a highlight or children.
 ~RndDrawable () override
 Drop the references on the children.
virtual void ListDrawObjects (std::list< RndObject * > &objects)
 Add the objects the drawable uses to a list.
virtual void ListDrawables (std::list< RndDrawable * > &drawables)
 Add the drawables to draw this frame to a list.
virtual void SetShowing (int nShowing)
 Set whether the drawable draws at all.
virtual void SetHighlight (int nHighlight)
 Set whether the drawable draws with its highlight treatment.
void DumpText (PrnStream &stream) override
 Write a description of the drawable.
void Save (BinStream &stream) override
 Write the showing flag and the names of the children.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Replace a child with another object.
void Copy (const RndObject *pSource, int nFlags) override
 Copy the showing flag, and the children when the flags request them.
void Load (BinStream &stream) override
 Read what Save() wrote.
RndDrawable * Parent ()
 Find the drawable whose children include this one.
void Draw ()
 Draw the drawable and then its children, when it is showing.
bool AddDraw (RndDrawable *pDraw, RndDrawable *pBefore)
 Add a child before another.
void RemoveDraw (RndDrawable *pDraw)
 Remove a child.
void ClearDraws ()
 Remove every child.
int GetShowing () const
const std::list< RndDrawable * > & GetDraws () const

Static Public Member Functions

static RndObject * New (const char *pszName)
 Create a track.
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 Member Functions inherited from RndCollideable
static void CollectChildren (std::list< RndObject * > &objects, RndCollideable *pCollideable)
 Append every collision descendant of a collideable, depth first, each before its descendants.
Static Public Member Functions inherited from RndTransformable
static void CollectChildren (std::list< RndObject * > &objects, RndTransformable *pTransformable)
 Append every transform descendant of a transformable, depth first, each before its descendants.
Static Public Member Functions inherited from RndDrawable
static void CollectChildren (std::list< RndObject * > &objects, RndDrawable *pDrawable)
 Append every draw descendant of a drawable, depth first, each before its descendants.

Static Public Attributes

static const char * sClassName
 The class name a .rnd file writes, Arena.
static int sRev
 The format version Save() writes and Load() accepts.
static int sLoadRev
 The version Load() read last.
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.
Static Public Attributes inherited from RndCollideable
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndTransformable
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndDrawable
static int sRev
 The format version Save() writes and Load() accepts.

Protected Member Functions

void ReleaseRefs ()
 Drop the references on the views and empty the drawing order.
void AcquireRefs ()
 Take a reference on each view and give the drawing order one entry per section.
void UpdateSection (Section &section)
 Place a section's view for the filtered frame and show it while the frame is in its window.
void SetSectionLoop (Section &section, int nLoop)
 Move a teleporting section's view on by the loop distance for each loop between its loop and a new one, and record the new loop.
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.
Protected Member Functions inherited from RndCollideable
void ReleaseCollideRefs ()
 Drop the reference on every child without emptying the list.
void AcquireCollideRefs ()
 Take a reference on every child.
Protected Member Functions inherited from RndTransformable
void ReleaseTransRefs ()
 Drop the reference on every child without emptying the list.
void AcquireTransRefs ()
 Take a reference on every child.
Protected Member Functions inherited from RndDrawable
void ReleaseDrawRefs ()
 Drop the reference on every child without emptying the list.
void AcquireDrawRefs ()
 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...
Public Types inherited from RndTransformable
enum  Billboard {
  kBillboardNone = 0 , kBillboardX = 1 , kBillboardY = 2 , kBillboardZ = 4 ,
  kBillboardXZ = 8 , kBillboardXYZ = 16 , kBillboardSimpleXYZ = 32 , kBillboardLocalRotate = 64 ,
  kBillboardScale = 128 , kBillboardScaleX = 129 , kBillboardScaleY = 130 , kBillboardScaleZ = 132 ,
  kBillboardScaleXZ = 136 , kBillboardScaleXYZ = 144 , kBillboardScaleSimpleXYZ = 160
}
 How the world transform turns to face the current camera. 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
Protected Attributes inherited from RndTransformable
std::list< RndTransformable * > mTransList
Transform mLocalXfm
Transform mWorldXfm
Vector3 mOrigin
int mDirty
int mBillboard
Protected Attributes inherited from RndDrawable
int mShowing

Detailed Description

Looping track of views, each shown over a window of frames and moved on by a fixed distance every loop.

The RTTI includes the class name and records RndAnimatable, RndCollideable, RndTransformable, and RndDrawable as bases. A section shows its view while the frame, less the loops already run, is in the window that ends at the section frame. The visible views are drawn farthest along first.

Constructor & Destructor Documentation

◆ RndArena()

RndArena::RndArena ( const char * pszName)
explicit

Construct an empty track that loops every 1000 frames over no distance.

Parameters
pszNameThe registry key.
Ghidra address:
NTSC-U/C: 0x00249c18
Ghidra address:
PAL: 0x00252698

◆ ~RndArena()

RndArena::~RndArena ( )
override

Drop the references on the views.

Ghidra address:
NTSC-U/C: 0x00249660
Ghidra address:
PAL: 0x002520e0

Member Function Documentation

◆ operator new()

void * RndArena::operator new ( size_t nSize)
inline

Allocate a track, billed to the class name.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.

◆ operator delete()

void RndArena::operator delete ( void * pBlock)
inline

Release a track.

Parameters
pBlockThe block.

◆ SetFrameSelf()

int RndArena::SetFrameSelf ( float fFrame)
overridevirtual

Place and show the view of each section for the filtered frame, then sort the drawing order.

Parameters
fFrameThe filtered frame. The routine reads mFilteredFrame instead.
Returns
1, to pass the frame on to the children.
Ghidra address:
NTSC-U/C: 0x002493b8
Ghidra address:
PAL: 0x00251e38

Reimplemented from RndAnimatable.

◆ UpdateWorldXfm()

int RndArena::UpdateWorldXfm ( RndTransformable * pParent,
int bForce )
overridevirtual

Update the world transform, then that of every showing view.

Parameters
pParentThe parent, or null.
bForceNon-zero to update even an unchanged transform.
Returns
The result of the base update. The views receive it as their force flag.
Ghidra address:
NTSC-U/C: 0x002494b0
Ghidra address:
PAL: 0x00251f30

Reimplemented from RndTransformable.

◆ DrawShowing()

int RndArena::DrawShowing ( )
overridevirtual

Draw the views in the drawing order.

Returns
1, to draw the children.
Ghidra address:
NTSC-U/C: 0x00249550
Ghidra address:
PAL: 0x00251fd0

Reimplemented from RndDrawable.

◆ Collide() [1/2]

void RndArena::Collide ( const Segment & segment,
std::list< Collision > & collisions )
overridevirtual

Add what each showing view strikes to a list.

The children are not tested.

Parameters
segmentThe segment, in world space.
collisionsThe list to add to.
Ghidra address:
NTSC-U/C: 0x002495c8
Ghidra address:
PAL: 0x00252048

Reimplemented from RndCollideable.

◆ DumpText()

void RndArena::DumpText ( PrnStream & stream)
overridevirtual

Write a description of the track and its bases.

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

Reimplemented from RndAnimatable.

◆ Save()

void RndArena::Save ( BinStream & stream)
overridevirtual

Write the track and its bases.

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

Reimplemented from RndAnimatable.

◆ Replace()

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

Replace a view with another object.

A replacement that is not a view, or null, clears the section's view. A drawing order entry of the view is cleared.

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

Reimplemented from RndAnimatable.

◆ ClassName()

const char * RndArena::ClassName ( ) const
inlineoverridevirtual

Report the class name.

Returns
sClassName.
Ghidra address:
NTSC-U/C: 0x00394b88
Ghidra address:
PAL: 0x00403278

Implements RndObject.

◆ Copy()

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

Copy another track and its bases.

Parameters
pSourceThe track to copy from.
nFlagsThe set of fields to copy.
Ghidra address:
NTSC-U/C: 0x00248aa0
Ghidra address:
PAL: 0x00251540

Reimplemented from RndAnimatable.

◆ Load()

void RndArena::Load ( BinStream & stream)
overridevirtual

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

Version 1 adds the animatable base, version 2 the other bases, and version 5 mAnimateViews.

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

Reimplemented from RndAnimatable.

◆ New()

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

Create a track.

Parameters
pszNameThe registry key.
Returns
The track.
Ghidra address:
NTSC-U/C: 0x00394b98
Ghidra address:
PAL: 0x00403288

◆ ReleaseRefs()

void RndArena::ReleaseRefs ( )
protected

Drop the references on the views and empty the drawing order.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00248f80
Ghidra address:
PAL: 0x00251a00

◆ AcquireRefs()

void RndArena::AcquireRefs ( )
protected

Take a reference on each view and give the drawing order one entry per section.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00248ee8
Ghidra address:
PAL: 0x00251968

◆ UpdateSection()

void RndArena::UpdateSection ( Section & section)
protected

Place a section's view for the filtered frame and show it while the frame is in its window.

The name is inferred.

Parameters
sectionThe section.
Ghidra address:
NTSC-U/C: 0x00249198
Ghidra address:
PAL: 0x00251c18

◆ SetSectionLoop()

void RndArena::SetSectionLoop ( Section & section,
int nLoop )
protected

Move a teleporting section's view on by the loop distance for each loop between its loop and a new one, and record the new loop.

The name is inferred.

Parameters
sectionThe section.
nLoopThe new loop.
Ghidra address:
NTSC-U/C: 0x002492a8
Ghidra address:
PAL: 0x00251d28

◆ Collide() [2/2]

virtual void RndCollideable::Collide ( const Vector2 & point,
std::list< Collision > & collisions )
virtual

Test a screen point against the collideable and add what it strikes to a list.

The base body tests the children.

Parameters
pointThe screen point.
collisionsThe list to add to.
Ghidra address:
NTSC-U/C: 0x00222568
Ghidra address:
PAL: 0x0022b338

Reimplemented from RndCollideable.

Member Data Documentation

◆ sClassName

const char* RndArena::sClassName
static

The class name a .rnd file writes, Arena.

Ghidra address:
NTSC-U/C: 0x003b0a6c
Ghidra address:
PAL: 0x0042f904

◆ sRev

int RndArena::sRev
static

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

Ghidra address:
NTSC-U/C: 0x003b0a70

◆ sLoadRev

int RndArena::sLoadRev
static

The version Load() read last.

The section reader reads by this version.

Ghidra address:
NTSC-U/C: 0x0043c820

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