More fixes for Code/Editor
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -1228,7 +1228,7 @@ bool CFileUtil::CreatePath(const QString& strPath)
|
||||
nTotalPathQueueElements = cstrDirectoryQueue.size();
|
||||
for (nCurrentPathQueue = 0; nCurrentPathQueue < nTotalPathQueueElements; ++nCurrentPathQueue)
|
||||
{
|
||||
strCurrentDirectoryPath += cstrDirectoryQueue[nCurrentPathQueue];
|
||||
strCurrentDirectoryPath += cstrDirectoryQueue[static_cast<int>(nCurrentPathQueue)];
|
||||
strCurrentDirectoryPath += "\\";
|
||||
// The value which will go out of this loop is the result of the attempt to create the
|
||||
// last directory, only.
|
||||
@@ -1368,8 +1368,8 @@ IFileUtil::ECopyTreeResult CFileUtil::CopyTree(const QString& strSourceDirectory
|
||||
return eCopyResult;
|
||||
}
|
||||
|
||||
QString sourceName = sourceDir.absoluteFilePath(cFiles[nCurrent]);
|
||||
QString targetName = targetDir.absoluteFilePath(cFiles[nCurrent]);
|
||||
QString sourceName = sourceDir.absoluteFilePath(cFiles[static_cast<int>(nCurrent)]);
|
||||
QString targetName = targetDir.absoluteFilePath(cFiles[static_cast<int>(nCurrent)]);
|
||||
|
||||
if (boConfirmOverwrite)
|
||||
{
|
||||
@@ -1387,7 +1387,7 @@ IFileUtil::ECopyTreeResult CFileUtil::CopyTree(const QString& strSourceDirectory
|
||||
const int ret = QMessageBox::question(AzToolsFramework::GetActiveWindow(),
|
||||
QObject::tr("Confirm file overwrite?"),
|
||||
QObject::tr("There is already a file named \"%1\" in the target folder. Do you want to move this file anyway replacing the old one?")
|
||||
.arg(cFiles[nCurrent]),
|
||||
.arg(cFiles[static_cast<int>(nCurrent)]),
|
||||
QMessageBox::YesToAll | QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
|
||||
switch (ret) {
|
||||
@@ -1448,8 +1448,8 @@ IFileUtil::ECopyTreeResult CFileUtil::CopyTree(const QString& strSourceDirectory
|
||||
|
||||
bool bnLastDirectoryWasCreated(false);
|
||||
|
||||
QString sourceName = sourceDir.absoluteFilePath(cDirectories[nCurrent]);
|
||||
QString targetName = targetDir.absoluteFilePath(cDirectories[nCurrent]);
|
||||
QString sourceName = sourceDir.absoluteFilePath(cDirectories[static_cast<int>(nCurrent)]);
|
||||
QString targetName = targetDir.absoluteFilePath(cDirectories[static_cast<int>(nCurrent)]);
|
||||
|
||||
bnLastDirectoryWasCreated = QDir().mkpath(targetName);
|
||||
|
||||
@@ -1473,7 +1473,7 @@ IFileUtil::ECopyTreeResult CFileUtil::CopyTree(const QString& strSourceDirectory
|
||||
const int ret = QMessageBox::question(AzToolsFramework::GetActiveWindow(),
|
||||
QObject::tr("Confirm directory overwrite?"),
|
||||
QObject::tr("There is already a folder named \"%1\" in the target folder. Do you want to move this folder anyway?")
|
||||
.arg(cDirectories[nCurrent]),
|
||||
.arg(cDirectories[static_cast<int>(nCurrent)]),
|
||||
QMessageBox::YesToAll | QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
|
||||
switch (ret) {
|
||||
@@ -1742,8 +1742,8 @@ IFileUtil::ECopyTreeResult CFileUtil::MoveTree(const QString& strSourceDirecto
|
||||
}
|
||||
|
||||
bool bnLastFileWasCopied(false);
|
||||
QString sourceName(sourceDir.absoluteFilePath(cFiles[nCurrent]));
|
||||
QString targetName(targetDir.absoluteFilePath(cFiles[nCurrent]));
|
||||
QString sourceName(sourceDir.absoluteFilePath(cFiles[static_cast<int>(nCurrent)]));
|
||||
QString targetName(targetDir.absoluteFilePath(cFiles[static_cast<int>(nCurrent)]));
|
||||
|
||||
if (boConfirmOverwrite)
|
||||
{
|
||||
@@ -1761,7 +1761,7 @@ IFileUtil::ECopyTreeResult CFileUtil::MoveTree(const QString& strSourceDirecto
|
||||
const int ret = QMessageBox::question(AzToolsFramework::GetActiveWindow(),
|
||||
QObject::tr("Confirm file overwrite?"),
|
||||
QObject::tr("There is already a file named \"%1\" in the target folder. Do you want to move this file anyway replacing the old one?")
|
||||
.arg(cFiles[nCurrent]),
|
||||
.arg(cFiles[static_cast<int>(nCurrent)]),
|
||||
QMessageBox::YesToAll | QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
|
||||
switch (ret) {
|
||||
@@ -1822,8 +1822,8 @@ IFileUtil::ECopyTreeResult CFileUtil::MoveTree(const QString& strSourceDirecto
|
||||
return eCopyResult;
|
||||
}
|
||||
|
||||
QString sourceName(sourceDir.absoluteFilePath(cDirectories[nCurrent]));
|
||||
QString targetName(targetDir.absoluteFilePath(cDirectories[nCurrent]));
|
||||
QString sourceName(sourceDir.absoluteFilePath(cDirectories[static_cast<int>(nCurrent)]));
|
||||
QString targetName(targetDir.absoluteFilePath(cDirectories[static_cast<int>(nCurrent)]));
|
||||
|
||||
bnLastDirectoryWasCreated = QDir().mkdir(targetName);
|
||||
|
||||
@@ -1847,7 +1847,7 @@ IFileUtil::ECopyTreeResult CFileUtil::MoveTree(const QString& strSourceDirecto
|
||||
const int ret = QMessageBox::question(AzToolsFramework::GetActiveWindow(),
|
||||
QObject::tr("Confirm directory overwrite?"),
|
||||
QObject::tr("There is already a folder named \"%1\" in the target folder. Do you want to move this folder anyway?")
|
||||
.arg(cDirectories[nCurrent]),
|
||||
.arg(cDirectories[static_cast<int>(nCurrent)]),
|
||||
QMessageBox::YesToAll | QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
|
||||
|
||||
switch (ret) {
|
||||
|
||||
@@ -55,9 +55,9 @@ bool CImageASC::Save(const QString& fileName, const CFloatImage& image)
|
||||
fprintf(file, fileHeader.c_str());
|
||||
|
||||
// Then print all the pixels.
|
||||
for (int y = 0; y < height; y++)
|
||||
for (uint32 y = 0; y < height; y++)
|
||||
{
|
||||
for (int x = 0; x < width; x++)
|
||||
for (uint32 x = 0; x < width; x++)
|
||||
{
|
||||
fprintf(file, "%.7f ", pixels[x + y * width]);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ bool CImageGif::Load(const QString& fileName, CImageEx& outImage)
|
||||
CLogFile::FormatLine("File not found %s", fileName.toUtf8().data());
|
||||
return false;
|
||||
}
|
||||
long filesize = file.GetLength();
|
||||
long filesize = static_cast<long>(file.GetLength());
|
||||
|
||||
data.resize(filesize);
|
||||
uint8* ptr = &data[0];
|
||||
|
||||
@@ -119,7 +119,7 @@ bool CImageTIF::Load(const QString& fileName, CImageEx& outImage)
|
||||
|
||||
std::vector<uint8> data;
|
||||
|
||||
memImage.size = file.GetLength();
|
||||
memImage.size = static_cast<uint32>(file.GetLength());
|
||||
|
||||
data.resize(memImage.size);
|
||||
memImage.buffer = &data[0];
|
||||
@@ -210,7 +210,7 @@ bool CImageTIF::Load(const QString& fileName, CFloatImage& outImage)
|
||||
|
||||
std::vector<uint8> data;
|
||||
|
||||
memImage.size = file.GetLength();
|
||||
memImage.size = static_cast<int>(file.GetLength());
|
||||
|
||||
data.resize(memImage.size);
|
||||
memImage.buffer = &data[0];
|
||||
@@ -460,7 +460,7 @@ const char* CImageTIF::GetPreset(const QString& fileName)
|
||||
|
||||
MemImage memImage;
|
||||
|
||||
memImage.size = file.GetLength();
|
||||
memImage.size = static_cast<uint32>(file.GetLength());
|
||||
|
||||
data.resize(memImage.size);
|
||||
memImage.buffer = &data[0];
|
||||
|
||||
@@ -106,9 +106,9 @@ bool CImageUtil::SavePGM(const QString& fileName, const CImageEx& image)
|
||||
fprintf(file, fileHeader.c_str());
|
||||
|
||||
// Then print all the pixels.
|
||||
for (int32 y = 0; y < height; y++)
|
||||
for (uint32 y = 0; y < height; y++)
|
||||
{
|
||||
for (int32 x = 0; x < width; x++)
|
||||
for (uint32 x = 0; x < width; x++)
|
||||
{
|
||||
fprintf(file, "%d ", pixels[x + (y * width)]);
|
||||
}
|
||||
@@ -478,7 +478,7 @@ unsigned char CImageUtil::GetBilinearFilteredAt(const int iniX256, const int ini
|
||||
DWORD x = (DWORD)(iniX256) >> 8;
|
||||
DWORD y = (DWORD)(iniY256) >> 8;
|
||||
|
||||
if (x >= image.GetWidth() - 1 || y >= image.GetHeight() - 1)
|
||||
if (x >= static_cast<DWORD>(image.GetWidth() - 1) || y >= static_cast<DWORD>(image.GetHeight() - 1))
|
||||
{
|
||||
return image.ValueAt(x, y); // border is not filtered, 255 to get in range 0..1
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ bool SearchForBestSplitPos(CKDTree::ESplitAxis axis, const std::vector<CKDTree::
|
||||
|
||||
outBestSplitPos = 0;
|
||||
|
||||
int nSizeOfIndices(indices.size());
|
||||
int nSizeOfIndices = static_cast<int>(indices.size());
|
||||
|
||||
for (int i = 0; i < nSizeOfIndices; ++i)
|
||||
{
|
||||
@@ -329,7 +329,7 @@ bool CKDTree::Build(IStatObj* pStatObj)
|
||||
entireBoundBox.Reset();
|
||||
|
||||
std::vector<uint32> indices;
|
||||
for (int i = 0, iStatObjSize(m_StatObjectList.size()); i < iStatObjSize; ++i)
|
||||
for (int i = 0, iStatObjSize = static_cast<uint32>(m_StatObjectList.size()); i < iStatObjSize; ++i)
|
||||
{
|
||||
IIndexedMesh* pMesh = m_StatObjectList[i].pStatObj->GetIndexedMesh(true);
|
||||
if (pMesh == nullptr)
|
||||
|
||||
@@ -158,7 +158,7 @@ bool CNamedData::Serialize(CArchive& ar)
|
||||
{
|
||||
if (ar.IsStoring())
|
||||
{
|
||||
int iSize = m_blocks.size();
|
||||
int iSize = static_cast<int>(m_blocks.size());
|
||||
ar << iSize;
|
||||
|
||||
for (TBlocks::iterator it = m_blocks.begin(); it != m_blocks.end(); it++)
|
||||
@@ -286,7 +286,7 @@ bool CNamedData::Load(const QString& levelPath, [[maybe_unused]] CPakFile& pakFi
|
||||
CCryFile cfile;
|
||||
if (cfile.Open(Path::Make(levelPath, filename).toUtf8().data(), "rb"))
|
||||
{
|
||||
int fileSize = cfile.GetLength();
|
||||
int fileSize = static_cast<int>(cfile.GetLength());
|
||||
if (fileSize > 0)
|
||||
{
|
||||
QString key = Path::GetFileName(filename);
|
||||
@@ -307,7 +307,7 @@ bool CNamedData::Load(const QString& levelPath, [[maybe_unused]] CPakFile& pakFi
|
||||
CCryFile cfile;
|
||||
if (cfile.Open(Path::Make(levelPath, filename).toUtf8().data(), "rb"))
|
||||
{
|
||||
int fileSize = cfile.GetLength();
|
||||
int fileSize = static_cast<uint32>(cfile.GetLength());
|
||||
if (fileSize > 0)
|
||||
{
|
||||
// Read uncompressed data size.
|
||||
|
||||
@@ -511,7 +511,7 @@ CVarGlobalEnumList::CVarGlobalEnumList(const QString& enumName)
|
||||
//! Get the name of specified value in enumeration.
|
||||
QString CVarGlobalEnumList::GetItemName(uint index)
|
||||
{
|
||||
if (!m_pEnum || index >= m_pEnum->strings.size())
|
||||
if (!m_pEnum || index >= static_cast<uint>(m_pEnum->strings.size()))
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ bool CXmlArchive::SaveToPak([[maybe_unused]] const QString& levelPath, CPakFile&
|
||||
|
||||
// Save xml file.
|
||||
QString xmlFilename = "Level.editor_xml";
|
||||
pakFile.UpdateFile(xmlFilename.toUtf8().data(), (void*)pXmlStrData->GetString(), pXmlStrData->GetStringLength());
|
||||
pakFile.UpdateFile(xmlFilename.toUtf8().data(), (void*)pXmlStrData->GetString(), static_cast<int>(pXmlStrData->GetStringLength()));
|
||||
|
||||
if (pakFile.GetArchive())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user