Gems/Atom
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -76,9 +76,9 @@ namespace ImageProcessingAtom
|
||||
for (int r = 0; r < ePS_Red; ++r)
|
||||
{
|
||||
SColor col;
|
||||
col.r = 255 * r / (ePS_Red);
|
||||
col.g = 255 * g / (ePS_Green);
|
||||
col.b = 255 * b / (ePS_Blue);
|
||||
col.r = aznumeric_cast<unsigned char>(255 * r / (ePS_Red));
|
||||
col.g = aznumeric_cast<unsigned char>(255 * g / (ePS_Green));
|
||||
col.b = aznumeric_cast<unsigned char>(255 * b / (ePS_Blue));
|
||||
int l = 255 - (col.r * 3 + col.g * 6 + col.b) / 10;
|
||||
col.r = col.g = col.b = (unsigned char)l;
|
||||
m_mapping.push_back(col);
|
||||
|
||||
@@ -97,8 +97,8 @@ namespace ImageProcessingAtom
|
||||
RHI::Format format = Utils::PixelFormatToRHIFormat(m_imageObject->GetPixelFormat(), m_imageObject->HasImageFlags(EIF_SRGBRead));
|
||||
RHI::ImageBindFlags bindFlag = RHI::ImageBindFlags::ShaderRead;
|
||||
|
||||
RHI::ImageDescriptor imageDesc = RHI::ImageDescriptor::Create2DArray(bindFlag, imageWidth, imageHeight, arraySize, format);
|
||||
imageDesc.m_mipLevels = m_imageObject->GetMipCount();
|
||||
RHI::ImageDescriptor imageDesc = RHI::ImageDescriptor::Create2DArray(bindFlag, imageWidth, imageHeight, aznumeric_cast<uint16_t>(arraySize), format);
|
||||
imageDesc.m_mipLevels = aznumeric_cast<uint16_t>(m_imageObject->GetMipCount());
|
||||
if (m_imageObject->HasImageFlags(EIF_Cubemap))
|
||||
{
|
||||
imageDesc.m_isCubemap = true;
|
||||
@@ -227,7 +227,7 @@ namespace ImageProcessingAtom
|
||||
{
|
||||
RPI::ImageMipChainAssetCreator builder;
|
||||
uint32_t arraySize = m_imageObject->HasImageFlags(EIF_Cubemap) ? 6 : 1;
|
||||
builder.Begin(chainAssetId, mipLevels, arraySize);
|
||||
builder.Begin(chainAssetId, aznumeric_cast<uint16_t>(mipLevels), aznumeric_cast<uint16_t>(arraySize));
|
||||
|
||||
for (uint32_t mip = startMip; mip < startMip + mipLevels; mip++)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace ImageProcessingAtom
|
||||
|
||||
Result = ((intValue + 0x0FFFU + ((intValue >> 13U) & 1U)) >> 13U) & 0x7FFFU;
|
||||
}
|
||||
h = (Result | Sign);
|
||||
h = static_cast<AZ::u16>(Result | Sign);
|
||||
}
|
||||
|
||||
operator float() const
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ namespace AZ
|
||||
}
|
||||
|
||||
float inverseScale = 1.0f / m_outputScale;
|
||||
uint32_t outputWidth = m_imageSize.m_width * inverseScale;
|
||||
uint32_t outputHeight = m_imageSize.m_height * inverseScale;
|
||||
uint32_t outputWidth = static_cast<uint32_t>(m_imageSize.m_width * inverseScale);
|
||||
uint32_t outputHeight = static_cast<uint32_t>(m_imageSize.m_height * inverseScale);
|
||||
|
||||
params.m_viewportState = RHI::Viewport(0, static_cast<float>(outputWidth), 0, static_cast<float>(outputHeight));
|
||||
params.m_scissorState = RHI::Scissor(0, 0, outputWidth, outputHeight);
|
||||
|
||||
@@ -1807,7 +1807,7 @@ namespace AZ
|
||||
if (iter != materialAssetsByUid.end())
|
||||
{
|
||||
ModelMaterialSlot materialSlot;
|
||||
materialSlot.m_stableId = meshView.m_materialUid;
|
||||
materialSlot.m_stableId = static_cast<AZ::RPI::ModelMaterialSlot::StableId>(meshView.m_materialUid);
|
||||
materialSlot.m_displayName = iter->second.m_name;
|
||||
materialSlot.m_defaultMaterialAsset = iter->second.m_asset;
|
||||
|
||||
|
||||
@@ -179,10 +179,10 @@ namespace AZ
|
||||
RHI::Size targetImageSize = outputAttachment->m_descriptor.m_image.m_size;
|
||||
|
||||
|
||||
m_viewportState.m_maxX = AZStd::min(static_cast<uint32_t>(params.m_viewportState.m_maxX), targetImageSize.m_width);
|
||||
m_viewportState.m_maxY = AZStd::min(static_cast<uint32_t>(params.m_viewportState.m_maxY), targetImageSize.m_height);
|
||||
m_viewportState.m_minX = AZStd::min(params.m_viewportState.m_minX, m_viewportState.m_maxX);
|
||||
m_viewportState.m_minY = AZStd::min(params.m_viewportState.m_minY, m_viewportState.m_maxY);
|
||||
m_viewportState.m_maxX = aznumeric_cast<float>(AZStd::min(static_cast<uint32_t>(params.m_viewportState.m_maxX), targetImageSize.m_width));
|
||||
m_viewportState.m_maxY = aznumeric_cast<float>(AZStd::min(static_cast<uint32_t>(params.m_viewportState.m_maxY), targetImageSize.m_height));
|
||||
m_viewportState.m_minX = aznumeric_cast<float>(AZStd::min(params.m_viewportState.m_minX, m_viewportState.m_maxX));
|
||||
m_viewportState.m_minY = aznumeric_cast<float>(AZStd::min(params.m_viewportState.m_minY, m_viewportState.m_maxY));
|
||||
|
||||
m_scissorState.m_maxX = AZStd::min(static_cast<uint32_t>(params.m_scissorState.m_maxX), targetImageSize.m_width);
|
||||
m_scissorState.m_maxY = AZStd::min(static_cast<uint32_t>(params.m_scissorState.m_maxY), targetImageSize.m_height);
|
||||
|
||||
@@ -618,7 +618,7 @@ namespace AZ
|
||||
else // We have enough space to draw the entire label, draw and center text.
|
||||
{
|
||||
const float remainingWidth = regionPixelWidth - textWidth;
|
||||
const float offset = remainingWidth * .5;
|
||||
const float offset = remainingWidth * .5f;
|
||||
|
||||
drawList->AddText({ startPoint.x + offset, startPoint.y }, IM_COL32_WHITE, label.c_str());
|
||||
}
|
||||
|
||||
@@ -1092,8 +1092,8 @@ namespace AZ
|
||||
AZStd::sort(m_tableRows.begin(), m_tableRows.end(),
|
||||
[ascending](const TableRow& lhs, const TableRow& rhs)
|
||||
{
|
||||
const float lhsSize = lhs.m_sizeInBytes;
|
||||
const float rhsSize = rhs.m_sizeInBytes;
|
||||
const float lhsSize = aznumeric_cast<float>(lhs.m_sizeInBytes);
|
||||
const float rhsSize = aznumeric_cast<float>(rhs.m_sizeInBytes);
|
||||
return ascending ? lhsSize < rhsSize : lhsSize > rhsSize;
|
||||
});
|
||||
break;
|
||||
|
||||
+1
-1
@@ -156,7 +156,7 @@ namespace AZ::Render
|
||||
|
||||
m_drawParams.m_drawViewportId = viewportContext->GetId();
|
||||
auto viewportSize = viewportContext->GetViewportSize();
|
||||
m_drawParams.m_position = AZ::Vector3(viewportSize.m_width, 0.0f, 1.0f) + AZ::Vector3(r_topRightBorderPadding) * viewportContext->GetDpiScalingFactor();
|
||||
m_drawParams.m_position = AZ::Vector3(static_cast<float>(viewportSize.m_width), 0.0f, 1.0f) + AZ::Vector3(r_topRightBorderPadding) * viewportContext->GetDpiScalingFactor();
|
||||
m_drawParams.m_color = AZ::Colors::White;
|
||||
m_drawParams.m_scale = AZ::Vector2(BaseFontSize);
|
||||
m_drawParams.m_hAlign = AzFramework::TextHorizontalAlignment::Right;
|
||||
|
||||
+2
-2
@@ -104,7 +104,7 @@ namespace AZ::Render
|
||||
{
|
||||
if (GetShadowsEnabled() && GetLightHandle().IsValid())
|
||||
{
|
||||
GetFeatureProcessor()->SetPredictionSampleCount(GetLightHandle(), count);
|
||||
GetFeatureProcessor()->SetPredictionSampleCount(GetLightHandle(), aznumeric_cast<uint16_t>(count));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace AZ::Render
|
||||
{
|
||||
if (GetShadowsEnabled() && GetLightHandle().IsValid())
|
||||
{
|
||||
GetFeatureProcessor()->SetFilteringSampleCount(GetLightHandle(), count);
|
||||
GetFeatureProcessor()->SetFilteringSampleCount(GetLightHandle(), aznumeric_cast<uint16_t>(count));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user