|
resonance 1.0.1
|
Owner of the art and sound assets the FreQ maker works from. More...
#include <metfreqmakerassetmanager.h>
Public Member Functions | |
| MetFreqMakerAssetManager () | |
| Start with no assets, no loaded templates, and two persona loaders. | |
| virtual | ~MetFreqMakerAssetManager () |
| Delete the two persona loaders. | |
| bool | PollLoad () |
| Advance the asset load by one step and report whether it has finished. | |
| void | WaitForLoad () |
| Block until PollLoad() reports the assets resident, running RndAsyncLoader::PollAsyncLoads() between attempts. | |
| std::vector< MetPersonaData * > * | GetIdentityList () |
| Resolve the list of prefabricated identities the FreQ maker offers. | |
| std::vector< MetPersonaData * > * | GetAllIdentities () |
| Resolve the full list of identities, the one at +0x74. | |
| void | StartIdentityLoads () |
| Queue the reads of both persona files. | |
| bool | AreIdentitiesLoaded () |
| Pump the asynchronous layer and report whether both persona files are parsed. | |
| bool | AreLoadersReady () |
| Report through both loaders whether the assets are resident. | |
| FreqPartTemplate * | GetPart (int nId) |
| Report the part template with one identifier. | |
| HxStr | NextMeshName () |
| Generate a fresh object name, autogen_obj_ followed by the value of a counter the call then advances. | |
| Rnd::Mesh * | CloneMesh (const HxStr &name) |
| Create a mesh under one name as a copy of the template mesh, in the default colour. | |
| void | ApplyPartScale (Rnd::Mesh *pMesh, FreqPartTemplate *pTemplate, float *pScaleX, float *pScaleZ, float flFactorX, float flFactorZ) |
| Scale a mesh to one part template. | |
| Color * | ColorAt (const Vector2 &position) |
| Report the colour at one position of the spectrum palette. | |
| Color * | SampleTexture (Rnd::Tex *pTex, float flU, float flV) |
| Read the colour of one texel of a texture. | |
| bool | PaintTexel (Rnd::Tex *pTex, const Color &color, float flU, float flV) |
| Write one colour into one texel of a texture. | |
| bool | ScaleMesh (Rnd::Mesh *pMesh, int nOrthonormalize, float flScaleX, float flScaleY, float flScaleZ) |
| Scale the three basis rows of a mesh's local transform. | |
| std::map< HxStr, FreqPartTemplate * > * | GetPartsByName () |
| Report the part templates by name, once PollLoad() has run and its result is discarded. | |
| FreqPartTemplate * | FindPart (const HxStr &name) |
| Report the part template registered under one name. | |
| std::list< FreqPartTemplate * > * | TemplatesInCategory (int nCategory) |
| Report the templates of one category. | |
| void | StartAssetLoad () |
| Create and queue the load of the FreQ maker asset file once. | |
| void | ReleaseParts () |
| Delete every part template and forget them, so the next PollLoad() reloads. | |
| std::list< Rnd::Object * > | GetLoadedObjects () |
| Report a copy of the objects the asset load produced, once PollLoad() has run and its result is discarded. | |
Static Public Member Functions | |
| static void | Create () |
| Allocate the one instance through CreateInstance(). | |
| static MetFreqMakerAssetManager * | shared () |
| Return the one instance through Instance(). | |
| static void | Destroy () |
| Delete the one instance through DestroyInstance(). | |
| static void | CreateInstance () |
| Allocate the one instance and record it for Instance(). | |
| static void | DestroyInstance () |
| Delete the one instance through its virtual destructor. | |
| static MetFreqMakerAssetManager * | Instance () |
| Return the one instance, or null before CreateInstance() has created it. | |
Static Public Attributes | |
| static constexpr int | kCategoryCount = 11 |
| The number of part categories, which count from 1. | |
Owner of the art and sound assets the FreQ maker works from.
Its RTTI descriptor is at 0x0086f7a8. It is a leaf class with no base. Following the g++ 2.x layout for a class with no base, the vptr sits after the data members at +0x80, and the object is 0x84 bytes. The two-entry vtable at 0x007f0908 makes the destructor the one virtual the class declares.
The manager loads MetaGame/persona/freq_maker_inventory_assets.rnd in the background. Once the load completes, PollLoad() builds one FreqPartTemplate for each part texture it produced, and the two MetFreqLoader objects read the pre-fab personas. The destructor deletes the two loaders and leaves the templates, the asset load, and the two prototypes in place.
The translation unit spans 0x0024f798 to 0x00255790.
The one instance is created by CreateInstance(), which allocates exactly 0x84 bytes, runs the constructor, and records the result in the global at 0x006a0f30 that Instance() reads. Creation and access are separate routines, so neither accessor constructs on first use.
The public Create(), shared(), and Destroy() are one-call forwarders defined at the start of the unit, and the bodies they reach are defined near its end. Every caller outside the unit goes through a forwarder except MetNullRenderer's constructor, which reads Instance() directly.
The titles shared(), PollLoad(), and WaitForLoad() are inferred, and so are the three body titles CreateInstance(), Instance(), and DestroyInstance(). No string in the image identifies any of them.
| MetFreqMakerAssetManager::MetFreqMakerAssetManager | ( | ) |
Start with no assets, no loaded templates, and two persona loaders.
The loaders read pers_PS2.dat and teamfreq_pers_PS2.dat under the pre-fab persona directory of GetFreqRoot() into mPrefabIdentities and mTeamFreqIdentities.
|
virtual |
Delete the two persona loaders.
The templates, the asset load, and the prototypes are not released.
|
static |
Allocate the one instance through CreateInstance().
MetRenderer's and MetNullRenderer's constructors are the callers. The title is inferred.
|
static |
Return the one instance through Instance().
Fifty call sites across ten classes reach the instance this way.
|
static |
Delete the one instance through DestroyInstance().
MetRenderer's and MetNullRenderer's destructors are the callers. The title is inferred.
|
static |
Allocate the one instance and record it for Instance().
Create() is the only caller.
|
static |
Delete the one instance through its virtual destructor.
The pointer Instance() reports is not cleared. Destroy() is the only caller.
|
static |
Return the one instance, or null before CreateInstance() has created it.
shared() and MetNullRenderer's constructor are the callers.
| bool MetFreqMakerAssetManager::PollLoad | ( | ) |
Advance the asset load by one step and report whether it has finished.
A completed load reports success without doing work. Otherwise the routine starts the asset load if needed, pumps the asynchronous loads, and returns false while the asset load is still running. On completion it resolves the prototype material and mesh, rebuilds the part templates from every loaded texture other than the spectrum, the burn prototype, the frame, and the four burn textures, numbers them in load order, marks the load complete, and starts the persona loads.
| void MetFreqMakerAssetManager::WaitForLoad | ( | ) |
Block until PollLoad() reports the assets resident, running RndAsyncLoader::PollAsyncLoads() between attempts.
| std::vector< MetPersonaData * > * MetFreqMakerAssetManager::GetIdentityList | ( | ) |
Resolve the list of prefabricated identities the FreQ maker offers.
The body waits for the load through WaitForLoad() and then spins on AreIdentitiesLoaded() before returning the team FreQ list when GlobalSettings::mTeamFreqUnlocked is set, and the pre-fab list otherwise. The title is inferred from the element type and from the one caller, MetLoadNewFreqScreen::AcquireIdentityList().
| std::vector< MetPersonaData * > * MetFreqMakerAssetManager::GetAllIdentities | ( | ) |
Resolve the full list of identities, the one at +0x74.
The body waits for the load through WaitForLoad() and spins on the same two asynchronous requests as GetIdentityList(), and then returns the +0x74 vector without a selector. The title is inferred from the one caller, CreditsRoll::Reset(), which searches every identity by name.
| void MetFreqMakerAssetManager::StartIdentityLoads | ( | ) |
Queue the reads of both persona files.
PollLoad() runs it. The title is inferred.
| bool MetFreqMakerAssetManager::AreIdentitiesLoaded | ( | ) |
Pump the asynchronous layer and report whether both persona files are parsed.
Both loaders are polled on every call. MetSonyScreen's slot 26 calls it, and GetIdentityList() and GetAllIdentities() expand the same body. The title is inferred.
| bool MetFreqMakerAssetManager::AreLoadersReady | ( | ) |
Report through both loaders whether the assets are resident.
The image has no caller. The title is inferred.
| FreqPartTemplate * MetFreqMakerAssetManager::GetPart | ( | int | nId | ) |
Report the part template with one identifier.
Runs PollLoad() first and discards its result. The identifier is not range-checked. The title is inferred.
| nId | The template identifier. |
| HxStr MetFreqMakerAssetManager::NextMeshName | ( | ) |
Generate a fresh object name, autogen_obj_ followed by the value of a counter the call then advances.
The title is inferred.
Create a mesh under one name as a copy of the template mesh, in the default colour.
Runs PollLoad() first and discards its result, creates the mesh through Rnd::Mesh::sNew, copies mMeshTemplate into it with no flags, and applies g_freqMakerDefaultColor. The title is inferred.
| name | The name of the new mesh. |
| void MetFreqMakerAssetManager::ApplyPartScale | ( | Rnd::Mesh * | pMesh, |
| FreqPartTemplate * | pTemplate, | ||
| float * | pScaleX, | ||
| float * | pScaleZ, | ||
| float | flFactorX, | ||
| float | flFactorZ ) |
Scale a mesh to one part template.
The template's x and z scales are converted from 1/128 units and reported through pScaleX and pScaleZ. The mesh's local basis is rebuilt as orthonormal around its y row, its x row is scaled by the x scale times flFactorX, its z row by the z scale times flFactorZ, and the mesh is marked dirty. The body does not read this object. The title is inferred.
| pMesh | The mesh to scale. |
| pTemplate | The template whose scale applies. |
| pScaleX | Receives the template's x scale. |
| pScaleZ | Receives the template's z scale. |
| flFactorX | The further factor on the x row. |
| flFactorZ | The further factor on the z row. |
Report the colour at one position of the spectrum palette.
The palette texture, g_spectrumTextureName, is resolved out of Rnd::TheManager on first use and kept in mPaletteTex. The title is inferred.
| position | The palette position, each coordinate from 0 to 1. |
Read the colour of one texel of a texture.
The coordinates are scaled by the texture's bitmap size, and the texel's three channels are converted from bytes to the unit range in a Color that every call shares, with an alpha of
| pTex | The texture. |
| flU | The horizontal coordinate, from 0 to 1. |
| flV | The vertical coordinate, from 0 to 1. |
| bool MetFreqMakerAssetManager::PaintTexel | ( | Rnd::Tex * | pTex, |
| const Color & | color, | ||
| float | flU, | ||
| float | flV ) |
Write one colour into one texel of a texture.
The colour's three channels are scaled to bytes, and the texel under the coordinates scaled by the texture's bitmap size is written. The body does not read this object, and the image has no caller. The title is inferred.
| pTex | The texture. |
| color | The colour. Its alpha is not written. |
| flU | The horizontal coordinate, from 0 to 1. |
| flV | The vertical coordinate, from 0 to 1. |
| bool MetFreqMakerAssetManager::ScaleMesh | ( | Rnd::Mesh * | pMesh, |
| int | nOrthonormalize, | ||
| float | flScaleX, | ||
| float | flScaleY, | ||
| float | flScaleZ ) |
Scale the three basis rows of a mesh's local transform.
With nOrthonormalize equal to 1 the basis is first rebuilt as orthonormal around its y row. The mesh is marked dirty. The body does not read this object, and the image has no caller. The title is inferred.
| pMesh | The mesh. |
| nOrthonormalize | 1 to rebuild the basis first. |
| flScaleX | The factor on the x row. |
| flScaleY | The factor on the y row. |
| flScaleZ | The factor on the z row. |
| std::map< HxStr, FreqPartTemplate * > * MetFreqMakerAssetManager::GetPartsByName | ( | ) |
Report the part templates by name, once PollLoad() has run and its result is discarded.
MetFreqMakerInventoryScreen's slot 38 is the one caller. The title is inferred.
| FreqPartTemplate * MetFreqMakerAssetManager::FindPart | ( | const HxStr & | name | ) |
Report the part template registered under one name.
Runs PollLoad() first and discards its result. The title is inferred.
| name | The template name. |
| std::list< FreqPartTemplate * > * MetFreqMakerAssetManager::TemplatesInCategory | ( | int | nCategory | ) |
Report the templates of one category.
A category outside 1 through 11 reports the list of category 11. The title is inferred.
| nCategory | The category. |
| void MetFreqMakerAssetManager::StartAssetLoad | ( | ) |
Create and queue the load of the FreQ maker asset file once.
Nothing happens once the load request exists. Otherwise the request for MetaGame/persona/freq_maker_inventory_assets.rnd is created with the index of the zone rndglobal as its priority and enqueued. MetRenderer's and MetNullRenderer's constructors and PollLoad() call it. The title is inferred.
| void MetFreqMakerAssetManager::ReleaseParts | ( | ) |
Delete every part template and forget them, so the next PollLoad() reloads.
Only the name map is emptied. The identifier vector and the category lists retain their pointers. The image has no caller. The title is inferred.
| std::list< Rnd::Object * > MetFreqMakerAssetManager::GetLoadedObjects | ( | ) |
Report a copy of the objects the asset load produced, once PollLoad() has run and its result is discarded.
The image has no caller, and PollLoad() expands the same copy. The title is inferred.
|
staticconstexpr |
The number of part categories, which count from 1.