Gems/Atom

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
monroegm-disable-blank-issue-2
Esteban Papp 4 years ago
parent 257557c692
commit c19c4af1e1

@ -115,8 +115,6 @@ namespace ImageProcessingAtom
IImageObjectPtr ETC2Compressor::CompressImage(IImageObjectPtr srcImage, EPixelFormat fmtDst,
const CompressOption* compressOption) const
{
const size_t srcPixelSize = 4;
//validate input
EPixelFormat fmtSrc = srcImage->GetPixelFormat();

@ -133,7 +133,6 @@ namespace ImageProcessingAtom
IImageObjectPtr C3dLutColorChart::GenerateChartImage()
{
const AZ::u32 mipCount = 1;
IImageObjectPtr image(IImageObject::CreateImage(ePS_Red* ePS_Blue, ePS_Green, 1, ePixelFormat_R8G8B8A8));
{

@ -209,18 +209,18 @@ namespace ImageProcessingAtom
/* addition of c-pointers already takes care of datatype-sizes */ \
const signed long int dy = /*parm->mirror ? -1 :*/ 1; \
const unsigned int stridei = parm->incols * 1 * 1; \
const unsigned int stridet = parm->subcols * 1 * 1; \
const unsigned int strideo = parm->outcols * 1 * 1; \
[[maybe_unused]] const unsigned int stridet = parm->subcols * 1 * 1; \
[[maybe_unused]] const unsigned int strideo = parm->outcols * 1 * 1; \
/* offset and shift calculations still require the unmodified values */ \
const unsigned int strideiraw = parm->incols; \
const unsigned int stridetraw = parm->subcols; \
[[maybe_unused]] const unsigned int stridetraw = parm->subcols; \
const unsigned int strideoraw = parm->outcols; \
\
class Plane2D<dtyp> tmp(tmpcols, tmprows, 4); \
dtyp*** t = (dtyp***)tmp; \
int srcPos, dstPos; \
bool plusminush = false; const bool of = true; \
bool plusminusv = false; const bool nc = false; \
bool plusminush = false; [[maybe_unused]] const bool of = true; \
bool plusminusv = false; [[maybe_unused]] const bool nc = false; \
FilterWeights<wtyp>* fwh = calculateFilterWeights<wtyp>(parm->resample.colrem, parm->caged ? 0 : 0 - parm->region.subtop, parm->caged ? srccols : parm->subrows - parm->region.subtop, \
parm->resample.colquo, 0, dstcols, reps, parm->resample.colblur, parm->resample.wf, parm->resample.operation != eWindowEvaluation_Sum, plusminush); \
FilterWeights<wtyp>* fwv = calculateFilterWeights<wtyp>(parm->resample.rowrem, parm->caged ? 0 : 0 - parm->region.intop, parm->caged ? srcrows : parm->inrows - parm->region.intop, \
@ -833,7 +833,7 @@ namespace ImageProcessingAtom
#define filterRowFetch(srcOffs, srcSize, srcSkip, dstOffs, dstSize, dstSkip) \
/* vertical stride, horizontal fetch */ \
getCxNFromStreamSwapped(srcSkip, i); \
/* getCxNFromStreamSwapped(srcSkip, i); Expands to nothing */ \
getCxNFromStream(srcSkip, i); \
getCxNFromPlane(1); \
\
@ -935,7 +935,7 @@ namespace ImageProcessingAtom
comcpyCHistogram(); \
\
/* horizontal stride, vertical store */ \
putCxNToStreamSwapped(dstSkip, o); \
/* putCxNToStreamSwapped(dstSkip, o); Expands to nothing */ \
putCxNToStream(dstSkip, o); \
putCxNToPlane(1); \
\

@ -58,9 +58,6 @@ namespace ImageProcessingAtom
// linear interpolation
FilterImage(MipGenType::triangle, MipGenEvalType::sum, 0.0f, 0.0f, m_img, dwMipDown, newImage, dstMip, NULL, NULL);
const AZ::u32 pixelCountIn = m_img->GetWidth(dstMip) * m_img->GetHeight(dstMip);
const AZ::u32 pixelCountOut = newImage->GetWidth(dstMip) * newImage->GetHeight(dstMip);
//substraction
AZ::u8* srcPixelBuf;
AZ::u32 srcPitch;

@ -87,7 +87,7 @@ namespace ImageProcessingAtom
if (dxgiFormat != DXGI_FORMAT_UNKNOWN)
{
int i = 0;
for (i; i < ePixelFormat_Count; i++)
for (; i < ePixelFormat_Count; i++)
{
const PixelFormatInfo* info = CPixelFormats::GetInstance().GetPixelFormatInfo((EPixelFormat)i);
if (static_cast<AZ::u32>(info->d3d10Format) == dxgiFormat)
@ -506,7 +506,7 @@ namespace ImageProcessingAtom
if (dxgiFormat != DXGI_FORMAT_UNKNOWN)
{
uint32_t i = 0;
for (i; i < ePixelFormat_Count; i++)
for (; i < ePixelFormat_Count; i++)
{
const PixelFormatInfo* info = CPixelFormats::GetInstance().GetPixelFormatInfo((EPixelFormat)i);
if (static_cast<uint32_t>(info->d3d10Format) == dxgiFormat)

@ -603,8 +603,6 @@ namespace ImageProcessingAtom
const bool isCompressing = isSourceFormatUncompressed ? true : false;
const EPixelFormat outputFormat = isCompressing ? destinationFormat : sourceFormat;
const uint32_t imageWidth = m_image->Get()->GetWidth(0);
const uint32_t imageHeight = m_image->Get()->GetHeight(0);
ICompressorPtr compressor = ICompressor::FindCompressor(outputFormat, m_input->m_presetSetting.m_destColorSpace, isCompressing);
// find out if the compressor has a preference to any specific colorspace

@ -241,8 +241,6 @@ namespace ImageProcessingAtom
// clone this image-object's contents
IImageObject* CImageObject::Clone(uint32_t maxMipCount) const
{
const EPixelFormat srcPixelformat = GetPixelFormat();
IImageObject* outImage = AllocateImage(maxMipCount);
AZ::u32 mips = outImage->GetMipCount();

@ -180,7 +180,7 @@ namespace ImageProcessingAtom
// Dispatch event on main thread
AZ::SystemTickBus::QueueFunction(
[
thumbnailKey, thumbnailSize,
thumbnailKey,
pixmap = QPixmap::fromImage(image.scaled(QSize(thumbnailSize, thumbnailSize), Qt::KeepAspectRatio, Qt::SmoothTransformation))
]() mutable
{

@ -154,7 +154,8 @@ namespace AZ
// Remark: for MacOS & Linux it is important to call va_start again before
// each call to azvsnprintf. Not required for Windows.
va_start(args, format);
count = azvscprintf(format, args) + 1; // vscprintf returns a size that doesn't include the null character.
count = azvscprintf(format, args);
count += 1; // vscprintf returns a size that doesn't include the null character.
va_end(args);
biggerData.reset(new char[count]);

@ -517,7 +517,7 @@ namespace AZ
{
// Search the function name into the list of valid entry points into the shader.
auto findId =
AZStd::find_if(shaderEntryPoints.begin(), shaderEntryPoints.end(), [&functionName, &mask](const auto& item) {
AZStd::find_if(shaderEntryPoints.begin(), shaderEntryPoints.end(), [&functionName](const auto& item) {
return item.first == functionName;
});

@ -959,7 +959,6 @@ namespace AZ
size_t numInfluencesAdded = 0;
for (const auto& skinData : sourceMesh.m_skinData)
{
const size_t numJoints = skinData->GetBoneCount();
const AZ::u32 controlPointIndex = sourceMeshData->GetControlPointIndex(static_cast<int>(vertexIndex));
const size_t numSkinInfluences = skinData->GetLinkCount(controlPointIndex);

@ -149,8 +149,6 @@ namespace AZ::RPI
const float tolerance = CalcPositionDeltaTolerance(sourceMesh);
AZ::Aabb deltaPositionAabb = AZ::Aabb::CreateNull();
const uint32_t numFaces = blendShapeData->GetFaceCount();
AZStd::vector<PackedCompressedMorphTargetDelta>& packedCompressedMorphTargetVertexData = productMesh.m_morphTargetVertexData;
MorphTargetMetaAsset::MorphTarget metaData;

@ -616,7 +616,6 @@ namespace UnitTest
Data::Asset<RPI::BufferAsset> asset;
creator.End(asset);
bufferInfo.m_bufferDescriptor.m_byteCount;
Data::Instance<RPI::Buffer> bufferInst = RPI::Buffer::FindOrCreate(asset);
ASSERT_NE(bufferInst.get(), nullptr);

@ -105,7 +105,7 @@ namespace UnitTest
{
EXPECT_FALSE(m_disabled);
AZStd::for_each(m_expectedErrors.begin(), m_expectedErrors.end(), [this](ExpectedError& expectedError) { expectedError.m_gotCount = 0; });
AZStd::for_each(m_expectedErrors.begin(), m_expectedErrors.end(), [](ExpectedError& expectedError) { expectedError.m_gotCount = 0; });
m_checked = false;
}

@ -490,7 +490,6 @@ namespace UnitTest
const uint16_t mipLevels = 1;
const uint16_t arraySize = 1;
const uint16_t pixelSize = 4;
Data::Asset<RPI::ImageMipChainAsset> mipChain;

@ -267,47 +267,47 @@ namespace UnitTest
creator.SetPropertyValue(Name{ "MyBool" }, m_testImageAsset);
});
expectCreatorError([this](MaterialAssetCreator& creator)
expectCreatorError([](MaterialAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyInt" }, 0.0f);
});
expectCreatorError([this](MaterialAssetCreator& creator)
expectCreatorError([](MaterialAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyUInt" }, -1);
});
expectCreatorError([this](MaterialAssetCreator& creator)
expectCreatorError([](MaterialAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyFloat" }, 10u);
});
expectCreatorError([this](MaterialAssetCreator& creator)
expectCreatorError([](MaterialAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyFloat2" }, 1.0f);
});
expectCreatorError([this](MaterialAssetCreator& creator)
expectCreatorError([](MaterialAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyFloat3" }, AZ::Vector4{});
});
expectCreatorError([this](MaterialAssetCreator& creator)
expectCreatorError([](MaterialAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyFloat4" }, AZ::Vector3{});
});
expectCreatorError([this](MaterialAssetCreator& creator)
expectCreatorError([](MaterialAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyColor" }, MaterialPropertyValue(false));
});
expectCreatorError([this](MaterialAssetCreator& creator)
expectCreatorError([](MaterialAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyImage" }, true);
});
expectCreatorError([this](MaterialAssetCreator& creator)
expectCreatorError([](MaterialAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyEnum" }, -1);
});

@ -566,7 +566,7 @@ namespace UnitTest
// We use local functions to easily start a new MaterialAssetCreator for each test case because
// the AssetCreator would just skip subsequent operations after the first failure is detected.
auto expectError = [this](AZStd::function<void(MaterialSourceData& materialSourceData)> setOneBadInput, [[maybe_unused]] uint32_t expectedAsserts = 2)
auto expectError = [](AZStd::function<void(MaterialSourceData& materialSourceData)> setOneBadInput, [[maybe_unused]] uint32_t expectedAsserts = 2)
{
MaterialSourceData sourceData;
@ -583,7 +583,7 @@ namespace UnitTest
EXPECT_FALSE(materialAssetOutcome.IsSuccess());
};
auto expectWarning = [this](AZStd::function<void(MaterialSourceData& materialSourceData)> setOneBadInput, [[maybe_unused]] uint32_t expectedAsserts = 1)
auto expectWarning = [](AZStd::function<void(MaterialSourceData& materialSourceData)> setOneBadInput, [[maybe_unused]] uint32_t expectedAsserts = 1)
{
MaterialSourceData sourceData;

@ -413,7 +413,7 @@ namespace UnitTest
EXPECT_EQ(1, creator.GetErrorCount());
};
auto expectCreatorWarning = [this](AZStd::function<void(MaterialTypeAssetCreator& creator)> passBadInput)
auto expectCreatorWarning = [](AZStd::function<void(MaterialTypeAssetCreator& creator)> passBadInput)
{
MaterialTypeAssetCreator creator;
creator.Begin(Uuid::CreateRandom());
@ -442,47 +442,47 @@ namespace UnitTest
creator.SetPropertyValue(Name{ "MyBool" }, m_testImageAsset);
});
expectCreatorError([this](MaterialTypeAssetCreator& creator)
expectCreatorError([](MaterialTypeAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyInt" }, 0.0f);
});
expectCreatorError([this](MaterialTypeAssetCreator& creator)
expectCreatorError([](MaterialTypeAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyUInt" }, -1);
});
expectCreatorError([this](MaterialTypeAssetCreator& creator)
expectCreatorError([](MaterialTypeAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyFloat" }, 10u);
});
expectCreatorError([this](MaterialTypeAssetCreator& creator)
expectCreatorError([](MaterialTypeAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyFloat2" }, 1.0f);
});
expectCreatorError([this](MaterialTypeAssetCreator& creator)
expectCreatorError([](MaterialTypeAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyFloat3" }, AZ::Vector4{});
});
expectCreatorError([this](MaterialTypeAssetCreator& creator)
expectCreatorError([](MaterialTypeAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyFloat4" }, AZ::Vector3{});
});
expectCreatorError([this](MaterialTypeAssetCreator& creator)
expectCreatorError([](MaterialTypeAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyColor" }, MaterialPropertyValue(false));
});
expectCreatorError([this](MaterialTypeAssetCreator& creator)
expectCreatorError([](MaterialTypeAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyImage" }, true);
});
expectCreatorError([this](MaterialTypeAssetCreator& creator)
expectCreatorError([](MaterialTypeAssetCreator& creator)
{
creator.SetPropertyValue(Name{ "MyEnum" }, -1);
});

@ -783,7 +783,6 @@ namespace UnitTest
const uint32_t vertexCount = 36;
const uint32_t vertexSize = sizeof(float) * 3;
const uint32_t vertexBufferSize = vertexCount * vertexSize;
RHI::BufferViewDescriptor validStreamBufferViewDescriptor =
RHI::BufferViewDescriptor::CreateStructured(0, vertexCount, vertexSize);

@ -160,8 +160,6 @@ namespace AtomToolsFramework
QElapsedTimer m_renderTimer;
// The time of the last recorded tick event from the system tick bus.
AZ::ScriptTimePoint m_time;
// Whether the Viewport is currently hiding and capturing the cursor position.
bool m_capturingCursor = false;
// The viewport settings (e.g. grid snapping, grid size) for this viewport.
const AzToolsFramework::ViewportInteraction::ViewportSettings* m_viewportSettings = nullptr;
// Maps our internal Qt events into AzFramework InputChannels for our ViewportControllerList.

@ -125,7 +125,7 @@ namespace MaterialEditor
QDesktopServices::openUrl(QUrl::fromLocalFile(entry->GetFullPath().c_str()));
});
menu->addAction("Duplicate...", [entry, caller]()
menu->addAction("Duplicate...", [entry]()
{
const QFileInfo duplicateFileInfo(AtomToolsFramework::GetDuplicationFileInfo(entry->GetFullPath().c_str()));
if (!duplicateFileInfo.absoluteFilePath().isEmpty())
@ -156,7 +156,7 @@ namespace MaterialEditor
AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Events::OpenDocument, entry->GetFullPath());
});
menu->addAction("Duplicate...", [entry, caller]()
menu->addAction("Duplicate...", [entry]()
{
const QFileInfo duplicateFileInfo(AtomToolsFramework::GetDuplicationFileInfo(entry->GetFullPath().c_str()));
if (!duplicateFileInfo.absoluteFilePath().isEmpty())
@ -285,7 +285,7 @@ namespace MaterialEditor
});
// add get latest action
m_getLatestAction = sourceControlMenu->addAction("Get Latest", [path, this]()
m_getLatestAction = sourceControlMenu->addAction("Get Latest", [path]()
{
SourceControlCommandBus::Broadcast(&SourceControlCommandBus::Events::RequestLatest, path.c_str(),
[](bool, const SourceControlFileInfo&) {});

@ -304,7 +304,7 @@ namespace MaterialEditor
}
}, QKeySequence::New);
m_actionOpen = m_menuFile->addAction("&Open...", [this]() {
m_actionOpen = m_menuFile->addAction("&Open...", []() {
const AZStd::vector<AZ::Data::AssetType> assetTypes = { azrtti_typeid<AZ::RPI::MaterialAsset>() };
const AZStd::string filePath = AtomToolsFramework::GetOpenFileInfo(assetTypes).absoluteFilePath().toUtf8().constData();
if (!filePath.empty())
@ -369,7 +369,7 @@ namespace MaterialEditor
AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Events::CloseDocument, documentId);
}, QKeySequence::Close);
m_actionCloseAll = m_menuFile->addAction("Close All", [this]() {
m_actionCloseAll = m_menuFile->addAction("Close All", []() {
AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Broadcast(&AtomToolsFramework::AtomToolsDocumentSystemRequestBus::Events::CloseAllDocuments);
});
@ -436,7 +436,7 @@ namespace MaterialEditor
SetDockWidgetVisible(label, !IsDockWidgetVisible(label));
});
m_actionConsole = m_menuView->addAction("&Console", [this]() {
m_actionConsole = m_menuView->addAction("&Console", []() {
});
m_actionPythonTerminal = m_menuView->addAction("Python &Terminal", [this]() {
@ -471,7 +471,7 @@ namespace MaterialEditor
dialog.exec();
});
m_actionAbout = m_menuHelp->addAction("&About...", [this]() {
m_actionAbout = m_menuHelp->addAction("&About...", []() {
});
}

@ -214,7 +214,7 @@ namespace AZ
groupNameId.c_str()));
auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget(
&group, &group, group.TYPEINFO_Uuid(), this, this, saveStateKey,
[this](const AzToolsFramework::InstanceDataNode* source, const AzToolsFramework::InstanceDataNode* target) {
[](const AzToolsFramework::InstanceDataNode* source, const AzToolsFramework::InstanceDataNode* target) {
AZ_UNUSED(source);
const AtomToolsFramework::DynamicProperty* property = AtomToolsFramework::FindDynamicPropertyForInstanceDataNode(target);
return property && AtomToolsFramework::ArePropertyValuesEqual(property->GetValue(), property->GetConfig().m_parentValue);
@ -267,7 +267,7 @@ namespace AZ
groupNameId.c_str()));
auto propertyGroupWidget = new AtomToolsFramework::InspectorPropertyGroupWidget(
&group, &group, group.TYPEINFO_Uuid(), this, this, saveStateKey,
[this](const AzToolsFramework::InstanceDataNode* source, const AzToolsFramework::InstanceDataNode* target) {
[](const AzToolsFramework::InstanceDataNode* source, const AzToolsFramework::InstanceDataNode* target) {
AZ_UNUSED(source);
const AtomToolsFramework::DynamicProperty* property = AtomToolsFramework::FindDynamicPropertyForInstanceDataNode(target);
return property && AtomToolsFramework::ArePropertyValuesEqual(property->GetValue(), property->GetConfig().m_parentValue);

Loading…
Cancel
Save