Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
pappeste
2021-06-18 15:47:56 -07:00
committed by Esteban Papp
parent 89c99b15af
commit 3c56edb827
34 changed files with 91 additions and 91 deletions
@@ -1402,7 +1402,7 @@ void SplineWidget::mouseMoveEvent(QMouseEvent* event)
QString tipText;
bool boFoundTheSelectedKey(false);
for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex)
for (int splineIndex = 0, endSpline = static_cast<int>(m_splines.size()); splineIndex < endSpline; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
for (int i = 0; i < pSpline->GetKeyCount(); i++)
@@ -1619,7 +1619,7 @@ bool AbstractSplineWidget::IsKeySelected(ISplineInterpolator* pSpline, int nKey,
int AbstractSplineWidget::GetNumSelected()
{
int nSelected = 0;
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
if (ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline)
{
@@ -1726,7 +1726,7 @@ AbstractSplineWidget::EHitCode AbstractSplineWidget::HitTest(const QPoint& point
}
// For each Spline...
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
ISplineInterpolator* pDetailSpline = m_splines[splineIndex].pDetailSpline;
@@ -1867,7 +1867,7 @@ void AbstractSplineWidget::ScaleAmplitudeKeys(float time, float startValue, floa
m_nHitKeyIndex = -1;
m_nHitDimension = -1;
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -1971,7 +1971,7 @@ void AbstractSplineWidget::TimeScaleKeys(float time, float startTime, float endT
float affectedRangeMin = FLT_MAX;
float affectedRangeMax = -FLT_MAX;
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -2078,7 +2078,7 @@ void AbstractSplineWidget::ValueScaleKeys(float startValue, float endValue)
m_nHitKeyIndex = -1;
m_nHitDimension = -1;
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -2119,7 +2119,7 @@ void AbstractSplineWidget::MoveSelectedKeys(Vec2 offset, bool copyKeys)
float affectedRangeMin = FLT_MAX;
float affectedRangeMax = -FLT_MAX;
// For each spline...
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -2241,7 +2241,7 @@ void AbstractSplineWidget::RemoveSelectedKeys()
m_pHitDetailSpline = 0;
m_nHitKeyIndex = -1;
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -2281,7 +2281,7 @@ void AbstractSplineWidget::RemoveSelectedKeyTimesImpl()
StoreUndo();
SendNotifyEvent(SPLN_BEFORE_CHANGE);
for (int splineIndex = 0, end = m_splines.size(); splineIndex < end; ++splineIndex)
for (int splineIndex = 0, end = static_cast<int>(m_splines.size()); splineIndex < end; ++splineIndex)
{
std::vector<KeyTime>::iterator itTime = m_keyTimes.begin(), endTime = m_keyTimes.end();
for (int keyIndex = 0, endIndex = m_splines[splineIndex].pSpline->GetKeyCount(); keyIndex < endIndex; )
@@ -2319,7 +2319,7 @@ void AbstractSplineWidget::RedrawWindowAroundMarker()
{
UpdateKeyTimes();
std::vector<KeyTime>::iterator itKeyTime = std::lower_bound(m_keyTimes.begin(), m_keyTimes.end(), KeyTime(m_fTimeMarker, 0));
int keyTimeIndex = (itKeyTime != m_keyTimes.end() ? itKeyTime - m_keyTimes.begin() : m_keyTimes.size());
int keyTimeIndex = static_cast<int>(itKeyTime != m_keyTimes.end() ? itKeyTime - m_keyTimes.begin() : m_keyTimes.size());
int redrawRangeStart = (keyTimeIndex >= 2 ? aznumeric_cast<int>(TimeToXOfs(m_keyTimes[keyTimeIndex - 2].time)) : m_rcSpline.left());
int redrawRangeEnd = (keyTimeIndex < int(m_keyTimes.size()) - 2 ? aznumeric_cast<int>(TimeToXOfs(m_keyTimes[keyTimeIndex + 2].time)) : m_rcSpline.right());
@@ -2421,7 +2421,7 @@ void AbstractSplineWidget::ClearSelection()
{
ConditionalStoreUndo();
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -2465,7 +2465,7 @@ void AbstractSplineWidget::StoreUndo()
if (UiAnimUndo::IsRecording() && !m_pCurrentUndo)
{
std::vector<ISplineInterpolator*> splines(m_splines.size());
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
splines[splineIndex] = m_splines[splineIndex].pSpline;
}
@@ -2508,7 +2508,7 @@ void AbstractSplineWidget::DuplicateSelectedKeys()
typedef std::vector<CKeyCopyInfo> KeysToAddContainer;
KeysToAddContainer keysToInsert;
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -2608,7 +2608,7 @@ void AbstractSplineWidget::KeyAll()
//////////////////////////////////////////////////////////////////////////
void AbstractSplineWidget::SelectAll()
{
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -2756,7 +2756,7 @@ void AbstractSplineWidget::SelectRectangle(const QRect& rc, bool bSelect)
{
std::swap(t0, t1);
}
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
ISplineInterpolator* pDetailSpline = m_splines[splineIndex].pDetailSpline;
@@ -2972,7 +2972,7 @@ void AbstractSplineWidget::ModifySelectedKeysFlags(int nRemoveFlags, int nAddFla
SendNotifyEvent(SPLN_BEFORE_CHANGE);
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
for (int splineIndex = 0, splineCount = static_cast<int>(m_splines.size()); splineIndex < splineCount; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -3138,7 +3138,7 @@ void AbstractSplineWidget::GotoNextKey(bool previousKey)
{
bool boFoundTheSelectedKey(false);
for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex)
for (int splineIndex = 0, endSpline = static_cast<int>(m_splines.size()); splineIndex < endSpline; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
for (int i = 0; i < pSpline->GetKeyCount(); i++)
@@ -3180,7 +3180,7 @@ void AbstractSplineWidget::GotoNextKey(bool previousKey)
}
else
{
for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex)
for (int splineIndex = 0, endSpline = static_cast<int>(m_splines.size()); splineIndex < endSpline; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -3231,7 +3231,7 @@ void AbstractSplineWidget::RemoveAllKeysButThis()
{
std::vector<int> keys;
for (int splineIndex = 0, endSpline = m_splines.size(); splineIndex < endSpline; ++splineIndex)
for (int splineIndex = 0, endSpline = static_cast<int>(m_splines.size()); splineIndex < endSpline; ++splineIndex)
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
@@ -90,7 +90,7 @@ public:
void AddSpline(ISplineInterpolator * pSpline, ISplineInterpolator * pDetailSpline, COLORREF anColorArray[4]);
void RemoveSpline(ISplineInterpolator* pSpline);
void RemoveAllSplines();
int GetSplineCount() const { return m_splines.size(); }
int GetSplineCount() const { return static_cast<int>(m_splines.size()); }
ISplineInterpolator* GetSpline(int nIndex) const { return m_splines[nIndex].pSpline; }
void SetTimeMarker(float fTime);
@@ -27,7 +27,7 @@ namespace AZ
class CUiAnimViewAnimNodeBundle
{
public:
unsigned int GetCount() const { return m_animNodes.size(); }
unsigned int GetCount() const { return static_cast<unsigned int>(m_animNodes.size()); }
CUiAnimViewAnimNode* GetNode(const unsigned int index) { return m_animNodes[index]; }
const CUiAnimViewAnimNode* GetNode(const unsigned int index) const { return m_animNodes[index]; }
@@ -121,7 +121,7 @@ public:
virtual bool AreAllKeysOfSameType() const override { return m_bAllOfSameType; }
virtual unsigned int GetKeyCount() const override { return m_keys.size(); }
virtual unsigned int GetKeyCount() const override { return static_cast<unsigned int>(m_keys.size()); }
virtual CUiAnimViewKeyHandle GetKey(unsigned int index) override { return m_keys[index]; }
virtual void SelectKeys(const bool bSelected) override;
@@ -173,7 +173,7 @@ public:
CUiAnimViewNode* GetParentNode() const { return m_pParentNode; }
// Children
unsigned int GetChildCount() const { return m_childNodes.size(); }
unsigned int GetChildCount() const { return static_cast<unsigned int>(m_childNodes.size()); }
CUiAnimViewNode* GetChild(unsigned int index) const { return m_childNodes[index].get(); }
// Snap time value to prev/next key in sequence
@@ -1320,7 +1320,7 @@ void CUiAnimViewSequence::CloneSelectedKeys()
std::vector<float> selectedKeyTimes;
for (size_t k = 0; k < selectedKeys.GetKeyCount(); ++k)
{
CUiAnimViewKeyHandle skey = selectedKeys.GetKey(k);
CUiAnimViewKeyHandle skey = selectedKeys.GetKey(static_cast<unsigned int>(k));
if (pTrack != skey.GetTrack())
{
pTrack = skey.GetTrack();
@@ -1332,7 +1332,7 @@ void CUiAnimViewSequence::CloneSelectedKeys()
// Now, do the actual cloning.
for (size_t k = 0; k < selectedKeyTimes.size(); ++k)
{
CUiAnimViewKeyHandle skey = selectedKeys.GetKey(k);
CUiAnimViewKeyHandle skey = selectedKeys.GetKey(static_cast<unsigned int>(k));
skey = skey.GetTrack()->GetKeyByTime(selectedKeyTimes[k]);
assert(skey.IsValid());
@@ -36,7 +36,7 @@ public:
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event);
unsigned int GetCount() const { return m_sequences.size(); }
unsigned int GetCount() const { return static_cast<unsigned int>(m_sequences.size()); }
void CreateSequence(QString name);
void DeleteSequence(CUiAnimViewSequence* pSequence);
@@ -23,7 +23,7 @@ public:
: m_bAllOfSameType(true)
, m_bHasRotationTrack(false) {}
unsigned int GetCount() const { return m_tracks.size(); }
unsigned int GetCount() const { return static_cast<unsigned int>(m_tracks.size()); }
CUiAnimViewTrack* GetTrack(const unsigned int index) { return m_tracks[index]; }
const CUiAnimViewTrack* GetTrack(const unsigned int index) const { return m_tracks[index]; }
@@ -493,7 +493,7 @@ void CanvasSizeToolbarSection::HandleIndexChanged()
int CanvasSizeToolbarSection::GetCustomSizeIndex()
{
return m_canvasSizePresets.size() - 1;
return static_cast<int>(m_canvasSizePresets.size() - 1);
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -156,7 +156,7 @@ void HierarchyClipboard::CopySelectedItemsToClipboard(HierarchyWidget* widget,
QMimeData* mimeData = pEditor->CreateQMimeData();
{
// Concatenate all the data we need into a single QByteArray.
QByteArray data(xml.c_str(), xml.size());
QByteArray data(xml.c_str(), static_cast<int>(xml.size()));
mimeData->setData(UICANVASEDITOR_MIMETYPE, data);
}
@@ -286,8 +286,8 @@ void SpriteBorderEditor::AddConfigureSection(QGridLayout* gridLayout, int& rowNu
// Count the number of unique entries along each axis to determine number
// of rows/cols contained within the spritesheet.
m_numRows = vSet.size() > 1 ? vSet.size() - 1 : 1;
m_numCols = uSet.size() > 1 ? uSet.size() - 1 : 1;
m_numRows = static_cast<uint>(vSet.size() > 1 ? vSet.size() - 1 : 1);
m_numCols = static_cast<uint>(uSet.size() > 1 ? uSet.size() - 1 : 1);
// Text input fields displaying row/col information for auto-extracting
// spritesheet cells
@@ -62,7 +62,7 @@ void CUiAnimNode::Activate([[maybe_unused]] bool bActivate)
//////////////////////////////////////////////////////////////////////////
int CUiAnimNode::GetTrackCount() const
{
return m_tracks.size();
return static_cast<int>(m_tracks.size());
}
const char* CUiAnimNode::GetParamName(const CUiAnimParamType& paramType) const
@@ -48,7 +48,7 @@ CUiAnimSequence::CUiAnimSequence(IUiAnimationSystem* pUiAnimationSystem, uint32
CUiAnimSequence::~CUiAnimSequence()
{
// clear reference to me from all my nodes
for (int i = m_nodes.size(); --i >= 0;)
for (int i = static_cast<int>(m_nodes.size()); --i >= 0;)
{
if (m_nodes[i])
{
@@ -144,7 +144,7 @@ const IUiAnimSequence* CUiAnimSequence::GetParentSequence() const
//////////////////////////////////////////////////////////////////////////
int CUiAnimSequence::GetNodeCount() const
{
return m_nodes.size();
return static_cast<int>(m_nodes.size());
}
//////////////////////////////////////////////////////////////////////////
@@ -71,7 +71,7 @@ public:
}
//! Return number of keys in track.
virtual int GetNumKeys() const { return m_keys.size(); };
virtual int GetNumKeys() const { return static_cast<int>(m_keys.size()); };
//! Return true if keys exists in this track
virtual bool HasKeys() const { return !m_keys.empty(); }
@@ -517,7 +517,7 @@ inline int TUiAnimTrack<KeyType>::GetActiveKey(float time, KeyType* key)
return -1;
}
int nkeys = m_keys.size();
int nkeys = static_cast<int>(m_keys.size());
if (nkeys == 0)
{
m_lastTime = time;
@@ -163,7 +163,7 @@ CUiAnimAzEntityNode::~CUiAnimAzEntityNode()
//////////////////////////////////////////////////////////////////////////
unsigned int CUiAnimAzEntityNode::GetParamCount() const
{
return CUiAnimAzEntityNode::GetParamCountStatic() + m_entityScriptPropertiesParamInfos.size();
return static_cast<unsigned int>(CUiAnimAzEntityNode::GetParamCountStatic() + m_entityScriptPropertiesParamInfos.size());
}
//////////////////////////////////////////////////////////////////////////
@@ -190,7 +190,7 @@ CUiAnimParamType CUiAnimAzEntityNode::GetParamType(unsigned int nIndex) const
//////////////////////////////////////////////////////////////////////////
int CUiAnimAzEntityNode::GetParamCountStatic()
{
return s_nodeParams.size();
return static_cast<int>(s_nodeParams.size());
}
//////////////////////////////////////////////////////////////////////////
@@ -680,7 +680,7 @@ IUiAnimTrack* CUiAnimAzEntityNode::CreateTrackForAzField(const UiAnimParamData&
// this is a compound type, create a compound track
// We only support compound tracks with 2, 3 or 4 subtracks
int numElements = classData->m_elements.size();
int numElements = static_cast<int>(classData->m_elements.size());
if (numElements < 2 || numElements > 4)
{
return nullptr;
@@ -31,7 +31,7 @@ void UiBoolTrack::GetValue(float time, bool& value)
CheckValid();
int nkeys = m_keys.size();
int nkeys = static_cast<int>(m_keys.size());
if (nkeys < 1)
{
return;
@@ -296,7 +296,7 @@ IUiAnimSequence* UiAnimationSystem::GetSequence(int i) const
//////////////////////////////////////////////////////////////////////////
int UiAnimationSystem::GetNumSequences() const
{
return m_sequences.size();
return static_cast<int>(m_sequences.size());
}
//////////////////////////////////////////////////////////////////////////
@@ -315,7 +315,7 @@ IUiAnimSequence* UiAnimationSystem::GetPlayingSequence(int i) const
//////////////////////////////////////////////////////////////////////////
int UiAnimationSystem::GetNumPlayingSequences() const
{
return m_playingSequences.size();
return static_cast<int>(m_playingSequences.size());
}
//////////////////////////////////////////////////////////////////////////
@@ -327,7 +327,7 @@ void UiAnimationSystem::AddSequence(IUiAnimSequence* pSequence)
//////////////////////////////////////////////////////////////////////////
bool UiAnimationSystem::IsCutScenePlaying() const
{
const uint numPlayingSequences = m_playingSequences.size();
const uint numPlayingSequences = static_cast<uint>(m_playingSequences.size());
for (uint i = 0; i < numPlayingSequences; ++i)
{
const IUiAnimSequence* pAnimSequence = m_playingSequences[i].sequence.get();
+3 -3
View File
@@ -1128,7 +1128,7 @@ namespace LyShine
// walk the graph recursively to add up all of the data
GetDebugInfoRenderNodeList(m_renderNodes, info, uniqueTextures);
info.m_numUniqueTextures = uniqueTextures.size();
info.m_numUniqueTextures = static_cast<int>(uniqueTextures.size());
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1183,7 +1183,7 @@ namespace LyShine
const PrimitiveListRenderNode* primListRenderNode = static_cast<const PrimitiveListRenderNode*>(renderNode);
IRenderer::DynUiPrimitiveList& primitives = primListRenderNode->GetPrimitives();
info.m_numPrimitives += primitives.size();
info.m_numPrimitives += static_cast<int>(primitives.size());
{
for (const IRenderer::DynUiPrimitive& primitive : primitives)
{
@@ -1367,7 +1367,7 @@ namespace LyShine
}
IRenderer::DynUiPrimitiveList& primitives = primListRenderNode->GetPrimitives();
int numPrimitives = primitives.size();
int numPrimitives = static_cast<int>(primitives.size());
int numTriangles = 0;
for (const IRenderer::DynUiPrimitive& primitive : primitives)
{
+1 -1
View File
@@ -273,7 +273,7 @@ void CSprite::Serialize(TSerialize ser)
if (hasSpriteSheetCells && ser.BeginOptionalGroup("SpriteSheet", true))
{
const int numSpriteSheetCells = ser.IsReading() ? m_numSpriteSheetCellTags : GetSpriteSheetCells().size();
const int numSpriteSheetCells = static_cast<int>(ser.IsReading() ? m_numSpriteSheetCellTags : GetSpriteSheetCells().size());
for (int i = 0; i < numSpriteSheetCells; ++i)
{
ser.BeginOptionalGroup("Cell", true);
+1 -1
View File
@@ -37,7 +37,7 @@ namespace LyShine
// this function and use Unicode::CIterator<>::Position instead.
wchar_t wcharString[2] = { static_cast<wchar_t>(multiByteChar), 0 };
AZStd::string utf8String(CryStringUtils::WStrToUTF8(wcharString));
int utf8Length = utf8String.length();
int utf8Length = static_cast<int>(utf8String.length());
return utf8Length;
}
@@ -2716,7 +2716,7 @@ namespace
float newWidth;
EBUS_EVENT_ID_RESULT(newWidth, testElemId, UiLayoutCellDefaultBus, GetTargetWidth, LyShine::UiLayoutCellUnspecifiedSize);
const int testStringLength = testString.length();
const int testStringLength = static_cast<int>(testString.length());
const int numGapsBetweenCharacters = testStringLength >= 1 ? testStringLength - 1 : 0;
const float ems = characterSpacing * 0.001f;
float expectedWidth = baseWidth + numGapsBetweenCharacters * ems * fontSize;
@@ -705,7 +705,7 @@ AZStd::string UiCanvasComponent::GetUniqueChildName(AZ::EntityId parentEntityId,
// Count trailing digits in base name
int i;
for (i = baseName.length() - 1; i >= 0; i--)
for (i = static_cast<int>(baseName.length() - 1); i >= 0; i--)
{
if (!isdigit(baseName[i]))
{
@@ -713,7 +713,7 @@ AZStd::string UiCanvasComponent::GetUniqueChildName(AZ::EntityId parentEntityId,
}
}
int startDigitIndex = i + 1;
int numDigits = baseName.length() - startDigitIndex;
int numDigits = static_cast<int>(baseName.length() - startDigitIndex);
int suffix = 1;
if (numDigits > 0)
@@ -737,7 +737,7 @@ AZStd::string UiCanvasComponent::GetUniqueChildName(AZ::EntityId parentEntityId,
AZStd::string suffixString = AZStd::string::format("%d", suffix);
// Append leading zeros
int numLeadingZeros = (suffixString.length() < numDigits) ? numDigits - suffixString.length() : 0;
int numLeadingZeros = static_cast<int>((suffixString.length() < numDigits) ? numDigits - suffixString.length() : 0);
for (int zeroes = 0; zeroes < numLeadingZeros; zeroes++)
{
proposedChildName.push_back('0');
@@ -1978,7 +1978,7 @@ void UiCanvasComponent::GetDebugInfoNumElements(DebugInfoNumElements& info) cons
info.m_numMaskElements = 0;
info.m_numFaderElements = 0;
info.m_numInteractableElements = 0;
info.m_numUpdateElements = UiCanvasUpdateNotificationBus::GetNumOfEventHandlers(GetEntityId());
info.m_numUpdateElements = static_cast<int>(UiCanvasUpdateNotificationBus::GetNumOfEventHandlers(GetEntityId()));
DebugInfoCountChildren(m_rootElement, true, info);
}
@@ -1179,7 +1179,7 @@ void UiDynamicScrollBoxComponent::ResizeContentToFitElements()
}
else
{
int numHeaders = m_sections.size();
int numHeaders = static_cast<int>(m_sections.size());
int numItems = m_numElements - numHeaders;
newSize = numHeaders * m_prototypeElementSize[ElementType::SectionHeader] + numItems * m_prototypeElementSize[ElementType::Item];
}
@@ -1201,7 +1201,7 @@ void UiDynamicScrollBoxComponent::ResizeContentToFitElements()
}
else
{
int numHeaders = m_sections.size();
int numHeaders = static_cast<int>(m_sections.size());
int numItems = m_numElements - numHeaders;
newSize = numHeaders * m_estimatedElementSize[ElementType::SectionHeader] + numItems * m_estimatedElementSize[ElementType::Item];
}
@@ -1555,7 +1555,7 @@ float UiDynamicScrollBoxComponent::GetFixedSizeElementOffset(int index) const
int numHeaders = 0;
int numItems = 0;
int numSections = m_sections.size();
int numSections = static_cast<int>(m_sections.size());
if (numSections > 0)
{
if (index > m_sections[numSections - 1].m_headerElementIndex)
+17 -17
View File
@@ -142,7 +142,7 @@ void UiElementComponent::RenderElement(LyShine::IRenderGraph* renderGraph, bool
if (m_renderControlInterface)
{
// give control of rendering this element and its children to the render control component on this element
m_renderControlInterface->Render(renderGraph, this, m_renderInterface, m_childElementComponents.size(), isInGame);
m_renderControlInterface->Render(renderGraph, this, m_renderInterface, static_cast<int>(m_childElementComponents.size()), isInGame);
}
else
{
@@ -153,7 +153,7 @@ void UiElementComponent::RenderElement(LyShine::IRenderGraph* renderGraph, bool
}
// now render child elements
int numChildren = m_childElementComponents.size();
int numChildren = static_cast<int>(m_childElementComponents.size());
for (int i = 0; i < numChildren; ++i)
{
GetChildElementComponent(i)->RenderElement(renderGraph, isInGame);
@@ -194,7 +194,7 @@ AZ::EntityId UiElementComponent::GetParentEntityId()
////////////////////////////////////////////////////////////////////////////////////////////////////
int UiElementComponent::GetNumChildElements()
{
return m_childEntityIdOrder.size();
return static_cast<int>(m_childEntityIdOrder.size());
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -236,7 +236,7 @@ UiElementInterface* UiElementComponent::GetChildElementInterface(int index)
int UiElementComponent::GetIndexOfChild(const AZ::Entity* child)
{
AZ::EntityId childEntityId = child->GetId();
int numChildren = m_childEntityIdOrder.size();
int numChildren = static_cast<int>(m_childEntityIdOrder.size());
for (int i = 0; i < numChildren; ++i)
{
if (m_childEntityIdOrder[i].m_entityId == childEntityId)
@@ -251,7 +251,7 @@ int UiElementComponent::GetIndexOfChild(const AZ::Entity* child)
////////////////////////////////////////////////////////////////////////////////////////////////////
int UiElementComponent::GetIndexOfChildByEntityId(AZ::EntityId childId)
{
int numChildren = m_childEntityIdOrder.size();
int numChildren = static_cast<int>(m_childEntityIdOrder.size());
for (int i = 0; i < numChildren; ++i)
{
if (m_childEntityIdOrder[i].m_entityId == childId)
@@ -266,7 +266,7 @@ int UiElementComponent::GetIndexOfChildByEntityId(AZ::EntityId childId)
////////////////////////////////////////////////////////////////////////////////////////////////////
LyShine::EntityArray UiElementComponent::GetChildElements()
{
int numChildren = m_childEntityIdOrder.size();
int numChildren = static_cast<int>(m_childEntityIdOrder.size());
LyShine::EntityArray children;
children.reserve(numChildren);
@@ -477,7 +477,7 @@ AZ::Entity* UiElementComponent::FindFrontmostChildContainingPoint(AZ::Vector2 po
// this traverses all of the elements in reverse hierarchy order and returns the first one that
// is containing the point.
// If necessary, this could be optimized using a spatial partitioning data structure.
for (int i = m_childEntityIdOrder.size() - 1; !matchElem && i >= 0; i--)
for (int i = static_cast<int>(m_childEntityIdOrder.size() - 1); !matchElem && i >= 0; i--)
{
AZ::EntityId child = m_childEntityIdOrder[i].m_entityId;
@@ -602,7 +602,7 @@ AZ::EntityId UiElementComponent::FindInteractableToHandleEvent(AZ::Vector2 point
EBUS_EVENT_ID_RESULT(isMasked, GetEntityId(), UiInteractionMaskBus, IsPointMasked, point);
if (!isMasked)
{
for (int i = m_childEntityIdOrder.size() - 1; !result.IsValid() && i >= 0; i--)
for (int i = static_cast<int>(m_childEntityIdOrder.size() - 1); !result.IsValid() && i >= 0; i--)
{
result = GetChildElementComponent(i)->FindInteractableToHandleEvent(point);
}
@@ -674,7 +674,7 @@ AZ::Entity* UiElementComponent::FindChildByName(const LyShine::NameType& name)
if (AreChildPointersValid())
{
int numChildren = m_childElementComponents.size();
int numChildren = static_cast<int>(m_childElementComponents.size());
for (int i = 0; i < numChildren; ++i)
{
AZ::Entity* childEntity = GetChildElementComponent(i)->GetEntity();
@@ -709,7 +709,7 @@ AZ::Entity* UiElementComponent::FindDescendantByName(const LyShine::NameType& na
if (AreChildPointersValid())
{
int numChildren = m_childElementComponents.size();
int numChildren = static_cast<int>(m_childElementComponents.size());
for (int i = 0; i < numChildren; ++i)
{
UiElementComponent* childElementComponent = GetChildElementComponent(i);
@@ -771,7 +771,7 @@ AZ::Entity* UiElementComponent::FindChildByEntityId(AZ::EntityId id)
{
AZ::Entity* matchElem = nullptr;
int numChildren = m_childEntityIdOrder.size();
int numChildren = static_cast<int>(m_childEntityIdOrder.size());
for (int i = 0; i < numChildren; ++i)
{
if (id == m_childEntityIdOrder[i].m_entityId)
@@ -803,7 +803,7 @@ AZ::Entity* UiElementComponent::FindDescendantById(LyShine::ElementId id)
if (AreChildPointersValid())
{
int numChildren = m_childEntityIdOrder.size();
int numChildren = static_cast<int>(m_childEntityIdOrder.size());
for (int i = 0; !match && i < numChildren; ++i)
{
match = GetChildElementComponent(i)->FindDescendantById(id);
@@ -825,7 +825,7 @@ void UiElementComponent::FindDescendantElements(AZStd::function<bool(const AZ::E
{
if (AreChildPointersValid())
{
int numChildren = m_childElementComponents.size();
int numChildren = static_cast<int>(m_childElementComponents.size());
for (int i = 0; i < numChildren; ++i)
{
UiElementComponent* childElementComponent = GetChildElementComponent(i);
@@ -860,7 +860,7 @@ void UiElementComponent::CallOnDescendantElements(AZStd::function<void(const AZ:
{
if (AreChildPointersValid())
{
int numChildren = m_childEntityIdOrder.size();
int numChildren = static_cast<int>(m_childEntityIdOrder.size());
for (int i = 0; i < numChildren; ++i)
{
callFunction(m_childEntityIdOrder[i].m_entityId);
@@ -1068,7 +1068,7 @@ void UiElementComponent::AddChild(AZ::Entity* child, AZ::Entity* insertBefore)
if (insertBefore)
{
int numChildren = m_childEntityIdOrder.size();
int numChildren = static_cast<int>(m_childEntityIdOrder.size());
for (int i = 0; i < numChildren; ++i)
{
if (m_childEntityIdOrder[i].m_entityId == insertBefore->GetId())
@@ -1696,7 +1696,7 @@ void UiElementComponent::OnPatchEnd(const AZ::DataPatchNodeInfo& patchInfo)
// the lookupAddress is the same length as the "Children" address plus an index
// check if the address is childrenAddress plus an extra element
bool match = true;
for (int i = childrenAddress.size() - 1; i >= 0; --i)
for (int i = static_cast<int>(childrenAddress.size() - 1); i >= 0; --i)
{
if (lookupAddress[i] != childrenAddress[i])
{
@@ -1827,7 +1827,7 @@ void UiElementComponent::OnPatchEnd(const AZ::DataPatchNodeInfo& patchInfo)
// This will sort all the entity order entries by sort index (primary) and entity id (secondary) which should never result in any collisions
// This is used since slice data patching may create duplicate entries for the same sort index, missing indices and the like.
// It should never result in multiple entity id entries since the serialization of this data uses a persistent id which is the entity id
int numChildren = m_childEntityIdOrder.size();
int numChildren = static_cast<int>(m_childEntityIdOrder.size());
if (numChildren > 0)
{
AZStd::sort(m_childEntityIdOrder.begin(), m_childEntityIdOrder.end());
@@ -699,7 +699,7 @@ const AZ::u32 UiImageComponent::GetImageIndexCount()
{
if (m_sprite)
{
return m_sprite->GetSpriteSheetCells().size();
return static_cast<AZ::u32>(m_sprite->GetSpriteSheetCells().size());
}
return 0;
@@ -2635,7 +2635,7 @@ LyShine::AZu32ComboBoxVec UiImageComponent::PopulateIndexStringList() const
// There may not be a sprite loaded for this component
if (m_sprite)
{
const AZ::u32 numCells = m_sprite->GetSpriteSheetCells().size();
const AZ::u32 numCells = static_cast<AZ::u32>(m_sprite->GetSpriteSheetCells().size());
if (numCells != 0)
{
@@ -268,7 +268,7 @@ const AZ::u32 UiImageSequenceComponent::GetImageIndex()
////////////////////////////////////////////////////////////////////////////////////////////////////
const AZ::u32 UiImageSequenceComponent::GetImageIndexCount()
{
return m_spriteList.size();
return static_cast<AZ::u32>(m_spriteList.size());
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -452,7 +452,7 @@ void UiLayoutColumnComponent::ApplyLayoutWidth(float availableWidth)
// Get the child element cell widths
UiLayoutHelpers::LayoutCellSizes layoutCells;
UiLayoutHelpers::GetLayoutCellWidths(GetEntityId(), m_ignoreDefaultLayoutCells, layoutCells);
int numChildren = layoutCells.size();
int numChildren = static_cast<int>(layoutCells.size());
if (numChildren > 0)
{
// Set the child elements' transform properties based on the calculated child widths
@@ -492,7 +492,7 @@ void UiLayoutColumnComponent::ApplyLayoutHeight(float availableHeight)
// Get the child element cell heights
UiLayoutHelpers::LayoutCellSizes layoutCells;
UiLayoutHelpers::GetLayoutCellHeights(GetEntityId(), m_ignoreDefaultLayoutCells, layoutCells);
int numChildren = layoutCells.size();
int numChildren = static_cast<int>(layoutCells.size());
if (numChildren > 0)
{
// Calculate child heights
+1 -1
View File
@@ -434,7 +434,7 @@ namespace UiLayoutHelpers
////////////////////////////////////////////////////////////////////////////////////////////////////
void CalculateElementSizes(const LayoutCellSizes& layoutCells, float availableSize, float spacing, AZStd::vector<float>& sizesOut)
{
int numElements = layoutCells.size();
int numElements = static_cast<int>(layoutCells.size());
availableSize -= (numElements - 1) * spacing;
@@ -452,7 +452,7 @@ void UiLayoutRowComponent::ApplyLayoutWidth(float availableWidth)
// Get the child element cell widths
UiLayoutHelpers::LayoutCellSizes layoutCells;
UiLayoutHelpers::GetLayoutCellWidths(GetEntityId(), m_ignoreDefaultLayoutCells, layoutCells);
int numChildren = layoutCells.size();
int numChildren = static_cast<int>(layoutCells.size());
if (numChildren > 0)
{
// Calculate child widths
@@ -529,7 +529,7 @@ void UiLayoutRowComponent::ApplyLayoutHeight(float availableHeight)
// Get the child element cell heights
UiLayoutHelpers::LayoutCellSizes layoutCells;
UiLayoutHelpers::GetLayoutCellHeights(GetEntityId(), m_ignoreDefaultLayoutCells, layoutCells);
int numChildren = layoutCells.size();
int numChildren = static_cast<int>(layoutCells.size());
if (numChildren > 0)
{
// Set the child elements' transform properties based on the calculated child heights
@@ -32,7 +32,7 @@ namespace
{
// Iterate through the clickable rects to find one that contains the point
int clickableRectIndex = -1;
const int numClickableRects = clickableTextRects.size();
const int numClickableRects = static_cast<int>(clickableTextRects.size());
for (int i = 0; i < numClickableRects; ++i)
{
const auto& clickableRect = clickableTextRects[i];
@@ -409,7 +409,7 @@ void UiParticleEmitterComponent::SetSpriteSheetCellIndex(int spriteSheetIndex)
if (m_sprite)
{
const AZ::u32 numCells = m_sprite->GetSpriteSheetCells().size();
const AZ::u32 numCells = static_cast<AZ::u32>(m_sprite->GetSpriteSheetCells().size());
m_spriteSheetCellIndex = AZ::GetMin(numCells, m_spriteSheetCellIndex);
m_spriteSheetCellEndIndex = AZ::GetMax(m_spriteSheetCellIndex, m_spriteSheetCellEndIndex);
}
@@ -428,7 +428,7 @@ void UiParticleEmitterComponent::SetSpriteSheetCellEndIndex(int spriteSheetEndIn
if (m_sprite)
{
const AZ::u32 numCells = m_sprite->GetSpriteSheetCells().size();
const AZ::u32 numCells = static_cast<AZ::u32>(m_sprite->GetSpriteSheetCells().size());
m_spriteSheetCellEndIndex = AZ::GetMin(numCells, m_spriteSheetCellEndIndex);
m_spriteSheetCellIndex = AZ::GetMin(m_spriteSheetCellIndex, m_spriteSheetCellEndIndex);
}
@@ -759,7 +759,7 @@ void UiParticleEmitterComponent::InGamePostActivate()
////////////////////////////////////////////////////////////////////////////////////////////////////
void UiParticleEmitterComponent::Render(LyShine::IRenderGraph* renderGraph)
{
AZ::u32 particlesToRender = AZ::GetMin<AZ::u32>(m_particleContainer.size(), m_particleBufferSize);
AZ::u32 particlesToRender = AZ::GetMin<AZ::u32>(static_cast<AZ::u32>(m_particleContainer.size()), m_particleBufferSize);
if (particlesToRender == 0)
{
return;
@@ -1943,7 +1943,7 @@ void UiParticleEmitterComponent::OnSpritePathnameChange()
m_spriteSheetCellIndex = 0;
if (IsSpriteTypeSpriteSheet())
{
m_spriteSheetCellEndIndex = m_sprite->GetSpriteSheetCells().size() - 1;
m_spriteSheetCellEndIndex = static_cast<AZ::u32>(m_sprite->GetSpriteSheetCells().size() - 1);
}
}
@@ -2086,7 +2086,7 @@ UiParticleEmitterComponent::AZu32ComboBoxVec UiParticleEmitterComponent::Populat
// There may not be a sprite loaded for this component
if (m_sprite)
{
const AZ::u32 numCells = m_sprite->GetSpriteSheetCells().size();
const AZ::u32 numCells = static_cast<AZ::u32>(m_sprite->GetSpriteSheetCells().size());
if (numCells != 0)
{
+1 -1
View File
@@ -4413,7 +4413,7 @@ void UiTextComponent::HandleWidthOnlyShrinkToFitWithWrapping(
{
// Consider the sizes of all overflowing lines when calculating the
// scale to reduce the number of times we need to iterate.
int numOverflowingLines = drawBatchLinesOut.batchLines.size() - maxLinesElementCanHold;
int numOverflowingLines = static_cast<int>(drawBatchLinesOut.batchLines.size() - maxLinesElementCanHold);
DrawBatchLineContainer::reverse_iterator riter;
int overflowLineCount = 0;
float overflowingLineSize = 0.0f;
@@ -92,7 +92,7 @@ void UiTextComponentOffsetsSelector::ParseBatchLine(const UiTextComponent::DrawB
// on the same line or not.
else if (!lastIndexFound)
{
int substrLength = drawBatch.text.length() - firstIndexLineIndex;
int substrLength = static_cast<int>(drawBatch.text.length() - firstIndexLineIndex);
AZStd::string curSubstring(drawBatch.text.substr(firstIndexLineIndex, substrLength));
curLineWidth += drawBatch.font->GetTextSize(curSubstring.c_str(), false, m_fontContext).x;
lineOffsetsStack.top()->right.SetX(AZStd::GetMax<float>(lineOffsetsStack.top()->right.GetX(), curLineWidth));
@@ -29,7 +29,7 @@ struct UiTextComponentOffsetsSelector
, m_firstIndex(firstIndex)
, m_lastIndex(lastIndex)
, m_lastIndexLineNumber(lastIndexLineNumber)
, m_numLines(m_drawBatchLines.batchLines.size())
, m_numLines(static_cast<int>(m_drawBatchLines.batchLines.size()))
, m_indexIter(0)
, m_numCharsSelected(0)
, m_lineCounter(0)
@@ -647,7 +647,7 @@ bool UiTextInputComponent::HandleKeyInputBegan(const AzFramework::InputChannel::
// Append text from clipboard
textString.insert(m_textCursorPos, clipboardText);
m_textCursorPos += clipboardText.length();
m_textCursorPos += static_cast<int>(clipboardText.length());
m_textSelectionStartPos = m_textCursorPos;
// If max length is set, remove extra characters