wavelength 1.0.0
Loading...
Searching...
No Matches
RndManager::ResourceLoader Class Reference

Read of one resource file into memory, shared by every reference to the file. More...

#include <rndmanager.h>

Public Member Functions

 ResourceLoader (std::unique_ptr< File > pFile, const char *pszTag)
 Start reading a file.
 ~ResourceLoader ()
 Release the buffer and the file.
bool Poll ()
 Finish the read when the file reports it complete.
int GetData (void **ppData, int *pnSize)
 Wait for the data and hand it out, dropping one reference.
void AddRef ()
 Take one more reference, for one more GetData().

Detailed Description

Read of one resource file into memory, shared by every reference to the file.

The RTTI includes the nested class name. A compressed file is read to the end of the buffer and inflated forward over it once the read completes.

Constructor & Destructor Documentation

◆ ResourceLoader()

RndManager::ResourceLoader::ResourceLoader ( std::unique_ptr< File > pFile,
const char * pszTag )

Start reading a file.

The loader has one reference.

Parameters
pFileThe open file. The loader closes it once the read completes.
pszTagThe tag the buffer is billed to.
Ghidra address:
NTSC-U/C: 0x0023a140
Ghidra address:
PAL: 0x00242cc0

◆ ~ResourceLoader()

RndManager::ResourceLoader::~ResourceLoader ( )

Release the buffer and the file.

Ghidra address:
NTSC-U/C: 0x0023a230
Ghidra address:
PAL: 0x00242db0

Member Function Documentation

◆ Poll()

bool RndManager::ResourceLoader::Poll ( )

Finish the read when the file reports it complete.

A compressed file is inflated, and the file is deleted.

Returns
Whether the data is in memory.
Ghidra address:
NTSC-U/C: 0x0023a2a8
Ghidra address:
PAL: 0x00242e28

◆ GetData()

int RndManager::ResourceLoader::GetData ( void ** ppData,
int * pnSize )

Wait for the data and hand it out, dropping one reference.

The last reference receives the buffer itself. Every earlier one receives a copy.

Parameters
ppDataReceives the data, which the caller frees.
pnSizeReceives the size of the data in bytes.
Returns
The references left.
Ghidra address:
NTSC-U/C: 0x0023a358
Ghidra address:
PAL: 0x00242ed8

◆ AddRef()

void RndManager::ResourceLoader::AddRef ( )
inline

Take one more reference, for one more GetData().


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