resonance 1.0.1
Loading...
Searching...
No Matches
FreqAppearanceDetail Class Reference

Avatar an appearance stores apart from its username. More...

#include <freqappearancedetail.h>

Inheritance diagram for FreqAppearanceDetail:
Collaboration diagram for FreqAppearanceDetail:

Public Member Functions

 FreqAppearanceDetail ()
 Start with an empty part list and a fresh view named by the FreQ maker asset manager.
 FreqAppearanceDetail (const FreqAppearanceDetail &other)
 Build a fresh avatar and copy another one's parts in.
 ~FreqAppearanceDetail ()
 Discard every part and delete the view.
void save (OBStream &stream)
 Write the avatar to a stream.
void load (IBStream &stream)
 Append the parts save() wrote.
void clear ()
 Delete every part, empty the view, and reset the placement state.
void copyFrom (const FreqAppearanceDetail &other)
 Append a copy of each of another avatar's parts, in the other view's draw order.
std::list< FreqPart * > & parts ()
 Report the parts the avatar is built from.
void pack (FreqPart::Packed *pOut, int *pCount)
 Pack every part into consecutive 8-byte records.
void unpack (const FreqPart::Packed *pRecords, int nCount)
 Append parts unpacked from consecutive 8-byte records.
void ensureCursorMesh ()
 Create the preview mesh if there is none, hanging it from mView, and clear three placement words.
void resetCursor ()
 Hide the preview mesh at the origin with no material and return the placement state to its unset values.
void selectTemplate (const HxStr &name)
 Start placing a new part of one template.
void placeCursor ()
 Place the previewed part, or stop editing the selected one.
void nudgeCursor (int nStepX, int nStepZ)
 Move the cursor one unit, moving the preview mesh or the selected part along with it.
FreqPart * selectPart (int nIndex)
 Start editing one part, retaining a copy to revert to.
void deletePart (int nIndex)
 Reset the placement state and delete one part.
void revertSelection ()
 Restore the selected part's colour, mirroring, draw position, and placement from the copy selectPart() retained, and drop the selection.
void randomize ()
 Give each part that may be randomised a random change.
void recentrePart (int nIndex)
 Move one part and the cursor to the origin and bring the part to the front.
void sendBackward ()
 Move the previewed or selected mesh one step earlier in the draw order.
void bringForward ()
 Move the previewed or selected mesh one step later in the draw order.
int drawIndexOf (FreqPart *pPart)
 Report where a part's mesh sits in the view's draw order.
void toggleMirror ()
 Mirror the previewed or selected part.
void setColor (const Color &color, const Vector2 &palettePosition)
 Record the current colour and apply it to the previewed or selected part.
void attachTo (Rnd::View *pParent)
 Hang mView from a parent view.
void detachFrom (Rnd::View *pParent)
 Unhang mView from a parent view.
Public Member Functions inherited from FreqMakerCursor
 FreqMakerCursor ()
 Start with no template selected, an unset scale, and the FreQ maker default colour.
 ~FreqMakerCursor ()
 Delete the preview mesh.
void deselect ()
 Forget the selected part without restoring it.

Public Attributes

Rnd::View * mView
 The avatar view the constructor allocates, 0x120 bytes.

Additional Inherited Members

Protected Attributes inherited from FreqMakerCursor
int mCursorX
int mCursorZ
unsigned char mColorAlignment [0x8]
Color mColor
FreqPart * mSelected
unsigned char mBackupAlignment [0xc]
FreqPart mSelectedBackup
int mSelectedDrawIndex
FreqPartTemplate * mTemplate
int mPlacing
float mScaleX
float mScaleZ
int mScaleStepX
int mScaleStepZ
int mCursorMirrored
Vector2 mPalettePosition
Rnd::Mesh * mCursorMesh

Detailed Description

Avatar an appearance stores apart from its username.

The class is not polymorphic and emits no RTTI descriptor, so no accessor and no vtable names it. Nor does the lever of last resort reach it. FreqAppearance's copy constructor takes its 0xb0 bytes from the untagged allocator at 0x004a81e0, which passes no class name, and the two tagged allocations inside its own constructor are billed to stl_list and to Rnd::View. The title here is inferred from its one owner and from the diagnostic literal Freq= that FreqAppearance::Print writes where this object would appear.

The object is 0xb0 bytes. FreqMakerCursor is its non-virtual base at +0x00 through +0x9f, the part list is at +0xa0, and the view every part mesh hangs from is at +0xa4. Besides FreqAppearance, MetFreqMakerCanvasScreen edits the avatar through this class.

The translation unit spans 0x00249b48 to 0x0024f798.

No identifier here is attested by the image, so every member takes the required style rather than the CamelCase the classes around it use. That divergence is deliberate.

Constructor & Destructor Documentation

◆ FreqAppearanceDetail() [1/2]

FreqAppearanceDetail::FreqAppearanceDetail ( )

Start with an empty part list and a fresh view named by the FreQ maker asset manager.

Ghidra address:
NTSC-U/C: 0x00249c40
Ghidra address:
PAL: 0x0025ef88

◆ FreqAppearanceDetail() [2/2]

FreqAppearanceDetail::FreqAppearanceDetail ( const FreqAppearanceDetail & other)

Build a fresh avatar and copy another one's parts in.

The image has no caller.

Parameters
otherThe avatar to copy.
Ghidra address:
NTSC-U/C: 0x00249e58
Ghidra address:
PAL: 0x0025f1c0

◆ ~FreqAppearanceDetail()

FreqAppearanceDetail::~FreqAppearanceDetail ( )

Discard every part and delete the view.

The destructor is not virtual. FreqAppearance's own destructor releases this object through a direct call rather than through a table.

Ghidra address:
NTSC-U/C: 0x0024edc8
Ghidra address:
PAL: 0x002641f0

Member Function Documentation

◆ save()

void FreqAppearanceDetail::save ( OBStream & stream)

Write the avatar to a stream.

The part count comes first. Each part follows as its template name (a length word and the bytes), its palette x and y, its mirrored flag as one byte, and its placement x and z.

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

◆ load()

void FreqAppearanceDetail::load ( IBStream & stream)

Append the parts save() wrote.

Each part is rebuilt from its template name as unpack() rebuilds a packed part. The name is also looked up in Rnd::TheManager as a texture, and that result is discarded.

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

◆ clear()

void FreqAppearanceDetail::clear ( )

Delete every part, empty the view, and reset the placement state.

The destructor runs this before releasing the view, and FreqAppearance::operator=() runs it before copying the source in. The name is inferred from those two uses.

Ghidra address:
NTSC-U/C: 0x0024a4b0
Ghidra address:
PAL: 0x0025f838

◆ copyFrom()

void FreqAppearanceDetail::copyFrom ( const FreqAppearanceDetail & other)

Append a copy of each of another avatar's parts, in the other view's draw order.

The other avatar's parts are first indexed by mesh in a local std::map, and each drawable of the other view other than its preview mesh is then looked up and copied. The routine does not clear first, so FreqAppearance::operator=() pairs it with clear(). The name is inferred from that pairing.

Parameters
otherThe avatar to copy.
Ghidra address:
NTSC-U/C: 0x0024a088
Ghidra address:
PAL: 0x0025f410

◆ parts()

std::list< FreqPart * > & FreqAppearanceDetail::parts ( )
inline

Report the parts the avatar is built from.

Defined in the header. The out-of-line copy is called by FreqAppearance::RenderBurnTextures() and by the routine at 0x00262270.

Returns
The part list.
Ghidra address:
NTSC-U/C: 0x0024f230
Ghidra address:
PAL: 0x00264658

◆ pack()

void FreqAppearanceDetail::pack ( FreqPart::Packed * pOut,
int * pCount )

Pack every part into consecutive 8-byte records.

The part list is also counted a second time and that count is discarded. FreqAppearance::Pack() is the one caller.

Parameters
pOutThe first record to write.
pCountReceives the number of parts written.
Ghidra address:
NTSC-U/C: 0x0024c398
Ghidra address:
PAL: 0x00261798

◆ unpack()

void FreqAppearanceDetail::unpack ( const FreqPart::Packed * pRecords,
int nCount )

Append parts unpacked from consecutive 8-byte records.

For each record the body allocates a FreqPart, unpacks it, clones a mesh for it with the template's material and scale, places the mesh at the part's position raised to a height of 0.1, hangs it from mView, mirrors it when the part is mirrored, colours the part from the palette, records the scale steps, appends the part, and resets the placement state. FreqAppearance::Unpack() is the one caller.

Parameters
pRecordsThe first record to read.
nCountThe number of records.
Ghidra address:
NTSC-U/C: 0x0024b898
Ghidra address:
PAL: 0x00260c78

◆ ensureCursorMesh()

void FreqAppearanceDetail::ensureCursorMesh ( )

Create the preview mesh if there is none, hanging it from mView, and clear three placement words.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x00249b48
Ghidra address:
PAL: 0x0025ee70

◆ resetCursor()

void FreqAppearanceDetail::resetCursor ( )

Hide the preview mesh at the origin with no material and return the placement state to its unset values.

unpack() expands the same body. The title is inferred.

Ghidra address:
NTSC-U/C: 0x0024ee60
Ghidra address:
PAL: 0x00264288

◆ selectTemplate()

void FreqAppearanceDetail::selectTemplate ( const HxStr & name)

Start placing a new part of one template.

The placement state is reset, and with fewer than 16 parts the named template is shown on the preview mesh with its material, scale, and the current colour, and the preview mesh is moved to the end of the view's lists. The title is inferred.

Parameters
nameThe template name.
Ghidra address:
NTSC-U/C: 0x0024a5f0
Ghidra address:
PAL: 0x0025f978

◆ placeCursor()

void FreqAppearanceDetail::placeCursor ( )

Place the previewed part, or stop editing the selected one.

While placing, a copy of the preview mesh becomes a new part at the cursor, drawn just before the preview mesh, with the current colour and mirroring, and the placement state is reset. While editing, the selection is dropped and placing resumes. The title is inferred.

Ghidra address:
NTSC-U/C: 0x0024a770
Ghidra address:
PAL: 0x0025faf8

◆ nudgeCursor()

void FreqAppearanceDetail::nudgeCursor ( int nStepX,
int nStepZ )

Move the cursor one unit, moving the preview mesh or the selected part along with it.

Each axis moves only while the part's edges stay inside -55 to 55, and a part of category 1 does not rise above zero. Nothing moves while placing with 16 parts. The title is inferred.

Parameters
nStepX-1, 0, or 1 along x.
nStepZ-1, 0, or 1 along z.
Ghidra address:
NTSC-U/C: 0x0024a9e8
Ghidra address:
PAL: 0x0025fd90

◆ selectPart()

FreqPart * FreqAppearanceDetail::selectPart ( int nIndex)

Start editing one part, retaining a copy to revert to.

The title is inferred.

Parameters
nIndexThe part's position in the part list.
Returns
The part, or null for an index outside the list.
Ghidra address:
NTSC-U/C: 0x0024ae20
Ghidra address:
PAL: 0x002601c8

◆ deletePart()

void FreqAppearanceDetail::deletePart ( int nIndex)

Reset the placement state and delete one part.

The title is inferred.

Parameters
nIndexThe part's position in the part list. An index outside the list deletes nothing.
Ghidra address:
NTSC-U/C: 0x0024bc50
Ghidra address:
PAL: 0x00261050

◆ revertSelection()

void FreqAppearanceDetail::revertSelection ( )

Restore the selected part's colour, mirroring, draw position, and placement from the copy selectPart() retained, and drop the selection.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x0024be00
Ghidra address:
PAL: 0x00261200

◆ randomize()

void FreqAppearanceDetail::randomize ( )

Give each part that may be randomised a random change.

With a chance of a third a part takes a random palette colour, and with another third a random template of its category, unless the category is 1, 2, or 8. The title is inferred.

Ghidra address:
NTSC-U/C: 0x0024bfc8
Ghidra address:
PAL: 0x002613c8

◆ recentrePart()

void FreqAppearanceDetail::recentrePart ( int nIndex)

Move one part and the cursor to the origin and bring the part to the front.

The title is inferred.

Parameters
nIndexThe part's position in the part list.
Ghidra address:
NTSC-U/C: 0x0024c218
Ghidra address:
PAL: 0x00261618

◆ sendBackward()

void FreqAppearanceDetail::sendBackward ( )

Move the previewed or selected mesh one step earlier in the draw order.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x0024ef08
Ghidra address:
PAL: 0x00264330

◆ bringForward()

void FreqAppearanceDetail::bringForward ( )

Move the previewed or selected mesh one step later in the draw order.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x0024ef80
Ghidra address:
PAL: 0x002643a8

◆ drawIndexOf()

int FreqAppearanceDetail::drawIndexOf ( FreqPart * pPart)

Report where a part's mesh sits in the view's draw order.

revertSelection() and selectPart() expand the same body. The out-of-line copy has no caller. The title is inferred.

Parameters
pPartThe part.
Returns
The position, or the number of drawables when the mesh is not drawn.
Ghidra address:
NTSC-U/C: 0x0024eff8
Ghidra address:
PAL: 0x00264420

◆ toggleMirror()

void FreqAppearanceDetail::toggleMirror ( )

Mirror the previewed or selected part.

The title is inferred.

Ghidra address:
NTSC-U/C: 0x0024f060
Ghidra address:
PAL: 0x00264488

◆ setColor()

void FreqAppearanceDetail::setColor ( const Color & color,
const Vector2 & palettePosition )

Record the current colour and apply it to the previewed or selected part.

The title is inferred.

Parameters
colorThe colour.
palettePositionThe palette position the colour came from.
Ghidra address:
NTSC-U/C: 0x0024f178
Ghidra address:
PAL: 0x002645a0

◆ attachTo()

void FreqAppearanceDetail::attachTo ( Rnd::View * pParent)

Hang mView from a parent view.

The title is inferred.

Parameters
pParentThe parent view.
Ghidra address:
NTSC-U/C: 0x0024f238
Ghidra address:
PAL: 0x00264660

◆ detachFrom()

void FreqAppearanceDetail::detachFrom ( Rnd::View * pParent)

Unhang mView from a parent view.

The title is inferred.

Parameters
pParentThe parent view.
Ghidra address:
NTSC-U/C: 0x0024f290
Ghidra address:
PAL: 0x002646b8

Member Data Documentation

◆ mView

Rnd::View* FreqAppearanceDetail::mView

The avatar view the constructor allocates, 0x120 bytes.

+0xa4

Public because FreqAppearance::AttachToBurnSlot() reads it directly, and the image has no accessor for it.


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