RDI first prototype release #1

Merged
JackCarterSmith merged 10 commits from develop into master 2022-09-22 20:03:12 +02:00
Showing only changes of commit a9d6c82b69 - Show all commits

View File

@ -151,7 +151,7 @@ RDI_RESULT RDat::ProcessFilesTree() {
}
RDI_RESULT RDat::ProcessDirectoryContents( DirectoryEntry* pCurDir, MEMFILE pDesc, const unsigned int count, MEMFILE pSectionStart ) {
unsigned int i;
unsigned int i, newDRECnt;
DAT_FILE_FLAGS curEntryFlags = {0};
FileEntry* newFile = nullptr;
@ -176,10 +176,10 @@ RDI_RESULT RDat::ProcessDirectoryContents( DirectoryEntry* pCurDir, MEMFILE pDes
newDir = new DirectoryEntry(tmpStr, curEntryFlags);
pCurDir->AddEntry(newDir);
ProcessDirectoryContents(newDir,
pDesc + (i + 1) * sizeof(T_FILE_HEADER),
(((T_FILE_HEADER*)(pDesc + i * sizeof(T_FILE_HEADER)))->dir_entries_size - sizeof(T_FILE_HEADER)) / sizeof(T_FILE_HEADER),
pSectionStart);
// Keep entries count in new directory to jump over after processing it.
newDRECnt = (((T_FILE_HEADER*)(pDesc + i * sizeof(T_FILE_HEADER)))->dir_entries_size - sizeof(T_FILE_HEADER)) / sizeof(T_FILE_HEADER);
ProcessDirectoryContents(newDir, pDesc + (i + 1) * sizeof(T_FILE_HEADER), newDRECnt, pSectionStart);
if (newDRECnt <= count) i += newDRECnt;
}
}