resonance 1.0.1
Loading...
Searching...
No Matches
freqappearance.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4
6#include "game/freqpart.h"
7#include "os/hxstr.h"
8#include "stream/ibstream.h"
9#include "stream/obstream.h"
10
11namespace Rnd {
12class Tex;
13}
14
40public:
42 static constexpr int kRecordNameLength = 12;
43
45 static constexpr int kRecordPartCapacity = 16;
46
60
72
86
93 virtual ~FreqAppearance();
94
104 virtual void Save(OBStream &stream) const;
105
116 virtual void Load(IBStream &stream);
117
131 void Print(std::ostream &stream) const;
132
143 void operator=(const FreqAppearance &other);
144
159 void AttachToBurnSlot(int nSlot);
160
171 static void InitBurnSlots();
172
186 static void RenderBurnTextures();
187
201 static Rnd::Tex *FindPersonaBurnTexture(int nIndex);
202
212 void CopyFrom(const FreqAppearance &other);
213
225 void Pack(Record *pRecord);
226
237 void Unpack(const Record &record);
238
252 static HxStr EncodeRecord(const Record &record);
253
267 static void DecodeRecord(const HxStr &encoded, Record *pRecord);
268
279 void SetSkillStatus(int nStatus) {
280 mSkillStatus = nStatus;
281 }
282
293 int GetSkillStatus() const {
294 return mSkillStatus;
295 }
296
305
313
314private:
324 static void EncodeNonZeroBytes(const unsigned char *pSource, unsigned char *pDest);
325
326 int mSkillStatus; // +0x0c
327};
Avatar an appearance stores apart from its username.
Definition freqappearancedetail.h:36
static constexpr int kRecordNameLength
The longest username a Record stores, without its terminator.
Definition freqappearance.h:42
FreqAppearanceDetail * mDetail
The avatar, owned, 0xb0 bytes.
Definition freqappearance.h:312
static Rnd::Tex * FindPersonaBurnTexture(int nIndex)
Resolve one numbered persona burn texture out of the render manager.
void Pack(Record *pRecord)
Fill a compact record from this appearance.
void SetSkillStatus(int nStatus)
Record the skill status.
Definition freqappearance.h:279
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.
static constexpr int kRecordPartCapacity
The number of packed parts a Record has room for.
Definition freqappearance.h:45
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 CopyFrom(const FreqAppearance &other)
Copy another appearance through operator=().
void AttachToBurnSlot(int nSlot)
Hang this appearance's avatar view in one of the four persona burn slots and show it.
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.
FreqAppearance(const FreqAppearance &other)
Copy another appearance.
FreqAppearance()
Construct the appearance a new player starts with.
void Unpack(const Record &record)
Replace this appearance from a compact record.
HxStr mUserName
Player username, starting as the literal initial name.
Definition freqappearance.h:304
int GetSkillStatus() const
Report the skill status.
Definition freqappearance.h:293
virtual ~FreqAppearance()
Release the detail object.
virtual void Save(OBStream &stream) const
Write the appearance to a stream.
void operator=(const FreqAppearance &other)
Replace the username and the detail object with another appearance's.
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Input half of the byte stream interface.
Definition ibstream.h:36
Output half of the byte stream interface.
Definition obstream.h:25
Texture, as a bitmap path plus the load state of its mip levels.
Definition tex.h:43
The rendering engine.
Definition animhelper.h:3
Compact form of an appearance that Pack() fills and Unpack() reads.
Definition freqappearance.h:53
bool mValid
Definition freqappearance.h:54
int mPartCount
Definition freqappearance.h:57
unsigned char mSkillStatus
Definition freqappearance.h:56
char mName[kRecordNameLength+1]
Definition freqappearance.h:55
FreqPart::Packed mParts[kRecordPartCapacity]
Definition freqappearance.h:58
Eight-byte transfer form of a part that Pack() writes and Unpack() reads.
Definition freqpart.h:32