Integrating latest from github/staging
Integrating up through commit 5e1bdae
This commit is contained in:
@@ -1064,7 +1064,7 @@ namespace Audio
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Interface methods
|
||||
virtual bool Initialize(const SSystemInitParams* initParams) = 0;
|
||||
virtual bool Initialize() = 0;
|
||||
virtual void Release() = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -392,7 +392,7 @@ struct IMaterial
|
||||
virtual void SetDirty(bool dirty = true) = 0;
|
||||
virtual bool IsDirty() const = 0;
|
||||
|
||||
//! Returns true if the material is the parent of a group of materials
|
||||
//! Returns true if the material is the parent of a group of materials
|
||||
virtual bool IsMaterialGroup() const = 0;
|
||||
|
||||
//! Returns true if the material is a single material belongs to a material group
|
||||
@@ -411,11 +411,6 @@ struct IMaterial
|
||||
// - 2, fast sketch mode.
|
||||
virtual void SetSketchMode(int mode) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Debug routines
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual const char* GetLoadingCallstack() = 0; // trace leaking materials by callstack
|
||||
|
||||
// Sets FT_DONT_STREAM flag for all textures used by the material
|
||||
// If a stream is already in process, this will stop the stream and flush the device texture
|
||||
virtual void DisableTextureStreaming() = 0;
|
||||
|
||||
@@ -119,8 +119,6 @@ namespace AZ
|
||||
|
||||
class IResourceCompilerHelper;
|
||||
|
||||
class CBootProfilerRecord;
|
||||
|
||||
namespace Serialization {
|
||||
struct IArchiveHost;
|
||||
}
|
||||
@@ -629,15 +627,7 @@ struct SSystemInitParams
|
||||
void* hWnd; //
|
||||
void* hWndForInputSystem; // the HWND for the input devices, distinct from the hWnd, which the rendering system overrides anyways
|
||||
|
||||
char remoteIP[256];
|
||||
int remotePort;
|
||||
bool remoteFileIO;
|
||||
bool remoteResourceCompiler;
|
||||
bool connectToRemote;
|
||||
bool waitForConnection; // if true, wait for the remote connection to be established before proceeding to system init.
|
||||
char assetsPlatform[64]; // what flavor of assets to load. Corresponds to those in rc.ini and asset processor ini
|
||||
char gameFolderName[256]; // just the name. Not the full path.
|
||||
char branchToken[12]; // information written by the assetprocessor which help determine whether the game/editor are running from the same branch or not
|
||||
|
||||
ILog* pLog; // You can specify your own ILog to be used by System.
|
||||
ILogCallback* pLogCallback; // You can specify your own ILogCallback to be added on log creation (used by Editor).
|
||||
@@ -648,45 +638,6 @@ struct SSystemInitParams
|
||||
IOutputPrintSink* pPrintSync; // Print Sync which can be used to catch all output from engine
|
||||
char szSystemCmdLine[2048]; // Command line.
|
||||
|
||||
|
||||
// set some paths before you create the system.
|
||||
|
||||
// rootPath - (REQUIRED) folder containing root. Must contain system.cfg or bootstrap.cfg basically.
|
||||
// the remainder are optional and if specified should contain prefixes that can be prepended to any file to get to that location:
|
||||
// READ ONLY!
|
||||
char rootPath[256];
|
||||
char rootPathCache[256];
|
||||
|
||||
// assetsPath - (REQUIRED) - where you assets live. The engine config parser will default this to @root@/gamename
|
||||
// READ ONLY!
|
||||
char assetsPath[256];
|
||||
char assetsPathCache[256];
|
||||
|
||||
// userPath - (OPTIONAL) User path contains a folder for preferences persistent storage. May be persisted to the cloud (by things like IOS)
|
||||
// If not specified, this is assumed @root@/User/
|
||||
// WRITABLE
|
||||
char userPath[256];
|
||||
|
||||
// cachePath - (OPTIONAL) a temporary store that can be erased at any time and does not need to be persisted
|
||||
// on the cloud or anything like that. if not specified, this will be @user@/Cache
|
||||
// WRITABLE
|
||||
char cachePath[256];
|
||||
|
||||
// logPath - (OPTIONAL) a log path folder.
|
||||
// If not specified, it will be @cache@/Logs
|
||||
// WRITABLE
|
||||
char logPath[256];
|
||||
|
||||
// the game should never use these values instead, the game should be using crypak or fileio with aliases:
|
||||
// @root@ To get to the folder where system.cfg lives
|
||||
// @assets@ to get to the folder containing game assets (textures and such) - by default, this is @root@/Gamename/
|
||||
// @devroot@ to get to source files that are checked into source control (PC EDITOR ONLY!)
|
||||
// @engroot@ to get to path to the engine root folder
|
||||
// @user@ to access user store
|
||||
// @cache@ to access temporary cache
|
||||
// @log@ to access log file and other forensic storage
|
||||
char szBinariesDir[256];
|
||||
|
||||
bool bEditor; // When running in Editor mode.
|
||||
bool bPreview; // When running in Preview mode (Minimal initialization).
|
||||
bool bTestMode; // When running in Automated testing mode.
|
||||
@@ -730,26 +681,7 @@ struct SSystemInitParams
|
||||
hWnd = NULL;
|
||||
hWndForInputSystem = NULL;
|
||||
|
||||
memset(rootPath, 0, sizeof(rootPath));
|
||||
memset(rootPathCache, 0, sizeof(rootPathCache));
|
||||
memset(userPath, 0, sizeof(userPath));
|
||||
memset(assetsPath, 0, sizeof(assetsPath));
|
||||
memset(assetsPathCache, 0, sizeof(assetsPathCache));
|
||||
memset(cachePath, 0, sizeof(cachePath));
|
||||
memset(logPath, 0, sizeof(logPath));
|
||||
memset(gameFolderName, 0, sizeof(gameFolderName));
|
||||
memset(branchToken, 0, sizeof(branchToken));
|
||||
|
||||
memset(remoteIP, 0, sizeof(remoteIP));
|
||||
azstrcpy(remoteIP, sizeof(remoteIP), "127.0.0.1");
|
||||
memset(assetsPlatform, 0, sizeof(assetsPlatform));
|
||||
azstrcpy(assetsPlatform, sizeof(assetsPlatform), "pc");
|
||||
|
||||
remotePort = 45643;
|
||||
remoteFileIO = false;
|
||||
remoteResourceCompiler = false;
|
||||
connectToRemote = false;
|
||||
waitForConnection = false;
|
||||
|
||||
pLog = NULL;
|
||||
pLogCallback = NULL;
|
||||
@@ -762,7 +694,6 @@ struct SSystemInitParams
|
||||
pValidator = NULL;
|
||||
pPrintSync = NULL;
|
||||
memset(szSystemCmdLine, 0, sizeof(szSystemCmdLine));
|
||||
memset(szBinariesDir, 0, sizeof(szBinariesDir));
|
||||
|
||||
bEditor = false;
|
||||
bPreview = false;
|
||||
@@ -798,17 +729,6 @@ struct SSystemInitParams
|
||||
|
||||
pSharedEnvironment = nullptr;
|
||||
}
|
||||
|
||||
bool UseAssetCache() const
|
||||
{
|
||||
#if defined(AZ_PLATFORM_WINDOWS) || defined(AZ_PLATFORM_MAC) || defined(AZ_PLATFORM_LINUX)
|
||||
char checkPath[AZ_MAX_PATH_LEN] = { 0 };
|
||||
azsnprintf(checkPath, AZ_MAX_PATH_LEN, "%s/engine.json", rootPathCache);
|
||||
return AZ::IO::SystemFile::Exists(checkPath);
|
||||
#else
|
||||
return false;
|
||||
#endif // defined(AZ_PLATFORM_WINDOWS) || AZ_TRAIT_OS_PLATFORM_APPLE
|
||||
}
|
||||
};
|
||||
|
||||
// Notes:
|
||||
@@ -1228,11 +1148,6 @@ struct ISystem
|
||||
// Gets number of CPUs
|
||||
virtual int GetLogicalCPUCount() = 0;
|
||||
|
||||
//! Get the 'kind' of assets you need to load - this describes the flavor of assets you are going to load
|
||||
//! based on the platform you're on - so for example, android on ES3 will be 'es3' but android on opengl might load PC assets or others...
|
||||
//! This is defined in bootstrap.cfg and is read-only during runtime.
|
||||
virtual const char* GetAssetsPlatform() const = 0;
|
||||
|
||||
// Summary:
|
||||
// Return the rendering driver name. GL or Metal
|
||||
virtual const char* GetRenderingDriverName() const = 0;
|
||||
@@ -1406,43 +1321,6 @@ struct ISystem
|
||||
// True if system running in Test mode.
|
||||
virtual bool IsTestMode() const = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Loading time/memory profiling
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Summary:
|
||||
// Starts function loading stats profiling.
|
||||
virtual struct SLoadingTimeContainer* StartLoadingSectionProfiling(CLoadingTimeProfiler* pProfiler, const char* szFuncName) = 0;
|
||||
|
||||
// Summary:
|
||||
// Ends function loading stats profiling.
|
||||
virtual void EndLoadingSectionProfiling(CLoadingTimeProfiler* pProfiler) = 0;
|
||||
|
||||
// Summary:
|
||||
// Starts function profiling with bootprofiler (session must be started).
|
||||
virtual CBootProfilerRecord* StartBootSectionProfiler(const char* name, const char* args) = 0;
|
||||
|
||||
// Summary:
|
||||
// Ends function profiling with bootprofiler.
|
||||
virtual void StopBootSectionProfiler(CBootProfilerRecord* record) = 0;
|
||||
|
||||
|
||||
// Summary:
|
||||
// Starts frame session
|
||||
virtual void StartBootProfilerSessionFrames(const char* pName) = 0;
|
||||
|
||||
// Summary:
|
||||
// Stops frame session
|
||||
virtual void StopBootProfilerSessionFrames() = 0;
|
||||
|
||||
// Summary:
|
||||
// Prints loading stats into log.
|
||||
virtual void OutputLoadingTimeStats() = 0;
|
||||
|
||||
// Summary:
|
||||
// Starts function loading stats profiling.
|
||||
virtual const char* GetLoadingProfilerCallstack() = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// File version.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -1581,10 +1459,10 @@ struct ISystem
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Summary:
|
||||
// Enable/Disable drawing the console
|
||||
// Enable/Disable drawing the console
|
||||
virtual void SetConsoleDrawEnabled(bool enabled) = 0;
|
||||
|
||||
// Enable/Disable drawing the UI
|
||||
// Enable/Disable drawing the UI
|
||||
virtual void SetUIDrawEnabled(bool enabled) = 0;
|
||||
|
||||
// Summary:
|
||||
@@ -1772,79 +1650,19 @@ struct DiskOperationInfo
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_LOADING_PROFILER)
|
||||
|
||||
struct CLoadingTimeProfiler
|
||||
{
|
||||
CLoadingTimeProfiler(ISystem* pSystem, const char* szFuncName)
|
||||
: m_pSystem(pSystem)
|
||||
{
|
||||
m_pSystem = pSystem;
|
||||
m_pTimeContainer = m_pSystem->StartLoadingSectionProfiling(this, szFuncName);
|
||||
}
|
||||
|
||||
~CLoadingTimeProfiler()
|
||||
{
|
||||
m_pSystem->EndLoadingSectionProfiling(this);
|
||||
}
|
||||
|
||||
struct SLoadingTimeContainer* m_pTimeContainer;
|
||||
double m_fConstructorTime;
|
||||
double m_fConstructorMemUsage;
|
||||
|
||||
DiskOperationInfo m_constructorInfo;
|
||||
|
||||
ISystem* m_pSystem;
|
||||
};
|
||||
|
||||
class CSYSBootProfileBlock
|
||||
{
|
||||
ISystem* m_pSystem;
|
||||
CBootProfilerRecord* m_pRecord;
|
||||
public:
|
||||
CSYSBootProfileBlock(ISystem* pSystem, const char* name, const char* args = NULL)
|
||||
: m_pSystem(pSystem)
|
||||
{
|
||||
if (m_pSystem)
|
||||
{
|
||||
m_pRecord = m_pSystem->StartBootSectionProfiler(name, args);
|
||||
}
|
||||
}
|
||||
|
||||
~CSYSBootProfileBlock()
|
||||
{
|
||||
if (m_pSystem)
|
||||
{
|
||||
m_pSystem->StopBootSectionProfiler(m_pRecord);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef AZ_PROFILE_TELEMETRY
|
||||
#if defined(ENABLE_LOADING_PROFILER) && AZ_PROFILE_TELEMETRY
|
||||
|
||||
#define LOADING_TIME_PROFILE_SECTION AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::AzCore)
|
||||
#define LOADING_TIME_PROFILE_SECTION_ARGS(...) AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, __VA_ARGS__)
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED(sectionName) AZ_PROFILE_SCOPE(AZ::Debug::ProfileCategory::AzCore, sectionName)
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED_ARGS(sectionName, args) AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, sectionName, args)
|
||||
|
||||
#else
|
||||
|
||||
#define LOADING_TIME_PROFILE_SECTION CSYSBootProfileBlock AZ_JOIN(_profileBlockLine, __LINE__)(gEnv && gEnv->pSystem ? gEnv->pSystem : nullptr, __FUNCTION__);
|
||||
#define LOADING_TIME_PROFILE_SECTION_ARGS(args) CSYSBootProfileBlock AZ_JOIN(_profileBlockLine, __LINE__)(gEnv->pSystem, __FUNCTION__, args);
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED(sectionName) CSYSBootProfileBlock AZ_JOIN(_profileBlockLine, __LINE__)(gEnv->pSystem, sectionName);
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED_ARGS(sectionName, args) CSYSBootProfileBlock AZ_JOIN(_profileBlockLine, __LINE__)(gEnv->pSystem, sectionName, args);
|
||||
|
||||
#endif // AZ_PROFILE_TELEMETRY
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED_ARGS(sectionName, ...) AZ_PROFILE_SCOPE_DYNAMIC(AZ::Debug::ProfileCategory::AzCore, sectionName, __VA_ARGS__)
|
||||
|
||||
#else
|
||||
|
||||
#define LOADING_TIME_PROFILE_SECTION
|
||||
#define LOADING_TIME_PROFILE_SECTION_ARGS(args)
|
||||
#define LOADING_TIME_PROFILE_SECTION_ARGS(...)
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED(sectionName)
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED_ARGS(sectionName, args)
|
||||
#define LOADING_TIME_PROFILE_SESSION_SECTION(sessionName)
|
||||
#define LOADING_TIME_PROFILE_SESSION_START(sessionName)
|
||||
#define LOADING_TIME_PROFILE_SESSION_STOP(sessionName)
|
||||
#define LOADING_TIME_PROFILE_SECTION_NAMED_ARGS(sectionName, ...)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1865,7 +1683,7 @@ extern SC_API SSystemGlobalEnvironment* gEnv;
|
||||
inline ISystem* GetISystem()
|
||||
{
|
||||
// Some unit tests temporarily install and then uninstall ISystem* mocks.
|
||||
// It is generally okay for runtime and tool systems which call this function to cache the returned pointer,
|
||||
// It is generally okay for runtime and tool systems which call this function to cache the returned pointer,
|
||||
// because their lifetime is usually shorter than the lifetime of the ISystem* implementation.
|
||||
// It is NOT safe for this function to cache it as a static itself, though, as the static it would cache
|
||||
// it inside may outlive the the actual instance implementing ISystem* when unit tests are torn down and then restarted.
|
||||
|
||||
@@ -15,10 +15,12 @@
|
||||
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/IO/SystemFile.h> // for max path len
|
||||
#include <ISystem.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzFramework/StringFunc/StringFunc.h>
|
||||
|
||||
#include <ISystem.h>
|
||||
|
||||
namespace MaterialUtils
|
||||
{
|
||||
//! UnifyMaterialName - given a non-unified material name, remove the extension, unify the slashes
|
||||
@@ -75,14 +77,11 @@ namespace MaterialUtils
|
||||
static char cachedGameName[AZ_MAX_PATH_LEN] = { 0 };
|
||||
if (!removals[removalSize - 1])
|
||||
{
|
||||
if ((gEnv) && (gEnv->pConsole))
|
||||
auto projectName = AZ::Utils::GetProjectName();
|
||||
if (!projectName.empty())
|
||||
{
|
||||
ICVar* pGameNameCVar = gEnv->pConsole->GetCVar("sys_game_folder");
|
||||
if (pGameNameCVar)
|
||||
{
|
||||
azstrcpy(cachedGameName, AZ_MAX_PATH_LEN, pGameNameCVar->GetString());
|
||||
azstrcat(cachedGameName, AZ_MAX_PATH_LEN, "/");
|
||||
}
|
||||
azstrcpy(cachedGameName, AZ_MAX_PATH_LEN, projectName.c_str());
|
||||
azstrcat(cachedGameName, AZ_MAX_PATH_LEN, "/");
|
||||
}
|
||||
|
||||
if (cachedGameName[0] == 0)
|
||||
|
||||
@@ -55,8 +55,6 @@ public:
|
||||
int());
|
||||
MOCK_METHOD0(GetLogicalCPUCount,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetAssetsPlatform,
|
||||
const char*());
|
||||
MOCK_CONST_METHOD0(GetRenderingDriverName,
|
||||
const char*());
|
||||
MOCK_METHOD1(DumpMemoryUsageStatistics,
|
||||
@@ -206,22 +204,6 @@ public:
|
||||
bool());
|
||||
MOCK_METHOD3(SetFrameProfiler,
|
||||
void(bool on, bool display, char* prefix));
|
||||
MOCK_METHOD2(StartLoadingSectionProfiling,
|
||||
struct SLoadingTimeContainer*(CLoadingTimeProfiler * pProfiler, const char* szFuncName));
|
||||
MOCK_METHOD1(EndLoadingSectionProfiling,
|
||||
void(CLoadingTimeProfiler * pProfiler));
|
||||
MOCK_METHOD2(StartBootSectionProfiler,
|
||||
CBootProfilerRecord * (const char* name, const char* args));
|
||||
MOCK_METHOD1(StopBootSectionProfiler,
|
||||
void(CBootProfilerRecord * record));
|
||||
MOCK_METHOD1(StartBootProfilerSessionFrames,
|
||||
void(const char* pName));
|
||||
MOCK_METHOD0(StopBootProfilerSessionFrames,
|
||||
void());
|
||||
MOCK_METHOD0(OutputLoadingTimeStats,
|
||||
void());
|
||||
MOCK_METHOD0(GetLoadingProfilerCallstack,
|
||||
const char*());
|
||||
MOCK_METHOD0(GetFileVersion,
|
||||
const SFileVersion&());
|
||||
MOCK_METHOD0(GetProductVersion,
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
/*
|
||||
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
|
||||
* its licensors.
|
||||
*
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this
|
||||
* distribution (the "License"). All use of this software is governed by the License,
|
||||
* or, if provided, by the license below or the license accompanying this file. Do not
|
||||
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
*
|
||||
*/
|
||||
// Original file Copyright Crytek GMBH or its affiliates, used under license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ISystem.h"
|
||||
#include <AzCore/base.h>
|
||||
#include <AzCore/IO/SystemFile.h>
|
||||
#include <AzCore/Settings/SettingsRegistryMergeUtils.h>
|
||||
#include <AzCore/Utils/Utils.h>
|
||||
#include <AzFramework/Platform/PlatformDefaults.h>
|
||||
|
||||
// any of the following tags can be present in the bootstrap.cfg
|
||||
// you can also prefix it with a platform.
|
||||
// so for example, you can specify remote_ip alone to specify it for all platforms
|
||||
// or you could specify android_remote_ip to change it for android only.
|
||||
// the instructions are executed in the order that they appear, so you can set the default
|
||||
// by using the non-platform-specific version, and then later on in the file you
|
||||
// can override specific platforms.
|
||||
|
||||
#define CONFIG_KEY_FOR_REMOTEIP "remote_ip"
|
||||
#define CONFIG_KEY_FOR_REMOTEPORT "remote_port"
|
||||
#define CONFIG_KEY_FOR_GAMEFOLDER "sys_game_folder"
|
||||
#define CONFIG_KEY_FOR_REMOTEFILEIO "remote_filesystem"
|
||||
#define CONFIG_KEY_FOR_CONNECTTOREMOTE "connect_to_remote"
|
||||
#define CONFIG_KEY_WAIT_FOR_CONNECT "wait_for_connect"
|
||||
#define DEFAULT_GAMEDLL "EmptyTemplate"
|
||||
#define DEFAULT_GAMEFOLDER "EmptyTemplate"
|
||||
#define DEFAULT_REMOTEIP "127.0.0.1"
|
||||
#define DEFAULT_REMOTEPORT 45643
|
||||
#define CONFIG_KEY_FOR_ASSETS "assets"
|
||||
#define CONFIG_KEY_FOR_BRANCHTOKEN "assetProcessor_branch_token"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
class CEngineConfig
|
||||
{
|
||||
public:
|
||||
string m_gameFolder; // folder only ("MyGame")
|
||||
string m_assetPlatform; // what platform folder assets are from if more than one is available or using VFS ("pc" / "es3")
|
||||
bool m_connectToRemote;
|
||||
bool m_remoteFileIO;
|
||||
bool m_waitForConnect;
|
||||
string m_remoteIP;
|
||||
int m_remotePort;
|
||||
|
||||
string m_rootFolder; // The engine root folder
|
||||
string m_branchToken;
|
||||
|
||||
CEngineConfig([[maybe_unused]] const char** sourcePaths = nullptr, [[maybe_unused]] size_t numSearchPaths = 0, [[maybe_unused]] size_t numLevelsUp = 3)
|
||||
: m_gameFolder(DEFAULT_GAMEFOLDER)
|
||||
, m_connectToRemote(false)
|
||||
, m_remoteFileIO(false)
|
||||
, m_remotePort(DEFAULT_REMOTEPORT)
|
||||
, m_waitForConnect(false)
|
||||
, m_remoteIP(DEFAULT_REMOTEIP)
|
||||
{
|
||||
m_assetPlatform = AzFramework::OSPlatformToDefaultAssetPlatform(AZ_TRAIT_OS_PLATFORM_CODENAME);
|
||||
|
||||
if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
|
||||
{
|
||||
AZ::SettingsRegistryInterface::FixedValueString gameFolder;
|
||||
auto gameFolderKey = AZ::SettingsRegistryInterface::FixedValueString::format("%s/%s",
|
||||
AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey, CONFIG_KEY_FOR_GAMEFOLDER);
|
||||
if (settingsRegistry->Get(gameFolder, gameFolderKey))
|
||||
{
|
||||
m_gameFolder.assign(gameFolder.c_str(), gameFolder.size());
|
||||
}
|
||||
|
||||
AZ::SettingsRegistryInterface::FixedValueString engineRoot;
|
||||
if (settingsRegistry->Get(engineRoot, AZ::SettingsRegistryMergeUtils::FilePathKey_EngineRootFolder))
|
||||
{
|
||||
m_rootFolder.assign(engineRoot.c_str(), engineRoot.size());
|
||||
}
|
||||
}
|
||||
|
||||
OnLoadSettings();
|
||||
}
|
||||
|
||||
void CopyToStartupParams(SSystemInitParams& startupParams) const
|
||||
{
|
||||
startupParams.remoteFileIO = m_remoteFileIO;
|
||||
startupParams.remotePort = m_remotePort;
|
||||
startupParams.connectToRemote = m_connectToRemote;
|
||||
startupParams.waitForConnection = m_waitForConnect;
|
||||
|
||||
azstrncpy(startupParams.remoteIP, sizeof(startupParams.remoteIP), m_remoteIP.c_str(), m_remoteIP.length() + 1); // +1 for the null terminator
|
||||
azstrncpy(startupParams.assetsPlatform, sizeof(startupParams.assetsPlatform), m_assetPlatform.c_str(), m_assetPlatform.length() + 1); // +1 for the null terminator
|
||||
azstrncpy(startupParams.rootPath, sizeof(startupParams.rootPath), m_rootFolder.c_str(), m_rootFolder.length() + 1); // +1 for the null terminator
|
||||
azstrncpy(startupParams.gameFolderName, sizeof(startupParams.gameFolderName), m_gameFolder.c_str(), m_gameFolder.length() + 1); // +1 for the null terminator
|
||||
azstrncpy(startupParams.branchToken, sizeof(startupParams.branchToken), m_branchToken.c_str(), m_branchToken.length() + 1); // +1 for the null terminator
|
||||
|
||||
// compute assets path based on game folder name
|
||||
string gameFolderLower(m_gameFolder);
|
||||
gameFolderLower.MakeLower();
|
||||
azsnprintf(startupParams.assetsPath, sizeof(startupParams.assetsPath), "%s/%s", startupParams.rootPath, gameFolderLower.c_str());
|
||||
|
||||
// compute where the cache should be located
|
||||
azsnprintf(startupParams.rootPathCache, sizeof(startupParams.rootPathCache), "%s/Cache/%s/%s", m_rootFolder.c_str(), m_gameFolder.c_str(), m_assetPlatform.c_str());
|
||||
azsnprintf(startupParams.assetsPathCache, sizeof(startupParams.assetsPathCache), "%s/%s", startupParams.rootPathCache, gameFolderLower.c_str());
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
void OnLoadSettings()
|
||||
{
|
||||
auto settingsRegistry = AZ::SettingsRegistry::Get();
|
||||
if (settingsRegistry == nullptr)
|
||||
{
|
||||
AZ_Warning("ParseEngineConfig", false, "Attempting to load configuration data while SettingsRegistry does not exist");
|
||||
return;
|
||||
|
||||
}
|
||||
AZ::SettingsRegistryInterface::FixedValueString settingsKeyPrefix = AZ::SettingsRegistryMergeUtils::BootstrapSettingsRootKey;
|
||||
AZ::SettingsRegistryInterface::FixedValueString settingsValueString;
|
||||
AZ::s64 settingsValueInt{};
|
||||
|
||||
if (AZ::SettingsRegistryMergeUtils::PlatformGet(*settingsRegistry, settingsValueInt, settingsKeyPrefix, CONFIG_KEY_FOR_REMOTEFILEIO))
|
||||
{
|
||||
m_remoteFileIO = settingsValueInt != 0;
|
||||
}
|
||||
if (AZ::SettingsRegistryMergeUtils::PlatformGet(*settingsRegistry, settingsValueInt, settingsKeyPrefix, CONFIG_KEY_WAIT_FOR_CONNECT))
|
||||
{
|
||||
m_waitForConnect = settingsValueInt != 0;
|
||||
}
|
||||
if (AZ::SettingsRegistryMergeUtils::PlatformGet(*settingsRegistry, settingsValueInt, settingsKeyPrefix, CONFIG_KEY_FOR_CONNECTTOREMOTE))
|
||||
{
|
||||
m_connectToRemote = settingsValueInt != 0;
|
||||
}
|
||||
if (AZ::SettingsRegistryMergeUtils::PlatformGet(*settingsRegistry, settingsValueInt, settingsKeyPrefix, CONFIG_KEY_FOR_REMOTEPORT))
|
||||
{
|
||||
m_remotePort = aznumeric_cast<AZ::u16>(settingsValueInt);
|
||||
}
|
||||
if (settingsValueString = {};
|
||||
AZ::SettingsRegistryMergeUtils::PlatformGet(*settingsRegistry, settingsValueString, settingsKeyPrefix, CONFIG_KEY_FOR_REMOTEIP))
|
||||
{
|
||||
m_remoteIP.assign(settingsValueString.c_str(), settingsValueString.size());
|
||||
}
|
||||
if (settingsValueString = {};
|
||||
AZ::SettingsRegistryMergeUtils::PlatformGet(*settingsRegistry, settingsValueString, settingsKeyPrefix, CONFIG_KEY_FOR_ASSETS))
|
||||
{
|
||||
m_assetPlatform.assign(settingsValueString.c_str(), settingsValueString.size());
|
||||
}
|
||||
if (settingsValueString = {};
|
||||
settingsRegistry->Get(settingsValueString, settingsKeyPrefix + "/" + CONFIG_KEY_FOR_BRANCHTOKEN))
|
||||
{
|
||||
m_branchToken.assign(settingsValueString.c_str(), settingsValueString.size());
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
@@ -293,7 +293,7 @@ typedef uint32 vtx_idx;
|
||||
|
||||
#if defined(ENABLE_PROFILING_CODE)
|
||||
# define USE_DISK_PROFILER
|
||||
//# define ENABLE_LOADING_PROFILER // Not guaranteed to have enough slots for all the threads in the system
|
||||
# define ENABLE_LOADING_PROFILER // requires AZ_PROFILE_TELEMETRY to also be defined
|
||||
#endif
|
||||
|
||||
#if defined(SOFTCODE_ENABLED)
|
||||
|
||||
@@ -110,7 +110,6 @@ set(FILES
|
||||
AzDXGIFormat.h
|
||||
SFunctor.h
|
||||
FunctorBaseFunction.h
|
||||
ParseEngineConfig.h
|
||||
CustomMemoryHeap.h
|
||||
FunctorBaseMember.h
|
||||
stridedptr.h
|
||||
|
||||
Reference in New Issue
Block a user