Enables override/virtual warnings

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-09-15 14:11:17 -07:00
committed by GitHub
501 changed files with 3326 additions and 2777 deletions
+21 -21
View File
@@ -82,7 +82,7 @@ enum EVarFlags
struct ICVarDumpSink
{
// <interfuscator:shuffle>
virtual ~ICVarDumpSink(){}
virtual ~ICVarDumpSink()= default;
virtual void OnElementFound(ICVar* pCVar) = 0;
// </interfuscator:shuffle>
};
@@ -90,7 +90,7 @@ struct ICVarDumpSink
struct IKeyBindDumpSink
{
// <interfuscator:shuffle>
virtual ~IKeyBindDumpSink(){}
virtual ~IKeyBindDumpSink()= default;
virtual void OnKeyBindFound(const char* sBind, const char* sCommand) = 0;
// </interfuscator:shuffle>
};
@@ -98,7 +98,7 @@ struct IKeyBindDumpSink
struct IOutputPrintSink
{
// <interfuscator:shuffle>
virtual ~IOutputPrintSink(){}
virtual ~IOutputPrintSink()= default;
virtual void Print(const char* inszText) = 0;
// </interfuscator:shuffle>
};
@@ -107,7 +107,7 @@ struct IOutputPrintSink
struct IConsoleVarSink
{
// <interfuscator:shuffle>
virtual ~IConsoleVarSink(){}
virtual ~IConsoleVarSink()= default;
// Called by Console before changing console var value, to validate if var can be changed.
// Return value: true if ok to change value, false if should not change value.
virtual bool OnBeforeVarChange(ICVar* pVar, const char* sNewValue) = 0;
@@ -120,7 +120,7 @@ struct IConsoleVarSink
struct IConsoleCmdArgs
{
// <interfuscator:shuffle>
virtual ~IConsoleCmdArgs(){}
virtual ~IConsoleCmdArgs()= default;
// Gets number of arguments supplied to the command (including the command itself)
virtual int GetArgCount() const = 0;
// Gets argument by index, nIndex must be in 0 <= nIndex < GetArgCount()
@@ -134,7 +134,7 @@ struct IConsoleCmdArgs
struct IConsoleArgumentAutoComplete
{
// <interfuscator:shuffle>
virtual ~IConsoleArgumentAutoComplete(){}
virtual ~IConsoleArgumentAutoComplete()= default;
// Gets number of matches for the argument to auto complete.
virtual int GetCount() const = 0;
// Gets argument value by index, nIndex must be in 0 <= nIndex < GetCount()
@@ -143,10 +143,10 @@ struct IConsoleArgumentAutoComplete
};
// This a definition of the console command function that can be added to console with AddCommand.
typedef void (* ConsoleCommandFunc)(IConsoleCmdArgs*);
using ConsoleCommandFunc = void (*)(IConsoleCmdArgs*);
// This a definition of the callback function that is called when variable change.
typedef void (* ConsoleVarFunc)(ICVar*);
using ConsoleVarFunc = void (*)(ICVar*);
/* Summary: Interface to the engine console.
@@ -163,7 +163,7 @@ typedef void (* ConsoleVarFunc)(ICVar*);
struct IConsole
{
// <interfuscator:shuffle>
virtual ~IConsole(){}
virtual ~IConsole()= default;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Deletes the console
virtual void Release() = 0;
@@ -180,7 +180,7 @@ struct IConsole
// help - help text that is shown when you use <sName> ? in the console
// Return:
// pointer to the interface ICVar
virtual ICVar* RegisterString(const char* sName, const char* sValue, int nFlags, const char* help = "", ConsoleVarFunc pChangeFunc = 0) = 0;
virtual ICVar* RegisterString(const char* sName, const char* sValue, int nFlags, const char* help = "", ConsoleVarFunc pChangeFunc = nullptr) = 0;
// Create a new console variable that store the value in a int
// Arguments:
// sName - console variable name
@@ -189,7 +189,7 @@ struct IConsole
// help - help text that is shown when you use <sName> ? in the console
// Return:
// pointer to the interface ICVar
virtual ICVar* RegisterInt(const char* sName, int iValue, int nFlags, const char* help = "", ConsoleVarFunc pChangeFunc = 0) = 0;
virtual ICVar* RegisterInt(const char* sName, int iValue, int nFlags, const char* help = "", ConsoleVarFunc pChangeFunc = nullptr) = 0;
// Create a new console variable that store the value in a float
// Arguments:
// sName - console variable name
@@ -198,7 +198,7 @@ struct IConsole
// help - help text that is shown when you use <sName> ? in the console
// Return:
// pointer to the interface ICVar
virtual ICVar* RegisterFloat(const char* sName, float fValue, int nFlags, const char* help = "", ConsoleVarFunc pChangeFunc = 0) = 0;
virtual ICVar* RegisterFloat(const char* sName, float fValue, int nFlags, const char* help = "", ConsoleVarFunc pChangeFunc = nullptr) = 0;
// Create a new console variable that will update the user defined float
// Arguments:
@@ -209,7 +209,7 @@ struct IConsole
// allowModify - allow modification through config vars, prevents missing modifications in release mode
// Return:
// pointer to the interface ICVar
virtual ICVar* Register(const char* name, float* src, float defaultvalue, int nFlags = 0, const char* help = "", ConsoleVarFunc pChangeFunc = 0, bool allowModify = true) = 0;
virtual ICVar* Register(const char* name, float* src, float defaultvalue, int nFlags = 0, const char* help = "", ConsoleVarFunc pChangeFunc = nullptr, bool allowModify = true) = 0;
// Create a new console variable that will update the user defined integer
// Arguments:
// sName - console variable name
@@ -219,7 +219,7 @@ struct IConsole
// allowModify - allow modification through config vars, prevents missing modifications in release mode
// Return:
// pointer to the interface ICVar
virtual ICVar* Register(const char* name, int* src, int defaultvalue, int nFlags = 0, const char* help = "", ConsoleVarFunc pChangeFunc = 0, bool allowModify = true) = 0;
virtual ICVar* Register(const char* name, int* src, int defaultvalue, int nFlags = 0, const char* help = "", ConsoleVarFunc pChangeFunc = nullptr, bool allowModify = true) = 0;
// Create a new console variable that will update the user defined pointer to null terminated string
// Arguments:
@@ -230,7 +230,7 @@ struct IConsole
// allowModify - allow modification through config vars, prevents missing modifications in release mode
// Return:
// pointer to the interface ICVar
virtual ICVar* Register(const char* name, const char** src, const char* defaultvalue, int nFlags = 0, const char* help = "", ConsoleVarFunc pChangeFunc = 0, bool allowModify = true) = 0;
virtual ICVar* Register(const char* name, const char** src, const char* defaultvalue, int nFlags = 0, const char* help = "", ConsoleVarFunc pChangeFunc = nullptr, bool allowModify = true) = 0;
// ! Remove a variable from the console
// @param sVarName console variable name
@@ -348,7 +348,7 @@ struct IConsole
// sHelp - Help string, will be displayed when typing in console "command ?".
// Return
// True if successful, false otherwise.
virtual bool AddCommand(const char* sCommand, ConsoleCommandFunc func, int nFlags = 0, const char* sHelp = NULL) = 0;
virtual bool AddCommand(const char* sCommand, ConsoleCommandFunc func, int nFlags = 0, const char* sHelp = nullptr) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Description:
@@ -363,7 +363,7 @@ struct IConsole
// Return
// True if successful, false otherwise.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
virtual bool AddCommand(const char* sName, const char* sScriptFunc, int nFlags = 0, const char* sHelp = NULL) = 0;
virtual bool AddCommand(const char* sName, const char* sScriptFunc, int nFlags = 0, const char* sHelp = nullptr) = 0;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Description:
@@ -402,7 +402,7 @@ struct IConsole
// szPrefix - 0 or prefix e.g. "sys_spec_"
// Return
// used size
virtual size_t GetSortedVars(AZStd::vector<AZStd::string_view>& pszArray, const char* szPrefix = 0) = 0;
virtual size_t GetSortedVars(AZStd::vector<AZStd::string_view>& pszArray, const char* szPrefix = nullptr) = 0;
virtual const char* AutoComplete(const char* substr) = 0;
virtual const char* AutoCompletePrev(const char* substr) = 0;
virtual const char* ProcessCompletion(const char* szInputBuffer) = 0;
@@ -466,7 +466,7 @@ struct IConsole
// This interface for the remote console
struct IRemoteConsoleListener
{
virtual ~IRemoteConsoleListener() {}
virtual ~IRemoteConsoleListener() = default;
virtual void OnConsoleCommand([[maybe_unused]] const char* cmd) {};
virtual void OnGameplayCommand([[maybe_unused]] const char* cmd) {};
@@ -474,7 +474,7 @@ struct IRemoteConsoleListener
struct IRemoteConsole
{
virtual ~IRemoteConsole() {};
virtual ~IRemoteConsole() = default;;
virtual void RegisterConsoleVariables() = 0;
virtual void UnregisterConsoleVariables() = 0;
@@ -513,7 +513,7 @@ struct ICVar
// <interfuscator:shuffle>
// TODO make protected;
virtual ~ICVar() {}
virtual ~ICVar() = default;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// delete the variable
// NOTE: the variable will automatically unregister itself from the console
+32 -32
View File
@@ -28,7 +28,7 @@ class XmlNodeRef;
struct SLocalizedInfoGame
{
SLocalizedInfoGame ()
: szCharacterName(NULL)
: szCharacterName(nullptr)
, bUseSubtitle(false)
{
}
@@ -50,15 +50,15 @@ struct SLocalizedSoundInfoGame
: public SLocalizedInfoGame
{
SLocalizedSoundInfoGame()
: sSoundEvent(NULL)
: sSoundEvent(nullptr)
, fVolume(0.f)
, fRadioRatio (0.f)
, bIsDirectRadio(false)
, bIsIntercepted(false)
, nNumSoundMoods(0)
, pSoundMoods (NULL)
, pSoundMoods (nullptr)
, nNumEventParameters(0)
, pEventParameters(NULL)
, pEventParameters(nullptr)
{
}
@@ -82,10 +82,10 @@ struct SLocalizedInfoEditor
: public SLocalizedInfoGame
{
SLocalizedInfoEditor()
: sKey(NULL)
, sOriginalCharacterName(NULL)
, sOriginalActorLine(NULL)
, sUtf8TranslatedActorLine(NULL)
: sKey(nullptr)
, sOriginalCharacterName(nullptr)
, sOriginalActorLine(nullptr)
, sUtf8TranslatedActorLine(nullptr)
, nRow(0)
{
}
@@ -133,21 +133,21 @@ struct ILocalizationManager
ePILID_MAX_OR_INVALID, //Not a language, denotes the maximum number of languages or an unknown language
};
typedef uint32 TLocalizationBitfield;
using TLocalizationBitfield = uint32;
// <interfuscator:shuffle>
virtual ~ILocalizationManager(){}
virtual ~ILocalizationManager()= default;
virtual const char* LangNameFromPILID(const ILocalizationManager::EPlatformIndependentLanguageID id) = 0;
virtual ILocalizationManager::EPlatformIndependentLanguageID PILIDFromLangName(AZStd::string langName) = 0;
virtual ILocalizationManager::EPlatformIndependentLanguageID GetSystemLanguage() { return ILocalizationManager::EPlatformIndependentLanguageID::ePILID_English_US; }
virtual ILocalizationManager::TLocalizationBitfield MaskSystemLanguagesFromSupportedLocalizations(const ILocalizationManager::TLocalizationBitfield systemLanguages) = 0;
virtual ILocalizationManager::TLocalizationBitfield IsLanguageSupported(const ILocalizationManager::EPlatformIndependentLanguageID id) = 0;
virtual bool SetLanguage([[maybe_unused]] const char* sLanguage) override { return false; }
virtual const char* GetLanguage() override { return nullptr; }
bool SetLanguage([[maybe_unused]] const char* sLanguage) override { return false; }
const char* GetLanguage() override { return nullptr; }
virtual int GetLocalizationFormat() const { return -1; }
virtual AZStd::string GetLocalizedSubtitleFilePath([[maybe_unused]] const AZStd::string& localVideoPath, [[maybe_unused]] const AZStd::string& subtitleFileExtension) const { return ""; }
virtual AZStd::string GetLocalizedLocXMLFilePath([[maybe_unused]] const AZStd::string& localXmlPath) const { return ""; }
int GetLocalizationFormat() const override { return -1; }
AZStd::string GetLocalizedSubtitleFilePath([[maybe_unused]] const AZStd::string& localVideoPath, [[maybe_unused]] const AZStd::string& subtitleFileExtension) const override { return ""; }
AZStd::string GetLocalizedLocXMLFilePath([[maybe_unused]] const AZStd::string& localXmlPath) const override { return ""; }
// load the descriptor file with tag information
virtual bool InitLocalizationData(const char* sFileName, bool bReload = false) = 0;
// request to load loca data by tag. Actual loading will happen during next level load begin event.
@@ -157,8 +157,8 @@ struct ILocalizationManager
virtual bool ReleaseLocalizationDataByTag(const char* sTag) = 0;
virtual bool LoadAllLocalizationData(bool bReload = false) = 0;
virtual bool LoadExcelXmlSpreadsheet([[maybe_unused]] const char* sFileName, [[maybe_unused]] bool bReload = false) override { return false; }
virtual void ReloadData() override {};
bool LoadExcelXmlSpreadsheet([[maybe_unused]] const char* sFileName, [[maybe_unused]] bool bReload = false) override { return false; }
void ReloadData() override {};
// Summary:
// Free localization data.
@@ -174,15 +174,15 @@ struct ILocalizationManager
// bEnglish - if true, translates the string into the always present English language.
// Returns:
// true if localization was successful, false otherwise
virtual bool LocalizeString_ch([[maybe_unused]] const char* sString, [[maybe_unused]] AZStd::string& outLocalizedString, [[maybe_unused]] bool bEnglish = false) override { return false; }
bool LocalizeString_ch([[maybe_unused]] const char* sString, [[maybe_unused]] AZStd::string& outLocalizedString, [[maybe_unused]] bool bEnglish = false) override { return false; }
// Summary:
// Same as LocalizeString( const char* sString, AZStd::string& outLocalizedString, bool bEnglish=false )
// but at the moment this is faster.
virtual bool LocalizeString_s([[maybe_unused]] const AZStd::string& sString, [[maybe_unused]] AZStd::string& outLocalizedString, [[maybe_unused]] bool bEnglish = false) override { return false; }
bool LocalizeString_s([[maybe_unused]] const AZStd::string& sString, [[maybe_unused]] AZStd::string& outLocalizedString, [[maybe_unused]] bool bEnglish = false) override { return false; }
// Summary:
virtual void LocalizeAndSubstituteInternal([[maybe_unused]] AZStd::string& locString, [[maybe_unused]] const AZStd::vector<AZStd::string>& keys, [[maybe_unused]] const AZStd::vector<AZStd::string>& values) override {}
void LocalizeAndSubstituteInternal([[maybe_unused]] AZStd::string& locString, [[maybe_unused]] const AZStd::vector<AZStd::string>& keys, [[maybe_unused]] const AZStd::vector<AZStd::string>& values) override {}
// Return the localized version corresponding to a label.
// Description:
// A label has to start with '@' sign.
@@ -192,7 +192,7 @@ struct ILocalizationManager
// bEnglish - if true, returns the always present English version of the label.
// Returns:
// True if localization was successful, false otherwise.
virtual bool LocalizeLabel([[maybe_unused]] const char* sLabel, [[maybe_unused]] AZStd::string& outLocalizedString, [[maybe_unused]] bool bEnglish = false) override { return false; }
bool LocalizeLabel([[maybe_unused]] const char* sLabel, [[maybe_unused]] AZStd::string& outLocalizedString, [[maybe_unused]] bool bEnglish = false) override { return false; }
virtual bool IsLocalizedInfoFound([[maybe_unused]] const char* sKey) { return false; }
// Summary:
@@ -220,7 +220,7 @@ struct ILocalizationManager
// Summary:
// Return number of localization entries.
virtual int GetLocalizedStringCount() override { return -1; }
int GetLocalizedStringCount() override { return -1; }
// Summary:
// Get the localization info structure at index nIndex.
@@ -247,7 +247,7 @@ struct ILocalizationManager
// sLocalizedString - Corresponding english language string.
// Returns:
// True if successful, false otherwise (key not found).
virtual bool GetEnglishString([[maybe_unused]] const char* sKey, [[maybe_unused]] AZStd::string& sLocalizedString) override { return false; }
bool GetEnglishString([[maybe_unused]] const char* sKey, [[maybe_unused]] AZStd::string& sLocalizedString) override { return false; }
// Summary:
// Get Subtitle for Key or Label .
@@ -257,25 +257,25 @@ struct ILocalizationManager
// bForceSubtitle - If true, get subtitle (sLocalized or sEnglish) even if not specified in Data file.
// Returns:
// True if subtitle found (and outSubtitle filled in), false otherwise.
virtual bool GetSubtitle([[maybe_unused]] const char* sKeyOrLabel, [[maybe_unused]] AZStd::string& outSubtitle, [[maybe_unused]] bool bForceSubtitle = false) override { return false; }
bool GetSubtitle([[maybe_unused]] const char* sKeyOrLabel, [[maybe_unused]] AZStd::string& outSubtitle, [[maybe_unused]] bool bForceSubtitle = false) override { return false; }
// Description:
// These methods format outString depending on sString with ordered arguments
// FormatStringMessage(outString, "This is %2 and this is %1", "second", "first");
// Arguments:
// outString - This is first and this is second.
virtual void FormatStringMessage_List([[maybe_unused]] AZStd::string& outString, [[maybe_unused]] const AZStd::string& sString, [[maybe_unused]] const char** sParams, [[maybe_unused]] int nParams) override {}
virtual void FormatStringMessage([[maybe_unused]] AZStd::string& outString, [[maybe_unused]] const AZStd::string& sString, [[maybe_unused]] const char* param1, [[maybe_unused]] const char* param2 = 0, [[maybe_unused]] const char* param3 = 0, [[maybe_unused]] const char* param4 = 0) override {}
void FormatStringMessage_List([[maybe_unused]] AZStd::string& outString, [[maybe_unused]] const AZStd::string& sString, [[maybe_unused]] const char** sParams, [[maybe_unused]] int nParams) override {}
void FormatStringMessage([[maybe_unused]] AZStd::string& outString, [[maybe_unused]] const AZStd::string& sString, [[maybe_unused]] const char* param1, [[maybe_unused]] const char* param2 = nullptr, [[maybe_unused]] const char* param3 = nullptr, [[maybe_unused]] const char* param4 = nullptr) override {}
virtual void LocalizeTime([[maybe_unused]] time_t t, [[maybe_unused]] bool bMakeLocalTime, [[maybe_unused]] bool bShowSeconds, [[maybe_unused]] AZStd::string& outTimeString) override {}
virtual void LocalizeDate([[maybe_unused]] time_t t, [[maybe_unused]] bool bMakeLocalTime, [[maybe_unused]] bool bShort, [[maybe_unused]] bool bIncludeWeekday, [[maybe_unused]] AZStd::string& outDateString) override {}
virtual void LocalizeDuration([[maybe_unused]] int seconds, [[maybe_unused]] AZStd::string& outDurationString) override {}
virtual void LocalizeNumber([[maybe_unused]] int number, [[maybe_unused]] AZStd::string& outNumberString) override {}
virtual void LocalizeNumber_Decimal([[maybe_unused]] float number, [[maybe_unused]] int decimals, [[maybe_unused]] AZStd::string& outNumberString) override {}
void LocalizeTime([[maybe_unused]] time_t t, [[maybe_unused]] bool bMakeLocalTime, [[maybe_unused]] bool bShowSeconds, [[maybe_unused]] AZStd::string& outTimeString) override {}
void LocalizeDate([[maybe_unused]] time_t t, [[maybe_unused]] bool bMakeLocalTime, [[maybe_unused]] bool bShort, [[maybe_unused]] bool bIncludeWeekday, [[maybe_unused]] AZStd::string& outDateString) override {}
void LocalizeDuration([[maybe_unused]] int seconds, [[maybe_unused]] AZStd::string& outDurationString) override {}
void LocalizeNumber([[maybe_unused]] int number, [[maybe_unused]] AZStd::string& outNumberString) override {}
void LocalizeNumber_Decimal([[maybe_unused]] float number, [[maybe_unused]] int decimals, [[maybe_unused]] AZStd::string& outNumberString) override {}
// Summary:
// Returns true if the project has localization configured for use, false otherwise.
virtual bool ProjectUsesLocalization() const override { return false; }
bool ProjectUsesLocalization() const override { return false; }
// </interfuscator:shuffle>
static ILINE TLocalizationBitfield LocalizationBitfieldFromPILID(EPlatformIndependentLanguageID pilid)
+2 -2
View File
@@ -119,8 +119,8 @@ struct CNullMiniLog
// The default implementation just won't do anything
//##@{
void LogV([[maybe_unused]] const char* szFormat, [[maybe_unused]] va_list args) {}
void LogV([[maybe_unused]] ELogType nType, [[maybe_unused]] const char* szFormat, [[maybe_unused]] va_list args) {}
void LogV ([[maybe_unused]] ELogType nType, [[maybe_unused]] int flags, [[maybe_unused]] const char* szFormat, [[maybe_unused]] va_list args) {}
void LogV([[maybe_unused]] ELogType nType, [[maybe_unused]] const char* szFormat, [[maybe_unused]] va_list args) override {}
void LogV ([[maybe_unused]] ELogType nType, [[maybe_unused]] int flags, [[maybe_unused]] const char* szFormat, [[maybe_unused]] va_list args) override {}
//##@}
};
+10 -10
View File
@@ -54,39 +54,39 @@ public:
{
}
void BeginGroup(const char* szName)
void BeginGroup(const char* szName) override
{
m_impl.BeginGroup(szName);
}
bool BeginOptionalGroup(const char* szName, bool condition)
bool BeginOptionalGroup(const char* szName, bool condition) override
{
return m_impl.BeginOptionalGroup(szName, condition);
}
void EndGroup()
void EndGroup() override
{
m_impl.EndGroup();
}
bool IsReading() const
bool IsReading() const override
{
return m_impl.IsReading();
}
void WriteStringValue(const char* name, SSerializeString& value)
void WriteStringValue(const char* name, SSerializeString& value) override
{
m_impl.Value(name, value);
}
void ReadStringValue(const char* name, SSerializeString& curValue)
void ReadStringValue(const char* name, SSerializeString& curValue) override
{
m_impl.Value(name, curValue);
}
#define SERIALIZATION_TYPE(T) \
void Value(const char* name, T& x) override \
{ \
m_impl.Value(name, x); \
#define SERIALIZATION_TYPE(T) \
void Value(const char* name, T& x) override \
{ \
m_impl.Value(name, x); \
}
#include "SerializationTypes.h"
#undef SERIALIZATION_TYPE
+19 -22
View File
@@ -25,9 +25,9 @@ public:
CLevelInfo() = default;
// ILevelInfo
virtual const char* GetName() const { return m_levelName.c_str(); }
virtual const char* GetPath() const { return m_levelPath.c_str(); }
virtual const char* GetAssetName() const { return m_levelAssetName.c_str(); }
const char* GetName() const override { return m_levelName.c_str(); }
const char* GetPath() const override { return m_levelPath.c_str(); }
const char* GetAssetName() const override { return m_levelAssetName.c_str(); }
// ~ILevelInfo
@@ -62,9 +62,9 @@ public:
CLevel() {}
virtual ~CLevel() = default;
virtual void Release() { delete this; }
void Release() override { delete this; }
virtual ILevelInfo* GetLevelInfo() { return &m_levelInfo; }
ILevelInfo* GetLevelInfo() override { return &m_levelInfo; }
private:
CLevelInfo m_levelInfo;
@@ -77,38 +77,35 @@ public:
CLevelSystem(ISystem* pSystem, const char* levelsFolder);
virtual ~CLevelSystem();
void Release() { delete this; };
void Release() override { delete this; };
// ILevelSystem
virtual void Rescan(const char* levelsFolder);
virtual int GetLevelCount();
virtual ILevelInfo* GetLevelInfo(int level);
virtual ILevelInfo* GetLevelInfo(const char* levelName);
void Rescan(const char* levelsFolder) override;
int GetLevelCount() override;
ILevelInfo* GetLevelInfo(int level) override;
ILevelInfo* GetLevelInfo(const char* levelName) override;
virtual void AddListener(ILevelSystemListener* pListener);
virtual void RemoveListener(ILevelSystemListener* pListener);
void AddListener(ILevelSystemListener* pListener) override;
void RemoveListener(ILevelSystemListener* pListener) override;
virtual bool LoadLevel(const char* levelName);
virtual void UnloadLevel();
virtual bool IsLevelLoaded() { return m_bLevelLoaded; }
bool LoadLevel(const char* levelName) override;
void UnloadLevel() override;
bool IsLevelLoaded() override { return m_bLevelLoaded; }
const char* GetCurrentLevelName() const override
{
if (m_pCurrentLevel && m_pCurrentLevel->GetLevelInfo())
{
return m_pCurrentLevel->GetLevelInfo()->GetName();
}
else
{
return "";
}
return "";
}
// If the level load failed then we need to have a different shutdown procedure vs when a level is naturally unloaded
virtual void SetLevelLoadFailed(bool loadFailed) { m_levelLoadFailed = loadFailed; }
virtual bool GetLevelLoadFailed() { return m_levelLoadFailed; }
void SetLevelLoadFailed(bool loadFailed) override { m_levelLoadFailed = loadFailed; }
bool GetLevelLoadFailed() override { return m_levelLoadFailed; }
// Unsupported by legacy level system.
virtual AZ::Data::AssetType GetLevelAssetType() const { return {}; }
AZ::Data::AssetType GetLevelAssetType() const override { return {}; }
// ~ILevelSystem
+32 -32
View File
@@ -27,7 +27,7 @@ class CLocalizedStringsManager
, public ISystemEventListener
{
public:
typedef std::vector<AZStd::string> TLocalizationTagVec;
using TLocalizationTagVec = std::vector<AZStd::string>;
constexpr const static size_t LOADING_FIXED_STRING_LENGTH = 2048;
constexpr const static size_t COMPRESSION_FIXED_BUFFER_LENGTH = 6144;
@@ -36,45 +36,45 @@ public:
virtual ~CLocalizedStringsManager();
// ILocalizationManager
const char* LangNameFromPILID(const ILocalizationManager::EPlatformIndependentLanguageID id);
const char* LangNameFromPILID(const ILocalizationManager::EPlatformIndependentLanguageID id) override;
ILocalizationManager::EPlatformIndependentLanguageID PILIDFromLangName(AZStd::string langName) override;
ILocalizationManager::EPlatformIndependentLanguageID GetSystemLanguage() override;
ILocalizationManager::TLocalizationBitfield MaskSystemLanguagesFromSupportedLocalizations(const ILocalizationManager::TLocalizationBitfield systemLanguages);
ILocalizationManager::TLocalizationBitfield IsLanguageSupported(const ILocalizationManager::EPlatformIndependentLanguageID id);
ILocalizationManager::TLocalizationBitfield MaskSystemLanguagesFromSupportedLocalizations(const ILocalizationManager::TLocalizationBitfield systemLanguages) override;
ILocalizationManager::TLocalizationBitfield IsLanguageSupported(const ILocalizationManager::EPlatformIndependentLanguageID id) override;
const char* GetLanguage() override;
bool SetLanguage(const char* sLanguage) override;
int GetLocalizationFormat() const override;
virtual AZStd::string GetLocalizedSubtitleFilePath(const AZStd::string& localVideoPath, const AZStd::string& subtitleFileExtension) const override;
virtual AZStd::string GetLocalizedLocXMLFilePath(const AZStd::string& localXmlPath) const override;
bool InitLocalizationData(const char* sFileName, bool bReload = false);
bool RequestLoadLocalizationDataByTag(const char* sTag);
bool LoadLocalizationDataByTag(const char* sTag, bool bReload = false);
bool ReleaseLocalizationDataByTag(const char* sTag);
AZStd::string GetLocalizedSubtitleFilePath(const AZStd::string& localVideoPath, const AZStd::string& subtitleFileExtension) const override;
AZStd::string GetLocalizedLocXMLFilePath(const AZStd::string& localXmlPath) const override;
bool InitLocalizationData(const char* sFileName, bool bReload = false) override;
bool RequestLoadLocalizationDataByTag(const char* sTag) override;
bool LoadLocalizationDataByTag(const char* sTag, bool bReload = false) override;
bool ReleaseLocalizationDataByTag(const char* sTag) override;
bool LoadAllLocalizationData(bool bReload = false) override;
bool LoadExcelXmlSpreadsheet(const char* sFileName, bool bReload = false) override;
void ReloadData() override;
void FreeData();
void FreeData() override;
bool LocalizeString_s(const AZStd::string& sString, AZStd::string& outLocalizedString, bool bEnglish = false) override;
bool LocalizeString_ch(const char* sString, AZStd::string& outLocalizedString, bool bEnglish = false) override;
void LocalizeAndSubstituteInternal(AZStd::string& locString, const AZStd::vector<AZStd::string>& keys, const AZStd::vector<AZStd::string>& values) override;
bool LocalizeLabel(const char* sLabel, AZStd::string& outLocalizedString, bool bEnglish = false) override;
bool IsLocalizedInfoFound(const char* sKey);
bool GetLocalizedInfoByKey(const char* sKey, SLocalizedInfoGame& outGameInfo);
bool GetLocalizedInfoByKey(const char* sKey, SLocalizedSoundInfoGame* pOutSoundInfoGame);
int GetLocalizedStringCount();
bool GetLocalizedInfoByIndex(int nIndex, SLocalizedInfoGame& outGameInfo);
bool GetLocalizedInfoByIndex(int nIndex, SLocalizedInfoEditor& outEditorInfo);
bool IsLocalizedInfoFound(const char* sKey) override;
bool GetLocalizedInfoByKey(const char* sKey, SLocalizedInfoGame& outGameInfo) override;
bool GetLocalizedInfoByKey(const char* sKey, SLocalizedSoundInfoGame* pOutSoundInfoGame) override;
int GetLocalizedStringCount() override;
bool GetLocalizedInfoByIndex(int nIndex, SLocalizedInfoGame& outGameInfo) override;
bool GetLocalizedInfoByIndex(int nIndex, SLocalizedInfoEditor& outEditorInfo) override;
bool GetEnglishString(const char* sKey, AZStd::string& sLocalizedString) override;
bool GetSubtitle(const char* sKeyOrLabel, AZStd::string& outSubtitle, bool bForceSubtitle = false) override;
void FormatStringMessage_List(AZStd::string& outString, const AZStd::string& sString, const char** sParams, int nParams) override;
void FormatStringMessage(AZStd::string& outString, const AZStd::string& sString, const char* param1, const char* param2 = 0, const char* param3 = 0, const char* param4 = 0) override;
void FormatStringMessage(AZStd::string& outString, const AZStd::string& sString, const char* param1, const char* param2 = nullptr, const char* param3 = nullptr, const char* param4 = nullptr) override;
void LocalizeTime(time_t t, bool bMakeLocalTime, bool bShowSeconds, AZStd::string& outTimeString) override;
void LocalizeDate(time_t t, bool bMakeLocalTime, bool bShort, bool bIncludeWeekday, AZStd::string& outDateString) override;
@@ -86,7 +86,7 @@ public:
// ~ILocalizationManager
// ISystemEventManager
void OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_PTR lparam);
void OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_PTR lparam) override;
// ~ISystemEventManager
void GetLoadedTags(TLocalizationTagVec& tagVec);
@@ -98,7 +98,7 @@ private:
bool LocalizeStringInternal(const char* pStr, size_t len, AZStd::string& outLocalizedString, bool bEnglish);
bool DoLoadExcelXmlSpreadsheet(const char* sFileName, uint8 tagID, bool bReload);
typedef bool(CLocalizedStringsManager::*LoadFunc)(const char*, uint8, bool);
using LoadFunc = bool(CLocalizedStringsManager::*)(const char*, uint8, bool);
bool DoLoadAGSXmlDocument(const char* sFileName, uint8 tagID, bool bReload);
LoadFunc GetLoadFunction() const;
@@ -163,9 +163,9 @@ private:
SLocalizedStringEntry()
: flags(0)
, huffmanTreeIndex(-1)
, pEditorExtension(NULL)
, pEditorExtension(nullptr)
{
TranslatedText.psUtf8Uncompressed = NULL;
TranslatedText.psUtf8Uncompressed = nullptr;
};
~SLocalizedStringEntry()
{
@@ -184,12 +184,12 @@ private:
};
//Keys as CRC32. Strings previously, but these proved too large
typedef VectorMap<uint32, SLocalizedStringEntry*> StringsKeyMap;
using StringsKeyMap = VectorMap<uint32, SLocalizedStringEntry*>;
struct SLanguage
{
typedef std::vector<SLocalizedStringEntry*> TLocalizedStringEntries;
typedef std::vector<HuffmanCoder*> THuffmanCoders;
using TLocalizedStringEntries = std::vector<SLocalizedStringEntry*>;
using THuffmanCoders = std::vector<HuffmanCoder*>;
AZStd::string sLanguage;
StringsKeyMap m_keysMap;
@@ -224,27 +224,27 @@ private:
SLanguage* m_pLanguage;
// all loaded Localization Files
typedef std::pair<AZStd::string, SFileInfo> pairFileName;
typedef std::map<AZStd::string, SFileInfo> tmapFilenames;
using pairFileName = std::pair<AZStd::string, SFileInfo>;
using tmapFilenames = std::map<AZStd::string, SFileInfo>;
tmapFilenames m_loadedTables;
// filenames per tag
typedef std::vector<AZStd::string> TStringVec;
using TStringVec = std::vector<AZStd::string>;
struct STag
{
TStringVec filenames;
uint8 id;
bool loaded;
};
typedef std::map<AZStd::string, STag> TTagFileNames;
using TTagFileNames = std::map<AZStd::string, STag>;
TTagFileNames m_tagFileNames;
TStringVec m_tagLoadRequests;
// Array of loaded languages.
std::vector<SLanguage*> m_languages;
typedef std::set<AZStd::string> PrototypeSoundEvents;
using PrototypeSoundEvents = std::set<AZStd::string>;
PrototypeSoundEvents m_prototypeEvents; // this set is purely used for clever string/string assigning to save memory
struct less_strcmp
@@ -255,7 +255,7 @@ private:
}
};
typedef std::set<AZStd::string, less_strcmp> CharacterNameSet;
using CharacterNameSet = std::set<AZStd::string, less_strcmp>;
CharacterNameSet m_characterNameSet; // this set is purely used for clever string/string assigning to save memory
// CVARs
@@ -268,5 +268,5 @@ private:
//Lock for
mutable AZStd::mutex m_cs;
typedef AZStd::lock_guard<AZStd::mutex> AutoLock;
using AutoLock = AZStd::lock_guard<AZStd::mutex>;
};
+85 -85
View File
@@ -90,7 +90,7 @@ class CWatchdogThread;
#endif
#ifdef WIN32
typedef void* WIN_HMODULE;
using WIN_HMODULE = void*;
#else
typedef void* WIN_HMODULE;
#endif
@@ -105,7 +105,7 @@ struct IDataProbe;
#define PHSYICS_OBJECT_ENTITY 0
typedef void (__cdecl * VTuneFunction)(void);
using VTuneFunction = void (__cdecl *)(void);
extern VTuneFunction VTResume;
extern VTuneFunction VTPause;
@@ -177,10 +177,10 @@ struct CProfilingSystem
// Summary:
// Resumes vtune data collection.
virtual void VTuneResume();
void VTuneResume() override;
// Summary:
// Pauses vtune data collection.
virtual void VTunePause();
void VTunePause() override;
//////////////////////////////////////////////////////////////////////////
};
@@ -216,105 +216,105 @@ public:
// interface ILoadConfigurationEntrySink ----------------------------------
virtual void OnLoadConfigurationEntry(const char* szKey, const char* szValue, const char* szGroup);
void OnLoadConfigurationEntry(const char* szKey, const char* szValue, const char* szGroup) override;
// ISystemEventListener
virtual void OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_PTR lparam);
void OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_PTR lparam) override;
///////////////////////////////////////////////////////////////////////////
//! @name ISystem implementation
//@{
virtual bool Init(const SSystemInitParams& startupParams);
virtual void Release();
void Release() override;
virtual SSystemGlobalEnvironment* GetGlobalEnvironment() { return &m_env; }
SSystemGlobalEnvironment* GetGlobalEnvironment() override { return &m_env; }
virtual bool UpdatePreTickBus(int updateFlags = 0, int nPauseMode = 0);
virtual bool UpdatePostTickBus(int updateFlags = 0, int nPauseMode = 0);
virtual bool UpdateLoadtime();
bool UpdatePreTickBus(int updateFlags = 0, int nPauseMode = 0) override;
bool UpdatePostTickBus(int updateFlags = 0, int nPauseMode = 0) override;
bool UpdateLoadtime() override;
////////////////////////////////////////////////////////////////////////
// CrySystemRequestBus interface implementation
ISystem* GetCrySystem() override;
////////////////////////////////////////////////////////////////////////
void Relaunch(bool bRelaunch);
bool IsRelaunch() const { return m_bRelaunch; };
void Relaunch(bool bRelaunch) override;
bool IsRelaunch() const override { return m_bRelaunch; };
void SerializingFile(int mode) { m_iLoadingMode = mode; }
int IsSerializingFile() const { return m_iLoadingMode; }
void Quit();
bool IsQuitting() const;
void SerializingFile(int mode) override { m_iLoadingMode = mode; }
int IsSerializingFile() const override { return m_iLoadingMode; }
void Quit() override;
bool IsQuitting() const override;
void ShutdownFileSystem(); // used to cleanup any file resources, such as cache handle.
void SetAffinity();
virtual const char* GetUserName();
virtual int GetApplicationInstance();
const char* GetUserName() override;
int GetApplicationInstance() override;
int GetApplicationLogInstance(const char* logFilePath) override;
ITimer* GetITimer(){ return m_env.pTimer; }
AZ::IO::IArchive* GetIPak() { return m_env.pCryPak; };
IConsole* GetIConsole() { return m_env.pConsole; };
IRemoteConsole* GetIRemoteConsole();
IMovieSystem* GetIMovieSystem() { return m_env.pMovieSystem; };
ICryFont* GetICryFont(){ return m_env.pCryFont; }
ILog* GetILog(){ return m_env.pLog; }
ICmdLine* GetICmdLine(){ return m_pCmdLine; }
IViewSystem* GetIViewSystem();
ILevelSystem* GetILevelSystem();
ISystemEventDispatcher* GetISystemEventDispatcher() { return m_pSystemEventDispatcher; }
IProfilingSystem* GetIProfilingSystem() { return &m_ProfilingSystem; }
ITimer* GetITimer() override{ return m_env.pTimer; }
AZ::IO::IArchive* GetIPak() override { return m_env.pCryPak; };
IConsole* GetIConsole() override { return m_env.pConsole; };
IRemoteConsole* GetIRemoteConsole() override;
IMovieSystem* GetIMovieSystem() override { return m_env.pMovieSystem; };
ICryFont* GetICryFont() override{ return m_env.pCryFont; }
ILog* GetILog() override{ return m_env.pLog; }
ICmdLine* GetICmdLine() override{ return m_pCmdLine; }
IViewSystem* GetIViewSystem() override;
ILevelSystem* GetILevelSystem() override;
ISystemEventDispatcher* GetISystemEventDispatcher() override { return m_pSystemEventDispatcher; }
IProfilingSystem* GetIProfilingSystem() override { return &m_ProfilingSystem; }
//////////////////////////////////////////////////////////////////////////
// retrieves the perlin noise singleton instance
CPNoise3* GetNoiseGen();
virtual uint64 GetUpdateCounter() { return m_nUpdateCounter; };
CPNoise3* GetNoiseGen() override;
uint64 GetUpdateCounter() override { return m_nUpdateCounter; };
void DetectGameFolderAccessRights();
virtual void ExecuteCommandLine(bool deferred=true);
void ExecuteCommandLine(bool deferred=true) override;
virtual void GetUpdateStats(SSystemUpdateStats& stats);
void GetUpdateStats(SSystemUpdateStats& stats) override;
//////////////////////////////////////////////////////////////////////////
virtual XmlNodeRef CreateXmlNode(const char* sNodeName = "", bool bReuseStrings = false, bool bIsProcessingInstruction = false);
virtual XmlNodeRef LoadXmlFromFile(const char* sFilename, bool bReuseStrings = false);
virtual XmlNodeRef LoadXmlFromBuffer(const char* buffer, size_t size, bool bReuseStrings = false, bool bSuppressWarnings = false);
virtual IXmlUtils* GetXmlUtils();
XmlNodeRef CreateXmlNode(const char* sNodeName = "", bool bReuseStrings = false, bool bIsProcessingInstruction = false) override;
XmlNodeRef LoadXmlFromFile(const char* sFilename, bool bReuseStrings = false) override;
XmlNodeRef LoadXmlFromBuffer(const char* buffer, size_t size, bool bReuseStrings = false, bool bSuppressWarnings = false) override;
IXmlUtils* GetXmlUtils() override;
//////////////////////////////////////////////////////////////////////////
void IgnoreUpdates(bool bIgnore) { m_bIgnoreUpdates = bIgnore; };
void IgnoreUpdates(bool bIgnore) override { m_bIgnoreUpdates = bIgnore; };
void SetIProcess(IProcess* process);
IProcess* GetIProcess(){ return m_pProcess; }
void SetIProcess(IProcess* process) override;
IProcess* GetIProcess() override{ return m_pProcess; }
bool IsTestMode() const { return m_bTestMode; }
bool IsTestMode() const override { return m_bTestMode; }
//@}
void SleepIfNeeded();
virtual void FatalError(const char* format, ...) PRINTF_PARAMS(2, 3);
virtual void ReportBug(const char* format, ...) PRINTF_PARAMS(2, 3);
void FatalError(const char* format, ...) override PRINTF_PARAMS(2, 3);
void ReportBug(const char* format, ...) override PRINTF_PARAMS(2, 3);
// Validator Warning.
void WarningV(EValidatorModule module, EValidatorSeverity severity, int flags, const char* file, const char* format, va_list args);
void Warning(EValidatorModule module, EValidatorSeverity severity, int flags, const char* file, const char* format, ...);
virtual int ShowMessage(const char* text, const char* caption, unsigned int uType);
bool CheckLogVerbosity(int verbosity);
void WarningV(EValidatorModule module, EValidatorSeverity severity, int flags, const char* file, const char* format, va_list args) override;
void Warning(EValidatorModule module, EValidatorSeverity severity, int flags, const char* file, const char* format, ...) override;
int ShowMessage(const char* text, const char* caption, unsigned int uType) override;
bool CheckLogVerbosity(int verbosity) override;
//! Return pointer to user defined callback.
ISystemUserCallback* GetUserCallback() const { return m_pUserCallback; };
//////////////////////////////////////////////////////////////////////////
virtual void SaveConfiguration();
virtual void LoadConfiguration(const char* sFilename, ILoadConfigurationEntrySink* pSink = 0, bool warnIfMissing = true);
virtual ESystemConfigSpec GetMaxConfigSpec() const;
virtual ESystemConfigPlatform GetConfigPlatform() const;
virtual void SetConfigPlatform(ESystemConfigPlatform platform);
void SaveConfiguration() override;
void LoadConfiguration(const char* sFilename, ILoadConfigurationEntrySink* pSink = nullptr, bool warnIfMissing = true) override;
ESystemConfigSpec GetMaxConfigSpec() const override;
ESystemConfigPlatform GetConfigPlatform() const override;
void SetConfigPlatform(ESystemConfigPlatform platform) override;
//////////////////////////////////////////////////////////////////////////
virtual bool IsPaused() const { return m_bPaused; };
bool IsPaused() const override { return m_bPaused; };
virtual ILocalizationManager* GetLocalizationManager();
virtual void debug_GetCallStack(const char** pFunctions, int& nCount);
virtual void debug_LogCallStack(int nMaxFuncs = 32, int nFlags = 0);
ILocalizationManager* GetLocalizationManager() override;
void debug_GetCallStack(const char** pFunctions, int& nCount) override;
void debug_LogCallStack(int nMaxFuncs = 32, int nFlags = 0) override;
// Get the current callstack in raw address form (more lightweight than the above functions)
// static as memReplay needs it before CSystem has been setup - expose a ISystem interface to this function if you need it outside CrySystem
static void debug_GetCallStackRaw(void** callstack, uint32& callstackLength);
@@ -329,13 +329,13 @@ public:
#if defined(WIN32)
friend LRESULT WINAPI WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
#endif
virtual void* GetRootWindowMessageHandler();
virtual void RegisterWindowMessageHandler(IWindowMessageHandler* pHandler);
virtual void UnregisterWindowMessageHandler(IWindowMessageHandler* pHandler);
void* GetRootWindowMessageHandler() override;
void RegisterWindowMessageHandler(IWindowMessageHandler* pHandler) override;
void UnregisterWindowMessageHandler(IWindowMessageHandler* pHandler) override;
// IWindowMessageHandler
#if defined(WIN32)
virtual bool HandleMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* pResult);
bool HandleMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* pResult) override;
#endif
// ~IWindowMessageHandler
@@ -378,7 +378,7 @@ private:
bool ReLaunchMediaCenter();
void UpdateAudioSystems();
void AddCVarGroupDirectory(const AZStd::string& sPath);
void AddCVarGroupDirectory(const AZStd::string& sPath) override;
AZStd::unique_ptr<AZ::DynamicModuleHandle> LoadDynamiclibrary(const char* dllName) const;
@@ -394,13 +394,13 @@ public:
// interface ISystem -------------------------------------------
virtual IDataProbe* GetIDataProbe() { return m_pDataProbe; };
virtual void SetForceNonDevMode(bool bValue);
virtual bool GetForceNonDevMode() const;
virtual bool WasInDevMode() const { return m_bWasInDevMode; };
virtual bool IsDevMode() const { return m_bInDevMode && !GetForceNonDevMode(); }
void SetForceNonDevMode(bool bValue) override;
bool GetForceNonDevMode() const override;
bool WasInDevMode() const override { return m_bWasInDevMode; };
bool IsDevMode() const override { return m_bInDevMode && !GetForceNonDevMode(); }
virtual void SetConsoleDrawEnabled(bool enabled) { m_bDrawConsole = enabled; }
virtual void SetUIDrawEnabled(bool enabled) { m_bDrawUI = enabled; }
void SetConsoleDrawEnabled(bool enabled) override { m_bDrawConsole = enabled; }
void SetUIDrawEnabled(bool enabled) override { m_bDrawUI = enabled; }
// -------------------------------------------------------------
@@ -408,10 +408,10 @@ public:
//! recreates the variable if necessary
ICVar* attachVariable (const char* szVarName, int* pContainer, const char* szComment, int dwFlags = 0);
const CTimeValue& GetLastTickTime(void) const { return m_lastTickTime; }
const ICVar* GetDedicatedMaxRate(void) const { return m_svDedicatedMaxRate; }
const CTimeValue& GetLastTickTime() const { return m_lastTickTime; }
const ICVar* GetDedicatedMaxRate() const { return m_svDedicatedMaxRate; }
std::shared_ptr<AZ::IO::FileIOBase> CreateLocalFileIO();
std::shared_ptr<AZ::IO::FileIOBase> CreateLocalFileIO() override;
private: // ------------------------------------------------------
@@ -584,9 +584,9 @@ public:
//////////////////////////////////////////////////////////////////////////
// File version.
//////////////////////////////////////////////////////////////////////////
virtual const SFileVersion& GetFileVersion();
virtual const SFileVersion& GetProductVersion();
virtual const SFileVersion& GetBuildVersion();
const SFileVersion& GetFileVersion() override;
const SFileVersion& GetProductVersion() override;
const SFileVersion& GetBuildVersion() override;
bool InitVTuneProfiler();
@@ -601,16 +601,16 @@ public:
//////////////////////////////////////////////////////////////////////////
// CryAssert and error related.
virtual bool RegisterErrorObserver(IErrorObserver* errorObserver);
bool UnregisterErrorObserver(IErrorObserver* errorObserver);
virtual void OnAssert(const char* condition, const char* message, const char* fileName, unsigned int fileLineNumber);
bool RegisterErrorObserver(IErrorObserver* errorObserver) override;
bool UnregisterErrorObserver(IErrorObserver* errorObserver) override;
void OnAssert(const char* condition, const char* message, const char* fileName, unsigned int fileLineNumber) override;
void OnFatalError(const char* message);
bool IsAssertDialogVisible() const;
void SetAssertVisible(bool bAssertVisble);
bool IsAssertDialogVisible() const override;
void SetAssertVisible(bool bAssertVisble) override;
//////////////////////////////////////////////////////////////////////////
virtual void ClearErrorMessages()
void ClearErrorMessages() override
{
m_ErrorMessages.clear();
}
@@ -620,11 +620,11 @@ public:
return m_eRuntimeState == ESYSTEM_EVENT_LEVEL_LOAD_START_LOADINGSCREEN;
}
virtual ESystemGlobalState GetSystemGlobalState(void);
virtual void SetSystemGlobalState(ESystemGlobalState systemGlobalState);
ESystemGlobalState GetSystemGlobalState() override;
void SetSystemGlobalState(ESystemGlobalState systemGlobalState) override;
#if !defined(_RELEASE)
virtual bool IsSavingResourceList() const { return (g_cvars.archiveVars.nSaveLevelResourceList != 0); }
bool IsSavingResourceList() const override { return (g_cvars.archiveVars.nSaveLevelResourceList != 0); }
#endif
private:
@@ -651,7 +651,7 @@ protected: // -------------------------------------------------------------
float m_Color[4];
bool m_HardFailure;
};
typedef std::list<SErrorMessage> TErrorMessages;
using TErrorMessages = std::list<SErrorMessage>;
TErrorMessages m_ErrorMessages;
bool m_bHasRenderedErrorMessage;
+27 -27
View File
@@ -21,7 +21,7 @@ public:
// constructor
CTimer();
// destructor
~CTimer() {};
~CTimer() = default;
bool Init();
@@ -30,57 +30,57 @@ public:
// TODO: Review m_time usage in System.cpp
// if it wants Game Time / UI Time or a new Render Time?
virtual void ResetTimer();
virtual void UpdateOnFrameStart();
virtual float GetCurrTime(ETimer which = ETIMER_GAME) const;
virtual CTimeValue GetAsyncTime() const;
virtual float GetAsyncCurTime(); // retrieve the actual wall clock time passed since the game started, in seconds
virtual float GetFrameTime(ETimer which = ETIMER_GAME) const;
virtual float GetRealFrameTime() const;
virtual float GetTimeScale() const;
virtual float GetTimeScale(uint32 channel) const;
virtual void SetTimeScale(float scale, uint32 channel = 0);
virtual void ClearTimeScales();
virtual void EnableTimer(bool bEnable);
virtual float GetFrameRate();
virtual float GetProfileFrameBlending(float* pfBlendTime = 0, int* piBlendMode = 0);
virtual void Serialize(TSerialize ser);
virtual bool IsTimerEnabled() const;
void ResetTimer() override;
void UpdateOnFrameStart() override;
float GetCurrTime(ETimer which = ETIMER_GAME) const override;
CTimeValue GetAsyncTime() const override;
float GetAsyncCurTime() override; // retrieve the actual wall clock time passed since the game started, in seconds
float GetFrameTime(ETimer which = ETIMER_GAME) const override;
float GetRealFrameTime() const override;
float GetTimeScale() const override;
float GetTimeScale(uint32 channel) const override;
void SetTimeScale(float scale, uint32 channel = 0) override;
void ClearTimeScales() override;
void EnableTimer(bool bEnable) override;
float GetFrameRate() override;
float GetProfileFrameBlending(float* pfBlendTime = nullptr, int* piBlendMode = nullptr) override;
void Serialize(TSerialize ser) override;
bool IsTimerEnabled() const override;
//! try to pause/unpause a timer
// returns true if successfully paused/unpaused, false otherwise
virtual bool PauseTimer(ETimer which, bool bPause);
bool PauseTimer(ETimer which, bool bPause) override;
//! determine if a timer is paused
// returns true if paused, false otherwise
virtual bool IsTimerPaused(ETimer which);
bool IsTimerPaused(ETimer which) override;
//! try to set a timer
// return true if successful, false otherwise
virtual bool SetTimer(ETimer which, float timeInSeconds);
bool SetTimer(ETimer which, float timeInSeconds) override;
//! make a tm struct from a time_t in UTC (like gmtime)
virtual void SecondsToDateUTC(time_t time, struct tm& outDateUTC);
void SecondsToDateUTC(time_t time, struct tm& outDateUTC) override;
//! make a UTC time from a tm (like timegm, but not available on all platforms)
virtual time_t DateToSecondsUTC(struct tm& timePtr);
time_t DateToSecondsUTC(struct tm& timePtr) override;
//! Convert from Tics to Seconds
virtual float TicksToSeconds(int64 ticks)
float TicksToSeconds(int64 ticks) override
{
return float((double)ticks * m_fSecsPerTick);
}
//! Get number of ticks per second
virtual int64 GetTicksPerSecond()
int64 GetTicksPerSecond() override
{
return m_lTicksPerSec;
}
virtual const CTimeValue& GetFrameStartTime(ETimer which = ETIMER_GAME) const { return m_CurrTime[(int)which]; }
virtual ITimer* CreateNewTimer();
const CTimeValue& GetFrameStartTime(ETimer which = ETIMER_GAME) const override { return m_CurrTime[(int)which]; }
ITimer* CreateNewTimer() override;
virtual void EnableFixedTimeMode(bool enable, float timeStep) override;
void EnableFixedTimeMode(bool enable, float timeStep) override;
private: // ---------------------------------------------------------------------
+17 -17
View File
@@ -26,7 +26,7 @@ class CView
public:
CView(ISystem* pSystem);
virtual ~CView();
~CView() override;
//shaking
struct SShake
@@ -85,24 +85,24 @@ public:
// IView
virtual void Release();
virtual void Update(float frameTime, bool isActive);
void Release() override;
void Update(float frameTime, bool isActive) override;
virtual void ProcessShaking(float frameTime);
virtual void ProcessShake(SShake* pShake, float frameTime);
virtual void ResetShaking();
virtual void ResetBlending() { m_viewParams.ResetBlending(); }
virtual void LinkTo(AZ::Entity* follow);
virtual void Unlink();
virtual AZ::EntityId GetLinkedId() {return m_linkedTo; };
virtual void SetCurrentParams(SViewParams& params) { m_viewParams = params; };
virtual const SViewParams* GetCurrentParams() {return &m_viewParams; }
virtual void SetViewShake(Ang3 shakeAngle, Vec3 shakeShift, float duration, float frequency, float randomness, int shakeID, bool bFlipVec = true, bool bUpdateOnly = false, bool bGroundOnly = false);
virtual void SetViewShakeEx(const SShakeParams& params);
virtual void StopShake(int shakeID);
virtual void SetFrameAdditiveCameraAngles(const Ang3& addFrameAngles);
virtual void SetScale(const float scale);
virtual void SetZoomedScale(const float scale);
virtual void SetActive(const bool bActive);
void ResetShaking() override;
void ResetBlending() override { m_viewParams.ResetBlending(); }
void LinkTo(AZ::Entity* follow) override;
void Unlink() override;
AZ::EntityId GetLinkedId() override {return m_linkedTo; };
void SetCurrentParams(SViewParams& params) override { m_viewParams = params; };
const SViewParams* GetCurrentParams() override {return &m_viewParams; }
void SetViewShake(Ang3 shakeAngle, Vec3 shakeShift, float duration, float frequency, float randomness, int shakeID, bool bFlipVec = true, bool bUpdateOnly = false, bool bGroundOnly = false) override;
void SetViewShakeEx(const SShakeParams& params) override;
void StopShake(int shakeID) override;
void SetFrameAdditiveCameraAngles(const Ang3& addFrameAngles) override;
void SetScale(const float scale) override;
void SetZoomedScale(const float scale) override;
void SetActive(const bool bActive) override;
// ~IView
void PostSerialize() override;
+34 -34
View File
@@ -29,60 +29,60 @@ class CViewSystem
{
private:
typedef std::map<unsigned int, IView*> TViewMap;
typedef std::vector<unsigned int> TViewIdVector;
using TViewMap = std::map<unsigned int, IView*>;
using TViewIdVector = std::vector<unsigned int>;
public:
//IViewSystem
virtual IView* CreateView();
virtual unsigned int AddView(IView* pView) override;
virtual void RemoveView(IView* pView);
virtual void RemoveView(unsigned int viewId);
IView* CreateView() override;
unsigned int AddView(IView* pView) override;
void RemoveView(IView* pView) override;
void RemoveView(unsigned int viewId) override;
virtual void SetActiveView(IView* pView);
virtual void SetActiveView(unsigned int viewId);
void SetActiveView(IView* pView) override;
void SetActiveView(unsigned int viewId) override;
//CameraSystemRequestBus
AZ::EntityId GetActiveCamera() override { return m_activeViewId ? GetActiveView()->GetLinkedId() : AZ::EntityId(); }
//utility functions
virtual IView* GetView(unsigned int viewId);
virtual IView* GetActiveView();
IView* GetView(unsigned int viewId) override;
IView* GetActiveView() override;
virtual unsigned int GetViewId(IView* pView);
virtual unsigned int GetActiveViewId();
unsigned int GetViewId(IView* pView) override;
unsigned int GetActiveViewId() override;
virtual void PostSerialize();
void PostSerialize() override;
virtual IView* GetViewByEntityId(const AZ::EntityId& id, bool forceCreate);
IView* GetViewByEntityId(const AZ::EntityId& id, bool forceCreate) override;
virtual float GetDefaultZNear() { return m_fDefaultCameraNearZ; };
virtual void SetBlendParams(float fBlendPosSpeed, float fBlendRotSpeed, bool performBlendOut) { m_fBlendInPosSpeed = fBlendPosSpeed; m_fBlendInRotSpeed = fBlendRotSpeed; m_bPerformBlendOut = performBlendOut; };
virtual void SetOverrideCameraRotation(bool bOverride, Quat rotation);
virtual bool IsPlayingCutScene() const
float GetDefaultZNear() override { return m_fDefaultCameraNearZ; };
void SetBlendParams(float fBlendPosSpeed, float fBlendRotSpeed, bool performBlendOut) override { m_fBlendInPosSpeed = fBlendPosSpeed; m_fBlendInRotSpeed = fBlendRotSpeed; m_bPerformBlendOut = performBlendOut; };
void SetOverrideCameraRotation(bool bOverride, Quat rotation) override;
bool IsPlayingCutScene() const override
{
return m_cutsceneCount > 0;
}
virtual void SetDeferredViewSystemUpdate(bool const bDeferred){ m_useDeferredViewSystemUpdate = bDeferred; }
virtual bool UseDeferredViewSystemUpdate() const { return m_useDeferredViewSystemUpdate; }
virtual void SetControlAudioListeners(bool const bActive);
void SetDeferredViewSystemUpdate(bool const bDeferred) override{ m_useDeferredViewSystemUpdate = bDeferred; }
bool UseDeferredViewSystemUpdate() const override { return m_useDeferredViewSystemUpdate; }
void SetControlAudioListeners(bool const bActive) override;
//~IViewSystem
//IMovieUser
virtual void SetActiveCamera(const SCameraParams& Params);
virtual void BeginCutScene(IAnimSequence* pSeq, unsigned long dwFlags, bool bResetFX);
virtual void EndCutScene(IAnimSequence* pSeq, unsigned long dwFlags);
virtual void SendGlobalEvent(const char* pszEvent);
void SetActiveCamera(const SCameraParams& Params) override;
void BeginCutScene(IAnimSequence* pSeq, unsigned long dwFlags, bool bResetFX) override;
void EndCutScene(IAnimSequence* pSeq, unsigned long dwFlags) override;
void SendGlobalEvent(const char* pszEvent) override;
//~IMovieUser
// ILevelSystemListener
virtual void OnLevelNotFound([[maybe_unused]] const char* levelName) {};
virtual void OnLoadingStart([[maybe_unused]] const char* levelName);
virtual void OnLoadingComplete([[maybe_unused]] const char* levelName){};
virtual void OnLoadingError([[maybe_unused]] const char* levelName, [[maybe_unused]] const char* error){};
virtual void OnLoadingProgress([[maybe_unused]] const char* levelName, [[maybe_unused]] int progressAmount){};
virtual void OnUnloadComplete([[maybe_unused]] const char* levelName);
void OnLevelNotFound([[maybe_unused]] const char* levelName) override {};
void OnLoadingStart([[maybe_unused]] const char* levelName) override;
void OnLoadingComplete([[maybe_unused]] const char* levelName) override{};
void OnLoadingError([[maybe_unused]] const char* levelName, [[maybe_unused]] const char* error) override{};
void OnLoadingProgress([[maybe_unused]] const char* levelName, [[maybe_unused]] int progressAmount) override{};
void OnUnloadComplete([[maybe_unused]] const char* levelName) override;
//~ILevelSystemListener
CViewSystem(ISystem* pSystem);
@@ -91,16 +91,16 @@ public:
void Release() override { delete this; };
void Update(float frameTime) override;
virtual void ForceUpdate(float elapsed) { Update(elapsed); }
void ForceUpdate(float elapsed) override { Update(elapsed); }
//void RegisterViewClass(const char *name, IView *(*func)());
bool AddListener(IViewSystemListener* pListener)
bool AddListener(IViewSystemListener* pListener) override
{
return stl::push_back_unique(m_listeners, pListener);
}
bool RemoveListener(IViewSystemListener* pListener)
bool RemoveListener(IViewSystemListener* pListener) override
{
return stl::find_and_erase(m_listeners, pListener);
}
+13 -13
View File
@@ -52,7 +52,7 @@ struct CConsoleCommand
//////////////////////////////////////////////////////////////////////////
CConsoleCommand()
: m_func(0)
: m_func(nullptr)
, m_nFlags(0) {}
size_t sizeofThis () const {return sizeof(*this) + m_sName.capacity() + 1 + m_sCommand.capacity() + 1; }
};
@@ -66,18 +66,18 @@ struct CConsoleCommandArgs
CConsoleCommandArgs(AZStd::string& line, std::vector<AZStd::string>& args)
: m_line(line)
, m_args(args) {};
virtual int GetArgCount() const { return static_cast<int>(m_args.size()); };
int GetArgCount() const override { return static_cast<int>(m_args.size()); };
// Get argument by index, nIndex must be in 0 <= nIndex < GetArgCount()
virtual const char* GetArg(int nIndex) const
const char* GetArg(int nIndex) const override
{
assert(nIndex >= 0 && nIndex < GetArgCount());
if (!(nIndex >= 0 && nIndex < GetArgCount()))
{
return NULL;
return nullptr;
}
return m_args[nIndex].c_str();
}
virtual const char* GetCommandLine() const
const char* GetCommandLine() const override
{
return m_line.c_str();
}
@@ -114,9 +114,9 @@ class CXConsole
, public AzFramework::CommandRegistrationBus::Handler
{
public:
typedef std::deque<AZStd::string> ConsoleBuffer;
typedef ConsoleBuffer::iterator ConsoleBufferItor;
typedef ConsoleBuffer::reverse_iterator ConsoleBufferRItor;
using ConsoleBuffer = std::deque<AZStd::string>;
using ConsoleBufferItor = ConsoleBuffer::iterator;
using ConsoleBufferRItor = ConsoleBuffer::reverse_iterator;
// constructor
CXConsole();
@@ -216,12 +216,12 @@ public:
//////////////////////////////////////////////////////////////////////////
void SetProcessingGroup(bool isGroup) { m_bIsProcessingGroup = isGroup; }
bool GetIsProcessingGroup(void) const { return m_bIsProcessingGroup; }
bool GetIsProcessingGroup() const { return m_bIsProcessingGroup; }
protected: // ----------------------------------------------------------------------------------------
void DrawBuffer(int nScrollPos, const char* szEffect);
void RegisterVar(ICVar* pCVar, ConsoleVarFunc pChangeFunc = 0);
void RegisterVar(ICVar* pCVar, ConsoleVarFunc pChangeFunc = nullptr);
bool ProcessInput(const AzFramework::InputChannel& inputChannel);
void AddLine(const char* inputStr);
@@ -272,7 +272,7 @@ private: // ----------------------------------------------------------
typedef std::map<const char*, ICVar*, string_nocase_lt> ConsoleVariablesMap; // key points into string stored in ICVar or in .exe/.dll
typedef ConsoleVariablesMap::iterator ConsoleVariablesMapItor;
typedef std::vector<std::pair<const char*, ICVar*> > ConsoleVariablesVector;
using ConsoleVariablesVector = std::vector<std::pair<const char*, ICVar*> >;
void LogChangeMessage(const char* name, const bool isConst, const bool isCheat, const bool isReadOnly, const bool isDeprecated,
const char* oldValue, const char* newValue, const bool isProcessingGroup, const bool allowChange);
@@ -308,9 +308,9 @@ private: // ----------------------------------------------------------
, silentMode(_silentMode)
{}
};
typedef std::list<SDeferredCommand> TDeferredCommandList;
using TDeferredCommandList = std::list<SDeferredCommand>;
typedef std::list<IConsoleVarSink*> ConsoleVarSinks;
using ConsoleVarSinks = std::list<IConsoleVarSink*>;
// --------------------------------------------------------------------------------
+58 -58
View File
@@ -26,19 +26,19 @@ public:
// interface ICVar --------------------------------------------------------------------------------------
virtual void ClearFlags(int flags);
virtual int GetFlags() const;
virtual int SetFlags(int flags);
virtual const char* GetName() const;
virtual const char* GetHelp();
virtual void Release();
virtual void ForceSet(const char* s);
virtual void SetOnChangeCallback(ConsoleVarFunc pChangeFunc);
virtual uint64 AddOnChangeFunctor(const AZStd::function<void()>& pChangeFunctor) override;
virtual ConsoleVarFunc GetOnChangeCallback() const;
void ClearFlags(int flags) override;
int GetFlags() const override;
int SetFlags(int flags) override;
const char* GetName() const override;
const char* GetHelp() override;
void Release() override;
void ForceSet(const char* s) override;
void SetOnChangeCallback(ConsoleVarFunc pChangeFunc) override;
uint64 AddOnChangeFunctor(const AZStd::function<void()>& pChangeFunctor) override;
ConsoleVarFunc GetOnChangeCallback() const override;
virtual bool ShouldReset() const { return (m_nFlags & VF_RESETTABLE) != 0; }
virtual void Reset() override
bool ShouldReset() const { return (m_nFlags & VF_RESETTABLE) != 0; }
void Reset() override
{
if (ShouldReset())
{
@@ -48,19 +48,19 @@ public:
virtual void ResetImpl() = 0;
virtual void SetLimits(float min, float max) override;
virtual void GetLimits(float& min, float& max) override;
virtual bool HasCustomLimits() override;
void SetLimits(float min, float max) override;
void GetLimits(float& min, float& max) override;
bool HasCustomLimits() override;
virtual int GetRealIVal() const { return GetIVal(); }
virtual bool IsConstCVar() const {return (m_nFlags & VF_CONST_CVAR) != 0; }
virtual void SetDataProbeString(const char* pDataProbeString)
int GetRealIVal() const override { return GetIVal(); }
bool IsConstCVar() const override {return (m_nFlags & VF_CONST_CVAR) != 0; }
void SetDataProbeString(const char* pDataProbeString) override
{
CRY_ASSERT(m_pDataProbeString == NULL);
m_pDataProbeString = new char[ strlen(pDataProbeString) + 1 ];
azstrcpy(m_pDataProbeString, strlen(pDataProbeString) + 1, pDataProbeString);
}
virtual const char* GetDataProbeString() const;
const char* GetDataProbeString() const override;
protected: // ------------------------------------------------------------------------------------------
@@ -77,7 +77,7 @@ protected: // ------------------------------------------------------------------
char* m_pDataProbeString; // value client is required to have for data probes
int m_nFlags; // e.g. VF_CHEAT, ...
typedef std::vector<std::pair<int, AZStd::function<void ()>> > ChangeFunctorContainer;
using ChangeFunctorContainer = std::vector<std::pair<int, AZStd::function<void ()>> >;
ChangeFunctorContainer m_changeFunctors;
ConsoleVarFunc m_pChangeFunc; // Callback function that is called when this variable changes.
CXConsole* m_pConsole; // used for the callback OnBeforeVarChange()
@@ -169,19 +169,19 @@ public:
// interface ICVar --------------------------------------------------------------------------------------
virtual int GetIVal() const { return (int)m_fValue; }
virtual int64 GetI64Val() const { return (int64)m_fValue; }
virtual float GetFVal() const { return m_fValue; }
virtual const char* GetString() const;
virtual void ResetImpl() { Set(m_fDefault); }
virtual void Set(const char* s);
virtual void Set(float f);
virtual void Set(int i);
virtual int GetType() { return CVAR_FLOAT; }
int GetIVal() const override { return (int)m_fValue; }
int64 GetI64Val() const override { return (int64)m_fValue; }
float GetFVal() const override { return m_fValue; }
const char* GetString() const override;
void ResetImpl() override { Set(m_fDefault); }
void Set(const char* s) override;
void Set(float f) override;
void Set(int i) override;
int GetType() override { return CVAR_FLOAT; }
protected:
virtual const char* GetOwnDataProbeString() const
const char* GetOwnDataProbeString() const override
{
static char szReturnString[8];
@@ -212,15 +212,15 @@ public:
// interface ICVar --------------------------------------------------------------------------------------
virtual int GetIVal() const { return m_iValue; }
virtual int64 GetI64Val() const { return m_iValue; }
virtual float GetFVal() const { return (float)m_iValue; }
virtual const char* GetString() const;
virtual void ResetImpl() { Set(m_iDefault); }
virtual void Set(const char* s);
virtual void Set(float f);
virtual void Set(int i);
virtual int GetType() { return CVAR_INT; }
int GetIVal() const override { return m_iValue; }
int64 GetI64Val() const override { return m_iValue; }
float GetFVal() const override { return (float)m_iValue; }
const char* GetString() const override;
void ResetImpl() override { Set(m_iDefault); }
void Set(const char* s) override;
void Set(float f) override;
void Set(int i) override;
int GetType() override { return CVAR_INT; }
private: // --------------------------------------------------------------------------------------------
@@ -246,26 +246,26 @@ public:
// interface ICVar --------------------------------------------------------------------------------------
virtual int GetIVal() const { return atoi(m_sValue.c_str()); }
virtual int64 GetI64Val() const { return _atoi64(m_sValue.c_str()); }
virtual float GetFVal() const { return (float)atof(m_sValue.c_str()); }
virtual const char* GetString() const
int GetIVal() const override { return atoi(m_sValue.c_str()); }
int64 GetI64Val() const override { return _atoi64(m_sValue.c_str()); }
float GetFVal() const override { return (float)atof(m_sValue.c_str()); }
const char* GetString() const override
{
return m_sValue.c_str();
}
virtual void ResetImpl() { Set(m_sDefault.c_str()); }
virtual void Set(const char* s);
virtual void Set(float f)
void ResetImpl() override { Set(m_sDefault.c_str()); }
void Set(const char* s) override;
void Set(float f) override
{
stack_string s = stack_string::format("%g", f);
Set(s.c_str());
}
virtual void Set(int i)
void Set(int i) override
{
stack_string s = stack_string::format("%d", i);
Set(s.c_str());
}
virtual int GetType() { return CVAR_STRING; }
int GetType() override { return CVAR_STRING; }
private: // --------------------------------------------------------------------------------------------
@@ -290,19 +290,19 @@ public:
// interface ICVar --------------------------------------------------------------------------------------
virtual int GetIVal() const { return (int)m_fValue; }
virtual int64 GetI64Val() const { return (int64)m_fValue; }
virtual float GetFVal() const { return m_fValue; }
virtual const char* GetString() const;
virtual void ResetImpl() { Set(m_fDefault); }
virtual void Set(const char* s);
virtual void Set(float f);
virtual void Set(int i);
virtual int GetType() { return CVAR_FLOAT; }
int GetIVal() const override { return (int)m_fValue; }
int64 GetI64Val() const override { return (int64)m_fValue; }
float GetFVal() const override { return m_fValue; }
const char* GetString() const override;
void ResetImpl() override { Set(m_fDefault); }
void Set(const char* s) override;
void Set(float f) override;
void Set(int i) override;
int GetType() override { return CVAR_FLOAT; }
protected:
virtual const char *GetOwnDataProbeString() const
const char *GetOwnDataProbeString() const override
{
static char szReturnString[8];
+64 -63
View File
@@ -63,17 +63,17 @@ public:
//void* operator new( size_t nSize );
//void operator delete( void *ptr );
virtual void DeleteThis() { }
void DeleteThis() override { }
//! Create new XML node.
XmlNodeRef createNode(const char* tag);
XmlNodeRef createNode(const char* tag) override;
// Summary:
// Reference counting.
virtual void AddRef() { ++m_pData->nRefCount; };
void AddRef() override { ++m_pData->nRefCount; };
// Notes:
// When ref count reach zero XML node dies.
virtual void Release()
void Release() override
{
if (--m_pData->nRefCount <= 0)
{
@@ -82,104 +82,105 @@ public:
};
//! Get XML node tag.
const char* getTag() const { return _string(_node()->nTagStringOffset); };
void setTag([[maybe_unused]] const char* tag) { assert(0); };
const char* getTag() const override { return _string(_node()->nTagStringOffset); };
void setTag([[maybe_unused]] const char* tag) override { assert(0); };
//! Return true if given tag is equal to node tag.
bool isTag(const char* tag) const;
bool isTag(const char* tag) const override;
//! Get XML Node attributes.
virtual int getNumAttributes() const { return (int)_node()->nAttributeCount; };
int getNumAttributes() const override { return (int)_node()->nAttributeCount; };
//! Return attribute key and value by attribute index.
virtual bool getAttributeByIndex(int index, const char** key, const char** value);
bool getAttributeByIndex(int index, const char** key, const char** value) override;
//! Return attribute key and value by attribute index, string version.
virtual bool getAttributeByIndex(int index, XmlString& key, XmlString& value);
virtual void shareChildren([[maybe_unused]] const XmlNodeRef& fromNode) { assert(0); };
virtual void copyAttributes(XmlNodeRef fromNode) { assert(0); };
void shareChildren([[maybe_unused]] const XmlNodeRef& fromNode) override { assert(0); };
void copyAttributes(XmlNodeRef fromNode) override { assert(0); };
//! Get XML Node attribute for specified key.
const char* getAttr(const char* key) const;
const char* getAttr(const char* key) const override;
//! Get XML Node attribute for specified key.
// Returns true if the attribute exists, false otherwise.
bool getAttr(const char* key, const char** value) const;
bool getAttr(const char* key, const char** value) const override;
//! Check if attributes with specified key exist.
bool haveAttr(const char* key) const;
bool haveAttr(const char* key) const override;
XmlNodeRef newChild([[maybe_unused]] const char* tagName) { assert(0); return 0; };
void replaceChild([[maybe_unused]] int inChild, [[maybe_unused]] const XmlNodeRef& node) { assert(0); };
void insertChild([[maybe_unused]] int inChild, [[maybe_unused]] const XmlNodeRef& node) { assert(0); };
void addChild([[maybe_unused]] const XmlNodeRef& node) { assert(0); };
void removeChild([[maybe_unused]] const XmlNodeRef& node) { assert(0); };
XmlNodeRef newChild([[maybe_unused]] const char* tagName) override { assert(0); return 0; };
void replaceChild([[maybe_unused]] int inChild, [[maybe_unused]] const XmlNodeRef& node) override { assert(0); };
void insertChild([[maybe_unused]] int inChild, [[maybe_unused]] const XmlNodeRef& node) override { assert(0); };
void addChild([[maybe_unused]] const XmlNodeRef& node) override { assert(0); };
void removeChild([[maybe_unused]] const XmlNodeRef& node) override { assert(0); };
//! Remove all child nodes.
void removeAllChilds() { assert(0); };
void removeAllChilds() override { assert(0); };
//! Get number of child XML nodes.
int getChildCount() const { return (int)_node()->nChildCount; };
int getChildCount() const override { return (int)_node()->nChildCount; };
//! Get XML Node child nodes.
XmlNodeRef getChild(int i) const;
XmlNodeRef getChild(int i) const override;
//! Find node with specified tag.
XmlNodeRef findChild(const char* tag) const;
XmlNodeRef findChild(const char* tag) const override;
void deleteChild([[maybe_unused]] const char* tag) { assert(0); };
void deleteChildAt([[maybe_unused]] int nIndex) { assert(0); };
void deleteChildAt([[maybe_unused]] int nIndex) override { assert(0); };
//! Get parent XML node.
XmlNodeRef getParent() const;
XmlNodeRef getParent() const override;
//! Returns content of this node.
const char* getContent() const { return _string(_node()->nContentStringOffset); };
void setContent([[maybe_unused]] const char* str) { assert(0); };
const char* getContent() const override { return _string(_node()->nContentStringOffset); };
void setContent([[maybe_unused]] const char* str) override { assert(0); };
XmlNodeRef clone() { assert(0); return 0; };
XmlNodeRef clone() override { assert(0); return 0; };
//! Returns line number for XML tag.
int getLine() const { return 0; };
int getLine() const override { return 0; };
//! Set line number in xml.
void setLine([[maybe_unused]] int line) { assert(0); };
void setLine([[maybe_unused]] int line) override { assert(0); };
//! Returns XML of this node and sub nodes.
virtual IXmlStringData* getXMLData([[maybe_unused]] int nReserveMem = 0) const { assert(0); return 0; };
XmlString getXML([[maybe_unused]] int level = 0) const { assert(0); return ""; };
bool saveToFile([[maybe_unused]] const char* fileName) { assert(0); return false; }; // saves in one huge chunk
bool saveToFile([[maybe_unused]] const char* fileName, [[maybe_unused]] size_t chunkSizeBytes, [[maybe_unused]] AZ::IO::HandleType fileHandle = AZ::IO::InvalidHandle) { assert(0); return false; }; // save in small memory chunks
IXmlStringData* getXMLData([[maybe_unused]] int nReserveMem = 0) const override { assert(0); return 0; };
XmlString getXML([[maybe_unused]] int level = 0) const override { assert(0); return ""; };
bool saveToFile([[maybe_unused]] const char* fileName) override { assert(0); return false; }; // saves in one huge chunk
bool saveToFile([[maybe_unused]] const char* fileName, [[maybe_unused]] size_t chunkSizeBytes, [[maybe_unused]] AZ::IO::HandleType fileHandle = AZ::IO::InvalidHandle) override { assert(0); return false; }; // save in small memory chunks
//! Set new XML Node attribute (or override attribute with same key).
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const char* value) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] int value) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] unsigned int value) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] int64 value) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] uint64 value, [[maybe_unused]] bool useHexFormat = true /* ignored */) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] float value) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] f64 value) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const Vec2& value) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const Ang3& value) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const Vec3& value) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const Vec4& value) { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const Quat& value) { assert(0); };
void delAttr([[maybe_unused]] const char* key) { assert(0); };
void removeAllAttributes() { assert(0); };
using IXmlNode::setAttr;
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const char* value) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] int value) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] unsigned int value) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] int64 value) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] uint64 value, [[maybe_unused]] bool useHexFormat = true /* ignored */) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] float value) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] f64 value) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const Vec2& value) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const Ang3& value) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const Vec3& value) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const Vec4& value) override { assert(0); };
void setAttr([[maybe_unused]] const char* key, [[maybe_unused]] const Quat& value) override { assert(0); };
void delAttr([[maybe_unused]] const char* key) override { assert(0); };
void removeAllAttributes() override { assert(0); };
//! Get attribute value of node.
bool getAttr(const char* key, int& value) const;
bool getAttr(const char* key, unsigned int& value) const;
bool getAttr(const char* key, int64& value) const;
bool getAttr(const char* key, uint64& value, bool useHexFormat = true /* ignored */) const;
bool getAttr(const char* key, float& value) const;
bool getAttr(const char* key, f64& value) const;
bool getAttr(const char* key, bool& value) const;
bool getAttr(const char* key, XmlString& value) const {const char* v(NULL); bool boHasAttribute(getAttr(key, &v)); value = v; return boHasAttribute; }
bool getAttr(const char* key, Vec2& value) const;
bool getAttr(const char* key, Ang3& value) const;
bool getAttr(const char* key, Vec3& value) const;
bool getAttr(const char* key, Vec4& value) const;
bool getAttr(const char* key, Quat& value) const;
bool getAttr(const char* key, ColorB& value) const;
bool getAttr(const char* key, int& value) const override;
bool getAttr(const char* key, unsigned int& value) const override;
bool getAttr(const char* key, int64& value) const override;
bool getAttr(const char* key, uint64& value, bool useHexFormat = true /* ignored */) const override;
bool getAttr(const char* key, float& value) const override;
bool getAttr(const char* key, f64& value) const override;
bool getAttr(const char* key, bool& value) const override;
bool getAttr(const char* key, XmlString& value) const override {const char* v(NULL); bool boHasAttribute(getAttr(key, &v)); value = v; return boHasAttribute; }
bool getAttr(const char* key, Vec2& value) const override;
bool getAttr(const char* key, Ang3& value) const override;
bool getAttr(const char* key, Vec3& value) const override;
bool getAttr(const char* key, Vec4& value) const override;
bool getAttr(const char* key, Quat& value) const override;
bool getAttr(const char* key, ColorB& value) const override;
private:
//////////////////////////////////////////////////////////////////////////
@@ -216,7 +217,7 @@ private:
}
protected:
virtual void setParent([[maybe_unused]] const XmlNodeRef& inRef) { assert(0); }
void setParent([[maybe_unused]] const XmlNodeRef& inRef) override { assert(0); }
//////////////////////////////////////////////////////////////////////////
private:
+20 -20
View File
@@ -85,10 +85,10 @@ class CXmlSerializer
public:
CXmlSerializer()
: m_nRefCount(0)
, m_pReaderImpl(NULL)
, m_pReaderSer(NULL)
, m_pWriterSer(NULL)
, m_pWriterImpl(NULL)
, m_pReaderImpl(nullptr)
, m_pReaderSer(nullptr)
, m_pWriterSer(nullptr)
, m_pWriterImpl(nullptr)
{
}
~CXmlSerializer()
@@ -104,8 +104,8 @@ public:
}
//////////////////////////////////////////////////////////////////////////
virtual void AddRef() { ++m_nRefCount; }
virtual void Release()
void AddRef() override { ++m_nRefCount; }
void Release() override
{
if (--m_nRefCount <= 0)
{
@@ -113,14 +113,14 @@ public:
}
}
virtual ISerialize* GetWriter(XmlNodeRef& node)
ISerialize* GetWriter(XmlNodeRef& node) override
{
ClearAll();
m_pWriterImpl = new CSerializeXMLWriterImpl(node);
m_pWriterSer = new CSimpleSerializeWithDefaults<CSerializeXMLWriterImpl>(*m_pWriterImpl);
return m_pWriterSer;
}
virtual ISerialize* GetReader(XmlNodeRef& node)
ISerialize* GetReader(XmlNodeRef& node) override
{
ClearAll();
m_pReaderImpl = new CSerializeXMLReaderImpl(node);
@@ -165,7 +165,7 @@ public:
return m_fileHandle != AZ::IO::InvalidHandle;
}
;
virtual void Write(const void* pData, size_t size)
void Write(const void* pData, size_t size) override
{
if (m_fileHandle != AZ::IO::InvalidHandle)
{
@@ -184,12 +184,12 @@ public:
CXmlTableReader();
~CXmlTableReader() override;
virtual void Release();
void Release() override;
virtual bool Begin(XmlNodeRef rootNode);
virtual int GetEstimatedRowCount();
virtual bool ReadRow(int& rowIndex);
virtual bool ReadCell(int& columnIndex, const char*& pContent, size_t& contentSize);
bool Begin(XmlNodeRef rootNode) override;
int GetEstimatedRowCount() override;
bool ReadRow(int& rowIndex) override;
bool ReadCell(int& columnIndex, const char*& pContent, size_t& contentSize) override;
private:
bool m_bExcel;
@@ -228,7 +228,7 @@ void CXmlTableReader::Release()
//////////////////////////////////////////////////////////////////////////
bool CXmlTableReader::Begin(XmlNodeRef rootNode)
{
m_tableNode = 0;
m_tableNode = nullptr;
if (!rootNode)
{
@@ -247,11 +247,11 @@ bool CXmlTableReader::Begin(XmlNodeRef rootNode)
m_tableNode = rootNode->findChild("Table");
}
m_rowNode = 0;
m_rowNode = nullptr;
m_rowNodeIndex = -1;
m_row = -1;
return (m_tableNode != 0);
return (m_tableNode != nullptr);
}
//////////////////////////////////////////////////////////////////////////
@@ -296,7 +296,7 @@ bool CXmlTableReader::ReadRow(int& rowIndex)
if (!m_rowNode->isTag("Row"))
{
m_rowNode = 0;
m_rowNode = nullptr;
continue;
}
@@ -309,7 +309,7 @@ bool CXmlTableReader::ReadRow(int& rowIndex)
if (index < m_row)
{
m_rowNodeIndex = rowNodeCount;
m_rowNode = 0;
m_rowNode = nullptr;
return false;
}
m_row = index;
@@ -351,7 +351,7 @@ bool CXmlTableReader::ReadRow(int& rowIndex)
//////////////////////////////////////////////////////////////////////////
bool CXmlTableReader::ReadCell(int& columnIndex, const char*& pContent, size_t& contentSize)
{
pContent = 0;
pContent = nullptr;
contentSize = 0;
if (!m_tableNode)
+1
View File
@@ -203,6 +203,7 @@ public:
bool saveToFile(const char* fileName, size_t chunkSizeBytes, AZ::IO::HandleType fileHandle = AZ::IO::InvalidHandle); // save in small memory chunks
//! Set new XML Node attribute (or override attribute with same key).
using IXmlNode::setAttr;
void setAttr(const char* key, const char* value);
void setAttr(const char* key, int value);
void setAttr(const char* key, unsigned int value);