NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
#include <dol/bases/d_res.hpp>
A utility class for loading resource files (files contained within a .arc file).
dRes_c is a holder for multiple archive (.arc) files.
Classes | |
class | callback_c |
A callback class for processing resources. More... | |
class | info_c |
A class that holds information about an archive. More... | |
class | searchCallback_c |
A callback class for EGG::Archive::searchInside. More... | |
Public Member Functions | |
dRes_c () | |
Constructs a new dRes_c. | |
~dRes_c () | |
Destroys this dRes_c. | |
bool | init (u16 maxCount, callback_c *callback) |
Initializes the dRes_c. | |
bool | setRes (const char *arcName, const char *containingFolder, u8 allocDir, EGG::Heap *heap) |
Registers an archive to be loaded next. | |
bool | deleteRes (const char *arcName) |
Marks the archive as no longer needed. | |
void * | getRes (const char *arcName, const char *resPath) const |
Loads a resource. | |
void * | getRes (const char *arcName, const char *resPath, unsigned long *size) const |
Loads a resource. | |
void * | getRes (const char *arcName, const char *resPath, unsigned long *size, int *compressionType) const |
Loads a resource which may optionally be compressed. | |
void * | getResSilently (const char *arcName, const char *resPath) const |
Loads a resource without logging a message if the resource is not found. | |
void * | getResSilently (const char *arcName, const char *resPath, unsigned long *size) const |
Loads a resource without logging a message if the resource is not found. | |
bool | syncAllRes () |
Attempts to load the resources of an archive that has finished loading since the last call to this function. The callback is executed on all files and folders. | |
info_c * | getResInfo (const char *arcName) const |
Gets the info_c for an archive, if it exists. | |
info_c * | getResInfoLoaded (const char *arcName) const |
Gets the info_c for an archive, if it exists and has been loaded into memory. | |
info_c * | newResInfo () |
Gets a free info_c that can be used to store an archive reference. | |
Static Public Member Functions | |
static void | copyRes (const void *from, void *to, int size) |
Copies an uncompressed resource. | |
static void | copyRes (const void *from, void *to, int size, int compressionType) |
Copies an optionally compressed resource. | |
Private Attributes | |
info_c * | mpArcInfos |
An array of archive holders. | |
u16 | mNumArcs |
The number of archive holders. | |
callback_c * | mpCallback |
The callback for when a resource is loaded. | |
Static Private Attributes | |
static void(* | mSetCallback )(const char *arcName, EGG::Heap *heap) |
[Unused]. The callback for when dRes_c::info_c::set is called. | |
bool dRes_c::init | ( | u16 | maxCount, |
callback_c * | callback | ||
) |
bool dRes_c::setRes | ( | const char * | arcName, |
const char * | containingFolder, | ||
u8 | allocDir, | ||
EGG::Heap * | heap | ||
) |
Registers an archive to be loaded next.
resName | The name of the archive to load. |
filePath | The path to the folder which the archive is in. |
allocDir | The allocation direction. 1: top-down, anything else: bottom-up. |
heap | The heap to load the archive into. |
bool dRes_c::deleteRes | ( | const char * | arcName | ) |
void * dRes_c::getRes | ( | const char * | arcName, |
const char * | resPath | ||
) | const |
void * dRes_c::getRes | ( | const char * | arcName, |
const char * | resPath, | ||
unsigned long * | size | ||
) | const |
void * dRes_c::getRes | ( | const char * | arcName, |
const char * | resPath, | ||
unsigned long * | size, | ||
int * | compressionType | ||
) | const |
Loads a resource which may optionally be compressed.
If the resource is not found, it tries to load "<resource name>.LZ". Only .LZ compression is supported.
arcName | The name of the archive which contains the resource. |
resPath | The path to the resource within the archive. |
size | A pointer where the size of the resource will be written to. |
compressionType | A pointer where the compression type of the resource will be written to. |
void * dRes_c::getResSilently | ( | const char * | arcName, |
const char * | resPath | ||
) | const |
Loads a resource without logging a message if the resource is not found.
void * dRes_c::getResSilently | ( | const char * | arcName, |
const char * | resPath, | ||
unsigned long * | size | ||
) | const |
Loads a resource without logging a message if the resource is not found.
bool dRes_c::syncAllRes | ( | ) |
dRes_c::info_c * dRes_c::getResInfo | ( | const char * | arcName | ) | const |
dRes_c::info_c * dRes_c::getResInfoLoaded | ( | const char * | arcName | ) | const |
dRes_c::info_c * dRes_c::newResInfo | ( | ) |
|
static |
|
static |
|
private |
|
private |
|
private |
|
staticprivate |
[Unused]. The callback for when dRes_c::info_c::set is called.