resonance 1.0.1
Loading...
Searching...
No Matches
Rnd::PsMultiMesh Class Reference

PlayStation 2 multi-mesh, which submits one GIF packet run per instance. More...

#include <psmultimesh.h>

Inheritance diagram for Rnd::PsMultiMesh:
Collaboration diagram for Rnd::PsMultiMesh:

Public Member Functions

 PsMultiMesh (const HxStr &name)
 Construct an empty PlayStation 2 multi-mesh.
virtual ~PsMultiMesh ()
Public Member Functions inherited from Rnd::MultiMesh
 MultiMesh (const HxStr &name)
 Construct an empty multi-mesh.
virtual ~MultiMesh ()
virtual void DumpText (Dbg &sink)
 Write the multi-mesh to the engine text sink.
virtual void Save (Stream &stream)
 Serialise the multi-mesh.
virtual void Replace (Object *pFrom, Object *pTo)
 Replace one object reference with another.
virtual const HxStr & ClassName () const
 Return the registered class name, "MultiMesh".
virtual void Copy (const Object *pSource, unsigned nFlags)
 Copy another multi-mesh over this one.
virtual void Load (Stream &stream)
 Load the multi-mesh.
void AcquireMeshRef ()
 Take a reference on the instanced mesh.
void ReleaseMeshRef ()
 Release the reference on the instanced mesh.
std::list< Transform > & GetTransforms ()
 Report the instance transforms.
Mesh * GetMesh () const
 Report the mesh every instance draws.
Transform & GetTransform (int nIndex)
 Report one instance transform by position.
void RemoveTransform (int nIndex)
 Remove one instance by position.
void SetMesh (Mesh *pMesh)
 Replace the mesh every instance draws, moving this object's reference to the new mesh.
Public Member Functions inherited from Rnd::Drawable
 Drawable ()
 Construct a visible drawable with no children.
virtual ~Drawable ()
 Drop this object's references on its children.
void Draw ()
 Draw this object followed by each of its children.
Drawable * Parent ()
 Report the drawable that draws this one.
void AddDraw (Drawable *pDraw, Drawable *pBefore)
 Insert pDraw into mDraws in front of pBefore.
void AddDraw (Drawable *pDraw)
 Insert pDraw at the front of mDraws.
void RemoveDraw (Drawable *pDraw)
 Erase pDraw from mDraws.
void RemoveAllDraws ()
 Empty mDraws, dropping this object's reference on every entry.
void MoveDraw (Drawable *pDraw, int nSteps)
 Move pDraw nSteps places later in mDraws, or earlier for a negative count.
virtual void SetShowing (int nShowing)
 Set whether this object draws at all.
void SetShowingRecursive (int nShowing)
 Set whether this object and every drawable beneath it in mDraws draw at all.
virtual void SetHighlight (int nHighlight)
 Set whether this object draws with its highlight treatment.
int GetHighlight () const
 Report the highlight flag.
int GetShowing () const
 Report the showing flag.
std::list< Drawable * > & GetDraws ()
 Report the child list.
Public Member Functions inherited from Rnd::Object
 Object ()
 Construct an unnamed object.
 Object (const HxStr &name)
 Construct an object and register it under name.
virtual ~Object ()
 Erase the registry entry and release the name buffer.
void SetName (const HxStr &name)
 Re-register this object under a different name.
void AddRef (Object *pReferrer)
 Register pReferrer as a store of a pointer to this object.
void RemoveRef (Object *pReferrer)
 Drop one registration made by AddRef().

Protected Member Functions

virtual int DrawShowing ()
 Draw every instance through the vector unit path.
void SubmitInstanceGifPackets ()
 Submit the GIF packets for every instance of the current material pass.
Protected Member Functions inherited from Rnd::Drawable
void ReleaseDrawsRefs ()
 Drop this object's reference on every mDraws entry without emptying the list.
Protected Member Functions inherited from Rnd::Object
void ReleaseAllRefs ()
 Tell every referrer to drop its pointer to this object.

Additional Inherited Members

Public Types inherited from Rnd::MultiMesh
enum  { kSerialVersion = 0 }
 Serial version this build writes, and the highest version it loads. More...
Static Public Member Functions inherited from Rnd::Drawable
static Drawable * Find (const HxStr &name)
 Resolve a registry key to a drawable.
Public Attributes inherited from Rnd::Drawable
int mShowing
Public Attributes inherited from Rnd::Object
HxStr mName
int mInternal
Protected Attributes inherited from Rnd::MultiMesh
Mesh * mMesh
std::list< Transform > mTransforms
Protected Attributes inherited from Rnd::Object
std::list< Object * > mRefs

Detailed Description

PlayStation 2 multi-mesh, which submits one GIF packet run per instance.

Its RTTI descriptor is at 0x008ef490. It has Rnd::MultiMesh as its one public base at offset

  1. The class does not declare a data member. It is the same 0x38 bytes the base occupies, and the creator at 0x005b5c28 allocates exactly that. Its two vtables at 0x00833d80 and 0x00833dc8 differ from the Rnd::MultiMesh pair only in the type info accessor, the destructor, and DrawShowing().

Constructor & Destructor Documentation

◆ PsMultiMesh()

Rnd::PsMultiMesh::PsMultiMesh ( const HxStr & name)

Construct an empty PlayStation 2 multi-mesh.

The body is empty beyond the base construction. Rnd::NewPsMultiMesh() is the only construction site.

Parameters
nameThe object name, passed to the Rnd::Object constructor.
Ghidra address:
NTSC-U/C: 0x005b2fd8
Ghidra address:
PAL: 0x005f55c0

◆ ~PsMultiMesh()

virtual Rnd::PsMultiMesh::~PsMultiMesh ( )
virtual
Ghidra address:
NTSC-U/C: 0x005b5a40
Ghidra address:
PAL: 0x005f8090

Member Function Documentation

◆ DrawShowing()

virtual int Rnd::PsMultiMesh::DrawShowing ( )
protectedvirtual

Draw every instance through the vector unit path.

Rnd::Drawable vtable slot 3. Falls back on Rnd::MultiMesh::DrawShowing() while the device submits geometry through the software path. An empty transform list, an absent mesh, and a mesh with no faces all yield without drawing. Otherwise the material passes run in a loop, each one selecting the depth registers and the material and then submitting the whole instance run.

Returns
Non-zero, always, so the children are drawn as well.
Ghidra address:
NTSC-U/C: 0x005b2ed0
Ghidra address:
PAL: 0x005f54b8

Reimplemented from Rnd::MultiMesh.

◆ SubmitInstanceGifPackets()

void Rnd::PsMultiMesh::SubmitInstanceGifPackets ( )
protected

Submit the GIF packets for every instance of the current material pass.

Adds the instance count times the face count to the triangle statistic, closes the open GIF tag, sends the mesh's face run through Rnd::PsMesh::EmitMultiMeshFaceRun(), and then sends the transforms in batches. Each batch holds as many transforms as fit in the VU1 data memory the face run leaves, unpacked behind a count quadword. The first batch calls the instanced microprogram and every later one continues it.

Ghidra address:
NTSC-U/C: 0x005b2c60
Ghidra address:
PAL: 0x005f5248

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