fixed AtomLyIntegration

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
pappeste
2021-06-25 16:21:12 -07:00
committed by Esteban Papp
parent 38fd7f0013
commit b3e895d10c
9 changed files with 19 additions and 18 deletions
@@ -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<uint8_t>(((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<char>(*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;
}
@@ -235,12 +235,12 @@ int AZ::FontRenderer::GetGlyph(GlyphBitmap* glyphBitmap, int* horizontalAdvance,
if (glyphWidth)
{
*glyphWidth = m_glyph->bitmap.width;
*glyphWidth = static_cast<uint8_t>(m_glyph->bitmap.width);
}
if (glyphHeight)
{
*glyphHeight = m_glyph->bitmap.rows;
*glyphHeight = static_cast<uint8_t>(m_glyph->bitmap.rows);
}
unsigned char* buffer = glyphBitmap->GetBuffer();
@@ -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<uint8_t>(width);
slot->m_characterHeight = static_cast<uint8_t>(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<uint8_t>(m_cellWidth - 2);
slot->m_characterHeight = static_cast<uint8_t>(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<uint8_t>(dwY * 255 / (slot->m_characterHeight - 1));
}
}
}
@@ -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<uint8_t>(colorSum >> 2);
}
}
}
@@ -135,7 +135,7 @@ namespace AZ::Render
return;
}
m_fpsInterval = AZStd::chrono::seconds(r_fpsCalcInterval);
m_fpsInterval = AZStd::chrono::seconds(static_cast<AZStd::sys_time_t>(r_fpsCalcInterval));
UpdateFramerate();
@@ -535,7 +535,7 @@ namespace AZ::Render
void AreaLightComponentController::SetPredictionSampleCount(uint32_t count)
{
m_configuration.m_predictionSampleCount = count;
m_configuration.m_predictionSampleCount = static_cast<uint16_t>(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<uint16_t>(count);
if (m_lightShapeDelegate)
{
m_lightShapeDelegate->SetFilteringSampleCount(count);
@@ -259,7 +259,8 @@ namespace AZ
void DirectionalLightComponentController::SetCascadeCount(uint32_t cascadeCount)
{
const uint16_t cascadeCount16 = cascadeCount = GetMin(Shadow::MaxNumberOfCascades, GetMax<uint16_t>(1, aznumeric_cast<uint16_t>(cascadeCount)));
const uint16_t cascadeCount16 = GetMin(static_cast<uint16_t>(Shadow::MaxNumberOfCascades), GetMax<uint16_t>(1, aznumeric_cast<uint16_t>(cascadeCount)));
cascadeCount = cascadeCount16;
m_configuration.m_cascadeCount = cascadeCount16;
if (m_featureProcessor)
{
@@ -159,7 +159,7 @@ namespace AZ::Render
{
if (GetShadowsEnabled() && GetLightHandle().IsValid())
{
GetFeatureProcessor()->SetPredictionSampleCount(GetLightHandle(), count);
GetFeatureProcessor()->SetPredictionSampleCount(GetLightHandle(), static_cast<uint16_t>(count));
}
}
@@ -167,7 +167,7 @@ namespace AZ::Render
{
if (GetShadowsEnabled() && GetLightHandle().IsValid())
{
GetFeatureProcessor()->SetFilteringSampleCount(GetLightHandle(), count);
GetFeatureProcessor()->SetFilteringSampleCount(GetLightHandle(), static_cast<uint16_t>(count));
}
}
@@ -442,7 +442,7 @@ namespace AZ
RPI::Cullable::LodOverride MeshComponentController::GetLodOverride() const
{
return m_meshFeatureProcessor->GetSortKey(m_meshHandle);
return static_cast<RPI::Cullable::LodOverride>(m_meshFeatureProcessor->GetSortKey(m_meshHandle));
}
void MeshComponentController::SetVisibility(bool visible)