1#include <game/bases/d_res.hpp>
2#include <game/mLib/m_heap.hpp>
3#include <lib/rvl/vi/VI.h>
4#include <lib/rvl/os/OSCache.h>
5#include <lib/MSL_C/string.h>
65 snprintf(pathBuf,
sizeof(pathBuf),
"/%s/%s.arc", containingFolder, arcName);
66 mpDvdCmd = mDvd_mountMemArchive_c::create(pathBuf, allocDir, heap);
102 mDataHeap = mHeap::makeFrmHeapAndUpdate(-1, heap,
"dRes_c::info_c::mDataHeap", 0x20, 0);
110 mHeap::restoreCurrentHeap();
124 if (dirEntry->mIsDirectory) {
126 const char *name = dirEntry->mpName;
128 int nameLen = strlen(name);
129 memcpy(&
mFolderSig, name, (nameLen <= 4) ? nameLen : 4);
151 for (
unsigned int i = 0; i < numFiles; i++) {
155 if (callback !=
nullptr) {
A callback class for processing resources.
virtual void init(const char *name)=0
Initializes the callback with the resource name.
EGG::Archive * mpArchive
The accessor for this archive.
bool set(const char *arcName, const char *containingFolder, u8 allocDirection, EGG::Heap *heap)
Sets information about the archive to be loaded.
~info_c()
Destroys the archive holder.
LOAD_STATUS_e
The loading status of the archive.
@ LOAD_IN_PROGRESS
The archive is currently being loaded.
@ LOAD_SUCCESS
The archive was loaded successfully.
@ LOAD_ERROR
An error occurred while loading the archive.
info_c()
Constructs a new archive holder.
EGG::Heap * mpMountHeap
The heap used for mounting the archive.
mDvd_mountMemArchive_c * mpDvdCmd
The DVD command for mounting the archive.
char mName[0x20]
The name of the archive.
void * mpArcBinary
The raw archive data.
u8 ** mpFiles
An array of pointers to the data of each loaded resource.
int mArchiveSize
The archive size.
LOAD_STATUS_e loadRes(callback_c *callback)
Builds the resource list and executes a callback on each file and directory.
EGG::FrmHeap * mDataHeap
The heap used for loading the resources of the archive.
u16 mRefCount
The number of references to this archive.
bool cleanup()
Unmounts the archive and frees the holder for use.
LOAD_STATUS_e setRes(callback_c *callback)
Attempts to load the archive into memory and load the resources with a callback.
A callback class for EGG::Archive::searchInside.
searchCallback_c(callback_c *callback, u8 **files, int numFiles, int fileIdx, u32 folderSig)
Constructs a new searchCallback_c.
unsigned int mFileIdx
The index of the current file in mpFiles.
callback_c * mpCallback
The file processing callback.
u32 mFolderSig
The first 4 characters of the current folder.
u8 ** mpFiles
An array of pointers to the data of each loaded resource.
static void callback(void *cbInfo, void *file, const ARCDirEntry *dirEntry, const char *path)
The callback function.
int mNumFiles
The number of files in mpFiles.
static void(* mSetCallback)(const char *arcName, EGG::Heap *heap)
[Unused]. The callback for when an archive is scheduled for loading.