RTech: rename member variable

This variable actually represents the structure size, which is the header + the rest of the data in the structure of the asset.
This commit is contained in:
Kawe Mazidjatari 2025-02-02 14:53:48 +01:00
parent b288d072db
commit 51931b59db
4 changed files with 7 additions and 7 deletions

View File

@ -204,7 +204,7 @@ struct PakAssetBinding_s
CAlignedMemAlloc* allocator; CAlignedMemAlloc* allocator;
uint32_t headerSize; uint32_t headerSize;
uint32_t nativeClassSize; // Native class size, for 'material' it would be CMaterialGlue full size. uint32_t structSize; // Native class size, for 'material' it would be CMaterialGlue full size.
uint32_t headerAlignment; uint32_t headerAlignment;
// the type of this asset bind // the type of this asset bind

View File

@ -25,7 +25,7 @@ void Pak_AlignSlabHeaders(PakFile_s* const pak, PakSlabDescriptor_s* const desc)
const size_t alignedSize = ALIGN_VALUE(headersSize, static_cast<size_t>(binding.headerAlignment)); const size_t alignedSize = ALIGN_VALUE(headersSize, static_cast<size_t>(binding.headerAlignment));
pak->memoryData.unkAssetTypeBindingSizes[i] = alignedSize; pak->memoryData.unkAssetTypeBindingSizes[i] = alignedSize;
headersSize = alignedSize + (desc->assetTypeCount[i] * binding.nativeClassSize); headersSize = alignedSize + (desc->assetTypeCount[i] * binding.structSize);
desc->slabSizeForType[SF_HEAD] = headersSize; desc->slabSizeForType[SF_HEAD] = headersSize;

View File

@ -556,7 +556,7 @@ static bool Pak_PrepareNextPageForPatching(PakLoadedInfo_s* const loadedInfo, Pa
const int assetTypeIdx = pakAsset->HashTableIndexForAssetType(); const int assetTypeIdx = pakAsset->HashTableIndexForAssetType();
pak->memoryData.patchDstPtr = reinterpret_cast<char*>(loadedInfo->slabBuffers[0]) + pak->memoryData.unkAssetTypeBindingSizes[assetTypeIdx]; pak->memoryData.patchDstPtr = reinterpret_cast<char*>(loadedInfo->slabBuffers[0]) + pak->memoryData.unkAssetTypeBindingSizes[assetTypeIdx];
pak->memoryData.unkAssetTypeBindingSizes[assetTypeIdx] += g_pakGlobals->assetBindings[assetTypeIdx].nativeClassSize; pak->memoryData.unkAssetTypeBindingSizes[assetTypeIdx] += g_pakGlobals->assetBindings[assetTypeIdx].structSize;
return true; return true;
} }
@ -656,7 +656,7 @@ static bool Pak_ProcessAssets(PakLoadedInfo_s* const loadedInfo)
pak->memoryData.patchDstPtr = reinterpret_cast<char*>(loadedInfo->slabBuffers[0]) + pak->memoryData.unkAssetTypeBindingSizes[assetTypeIdx]; pak->memoryData.patchDstPtr = reinterpret_cast<char*>(loadedInfo->slabBuffers[0]) + pak->memoryData.unkAssetTypeBindingSizes[assetTypeIdx];
pak->memoryData.unkAssetTypeBindingSizes[assetTypeIdx] += g_pakGlobals->assetBindings[assetTypeIdx].nativeClassSize; pak->memoryData.unkAssetTypeBindingSizes[assetTypeIdx] += g_pakGlobals->assetBindings[assetTypeIdx].structSize;
} }
else else
{ {
@ -756,7 +756,7 @@ static void Pak_StubInvalidAssetBinds(PakFile_s* const pak, PakSlabDescriptor_s*
assetBinding->replaceAssetFunc = nullptr; assetBinding->replaceAssetFunc = nullptr;
assetBinding->allocator = AlignedMemAlloc(); assetBinding->allocator = AlignedMemAlloc();
assetBinding->headerSize = asset->headerSize; assetBinding->headerSize = asset->headerSize;
assetBinding->nativeClassSize = asset->headerSize; assetBinding->structSize = asset->headerSize;
assetBinding->headerAlignment = pak->memoryData.pageHeaders[asset->headPtr.index].pageAlignment; assetBinding->headerAlignment = pak->memoryData.pageHeaders[asset->headPtr.index].pageAlignment;
assetBinding->type = PakAssetBinding_s::STUB; assetBinding->type = PakAssetBinding_s::STUB;
} }

View File

@ -46,7 +46,7 @@ Pak_ListTypes_f
*/ */
static void Pak_ListTypes_f() static void Pak_ListTypes_f()
{ {
Msg(eDLL_T::RTECH, "| ext | description | version | alignment | header size | native size |\n"); Msg(eDLL_T::RTECH, "| ext | description | version | alignment | header size | struct size |\n");
Msg(eDLL_T::RTECH, "|------|---------------------------|---------|-----------|-------------|-------------|\n"); Msg(eDLL_T::RTECH, "|------|---------------------------|---------|-----------|-------------|-------------|\n");
uint32_t numRegistered = 0; uint32_t numRegistered = 0;
@ -62,7 +62,7 @@ static void Pak_ListTypes_f()
FourCCToString(assetExtension, type.extension); FourCCToString(assetExtension, type.extension);
Msg(eDLL_T::RTECH, "| %-4s | %-25s | %7u | %9u | %11u | %11u |\n", Msg(eDLL_T::RTECH, "| %-4s | %-25s | %7u | %9u | %11u | %11u |\n",
assetExtension, type.description, type.version, type.headerAlignment, type.headerSize, type.nativeClassSize); assetExtension, type.description, type.version, type.headerAlignment, type.headerSize, type.structSize);
numRegistered++; numRegistered++;
} }