NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
dResMng_c Class Reference

#include <game/bases/d_res_mng.hpp>

Description

A higher-level archive resource management class.

Overview

The dResMng_c class wraps a dRes_c instance to provide higher-level access. For more information on resource loading and management, see dRes_c.

Bulk Resource Loading

Use the setRes function to open multiple archives at once. Only up to MAX_NUM_RES archives can be open at the same time.

Definition at line 20 of file d_res_mng.hpp.

Classes

class  resCallback_c
 A callback class for processing resources that handles loading g3d data. More...
 

Public Member Functions

 dResMng_c ()
 Constructs a new dResMng_c.
 
virtual ~dResMng_c ()
 Destroys this dResMng_c.
 
void setRes (const char *path, const char **names, int count, EGG::Heap *heap)
 Schedules multiple archives for loading.
 
bool setRes (const char *path, const char *name, EGG::Heap *heap)
 Schedules a single archive for loading.
 

Public Attributes

dRes_c mRes
 The resource manager.
 

Static Public Attributes

static dResMng_cm_instance
 The instance of this class.
 

Private Attributes

resCallback_c mCallback
 The callback for after a file has been loaded.
 

Constructor & Destructor Documentation

◆ dResMng_c()

dResMng_c::dResMng_c ( )

Constructs a new dResMng_c.

Definition at line 7 of file d_res_mng.cpp.

◆ ~dResMng_c()

dResMng_c::~dResMng_c ( )
virtual

Destroys this dResMng_c.

Definition at line 12 of file d_res_mng.cpp.

Member Function Documentation

◆ setRes() [1/2]

void dResMng_c::setRes ( const char * path,
const char ** names,
int count,
EGG::Heap * heap )

Schedules multiple archives for loading.

Parameters
pathThe path to the folder containing the archives. See the path notes in dRes_c.
namesAn array of archive names. See the path notes in dRes_c.
countThe number of archives in the array.
heapThe heap to load the archives into, or nullptr to use the default archive heap.

Definition at line 31 of file d_res_mng.cpp.

◆ setRes() [2/2]

bool dResMng_c::setRes ( const char * path,
const char * name,
EGG::Heap * heap )

Schedules a single archive for loading.

Parameters
pathThe path to the folder containing the archive. See the path notes in dRes_c.
nameThe name of the archive. See the path notes in dRes_c.
heapThe heap to load the archive into, or nullptr to use the default archive heap.
Returns
Whether the archive was loaded successfully.

Definition at line 37 of file d_res_mng.cpp.

Member Data Documentation

◆ mRes

dRes_c dResMng_c::mRes

The resource manager.

Definition at line 51 of file d_res_mng.hpp.

◆ mCallback

resCallback_c dResMng_c::mCallback
private

The callback for after a file has been loaded.

Definition at line 54 of file d_res_mng.hpp.

◆ m_instance

dResMng_c * dResMng_c::m_instance
static

The instance of this class.

Definition at line 57 of file d_res_mng.hpp.