mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Make static to source file
Should be made static to avoid unwanted bloat in compiled output, as each translation unit will create a new initializer/destructor. -10KiB compiled code for GameSDK.
This commit is contained in:
parent
f6f3c7f9a2
commit
56da0576a6
@ -12,6 +12,7 @@
|
||||
#ifndef NETCONSOLE
|
||||
#include "vscript/languages/squirrel_re/include/sqstdaux.h"
|
||||
#endif // !NETCONSOLE
|
||||
static const std::regex s_AnsiRowRegex("\\\033\\[.*?m");
|
||||
std::mutex g_LogMutex;
|
||||
|
||||
#if !defined (DEDICATED) && !defined (NETCONSOLE)
|
||||
|
@ -96,7 +96,6 @@ constexpr const char* s_ScriptAnsiColor[4] =
|
||||
"\033[38;2;151;149;163mScript(X):"
|
||||
};
|
||||
|
||||
static const std::regex s_AnsiRowRegex("\\\033\\[.*?m");
|
||||
extern std::mutex g_LogMutex;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
@ -34,6 +34,9 @@
|
||||
#include "vpc/keyvalues.h"
|
||||
#include "vpklib/packedstore.h"
|
||||
|
||||
static const std::regex s_DirFileRegex{ R"((?:.*\/)?([^_]*_)(.*)(.bsp.pak000_dir).*)" };
|
||||
static const std::regex s_BlockFileRegex{ R"(pak000_([0-9]{3}))" };
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: initialize parameters for compression algorithm
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -168,7 +171,7 @@ bool CPackedStore::GetEntryValues(CUtlVector<VPKKeyValues_t>& entryValues,
|
||||
CUtlString CPackedStore::GetNameParts(const CUtlString& dirFileName, int nCaptureGroup) const
|
||||
{
|
||||
std::cmatch regexMatches;
|
||||
std::regex_search(dirFileName.Get(), regexMatches, DIR_REGEX);
|
||||
std::regex_search(dirFileName.Get(), regexMatches, s_DirFileRegex);
|
||||
|
||||
return regexMatches[nCaptureGroup].str().c_str();
|
||||
}
|
||||
@ -181,7 +184,7 @@ CUtlString CPackedStore::GetNameParts(const CUtlString& dirFileName, int nCaptur
|
||||
CUtlString CPackedStore::GetLevelName(const CUtlString& dirFileName) const
|
||||
{
|
||||
std::cmatch regexMatches;
|
||||
std::regex_search(dirFileName.Get(), regexMatches, DIR_REGEX);
|
||||
std::regex_search(dirFileName.Get(), regexMatches, s_DirFileRegex);
|
||||
|
||||
CUtlString result;
|
||||
result.Format("%s%s", regexMatches[1].str().c_str(), regexMatches[2].str().c_str());
|
||||
@ -826,7 +829,7 @@ VPKDir_t::VPKDir_t(const CUtlString& dirFilePath, bool bSanitizeName)
|
||||
}
|
||||
|
||||
std::cmatch regexMatches;
|
||||
std::regex_search(dirFilePath.String(), regexMatches, BLOCK_REGEX);
|
||||
std::regex_search(dirFilePath.String(), regexMatches, s_BlockFileRegex);
|
||||
|
||||
if (regexMatches.empty())
|
||||
{
|
||||
|
@ -24,9 +24,6 @@ constexpr int PACKFILEINDEX_SEP = 0x0;
|
||||
constexpr int PACKFILEINDEX_END = 0xffff;
|
||||
constexpr const char VPK_IGNORE_FILE[] = ".vpkignore";
|
||||
|
||||
static const std::regex BLOCK_REGEX{ R"(pak000_([0-9]{3}))" };
|
||||
static const std::regex DIR_REGEX{ R"((?:.*\/)?([^_]*_)(.*)(.bsp.pak000_dir).*)" };
|
||||
|
||||
static const char* const DIR_TARGET[]
|
||||
{
|
||||
"server",
|
||||
|
Loading…
x
Reference in New Issue
Block a user