From b3e895d10c697354ee6a9580f533494a722b3a1f Mon Sep 17 00:00:00 2001 From: pappeste Date: Fri, 25 Jun 2021 16:21:12 -0700 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFfixed=20AtomLyIntegration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp | 6 +++--- .../AtomFont/Code/Source/FontRenderer.cpp | 4 ++-- .../AtomFont/Code/Source/FontTexture.cpp | 10 +++++----- .../AtomFont/Code/Source/GlyphBitmap.cpp | 2 +- .../Source/AtomViewportDisplayInfoSystemComponent.cpp | 2 +- .../Source/CoreLights/AreaLightComponentController.cpp | 4 ++-- .../CoreLights/DirectionalLightComponentController.cpp | 3 ++- .../Code/Source/CoreLights/DiskLightDelegate.cpp | 4 ++-- .../Code/Source/Mesh/MeshComponentController.cpp | 2 +- 9 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp index 9317cae846..a29815f08c 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/FFont.cpp @@ -1070,7 +1070,7 @@ int AZ::FFont::CreateQuadsForText(const RHI::Viewport& viewport, float x, float uint32_t packedColor = 0xffffffff; { ColorB tempColor = color; - tempColor.a = ((uint32_t) tempColor.a * alphaBlend) >> 8; + tempColor.a = static_cast(((uint32_t) tempColor.a * alphaBlend) >> 8); packedColor = tempColor.pack_argb8888(); //note: this ends up in r,g,b,a order on little-endian machines } @@ -1220,7 +1220,7 @@ void AZ::FFont::WrapText(AZStd::string& result, float maxWidth, const char* str, if (ctx.m_processSpecialChars && ch == '$') { ++pChar; - char nextChar = *pChar; + char nextChar = static_cast(*pChar); if (isdigit(nextChar) || nextChar == 'O' || nextChar == 'o') { @@ -1516,7 +1516,7 @@ bool AZ::FFont::InitCache() char* p = buf; // precache all [normal] printable characters to the string (missing ones are updated on demand) - for (int i = first; i <= last; ++i) + for (char i = first; i <= last; ++i) { *p++ = i; } diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/FontRenderer.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/FontRenderer.cpp index 8c023f9353..053a2eb419 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/FontRenderer.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/FontRenderer.cpp @@ -235,12 +235,12 @@ int AZ::FontRenderer::GetGlyph(GlyphBitmap* glyphBitmap, int* horizontalAdvance, if (glyphWidth) { - *glyphWidth = m_glyph->bitmap.width; + *glyphWidth = static_cast(m_glyph->bitmap.width); } if (glyphHeight) { - *glyphHeight = m_glyph->bitmap.rows; + *glyphHeight = static_cast(m_glyph->bitmap.rows); } unsigned char* buffer = glyphBitmap->GetBuffer(); diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/FontTexture.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/FontTexture.cpp index 1ee7f80eda..773b19e740 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/FontTexture.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/FontTexture.cpp @@ -496,8 +496,8 @@ int AZ::FontTexture::UpdateSlot(int slotIndex, uint16_t slotUsage, uint32_t char return 0; } - slot->m_characterWidth = width; - slot->m_characterHeight = height; + slot->m_characterWidth = static_cast(width); + slot->m_characterHeight = static_cast(height); // Add a pixel along width and height to avoid artifacts being rendered // from a previous glyph in this slot due to bilinear filtering. The source @@ -519,8 +519,8 @@ void AZ::FontTexture::CreateGradientSlot() assert(slot->m_currentCharacter == (uint32_t)~0); // 0 needs to be unused spot slot->Reset(); - slot->m_characterWidth = m_cellWidth - 2; - slot->m_characterHeight = m_cellHeight - 2; + slot->m_characterWidth = static_cast(m_cellWidth - 2); + slot->m_characterHeight = static_cast(m_cellHeight - 2); slot->SetNotReusable(); int x = slot->m_textureSlot % m_widthCellCount; @@ -533,7 +533,7 @@ void AZ::FontTexture::CreateGradientSlot() { for (uint32_t dwX = 0; dwX < slot->m_characterWidth; ++dwX) { - buffer[dwX + dwY * m_width] = dwY * 255 / (slot->m_characterHeight - 1); + buffer[dwX + dwY * m_width] = static_cast(dwY * 255 / (slot->m_characterHeight - 1)); } } } diff --git a/Gems/AtomLyIntegration/AtomFont/Code/Source/GlyphBitmap.cpp b/Gems/AtomLyIntegration/AtomFont/Code/Source/GlyphBitmap.cpp index 09bc27783b..395a161b83 100644 --- a/Gems/AtomLyIntegration/AtomFont/Code/Source/GlyphBitmap.cpp +++ b/Gems/AtomLyIntegration/AtomFont/Code/Source/GlyphBitmap.cpp @@ -118,7 +118,7 @@ int AZ::GlyphBitmap::Blur(AZ::FontSmoothAmount smoothAmount) colorSum += m_buffer[yOffset + x]; } - m_buffer[yOffset + x] = colorSum >> 2; + m_buffer[yOffset + x] = static_cast(colorSum >> 2); } } } diff --git a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp index 40c4f8e48f..c1f459e1ee 100644 --- a/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp +++ b/Gems/AtomLyIntegration/AtomViewportDisplayInfo/Code/Source/AtomViewportDisplayInfoSystemComponent.cpp @@ -135,7 +135,7 @@ namespace AZ::Render return; } - m_fpsInterval = AZStd::chrono::seconds(r_fpsCalcInterval); + m_fpsInterval = AZStd::chrono::seconds(static_cast(r_fpsCalcInterval)); UpdateFramerate(); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp index b90b145320..0a5598a74a 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/AreaLightComponentController.cpp @@ -535,7 +535,7 @@ namespace AZ::Render void AreaLightComponentController::SetPredictionSampleCount(uint32_t count) { - m_configuration.m_predictionSampleCount = count; + m_configuration.m_predictionSampleCount = static_cast(count); if (m_lightShapeDelegate) { m_lightShapeDelegate->SetPredictionSampleCount(count); @@ -549,7 +549,7 @@ namespace AZ::Render void AreaLightComponentController::SetFilteringSampleCount(uint32_t count) { - m_configuration.m_filteringSampleCount = count; + m_configuration.m_filteringSampleCount = static_cast(count); if (m_lightShapeDelegate) { m_lightShapeDelegate->SetFilteringSampleCount(count); diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp index 031d935513..642e50d104 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DirectionalLightComponentController.cpp @@ -259,7 +259,8 @@ namespace AZ void DirectionalLightComponentController::SetCascadeCount(uint32_t cascadeCount) { - const uint16_t cascadeCount16 = cascadeCount = GetMin(Shadow::MaxNumberOfCascades, GetMax(1, aznumeric_cast(cascadeCount))); + const uint16_t cascadeCount16 = GetMin(static_cast(Shadow::MaxNumberOfCascades), GetMax(1, aznumeric_cast(cascadeCount))); + cascadeCount = cascadeCount16; m_configuration.m_cascadeCount = cascadeCount16; if (m_featureProcessor) { diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp index c6e4441d57..91856f7ee5 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/CoreLights/DiskLightDelegate.cpp @@ -159,7 +159,7 @@ namespace AZ::Render { if (GetShadowsEnabled() && GetLightHandle().IsValid()) { - GetFeatureProcessor()->SetPredictionSampleCount(GetLightHandle(), count); + GetFeatureProcessor()->SetPredictionSampleCount(GetLightHandle(), static_cast(count)); } } @@ -167,7 +167,7 @@ namespace AZ::Render { if (GetShadowsEnabled() && GetLightHandle().IsValid()) { - GetFeatureProcessor()->SetFilteringSampleCount(GetLightHandle(), count); + GetFeatureProcessor()->SetFilteringSampleCount(GetLightHandle(), static_cast(count)); } } diff --git a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp index 68276a7320..bb38f932fb 100644 --- a/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp +++ b/Gems/AtomLyIntegration/CommonFeatures/Code/Source/Mesh/MeshComponentController.cpp @@ -442,7 +442,7 @@ namespace AZ RPI::Cullable::LodOverride MeshComponentController::GetLodOverride() const { - return m_meshFeatureProcessor->GetSortKey(m_meshHandle); + return static_cast(m_meshFeatureProcessor->GetSortKey(m_meshHandle)); } void MeshComponentController::SetVisibility(bool visible)