Legacy code cleanup - part 3 (#3903)
* Legacy cleanup - part 3 Not much is left that can be easily removed, so I think this will be last cleanup before the legacy functionality is replaced. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * fix windows build, remove a few more things, re-add one file Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove legacy RenderBus + more cleanups Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove MaterialOwnerBus.h Clean-up in Cry_Matrix34/33 Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
This commit is contained in:
@@ -22,8 +22,6 @@
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
|
||||
#include "SystemCFG.h"
|
||||
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#undef AZ_RESTRICTED_SECTION
|
||||
#define SYSTEMCFG_CPP_SECTION_1 1
|
||||
@@ -180,7 +178,7 @@ void CSystem::LogVersion()
|
||||
strftime(s, 128, "%d %b %y (%H %M %S)", today);
|
||||
#endif
|
||||
|
||||
[[maybe_unused]] const SFileVersion& ver = GetFileVersion();
|
||||
const SFileVersion& ver = GetFileVersion();
|
||||
|
||||
CryLogAlways("BackupNameAttachment=\" Build(%d) %s\" -- used by backup system\n", ver.v[0], s); // read by CreateBackupFile()
|
||||
|
||||
@@ -251,122 +249,21 @@ void CSystem::LogVersion()
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CSystem::LogBuildInfo()
|
||||
{
|
||||
[[maybe_unused]] auto projectName = AZ::Utils::GetProjectName();
|
||||
auto projectName = AZ::Utils::GetProjectName();
|
||||
CryLogAlways("GameName: %s", projectName.c_str());
|
||||
CryLogAlways("BuildTime: " __DATE__ " " __TIME__);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class CCVarSaveDump
|
||||
: public ICVarDumpSink
|
||||
{
|
||||
public:
|
||||
|
||||
CCVarSaveDump(FILE* pFile)
|
||||
{
|
||||
m_pFile = pFile;
|
||||
}
|
||||
|
||||
virtual void OnElementFound(ICVar* pCVar)
|
||||
{
|
||||
if (!pCVar)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int nFlags = pCVar->GetFlags();
|
||||
if (((nFlags & VF_DUMPTODISK) && (nFlags & VF_MODIFIED)) || (nFlags & VF_WASINCONFIG))
|
||||
{
|
||||
AZStd::string szValue = pCVar->GetString();
|
||||
int pos;
|
||||
|
||||
pos = 1;
|
||||
for (;; )
|
||||
{
|
||||
pos = static_cast<int>(szValue.find_first_of("\\", pos));
|
||||
|
||||
if (pos == AZStd::string::npos)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
szValue.replace(pos, 1, "\\\\", 2);
|
||||
pos += 2;
|
||||
}
|
||||
|
||||
// replace " with \"
|
||||
pos = 1;
|
||||
for (;; )
|
||||
{
|
||||
pos = static_cast<int>(szValue.find_first_of("\"", pos));
|
||||
|
||||
if (pos == AZStd::string::npos)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
szValue.replace(pos, 1, "\\\"", 2);
|
||||
pos += 2;
|
||||
}
|
||||
|
||||
AZStd::string szLine = pCVar->GetName();
|
||||
|
||||
if (pCVar->GetType() == CVAR_STRING)
|
||||
{
|
||||
szLine += " = \"" + szValue + "\"\r\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
szLine += " = " + szValue + "\r\n";
|
||||
}
|
||||
|
||||
if (pCVar->GetFlags() & VF_WARNING_NOTUSED)
|
||||
{
|
||||
fputs("-- REMARK: the following was not assigned to a console variable\r\n", m_pFile);
|
||||
}
|
||||
|
||||
fputs(szLine.c_str(), m_pFile);
|
||||
}
|
||||
}
|
||||
|
||||
private: // --------------------------------------------------------
|
||||
|
||||
FILE* m_pFile; //
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CSystem::SaveConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// system cfg
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CSystemConfiguration::CSystemConfiguration(const AZStd::string& strSysConfigFilePath, CSystem* pSystem, ILoadConfigurationEntrySink* pSink, bool warnIfMissing)
|
||||
: m_strSysConfigFilePath(strSysConfigFilePath)
|
||||
, m_bError(false)
|
||||
, m_pSink(pSink)
|
||||
, m_warnIfMissing(warnIfMissing)
|
||||
static bool ParseSystemConfig(const AZStd::string& strSysConfigFilePath, ILoadConfigurationEntrySink* pSink, bool warnIfMissing)
|
||||
{
|
||||
assert(pSink);
|
||||
|
||||
m_pSystem = pSystem;
|
||||
m_bError = !ParseSystemConfig();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CSystemConfiguration::~CSystemConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CSystemConfiguration::ParseSystemConfig()
|
||||
{
|
||||
AZStd::string filename = m_strSysConfigFilePath;
|
||||
AZStd::string filename = strSysConfigFilePath;
|
||||
if (strlen(PathUtil::GetExt(filename.c_str())) == 0)
|
||||
{
|
||||
filename = PathUtil::ReplaceExtension(filename, "cfg");
|
||||
@@ -384,7 +281,7 @@ bool CSystemConfiguration::ParseSystemConfig()
|
||||
// if the file is missing and its already prefixed with an alias, there is no need to look any further.
|
||||
if (!(file.Open(filename.c_str(), "rb", flags)))
|
||||
{
|
||||
if (m_warnIfMissing)
|
||||
if (warnIfMissing)
|
||||
{
|
||||
CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, "Config file %s not found!", filename.c_str());
|
||||
}
|
||||
@@ -403,7 +300,7 @@ bool CSystemConfiguration::ParseSystemConfig()
|
||||
!(file.Open((AZStd::string("@assets@/config/spec/") + filename).c_str(), "rb", flags))
|
||||
)
|
||||
{
|
||||
if (m_warnIfMissing)
|
||||
if (warnIfMissing)
|
||||
{
|
||||
CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, "Config file %s not found!", filename.c_str());
|
||||
}
|
||||
@@ -518,7 +415,7 @@ bool CSystemConfiguration::ParseSystemConfig()
|
||||
AZ::StringFunc::Replace(strValue, "\\\\", "\\");
|
||||
AZ::StringFunc::Replace(strValue, "\\\"", "\"");
|
||||
|
||||
m_pSink->OnLoadConfigurationEntry(strKey.c_str(), strValue.c_str(), strGroup.c_str());
|
||||
pSink->OnLoadConfigurationEntry(strKey.c_str(), strValue.c_str(), strGroup.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -532,7 +429,7 @@ bool CSystemConfiguration::ParseSystemConfig()
|
||||
|
||||
CryLog("Loading Config file %s (%s)", filename.c_str(), filenameLog.c_str());
|
||||
|
||||
m_pSink->OnLoadConfigurationEntry_End();
|
||||
pSink->OnLoadConfigurationEntry_End();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -574,7 +471,7 @@ void CSystem::LoadConfiguration(const char* sFilename, ILoadConfigurationEntrySi
|
||||
pSink = this;
|
||||
}
|
||||
|
||||
CSystemConfiguration tempConfig(sFilename, this, pSink, warnIfMissing);
|
||||
ParseSystemConfig(sFilename, pSink, warnIfMissing);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user