Merge branch 'development' into cmake/win_fix_warn_4296

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-20 11:18:43 -07:00
116 changed files with 4638 additions and 4173 deletions
@@ -675,14 +675,14 @@ void AzAssetBrowserRequestHandler::OpenAssetInAssociatedEditor(const AZ::Data::A
firstValidOpener = &openerDetails;
}
// bind a callback such that when the menu item is clicked, it sets that as the opener to use.
menu.addAction(openerDetails.m_iconToUse, QObject::tr(openerDetails.m_displayText.c_str()), mainWindow, AZStd::bind(switchToOpener, &openerDetails));
menu.addAction(openerDetails.m_iconToUse, QObject::tr(openerDetails.m_displayText.c_str()), mainWindow, [switchToOpener, details = &openerDetails] { return switchToOpener(details); });
}
}
if (numValidOpeners > 1) // more than one option was added
{
menu.addSeparator();
menu.addAction(QObject::tr("Cancel"), AZStd::bind(switchToOpener, nullptr)); // just something to click on to avoid doing anything.
menu.addAction(QObject::tr("Cancel"), [switchToOpener] { return switchToOpener(nullptr); }); // just something to click on to avoid doing anything.
menu.exec(QCursor::pos());
}
else if (numValidOpeners == 1)
@@ -145,7 +145,7 @@ bool UserPopupWidgetHandler::ReadValuesIntoGUI(size_t index, UserPropertyEditor*
QWidget* FloatCurveHandler::CreateGUI(QWidget *pParent)
{
CSplineCtrl *cSpline = new CSplineCtrl(pParent);
cSpline->SetUpdateCallback(AZStd::bind(&FloatCurveHandler::OnSplineChange, this, AZStd::placeholders::_1));
cSpline->SetUpdateCallback([this](CSplineCtrl* spl) { OnSplineChange(spl); });
cSpline->SetTimeRange(0, 1);
cSpline->SetValueRange(0, 1);
cSpline->SetGrid(12, 12);
@@ -172,8 +172,8 @@ ReflectedPropertyItem::ReflectedPropertyItem(ReflectedPropertyControl *control,
if (parent)
parent->AddChild(this);
m_onSetCallback = AZStd::bind(&ReflectedPropertyItem::OnVariableChange, this, AZStd::placeholders::_1);
m_onSetEnumCallback = AZStd::bind(&ReflectedPropertyItem::OnVariableEnumChange, this, AZStd::placeholders::_1);
m_onSetCallback = [this](IVariable* var) { OnVariableChange(var); };
m_onSetEnumCallback = [this](IVariable* var) { OnVariableEnumChange(var); };
}
ReflectedPropertyItem::~ReflectedPropertyItem()
@@ -37,7 +37,7 @@ namespace UnitTest
m_inputChannelMapper = AZStd::make_unique<AzToolsFramework::QtEventToAzInputMapper>(m_rootWidget.get(), TestViewportId);
}
void TearDown()
void TearDown() override
{
m_inputChannelMapper.reset();
@@ -24,10 +24,10 @@ namespace UnitTest
void Disconnect();
// EditorInteractionSystemViewportSelectionRequestBus overrides ...
void SetHandler(const AzToolsFramework::ViewportSelectionRequestsBuilderFn& interactionRequestsBuilder);
void SetDefaultHandler();
bool InternalHandleMouseViewportInteraction(const MouseInteractionEvent& mouseInteraction);
bool InternalHandleMouseManipulatorInteraction(const MouseInteractionEvent& mouseInteraction);
void SetHandler(const AzToolsFramework::ViewportSelectionRequestsBuilderFn& interactionRequestsBuilder) override;
void SetDefaultHandler() override;
bool InternalHandleMouseViewportInteraction(const MouseInteractionEvent& mouseInteraction) override;
bool InternalHandleMouseManipulatorInteraction(const MouseInteractionEvent& mouseInteraction) override;
AZStd::function<bool(const MouseInteractionEvent& mouseInteraction)> m_internalHandleMouseViewportInteraction;
AZStd::function<bool(const MouseInteractionEvent& mouseInteraction)> m_internalHandleMouseManipulatorInteraction;
@@ -92,7 +92,7 @@ namespace UnitTest
m_inputChannelMapper = AZStd::make_unique<AzToolsFramework::QtEventToAzInputMapper>(m_rootWidget.get(), TestViewportId);
}
void TearDown()
void TearDown() override
{
m_inputChannelMapper.reset();
+1 -1
View File
@@ -1767,7 +1767,7 @@ void MainWindow::RegisterOpenWndCommands()
cmdUI.tooltip = (QString("Open ") + className).toUtf8().data();
cmdUI.iconFilename = className.toUtf8().data();
GetIEditor()->GetCommandManager()->RegisterUICommand("editor", openCommandName.toUtf8().data(),
"", "", AZStd::bind(&CEditorOpenViewCommand::Execute, pCmd), cmdUI);
"", "", [pCmd] { pCmd->Execute(); }, cmdUI);
GetIEditor()->GetCommandManager()->GetUIInfo("editor", openCommandName.toUtf8().data(), cmdUI);
}
}
+2 -2
View File
@@ -1515,8 +1515,8 @@ void CBaseObject::Serialize(CObjectArchive& ar)
SetFrozen(bFrozen);
SetHidden(bHidden);
ar.SetResolveCallback(this, parentId, AZStd::bind(&CBaseObject::ResolveParent, this, AZStd::placeholders::_1 ));
ar.SetResolveCallback(this, lookatId, AZStd::bind(&CBaseObject::SetLookAt, this, AZStd::placeholders::_1));
ar.SetResolveCallback(this, parentId, [this](CBaseObject* parent) { ResolveParent(parent); });
ar.SetResolveCallback(this, lookatId, [this](CBaseObject* target) { SetLookAt(target); });
InvalidateTM(0);
SetModified(false);
+24 -21
View File
@@ -230,25 +230,25 @@ CEntityObject::CEntityObject()
m_attachmentType = eAT_Pivot;
// cache all the variable callbacks, must match order of enum defined in header
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnAreaHeightChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnAreaLightChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnAreaLightSizeChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnAreaWidthChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxHeightChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxLengthChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxProjectionChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxSizeXChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxSizeYChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxSizeZChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnBoxWidthChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnColorChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnInnerRadiusChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnOuterRadiusChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnProjectInAllDirsChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnProjectorFOVChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnProjectorTextureChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnPropertyChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.push_back(AZStd::bind(&CEntityObject::OnRadiusChange, this, AZStd::placeholders::_1));
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnAreaHeightChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnAreaLightChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnAreaLightSizeChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnAreaWidthChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxHeightChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxLengthChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxProjectionChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxSizeXChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxSizeYChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxSizeZChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnBoxWidthChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnColorChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnInnerRadiusChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnOuterRadiusChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectInAllDirsChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectorFOVChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectorTextureChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnPropertyChange(var); });
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnRadiusChange(var); });
}
CEntityObject::~CEntityObject()
@@ -938,11 +938,14 @@ void CEntityObject::Serialize(CObjectArchive& ar)
eventTarget->getAttr("TargetId", targetId);
eventTarget->getAttr("Event", et.event);
eventTarget->getAttr("SourceEvent", et.sourceEvent);
m_eventTargets.push_back(et);
m_eventTargets.emplace_back(AZStd::move(et));
if (targetId != GUID_NULL)
{
using namespace AZStd::placeholders;
ar.SetResolveCallback(this, targetId, AZStd::bind(&CEntityObject::ResolveEventTarget, this, _1, _2), i);
ar.SetResolveCallback(
this, targetId,
[this](CBaseObject* object, unsigned int index) { ResolveEventTarget(object, index); },
i);
}
}
}
@@ -110,7 +110,7 @@ void CTrackViewKeyPropertiesDlg::PopulateVariables()
m_wndProps->RemoveAllItems();
m_wndProps->AddVarBlock(m_pVarBlock);
m_wndProps->SetUpdateCallback(AZStd::bind(&CTrackViewKeyPropertiesDlg::OnVarChange, this, AZStd::placeholders::_1));
m_wndProps->SetUpdateCallback([this](IVariable* var) { OnVarChange(var); });
//m_wndProps->m_props.ExpandAll();
@@ -1850,7 +1850,7 @@ namespace AZ
* {
* // do any conversion of caching of the "data" here and forward this to behavior (often the reason for this is that you can't pass everything to behavior
* // plus behavior can't really handle all constructs pointer to pointer, rvalues, etc. as they don't make sense for most script environments
* int result = 0; // set the default value for your result if the behavior if there is no implmentation
* int result = 0; // set the default value for your result if the behavior if there is no implementation
* // The AZ_EBUS_BEHAVIOR_BINDER defines FN_EventName for each index. You can also cache it yourself (but it's slower), static int cacheIndex = GetFunctionIndex("OnEvent1"); and use that .
* CallResult(result, FN_OnEvent1, data); // forward to the binding (there can be none, this is why we need to always have properly set result, when there is one)
* return result; // return the result like you will in any normal EBus even with result
@@ -102,11 +102,25 @@ namespace AzFramework
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
//////////////////////////////////////////////////////////////////////////
virtual void OnTerrainDataCreateBegin() {};
virtual void OnTerrainDataCreateEnd() {};
enum TerrainDataChangedMask : uint8_t
{
None = 0b00000000,
Settings = 0b00000001,
HeightData = 0b00000010,
ColorData = 0b00000100,
SurfaceData = 0b00001000
};
virtual void OnTerrainDataDestroyBegin() {};
virtual void OnTerrainDataDestroyEnd() {};
virtual void OnTerrainDataCreateBegin() {}
virtual void OnTerrainDataCreateEnd() {}
virtual void OnTerrainDataDestroyBegin() {}
virtual void OnTerrainDataDestroyEnd() {}
virtual void OnTerrainDataChanged(
[[maybe_unused]] const AZ::Aabb& dirtyRegion, [[maybe_unused]] TerrainDataChangedMask dataChangedMask)
{
}
};
using TerrainDataNotificationBus = AZ::EBus<TerrainDataNotifications>;
@@ -1,34 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include <AzCore/EBus/EBus.h>
#include <AzCore/Math/Aabb.h>
namespace AZ
{
/**
* the EBus is used to request information about potential vegetation surfaces
*/
class HeightmapUpdateNotification
: public AZ::EBusTraits
{
public:
////////////////////////////////////////////////////////////////////////
// EBusTraits
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Multiple;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
////////////////////////////////////////////////////////////////////////
// Occurs when the terrain height map is modified.
virtual void HeightmapModified(const AZ::Aabb& bounds) = 0;
};
typedef AZ::EBus<HeightmapUpdateNotification> HeightmapUpdateNotificationBus;
}
@@ -53,7 +53,6 @@ set(FILES
HMDBus.h
VRCommon.h
StereoRendererBus.h
HeightmapUpdateNotificationBus.h
INavigationSystem.h
IMNM.h
SFunctor.h
+3
View File
@@ -3133,6 +3133,9 @@ char* CXConsole::GetCheatVarAt(uint32 nOffset)
//////////////////////////////////////////////////////////////////////////
size_t CXConsole::GetSortedVars(AZStd::vector<AZStd::string_view>& pszArray, const char* szPrefix)
{
// This method used to insert instead of push_back, so we need to clear first
pszArray.clear();
size_t iPrefixLen = szPrefix ? strlen(szPrefix) : 0;
// variables