Remove lots of unused things from CrySystem (#765)
Remove lots of unused things from CrySystem
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#include "CrySystem_precompiled.h"
|
||||
#include "SystemInit.h"
|
||||
#include "System.h"
|
||||
|
||||
#if defined(AZ_RESTRICTED_PLATFORM) || defined(AZ_TOOLS_EXPAND_FOR_RESTRICTED_PLATFORMS)
|
||||
#undef AZ_RESTRICTED_SECTION
|
||||
@@ -95,17 +95,8 @@
|
||||
#include "XConsole.h"
|
||||
#include "Log.h"
|
||||
#include "XML/xml.h"
|
||||
#include "PhysRenderer.h"
|
||||
#include "LocalizedStringManager.h"
|
||||
#include "SystemEventDispatcher.h"
|
||||
#include "Validator.h"
|
||||
#include "ServerThrottle.h"
|
||||
#include "SystemCFG.h"
|
||||
#include "AutoDetectSpec.h"
|
||||
#include "ZLibCompressor.h"
|
||||
#include "ZLibDecompressor.h"
|
||||
#include "ZStdDecompressor.h"
|
||||
#include "LZ4Decompressor.h"
|
||||
#include "LevelSystem/LevelSystem.h"
|
||||
#include "LevelSystem/SpawnableLevelSystem.h"
|
||||
#include "ViewSystem/ViewSystem.h"
|
||||
@@ -114,29 +105,10 @@
|
||||
#include <AzCore/Jobs/JobManagerBus.h>
|
||||
#include <AzFramework/Driller/DrillerConsoleAPI.h>
|
||||
|
||||
#if USE_STEAM
|
||||
#include "Steamworks/public/steam/steam_api.h"
|
||||
#include "Steamworks/public/steam/isteamremotestorage.h"
|
||||
#endif
|
||||
|
||||
#if defined(IOS)
|
||||
#include "IOSConsole.h"
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID)
|
||||
#include <AzCore/Android/Utils.h>
|
||||
#include "AndroidConsole.h"
|
||||
#if !defined(AZ_RELEASE_BUILD)
|
||||
#include "ThermalInfoAndroid.h"
|
||||
#endif // !defined(AZ_RELEASE_BUILD)
|
||||
#endif
|
||||
|
||||
#if defined(AZ_PLATFORM_ANDROID) || defined(AZ_PLATFORM_IOS)
|
||||
#include "MobileDetectSpec.h"
|
||||
#endif
|
||||
|
||||
#include "WindowsConsole.h"
|
||||
|
||||
#if defined(EXTERNAL_CRASH_REPORTING)
|
||||
#include <CrashHandler.h>
|
||||
#endif
|
||||
@@ -150,10 +122,6 @@
|
||||
# include <AzFramework/Network/AssetProcessorConnection.h>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
extern LONG WINAPI CryEngineExceptionFilterWER(struct _EXCEPTION_POINTERS* pExceptionPointers);
|
||||
#endif
|
||||
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_14
|
||||
#include AZ_RESTRICTED_FILE(SystemInit_cpp)
|
||||
@@ -196,12 +164,6 @@ void CryEngineSignalHandler(int signal)
|
||||
|
||||
#endif // AZ_TRAIT_USE_CRY_SIGNAL_HANDLER
|
||||
|
||||
#if defined(USE_UNIXCONSOLE)
|
||||
#if defined(LINUX) && !defined(ANDROID)
|
||||
CUNIXConsole* pUnixConsole;
|
||||
#endif
|
||||
#endif // USE_UNIXCONSOLE
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#define DEFAULT_LOG_FILENAME "@log@/Log.txt"
|
||||
|
||||
@@ -333,26 +295,6 @@ static void CmdCrashTest(IConsoleCmdArgs* pArgs)
|
||||
}
|
||||
AZ_POP_DISABLE_WARNING
|
||||
|
||||
#if USE_STEAM
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
static void CmdWipeSteamCloud(IConsoleCmdArgs* pArgs)
|
||||
{
|
||||
if (!gEnv->pSystem->SteamInit())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int32 fileCount = SteamRemoteStorage()->GetFileCount();
|
||||
for (int i = 0; i < fileCount; i++)
|
||||
{
|
||||
int32 size = 0;
|
||||
const char* name = SteamRemoteStorage()->GetFileNameAndSize(i, &size);
|
||||
bool success = SteamRemoteStorage()->FileDelete(name);
|
||||
CryLog("Deleting file: %s - success: %d", name, success);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct SysSpecOverrideSink
|
||||
: public ILoadConfigurationEntrySink
|
||||
@@ -466,275 +408,6 @@ static ESystemConfigPlatform GetDevicePlatform()
|
||||
#endif
|
||||
}
|
||||
|
||||
static void GetSpecConfigFileToLoad(ICVar* pVar, AZStd::string& cfgFile, ESystemConfigPlatform platform)
|
||||
{
|
||||
switch (platform)
|
||||
{
|
||||
case CONFIG_PC:
|
||||
cfgFile = "pc";
|
||||
break;
|
||||
case CONFIG_ANDROID:
|
||||
cfgFile = "android";
|
||||
break;
|
||||
case CONFIG_IOS:
|
||||
cfgFile = "ios";
|
||||
break;
|
||||
#if defined(AZ_PLATFORM_JASPER) || defined(TOOLS_SUPPORT_JASPER)
|
||||
#define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_3
|
||||
#include AZ_RESTRICTED_FILE_EXPLICIT(SystemInit_cpp, jasper)
|
||||
#endif
|
||||
#if defined(AZ_PLATFORM_PROVO) || defined(TOOLS_SUPPORT_PROVO)
|
||||
#define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_3
|
||||
#include AZ_RESTRICTED_FILE_EXPLICIT(SystemInit_cpp, provo)
|
||||
#endif
|
||||
#if defined(AZ_PLATFORM_SALEM) || defined(TOOLS_SUPPORT_SALEM)
|
||||
#define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_3
|
||||
#include AZ_RESTRICTED_FILE_EXPLICIT(SystemInit_cpp, salem)
|
||||
#endif
|
||||
case CONFIG_OSX_METAL:
|
||||
cfgFile = "osx_metal";
|
||||
break;
|
||||
case CONFIG_OSX_GL:
|
||||
// Spec level is hardcoded for these platforms
|
||||
cfgFile = "";
|
||||
return;
|
||||
default:
|
||||
AZ_Assert(false, "Platform not supported");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (pVar->GetIVal())
|
||||
{
|
||||
case CONFIG_AUTO_SPEC:
|
||||
// Spec level is set for autodetection
|
||||
cfgFile = "";
|
||||
break;
|
||||
case CONFIG_LOW_SPEC:
|
||||
cfgFile += "_low.cfg";
|
||||
break;
|
||||
case CONFIG_MEDIUM_SPEC:
|
||||
cfgFile += "_medium.cfg";
|
||||
break;
|
||||
case CONFIG_HIGH_SPEC:
|
||||
cfgFile += "_high.cfg";
|
||||
break;
|
||||
case CONFIG_VERYHIGH_SPEC:
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_4
|
||||
#include AZ_RESTRICTED_FILE(SystemInit_cpp)
|
||||
#endif
|
||||
cfgFile += "_veryhigh.cfg";
|
||||
break;
|
||||
default:
|
||||
AZ_Assert(false, "Invalid value for r_GraphicsQuality");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void LoadDetectedSpec(ICVar* pVar)
|
||||
{
|
||||
CDebugAllowFileAccess ignoreInvalidFileAccess;
|
||||
SysSpecOverrideSink sysSpecOverrideSink;
|
||||
ILoadConfigurationEntrySink* pSysSpecOverrideSinkConsole = nullptr;
|
||||
|
||||
#if !defined(CONSOLE)
|
||||
SysSpecOverrideSinkConsole sysSpecOverrideSinkConsole;
|
||||
pSysSpecOverrideSinkConsole = &sysSpecOverrideSinkConsole;
|
||||
#endif
|
||||
|
||||
// g_sysSpecChanged = true;
|
||||
static int no_recursive = false;
|
||||
if (no_recursive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
no_recursive = true;
|
||||
|
||||
int spec = pVar->GetIVal();
|
||||
ESystemConfigPlatform platform = GetDevicePlatform();
|
||||
if (gEnv->IsEditor())
|
||||
{
|
||||
ESystemConfigPlatform configPlatform = GetISystem()->GetConfigPlatform();
|
||||
// Check if the config platform is set first.
|
||||
if (configPlatform != CONFIG_INVALID_PLATFORM)
|
||||
{
|
||||
platform = configPlatform;
|
||||
}
|
||||
}
|
||||
|
||||
AZStd::string configFile;
|
||||
GetSpecConfigFileToLoad(pVar, configFile, platform);
|
||||
if (configFile.length())
|
||||
{
|
||||
GetISystem()->LoadConfiguration(configFile.c_str(), platform == CONFIG_PC ? &sysSpecOverrideSink : pSysSpecOverrideSinkConsole);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Automatically sets graphics quality - spec level autodetected for ios/android, hardcoded for all other platforms
|
||||
|
||||
switch (platform)
|
||||
{
|
||||
case CONFIG_PC:
|
||||
{
|
||||
// TODO: add support for autodetection
|
||||
pVar->Set(CONFIG_VERYHIGH_SPEC);
|
||||
GetISystem()->LoadConfiguration("pc_veryhigh.cfg", &sysSpecOverrideSink);
|
||||
break;
|
||||
}
|
||||
case CONFIG_ANDROID:
|
||||
{
|
||||
#if defined(AZ_PLATFORM_ANDROID)
|
||||
AZStd::string file;
|
||||
if (MobileSysInspect::GetAutoDetectedSpecName(file))
|
||||
{
|
||||
if (file == "android_low.cfg")
|
||||
{
|
||||
pVar->Set(CONFIG_LOW_SPEC);
|
||||
}
|
||||
if (file == "android_medium.cfg")
|
||||
{
|
||||
pVar->Set(CONFIG_MEDIUM_SPEC);
|
||||
}
|
||||
if (file == "android_high.cfg")
|
||||
{
|
||||
pVar->Set(CONFIG_HIGH_SPEC);
|
||||
}
|
||||
if (file == "android_veryhigh.cfg")
|
||||
{
|
||||
pVar->Set(CONFIG_VERYHIGH_SPEC);
|
||||
}
|
||||
GetISystem()->LoadConfiguration(file.c_str(), pSysSpecOverrideSinkConsole);
|
||||
}
|
||||
else
|
||||
{
|
||||
float totalRAM = MobileSysInspect::GetDeviceRamInGB();
|
||||
if (totalRAM < MobileSysInspect::LOW_SPEC_RAM)
|
||||
{
|
||||
pVar->Set(CONFIG_LOW_SPEC);
|
||||
GetISystem()->LoadConfiguration("android_low.cfg", pSysSpecOverrideSinkConsole);
|
||||
}
|
||||
else if (totalRAM < MobileSysInspect::MEDIUM_SPEC_RAM)
|
||||
{
|
||||
pVar->Set(CONFIG_MEDIUM_SPEC);
|
||||
GetISystem()->LoadConfiguration("android_medium.cfg", pSysSpecOverrideSinkConsole);
|
||||
}
|
||||
else if (totalRAM < MobileSysInspect::HIGH_SPEC_RAM)
|
||||
{
|
||||
pVar->Set(CONFIG_HIGH_SPEC);
|
||||
GetISystem()->LoadConfiguration("android_high.cfg", pSysSpecOverrideSinkConsole);
|
||||
}
|
||||
else
|
||||
{
|
||||
pVar->Set(CONFIG_VERYHIGH_SPEC);
|
||||
GetISystem()->LoadConfiguration("android_veryhigh.cfg", pSysSpecOverrideSinkConsole);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case CONFIG_IOS:
|
||||
{
|
||||
#if defined(AZ_PLATFORM_IOS)
|
||||
AZStd::string file;
|
||||
if (MobileSysInspect::GetAutoDetectedSpecName(file))
|
||||
{
|
||||
if (file == "ios_low.cfg")
|
||||
{
|
||||
pVar->Set(CONFIG_LOW_SPEC);
|
||||
}
|
||||
if (file == "ios_medium.cfg")
|
||||
{
|
||||
pVar->Set(CONFIG_MEDIUM_SPEC);
|
||||
}
|
||||
if (file == "ios_high.cfg")
|
||||
{
|
||||
pVar->Set(CONFIG_HIGH_SPEC);
|
||||
}
|
||||
if (file == "ios_veryhigh.cfg")
|
||||
{
|
||||
pVar->Set(CONFIG_VERYHIGH_SPEC);
|
||||
}
|
||||
GetISystem()->LoadConfiguration(file.c_str(), pSysSpecOverrideSinkConsole);
|
||||
}
|
||||
else
|
||||
{
|
||||
pVar->Set(CONFIG_MEDIUM_SPEC);
|
||||
GetISystem()->LoadConfiguration("ios_medium.cfg", pSysSpecOverrideSinkConsole);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#if defined(AZ_PLATFORM_JASPER) || defined(TOOLS_SUPPORT_JASPER)
|
||||
#define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_5
|
||||
#include AZ_RESTRICTED_FILE_EXPLICIT(SystemInit_cpp, jasper)
|
||||
#endif
|
||||
#if defined(AZ_PLATFORM_PROVO) || defined(TOOLS_SUPPORT_PROVO)
|
||||
#define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_5
|
||||
#include AZ_RESTRICTED_FILE_EXPLICIT(SystemInit_cpp, provo)
|
||||
#endif
|
||||
#if defined(AZ_PLATFORM_SALEM) || defined(TOOLS_SUPPORT_SALEM)
|
||||
#define AZ_RESTRICTED_SECTION SYSTEMINIT_CPP_SECTION_5
|
||||
#include AZ_RESTRICTED_FILE_EXPLICIT(SystemInit_cpp, salem)
|
||||
#endif
|
||||
|
||||
case CONFIG_OSX_GL:
|
||||
{
|
||||
pVar->Set(CONFIG_HIGH_SPEC);
|
||||
GetISystem()->LoadConfiguration("osx_gl.cfg", pSysSpecOverrideSinkConsole);
|
||||
break;
|
||||
}
|
||||
case CONFIG_OSX_METAL:
|
||||
{
|
||||
pVar->Set(CONFIG_HIGH_SPEC);
|
||||
GetISystem()->LoadConfiguration("osx_metal_high.cfg", pSysSpecOverrideSinkConsole);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
AZ_Assert(false, "Platform not supported");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// make sure editor specific settings are not changed
|
||||
if (gEnv->IsEditor())
|
||||
{
|
||||
GetISystem()->LoadConfiguration("editor.cfg");
|
||||
}
|
||||
|
||||
// override cvars just loaded based on current API version/GPU
|
||||
|
||||
GetISystem()->SetConfigSpec(static_cast<ESystemConfigSpec>(spec), platform, false);
|
||||
|
||||
no_recursive = false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct SCryEngineLanguageConfigLoader
|
||||
: public ILoadConfigurationEntrySink
|
||||
{
|
||||
CSystem* m_pSystem;
|
||||
string m_language;
|
||||
string m_pakFile;
|
||||
|
||||
SCryEngineLanguageConfigLoader(CSystem* pSystem) { m_pSystem = pSystem; }
|
||||
void Load(const char* sCfgFilename)
|
||||
{
|
||||
CSystemConfiguration cfg(sCfgFilename, m_pSystem, this); // Parse folders config file.
|
||||
}
|
||||
virtual void OnLoadConfigurationEntry(const char* szKey, const char* szValue, [[maybe_unused]] const char* szGroup)
|
||||
{
|
||||
if (azstricmp(szKey, "Language") == 0)
|
||||
{
|
||||
m_language = szValue;
|
||||
}
|
||||
else if (azstricmp(szKey, "PAK") == 0)
|
||||
{
|
||||
m_pakFile = szValue;
|
||||
}
|
||||
}
|
||||
virtual void OnLoadConfigurationEntry_End() {}
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#if !defined(AZ_MONOLITHIC_BUILD)
|
||||
|
||||
@@ -1392,96 +1065,6 @@ string GetUniqueLogFileName(string logFileName)
|
||||
return logFileName;
|
||||
}
|
||||
|
||||
|
||||
#if defined(WIN32) || defined(WIN64)
|
||||
static wstring GetErrorStringUnsupportedCPU()
|
||||
{
|
||||
static const wchar_t s_EN[] = L"Unsupported CPU detected. CPU needs to support SSE, SSE2, SSE3 and SSE4.1.";
|
||||
static const wchar_t s_FR[] = { 0 };
|
||||
static const wchar_t s_RU[] = { 0 };
|
||||
static const wchar_t s_ES[] = { 0 };
|
||||
static const wchar_t s_DE[] = { 0 };
|
||||
static const wchar_t s_IT[] = { 0 };
|
||||
|
||||
const size_t fullLangID = (size_t) GetKeyboardLayout(0);
|
||||
const size_t primLangID = fullLangID & 0x3FF;
|
||||
const wchar_t* pFmt = s_EN;
|
||||
|
||||
/*switch (primLangID)
|
||||
{
|
||||
case 0x07: // German
|
||||
pFmt = s_DE;
|
||||
break;
|
||||
case 0x0a: // Spanish
|
||||
pFmt = s_ES;
|
||||
break;
|
||||
case 0x0c: // French
|
||||
pFmt = s_FR;
|
||||
break;
|
||||
case 0x10: // Italian
|
||||
pFmt = s_IT;
|
||||
break;
|
||||
case 0x19: // Russian
|
||||
pFmt = s_RU;
|
||||
break;
|
||||
case 0x09: // English
|
||||
default:
|
||||
break;
|
||||
}*/
|
||||
wchar_t msg[1024];
|
||||
msg[0] = L'\0';
|
||||
msg[sizeof(msg) / sizeof(msg[0]) - 1] = L'\0';
|
||||
azsnwprintf(msg, sizeof(msg) / sizeof(msg[0]) - 1, pFmt);
|
||||
return msg;
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool CheckCPURequirements([[maybe_unused]] CCpuFeatures* pCpu, [[maybe_unused]] CSystem* pSystem)
|
||||
{
|
||||
#if defined(WIN32) || defined(WIN64)
|
||||
if (!gEnv->IsDedicated())
|
||||
{
|
||||
if (!(pCpu->hasSSE() && pCpu->hasSSE2() && pCpu->hasSSE3() && pCpu->hasSSE41()))
|
||||
{
|
||||
AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "Unsupported CPU! Need SSE, SSE2, SSE3 and SSE4.1 instructions to be available.");
|
||||
|
||||
#if !defined(_RELEASE)
|
||||
const bool allowPrompts = pSystem->GetICmdLine()->FindArg(eCLAT_Pre, "noprompt") == 0;
|
||||
#else
|
||||
const bool allowPrompts = true;
|
||||
#endif // !defined(_RELEASE)
|
||||
if (allowPrompts)
|
||||
{
|
||||
AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "Asking user if they wish to continue...");
|
||||
const int mbRes = MessageBoxW(0, GetErrorStringUnsupportedCPU().c_str(), L"Open 3D Engine", MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON2 | MB_DEFAULT_DESKTOP_ONLY);
|
||||
if (mbRes == IDCANCEL)
|
||||
{
|
||||
AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "User chose to cancel startup.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#if !defined(_RELEASE)
|
||||
const bool obeyCPUCheck = pSystem->GetICmdLine()->FindArg(eCLAT_Pre, "anycpu") == 0;
|
||||
#else
|
||||
const bool obeyCPUCheck = true;
|
||||
#endif // !defined(_RELEASE)
|
||||
if (obeyCPUCheck)
|
||||
{
|
||||
AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "No prompts allowed and unsupported CPU check active. Treating unsupported CPU as error and exiting.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
AZ_Printf(AZ_TRACE_SYSTEM_WINDOW, "User chose to continue despite unsupported CPU!");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
class AzConsoleToCryConsoleBinder final
|
||||
{
|
||||
public:
|
||||
@@ -1692,16 +1275,6 @@ AZ_POP_DISABLE_WARNING
|
||||
}
|
||||
}
|
||||
|
||||
if (!startupParams.pValidator)
|
||||
{
|
||||
m_pDefaultValidator = new SDefaultValidator(this);
|
||||
m_pValidator = m_pDefaultValidator;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pValidator = startupParams.pValidator;
|
||||
}
|
||||
|
||||
#if !defined(_RELEASE)
|
||||
if (!m_bDedicatedServer)
|
||||
{
|
||||
@@ -1717,79 +1290,6 @@ AZ_POP_DISABLE_WARNING
|
||||
gEnv->SetIsDedicated(m_bDedicatedServer);
|
||||
#endif
|
||||
|
||||
#if !defined(CONSOLE)
|
||||
#if !defined(_RELEASE)
|
||||
bool isDaemonMode = (m_pCmdLine->FindArg(eCLAT_Pre, "daemon") != 0);
|
||||
#endif // !defined(_RELEASE)
|
||||
|
||||
#if defined(USE_DEDICATED_SERVER_CONSOLE)
|
||||
|
||||
#if !defined(_RELEASE)
|
||||
bool isSimpleConsole = (m_pCmdLine->FindArg(eCLAT_Pre, "simple_console") != 0);
|
||||
|
||||
if (!(isDaemonMode || isSimpleConsole))
|
||||
#endif // !defined(_RELEASE)
|
||||
{
|
||||
#if defined(USE_UNIXCONSOLE)
|
||||
CUNIXConsole* pConsole = new CUNIXConsole();
|
||||
#if defined(LINUX)
|
||||
pUnixConsole = pConsole;
|
||||
#endif
|
||||
#elif defined(USE_IOSCONSOLE)
|
||||
CIOSConsole* pConsole = new CIOSConsole();
|
||||
#elif defined(USE_WINDOWSCONSOLE)
|
||||
CWindowsConsole* pConsole = new CWindowsConsole();
|
||||
#elif defined(USE_ANDROIDCONSOLE)
|
||||
CAndroidConsole* pConsole = new CAndroidConsole();
|
||||
#else
|
||||
CNULLConsole* pConsole = new CNULLConsole(false);
|
||||
#endif
|
||||
m_pTextModeConsole = static_cast<ITextModeConsole*>(pConsole);
|
||||
|
||||
if (m_pUserCallback == nullptr && m_bDedicatedServer)
|
||||
{
|
||||
char headerString[128];
|
||||
m_pUserCallback = pConsole;
|
||||
pConsole->SetRequireDedicatedServer(true);
|
||||
|
||||
azstrcpy(
|
||||
headerString,
|
||||
AZ_ARRAY_SIZE(headerString),
|
||||
"Open 3D Engine - "
|
||||
#if defined(LINUX)
|
||||
"Linux "
|
||||
#elif defined(MAC)
|
||||
"MAC "
|
||||
#elif defined(IOS)
|
||||
"iOS "
|
||||
#endif
|
||||
"Dedicated Server"
|
||||
" - Version ");
|
||||
|
||||
char* str = headerString + strlen(headerString);
|
||||
GetProductVersion().ToString(str, sizeof(headerString) - (str - headerString));
|
||||
pConsole->SetHeader(headerString);
|
||||
}
|
||||
}
|
||||
#if !defined(_RELEASE)
|
||||
else
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !(defined(USE_DEDICATED_SERVER_CONSOLE) && defined(_RELEASE))
|
||||
{
|
||||
CNULLConsole* pConsole = new CNULLConsole(isDaemonMode);
|
||||
m_pTextModeConsole = pConsole;
|
||||
|
||||
if (m_pUserCallback == nullptr && m_bDedicatedServer)
|
||||
{
|
||||
m_pUserCallback = pConsole;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // !defined(CONSOLE)
|
||||
|
||||
{
|
||||
EBUS_EVENT(CrySystemEventBus, OnCrySystemPreInitialize, *this, startupParams);
|
||||
|
||||
@@ -1909,9 +1409,6 @@ AZ_POP_DISABLE_WARNING
|
||||
|
||||
// Need to load the engine.pak that includes the config files needed during initialization
|
||||
m_env.pCryPak->OpenPack("@assets@", "Engine.pak");
|
||||
#if defined(AZ_PLATFORM_ANDROID) || defined(AZ_PLATFORM_IOS)
|
||||
MobileSysInspect::LoadDeviceSpecMapping();
|
||||
#endif
|
||||
|
||||
InitFileSystem_LoadEngineFolders(startupParams);
|
||||
|
||||
@@ -1920,16 +1417,6 @@ AZ_POP_DISABLE_WARNING
|
||||
GetIRemoteConsole()->Update();
|
||||
#endif
|
||||
|
||||
// CPU features detection.
|
||||
m_pCpu = new CCpuFeatures;
|
||||
m_pCpu->Detect();
|
||||
|
||||
// Check hard minimum CPU requirements
|
||||
if (!CheckCPURequirements(m_pCpu, this))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
InlineInitializationProcessing("CSystem::Init Load Engine Folders");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -1998,14 +1485,6 @@ AZ_POP_DISABLE_WARNING
|
||||
|
||||
InlineInitializationProcessing("CSystem::Init LoadConfigurations");
|
||||
|
||||
#ifdef WIN32
|
||||
if ((g_cvars.sys_WER))
|
||||
{
|
||||
SetUnhandledExceptionFilter(CryEngineExceptionFilterWER);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Localization
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -2014,10 +1493,6 @@ AZ_POP_DISABLE_WARNING
|
||||
}
|
||||
InlineInitializationProcessing("CSystem::Init InitLocalizations");
|
||||
|
||||
#if !defined(AZ_RELEASE_BUILD) && defined(AZ_PLATFORM_ANDROID)
|
||||
m_thermalInfoHandler = AZStd::make_unique<ThermalInfoAndroidHandler>();
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Open basic pak files after intro movie playback started
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -2129,30 +1604,6 @@ AZ_POP_DISABLE_WARNING
|
||||
|
||||
InlineInitializationProcessing("CSystem::Init View System");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Zlib compressor
|
||||
m_pIZLibCompressor = new CZLibCompressor();
|
||||
|
||||
InlineInitializationProcessing("CSystem::Init ZLibCompressor");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Zlib decompressor
|
||||
m_pIZLibDecompressor = new CZLibDecompressor();
|
||||
|
||||
InlineInitializationProcessing("CSystem::Init ZLibDecompressor");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// LZ4 decompressor
|
||||
m_pILZ4Decompressor = new CLZ4Decompressor();
|
||||
|
||||
InlineInitializationProcessing("CSystem::Init LZ4Decompressor");
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// ZStd decompressor
|
||||
m_pIZStdDecompressor = new CZStdDecompressor();
|
||||
|
||||
InlineInitializationProcessing("CSystem::Init ZStdDecompressor");
|
||||
|
||||
if (m_env.pLyShine)
|
||||
{
|
||||
m_env.pLyShine->PostInit();
|
||||
@@ -2192,9 +1643,6 @@ AZ_POP_DISABLE_WARNING
|
||||
LoadConfiguration("client.cfg", &CVarsClientConfigSink);
|
||||
}
|
||||
|
||||
// All CVars should be registered by this point, we must now flush the cvar groups
|
||||
LoadDetectedSpec(m_sys_GraphicsQuality);
|
||||
|
||||
//Connect to the render bus
|
||||
AZ::RenderNotificationsBus::Handler::BusConnect();
|
||||
|
||||
@@ -2268,153 +1716,6 @@ void CmdSetAwsLogLevel(IConsoleCmdArgs* pArgs)
|
||||
}
|
||||
}
|
||||
|
||||
static void SysRestoreSpecCmd(IConsoleCmdArgs* pParams)
|
||||
{
|
||||
assert(pParams);
|
||||
|
||||
if (pParams->GetArgCount() == 2)
|
||||
{
|
||||
const char* szArg = pParams->GetArg(1);
|
||||
|
||||
ICVar* pCVar = gEnv->pConsole->GetCVar("sys_spec_Full");
|
||||
|
||||
if (!pCVar)
|
||||
{
|
||||
gEnv->pLog->LogWithType(ILog::eInputResponse, "sys_RestoreSpec: no action"); // e.g. running Editor in shder compile mode
|
||||
return;
|
||||
}
|
||||
|
||||
ICVar::EConsoleLogMode mode = ICVar::eCLM_Off;
|
||||
|
||||
if (azstricmp(szArg, "test") == 0)
|
||||
{
|
||||
mode = ICVar::eCLM_ConsoleAndFile;
|
||||
}
|
||||
else if (azstricmp(szArg, "test*") == 0)
|
||||
{
|
||||
mode = ICVar::eCLM_FileOnly;
|
||||
}
|
||||
else if (azstricmp(szArg, "info") == 0)
|
||||
{
|
||||
mode = ICVar::eCLM_FullInfo;
|
||||
}
|
||||
|
||||
if (mode != ICVar::eCLM_Off)
|
||||
{
|
||||
bool bFileOrConsole = (mode == ICVar::eCLM_FileOnly || mode == ICVar::eCLM_FullInfo);
|
||||
|
||||
if (bFileOrConsole)
|
||||
{
|
||||
gEnv->pLog->LogToFile(" ");
|
||||
}
|
||||
else
|
||||
{
|
||||
CryLog(" ");
|
||||
}
|
||||
|
||||
int iSysSpec = pCVar->GetRealIVal();
|
||||
|
||||
if (iSysSpec == -1)
|
||||
{
|
||||
iSysSpec = ((CSystem*)gEnv->pSystem)->GetMaxConfigSpec();
|
||||
|
||||
if (bFileOrConsole)
|
||||
{
|
||||
gEnv->pLog->LogToFile(" sys_spec = Custom (assuming %d)", iSysSpec);
|
||||
}
|
||||
else
|
||||
{
|
||||
gEnv->pLog->LogWithType(ILog::eInputResponse, " $3sys_spec = $6Custom (assuming %d)", iSysSpec);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bFileOrConsole)
|
||||
{
|
||||
gEnv->pLog->LogToFile(" sys_spec = %d", iSysSpec);
|
||||
}
|
||||
else
|
||||
{
|
||||
gEnv->pLog->LogWithType(ILog::eInputResponse, " $3sys_spec = $6%d", iSysSpec);
|
||||
}
|
||||
}
|
||||
|
||||
pCVar->DebugLog(iSysSpec, mode);
|
||||
|
||||
if (bFileOrConsole)
|
||||
{
|
||||
gEnv->pLog->LogToFile(" ");
|
||||
}
|
||||
else
|
||||
{
|
||||
gEnv->pLog->LogWithType(ILog::eInputResponse, " ");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
else if (strcmp(szArg, "apply") == 0)
|
||||
{
|
||||
const char* szPrefix = "sys_spec_";
|
||||
|
||||
ESystemConfigSpec originalSpec = CONFIG_AUTO_SPEC;
|
||||
ESystemConfigPlatform originalPlatform = GetDevicePlatform();
|
||||
|
||||
if (gEnv->IsEditor())
|
||||
{
|
||||
originalSpec = gEnv->pSystem->GetConfigSpec(true);
|
||||
}
|
||||
|
||||
std::vector<const char*> cmds;
|
||||
|
||||
cmds.resize(gEnv->pConsole->GetSortedVars(0, 0, szPrefix));
|
||||
gEnv->pConsole->GetSortedVars(&cmds[0], cmds.size(), szPrefix);
|
||||
|
||||
gEnv->pLog->LogWithType(IMiniLog::eInputResponse, " ");
|
||||
|
||||
std::vector<const char*>::const_iterator it, end = cmds.end();
|
||||
|
||||
for (it = cmds.begin(); it != end; ++it)
|
||||
{
|
||||
const char* szName = *it;
|
||||
|
||||
if (azstricmp(szName, "sys_spec_Full") == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
pCVar = gEnv->pConsole->GetCVar(szName);
|
||||
assert(pCVar);
|
||||
|
||||
if (!pCVar)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
bool bNeeded = pCVar->GetIVal() != pCVar->GetRealIVal();
|
||||
|
||||
gEnv->pLog->LogWithType(IMiniLog::eInputResponse, " $3%s = $6%d ... %s",
|
||||
szName, pCVar->GetIVal(),
|
||||
bNeeded ? "$4restored" : "valid");
|
||||
|
||||
if (bNeeded)
|
||||
{
|
||||
pCVar->Set(pCVar->GetIVal());
|
||||
}
|
||||
}
|
||||
|
||||
gEnv->pLog->LogWithType(IMiniLog::eInputResponse, " ");
|
||||
|
||||
if (gEnv->IsEditor())
|
||||
{
|
||||
gEnv->pSystem->SetConfigSpec(originalSpec, originalPlatform, true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
gEnv->pLog->LogWithType(ILog::eInputResponse, "ERROR: sys_RestoreSpec invalid arguments");
|
||||
}
|
||||
|
||||
void CmdDrillToFile(IConsoleCmdArgs* pArgs)
|
||||
{
|
||||
if (azstricmp(pArgs->GetArg(0), "DrillerStop") == 0)
|
||||
@@ -2551,14 +1852,6 @@ void CSystem::CreateSystemVars()
|
||||
"1 - enable optimisation\n"
|
||||
"Default is 1");
|
||||
|
||||
#if USE_STEAM
|
||||
#ifndef RELEASE
|
||||
REGISTER_CVAR2("sys_steamAppId", &g_cvars.sys_steamAppId, 0, VF_NULL, "steam appId used for development testing");
|
||||
REGISTER_COMMAND("sys_wipeSteamCloud", CmdWipeSteamCloud, VF_CHEAT, "Delete all files from steam cloud for this user");
|
||||
#endif // RELEASE
|
||||
REGISTER_CVAR2("sys_useSteamCloudForPlatformSaving", &g_cvars.sys_useSteamCloudForPlatformSaving, 0, VF_NULL, "Use steam cloud for save games and profile on PC (instead of the user folder)");
|
||||
#endif
|
||||
|
||||
m_sysNoUpdate = REGISTER_INT("sys_noupdate", 0, VF_CHEAT,
|
||||
"Toggles updating of system with sys_script_debugger.\n"
|
||||
"Usage: sys_noupdate [0/1]\n"
|
||||
@@ -2622,9 +1915,6 @@ void CSystem::CreateSystemVars()
|
||||
#else
|
||||
const uint32 nJobSystemDefaultCoreNumber = 4;
|
||||
#endif
|
||||
m_sys_GraphicsQuality = REGISTER_INT_CB("r_GraphicsQuality", 0, VF_ALWAYSONCHANGE,
|
||||
"Specifies the system cfg spec. 1=low, 2=med, 3=high, 4=very high)",
|
||||
LoadDetectedSpec);
|
||||
|
||||
m_sys_firstlaunch = REGISTER_INT("sys_firstlaunch", 0, 0,
|
||||
"Indicates that the game was run for the first time.");
|
||||
@@ -2731,14 +2021,6 @@ void CSystem::CreateSystemVars()
|
||||
REGISTER_CVAR2("sys_update_profile_time", &g_cvars.sys_update_profile_time, 1.0f, 0, "Time to keep updates timings history for.");
|
||||
REGISTER_CVAR2("sys_no_crash_dialog", &g_cvars.sys_no_crash_dialog, m_bNoCrashDialog, VF_NULL, "Whether to disable the crash dialog window");
|
||||
REGISTER_CVAR2("sys_no_error_report_window", &g_cvars.sys_no_error_report_window, m_bNoErrorReportWindow, VF_NULL, "Whether to disable the error report list");
|
||||
#if defined(_RELEASE)
|
||||
if (!gEnv->IsDedicated())
|
||||
{
|
||||
REGISTER_CVAR2("sys_WER", &g_cvars.sys_WER, 1, 0, "Enables Windows Error Reporting");
|
||||
}
|
||||
#else
|
||||
REGISTER_CVAR2("sys_WER", &g_cvars.sys_WER, 0, 0, "Enables Windows Error Reporting");
|
||||
#endif
|
||||
|
||||
#ifdef USE_HTTP_WEBSOCKETS
|
||||
REGISTER_CVAR2("sys_simple_http_base_port", &g_cvars.sys_simple_http_base_port, 1880, VF_REQUIRE_APP_RESTART,
|
||||
@@ -2820,11 +2102,6 @@ void CSystem::CreateSystemVars()
|
||||
REGISTER_STRING_CB("g_language", "", VF_NULL, "Defines which language pak is loaded", CSystem::OnLanguageCVarChanged);
|
||||
REGISTER_STRING_CB("g_languageAudio", "", VF_NULL, "Will automatically match g_language setting unless specified otherwise", CSystem::OnLanguageAudioCVarChanged);
|
||||
|
||||
REGISTER_COMMAND("sys_RestoreSpec", &SysRestoreSpecCmd, 0,
|
||||
"Restore or test the cvar settings of game specific spec settings,\n"
|
||||
"'test*' and 'info' log to the log file only\n"
|
||||
"Usage: sys_RestoreSpec [test|test*|apply|info]");
|
||||
|
||||
#if defined(WIN32)
|
||||
REGISTER_CVAR2("sys_display_threads", &g_cvars.sys_display_threads, 0, 0, "Displays Thread info");
|
||||
#elif defined(AZ_RESTRICTED_PLATFORM)
|
||||
|
||||
Reference in New Issue
Block a user