Merge branch 'development' into cmake/AddressSanitizer

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-19 12:25:41 -07:00
429 changed files with 1447 additions and 1830 deletions
@@ -661,8 +661,8 @@ bool CComponentEntityObject::HitHelperTest(HitContext& hc)
if (IsEntityIconVisible())
{
const QPoint entityScreenPos = hc.view->WorldToView(GetWorldPos());
const float screenPosX = entityScreenPos.x();
const float screenPosY = entityScreenPos.y();
const float screenPosX = static_cast<float>(entityScreenPos.x());
const float screenPosY = static_cast<float>(entityScreenPos.y());
const float iconRange = static_cast<float>(s_kIconSize / 2);
if ((hc.point2d.x() >= screenPosX - iconRange && hc.point2d.x() <= screenPosX + iconRange)
@@ -626,7 +626,7 @@ void SandboxIntegrationManager::PopulateEditorGlobalContextMenu(QMenu* menu, con
{
view->GetDimensions(&width, &height);
}
m_contextMenuViewPoint.Set(width / 2, height / 2);
m_contextMenuViewPoint.Set(static_cast<float>(width / 2), static_cast<float>(height / 2));
}
else
{
@@ -1009,7 +1009,7 @@ void SandboxIntegrationManager::HandleObjectModeSelection(const AZ::Vector2& poi
if (m_inObjectPickMode)
{
CViewport* view = GetIEditor()->GetViewManager()->GetGameViewport();
const QPoint viewPoint(point.GetX(), point.GetY());
const QPoint viewPoint(static_cast<int>(point.GetX()), static_cast<int>(point.GetY()));
HitContext hitInfo;
hitInfo.view = view;
@@ -1451,7 +1451,7 @@ void SandboxIntegrationManager::ContextMenu_NewEntity()
// will be created at the origin.
if (view)
{
const QPoint viewPoint(m_contextMenuViewPoint.GetX(), m_contextMenuViewPoint.GetY());
const QPoint viewPoint(static_cast<int>(m_contextMenuViewPoint.GetX()), static_cast<int>(m_contextMenuViewPoint.GetY()));
worldPosition = view->GetHitLocation(viewPoint);
}
@@ -1641,7 +1641,7 @@ void SandboxIntegrationManager::InstantiateSliceFromAssetId(const AZ::Data::Asse
// will be instantiated at the origin.
if (view)
{
const QPoint viewPoint(m_contextMenuViewPoint.GetX(), m_contextMenuViewPoint.GetY());
const QPoint viewPoint(static_cast<int>(m_contextMenuViewPoint.GetX()), static_cast<int>(m_contextMenuViewPoint.GetY()));
sliceWorldTransform = AZ::Transform::CreateTranslation(LYVec3ToAZVec3(view->SnapToGrid(view->ViewToWorld(viewPoint))));
}
@@ -472,7 +472,7 @@ void AssetCatalogModel::LoadDatabase()
{
m_fileCacheCurrentIndex = 0;
Q_EMIT UpdateProgress(0);
Q_EMIT SetTotalProgress(m_fileCache.size());
Q_EMIT SetTotalProgress(static_cast<int>(m_fileCache.size()));
};
EBUS_EVENT(AZ::Data::AssetCatalogRequestBus, EnumerateAssets, startCB, enumerateCB, endCB);
@@ -262,7 +262,7 @@ QModelIndex ComponentDataModel::parent([[maybe_unused]] const QModelIndex &child
int ComponentDataModel::rowCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const
{
return m_componentList.size();
return static_cast<int>(m_componentList.size());
}
int ComponentDataModel::columnCount([[maybe_unused]] const QModelIndex &parent /*= QModelIndex()*/) const
@@ -2476,10 +2476,10 @@ void OutlinerItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem&
auto backgroundBoxRect = option.rect;
backgroundBoxRect.setX(backgroundBoxRect.x() + 0.5);
backgroundBoxRect.setY(backgroundBoxRect.y() + 2.5);
backgroundBoxRect.setWidth(backgroundBoxRect.width() - 1.0);
backgroundBoxRect.setHeight(backgroundBoxRect.height() - 1.0);
backgroundBoxRect.setX(static_cast<int>(backgroundBoxRect.x() + 0.5f));
backgroundBoxRect.setY(static_cast<int>(backgroundBoxRect.y() + 2.5f));
backgroundBoxRect.setWidth(static_cast<int>(backgroundBoxRect.width() - 1.0f));
backgroundBoxRect.setHeight(static_cast<int>(backgroundBoxRect.height() - 1.0f));
const qreal sliceBorderHeight = 0.8f;
@@ -2513,7 +2513,7 @@ void OutlinerItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem&
else
{
auto newRect = option.rect;
newRect.setHeight(newRect.height() - 1.0);
newRect.setHeight(static_cast<int>(newRect.height() - 1.0f));
path.addRect(newRect);
}
@@ -2597,7 +2597,7 @@ void OutlinerItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem&
QString htmlStripped = layerInfoString;
htmlStripped.remove(htmlMarkupRegex);
const float layerInfoPadding = 1.2f;
textWidthAvailable -= fontMetrics.horizontalAdvance(htmlStripped) * layerInfoPadding;
textWidthAvailable -= static_cast<int>(fontMetrics.horizontalAdvance(htmlStripped) * layerInfoPadding);
}
entityNameRichText = fontMetrics.elidedText(optionV4.text, Qt::TextElideMode::ElideRight, textWidthAvailable);
@@ -274,8 +274,8 @@ void OutlinerTreeView::drawBranches(QPainter* painter, const QRect& rect, const
// if the item has children offset the drawn line to compensate for drawn expander buttons
bool hasChildren = previousIndex.model()->index(0, 0, previousIndex).isValid();
int horizontalLineY = rect.top() + rectHalfHeight;
int horizontalLineLeft = rect.right() - indentation() * 1.5f;
int horizontalLineRight = hasChildren ? (lineBaseX - indentation()) : (lineBaseX - indentation() * 0.5f);
int horizontalLineLeft = static_cast<int>(rect.right() - indentation() * 1.5f);
int horizontalLineRight = hasChildren ? (lineBaseX - indentation()) : static_cast<int>(lineBaseX - indentation() * 0.5f);
painter->drawLine(horizontalLineLeft, horizontalLineY, horizontalLineRight, horizontalLineY);
}
@@ -284,7 +284,7 @@ void OutlinerTreeView::drawBranches(QPainter* painter, const QRect& rect, const
bool hasNext = previousIndex.sibling(previousIndex.row() + 1, previousIndex.column()).isValid();
if (hasNext || previousIndex == index)
{
int verticalLineX = lineBaseX - indentation() * 1.5f;
int verticalLineX = static_cast<int>(lineBaseX - indentation() * 1.5f);
int verticalLineTop = rect.top();
int verticalLineBottom = hasNext ? rect.bottom() : rect.bottom() - rectHalfHeight;
painter->drawLine(verticalLineX, verticalLineTop, verticalLineX, verticalLineBottom);
@@ -500,10 +500,10 @@ void AssetImporterWindow::SetTitle(const char* filePath)
AZStd::string extension;
if (AzFramework::StringFunc::Path::GetExtension(filePath, extension, false))
{
extension[0] = toupper(extension[0]);
extension[0] = static_cast<char>(toupper(extension[0]));
for (size_t i = 1; i < extension.size(); ++i)
{
extension[i] = tolower(extension[i]);
extension[i] = static_cast<char>(tolower(extension[i]));
}
}
else
@@ -9,8 +9,6 @@
#include "platform.h"
#pragma warning(disable: 4266) // disabled warning from afk overrides
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
#include <afxwin.h>
#include <vector>
@@ -30,13 +28,10 @@
#include "QtUtil.h"
// ugly dependencies:
#pragma warning(push)
#pragma warning(disable: 4244) // warning C4244: 'argument' : conversion from 'A' to 'B', possible loss of data
#include "Functor.h"
class CXmlArchive;
#include <IRenderer.h>
#include "Util/PathUtil.h"
#pragma warning(pop)
// ^^^
// ---------------------------------------------------------------------------