diff --git a/Gems/AtomLyIntegration/AtomBridge/Code/Source/Editor/AssetCollectionAsyncLoaderTestComponent.cpp b/Gems/AtomLyIntegration/AtomBridge/Code/Source/Editor/AssetCollectionAsyncLoaderTestComponent.cpp index 08f3d8cf9e..b51e3b0e29 100644 --- a/Gems/AtomLyIntegration/AtomBridge/Code/Source/Editor/AssetCollectionAsyncLoaderTestComponent.cpp +++ b/Gems/AtomLyIntegration/AtomBridge/Code/Source/Editor/AssetCollectionAsyncLoaderTestComponent.cpp @@ -238,7 +238,7 @@ namespace AZ uint32_t AssetCollectionAsyncLoaderTestComponent::GetCountOfPendingAssets() const { - return m_pendingAssets.size(); + return static_cast(m_pendingAssets.size()); } bool AssetCollectionAsyncLoaderTestComponent::ValidateAssetWasLoaded(const AZStd::string& assetPath) const diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp index c07717945a..421a757b04 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp @@ -331,7 +331,7 @@ void AZ::FFont::DrawStringUInternal( m_vertexBuffer[vertexOffset + 3].color.dcolor = packedColor; m_vertexBuffer[vertexOffset + 3].st = tc3; - uint16_t startingIndex = vertexOffset - startingVertexCount; + uint16_t startingIndex = static_cast(vertexOffset - startingVertexCount); m_indexBuffer[indexOffset + 0] = startingIndex + 0; m_indexBuffer[indexOffset + 1] = startingIndex + 1; m_indexBuffer[indexOffset + 2] = startingIndex + 2; @@ -697,12 +697,12 @@ uint32_t AZ::FFont::WriteTextQuadsToBuffers(SVF_P2F_C4B_T2F_F4B* verts, uint16_t vertexData[vertexOffset + 3].texIndex2 = 0; vertexData[vertexOffset + 3].pad = 0; - indexData[indexOffset + 0] = vertexOffset + 0; - indexData[indexOffset + 1] = vertexOffset + 1; - indexData[indexOffset + 2] = vertexOffset + 2; - indexData[indexOffset + 3] = vertexOffset + 2; - indexData[indexOffset + 4] = vertexOffset + 3; - indexData[indexOffset + 5] = vertexOffset + 0; + indexData[indexOffset + 0] = static_cast(vertexOffset + 0); + indexData[indexOffset + 1] = static_cast(vertexOffset + 1); + indexData[indexOffset + 2] = static_cast(vertexOffset + 2); + indexData[indexOffset + 3] = static_cast(vertexOffset + 2); + indexData[indexOffset + 4] = static_cast(vertexOffset + 3); + indexData[indexOffset + 5] = static_cast(vertexOffset + 0); vertexOffset += 4; indexOffset += 6; @@ -1331,7 +1331,7 @@ unsigned int AZ::FFont::GetEffectId(const char* effectName) const { if (!strcmp(m_effects[i].m_name.c_str(), effectName)) { - return i; + return static_cast(i); } } } @@ -1341,7 +1341,7 @@ unsigned int AZ::FFont::GetEffectId(const char* effectName) const unsigned int AZ::FFont::GetNumEffects() const { - return m_effects.size(); + return static_cast(m_effects.size()); } const char* AZ::FFont::GetEffectName(unsigned int effectId) const diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp index 62d673f9eb..6ea6a8e85f 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp +++ b/Gems/AtomLyIntegration/AtomViewportDisplayIcons/Code/Source/AtomViewportDisplayIconsSystemComponent.cpp @@ -207,7 +207,7 @@ namespace AZ::Render createVertex(-0.5f, 0.5f, 0.f, 1.f) }; AZStd::array indices = {0, 1, 2, 0, 2, 3}; - dynamicDraw->DrawIndexed(&vertices, vertices.size(), &indices, indices.size(), RHI::IndexFormat::Uint16, drawSrg); + dynamicDraw->DrawIndexed(&vertices, static_cast(vertices.size()), &indices, static_cast(indices.size()), RHI::IndexFormat::Uint16, drawSrg); } QString AtomViewportDisplayIconsSystemComponent::FindAssetPath(const QString& path) const diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp index a001b5a453..7715dfde4f 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/PolygonLightDelegate.cpp @@ -54,7 +54,7 @@ namespace AZ { transformedVertices.push_back(transform.TransformPoint(Vector3(vertex.GetX(), vertex.GetY(), 0.0f))); } - GetFeatureProcessor()->SetPolygonPoints(GetLightHandle(), transformedVertices.data(), transformedVertices.size(), GetTransform().GetBasisZ()); + GetFeatureProcessor()->SetPolygonPoints(GetLightHandle(), transformedVertices.data(), static_cast(transformedVertices.size()), GetTransform().GetBasisZ()); } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp index fc62690cc4..4b3322c442 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/EditorMeshComponent.cpp @@ -213,7 +213,7 @@ namespace AZ { EditorMeshStatsForLod stats; const auto& meshes = lodAsset->GetMeshes(); - stats.m_meshCount = meshes.size(); + stats.m_meshCount = static_cast(meshes.size()); for (const auto& mesh : meshes) { stats.m_vertCount += mesh.GetVertexCount(); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp index 29bd9a839b..2c57c10f4d 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp @@ -58,7 +58,7 @@ namespace AZ { if (m_modelAsset.IsReady()) { - lodCount = m_modelAsset->GetLodCount(); + lodCount = static_cast(m_modelAsset->GetLodCount()); } else { @@ -66,7 +66,7 @@ namespace AZ Data::Instance model = Data::InstanceDatabase::Instance().Find(Data::InstanceId::CreateFromAssetId(m_modelAsset.GetId())); if (model) { - lodCount = model->GetLodCount(); + lodCount = static_cast(model->GetLodCount()); } } } diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp index 3143191135..259fd0a6a9 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/ActorAsset.cpp @@ -212,7 +212,7 @@ namespace AZ for (uint32_t vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex) { const uint32_t originalVertex = sourceOriginalVertex[vertexIndex + vertexStart]; - const uint32_t influenceCount = AZStd::GetMin(MaxSupportedSkinInfluences, sourceSkinningInfo->GetNumInfluences(originalVertex)); + const uint32_t influenceCount = AZStd::GetMin(MaxSupportedSkinInfluences, static_cast(sourceSkinningInfo->GetNumInfluences(originalVertex))); uint32_t influenceIndex = 0; float weightError = 1.0f; @@ -379,7 +379,7 @@ namespace AZ size_t skinnedMeshSubmeshIndex = 0; for (size_t jointIndex = 0; jointIndex < numJoints; ++jointIndex) { - const EMotionFX::Mesh* mesh = actor->GetMesh(lodIndex, jointIndex); + const EMotionFX::Mesh* mesh = actor->GetMesh(static_cast(lodIndex), static_cast(jointIndex)); if (!mesh || mesh->GetIsCollisionMesh()) { continue; @@ -405,7 +405,7 @@ namespace AZ for (size_t subMeshIndex = 0; subMeshIndex < numSubMeshes; ++subMeshIndex) { - const EMotionFX::SubMesh* subMesh = mesh->GetSubMesh(subMeshIndex); + const EMotionFX::SubMesh* subMesh = mesh->GetSubMesh(static_cast(subMeshIndex)); const size_t vertexCount = subMesh->GetNumVertices(); // Skip empty sub-meshes and sub-meshes that would put the total vertex count beyond the supported range @@ -509,7 +509,7 @@ namespace AZ if (morphBufferAssetView) { - ProcessMorphsForLod(actor, morphBufferAssetView->GetBufferAsset(), lodIndex, fullFileName, skinnedMeshLod); + ProcessMorphsForLod(actor, morphBufferAssetView->GetBufferAsset(), static_cast(lodIndex), fullFileName, skinnedMeshLod); } // Set colors after morphs are set, so that we know whether or not they are dynamic (if they exist) @@ -594,7 +594,7 @@ namespace AZ descriptor.m_bufferData = boneTransforms.data(); descriptor.m_bufferName = AZStd::string::format("BoneTransformBuffer_%s", actorInstance->GetActor()->GetName()); descriptor.m_byteCount = boneTransforms.size() * sizeof(float); - descriptor.m_elementSize = floatsPerBone * sizeof(float); + descriptor.m_elementSize = static_cast(floatsPerBone * sizeof(float)); descriptor.m_poolType = RPI::CommonBufferPoolType::ReadOnly; return RPI::BufferSystemInterface::Get()->CreateBufferFromCommonPool(descriptor); } diff --git a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp index 4c6045d7ce..6d3d78baa9 100644 --- a/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp +++ b/Gems/AtomLyIntegration/EMotionFXAtom/Code/Source/AtomActorInstance.cpp @@ -163,7 +163,7 @@ namespace AZ const AZ::Color skeletonColor(0.604f, 0.804f, 0.196f, 1.0f); RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs; lineArgs.m_verts = m_auxVertices.data(); - lineArgs.m_vertCount = m_auxVertices.size(); + lineArgs.m_vertCount = static_cast(m_auxVertices.size()); lineArgs.m_colors = &skeletonColor; lineArgs.m_colorCount = 1; lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off; @@ -204,9 +204,9 @@ namespace AZ RPI::AuxGeomDraw::AuxGeomDynamicDrawArguments lineArgs; lineArgs.m_verts = m_auxVertices.data(); - lineArgs.m_vertCount = m_auxVertices.size(); + lineArgs.m_vertCount = static_cast(m_auxVertices.size()); lineArgs.m_colors = m_auxColors.data(); - lineArgs.m_colorCount = m_auxColors.size(); + lineArgs.m_colorCount = static_cast(m_auxColors.size()); lineArgs.m_depthTest = RPI::AuxGeomDraw::DepthTest::Off; auxGeom->DrawLines(lineArgs); } @@ -786,7 +786,7 @@ namespace AZ for (size_t lodIndex = 0; lodIndex < m_skinnedMeshInputBuffers->GetLodCount(); ++lodIndex) { - EMotionFX::MorphSetup* morphSetup = actor->GetMorphSetup(lodIndex); + EMotionFX::MorphSetup* morphSetup = actor->GetMorphSetup(static_cast(lodIndex)); if (morphSetup) { const AZStd::vector& metaDatas = actor->GetMorphTargetMetaAsset()->GetMorphTargets(); @@ -836,7 +836,7 @@ namespace AZ // Set the weights for any active masks for (size_t i = 0; i < m_wrinkleMaskWeights.size(); ++i) { - wrinkleMaskObjectSrg->SetConstant(wrinkleMaskWeightsIndex, m_wrinkleMaskWeights[i], i); + wrinkleMaskObjectSrg->SetConstant(wrinkleMaskWeightsIndex, m_wrinkleMaskWeights[i], static_cast(i)); } AZ_Error("AtomActorInstance", m_wrinkleMaskWeights.size() <= s_maxActiveWrinkleMasks, "The skinning shader supports no more than %d active morph targets with wrinkle masks.", s_maxActiveWrinkleMasks); } diff --git a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.cpp b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.cpp index 73e0a61ad2..e47c8ba071 100644 --- a/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.cpp +++ b/Gems/AtomLyIntegration/ImguiAtom/Code/Source/DebugConsole.cpp @@ -230,7 +230,7 @@ namespace AZ void DebugConsole::BrowseInputHistory(ImGuiInputTextCallbackData* data) { const int previousHistoryIndex = m_currentHistoryIndex; - const int maxHistoryIndex = m_textInputHistory.size() - 1; + const int maxHistoryIndex = static_cast(m_textInputHistory.size() - 1); switch (data->EventKey) { // Browse backwards through the history.