mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
RTech: enforce naming consistency in define names
renamed PLATFORM_PAK_PATH and PLATFORM_PAK_OVERRIDE_PATH.
This commit is contained in:
parent
bec5d2746f
commit
a1c9f3e49e
@ -80,11 +80,11 @@
|
|||||||
|
|
||||||
// base pak directory containing paks sorted in platform specific subdirectories
|
// base pak directory containing paks sorted in platform specific subdirectories
|
||||||
#define PAK_BASE_PATH "paks\\"
|
#define PAK_BASE_PATH "paks\\"
|
||||||
#define PLATFORM_PAK_PATH PAK_BASE_PATH"Win64\\"
|
#define PAK_PLATFORM_PATH PAK_BASE_PATH"Win64\\"
|
||||||
|
|
||||||
// pak override directory; the system will looks for pak files in this directory
|
// pak override directory; the system will looks for pak files in this directory
|
||||||
// first before falling back to PLATFORM_PAK_PATH
|
// first before falling back to PAK_PLATFORM_PATH
|
||||||
#define PLATFORM_PAK_OVERRIDE_PATH PAK_BASE_PATH"Win64_override\\"
|
#define PAK_PLATFORM_OVERRIDE_PATH PAK_BASE_PATH"Win64_override\\"
|
||||||
|
|
||||||
// the handle that should be returned when a pak failed to load or process
|
// the handle that should be returned when a pak failed to load or process
|
||||||
#define PAK_INVALID_HANDLE -1
|
#define PAK_INVALID_HANDLE -1
|
||||||
|
@ -23,7 +23,7 @@ int FS_OpenAsyncFile(const char* const filePath, const int logLevel, size_t* con
|
|||||||
if (fileToLoad && *fileToLoad)
|
if (fileToLoad && *fileToLoad)
|
||||||
{
|
{
|
||||||
// is this a pak file and do we have an override
|
// is this a pak file and do we have an override
|
||||||
if (strstr(fileToLoad, PLATFORM_PAK_PATH) &&
|
if (strstr(fileToLoad, PAK_PLATFORM_PATH) &&
|
||||||
Pak_FileOverrideExists(fileToLoad, overridePath, sizeof(overridePath)))
|
Pak_FileOverrideExists(fileToLoad, overridePath, sizeof(overridePath)))
|
||||||
{
|
{
|
||||||
fileToLoad = overridePath;
|
fileToLoad = overridePath;
|
||||||
|
@ -461,7 +461,7 @@ bool Pak_ProcessPakFile(PakFile_s* const pak)
|
|||||||
return memoryData->patchSrcSize == 0;
|
return memoryData->patchSrcSize == 0;
|
||||||
|
|
||||||
char pakPatchPath[MAX_PATH] = {};
|
char pakPatchPath[MAX_PATH] = {};
|
||||||
sprintf(pakPatchPath, PLATFORM_PAK_PATH"%s", pak->memoryData.fileName);
|
sprintf(pakPatchPath, PAK_PLATFORM_PATH"%s", pak->memoryData.fileName);
|
||||||
|
|
||||||
// get path of next patch rpak to load
|
// get path of next patch rpak to load
|
||||||
if (pak->memoryData.patchIndices[pak->patchCount])
|
if (pak->memoryData.patchIndices[pak->patchCount])
|
||||||
|
@ -208,8 +208,8 @@ static void Pak_Decompress_f(const CCommand& args)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFmtStr1024 inPakFile(PLATFORM_PAK_PATH "%s", args.Arg(1));
|
CFmtStr1024 inPakFile(PAK_PLATFORM_PATH "%s", args.Arg(1));
|
||||||
CFmtStr1024 outPakFile(PLATFORM_PAK_OVERRIDE_PATH "%s", args.Arg(1));
|
CFmtStr1024 outPakFile(PAK_PLATFORM_OVERRIDE_PATH "%s", args.Arg(1));
|
||||||
|
|
||||||
if (!Pak_DecodePakFile(inPakFile.String(), outPakFile.String()))
|
if (!Pak_DecodePakFile(inPakFile.String(), outPakFile.String()))
|
||||||
{
|
{
|
||||||
@ -233,8 +233,8 @@ static void Pak_Compress_f(const CCommand& args)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFmtStr1024 inPakFile(PLATFORM_PAK_OVERRIDE_PATH "%s", args.Arg(1));
|
CFmtStr1024 inPakFile(PAK_PLATFORM_OVERRIDE_PATH "%s", args.Arg(1));
|
||||||
CFmtStr1024 outPakFile(PLATFORM_PAK_PATH "%s", args.Arg(1));
|
CFmtStr1024 outPakFile(PAK_PLATFORM_PATH "%s", args.Arg(1));
|
||||||
|
|
||||||
// NULL means default compress level
|
// NULL means default compress level
|
||||||
const int compressLevel = args.ArgC() > 2 ? atoi(args.Arg(2)) : NULL;
|
const int compressLevel = args.ArgC() > 2 ? atoi(args.Arg(2)) : NULL;
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
bool Pak_BasePathExists()
|
bool Pak_BasePathExists()
|
||||||
{
|
{
|
||||||
return IsDirectory(PLATFORM_PAK_PATH);
|
return IsDirectory(PAK_PLATFORM_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
@ -26,7 +26,7 @@ bool Pak_CreateBasePath()
|
|||||||
if (Pak_BasePathExists())
|
if (Pak_BasePathExists())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return CreateDirHierarchy(PLATFORM_PAK_PATH) == 0;
|
return CreateDirHierarchy(PAK_PLATFORM_PATH) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
@ -34,7 +34,7 @@ bool Pak_CreateBasePath()
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
bool Pak_OverridePathExists()
|
bool Pak_OverridePathExists()
|
||||||
{
|
{
|
||||||
return IsDirectory(PLATFORM_PAK_OVERRIDE_PATH);
|
return IsDirectory(PAK_PLATFORM_OVERRIDE_PATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
@ -46,7 +46,7 @@ bool Pak_CreateOverridePath()
|
|||||||
if (Pak_OverridePathExists())
|
if (Pak_OverridePathExists())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return CreateDirHierarchy(PLATFORM_PAK_OVERRIDE_PATH) == 0;
|
return CreateDirHierarchy(PAK_PLATFORM_OVERRIDE_PATH) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
@ -55,7 +55,7 @@ bool Pak_CreateOverridePath()
|
|||||||
bool Pak_FileOverrideExists(const char* const pakFilePath, char* const outPath, const size_t outBufLen)
|
bool Pak_FileOverrideExists(const char* const pakFilePath, char* const outPath, const size_t outBufLen)
|
||||||
{
|
{
|
||||||
// check the overrides path
|
// check the overrides path
|
||||||
snprintf(outPath, outBufLen, PLATFORM_PAK_OVERRIDE_PATH"%s", V_UnqualifiedFileName(pakFilePath));
|
snprintf(outPath, outBufLen, PAK_PLATFORM_OVERRIDE_PATH"%s", V_UnqualifiedFileName(pakFilePath));
|
||||||
return FileExists(outPath);
|
return FileExists(outPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ int Pak_FileExists(const char* const pakFilePath)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// check the platform's default path
|
// check the platform's default path
|
||||||
snprintf(fullPath, sizeof(fullPath), PLATFORM_PAK_PATH"%s", pakFilePath);
|
snprintf(fullPath, sizeof(fullPath), PAK_PLATFORM_PATH"%s", pakFilePath);
|
||||||
|
|
||||||
return FileExists(fullPath);
|
return FileExists(fullPath);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user