Merge remote-tracking branch 'upstream/development' into camera_and_editor_viewport_widget_improvements

Signed-off-by: Yuriy Toporovskyy <toporovskyy.y@gmail.com>
This commit is contained in:
Yuriy Toporovskyy
2021-08-06 10:32:38 -04:00
425 changed files with 2145 additions and 1758 deletions
+1 -1
View File
@@ -112,7 +112,7 @@ bool CConsoleBatchFile::ExecuteConfigFile(const char* sFilename)
CryLog("%s \"%s\" found in %s ...", szLog, PathUtil::GetFile(filenameLog.c_str()), PathUtil::GetPath(filenameLog).c_str());
}
int nLen = file.GetLength();
size_t nLen = file.GetLength();
char* sAllText = new char [nLen + 16];
file.ReadRaw(sAllText, nLen);
sAllText[nLen] = '\0';
@@ -161,7 +161,7 @@ struct SLevelNameAutoComplete
: public IConsoleArgumentAutoComplete
{
AZStd::vector<AZStd::string> levels;
virtual int GetCount() const { return levels.size(); };
virtual int GetCount() const { return static_cast<int>(levels.size()); };
virtual const char* GetValue(int nIndex) const { return levels[nIndex].c_str(); };
};
// definition and declaration must be separated for devirtualization
@@ -479,7 +479,7 @@ void CLocalizedStringsManager::ParseFirstLine(IXmlTableReader* pXmlTableReader,
if (i == ELOCALIZED_COLUMN_SOUNDMOOD)
{
const char* pSoundMoodName = pFind + strlen(sLocalizedColumnNames[i]) + 1;
int nSoundMoodNameLength = sCellContent.length() - strlen(sLocalizedColumnNames[i]) - 1;
int nSoundMoodNameLength = static_cast<int>(sCellContent.length() - strlen(sLocalizedColumnNames[i]) - 1);
if (nSoundMoodNameLength > 0)
{
SoundMoodIndex[nCellIndex] = pSoundMoodName;
@@ -490,7 +490,7 @@ void CLocalizedStringsManager::ParseFirstLine(IXmlTableReader* pXmlTableReader,
if (i == ELOCALIZED_COLUMN_EVENTPARAMETER)
{
const char* pParameterName = pFind + strlen(sLocalizedColumnNames[i]) + 1;
int nParameterNameLength = sCellContent.length() - strlen(sLocalizedColumnNames[i]) - 1;
int nParameterNameLength = static_cast<int>(sCellContent.length() - strlen(sLocalizedColumnNames[i]) - 1);
if (nParameterNameLength > 0)
{
EventParameterIndex[nCellIndex] = pParameterName;
@@ -622,7 +622,7 @@ bool CLocalizedStringsManager::InitLocalizationData(
CRY_ASSERT(m_tagFileNames.size() < 255);
uint8 curNumTags = m_tagFileNames.size();
uint8 curNumTags = static_cast<uint8>(m_tagFileNames.size());
m_tagFileNames[sType].filenames = vEntries;
m_tagFileNames[sType].id = curNumTags + 1;
@@ -757,7 +757,7 @@ bool CLocalizedStringsManager::ReleaseLocalizationDataByTag(
bool bVecEntryErased = false;
//Then remove the entries in the storage vector
const uint32 numEntries = m_pLanguage->m_vLocalizedStrings.size();
const int32 numEntries = static_cast<int32>(m_pLanguage->m_vLocalizedStrings.size());
for (int32 i = numEntries - 1; i >= 0; i--)
{
SLocalizedStringEntry* entry = m_pLanguage->m_vLocalizedStrings[i];
@@ -1405,7 +1405,7 @@ bool CLocalizedStringsManager::DoLoadExcelXmlSpreadsheet(const char* sFileName,
// SoundMood Entries
{
pEntry->SoundMoods.resize(SoundMoodValues.size());
pEntry->SoundMoods.resize(static_cast<int>(SoundMoodValues.size()));
if (SoundMoodValues.size() > 0)
{
std::map<int, float>::const_iterator itEnd = SoundMoodValues.end();
@@ -1421,7 +1421,7 @@ bool CLocalizedStringsManager::DoLoadExcelXmlSpreadsheet(const char* sFileName,
// EventParameter Entries
{
pEntry->EventParameters.resize(EventParameterValues.size());
pEntry->EventParameters.resize(static_cast<int>(EventParameterValues.size()));
if (EventParameterValues.size() > 0)
{
std::map<int, float>::const_iterator itEnd = EventParameterValues.end();
@@ -2196,7 +2196,7 @@ int CLocalizedStringsManager::GetLocalizedStringCount()
{
return 0;
}
return m_pLanguage->m_vLocalizedStrings.size();
return static_cast<int>(m_pLanguage->m_vLocalizedStrings.size());
}
//////////////////////////////////////////////////////////////////////////
@@ -2310,10 +2310,10 @@ void InternalFormatStringMessage(StringClass& outString, const StringClass& sStr
int maxArgUsed = 0;
int lastPos = 0;
int curPos = 0;
const int sourceLen = sString.length();
const int sourceLen = static_cast<int>(sString.length());
while (true)
{
int foundPos = sString.find(token, curPos);
int foundPos = static_cast<int>(sString.find(token, curPos));
if (foundPos != string::npos)
{
if (foundPos + 1 < sourceLen)
+1 -1
View File
@@ -484,7 +484,7 @@ void CLog::LogV(const ELogType type, [[maybe_unused]]int flags, const char* szFo
break;
}
int bufferlen = sizeof(szBuffer) - prefixSize;
int bufferlen = static_cast<int>(sizeof(szBuffer) - prefixSize);
if (bufferlen > 0)
{
#if defined(AZ_RESTRICTED_PLATFORM)
+2 -2
View File
@@ -216,8 +216,8 @@ public:
CryFatalError("Can't replace strings in an xml node that reuses strings");
}
int nStrLen1 = strlen(str1);
int nStrLen2 = strlen(str2);
int nStrLen1 = static_cast<int>(strlen(str1));
int nStrLen2 = static_cast<int>(strlen(str2));
// undo ptr1 add.
if (m_ptr != m_start)
+3 -3
View File
@@ -285,7 +285,7 @@ public:
pos = 1;
for (;; )
{
pos = szValue.find_first_of("\\", pos);
pos = static_cast<int>(szValue.find_first_of("\\", pos));
if (pos == string::npos)
{
@@ -300,7 +300,7 @@ public:
pos = 1;
for (;; )
{
pos = szValue.find_first_of("\"", pos);
pos = static_cast<int>(szValue.find_first_of("\"", pos));
if (pos == string::npos)
{
@@ -414,7 +414,7 @@ bool CSystemConfiguration::ParseSystemConfig()
INDENT_LOG_DURING_SCOPE();
int nLen = file.GetLength();
int nLen = static_cast<int>(file.GetLength());
if (nLen == 0)
{
CryWarning(VALIDATOR_MODULE_SYSTEM, VALIDATOR_WARNING, "Couldn't get length for Config file %s", filename.c_str());
+3 -3
View File
@@ -103,7 +103,7 @@ void CView::SetViewShakeEx(const SShakeParams& params)
return;
}
int shakes(m_shakes.size());
int shakes = static_cast<int>(m_shakes.size());
SShake* pSetShake(NULL);
for (int i = 0; i < shakes; ++i)
@@ -180,7 +180,7 @@ void CView::ProcessShaking(float frameTime)
m_viewParams.shakingRatio = 0;
m_viewParams.groundOnly = false;
int shakes(m_shakes.size());
int shakes = static_cast<int>(m_shakes.size());
for (int i = 0; i < shakes; ++i)
{
ProcessShake(&m_shakes[i], frameTime);
@@ -486,7 +486,7 @@ void CView::ProcessShakeNormal_DoShaking(SShake* pShake, float frameTime)
//------------------------------------------------------------------------
void CView::StopShake(int shakeID)
{
uint32 num = m_shakes.size();
uint32 num = static_cast<int>(m_shakes.size());
for (uint32 i = 0; i < num; ++i)
{
if (m_shakes[i].ID == shakeID && m_shakes[i].updating)
+4 -4
View File
@@ -1341,7 +1341,7 @@ bool CXConsole::ProcessInput(const AzFramework::InputChannel& inputChannel)
{
if (isCtrlModifierActive)
{
m_nScrollLine = m_dqConsoleBuffer.size() - 1;
m_nScrollLine = static_cast<int>(m_dqConsoleBuffer.size() - 1);
}
else
{
@@ -1454,7 +1454,7 @@ bool CXConsole::GetLineNo(const int indwLineNo, char* outszBuffer, const int ind
//////////////////////////////////////////////////////////////////////////
int CXConsole::GetLineCount() const
{
return m_dqConsoleBuffer.size();
return static_cast<int>(m_dqConsoleBuffer.size());
}
//////////////////////////////////////////////////////////////////////////
@@ -2675,7 +2675,7 @@ void CXConsole::RemoveOutputPrintSink(IOutputPrintSink* inpSink)
{
assert(inpSink);
int nCount = m_OutputSinks.size();
int nCount = static_cast<int>(m_OutputSinks.size());
for (int i = 0; i < nCount; i++)
{
@@ -2965,7 +2965,7 @@ bool CXConsole::IsHashCalculated()
//////////////////////////////////////////////////////////////////////////
int CXConsole::GetNumCheatVars()
{
return m_randomCheckedVariables.size();
return static_cast<int>(m_randomCheckedVariables.size());
}
//////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -70,7 +70,7 @@ struct CConsoleCommandArgs
CConsoleCommandArgs(string& line, std::vector<string>& args)
: m_line(line)
, m_args(args) {};
virtual int GetArgCount() const { return m_args.size(); };
virtual int GetArgCount() const { 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
{
+2 -1
View File
@@ -190,8 +190,9 @@ bool SaveArray(const IdTable& idTable, XmlNodeRef& definition, XmlNodeRef& data,
}
bool needIndex = false;
for (size_t i = 1; i <= numElems; i++)
for (size_t sizei = 1; sizei <= numElems; sizei++)
{
const int i = static_cast<int>(sizei);
if (!childSource->HaveElemAt(i))
{
needIndex = true;
@@ -114,26 +114,26 @@ bool XMLBinary::CXMLBinaryWriter::WriteNode(IDataWriter* pFile, XmlNodeRef node,
nTheoreticalPosition += sizeof(header);
align(nTheoreticalPosition, nAlignment);
header.nNodeTablePosition = nTheoreticalPosition;
header.nNodeTablePosition = static_cast<uint32>(nTheoreticalPosition);
header.nNodeCount = int(m_nodes.size());
nTheoreticalPosition += header.nNodeCount * sizeof(Node);
align(nTheoreticalPosition, nAlignment);
header.nChildTablePosition = nTheoreticalPosition;
header.nChildTablePosition = static_cast<uint32>(nTheoreticalPosition);
header.nChildCount = int(m_childs.size());
nTheoreticalPosition += header.nChildCount * sizeof(NodeIndex);
align(nTheoreticalPosition, nAlignment);
header.nAttributeTablePosition = nTheoreticalPosition;
header.nAttributeTablePosition = static_cast<uint32>(nTheoreticalPosition);
header.nAttributeCount = int(m_attributes.size());
nTheoreticalPosition += header.nAttributeCount * sizeof(Attribute);
align(nTheoreticalPosition, nAlignment);
header.nStringDataPosition = nTheoreticalPosition;
header.nStringDataPosition = static_cast<uint32>(nTheoreticalPosition);
header.nStringDataSize = m_nStringDataSize;
nTheoreticalPosition += header.nStringDataSize;
header.nXMLSize = nTheoreticalPosition;
header.nXMLSize = static_cast<uint32>(nTheoreticalPosition);
// Swap endianness of the data structures
if (bNeedSwapEndian)
@@ -328,7 +328,7 @@ int XMLBinary::CXMLBinaryWriter::AddString(const XmlString& sString)
// We don't have such string yet, so we should add it to the tables.
m_strings.push_back(sString);
itStringEntry = m_stringMap.insert(StringMap::value_type(sString, m_nStringDataSize)).first;
m_nStringDataSize += sString.length() + 1;
m_nStringDataSize += static_cast<uint>(sString.length() + 1);
}
// Return offset of the string in the string data buffer.
+2 -2
View File
@@ -91,7 +91,7 @@ XmlNodeRef CXmlUtils::LoadXmlFromFile(const char* sFilename, bool bReuseStrings,
XmlNodeRef CXmlUtils::LoadXmlFromBuffer(const char* buffer, size_t size, bool bReuseStrings, bool bSuppressWarnings)
{
XmlParser parser(bReuseStrings);
XmlNodeRef node = parser.ParseBuffer(buffer, size, true, bSuppressWarnings);
XmlNodeRef node = parser.ParseBuffer(buffer, static_cast<int>(size), true, bSuppressWarnings);
return node;
}
@@ -111,7 +111,7 @@ const char* CXmlUtils::HashXml(XmlNodeRef node)
static char temp[16];
static const char* hex = "0123456789abcdef";
XmlString str = node->getXML();
GetMD5(str.data(), str.length(), temp);
GetMD5(str.data(), static_cast<int>(str.length()), temp);
for (int i = 0; i < 16; i++)
{
signature[2 * i + 0] = hex[((uint8)temp[i]) >> 4];
+5 -5
View File
@@ -655,7 +655,7 @@ XmlNodeRef CXmlNode::findChild(const char* tag) const
if (m_pChilds)
{
XmlNodes& childs = *m_pChilds;
for (int i = 0, num = childs.size(); i < num; ++i)
for (int i = 0, num = static_cast<int>(childs.size()); i < num; ++i)
{
if (childs[i]->isTag(tag))
{
@@ -690,7 +690,7 @@ void CXmlNode::deleteChild(const char* tag)
if (m_pChilds)
{
XmlNodes& childs = *m_pChilds;
for (int i = 0, num = childs.size(); i < num; ++i)
for (int i = 0, num = static_cast<int>(childs.size()); i < num; ++i)
{
if (childs[i]->isTag(tag))
{
@@ -913,7 +913,7 @@ XmlNodeRef CXmlNode::clone()
node->m_pChilds = new XmlNodes;
node->m_pChilds->reserve(childs.size());
for (int i = 0, num = childs.size(); i < num; ++i)
for (int i = 0, num = static_cast<int>(childs.size()); i < num; ++i)
{
node->addChild(childs[i]->clone());
}
@@ -956,7 +956,7 @@ static void AddTabsToString(XmlString& xml, int level)
//////////////////////////////////////////////////////////////////////////
bool CXmlNode::IsValidXmlString(const char* str) const
{
int len = strlen(str);
int len = static_cast<int>(strlen(str));
{
// Prevents invalid characters not from standard ASCII set to propagate to xml.
@@ -1432,7 +1432,7 @@ protected:
void XmlParserImp::CleanStack()
{
m_nNodeStackTop = 0;
for (int i = 0, num = m_nodeStack.size(); i < num; i++)
for (int i = 0, num = static_cast<int>(m_nodeStack.size()); i < num; i++)
{
m_nodeStack[i].node = 0;
m_nodeStack[i].childs.resize(0);