mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-04 17:21:31 -04:00
Mod SDK: Arc Overlays (#2280)
* Mod SDK: Arc Overlays * Use DVD Functions for Arc overlays * Re-add Fetchcontent for json.hpp * Fix build for actions * Make sure buffer usues aligned length * Add include so msvc compiles * Arc Overlays fixes: remove _arc suffix, handle getting overlayed file size from arcs, copy data correctly, etc. * Reload overlayed data during loading screens * Rename sync function * Free overlayed files on load instead of re-loading them * Rework arc overlays & load overlay files into host memory --------- Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
@@ -311,6 +311,11 @@ u32 dLib_getExpandSizeFromAramArchive(JKRAramArchive* i_aramArchive, char const*
|
||||
JUT_ASSERT(1260, readAddress == header);
|
||||
JKRArchive::SDIFileEntry* entry = i_aramArchive->findFsResource(param_2, 0);
|
||||
JUT_ASSERT(1263, entry != NULL);
|
||||
#if TARGET_PC
|
||||
if (u32 size; i_aramArchive->getOverlayFileSize(entry, &size)) {
|
||||
return ALIGN_NEXT(size, 32);
|
||||
}
|
||||
#endif
|
||||
u32 uVar1 = ALIGN_NEXT(JKRDecompExpandSize(header), 32);
|
||||
u32 uVar5 = ALIGN_NEXT(entry->data_size, 32);
|
||||
return uVar1 > uVar5 ? uVar1 : uVar5;
|
||||
|
||||
+2
-2
@@ -335,7 +335,7 @@ int dRes_info_c::loadResource() {
|
||||
#endif
|
||||
void* res = mArchive->getIdxResource(fileIndex);
|
||||
#if TARGET_PC
|
||||
u32 size = mArchive->findIdxResource(fileIndex)->data_size;
|
||||
u32 size = mArchive->getFileSize(mArchive->findIdxResource(fileIndex));
|
||||
std::string fileName = mArchive->mStringTable +
|
||||
(mArchive->findIdxResource(fileIndex)->type_flags_and_name_offset & 0xFFFFFF);
|
||||
DuskLog.debug("Loading Resource: {} (Size: {})", fileName, size);
|
||||
@@ -369,7 +369,7 @@ int dRes_info_c::loadResource() {
|
||||
parentHeap = NULL;
|
||||
}
|
||||
|
||||
int rt = dComIfG_setObjectRes(arcName, res, entry->data_size, parentHeap);
|
||||
int rt = dComIfG_setObjectRes(arcName, res, DUSK_IF_ELSE(mArchive->getFileSize(entry),entry->data_size), parentHeap);
|
||||
JUT_ASSERT(788, rt);
|
||||
} else if (nodeType == 'BMDP') {
|
||||
#if DEBUG
|
||||
|
||||
Reference in New Issue
Block a user