|
resonance 1.0.1
|
Appearance of a player's avatar. More...
#include <freqappearance.h>

Classes | |
| struct | Record |
| Compact form of an appearance that Pack() fills and Unpack() reads. More... | |
Public Member Functions | |
| FreqAppearance () | |
| Construct the appearance a new player starts with. | |
| FreqAppearance (const FreqAppearance &other) | |
| Copy another appearance. | |
| virtual | ~FreqAppearance () |
| Release the detail object. | |
| virtual void | Save (OBStream &stream) const |
| Write the appearance to a stream. | |
| virtual void | Load (IBStream &stream) |
| Read the appearance back from a stream. | |
| void | Print (std::ostream &stream) const |
| Write the username and the skill status to a diagnostic stream. | |
| void | operator= (const FreqAppearance &other) |
| Replace the username and the detail object with another appearance's. | |
| void | AttachToBurnSlot (int nSlot) |
| Hang this appearance's avatar view in one of the four persona burn slots and show it. | |
| void | CopyFrom (const FreqAppearance &other) |
| Copy another appearance through operator=(). | |
| void | Pack (Record *pRecord) |
| Fill a compact record from this appearance. | |
| void | Unpack (const Record &record) |
| Replace this appearance from a compact record. | |
| void | SetSkillStatus (int nStatus) |
| Record the skill status. | |
| int | GetSkillStatus () const |
| Report the skill status. | |
Static Public Member Functions | |
| static void | InitBurnSlots () |
| Resolve the four burn cameras and hangpoint views once. | |
| static void | RenderBurnTextures () |
| Render each shown burn camera into its slot's persona burn texture. | |
| static Rnd::Tex * | FindPersonaBurnTexture (int nIndex) |
| Resolve one numbered persona burn texture out of the render manager. | |
| static HxStr | EncodeRecord (const Record &record) |
| Encode a compact record as a 256-character string with no zero bytes. | |
| static void | DecodeRecord (const HxStr &encoded, Record *pRecord) |
| Decode a string EncodeRecord() wrote back into a compact record. | |
Public Attributes | |
| HxStr | mUserName |
| Player username, starting as the literal initial name. | |
| FreqAppearanceDetail * | mDetail |
| The avatar, owned, 0xb0 bytes. | |
Static Public Attributes | |
| static constexpr int | kRecordNameLength = 12 |
| The longest username a Record stores, without its terminator. | |
| static constexpr int | kRecordPartCapacity = 16 |
| The number of packed parts a Record has room for. | |
Appearance of a player's avatar.
Its RTTI descriptor is at 0x0086f580. It has no base. The compiler places the vptr after the data at +0x10, and the class is 0x14 bytes. Its vtable at 0x007d98a0 has four entries and a zero terminator at index 4, the type function, the destructor, and the two transfer members.
The purpose of two of the three members is recovered from the diagnostic literals Print() writes. username= precedes the string at +0x00, so that member is the player username, and SkillStatus= precedes the word at +0x0c. The detail object at +0x08 sits behind Freq=. Both literals are display labels rather than identifiers, and they disagree with each other on capitalisation, so neither is treated as an attested member name and both members retain their recovered-purpose-pending spelling.
The layout comes from the copy constructor and the destructor together. The copy constructor takes 0xb0 bytes from the allocator for the detail object and stores the pointer at +0x08, and the destructor releases the detail object and the string buffer. The username and the detail object are public for the readers their documentation lists, and the skill status is private.
PSJoinRequestPacket::saveGuts() and PlayerInfo::Save() both delegate an embedded FreqAppearance to slot 2 of this table, and PSJoinRequestPacket::restoreGuts() and PlayerInfo::Load() delegate it to slot 3, which is what establishes the two slots as the transfer pair rather than inferring the roles from this class alone.
| FreqAppearance::FreqAppearance | ( | ) |
Construct the appearance a new player starts with.
The username starts as the literal initial name, a fresh 0xb0-byte detail object is allocated, and the skill status is cleared. PSJoinRequestPacket, SPJoinAcceptPacket, and PlayerInfo reach it through their own constructors.
| FreqAppearance::FreqAppearance | ( | const FreqAppearance & | other | ) |
Copy another appearance.
The three members are initialised first and the assignment below then replaces the string and the detail object. The initial username and the cleared skill status therefore both survive into the copy only for as long as the assignment takes, and because the assignment does not touch the skill status, a copy always reports a skill status of zero.
| other | The appearance to copy. |
|
virtual |
Release the detail object.
|
virtual |
Write the appearance to a stream.
Slot 2. A version word of 8 precedes the payload.
| stream | The stream to write to. |
|
virtual |
Read the appearance back from a stream.
Slot 3. The version word Save() writes is read and discarded, so no version older than the current one is handled differently.
| stream | The stream to read from. |
| void FreqAppearance::Print | ( | std::ostream & | stream | ) | const |
Write the username and the skill status to a diagnostic stream.
The two literals Freq= and SkillStatus= arrive back to back with no value between them, so the detail object is never written.
The member is not virtual and occupies no table slot. PlayerInfo::Print() runs it on its embedded appearance.
| stream | The stream to write to. |
| void FreqAppearance::operator= | ( | const FreqAppearance & | other | ) |
Replace the username and the detail object with another appearance's.
Self-assignment is tested first and does nothing. The skill status is not copied, and the routine returns nothing.
| other | The appearance to copy. |
| void FreqAppearance::AttachToBurnSlot | ( | int | nSlot | ) |
Hang this appearance's avatar view in one of the four persona burn slots and show it.
Runs InitBurnSlots() first and records the detail object as the slot's occupant. The slot's hangpoint view (<slot>_freq_hangpoint.view) then loses its draws and transforms, takes the avatar view as its one child for both, recomposes the avatar's world transform under it, and is shown with everything beneath it. The slot's camera (persona_texburn_<slot + 1>.cam) is shown last. MetPersonaData::AttachToBurnSlot() and the routines at 0x003455a8 and 0x0035abf8 call it, and the name is inferred.
| nSlot | The burn slot, 0 through 3. |
|
static |
Resolve the four burn cameras and hangpoint views once.
Does nothing after the first call. Otherwise it polls the FreQ maker asset load once, sizes both lists to four, resolves each camera and hides it, and resolves each hangpoint view and shows it. The name is inferred.
|
static |
Render each shown burn camera into its slot's persona burn texture.
Does nothing before InitBurnSlots() has run. For each slot whose camera is shown, the camera recomposes its world transform and draws twice around a GS path sync, and the camera's render target is read back and quantised into the slot's burn texture with one ramp for each part colour of the avatar hung in that slot. The burn texture's palette is then reset, and the camera is hidden. MetRenderer::DrawFrontEnd() is the one caller, and the name is inferred.
|
static |
Resolve one numbered persona burn texture out of the render manager.
The name is formatted as persona_texburn_texture_d.tex from one past the index, so index zero resolves persona_texburn_texture_1.tex. A name the manager does not recognise produces a null result, as does an object that is not a Rnd::Tex. RenderBurnTextures() expands it inline. The name is inferred.
| nIndex | Zero-based texture index. |
| void FreqAppearance::CopyFrom | ( | const FreqAppearance & | other | ) |
Copy another appearance through operator=().
The image has no caller. The name is inferred.
| other | The appearance to copy. |
| void FreqAppearance::Pack | ( | Record * | pRecord | ) |
Fill a compact record from this appearance.
The record is marked valid and takes the skill status, the username cut to 12 characters, and the packed parts of the detail object. Only the low byte of the part count survives. The image has no caller, and the name is inferred.
| pRecord | The record to fill. |
| void FreqAppearance::Unpack | ( | const Record & | record | ) |
Replace this appearance from a compact record.
A record that is not marked valid changes nothing. The image has no caller, and the name is inferred.
| record | The record to read. |
Encode a compact record as a 256-character string with no zero bytes.
The record is split into 32 groups of seven bytes, zero padded, and each group becomes eight bytes through EncodeNonZeroBytes(). The encoded buffer has no terminator, and the last group's fill runs seven bytes past the buffer. The string therefore ends at the next zero byte on the stack. The image has no caller, and the name is inferred.
| record | The record to encode. |
Decode a string EncodeRecord() wrote back into a compact record.
The string is copied over 256 bytes of 1 with no length check, and the first seven bytes of each eight-byte group are kept with each 1 turned back into zero. The mask byte is ignored, and a zero EncodeRecord() wrote as 0xff therefore decodes as 0xff. The image has no caller, and the name is inferred.
| encoded | The encoded string. |
| pRecord | The record to fill. |
|
inline |
Record the skill status.
Defined in the header. The one out-of-line copy is never called, and MetPersonaData::UpdateSkillStatus() expands the store where it is used.
| nStatus | The status, 0 through 4. |
|
inline |
Report the skill status.
Defined in the header. The out-of-line copy's one caller is the uncalled MetPersonaData forwarder at 0x0032e258.
|
staticconstexpr |
The longest username a Record stores, without its terminator.
|
staticconstexpr |
The number of packed parts a Record has room for.
| HxStr FreqAppearance::mUserName |
Player username, starting as the literal initial name.
Public rather than private, because MetLoadFreqBaseScreen::UpdateNameLabel() copy-constructs an HxStr straight from +0x00 of the embedded appearance and the image has no accessor to route that read through. A friend declaration fits the image equally well. +0x00
| FreqAppearanceDetail* FreqAppearance::mDetail |
The avatar, owned, 0xb0 bytes.
+0x08
Public because MetFreqMakerCanvasScreen::CommitPersona(), LoadPersona(), and LoadPrefab() copy the avatar in and out of it directly, and the image has no accessor.