mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
RTech: use more consistent type names
Force consistency between type names (follow scheme used in tier0 and rtech_game export symbols).
This commit is contained in:
parent
e639cb3f5f
commit
b699fe431e
@ -176,7 +176,7 @@ struct studioanimcache_t
|
||||
const char* rigName;
|
||||
int unk0;
|
||||
int numSequences;
|
||||
PakPage_t sequences;
|
||||
PakPage_u sequences;
|
||||
int unk1;
|
||||
int unk2;
|
||||
};
|
||||
|
@ -236,8 +236,8 @@ void Mod_QueuedPakCacheFrame()
|
||||
{
|
||||
if (*data->pakName)
|
||||
{
|
||||
PakLoadedInfo_t* const pakInfo = Pak_GetPakInfo(data->pakId);
|
||||
EPakStatus status;
|
||||
PakLoadedInfo_s* const pakInfo = Pak_GetPakInfo(data->pakId);
|
||||
PakStatus_e status;
|
||||
|
||||
// TODO: revisit this, this appears incorrect but also the way
|
||||
// respawn does this. it this always supposed to be true on
|
||||
@ -423,7 +423,7 @@ CHECK_FOR_FAILURE:
|
||||
|
||||
if (commonData->pakId != PAK_INVALID_HANDLE)
|
||||
{
|
||||
const PakLoadedInfo_t* const pli = Pak_GetPakInfo(commonData->pakId);
|
||||
const PakLoadedInfo_s* const pli = Pak_GetPakInfo(commonData->pakId);
|
||||
|
||||
if (pli->handle != commonData->pakId || ((pli->status - 9) & 0xFFFFFFFB) != 0)
|
||||
{
|
||||
|
@ -95,7 +95,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// Forward declarations
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PakFile_t;
|
||||
struct PakFile_s;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Handle types
|
||||
@ -106,7 +106,7 @@ typedef uint64_t PakGuid_t;
|
||||
//-----------------------------------------------------------------------------
|
||||
// Page handle types
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PakPageHeader_t
|
||||
struct PakPageHeader_s
|
||||
{
|
||||
uint32_t segmentIdx;
|
||||
uint32_t pageAlignment;
|
||||
@ -120,7 +120,7 @@ struct PakPageHeader_t
|
||||
#define IS_PAKPTR_VALID(pak, ptr) ((ptr)->index != UINT32_MAX && (ptr)->offset != UINT32_MAX && (ptr)->index < (pak)->GetPageCount() && (ptr)->offset <= (pak)->GetPageSize((ptr)->index))
|
||||
#define ASSERT_PAKPTR_VALID(pak, ptr) Assert(IS_PAKPTR_VALID(pak, ptr), "Invalid pak page pointer")
|
||||
|
||||
union PakPage_t
|
||||
union PakPage_u
|
||||
{
|
||||
struct
|
||||
{
|
||||
@ -133,7 +133,7 @@ union PakPage_t
|
||||
//-----------------------------------------------------------------------------
|
||||
// Enumerations
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EPakDecodeMode : int32_t
|
||||
enum PakDecodeMode_e
|
||||
{
|
||||
MODE_DISABLED = -1,
|
||||
|
||||
@ -142,7 +142,7 @@ enum EPakDecodeMode : int32_t
|
||||
MODE_ZSTD
|
||||
};
|
||||
|
||||
enum EPakStreamSet
|
||||
enum PakStreamSet_e
|
||||
{
|
||||
STREAMING_SET_MANDATORY = 0,
|
||||
STREAMING_SET_OPTIONAL,
|
||||
@ -151,7 +151,7 @@ enum EPakStreamSet
|
||||
STREAMING_SET_COUNT
|
||||
};
|
||||
|
||||
enum EPakStatus : int32_t
|
||||
enum PakStatus_e
|
||||
{
|
||||
PAK_STATUS_FREED = 0,
|
||||
PAK_STATUS_LOAD_PENDING = 1,
|
||||
@ -171,7 +171,7 @@ enum EPakStatus : int32_t
|
||||
PAK_STATUS_BUSY = 15
|
||||
};
|
||||
|
||||
struct PakAssetBinding_t
|
||||
struct PakAssetBinding_s
|
||||
{
|
||||
enum EType
|
||||
{
|
||||
@ -210,15 +210,15 @@ struct PakAssetBinding_t
|
||||
// [ PIXIE ]: Should be the full size across Season 0-3.
|
||||
};
|
||||
|
||||
struct PakAsset_t
|
||||
struct PakAsset_s
|
||||
{
|
||||
// the guid of this asset, which will be used to index into, and retrieve
|
||||
// this asset from the hash table
|
||||
PakGuid_t guid;
|
||||
uint64_t padding; // Unknown.
|
||||
|
||||
PakPage_t headPtr;
|
||||
PakPage_t dataPtr;
|
||||
PakPage_u headPtr;
|
||||
PakPage_u dataPtr;
|
||||
|
||||
// offset to the streaming data in the streaming set
|
||||
uint64_t streamingDataFileOffset[STREAMING_SET_COUNT];
|
||||
@ -244,7 +244,7 @@ struct PakAsset_t
|
||||
}
|
||||
};
|
||||
|
||||
struct PakAssetShort_t
|
||||
struct PakAssetShort_s
|
||||
{
|
||||
PakGuid_t guid;
|
||||
uint32_t trackerIndex;
|
||||
@ -273,7 +273,7 @@ struct PakTracker_s
|
||||
char gap_9DC04[522240];
|
||||
};
|
||||
|
||||
class PakLoadedInfo_t
|
||||
class PakLoadedInfo_s
|
||||
{
|
||||
public:
|
||||
struct StreamingInfo_t
|
||||
@ -297,7 +297,7 @@ public:
|
||||
};
|
||||
|
||||
PakHandle_t handle;
|
||||
EPakStatus status;
|
||||
PakStatus_e status;
|
||||
JobID_t loadJobId;
|
||||
uint32_t padding_maybe;
|
||||
|
||||
@ -312,7 +312,7 @@ public:
|
||||
void* segmentBuffers[PAK_SEGMENT_BUFFER_TYPES];
|
||||
_QWORD qword50;
|
||||
FILETIME fileTime;
|
||||
PakFile_t* pakFile;
|
||||
PakFile_s* pakFile;
|
||||
StreamingInfo_t streamInfo[STREAMING_SET_COUNT];
|
||||
uint32_t fileHandle;
|
||||
uint8_t m_nUnk5;
|
||||
@ -320,11 +320,11 @@ public:
|
||||
|
||||
}; //Size: 0x00B8/0x00E8
|
||||
|
||||
struct PakGlobals_s
|
||||
struct PakGlobalState_s
|
||||
{
|
||||
// [ PIXIE ]: Max possible registered assets on Season 3, 0-2 I did not check yet.
|
||||
PakAssetBinding_t assetBindings[PAK_MAX_TRACKED_TYPES];
|
||||
PakAssetShort_t loadedAssets[PAK_MAX_LOADED_ASSETS];
|
||||
PakAssetBinding_s assetBindings[PAK_MAX_TRACKED_TYPES];
|
||||
PakAssetShort_s loadedAssets[PAK_MAX_LOADED_ASSETS];
|
||||
|
||||
// assets that are tracked across all asset types
|
||||
PakAssetTracker_s trackedAssets[PAK_MAX_TRACKED_ASSETS];
|
||||
@ -333,7 +333,7 @@ struct PakGlobals_s
|
||||
RHashMap loadedPakMap; // links to 'loadedPaks'
|
||||
|
||||
// all currently loaded pak handles
|
||||
PakLoadedInfo_t loadedPaks[PAK_MAX_LOADED_PAKS];
|
||||
PakLoadedInfo_s loadedPaks[PAK_MAX_LOADED_PAKS];
|
||||
|
||||
RMultiHashMap unkMap2; // links to 'unkIntArray' and 'unkIntArray2'
|
||||
int unkIntArray[PAK_MAX_TRACKED_ASSETS];
|
||||
@ -395,19 +395,19 @@ struct PakGlobals_s
|
||||
uint8_t* patchNumbers;
|
||||
};
|
||||
|
||||
struct PakPatchFileHeader_t
|
||||
struct PakPatchFileHeader_s
|
||||
{
|
||||
uint64_t compressedSize;
|
||||
uint64_t decompressedSize;
|
||||
};
|
||||
|
||||
struct PakPatchDataHeader_t
|
||||
struct PakPatchDataHeader_s
|
||||
{
|
||||
uint32_t editStreamSize;
|
||||
uint32_t pageCount;
|
||||
};
|
||||
|
||||
struct PakFileHeader_t
|
||||
struct PakFileHeader_s
|
||||
{
|
||||
inline uint32_t GetTotalStreamingNamesBufferSize() const
|
||||
{
|
||||
@ -425,30 +425,30 @@ struct PakFileHeader_t
|
||||
|
||||
inline uint64_t GetTotalHeaderSize() const
|
||||
{
|
||||
uint64_t headerSize = sizeof(PakFileHeader_t);
|
||||
uint64_t headerSize = sizeof(PakFileHeader_s);
|
||||
|
||||
// if we have patches, we should include the patch header as well
|
||||
if (patchIndex > 0)
|
||||
headerSize += sizeof(PakPatchDataHeader_t);
|
||||
headerSize += sizeof(PakPatchDataHeader_s);
|
||||
|
||||
// the streaming file paths belong to the header as well
|
||||
headerSize += GetTotalStreamingNamesBufferSize();
|
||||
return headerSize;
|
||||
}
|
||||
|
||||
inline EPakDecodeMode GetCompressionMode() const
|
||||
inline PakDecodeMode_e GetCompressionMode() const
|
||||
{
|
||||
if (flags & PAK_HEADER_FLAGS_ZSTREAM_ENCODED)
|
||||
return EPakDecodeMode::MODE_ZSTD;
|
||||
return PakDecodeMode_e::MODE_ZSTD;
|
||||
|
||||
// NOTE: this should be the first check once we rebuilt function
|
||||
// 14043F300 and alloc ring buffer for the flags individually instead
|
||||
// instead of having to define the main compress flag (which really
|
||||
// just means that the pak is using the RTech decoder)
|
||||
else if (flags & PAK_HEADER_FLAGS_COMPRESSED)
|
||||
return EPakDecodeMode::MODE_RTECH;
|
||||
return PakDecodeMode_e::MODE_RTECH;
|
||||
|
||||
return EPakDecodeMode::MODE_DISABLED;
|
||||
return PakDecodeMode_e::MODE_DISABLED;
|
||||
}
|
||||
|
||||
// file versions
|
||||
@ -501,7 +501,7 @@ struct PakFileHeader_t
|
||||
uint32_t memPageOffset;
|
||||
|
||||
uint8_t unk3[0x8];
|
||||
}; static_assert(sizeof(PakFileHeader_t) == 0x80);
|
||||
}; static_assert(sizeof(PakFileHeader_s) == 0x80);
|
||||
|
||||
// segment flags
|
||||
#define SF_HEAD (0)
|
||||
@ -509,14 +509,14 @@ struct PakFileHeader_t
|
||||
#define SF_CPU (1 << 1) // 0x2
|
||||
#define SF_DEV (1 << 8) // 0x80
|
||||
|
||||
struct PakSegmentHeader_t
|
||||
struct PakSegmentHeader_s
|
||||
{
|
||||
int typeFlags;
|
||||
int dataAlignment;
|
||||
size_t dataSize;
|
||||
};
|
||||
|
||||
struct PakSegmentDescriptor_t
|
||||
struct PakSegmentDescriptor_s
|
||||
{
|
||||
size_t assetTypeCount[PAK_MAX_TRACKED_TYPES];
|
||||
int64_t segmentSizes[PAK_MAX_SEGMENTS];
|
||||
@ -525,7 +525,7 @@ struct PakSegmentDescriptor_t
|
||||
int segmentAlignmentForType[PAK_SEGMENT_BUFFER_TYPES];
|
||||
};
|
||||
|
||||
struct PakDecoder_t
|
||||
struct PakDecoder_s
|
||||
{
|
||||
const uint8_t* inputBuf;
|
||||
uint8_t* outputBuf;
|
||||
@ -542,7 +542,7 @@ struct PakDecoder_t
|
||||
uint32_t headerOffset;
|
||||
|
||||
// this field was unused, it now contains the decoder mode
|
||||
EPakDecodeMode decodeMode;
|
||||
PakDecodeMode_e decodeMode;
|
||||
|
||||
// NOTE: unless you are in the RTech decoder, use the getter if you need to
|
||||
// get the current pos!!!
|
||||
@ -579,13 +579,13 @@ struct PakDecoder_t
|
||||
};
|
||||
};
|
||||
|
||||
struct PakRingBufferFrame_t
|
||||
struct PakRingBufferFrame_s
|
||||
{
|
||||
size_t bufIndex;
|
||||
size_t frameLen;
|
||||
};
|
||||
|
||||
struct PakFileStream_t
|
||||
struct PakFileStream_s
|
||||
{
|
||||
struct Descriptor
|
||||
{
|
||||
@ -595,7 +595,7 @@ struct PakFileStream_t
|
||||
|
||||
// NOTE: if this is set, the game sets 'PakMemoryData_t::processedPatchedDataSize'
|
||||
// to 'dataOffset'; else its getting set to 'sizeof(PakFileHeader_t)'.
|
||||
EPakDecodeMode compressionMode;
|
||||
PakDecodeMode_e compressionMode;
|
||||
};
|
||||
|
||||
_QWORD qword0;
|
||||
@ -615,11 +615,11 @@ struct PakFileStream_t
|
||||
_QWORD bytesStreamed;
|
||||
};
|
||||
|
||||
typedef struct PakPatchFuncs_s
|
||||
struct PakPatchFuncs_s
|
||||
{
|
||||
typedef bool (*PatchFunc_t)(PakFile_t* const pak, size_t* const numAvailableBytes);
|
||||
typedef bool (*PatchFunc_t)(PakFile_s* const pak, size_t* const numAvailableBytes);
|
||||
|
||||
enum EPatchCommands
|
||||
enum PatchCommands_e
|
||||
{
|
||||
PATCH_CMD0,
|
||||
PATCH_CMD1,
|
||||
@ -641,9 +641,9 @@ typedef struct PakPatchFuncs_s
|
||||
|
||||
PatchFunc_t patchFuncs[PATCH_CMD_COUNT];
|
||||
|
||||
} PakPatchFuncs_t;
|
||||
};
|
||||
|
||||
struct PakMemoryData_t
|
||||
struct PakMemoryData_s
|
||||
{
|
||||
uint64_t processedPatchedDataSize;
|
||||
char* patchData; // pointer to patch stream data
|
||||
@ -675,24 +675,24 @@ struct PakMemoryData_t
|
||||
int* loadedAssetIndices;
|
||||
uint8_t** memPageBuffers;
|
||||
|
||||
PakPatchFileHeader_t* patchHeaders;
|
||||
PakPatchFileHeader_s* patchHeaders;
|
||||
unsigned short* patchIndices;
|
||||
|
||||
char* streamingFilePaths[STREAMING_SET_COUNT];
|
||||
|
||||
PakSegmentHeader_t* segmentHeaders;
|
||||
PakPageHeader_t* pageHeaders;
|
||||
PakSegmentHeader_s* segmentHeaders;
|
||||
PakPageHeader_s* pageHeaders;
|
||||
|
||||
PakPage_t* virtualPointers;
|
||||
PakAsset_t* assetEntries;
|
||||
PakPage_u* virtualPointers;
|
||||
PakAsset_s* assetEntries;
|
||||
|
||||
PakPage_t* guidDescriptors;
|
||||
PakPage_u* guidDescriptors;
|
||||
uint32_t* fileRelations;
|
||||
|
||||
char gap5E0[32];
|
||||
|
||||
PakPatchDataHeader_t* patchDataHeader;
|
||||
PakAsset_t** ppAssetEntries;
|
||||
PakPatchDataHeader_s* patchDataHeader;
|
||||
PakAsset_s** ppAssetEntries;
|
||||
|
||||
int someAssetCount;
|
||||
int numShiftedPointers;
|
||||
@ -701,11 +701,11 @@ struct PakMemoryData_t
|
||||
__int64 unkAssetTypeBindingSizes[PAK_MAX_TRACKED_TYPES];
|
||||
|
||||
const char* fileName;
|
||||
PakFileHeader_t pakHeader;
|
||||
PakPatchFileHeader_t patchHeader;
|
||||
PakFileHeader_s pakHeader;
|
||||
PakPatchFileHeader_s patchHeader;
|
||||
};
|
||||
|
||||
struct PakFile_t
|
||||
struct PakFile_s
|
||||
{
|
||||
int numProcessedPointers;
|
||||
uint32_t processedAssetCount;
|
||||
@ -715,26 +715,26 @@ struct PakFile_t
|
||||
uint32_t patchCount;
|
||||
uint32_t dword14;
|
||||
|
||||
PakFileStream_t fileStream;
|
||||
PakFileStream_s fileStream;
|
||||
uint64_t inputBytePos;
|
||||
uint8_t byte1F8;
|
||||
char gap1F9[4];
|
||||
uint8_t byte1FD;
|
||||
bool isOffsetted_MAYBE;
|
||||
bool isCompressed;
|
||||
PakDecoder_t pakDecoder;
|
||||
PakDecoder_s pakDecoder;
|
||||
uint8_t* decompBuffer;
|
||||
size_t maxCopySize;
|
||||
uint64_t qword298;
|
||||
|
||||
PakMemoryData_t memoryData;
|
||||
PakMemoryData_s memoryData;
|
||||
|
||||
inline const char* GetName() const
|
||||
{
|
||||
return memoryData.fileName;
|
||||
}
|
||||
|
||||
inline const PakFileHeader_t& GetHeader() const
|
||||
inline const PakFileHeader_s& GetHeader() const
|
||||
{
|
||||
return memoryData.pakHeader;
|
||||
}
|
||||
@ -771,7 +771,7 @@ struct PakFile_t
|
||||
return true;
|
||||
}
|
||||
|
||||
inline const PakPageHeader_t* GetPageHeader(const uint32_t i) const
|
||||
inline const PakPageHeader_s* GetPageHeader(const uint32_t i) const
|
||||
{
|
||||
assert(i != UINT32_MAX && i < GetPageCount());
|
||||
|
||||
@ -791,14 +791,14 @@ struct PakFile_t
|
||||
return memoryData.memPageBuffers[index] + offset;
|
||||
}
|
||||
|
||||
inline void* GetPointerForPageOffset(const PakPage_t& ptr) const
|
||||
inline void* GetPointerForPageOffset(const PakPage_u& ptr) const
|
||||
{
|
||||
assert(IsPageOffsetValid(ptr.index, ptr.offset));
|
||||
|
||||
return memoryData.memPageBuffers[ptr.index] + ptr.offset;
|
||||
}
|
||||
|
||||
inline void* GetPointerForPageOffset(const PakPage_t* ptr) const
|
||||
inline void* GetPointerForPageOffset(const PakPage_u* ptr) const
|
||||
{
|
||||
assert(IsPageOffsetValid(ptr->index, ptr->offset));
|
||||
|
||||
@ -811,7 +811,7 @@ struct PakFile_t
|
||||
return GetHeader().virtualSegmentCount;
|
||||
}
|
||||
|
||||
inline const PakSegmentHeader_t* GetSegmentHeader(const uint32_t i) const
|
||||
inline const PakSegmentHeader_s* GetSegmentHeader(const uint32_t i) const
|
||||
{
|
||||
assert(i < GetSegmentCount());
|
||||
|
||||
@ -821,11 +821,11 @@ struct PakFile_t
|
||||
|
||||
|
||||
static_assert(sizeof(PakTracker_s) == 0x11D410);
|
||||
static_assert(sizeof(PakFile_t) == 2224); // S3+
|
||||
static_assert(sizeof(PakLoadedInfo_t) == 184);
|
||||
static_assert(sizeof(PakDecoder_t) == 136);
|
||||
static_assert(sizeof(PakPatchFileHeader_t) == 16);
|
||||
static_assert(sizeof(PakPatchDataHeader_t) == 8);
|
||||
static_assert(sizeof(PakGlobals_s) == 0xC98A48);
|
||||
static_assert(sizeof(PakFile_s) == 2224); // S3+
|
||||
static_assert(sizeof(PakLoadedInfo_s) == 184);
|
||||
static_assert(sizeof(PakDecoder_s) == 136);
|
||||
static_assert(sizeof(PakPatchFileHeader_s) == 16);
|
||||
static_assert(sizeof(PakPatchDataHeader_s) == 8);
|
||||
static_assert(sizeof(PakGlobalState_s) == 0xC98A48);
|
||||
|
||||
#endif // RTECH_IPACKFILE_H
|
||||
|
@ -10,14 +10,14 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// aligns the segment headers for each asset type
|
||||
//-----------------------------------------------------------------------------
|
||||
void Pak_AlignSegmentHeaders(PakFile_t* const pak, PakSegmentDescriptor_t* const desc)
|
||||
void Pak_AlignSegmentHeaders(PakFile_s* const pak, PakSegmentDescriptor_s* const desc)
|
||||
{
|
||||
uint64_t headersSize = 0;
|
||||
uint8_t headerSegmentAlignment = static_cast<int8_t>(desc->segmentAlignmentForType[SF_HEAD]);
|
||||
|
||||
for (uint8_t i = 0; i < PAK_MAX_TRACKED_TYPES; ++i)
|
||||
{
|
||||
const PakAssetBinding_t& binding = g_pakGlobals->assetBindings[i];
|
||||
const PakAssetBinding_s& binding = g_pakGlobals->assetBindings[i];
|
||||
|
||||
if (desc->assetTypeCount[i])
|
||||
{
|
||||
@ -41,11 +41,11 @@ void Pak_AlignSegmentHeaders(PakFile_t* const pak, PakSegmentDescriptor_t* const
|
||||
//-----------------------------------------------------------------------------
|
||||
// aligns each individual non-header segment
|
||||
//-----------------------------------------------------------------------------
|
||||
void Pak_AlignSegments(PakFile_t* const pak, PakSegmentDescriptor_t* const desc)
|
||||
void Pak_AlignSegments(PakFile_s* const pak, PakSegmentDescriptor_s* const desc)
|
||||
{
|
||||
for (uint16_t i = 0; i < pak->GetSegmentCount(); ++i)
|
||||
{
|
||||
const PakSegmentHeader_t* const segHeader = pak->GetSegmentHeader(i);
|
||||
const PakSegmentHeader_s* const segHeader = pak->GetSegmentHeader(i);
|
||||
|
||||
const uint8_t segmentType = segHeader->typeFlags & (SF_TEMP | SF_CPU);
|
||||
|
||||
@ -71,14 +71,14 @@ void Pak_AlignSegments(PakFile_t* const pak, PakSegmentDescriptor_t* const desc)
|
||||
//-----------------------------------------------------------------------------
|
||||
// copy's pages into pre-allocated and aligned segments
|
||||
//-----------------------------------------------------------------------------
|
||||
void Pak_CopyPagesToSegments(PakFile_t* const pak, PakLoadedInfo_t* const loadedInfo, PakSegmentDescriptor_t* const desc)
|
||||
void Pak_CopyPagesToSegments(PakFile_s* const pak, PakLoadedInfo_s* const loadedInfo, PakSegmentDescriptor_s* const desc)
|
||||
{
|
||||
for (uint32_t i = 0; i < pak->GetPageCount(); ++i)
|
||||
{
|
||||
const PakPageHeader_t* const pageHeader = pak->GetPageHeader(i);
|
||||
const PakPageHeader_s* const pageHeader = pak->GetPageHeader(i);
|
||||
const uint32_t segmentIndex = pageHeader->segmentIdx;
|
||||
|
||||
const PakSegmentHeader_t* const segHeader = pak->GetSegmentHeader(segmentIndex);
|
||||
const PakSegmentHeader_s* const segHeader = pak->GetSegmentHeader(segmentIndex);
|
||||
const int typeFlags = segHeader->typeFlags;
|
||||
|
||||
// check if header page
|
||||
|
@ -2,12 +2,12 @@
|
||||
#define RTECH_PAKALLOC_H
|
||||
#include "rtech/ipakfile.h"
|
||||
|
||||
extern void Pak_AlignSegmentHeaders(PakFile_t* const pak, PakSegmentDescriptor_t* const desc);
|
||||
extern void Pak_AlignSegments(PakFile_t* const pak, PakSegmentDescriptor_t* const desc);
|
||||
extern void Pak_CopyPagesToSegments(PakFile_t* const pak, PakLoadedInfo_t* const loadedInfo, PakSegmentDescriptor_t* const desc);
|
||||
extern void Pak_AlignSegmentHeaders(PakFile_s* const pak, PakSegmentDescriptor_s* const desc);
|
||||
extern void Pak_AlignSegments(PakFile_s* const pak, PakSegmentDescriptor_s* const desc);
|
||||
extern void Pak_CopyPagesToSegments(PakFile_s* const pak, PakLoadedInfo_s* const loadedInfo, PakSegmentDescriptor_s* const desc);
|
||||
|
||||
// something with sorting pages?
|
||||
inline void (*sub_140442740)(PakAsset_t** assetEntries, PakAsset_t** assetEntry, __int64 idx, PakFile_t* pak);
|
||||
inline void (*sub_140442740)(PakAsset_s** assetEntries, PakAsset_s** assetEntry, __int64 idx, PakFile_s* pak);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class V_PakAlloc : public IDetour
|
||||
|
@ -135,7 +135,7 @@ static const unsigned char /*141313180*/ s_defaultDecoderLUT[] =
|
||||
//-----------------------------------------------------------------------------
|
||||
// checks if we have enough output buffer room to decode the data stream
|
||||
//-----------------------------------------------------------------------------
|
||||
bool Pak_HasEnoughDecodeBufferAvailable(PakDecoder_t* const decoder, const size_t outLen)
|
||||
bool Pak_HasEnoughDecodeBufferAvailable(PakDecoder_s* const decoder, const size_t outLen)
|
||||
{
|
||||
// make sure caller has copied all data out the ring buffer first before
|
||||
// overwriting it with new decoded data
|
||||
@ -146,7 +146,7 @@ bool Pak_HasEnoughDecodeBufferAvailable(PakDecoder_t* const decoder, const size_
|
||||
//-----------------------------------------------------------------------------
|
||||
// checks if we have enough source data streamed to decode the next block
|
||||
//-----------------------------------------------------------------------------
|
||||
bool Pak_HasEnoughStreamedDataForDecode(PakDecoder_t* const decoder, const size_t inLen)
|
||||
bool Pak_HasEnoughStreamedDataForDecode(PakDecoder_s* const decoder, const size_t inLen)
|
||||
{
|
||||
// the decoder needs at least this amount of input data streamed in order
|
||||
// to decode the rest of the pak file, as this is where reading has stopped
|
||||
@ -160,9 +160,9 @@ bool Pak_HasEnoughStreamedDataForDecode(PakDecoder_t* const decoder, const size_
|
||||
// gets the frame for the data in the ring buffer, the frame returned is always
|
||||
// ending to the end of the ring buffer, or the end of the data itself
|
||||
//-----------------------------------------------------------------------------
|
||||
PakRingBufferFrame_t Pak_DetermineRingBufferFrame(const uint64_t bufMask, const size_t seekPos, const size_t dataLen)
|
||||
PakRingBufferFrame_s Pak_DetermineRingBufferFrame(const uint64_t bufMask, const size_t seekPos, const size_t dataLen)
|
||||
{
|
||||
PakRingBufferFrame_t ring;
|
||||
PakRingBufferFrame_s ring;
|
||||
ring.bufIndex = seekPos & bufMask;
|
||||
|
||||
// the total amount of bytes used and available in this frame
|
||||
@ -178,7 +178,7 @@ PakRingBufferFrame_t Pak_DetermineRingBufferFrame(const uint64_t bufMask, const
|
||||
//-----------------------------------------------------------------------------
|
||||
// initializes the RTech decoder
|
||||
//-----------------------------------------------------------------------------
|
||||
size_t Pak_RTechDecoderInit(PakDecoder_t* const decoder, const uint8_t* const fileBuffer,
|
||||
size_t Pak_RTechDecoderInit(PakDecoder_s* const decoder, const uint8_t* const fileBuffer,
|
||||
const uint64_t inputMask, const size_t dataSize, const size_t dataOffset, const size_t headerSize)
|
||||
{
|
||||
uint64_t frameHeader = *(_QWORD*)((inputMask & (dataOffset + headerSize)) + fileBuffer);
|
||||
@ -243,7 +243,7 @@ size_t Pak_RTechDecoderInit(PakDecoder_t* const decoder, const uint8_t* const fi
|
||||
//-----------------------------------------------------------------------------
|
||||
// decodes the RTech data stream up to available buffer or data
|
||||
//-----------------------------------------------------------------------------
|
||||
bool Pak_RTechStreamDecode(PakDecoder_t* const decoder, const size_t inLen, const size_t outLen)
|
||||
bool Pak_RTechStreamDecode(PakDecoder_s* const decoder, const size_t inLen, const size_t outLen)
|
||||
{
|
||||
bool result; // al
|
||||
uint64_t outBufBytePos; // r15
|
||||
@ -570,7 +570,7 @@ LABEL_69:
|
||||
//-----------------------------------------------------------------------------
|
||||
// initializes the ZStd decoder
|
||||
//-----------------------------------------------------------------------------
|
||||
size_t Pak_ZStdDecoderInit(PakDecoder_t* const decoder, const uint8_t* frameHeader,
|
||||
size_t Pak_ZStdDecoderInit(PakDecoder_s* const decoder, const uint8_t* frameHeader,
|
||||
const size_t dataSize, const size_t headerSize)
|
||||
{
|
||||
ZSTD_DStream* const dctx = ZSTD_createDStream();
|
||||
@ -608,7 +608,7 @@ size_t Pak_ZStdDecoderInit(PakDecoder_t* const decoder, const uint8_t* frameHead
|
||||
// decodes the ZStd data stream up to available buffer or data, whichever ends
|
||||
// first
|
||||
//-----------------------------------------------------------------------------
|
||||
bool Pak_ZStdStreamDecode(PakDecoder_t* const decoder, const PakRingBufferFrame_t& outFrame, const PakRingBufferFrame_t& inFrame)
|
||||
bool Pak_ZStdStreamDecode(PakDecoder_s* const decoder, const PakRingBufferFrame_s& outFrame, const PakRingBufferFrame_s& inFrame)
|
||||
{
|
||||
ZSTD_outBuffer outBuffer = {
|
||||
&decoder->outputBuf[outFrame.bufIndex],
|
||||
@ -663,9 +663,9 @@ bool Pak_ZStdStreamDecode(PakDecoder_t* const decoder, const PakRingBufferFrame_
|
||||
//-----------------------------------------------------------------------------
|
||||
// initializes the decoder
|
||||
//-----------------------------------------------------------------------------
|
||||
size_t Pak_InitDecoder(PakDecoder_t* const decoder, const uint8_t* const inputBuf, uint8_t* const outputBuf,
|
||||
size_t Pak_InitDecoder(PakDecoder_s* const decoder, const uint8_t* const inputBuf, uint8_t* const outputBuf,
|
||||
const uint64_t inputMask, const uint64_t outputMask, const size_t dataSize, const size_t dataOffset,
|
||||
const size_t headerSize, const EPakDecodeMode decodeMode)
|
||||
const size_t headerSize, const PakDecodeMode_e decodeMode)
|
||||
{
|
||||
// buffer size must be power of two as we index into buffers using a bit
|
||||
// mask rather than a modulo, the mask provided must be bufferSize-1
|
||||
@ -696,7 +696,7 @@ size_t Pak_InitDecoder(PakDecoder_t* const decoder, const uint8_t* const inputBu
|
||||
|
||||
// if we use the default RTech decoder, return from here as the stuff below
|
||||
// is handled by the RTech decoder internally
|
||||
if (decodeMode == EPakDecodeMode::MODE_RTECH)
|
||||
if (decodeMode == PakDecodeMode_e::MODE_RTECH)
|
||||
return Pak_RTechDecoderInit(decoder, inputBuf, inputMask, dataSize, dataOffset, headerSize);
|
||||
|
||||
// NOTE: on RTech encoded paks this data is parsed out of the frame header,
|
||||
@ -721,7 +721,7 @@ size_t Pak_InitDecoder(PakDecoder_t* const decoder, const uint8_t* const inputBu
|
||||
// from where the base pak had ended as patch pak files are considered part of
|
||||
// the pak file that's currently getting loaded
|
||||
//-----------------------------------------------------------------------------
|
||||
bool Pak_StreamToBufferDecode(PakDecoder_t* const decoder, const size_t inLen, const size_t outLen, const EPakDecodeMode decodeMode)
|
||||
bool Pak_StreamToBufferDecode(PakDecoder_s* const decoder, const size_t inLen, const size_t outLen, const PakDecodeMode_e decodeMode)
|
||||
{
|
||||
if (!Pak_HasEnoughStreamedDataForDecode(decoder, inLen))
|
||||
return false;
|
||||
@ -729,7 +729,7 @@ bool Pak_StreamToBufferDecode(PakDecoder_t* const decoder, const size_t inLen, c
|
||||
if (!Pak_HasEnoughDecodeBufferAvailable(decoder, outLen))
|
||||
return false;
|
||||
|
||||
if (decodeMode == EPakDecodeMode::MODE_RTECH)
|
||||
if (decodeMode == PakDecodeMode_e::MODE_RTECH)
|
||||
return Pak_RTechStreamDecode(decoder, inLen, outLen);
|
||||
|
||||
// must have a decoder at this point
|
||||
@ -739,8 +739,8 @@ bool Pak_StreamToBufferDecode(PakDecoder_t* const decoder, const size_t inLen, c
|
||||
// this position in code
|
||||
assert(decoder->zstreamContext && decoder->inBufBytePos <= inLen);
|
||||
|
||||
const PakRingBufferFrame_t outFrame = Pak_DetermineRingBufferFrame(decoder->outputMask, decoder->outBufBytePos , outLen);
|
||||
const PakRingBufferFrame_t inFrame = Pak_DetermineRingBufferFrame(decoder->inputMask, decoder->inBufBytePos, inLen);
|
||||
const PakRingBufferFrame_s outFrame = Pak_DetermineRingBufferFrame(decoder->outputMask, decoder->outBufBytePos , outLen);
|
||||
const PakRingBufferFrame_s inFrame = Pak_DetermineRingBufferFrame(decoder->inputMask, decoder->inBufBytePos, inLen);
|
||||
|
||||
return Pak_ZStdStreamDecode(decoder, outFrame, inFrame);
|
||||
}
|
||||
@ -748,14 +748,14 @@ bool Pak_StreamToBufferDecode(PakDecoder_t* const decoder, const size_t inLen, c
|
||||
//-----------------------------------------------------------------------------
|
||||
// decodes buffered input pak data
|
||||
//-----------------------------------------------------------------------------
|
||||
bool Pak_BufferToBufferDecode(uint8_t* const inBuf, uint8_t* const outBuf, const size_t pakSize, const EPakDecodeMode decodeMode)
|
||||
bool Pak_BufferToBufferDecode(uint8_t* const inBuf, uint8_t* const outBuf, const size_t pakSize, const PakDecodeMode_e decodeMode)
|
||||
{
|
||||
assert(decodeMode != EPakDecodeMode::MODE_DISABLED);
|
||||
assert(decodeMode != PakDecodeMode_e::MODE_DISABLED);
|
||||
|
||||
PakDecoder_t decoder{};
|
||||
const size_t decompressedSize = Pak_InitDecoder(&decoder, inBuf, outBuf, UINT64_MAX, UINT64_MAX, pakSize, NULL, sizeof(PakFileHeader_t), decodeMode);
|
||||
PakDecoder_s decoder{};
|
||||
const size_t decompressedSize = Pak_InitDecoder(&decoder, inBuf, outBuf, UINT64_MAX, UINT64_MAX, pakSize, NULL, sizeof(PakFileHeader_s), decodeMode);
|
||||
|
||||
PakFileHeader_t* const inHeader = reinterpret_cast<PakFileHeader_t*>(inBuf);
|
||||
PakFileHeader_s* const inHeader = reinterpret_cast<PakFileHeader_s*>(inBuf);
|
||||
|
||||
if (decompressedSize != inHeader->decompressedSize)
|
||||
{
|
||||
@ -774,7 +774,7 @@ bool Pak_BufferToBufferDecode(uint8_t* const inBuf, uint8_t* const outBuf, const
|
||||
return false;
|
||||
}
|
||||
|
||||
PakFileHeader_t* const outHeader = reinterpret_cast<PakFileHeader_t*>(outBuf);
|
||||
PakFileHeader_s* const outHeader = reinterpret_cast<PakFileHeader_s*>(outBuf);
|
||||
|
||||
// copy the header over to the decoded buffer
|
||||
*outHeader = *inHeader;
|
||||
@ -826,7 +826,7 @@ bool Pak_DecodePakFile(const char* const inPakFile, const char* const outPakFile
|
||||
|
||||
const size_t fileSize = inPakStream.GetSize();
|
||||
|
||||
if (fileSize <= sizeof(PakFileHeader_t))
|
||||
if (fileSize <= sizeof(PakFileHeader_s))
|
||||
{
|
||||
Error(eDLL_T::RTECH, NO_ERROR, "%s: pak '%s' appears truncated!\n",
|
||||
__FUNCTION__, inPakFile);
|
||||
@ -840,7 +840,7 @@ bool Pak_DecodePakFile(const char* const inPakFile, const char* const outPakFile
|
||||
inPakStream.Read(inPakBuf, fileSize);
|
||||
inPakStream.Close();
|
||||
|
||||
PakFileHeader_t* const inHeader = reinterpret_cast<PakFileHeader_t*>(inPakBuf);
|
||||
PakFileHeader_s* const inHeader = reinterpret_cast<PakFileHeader_s*>(inPakBuf);
|
||||
|
||||
if (inHeader->magic != PAK_HEADER_MAGIC || inHeader->version != PAK_HEADER_VERSION)
|
||||
{
|
||||
@ -850,9 +850,9 @@ bool Pak_DecodePakFile(const char* const inPakFile, const char* const outPakFile
|
||||
return false;
|
||||
}
|
||||
|
||||
const EPakDecodeMode decodeMode = inHeader->GetCompressionMode();
|
||||
const PakDecodeMode_e decodeMode = inHeader->GetCompressionMode();
|
||||
|
||||
if (decodeMode == EPakDecodeMode::MODE_DISABLED)
|
||||
if (decodeMode == PakDecodeMode_e::MODE_DISABLED)
|
||||
{
|
||||
Error(eDLL_T::RTECH, NO_ERROR, "%s: pak '%s' is already decompressed!\n",
|
||||
__FUNCTION__, inPakFile);
|
||||
@ -881,7 +881,7 @@ bool Pak_DecodePakFile(const char* const inPakFile, const char* const outPakFile
|
||||
return false;
|
||||
}
|
||||
|
||||
const PakFileHeader_t* const outHeader = reinterpret_cast<PakFileHeader_t*>(outPakBuf);
|
||||
const PakFileHeader_s* const outHeader = reinterpret_cast<PakFileHeader_s*>(outPakBuf);
|
||||
|
||||
// NOTE: if the paks this particular pak patches have different sizes than
|
||||
// current sizes in the patch header, the runtime will crash!
|
||||
|
@ -2,12 +2,12 @@
|
||||
#define RTECH_PAKDECODE_H
|
||||
#include "rtech/ipakfile.h"
|
||||
|
||||
extern size_t Pak_InitDecoder(PakDecoder_t* const decoder, const uint8_t* const inputBuf, uint8_t* const outputBuf,
|
||||
extern size_t Pak_InitDecoder(PakDecoder_s* const decoder, const uint8_t* const inputBuf, uint8_t* const outputBuf,
|
||||
const uint64_t inputMask, const uint64_t outputMask, const size_t dataSize, const size_t dataOffset,
|
||||
const size_t headerSize, const EPakDecodeMode decodeMode);
|
||||
const size_t headerSize, const PakDecodeMode_e decodeMode);
|
||||
|
||||
extern bool Pak_StreamToBufferDecode(PakDecoder_t* const decoder, const size_t inLen, const size_t outLen, const EPakDecodeMode decodeMode);
|
||||
extern bool Pak_BufferToBufferDecode(uint8_t* const inBuf, uint8_t* const outBuf, const size_t pakSize, const EPakDecodeMode decodeMode);
|
||||
extern bool Pak_StreamToBufferDecode(PakDecoder_s* const decoder, const size_t inLen, const size_t outLen, const PakDecodeMode_e decodeMode);
|
||||
extern bool Pak_BufferToBufferDecode(uint8_t* const inBuf, uint8_t* const outBuf, const size_t pakSize, const PakDecodeMode_e decodeMode);
|
||||
|
||||
extern bool Pak_DecodePakFile(const char* const inPakFile, const char* const outPakFile);
|
||||
|
||||
|
@ -35,7 +35,7 @@ bool Pak_BufferToBufferEncode(const uint8_t* const inBuf, const uint64_t inLen,
|
||||
{
|
||||
// offset to the actual pak data, the main file header shouldn't be
|
||||
// compressed
|
||||
const size_t dataOffset = sizeof(PakFileHeader_t);
|
||||
const size_t dataOffset = sizeof(PakFileHeader_s);
|
||||
|
||||
uint8_t* const dstBuf = outBuf + dataOffset;
|
||||
const size_t dstLen = outLen - dataOffset;
|
||||
@ -55,7 +55,7 @@ bool Pak_BufferToBufferEncode(const uint8_t* const inBuf, const uint64_t inLen,
|
||||
return false;
|
||||
}
|
||||
|
||||
PakFileHeader_t* const outHeader = reinterpret_cast<PakFileHeader_t* const>(outBuf);
|
||||
PakFileHeader_s* const outHeader = reinterpret_cast<PakFileHeader_s* const>(outBuf);
|
||||
|
||||
// the compressed size includes the entire buffer, even the data we didn't
|
||||
// compress like the file header
|
||||
@ -105,7 +105,7 @@ bool Pak_EncodePakFile(const char* const inPakFile, const char* const outPakFile
|
||||
const size_t fileSize = inPakStream.GetSize();
|
||||
|
||||
// file appears truncated
|
||||
if (fileSize <= sizeof(PakFileHeader_t))
|
||||
if (fileSize <= sizeof(PakFileHeader_s))
|
||||
{
|
||||
Error(eDLL_T::RTECH, NO_ERROR, "%s: pak '%s' appears truncated!\n",
|
||||
__FUNCTION__, inPakFile);
|
||||
@ -119,7 +119,7 @@ bool Pak_EncodePakFile(const char* const inPakFile, const char* const outPakFile
|
||||
inPakStream.Read(inPakBuf, fileSize);
|
||||
inPakStream.Close();
|
||||
|
||||
const PakFileHeader_t* const inHeader = reinterpret_cast<PakFileHeader_t* const>(inPakBuf);
|
||||
const PakFileHeader_s* const inHeader = reinterpret_cast<PakFileHeader_s* const>(inPakBuf);
|
||||
|
||||
if (inHeader->magic != PAK_HEADER_MAGIC || inHeader->version != PAK_HEADER_VERSION)
|
||||
{
|
||||
@ -129,7 +129,7 @@ bool Pak_EncodePakFile(const char* const inPakFile, const char* const outPakFile
|
||||
return false;
|
||||
}
|
||||
|
||||
if (inHeader->GetCompressionMode() != EPakDecodeMode::MODE_DISABLED)
|
||||
if (inHeader->GetCompressionMode() != PakDecodeMode_e::MODE_DISABLED)
|
||||
{
|
||||
Error(eDLL_T::RTECH, NO_ERROR, "%s: pak '%s' is already compressed!\n",
|
||||
__FUNCTION__, inPakFile);
|
||||
@ -158,7 +158,7 @@ bool Pak_EncodePakFile(const char* const inPakFile, const char* const outPakFile
|
||||
std::unique_ptr<uint8_t[]> outPakBufContainer(new uint8_t[outBufSize]);
|
||||
uint8_t* const outPakBuf = outPakBufContainer.get();
|
||||
|
||||
PakFileHeader_t* const outHeader = reinterpret_cast<PakFileHeader_t* const>(outPakBuf);
|
||||
PakFileHeader_s* const outHeader = reinterpret_cast<PakFileHeader_s* const>(outPakBuf);
|
||||
|
||||
// copy the header over
|
||||
*outHeader = *inHeader;
|
||||
@ -172,7 +172,7 @@ bool Pak_EncodePakFile(const char* const inPakFile, const char* const outPakFile
|
||||
return false;
|
||||
}
|
||||
|
||||
const PakFileHeader_t* const outPakHeader = reinterpret_cast<PakFileHeader_t* const>(outPakBuf);
|
||||
const PakFileHeader_s* const outPakHeader = reinterpret_cast<PakFileHeader_s* const>(outPakBuf);
|
||||
|
||||
Pak_ShowHeaderDetails(outPakHeader);
|
||||
|
||||
|
@ -19,7 +19,7 @@ static ConVar pak_debugrelations("pak_debugrelations", "0", FCVAR_DEVELOPMENTONL
|
||||
//-----------------------------------------------------------------------------
|
||||
// resolve the target guid from lookuo table
|
||||
//-----------------------------------------------------------------------------
|
||||
static bool Pak_ResolveAssetDependency(const PakFile_t* const pak, PakGuid_t currentGuid,
|
||||
static bool Pak_ResolveAssetDependency(const PakFile_s* const pak, PakGuid_t currentGuid,
|
||||
const PakGuid_t targetGuid, int& currentIndex, const bool shouldCheckTwo)
|
||||
{
|
||||
while (true)
|
||||
@ -48,9 +48,9 @@ static bool Pak_ResolveAssetDependency(const PakFile_t* const pak, PakGuid_t cur
|
||||
//-----------------------------------------------------------------------------
|
||||
// resolve guid relations for asset
|
||||
//-----------------------------------------------------------------------------
|
||||
void Pak_ResolveAssetRelations(PakFile_t* const pak, const PakAsset_t* const asset)
|
||||
void Pak_ResolveAssetRelations(PakFile_s* const pak, const PakAsset_s* const asset)
|
||||
{
|
||||
PakPage_t* const pGuidDescriptors = &pak->memoryData.guidDescriptors[asset->dependenciesIndex];
|
||||
PakPage_u* const pGuidDescriptors = &pak->memoryData.guidDescriptors[asset->dependenciesIndex];
|
||||
uint32_t* const v5 = (uint32_t*)g_pakGlobals->loadedPaks[pak->memoryData.pakId & PAK_MAX_LOADED_PAKS_MASK].qword50;
|
||||
|
||||
if (pak_debugrelations.GetBool())
|
||||
@ -77,7 +77,7 @@ void Pak_ResolveAssetRelations(PakFile_t* const pak, const PakAsset_t* const ass
|
||||
// are we some special asset with the guid 2?
|
||||
if (!Pak_ResolveAssetDependency(pak, currentGuid, targetGuid, currentIndex, true))
|
||||
{
|
||||
PakAsset_t* assetEntries = pak->memoryData.assetEntries;
|
||||
PakAsset_s* assetEntries = pak->memoryData.assetEntries;
|
||||
uint64_t a = 0;
|
||||
|
||||
for (; assetEntries->guid != targetGuid; a++, assetEntries++)
|
||||
@ -111,13 +111,13 @@ void Pak_ResolveAssetRelations(PakFile_t* const pak, const PakAsset_t* const ass
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t Pak_ProcessRemainingPagePointers(PakFile_t* const pak)
|
||||
uint32_t Pak_ProcessRemainingPagePointers(PakFile_s* const pak)
|
||||
{
|
||||
uint32_t processedPointers = 0;
|
||||
|
||||
for (processedPointers = pak->numProcessedPointers; processedPointers < pak->GetPointerCount(); ++processedPointers)
|
||||
{
|
||||
PakPage_t* const curPage = &pak->memoryData.virtualPointers[processedPointers];
|
||||
PakPage_u* const curPage = &pak->memoryData.virtualPointers[processedPointers];
|
||||
int curCount = curPage->index - pak->firstPageIdx;
|
||||
|
||||
if (curCount < 0)
|
||||
@ -126,14 +126,14 @@ uint32_t Pak_ProcessRemainingPagePointers(PakFile_t* const pak)
|
||||
if (curCount >= pak->processedPageCount)
|
||||
break;
|
||||
|
||||
PakPage_t* const ptr = reinterpret_cast<PakPage_t*>(pak->GetPointerForPageOffset(curPage));
|
||||
PakPage_u* const ptr = reinterpret_cast<PakPage_u*>(pak->GetPointerForPageOffset(curPage));
|
||||
ptr->ptr = pak->memoryData.memPageBuffers[ptr->index] + ptr->offset;
|
||||
}
|
||||
|
||||
return processedPointers;
|
||||
}
|
||||
|
||||
void Pak_RunAssetLoadingJobs(PakFile_t* const pak)
|
||||
void Pak_RunAssetLoadingJobs(PakFile_s* const pak)
|
||||
{
|
||||
pak->numProcessedPointers = Pak_ProcessRemainingPagePointers(pak);
|
||||
|
||||
@ -142,7 +142,7 @@ void Pak_RunAssetLoadingJobs(PakFile_t* const pak)
|
||||
if (numAssets == pak->memoryData.pakHeader.assetCount)
|
||||
return;
|
||||
|
||||
PakAsset_t* pakAsset = &pak->memoryData.assetEntries[numAssets];
|
||||
PakAsset_s* pakAsset = &pak->memoryData.assetEntries[numAssets];
|
||||
|
||||
if (pakAsset->pageEnd > pak->processedPageCount)
|
||||
return;
|
||||
@ -215,7 +215,7 @@ PakHandle_t Pak_LoadAsync(const char* const fileName, CAlignedMemAlloc* const al
|
||||
//-----------------------------------------------------------------------------
|
||||
void Pak_UnloadAsync(PakHandle_t handle)
|
||||
{
|
||||
const PakLoadedInfo_t* const pakInfo = Pak_GetPakInfo(handle);
|
||||
const PakLoadedInfo_s* const pakInfo = Pak_GetPakInfo(handle);
|
||||
|
||||
if (pakInfo->fileName)
|
||||
Msg(eDLL_T::RTECH, "Unloading pak file: '%s'\n", pakInfo->fileName);
|
||||
@ -232,13 +232,13 @@ static const int s_patchCmdToBytesToProcess[] = { CMD_INVALID, CMD_INVALID, CMD_
|
||||
// loads and processes a pak file (handles decompression and patching)
|
||||
// TODO: !!! FINISH REBUILD !!!
|
||||
//----------------------------------------------------------------------------------
|
||||
bool Pak_ProcessPakFile(PakFile_t* const pak)
|
||||
bool Pak_ProcessPakFile(PakFile_s* const pak)
|
||||
{
|
||||
PakFileStream_t* const fileStream = &pak->fileStream;
|
||||
PakMemoryData_t* const memoryData = &pak->memoryData;
|
||||
PakFileStream_s* const fileStream = &pak->fileStream;
|
||||
PakMemoryData_s* const memoryData = &pak->memoryData;
|
||||
|
||||
// first request is always just the header?
|
||||
size_t readStart = sizeof(PakFileHeader_t);
|
||||
size_t readStart = sizeof(PakFileHeader_s);
|
||||
|
||||
if (fileStream->numDataChunks > 0)
|
||||
readStart = fileStream->numDataChunks * PAK_READ_DATA_CHUNK_SIZE;
|
||||
@ -261,19 +261,19 @@ bool Pak_ProcessPakFile(PakFile_t* const pak)
|
||||
fileStream->bytesStreamed += bytesProcessed;
|
||||
if (v8)
|
||||
{
|
||||
const PakFileHeader_t* pakHeader = &pak->memoryData.pakHeader;
|
||||
const PakFileHeader_s* pakHeader = &pak->memoryData.pakHeader;
|
||||
const uint64_t v16 = fileStream->numDataChunksProcessed * PAK_READ_DATA_CHUNK_SIZE;
|
||||
|
||||
if (v8 == 2)
|
||||
{
|
||||
fileStream->bytesStreamed = bytesProcessed + v16;
|
||||
pakHeader = (PakFileHeader_t*)&fileStream->buffer[v16 & fileStream->bufferMask];
|
||||
pakHeader = (PakFileHeader_s*)&fileStream->buffer[v16 & fileStream->bufferMask];
|
||||
}
|
||||
|
||||
const uint8_t fileIndex = fileStream->numLoadedFiles++ & PAK_MAX_ASYNC_STREAMED_LOAD_REQUESTS_MASK;
|
||||
|
||||
//printf("v16: %lld\n", v16);
|
||||
fileStream->descriptors[fileIndex].dataOffset = v16 + sizeof(PakFileHeader_t);
|
||||
fileStream->descriptors[fileIndex].dataOffset = v16 + sizeof(PakFileHeader_s);
|
||||
fileStream->descriptors[fileIndex].compressedSize = v16 + pakHeader->compressedSize;
|
||||
fileStream->descriptors[fileIndex].decompressedSize = pakHeader->decompressedSize;
|
||||
fileStream->descriptors[fileIndex].compressionMode = pakHeader->GetCompressionMode();
|
||||
@ -285,18 +285,18 @@ bool Pak_ProcessPakFile(PakFile_t* const pak)
|
||||
|
||||
for (; pak->byte1F8 != fileStream->numLoadedFiles; pak->byte1F8++)
|
||||
{
|
||||
PakFileStream_t::Descriptor* v22 = &fileStream->descriptors[pak->byte1F8 & PAK_MAX_ASYNC_STREAMED_LOAD_REQUESTS_MASK];
|
||||
PakFileStream_s::Descriptor* v22 = &fileStream->descriptors[pak->byte1F8 & PAK_MAX_ASYNC_STREAMED_LOAD_REQUESTS_MASK];
|
||||
|
||||
if (pak->byte1FD)
|
||||
{
|
||||
pak->byte1FD = false;
|
||||
pak->inputBytePos = v22->dataOffset;
|
||||
|
||||
if (v22->compressionMode != EPakDecodeMode::MODE_DISABLED)
|
||||
if (v22->compressionMode != PakDecodeMode_e::MODE_DISABLED)
|
||||
{
|
||||
pak->isOffsetted_MAYBE = false;
|
||||
pak->isCompressed = true;
|
||||
memoryData->processedPatchedDataSize = sizeof(PakFileHeader_t);
|
||||
memoryData->processedPatchedDataSize = sizeof(PakFileHeader_s);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -311,8 +311,8 @@ bool Pak_ProcessPakFile(PakFile_t* const pak)
|
||||
const size_t decompressedSize = Pak_InitDecoder(&pak->pakDecoder,
|
||||
fileStream->buffer, pak->decompBuffer,
|
||||
PAK_DECODE_IN_RING_BUFFER_MASK, PAK_DECODE_OUT_RING_BUFFER_MASK,
|
||||
v22->compressedSize - (v22->dataOffset - sizeof(PakFileHeader_t)),
|
||||
v22->dataOffset - sizeof(PakFileHeader_t), sizeof(PakFileHeader_t), v22->compressionMode);
|
||||
v22->compressedSize - (v22->dataOffset - sizeof(PakFileHeader_s)),
|
||||
v22->dataOffset - sizeof(PakFileHeader_s), sizeof(PakFileHeader_s), v22->compressionMode);
|
||||
|
||||
if (decompressedSize != v22->decompressedSize)
|
||||
Error(eDLL_T::RTECH, EXIT_FAILURE,
|
||||
@ -520,7 +520,7 @@ bool Pak_ProcessPakFile(PakFile_t* const pak)
|
||||
|
||||
// sets patch variables for copying the next unprocessed page into the relevant segment buffer
|
||||
// if this is a header page, fetch info from the next unprocessed asset and copy over the asset's header
|
||||
bool SetupNextPageForPatching(PakLoadedInfo_t* a1, PakFile_t* pak)
|
||||
bool SetupNextPageForPatching(PakLoadedInfo_s* a1, PakFile_s* pak)
|
||||
{
|
||||
Pak_RunAssetLoadingJobs(pak);
|
||||
|
||||
@ -538,7 +538,7 @@ bool SetupNextPageForPatching(PakLoadedInfo_t* a1, PakFile_t* pak)
|
||||
if (highestProcessedPageIdx < pak->GetPageCount())
|
||||
v26 = highestProcessedPageIdx;
|
||||
|
||||
const PakPageHeader_t* const nextMemPageHeader = &pak->memoryData.pageHeaders[v26];
|
||||
const PakPageHeader_s* const nextMemPageHeader = &pak->memoryData.pageHeaders[v26];
|
||||
if ((pak->memoryData.segmentHeaders[nextMemPageHeader->segmentIdx].typeFlags & (SF_TEMP | SF_CPU)) != 0)
|
||||
{
|
||||
pak->memoryData.patchSrcSize = nextMemPageHeader->dataSize;
|
||||
@ -549,7 +549,7 @@ bool SetupNextPageForPatching(PakLoadedInfo_t* a1, PakFile_t* pak)
|
||||
}
|
||||
|
||||
// headers
|
||||
PakAsset_t* pakAsset = pak->memoryData.ppAssetEntries[pak->memoryData.someAssetCount];
|
||||
PakAsset_s* pakAsset = pak->memoryData.ppAssetEntries[pak->memoryData.someAssetCount];
|
||||
|
||||
pak->memoryData.patchSrcSize = pakAsset->headerSize;
|
||||
int assetTypeIdx = pakAsset->HashTableIndexForAssetType();
|
||||
@ -560,9 +560,9 @@ bool SetupNextPageForPatching(PakLoadedInfo_t* a1, PakFile_t* pak)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Pak_ProcessAssets(PakLoadedInfo_t* const a1)
|
||||
bool Pak_ProcessAssets(PakLoadedInfo_s* const a1)
|
||||
{
|
||||
PakFile_t* const pak = a1->pakFile;
|
||||
PakFile_s* const pak = a1->pakFile;
|
||||
while (pak->processedAssetCount != pak->GetAssetCount())
|
||||
{
|
||||
// TODO: invert condition and make the branch encompass the whole loop
|
||||
@ -603,7 +603,7 @@ bool Pak_ProcessAssets(PakLoadedInfo_t* const a1)
|
||||
break;
|
||||
}
|
||||
|
||||
PakAsset_t* asset = pak->memoryData.ppAssetEntries[pak->memoryData.someAssetCount];
|
||||
PakAsset_s* asset = pak->memoryData.ppAssetEntries[pak->memoryData.someAssetCount];
|
||||
const uint32_t headPageOffset = asset->headPtr.offset;
|
||||
char* v8 = pak->memoryData.patchDstPtr - asset->headerSize;
|
||||
|
||||
@ -616,7 +616,7 @@ bool Pak_ProcessAssets(PakLoadedInfo_t* const a1)
|
||||
|
||||
for (uint32_t i = pak->memoryData.numShiftedPointers; i < pak->GetPointerCount(); pak->memoryData.numShiftedPointers = i)
|
||||
{
|
||||
PakPage_t* ptr = &pak->memoryData.virtualPointers[i];
|
||||
PakPage_u* ptr = &pak->memoryData.virtualPointers[i];
|
||||
|
||||
ASSERT_PAKPTR_VALID(pak, ptr);
|
||||
|
||||
@ -627,7 +627,7 @@ bool Pak_ProcessAssets(PakLoadedInfo_t* const a1)
|
||||
if (offsetToPointer >= asset->headerSize)
|
||||
break;
|
||||
|
||||
PakPage_t* pagePtr = reinterpret_cast<PakPage_t*>(v8 + offsetToPointer);
|
||||
PakPage_u* pagePtr = reinterpret_cast<PakPage_u*>(v8 + offsetToPointer);
|
||||
|
||||
ASSERT_PAKPTR_VALID(pak, ptr);
|
||||
|
||||
@ -641,7 +641,7 @@ bool Pak_ProcessAssets(PakLoadedInfo_t* const a1)
|
||||
|
||||
for (uint32_t j = 0; j < asset->dependenciesCount; ++j)
|
||||
{
|
||||
PakPage_t* descriptor = &pak->memoryData.guidDescriptors[asset->dependenciesIndex + j];
|
||||
PakPage_u* descriptor = &pak->memoryData.guidDescriptors[asset->dependenciesIndex + j];
|
||||
|
||||
if (descriptor->index == shiftedPageIndex)
|
||||
descriptor->offset += offsetSize;
|
||||
@ -649,7 +649,7 @@ bool Pak_ProcessAssets(PakLoadedInfo_t* const a1)
|
||||
|
||||
const uint32_t v16 = ++pak->memoryData.someAssetCount;
|
||||
|
||||
PakAsset_t* v17 = nullptr;
|
||||
PakAsset_s* v17 = nullptr;
|
||||
if (v16 < pak->GetAssetCount() && (v17 = pak->memoryData.ppAssetEntries[v16], v17->headPtr.index == shiftedPageIndex))
|
||||
{
|
||||
pak->memoryData.field_2A8 = v17->headPtr.offset - headPageOffset - asset->headerSize;
|
||||
@ -675,7 +675,7 @@ bool Pak_ProcessAssets(PakLoadedInfo_t* const a1)
|
||||
return false;
|
||||
|
||||
uint32_t i = 0;
|
||||
PakAsset_t* pAsset = nullptr;
|
||||
PakAsset_s* pAsset = nullptr;
|
||||
|
||||
for (int j = pak->memoryData.pakId & PAK_MAX_LOADED_PAKS_MASK; i < pak->GetHeader().assetCount; a1->assetGuids[i - 1] = pAsset->guid)
|
||||
{
|
||||
@ -686,7 +686,7 @@ bool Pak_ProcessAssets(PakLoadedInfo_t* const a1)
|
||||
Pak_ResolveAssetRelations(pak, pAsset);
|
||||
|
||||
const int assetIndex = pak->memoryData.loadedAssetIndices[i];
|
||||
const PakAssetShort_t& loadedAsset = g_pakGlobals->loadedAssets[assetIndex];
|
||||
const PakAssetShort_s& loadedAsset = g_pakGlobals->loadedAssets[assetIndex];
|
||||
|
||||
if (g_pakGlobals->trackedAssets[loadedAsset.trackerIndex].loadedPakIndex == j)
|
||||
{
|
||||
@ -733,24 +733,24 @@ bool Pak_ProcessAssets(PakLoadedInfo_t* const a1)
|
||||
if (g_pakGlobals->pakTracker)
|
||||
sub_14043D870(a1, 0);
|
||||
|
||||
a1->status = EPakStatus::PAK_STATUS_LOADED;
|
||||
a1->status = PakStatus_e::PAK_STATUS_LOADED;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void Pak_StubInvalidAssetBinds(PakFile_t* const pak, PakSegmentDescriptor_t* const desc)
|
||||
void Pak_StubInvalidAssetBinds(PakFile_s* const pak, PakSegmentDescriptor_s* const desc)
|
||||
{
|
||||
for (uint32_t i = 0; i < pak->GetAssetCount(); ++i)
|
||||
{
|
||||
PakAsset_t* const asset = &pak->memoryData.assetEntries[i];
|
||||
PakAsset_s* const asset = &pak->memoryData.assetEntries[i];
|
||||
pak->memoryData.ppAssetEntries[i] = asset;
|
||||
|
||||
const uint8_t assetTypeIndex = asset->HashTableIndexForAssetType();
|
||||
desc->assetTypeCount[assetTypeIndex]++;
|
||||
|
||||
PakAssetBinding_t* const assetBinding = &g_pakGlobals->assetBindings[assetTypeIndex];
|
||||
PakAssetBinding_s* const assetBinding = &g_pakGlobals->assetBindings[assetTypeIndex];
|
||||
|
||||
if (assetBinding->type == PakAssetBinding_t::NONE)
|
||||
if (assetBinding->type == PakAssetBinding_s::NONE)
|
||||
{
|
||||
assetBinding->extension = asset->magic;
|
||||
assetBinding->version = asset->version;
|
||||
@ -762,7 +762,7 @@ void Pak_StubInvalidAssetBinds(PakFile_t* const pak, PakSegmentDescriptor_t* con
|
||||
assetBinding->headerSize = asset->headerSize;
|
||||
assetBinding->nativeClassSize = asset->headerSize;
|
||||
assetBinding->headerAlignment = pak->memoryData.pageHeaders[asset->headPtr.index].pageAlignment;
|
||||
assetBinding->type = PakAssetBinding_t::STUB;
|
||||
assetBinding->type = PakAssetBinding_s::STUB;
|
||||
}
|
||||
|
||||
// this is dev only because it could spam a lot on older paks
|
||||
@ -784,14 +784,14 @@ void Pak_StubInvalidAssetBinds(PakFile_t* const pak, PakSegmentDescriptor_t* con
|
||||
}
|
||||
}
|
||||
|
||||
bool Pak_StartLoadingPak(PakLoadedInfo_t* const loadedInfo)
|
||||
bool Pak_StartLoadingPak(PakLoadedInfo_s* const loadedInfo)
|
||||
{
|
||||
PakFile_t* const pakFile = loadedInfo->pakFile;
|
||||
PakFile_s* const pakFile = loadedInfo->pakFile;
|
||||
|
||||
if (pakFile->memoryData.patchSrcSize && !Pak_ProcessPakFile(pakFile))
|
||||
return false;
|
||||
|
||||
PakSegmentDescriptor_t pakDescriptor = {};
|
||||
PakSegmentDescriptor_s pakDescriptor = {};
|
||||
|
||||
Pak_StubInvalidAssetBinds(pakFile, &pakDescriptor);
|
||||
|
||||
@ -823,7 +823,7 @@ bool Pak_StartLoadingPak(PakLoadedInfo_t* const loadedInfo)
|
||||
|
||||
Pak_CopyPagesToSegments(pakFile, loadedInfo, &pakDescriptor);
|
||||
|
||||
const PakFileHeader_t& pakHdr = pakFile->GetHeader();
|
||||
const PakFileHeader_s& pakHdr = pakFile->GetHeader();
|
||||
|
||||
if (Pak_StreamingEnabled())
|
||||
Pak_LoadStreamingData(loadedInfo);
|
||||
@ -833,12 +833,12 @@ bool Pak_StartLoadingPak(PakLoadedInfo_t* const loadedInfo)
|
||||
|
||||
pakFile->dword14 = 1;
|
||||
|
||||
PakMemoryData_t& memoryData = pakFile->memoryData;
|
||||
PakMemoryData_s& memoryData = pakFile->memoryData;
|
||||
|
||||
memoryData.patchSrcSize = pakFile->memoryData.qword2D0 - patchDestOffset;
|
||||
memoryData.patchDstPtr = (char*)&pakHdr + patchDestOffset;
|
||||
|
||||
loadedInfo->status = EPakStatus::PAK_STATUS_LOAD_PAKHDR;
|
||||
loadedInfo->status = PakStatus_e::PAK_STATUS_LOAD_PAKHDR;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -11,22 +11,22 @@
|
||||
inline PakHandle_t(*v_Pak_Initialize)(int mode);
|
||||
|
||||
inline PakHandle_t(*v_Pak_LoadAsync)(const char* fileName, CAlignedMemAlloc* allocator, int nIdx, bool bUnk);
|
||||
inline EPakStatus(*v_Pak_WaitAsync)(PakHandle_t handle, void* finishCallback);
|
||||
inline PakStatus_e(*v_Pak_WaitAsync)(PakHandle_t handle, void* finishCallback);
|
||||
inline void(*v_Pak_UnloadAsync)(PakHandle_t handle);
|
||||
inline void(*v_Pak_RegisterAsset)(int, int, const char*, void*, void*, void*, void*, int, int, uint32_t, int, int);
|
||||
|
||||
inline bool(*v_Pak_StartLoadingPak)(PakLoadedInfo_t* loadedInfo);
|
||||
inline bool(*v_Pak_ProcessPakFile)(PakFile_t* const pak);
|
||||
inline bool(*v_Pak_ProcessAssets)(PakLoadedInfo_t* pakInfo);
|
||||
inline void(*v_Pak_ResolveAssetRelations)(PakFile_t* const pak, const PakAsset_t* const asset);
|
||||
inline bool(*v_Pak_StartLoadingPak)(PakLoadedInfo_s* loadedInfo);
|
||||
inline bool(*v_Pak_ProcessPakFile)(PakFile_s* const pak);
|
||||
inline bool(*v_Pak_ProcessAssets)(PakLoadedInfo_s* pakInfo);
|
||||
inline void(*v_Pak_ResolveAssetRelations)(PakFile_s* const pak, const PakAsset_s* const asset);
|
||||
|
||||
inline void (*v_Pak_RunAssetLoadingJobs)(PakFile_t* pak);
|
||||
inline void (*Pak_ProcessAssetRelationsAndResolveDependencies)(PakFile_t* pak_arg, PakAsset_t* asset_arg, unsigned int asset_idx_arg, unsigned int a4);
|
||||
inline void (*v_Pak_RunAssetLoadingJobs)(PakFile_s* pak);
|
||||
inline void (*Pak_ProcessAssetRelationsAndResolveDependencies)(PakFile_s* pak_arg, PakAsset_s* asset_arg, unsigned int asset_idx_arg, unsigned int a4);
|
||||
|
||||
inline int (*Pak_TrackAsset)(PakFile_t* const a1, PakAsset_t* a2);
|
||||
inline int (*Pak_TrackAsset)(PakFile_s* const a1, PakAsset_s* a2);
|
||||
|
||||
// TODO: name these!
|
||||
inline void (*sub_14043D870)(PakLoadedInfo_t* a1, int a2);
|
||||
inline void (*sub_14043D870)(PakLoadedInfo_s* a1, int a2);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class V_PakParse : public IDetour
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "rtech/ipakfile.h"
|
||||
#include "pakpatch.h"
|
||||
|
||||
bool PATCH_CMD_0(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
bool PATCH_CMD_0(PakFile_s* const pak, size_t* const numAvailableBytes)
|
||||
{
|
||||
unsigned __int64 m_numBytesToProcess_maybe; // r9
|
||||
unsigned __int64 v4; // rdi
|
||||
@ -83,7 +83,7 @@ bool PATCH_CMD_0(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
return pak->memoryData.numBytesToProcess_maybe == 0;
|
||||
}
|
||||
|
||||
bool PATCH_CMD_1(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
bool PATCH_CMD_1(PakFile_s* const pak, size_t* const numAvailableBytes)
|
||||
{
|
||||
unsigned __int64 m_numBytesToProcess_maybe; // r8
|
||||
size_t v3; // r9
|
||||
@ -111,7 +111,7 @@ bool PATCH_CMD_1(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
}
|
||||
}
|
||||
|
||||
bool PATCH_CMD_2(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
bool PATCH_CMD_2(PakFile_s* const pak, size_t* const numAvailableBytes)
|
||||
{
|
||||
NOTE_UNUSED(numAvailableBytes);
|
||||
|
||||
@ -153,7 +153,7 @@ bool PATCH_CMD_2(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
return pak->memoryData.numBytesToProcess_maybe == 0;
|
||||
}
|
||||
|
||||
bool PATCH_CMD_3(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
bool PATCH_CMD_3(PakFile_s* const pak, size_t* const numAvailableBytes)
|
||||
{
|
||||
size_t patchSrcSize = pak->memoryData.patchSrcSize;
|
||||
|
||||
@ -172,7 +172,7 @@ bool PATCH_CMD_3(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
return pak->memoryData.numBytesToProcess_maybe == 0;
|
||||
}
|
||||
|
||||
bool PATCH_CMD_4_5(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
bool PATCH_CMD_4_5(PakFile_s* const pak, size_t* const numAvailableBytes)
|
||||
{
|
||||
const size_t v2 = *numAvailableBytes;
|
||||
if (!v2)
|
||||
@ -188,7 +188,7 @@ bool PATCH_CMD_4_5(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
return PATCH_CMD_0(pak, numAvailableBytes);
|
||||
}
|
||||
|
||||
bool PATCH_CMD_6(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
bool PATCH_CMD_6(PakFile_s* const pak, size_t* const numAvailableBytes)
|
||||
{
|
||||
const size_t v2 = *numAvailableBytes;
|
||||
size_t v3 = 2;
|
||||
@ -238,7 +238,7 @@ bool PATCH_CMD_6(PakFile_t* const pak, size_t* const numAvailableBytes)
|
||||
return false;
|
||||
}
|
||||
|
||||
const PakPatchFuncs_t g_pakPatchApi
|
||||
const PakPatchFuncs_s g_pakPatchApi
|
||||
{
|
||||
PATCH_CMD_0,
|
||||
PATCH_CMD_1,
|
||||
|
@ -2,6 +2,6 @@
|
||||
#define RTECH_PATCHAPI_H
|
||||
#include "rtech/ipakfile.h"
|
||||
|
||||
extern const PakPatchFuncs_t g_pakPatchApi;
|
||||
extern const PakPatchFuncs_s g_pakPatchApi;
|
||||
|
||||
#endif // RTECH_PATCHAPI_H
|
||||
|
@ -24,9 +24,9 @@ static void Pak_ListPaks_f()
|
||||
|
||||
for (int16_t i = 0, n = g_pakGlobals->loadedPakCount; i < n; ++i)
|
||||
{
|
||||
const PakLoadedInfo_t& info = g_pakGlobals->loadedPaks[i];
|
||||
const PakLoadedInfo_s& info = g_pakGlobals->loadedPaks[i];
|
||||
|
||||
if (info.status == EPakStatus::PAK_STATUS_FREED)
|
||||
if (info.status == PakStatus_e::PAK_STATUS_FREED)
|
||||
continue;
|
||||
|
||||
const char* szRpakStatus = Pak_StatusToString(info.status);
|
||||
@ -54,7 +54,7 @@ static void Pak_ListTypes_f()
|
||||
|
||||
for (int8_t i = 0; i < PAK_MAX_TRACKED_TYPES; ++i)
|
||||
{
|
||||
PakAssetBinding_t* type = &g_pakGlobals->assetBindings[i];
|
||||
PakAssetBinding_s* type = &g_pakGlobals->assetBindings[i];
|
||||
|
||||
if (!type->description)
|
||||
continue;
|
||||
@ -85,7 +85,7 @@ static void Pak_RequestUnload_f(const CCommand& args)
|
||||
if (args.HasOnlyDigits(1))
|
||||
{
|
||||
const PakHandle_t pakHandle = atoi(args.Arg(1));
|
||||
const PakLoadedInfo_t* const pakInfo = Pak_GetPakInfo(pakHandle);
|
||||
const PakLoadedInfo_s* const pakInfo = Pak_GetPakInfo(pakHandle);
|
||||
|
||||
if (!pakInfo)
|
||||
{
|
||||
@ -98,7 +98,7 @@ static void Pak_RequestUnload_f(const CCommand& args)
|
||||
}
|
||||
else
|
||||
{
|
||||
const PakLoadedInfo_t* const pakInfo = Pak_GetPakInfo(args.Arg(1));
|
||||
const PakLoadedInfo_s* const pakInfo = Pak_GetPakInfo(args.Arg(1));
|
||||
if (!pakInfo)
|
||||
{
|
||||
Warning(eDLL_T::RTECH, "Found no pak entry for specified name.\n");
|
||||
@ -136,7 +136,7 @@ static void Pak_Swap_f(const CCommand& args)
|
||||
const char* pakName = nullptr;
|
||||
|
||||
PakHandle_t pakHandle = PAK_INVALID_HANDLE;
|
||||
const PakLoadedInfo_t* pakInfo = nullptr;
|
||||
const PakLoadedInfo_s* pakInfo = nullptr;
|
||||
|
||||
if (args.HasOnlyDigits(1))
|
||||
{
|
||||
@ -168,7 +168,7 @@ static void Pak_Swap_f(const CCommand& args)
|
||||
Msg(eDLL_T::RTECH, "Requested pak swap for handle '%d'\n", pakHandle);
|
||||
g_pakLoadApi->UnloadAsync(pakHandle);
|
||||
|
||||
while (pakInfo->status != EPakStatus::PAK_STATUS_FREED) // Wait till this slot gets free'd.
|
||||
while (pakInfo->status != PakStatus_e::PAK_STATUS_FREED) // Wait till this slot gets free'd.
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
|
||||
g_pakLoadApi->LoadAsync(pakName, AlignedMemAlloc(), NULL, 0);
|
||||
|
@ -18,7 +18,7 @@ struct PakLoadFuncs_s
|
||||
char unknown2[16];
|
||||
void* Func7;
|
||||
void* Func8;
|
||||
EPakStatus(*WaitAsync)(PakHandle_t handle, void* finishCallback);
|
||||
PakStatus_e(*WaitAsync)(PakHandle_t handle, void* finishCallback);
|
||||
void* Func10;
|
||||
void* Func11;
|
||||
void* FindByGUID;
|
||||
@ -47,7 +47,7 @@ struct PakLoadFuncs_s
|
||||
void* Func33;
|
||||
};
|
||||
|
||||
inline PakGlobals_s* g_pakGlobals;
|
||||
inline PakGlobalState_s* g_pakGlobals;
|
||||
extern PakLoadFuncs_s* g_pakLoadApi;
|
||||
|
||||
inline JobHelpCallback_t g_pPakFifoLockWrapper; // Pointer to functor that takes the global pak fifolock as argument.
|
||||
@ -72,7 +72,7 @@ class V_PakState : public IDetour
|
||||
virtual void GetFun(void) const { }
|
||||
virtual void GetVar(void) const
|
||||
{
|
||||
g_pakGlobals = g_GameDll.FindPatternSIMD("48 8D 1D ?? ?? ?? ?? 45 8D 5A 0E").ResolveRelativeAddressSelf(0x3, 0x7).RCast<PakGlobals_s*>();
|
||||
g_pakGlobals = g_GameDll.FindPatternSIMD("48 8D 1D ?? ?? ?? ?? 45 8D 5A 0E").ResolveRelativeAddressSelf(0x3, 0x7).RCast<PakGlobalState_s*>();
|
||||
g_pakLoadApi = CMemory(v_LauncherMain).Offset(0x820).FindPatternSelf("48 89").ResolveRelativeAddressSelf(0x3, 0x7).RCast<PakLoadFuncs_s*>();
|
||||
|
||||
const CMemory jtBase(JT_HelpWithAnything);
|
||||
|
@ -45,12 +45,12 @@ static bool Pak_OptionalStreamingDataDownloaded()
|
||||
//-----------------------------------------------------------------------------
|
||||
// opens all associated streaming assets for this pak
|
||||
//-----------------------------------------------------------------------------
|
||||
void Pak_OpenAssociatedStreamingFiles(PakLoadedInfo_t* const loadedInfo, PakLoadedInfo_t::StreamingInfo_t& streamInfo,
|
||||
const uint16_t fileNamesBufSize, const EPakStreamSet set)
|
||||
void Pak_OpenAssociatedStreamingFiles(PakLoadedInfo_s* const loadedInfo, PakLoadedInfo_s::StreamingInfo_t& streamInfo,
|
||||
const uint16_t fileNamesBufSize, const PakStreamSet_e set)
|
||||
{
|
||||
assert(set < STREAMING_SET_COUNT);
|
||||
|
||||
const PakMemoryData_t& memoryData = loadedInfo->pakFile->memoryData;
|
||||
const PakMemoryData_s& memoryData = loadedInfo->pakFile->memoryData;
|
||||
uint16_t numStreamFiles = 0;
|
||||
|
||||
// load all streaming sets
|
||||
@ -83,7 +83,7 @@ void Pak_OpenAssociatedStreamingFiles(PakLoadedInfo_t* const loadedInfo, PakLoad
|
||||
//-----------------------------------------------------------------------------
|
||||
// allocates the pak string to be used for embedded streaming data
|
||||
//-----------------------------------------------------------------------------
|
||||
void Pak_EnableEmbeddedStreamingData(PakLoadedInfo_t* const loadedInfo, PakLoadedInfo_t::StreamingInfo_t& streamInfo)
|
||||
void Pak_EnableEmbeddedStreamingData(PakLoadedInfo_s* const loadedInfo, PakLoadedInfo_s::StreamingInfo_t& streamInfo)
|
||||
{
|
||||
const char* const baseName = V_UnqualifiedFileName(loadedInfo->fileName);
|
||||
const size_t baseNameLen = strlen(baseName);
|
||||
@ -113,13 +113,13 @@ void Pak_EnableEmbeddedStreamingData(PakLoadedInfo_t* const loadedInfo, PakLoade
|
||||
//-----------------------------------------------------------------------------
|
||||
// parse and open all streaming files
|
||||
//-----------------------------------------------------------------------------
|
||||
void Pak_LoadStreamingData(PakLoadedInfo_t* const loadedInfo)
|
||||
void Pak_LoadStreamingData(PakLoadedInfo_s* const loadedInfo)
|
||||
{
|
||||
const PakFileHeader_t& pakHeader = loadedInfo->pakFile->GetHeader();
|
||||
const PakFileHeader_s& pakHeader = loadedInfo->pakFile->GetHeader();
|
||||
|
||||
for (int i = 0; i < STREAMING_SET_COUNT; i++)
|
||||
{
|
||||
PakLoadedInfo_t::StreamingInfo_t& streamInfo = loadedInfo->streamInfo[i];
|
||||
PakLoadedInfo_s::StreamingInfo_t& streamInfo = loadedInfo->streamInfo[i];
|
||||
streamInfo.Reset();
|
||||
|
||||
const bool optional = (i == STREAMING_SET_OPTIONAL);
|
||||
@ -141,7 +141,7 @@ void Pak_LoadStreamingData(PakLoadedInfo_t* const loadedInfo)
|
||||
// external streaming files; mistake while building the pak?
|
||||
assert(!embeddedStreamingDataSize);
|
||||
|
||||
Pak_OpenAssociatedStreamingFiles(loadedInfo, streamInfo, filesBufLen, EPakStreamSet(i));
|
||||
Pak_OpenAssociatedStreamingFiles(loadedInfo, streamInfo, filesBufLen, PakStreamSet_e(i));
|
||||
}
|
||||
else if (embeddedStreamingDataSize > 0)
|
||||
{
|
||||
|
@ -3,11 +3,11 @@
|
||||
#include "rtech/ipakfile.h"
|
||||
#include "pakstate.h"
|
||||
|
||||
extern void Pak_OpenAssociatedStreamingFiles(PakLoadedInfo_t* const loadedInfo, PakLoadedInfo_t::StreamingInfo_t& streamInfo,
|
||||
const uint16_t fileNamesBufSize, const EPakStreamSet set);
|
||||
extern void Pak_OpenAssociatedStreamingFiles(PakLoadedInfo_s* const loadedInfo, PakLoadedInfo_s::StreamingInfo_t& streamInfo,
|
||||
const uint16_t fileNamesBufSize, const PakStreamSet_e set);
|
||||
|
||||
extern void Pak_EnableEmbeddedStreamingData(PakLoadedInfo_t* const loadedInfo, PakLoadedInfo_t::StreamingInfo_t& streamInfo);
|
||||
extern void Pak_LoadStreamingData(PakLoadedInfo_t* const loadedInfo);
|
||||
extern void Pak_EnableEmbeddedStreamingData(PakLoadedInfo_s* const loadedInfo, PakLoadedInfo_s::StreamingInfo_t& streamInfo);
|
||||
extern void Pak_LoadStreamingData(PakLoadedInfo_s* const loadedInfo);
|
||||
|
||||
// the current download progress of optional streaming assets
|
||||
inline float* g_pStreamingDownloadProgress = nullptr;
|
||||
|
@ -77,26 +77,26 @@ int Pak_FileExists(const char* const pakFilePath)
|
||||
//-----------------------------------------------------------------------------
|
||||
// returns pak status as string
|
||||
//-----------------------------------------------------------------------------
|
||||
const char* Pak_StatusToString(const EPakStatus status)
|
||||
const char* Pak_StatusToString(const PakStatus_e status)
|
||||
{
|
||||
switch (status)
|
||||
{
|
||||
case EPakStatus::PAK_STATUS_FREED: return "PAK_STATUS_FREED";
|
||||
case EPakStatus::PAK_STATUS_LOAD_PENDING: return "PAK_STATUS_LOAD_PENDING";
|
||||
case EPakStatus::PAK_STATUS_REPAK_RUNNING: return "PAK_STATUS_REPAK_RUNNING";
|
||||
case EPakStatus::PAK_STATUS_REPAK_DONE: return "PAK_STATUS_REPAK_DONE";
|
||||
case EPakStatus::PAK_STATUS_LOAD_STARTING: return "PAK_STATUS_LOAD_STARTING";
|
||||
case EPakStatus::PAK_STATUS_LOAD_PAKHDR: return "PAK_STATUS_LOAD_PAKHDR";
|
||||
case EPakStatus::PAK_STATUS_LOAD_PATCH_INIT: return "PAK_STATUS_LOAD_PATCH_INIT";
|
||||
case EPakStatus::PAK_STATUS_LOAD_PATCH_EDIT_STREAM: return "PAK_STATUS_LOAD_PATCH_EDIT_STREAM";
|
||||
case EPakStatus::PAK_STATUS_LOAD_ASSETS: return "PAK_STATUS_LOAD_ASSETS";
|
||||
case EPakStatus::PAK_STATUS_LOADED: return "PAK_STATUS_LOADED";
|
||||
case EPakStatus::PAK_STATUS_UNLOAD_PENDING: return "PAK_STATUS_UNLOAD_PENDING";
|
||||
case EPakStatus::PAK_STATUS_FREE_PENDING: return "PAK_STATUS_FREE_PENDING";
|
||||
case EPakStatus::PAK_STATUS_CANCELING: return "PAK_STATUS_CANCELING";
|
||||
case EPakStatus::PAK_STATUS_ERROR: return "PAK_STATUS_ERROR";
|
||||
case EPakStatus::PAK_STATUS_INVALID_PAKHANDLE: return "PAK_STATUS_INVALID_PAKHANDLE";
|
||||
case EPakStatus::PAK_STATUS_BUSY: return "PAK_STATUS_BUSY";
|
||||
case PakStatus_e::PAK_STATUS_FREED: return "PAK_STATUS_FREED";
|
||||
case PakStatus_e::PAK_STATUS_LOAD_PENDING: return "PAK_STATUS_LOAD_PENDING";
|
||||
case PakStatus_e::PAK_STATUS_REPAK_RUNNING: return "PAK_STATUS_REPAK_RUNNING";
|
||||
case PakStatus_e::PAK_STATUS_REPAK_DONE: return "PAK_STATUS_REPAK_DONE";
|
||||
case PakStatus_e::PAK_STATUS_LOAD_STARTING: return "PAK_STATUS_LOAD_STARTING";
|
||||
case PakStatus_e::PAK_STATUS_LOAD_PAKHDR: return "PAK_STATUS_LOAD_PAKHDR";
|
||||
case PakStatus_e::PAK_STATUS_LOAD_PATCH_INIT: return "PAK_STATUS_LOAD_PATCH_INIT";
|
||||
case PakStatus_e::PAK_STATUS_LOAD_PATCH_EDIT_STREAM: return "PAK_STATUS_LOAD_PATCH_EDIT_STREAM";
|
||||
case PakStatus_e::PAK_STATUS_LOAD_ASSETS: return "PAK_STATUS_LOAD_ASSETS";
|
||||
case PakStatus_e::PAK_STATUS_LOADED: return "PAK_STATUS_LOADED";
|
||||
case PakStatus_e::PAK_STATUS_UNLOAD_PENDING: return "PAK_STATUS_UNLOAD_PENDING";
|
||||
case PakStatus_e::PAK_STATUS_FREE_PENDING: return "PAK_STATUS_FREE_PENDING";
|
||||
case PakStatus_e::PAK_STATUS_CANCELING: return "PAK_STATUS_CANCELING";
|
||||
case PakStatus_e::PAK_STATUS_ERROR: return "PAK_STATUS_ERROR";
|
||||
case PakStatus_e::PAK_STATUS_INVALID_PAKHANDLE: return "PAK_STATUS_INVALID_PAKHANDLE";
|
||||
case PakStatus_e::PAK_STATUS_BUSY: return "PAK_STATUS_BUSY";
|
||||
default: return "PAK_STATUS_UNKNOWN";
|
||||
}
|
||||
}
|
||||
@ -104,12 +104,12 @@ const char* Pak_StatusToString(const EPakStatus status)
|
||||
//-----------------------------------------------------------------------------
|
||||
// returns pak decoder as string
|
||||
//-----------------------------------------------------------------------------
|
||||
const char* Pak_DecoderToString(const EPakDecodeMode mode)
|
||||
const char* Pak_DecoderToString(const PakDecodeMode_e mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case EPakDecodeMode::MODE_RTECH: return "RTech";
|
||||
case EPakDecodeMode::MODE_ZSTD: return "ZStd";
|
||||
case PakDecodeMode_e::MODE_RTECH: return "RTech";
|
||||
case PakDecodeMode_e::MODE_ZSTD: return "ZStd";
|
||||
}
|
||||
|
||||
UNREACHABLE();
|
||||
@ -253,7 +253,7 @@ PakGuid_t Pak_StringToGuid(const char* const string)
|
||||
//-----------------------------------------------------------------------------
|
||||
// gets information about loaded pak file via pak id
|
||||
//-----------------------------------------------------------------------------
|
||||
PakLoadedInfo_t* Pak_GetPakInfo(const PakHandle_t pakId)
|
||||
PakLoadedInfo_s* Pak_GetPakInfo(const PakHandle_t pakId)
|
||||
{
|
||||
return &g_pakGlobals->loadedPaks[pakId & PAK_MAX_LOADED_PAKS_MASK];
|
||||
}
|
||||
@ -261,11 +261,11 @@ PakLoadedInfo_t* Pak_GetPakInfo(const PakHandle_t pakId)
|
||||
//-----------------------------------------------------------------------------
|
||||
// gets information about loaded pak file via pak name
|
||||
//-----------------------------------------------------------------------------
|
||||
const PakLoadedInfo_t* Pak_GetPakInfo(const char* const pakName)
|
||||
const PakLoadedInfo_s* Pak_GetPakInfo(const char* const pakName)
|
||||
{
|
||||
for (int16_t i = 0; i < g_pakGlobals->loadedPakCount; ++i)
|
||||
{
|
||||
const PakLoadedInfo_t* const info = &g_pakGlobals->loadedPaks[i];
|
||||
const PakLoadedInfo_s* const info = &g_pakGlobals->loadedPaks[i];
|
||||
if (!info)
|
||||
continue;
|
||||
|
||||
@ -285,27 +285,27 @@ const PakLoadedInfo_t* Pak_GetPakInfo(const char* const pakName)
|
||||
//-----------------------------------------------------------------------------
|
||||
// returns a pointer to the patch data header
|
||||
//-----------------------------------------------------------------------------
|
||||
PakPatchDataHeader_t* Pak_GetPatchDataHeader(PakFileHeader_t* const pakHeader)
|
||||
PakPatchDataHeader_s* Pak_GetPatchDataHeader(PakFileHeader_s* const pakHeader)
|
||||
{
|
||||
// shouldn't be called if the pak doesn1't have patches!
|
||||
assert(pakHeader->patchIndex > 0);
|
||||
return reinterpret_cast<PakPatchDataHeader_t*>(reinterpret_cast<uint8_t* const>(pakHeader) + sizeof(PakFileHeader_t));
|
||||
return reinterpret_cast<PakPatchDataHeader_s*>(reinterpret_cast<uint8_t* const>(pakHeader) + sizeof(PakFileHeader_s));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// returns a pointer to the patch file header
|
||||
//-----------------------------------------------------------------------------
|
||||
PakPatchFileHeader_t* Pak_GetPatchFileHeader(PakFileHeader_t* const pakHeader, const int index)
|
||||
PakPatchFileHeader_s* Pak_GetPatchFileHeader(PakFileHeader_s* const pakHeader, const int index)
|
||||
{
|
||||
assert(pakHeader->patchIndex > 0 && index < pakHeader->patchIndex);
|
||||
uint8_t* address = reinterpret_cast<uint8_t* const>(pakHeader);
|
||||
|
||||
// skip the file header
|
||||
address += sizeof(PakFileHeader_t);
|
||||
address += sizeof(PakFileHeader_s);
|
||||
|
||||
// skip the patch data header, the patch file headers start from there
|
||||
address += sizeof(PakPatchDataHeader_t);
|
||||
PakPatchFileHeader_t* const patchHeaders = reinterpret_cast<PakPatchFileHeader_t* const>(address);
|
||||
address += sizeof(PakPatchDataHeader_s);
|
||||
PakPatchFileHeader_s* const patchHeaders = reinterpret_cast<PakPatchFileHeader_s* const>(address);
|
||||
|
||||
return &patchHeaders[index];
|
||||
}
|
||||
@ -313,13 +313,13 @@ PakPatchFileHeader_t* Pak_GetPatchFileHeader(PakFileHeader_t* const pakHeader, c
|
||||
//-----------------------------------------------------------------------------
|
||||
// returns the patch number belonging to the index provided
|
||||
//-----------------------------------------------------------------------------
|
||||
short Pak_GetPatchNumberForIndex(PakFileHeader_t* const pakHeader, const int index)
|
||||
short Pak_GetPatchNumberForIndex(PakFileHeader_s* const pakHeader, const int index)
|
||||
{
|
||||
assert(pakHeader->patchIndex > 0 && index < pakHeader->patchIndex);
|
||||
const uint8_t* patchHeader = reinterpret_cast<const uint8_t*>(Pak_GetPatchFileHeader(pakHeader, pakHeader->patchIndex - 1));
|
||||
|
||||
// skip the last patch file header, the patch number start from there
|
||||
patchHeader += sizeof(PakPatchFileHeader_t);
|
||||
patchHeader += sizeof(PakPatchFileHeader_s);
|
||||
const short* patchNumber = reinterpret_cast<const short*>(patchHeader);
|
||||
|
||||
return patchNumber[index];
|
||||
@ -347,7 +347,7 @@ bool Pak_UpdatePatchHeaders(uint8_t* const inBuf, const char* const outPakFile)
|
||||
|
||||
// NOTE: we modify the in buffer as the patch headers belong to the
|
||||
// compressed section
|
||||
PakFileHeader_t* const inHeader = reinterpret_cast<PakFileHeader_t* const>(inBuf);
|
||||
PakFileHeader_s* const inHeader = reinterpret_cast<PakFileHeader_s* const>(inBuf);
|
||||
|
||||
// update each patch header
|
||||
for (uint16_t i = 0; i < inHeader->patchIndex; i++)
|
||||
@ -371,13 +371,13 @@ bool Pak_UpdatePatchHeaders(uint8_t* const inBuf, const char* const outPakFile)
|
||||
const size_t fileSize = inPatch.GetSize();
|
||||
|
||||
// pak appears truncated
|
||||
if (fileSize <= sizeof(PakFileHeader_t))
|
||||
if (fileSize <= sizeof(PakFileHeader_s))
|
||||
return false;
|
||||
|
||||
DevMsg(eDLL_T::RTECH, "%s: updating patch header for pak '%s', new size = %zu\n",
|
||||
__FUNCTION__, patchFile, fileSize);
|
||||
|
||||
PakPatchFileHeader_t* const patchHeader = Pak_GetPatchFileHeader(inHeader, i);
|
||||
PakPatchFileHeader_s* const patchHeader = Pak_GetPatchFileHeader(inHeader, i);
|
||||
patchHeader->compressedSize = fileSize;
|
||||
}
|
||||
|
||||
@ -387,7 +387,7 @@ bool Pak_UpdatePatchHeaders(uint8_t* const inBuf, const char* const outPakFile)
|
||||
//-----------------------------------------------------------------------------
|
||||
// prints the pak header details to the console
|
||||
//-----------------------------------------------------------------------------
|
||||
void Pak_ShowHeaderDetails(const PakFileHeader_t* const pakHeader)
|
||||
void Pak_ShowHeaderDetails(const PakFileHeader_s* const pakHeader)
|
||||
{
|
||||
SYSTEMTIME systemTime;
|
||||
FileTimeToSystemTime(&pakHeader->fileTime, &systemTime);
|
||||
|
@ -12,20 +12,20 @@ extern bool Pak_FileOverrideExists(const char* const pakFilePath, char* const ou
|
||||
|
||||
extern int Pak_FileExists(const char* const pakFilePath);
|
||||
|
||||
extern const char* Pak_StatusToString(const EPakStatus status);
|
||||
const char* Pak_DecoderToString(const EPakDecodeMode mode);
|
||||
extern const char* Pak_StatusToString(const PakStatus_e status);
|
||||
const char* Pak_DecoderToString(const PakDecodeMode_e mode);
|
||||
|
||||
extern PakGuid_t Pak_StringToGuid(const char* const string);
|
||||
|
||||
extern PakLoadedInfo_t* Pak_GetPakInfo(const PakHandle_t pakId);
|
||||
extern const PakLoadedInfo_t* Pak_GetPakInfo(const char* const pakName);
|
||||
extern PakLoadedInfo_s* Pak_GetPakInfo(const PakHandle_t pakId);
|
||||
extern const PakLoadedInfo_s* Pak_GetPakInfo(const char* const pakName);
|
||||
|
||||
extern PakPatchDataHeader_t* Pak_GetPatchDataHeader(PakFileHeader_t* const pakHeader);
|
||||
extern PakPatchFileHeader_t* Pak_GetPatchFileHeader(PakFileHeader_t* const pakHeader, const int index);
|
||||
extern short Pak_GetPatchNumberForIndex(PakFileHeader_t* const pakHeader, const int index);
|
||||
extern PakPatchDataHeader_s* Pak_GetPatchDataHeader(PakFileHeader_s* const pakHeader);
|
||||
extern PakPatchFileHeader_s* Pak_GetPatchFileHeader(PakFileHeader_s* const pakHeader, const int index);
|
||||
extern short Pak_GetPatchNumberForIndex(PakFileHeader_s* const pakHeader, const int index);
|
||||
|
||||
extern bool Pak_UpdatePatchHeaders(uint8_t* const inBuf, const char* const outPakFile);
|
||||
|
||||
extern void Pak_ShowHeaderDetails(const PakFileHeader_t* const pakHeader);
|
||||
extern void Pak_ShowHeaderDetails(const PakFileHeader_s* const pakHeader);
|
||||
|
||||
#endif // !RTECH_PAKTOOLS_H
|
||||
|
Loading…
x
Reference in New Issue
Block a user