merge from development

Signed-off-by: greerdv <greerdv@amazon.com>
This commit is contained in:
greerdv
2021-08-06 11:06:32 +01:00
301 changed files with 987 additions and 1055 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ int32 CHierarchy::FindNodeIndexByName(const char* name) const
const CHierarchy::SNode* CHierarchy::FindNode(const char* name) const
{
int32 index = FindNodeIndexByName(name);
return index < 0 ? NULL : &m_nodes[index];
return index < 0 ? nullptr : &m_nodes[index];
}
void CHierarchy::CreateFrom(IDefaultSkeleton* pIDefaultSkeleton)
+4 -4
View File
@@ -56,8 +56,8 @@ void CMapper::ClearLocations()
uint32 count = uint32(m_nodes.size());
for (uint32 i = 0; i < count; ++i)
{
m_nodes[i].position = NULL;
m_nodes[i].orientation = NULL;
m_nodes[i].position = nullptr;
m_nodes[i].orientation = nullptr;
}
m_locations.clear();
@@ -141,7 +141,7 @@ void CMapper::Map(QuatT* pResult)
}
CHierarchy::SNode* pParent = pNode->parent < 0 ?
NULL : m_hierarchy.GetNode(pNode->parent);
nullptr : m_hierarchy.GetNode(pNode->parent);
if (pParent)
{
pResult[i].t =
@@ -173,7 +173,7 @@ void CMapper::Map(QuatT* pResult)
}
CHierarchy::SNode* pParent = pNode->parent < 0 ?
NULL : m_hierarchy.GetNode(pNode->parent);
nullptr : m_hierarchy.GetNode(pNode->parent);
if (!pParent)
{
pResult[i].q = absolutes[i];
@@ -37,8 +37,8 @@ CMapperOperatorDesc::CMapperOperatorDesc(const char* name)
CMapperOperator::CMapperOperator(const char* className, uint32 positionCount, uint32 orientationCount)
{
m_className = className;
m_position.resize(positionCount, NULL);
m_orientation.resize(orientationCount, NULL);
m_position.resize(positionCount, nullptr);
m_orientation.resize(orientationCount, nullptr);
}
CMapperOperator::~CMapperOperator()
-11
View File
@@ -1,11 +0,0 @@
--- Editor/AnimationContext.cpp
+++ Editor/AnimationContext.cpp
@@ -612,7 +612,7 @@ void CAnimationContext::UpdateAnimatedLights()
return;
std::vector<CBaseObject*> entityObjects;
- GetIEditor()->GetObjectManager()->FindObjectsOfType<CEntityObject*>(entityObjects);
+ GetIEditor()->GetObjectManager()->FindObjectsOfType(&CEntityObject::staticMetaObject, entityObjects);
std::for_each(std::begin(entityObjects), std::end(entityObjects),
[this](CBaseObject *pBaseObject)
{
@@ -42,7 +42,7 @@ public:
AzToolsFramework::EditorEvents::Bus::Handler::BusConnect();
}
~ListenerForShowAssetEditorEvent()
~ListenerForShowAssetEditorEvent() override
{
AzToolsFramework::EditorEvents::Bus::Handler::BusDisconnect();
}
+3 -3
View File
@@ -20,8 +20,8 @@
// AzToolsFramework
#include <AzToolsFramework/PythonTerminal/ScriptTermDialog.h>
CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::s_pFirst = 0;
CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::s_pLast = 0;
CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::s_pFirst = nullptr;
CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::s_pLast = nullptr;
CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::GetFirst()
{
@@ -31,7 +31,7 @@ CAutoRegisterCommandHelper* CAutoRegisterCommandHelper::GetFirst()
CAutoRegisterCommandHelper::CAutoRegisterCommandHelper(void(*registerFunc)(CEditorCommandManager &))
{
m_registerFunc = registerFunc;
m_pNext = 0;
m_pNext = nullptr;
if (!s_pLast)
{
+1 -1
View File
@@ -38,7 +38,7 @@ public:
void RegisterAutoCommands();
bool AddCommand(CCommand* pCommand, TPfnDeleter deleter = NULL);
bool AddCommand(CCommand* pCommand, TPfnDeleter deleter = nullptr);
bool UnregisterCommand(const char* module, const char* name);
bool RegisterUICommand(
const char* module,
+1 -1
View File
@@ -42,7 +42,7 @@ public:
CBitmapToolTip(QWidget* parent = nullptr);
virtual ~CBitmapToolTip();
BOOL Create(const RECT& rect);
bool Create(const RECT& rect);
// Attributes
public:
+3 -3
View File
@@ -29,7 +29,7 @@ CColorGradientCtrl::CColorGradientCtrl(QWidget* parent)
m_nHitKeyIndex = -1;
m_nKeyDrawRadius = 3;
m_bTracking = false;
m_pSpline = 0;
m_pSpline = nullptr;
m_fMinTime = -1;
m_fMaxTime = 1;
m_fMinValue = -1;
@@ -474,7 +474,7 @@ void CColorGradientCtrl::SetActiveKey(int nIndex)
}
/////////////////////////////////////////////////////////////////////////////
void CColorGradientCtrl::SetSpline(ISplineInterpolator* pSpline, BOOL bRedraw)
void CColorGradientCtrl::SetSpline(ISplineInterpolator* pSpline, bool bRedraw)
{
if (pSpline != m_pSpline)
{
@@ -501,7 +501,7 @@ ISplineInterpolator* CColorGradientCtrl::GetSpline()
/////////////////////////////////////////////////////////////////////////////
void CColorGradientCtrl::keyPressEvent(QKeyEvent* event)
{
BOOL bProcessed = false;
bool bProcessed = false;
if (m_nActiveKey != -1 && m_pSpline)
{
+1 -1
View File
@@ -54,7 +54,7 @@ public:
// Lock value of first and last key to be the same.
void LockFirstAndLastKeys(bool bLock) { m_bLockFirstLastKey = bLock; }
void SetSpline(ISplineInterpolator* pSpline, BOOL bRedraw = FALSE);
void SetSpline(ISplineInterpolator* pSpline, bool bRedraw = false);
ISplineInterpolator* GetSpline();
void SetTimeMarker(float fTime);
+3 -3
View File
@@ -62,14 +62,14 @@ public:
}
protected:
void highlightBlock(const QString &text)
void highlightBlock(const QString &text) override
{
auto pos = -1;
QTextCharFormat myClassFormat;
myClassFormat.setFontWeight(QFont::Bold);
myClassFormat.setBackground(Qt::yellow);
while (1)
while (true)
{
pos = text.indexOf(m_searchTerm, pos+1, Qt::CaseInsensitive);
@@ -571,7 +571,7 @@ static CVarBlock* VarBlockFromConsoleVars()
size_t cmdCount = console->GetSortedVars(&cmds[0], cmds.size());
CVarBlock* vb = new CVarBlock;
IVariable* pVariable = 0;
IVariable* pVariable = nullptr;
for (int i = 0; i < cmdCount; i++)
{
ICVar* pCVar = console->GetCVar(cmds[i]);
+4 -4
View File
@@ -19,22 +19,22 @@ CHotTrackingTreeCtrl::CHotTrackingTreeCtrl(QWidget* parent)
: QTreeWidget(parent)
{
setMouseTracking(true);
m_hHoverItem = NULL;
m_hHoverItem = nullptr;
}
void CHotTrackingTreeCtrl::mouseMoveEvent(QMouseEvent* event)
{
QTreeWidgetItem* hItem = itemAt(event->pos());
if (m_hHoverItem != NULL)
if (m_hHoverItem != nullptr)
{
QFont font = m_hHoverItem->font(0);
font.setBold(false);
m_hHoverItem->setFont(0, font);
m_hHoverItem = NULL;
m_hHoverItem = nullptr;
}
if (hItem != NULL)
if (hItem != nullptr)
{
QFont font = hItem->font(0);
font.setBold(true);
@@ -27,7 +27,7 @@ void ReflectedPropertiesPanel::DeleteVars()
{
ClearVarBlock();
m_updateCallbacks.clear();
m_varBlock = 0;
m_varBlock = nullptr;
}
//////////////////////////////////////////////////////////////////////////
@@ -198,7 +198,7 @@ void ReflectedPropertyControl::CreateItems(XmlNodeRef node)
void ReflectedPropertyControl::CreateItems(XmlNodeRef node, CVarBlockPtr& outBlockPtr, IVariable::OnSetCallback* func, bool splitCamelCaseIntoWords)
{
SelectItem(0);
SelectItem(nullptr);
outBlockPtr = new CVarBlock;
for (size_t i = 0, iGroupCount(node->getChildCount()); i < iGroupCount; ++i)
@@ -505,7 +505,7 @@ void ReflectedPropertyControl::RemoveAllItems()
void ReflectedPropertyControl::ClearVarBlock()
{
RemoveAllItems();
m_pVarBlock = 0;
m_pVarBlock = nullptr;
}
void ReflectedPropertyControl::RecreateAllItems()
@@ -688,11 +688,11 @@ void ReflectedPropertyControl::OnItemChange(ReflectedPropertyItem *item, bool de
// callback until after the current event queue is processed, so that we aren't changing other widgets
// as a ton of them are still being created.
Qt::ConnectionType connectionType = deferCallbacks ? Qt::QueuedConnection : Qt::DirectConnection;
if (m_updateVarFunc != 0 && m_bEnableCallback)
if (m_updateVarFunc && m_bEnableCallback)
{
QMetaObject::invokeMethod(this, "DoUpdateCallback", connectionType, Q_ARG(IVariable*, item->GetVariable()));
}
if (m_updateObjectFunc != 0 && m_bEnableCallback)
if (m_updateObjectFunc && m_bEnableCallback)
{
// KDAB: This callback has same signature as DoUpdateCallback. I think the only reason there are 2 is because some
// EntityObject registers callback and some derived objects want to register their own callback. the normal UpdateCallback
@@ -709,7 +709,7 @@ void ReflectedPropertyControl::DoUpdateCallback(IVariable *var)
const bool variableStillExists = FindVariable(var);
AZ_Assert(variableStillExists, "This variable and the item containing it were destroyed during a deferred callback. Change to non-deferred callback.");
if (m_updateVarFunc == 0 || !variableStillExists)
if (!m_updateVarFunc || !variableStillExists)
{
return;
}
@@ -724,7 +724,7 @@ void ReflectedPropertyControl::DoUpdateObjectCallback(IVariable *var)
const bool variableStillExists = FindVariable(var);
AZ_Assert(variableStillExists, "This variable and the item containing it were destroyed during a deferred callback. Change to non-deferred callback.");
if (m_updateVarFunc == 0 || !variableStillExists)
if ( !m_updateVarFunc || !variableStillExists)
{
return;
}
@@ -904,7 +904,7 @@ void ReflectedPropertyControl::SetUndoCallback(UndoCallback &callback)
void ReflectedPropertyControl::ClearUndoCallback()
{
m_undoFunc = 0;
m_undoFunc = nullptr;
}
bool ReflectedPropertyControl::FindVariable(IVariable *categoryItem) const
@@ -82,7 +82,7 @@ public:
}
//helps implement ReflectedPropertyControl::ReplaceVarBlock
void ReplaceVarBlock(CVarBlock *varBlock)
void ReplaceVarBlock(CVarBlock *varBlock) override
{
m_containerVar->Clear();
UpdateCommon(m_item->GetVariable(), varBlock);
@@ -207,7 +207,7 @@ void ReflectedPropertyItem::SetVariable(IVariable *var)
ReleaseVariable();
m_pVariable = pInputVar;
assert(m_pVariable != NULL);
assert(m_pVariable != nullptr);
m_pVariable->AddOnSetCallback(&m_onSetCallback);
m_pVariable->AddOnSetEnumCallback(&m_onSetEnumCallback);
@@ -332,7 +332,7 @@ void ReflectedPropertyItem::RemoveAllChildren()
{
for (int i = 0; i < m_childs.size(); i++)
{
m_childs[i]->m_parent = 0;
m_childs[i]->m_parent = nullptr;
}
m_childs.clear();
@@ -473,7 +473,7 @@ void ReflectedPropertyItem::ReleaseVariable()
m_pVariable->RemoveOnSetCallback(&m_onSetCallback);
m_pVariable->RemoveOnSetEnumCallback(&m_onSetEnumCallback);
}
m_pVariable = 0;
m_pVariable = nullptr;
delete m_reflectedVarAdapter;
m_reflectedVarAdapter = nullptr;
}
@@ -122,7 +122,7 @@ protected:
public:
//! Get number of child nodes.
int GetChildCount() const { return m_childs.size(); };
int GetChildCount() const { return static_cast<int>(m_childs.size()); };
//! Get Child by id.
ReflectedPropertyItem* GetChild(int index) const { return m_childs[index]; }
PropertyType GetType() const { return m_type; }
@@ -473,7 +473,7 @@ void ReflectedVarUserAdapter::SyncReflectedVarToIVar(IVariable *pVariable)
//extract the list of custom items from the IVariable user data
IVariable::IGetCustomItems* pGetCustomItems = static_cast<IVariable::IGetCustomItems*> (pVariable->GetUserData().value<void *>());
if (pGetCustomItems != 0)
if (pGetCustomItems != nullptr)
{
std::vector<IVariable::IGetCustomItems::SItem> items;
QString dlgTitle;
+5 -5
View File
@@ -30,7 +30,7 @@ CSplineCtrl::CSplineCtrl(QWidget* parent)
m_nHitKeyIndex = -1;
m_nKeyDrawRadius = 3;
m_bTracking = false;
m_pSpline = 0;
m_pSpline = nullptr;
m_gridX = 10;
m_gridY = 10;
m_fMinTime = -1;
@@ -40,7 +40,7 @@ CSplineCtrl::CSplineCtrl(QWidget* parent)
m_fTooltipScaleX = 1;
m_fTooltipScaleY = 1;
m_bLockFirstLastKey = false;
m_pTimelineCtrl = 0;
m_pTimelineCtrl = nullptr;
m_bSelectedKeys.reserve(0);
@@ -417,7 +417,7 @@ void CSplineCtrl::SetActiveKey(int nIndex)
}
/////////////////////////////////////////////////////////////////////////////
void CSplineCtrl::SetSpline(ISplineInterpolator* pSpline, BOOL bRedraw)
void CSplineCtrl::SetSpline(ISplineInterpolator* pSpline, bool bRedraw)
{
if (pSpline != m_pSpline)
{
@@ -596,7 +596,7 @@ CSplineCtrl::EHitCode CSplineCtrl::HitTest(const QPoint& point)
///////////////////////////////////////////////////////////////////////////////
void CSplineCtrl::StartTracking()
{
m_bTracking = TRUE;
m_bTracking = true;
GetIEditor()->BeginUndo();
@@ -674,7 +674,7 @@ void CSplineCtrl::StopTracking()
GetIEditor()->AcceptUndo("Spline Move");
m_bTracking = FALSE;
m_bTracking = false;
}
//////////////////////////////////////////////////////////////////////////
+1 -1
View File
@@ -59,7 +59,7 @@ public:
// Lock value of first and last key to be the same.
void LockFirstAndLastKeys(bool bLock) { m_bLockFirstLastKey = bLock; }
void SetSpline(ISplineInterpolator* pSpline, BOOL bRedraw = FALSE);
void SetSpline(ISplineInterpolator* pSpline, bool bRedraw = false);
ISplineInterpolator* GetSpline();
void SetTimeMarker(float fTime);
+38 -38
View File
@@ -69,8 +69,8 @@ protected:
AbstractSplineWidget* pCtrl = FindControl(m_pCtrl);
m_splineEntries.resize(m_splineEntries.size() + 1);
SplineEntry& entry = m_splineEntries.back();
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : 0);
entry.id = (pSplineSet ? pSplineSet->GetIDFromSpline(pSpline) : 0);
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : nullptr);
entry.id = (pSplineSet ? pSplineSet->GetIDFromSpline(pSpline) : nullptr);
entry.pSpline = pSpline;
const int numKeys = pSpline->GetKeyCount();
@@ -81,10 +81,10 @@ protected:
}
}
virtual int GetSize() { return sizeof(*this); }
virtual QString GetDescription() { return "UndoSplineCtrlEx"; };
int GetSize() override { return sizeof(*this); }
QString GetDescription() override { return "UndoSplineCtrlEx"; };
virtual void Undo(bool bUndo)
void Undo(bool bUndo) override
{
AbstractSplineWidget* pCtrl = FindControl(m_pCtrl);
if (pCtrl)
@@ -104,7 +104,7 @@ protected:
}
}
virtual void Redo()
void Redo() override
{
AbstractSplineWidget* pCtrl = FindControl(m_pCtrl);
if (pCtrl)
@@ -134,7 +134,7 @@ private:
void SerializeSplines(_smart_ptr<ISplineBackup> SplineEntry::* backup, bool bLoading)
{
AbstractSplineWidget* pCtrl = FindControl(m_pCtrl);
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : 0);
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : nullptr);
for (auto it = m_splineEntries.begin(); it != m_splineEntries.end(); ++it)
{
SplineEntry& entry = *it;
@@ -157,19 +157,19 @@ private:
}
public:
typedef std::list<AbstractSplineWidget*> CSplineCtrls;
using CSplineCtrls = std::list<AbstractSplineWidget *>;
static AbstractSplineWidget* FindControl(AbstractSplineWidget* pCtrl)
{
if (!pCtrl)
{
return 0;
return nullptr;
}
auto iter = std::find(s_activeCtrls.begin(), s_activeCtrls.end(), pCtrl);
if (iter == s_activeCtrls.end())
{
return 0;
return nullptr;
}
return *iter;
@@ -193,10 +193,10 @@ public:
static CSplineCtrls s_activeCtrls;
virtual bool IsSelectionChanged() const
bool IsSelectionChanged() const override
{
AbstractSplineWidget* pCtrl = FindControl(m_pCtrl);
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : 0);
ISplineSet* pSplineSet = (pCtrl ? pCtrl->m_pSplineSet : nullptr);
for (auto it = m_splineEntries.begin(); it != m_splineEntries.end(); ++it)
{
@@ -256,11 +256,11 @@ SplineWidget::~SplineWidget()
AbstractSplineWidget::AbstractSplineWidget()
: m_defaultKeyTangentType(SPLINE_KEY_TANGENT_NONE)
{
m_pTimelineCtrl = 0;
m_pTimelineCtrl = nullptr;
m_totalSplineCount = 0;
m_pHitSpline = 0;
m_pHitDetailSpline = 0;
m_pHitSpline = nullptr;
m_pHitDetailSpline = nullptr;
m_nHitKeyIndex = -1;
m_nHitDimension = -1;
m_bHitIncomingHandle = true;
@@ -301,7 +301,7 @@ AbstractSplineWidget::AbstractSplineWidget()
m_boLeftMouseButtonDown = false;
m_pSplineSet = 0;
m_pSplineSet = nullptr;
m_controlAmplitude = false;
@@ -1633,7 +1633,7 @@ void SplineWidget::wheelEvent(QWheelEvent* event)
void SplineWidget::keyPressEvent(QKeyEvent* e)
{
BOOL bProcessed = false;
bool bProcessed = false;
switch (e->key())
{
@@ -1780,7 +1780,7 @@ void AbstractSplineWidget::SetHorizontalExtent([[maybe_unused]] int min, [[maybe
//si.nPage = max(0,m_rcClient.Width() - m_leftOffset*2);
//si.nPage = 1;
//si.nPage = 1;
SetScrollInfo( SB_HORZ,&si,TRUE );
SetScrollInfo( SB_HORZ,&si,true );
*/
}
@@ -1792,7 +1792,7 @@ ISplineInterpolator* AbstractSplineWidget::HitSpline(const QPoint& point)
return m_pHitSpline;
}
return NULL;
return nullptr;
}
//////////////////////////////////////////////////////////////////////////////
@@ -1806,8 +1806,8 @@ AbstractSplineWidget::EHitCode AbstractSplineWidget::HitTest(const QPoint& point
PointToTimeValue(point, time, val);
m_hitCode = HIT_NOTHING;
m_pHitSpline = NULL;
m_pHitDetailSpline = NULL;
m_pHitSpline = nullptr;
m_pHitDetailSpline = nullptr;
m_nHitKeyIndex = -1;
m_nHitDimension = -1;
m_bHitIncomingHandle = true;
@@ -1968,8 +1968,8 @@ void AbstractSplineWidget::StopTracking()
void AbstractSplineWidget::ScaleAmplitudeKeys(float time, float startValue, float offset)
{
//TODO: Test it in the facial animation pane and fix it...
m_pHitSpline = 0;
m_pHitDetailSpline = 0;
m_pHitSpline = nullptr;
m_pHitDetailSpline = nullptr;
m_nHitKeyIndex = -1;
m_nHitDimension = -1;
@@ -2071,8 +2071,8 @@ void AbstractSplineWidget::TimeScaleKeys(float time, float startTime, float endT
float timeScaleC = endTime - startTime * timeScaleM;
// Loop through all keys that are selected.
m_pHitSpline = 0;
m_pHitDetailSpline = 0;
m_pHitSpline = nullptr;
m_pHitDetailSpline = nullptr;
m_nHitKeyIndex = -1;
float affectedRangeMin = FLT_MAX;
@@ -2179,8 +2179,8 @@ void AbstractSplineWidget::ValueScaleKeys(float startValue, float endValue)
}
// Loop through all keys that are selected.
m_pHitSpline = 0;
m_pHitDetailSpline = 0;
m_pHitSpline = nullptr;
m_pHitDetailSpline = nullptr;
m_nHitKeyIndex = -1;
m_nHitDimension = -1;
@@ -2212,8 +2212,8 @@ void AbstractSplineWidget::ValueScaleKeys(float startValue, float endValue)
//////////////////////////////////////////////////////////////////////////
void AbstractSplineWidget::MoveSelectedKeys(Vec2 offset, bool copyKeys)
{
m_pHitSpline = 0;
m_pHitDetailSpline = 0;
m_pHitSpline = nullptr;
m_pHitDetailSpline = nullptr;
m_nHitKeyIndex = -1;
m_nHitDimension = -1;
@@ -2275,8 +2275,8 @@ void AbstractSplineWidget::RemoveKey(ISplineInterpolator* pSpline, int nKey)
SendNotifyEvent(SPLN_BEFORE_CHANGE);
m_pHitSpline = 0;
m_pHitDetailSpline = 0;
m_pHitSpline = nullptr;
m_pHitDetailSpline = nullptr;
m_nHitKeyIndex = -1;
if (nKey != -1)
{
@@ -2294,8 +2294,8 @@ void AbstractSplineWidget::RemoveSelectedKeys()
SendNotifyEvent(SPLN_BEFORE_CHANGE);
m_pHitSpline = 0;
m_pHitDetailSpline = 0;
m_pHitSpline = nullptr;
m_pHitDetailSpline = nullptr;
m_nHitKeyIndex = -1;
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
@@ -2558,11 +2558,11 @@ public:
};
void AbstractSplineWidget::DuplicateSelectedKeys()
{
m_pHitSpline = 0;
m_pHitDetailSpline = 0;
m_pHitSpline = nullptr;
m_pHitDetailSpline = nullptr;
m_nHitKeyIndex = -1;
typedef std::vector<CKeyCopyInfo> KeysToAddContainer;
using KeysToAddContainer = std::vector<CKeyCopyInfo>;
KeysToAddContainer keysToInsert;
for (int splineIndex = 0, splineCount = m_splines.size(); splineIndex < splineCount; ++splineIndex)
{
@@ -2600,7 +2600,7 @@ void AbstractSplineWidget::ZeroAll()
{
GetIEditor()->BeginUndo();
typedef std::vector<ISplineInterpolator*> SplineContainer;
using SplineContainer = std::vector<ISplineInterpolator *>;
SplineContainer splines;
for (int splineIndex = 0; splineIndex < int(m_splines.size()); ++splineIndex)
{
@@ -2632,7 +2632,7 @@ void AbstractSplineWidget::KeyAll()
{
GetIEditor()->BeginUndo();
typedef std::vector<ISplineInterpolator*> SplineContainer;
using SplineContainer = std::vector<ISplineInterpolator *>;
SplineContainer splines;
for (int splineIndex = 0; splineIndex < int(m_splines.size()); ++splineIndex)
{
+1 -1
View File
@@ -58,7 +58,7 @@ TimelineWidget::TimelineWidget(QWidget* parent /* = nullptr */)
m_bIgnoreSetTime = false;
m_pKeyTimeSet = 0;
m_pKeyTimeSet = nullptr;
m_markerStyle = MARKER_STYLE_SECONDS;
m_fps = 30.0f;
+2 -2
View File
@@ -80,12 +80,12 @@ namespace
, m_trigger(trigger)
{}
virtual ~EditorListener()
~EditorListener() override
{
GetIEditor()->UnregisterNotifyListener(this);
}
void OnEditorNotifyEvent(EEditorNotifyEvent event)
void OnEditorNotifyEvent(EEditorNotifyEvent event) override
{
m_trigger(event);
}
+1 -1
View File
@@ -423,7 +423,7 @@ namespace Editor
{
UINT rawInputSize;
const UINT rawInputHeaderSize = sizeof(RAWINPUTHEADER);
GetRawInputData((HRAWINPUT)msg->lParam, RID_INPUT, NULL, &rawInputSize, rawInputHeaderSize);
GetRawInputData((HRAWINPUT)msg->lParam, RID_INPUT, nullptr, &rawInputSize, rawInputHeaderSize);
AZStd::array<BYTE, sizeof(RAWINPUT)> rawInputBytesArray;
LPBYTE rawInputBytes = rawInputBytesArray.data();
+1 -1
View File
@@ -26,7 +26,7 @@ class EditorCoreTestEnvironment
public:
AZ_TEST_CLASS_ALLOCATOR(EditorCoreTestEnvironment);
virtual ~EditorCoreTestEnvironment()
~EditorCoreTestEnvironment() override
{
}
+1 -1
View File
@@ -20,7 +20,7 @@ AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
CErrorsDlg::CErrorsDlg(QWidget* pParent /*=NULL*/)
CErrorsDlg::CErrorsDlg(QWidget* pParent /*=nullptr*/)
: QDialog(pParent)
, ui(new Ui::CErrorsDlg)
{
+1 -1
View File
@@ -159,7 +159,7 @@ void CPythonScriptsDialog::OnExecute()
QList<QStandardItem*> selectedItems = ui->treeView->GetSelectedItems();
QStandardItem* selectedItem = selectedItems.empty() ? nullptr : selectedItems.first();
if (selectedItem == NULL)
if (selectedItem == nullptr)
{
return;
}
+3 -3
View File
@@ -258,19 +258,19 @@ public:
m_relCameraRotX = 0;
m_relCameraRotZ = 0;
uint32 numSample6 = m_arrAnimatedCharacterPath.size();
uint32 numSample6 = static_cast<uint32>(m_arrAnimatedCharacterPath.size());
for (uint32 i = 0; i < numSample6; i++)
{
m_arrAnimatedCharacterPath[i] = Vec3(ZERO);
}
numSample6 = m_arrSmoothEntityPath.size();
numSample6 = static_cast<uint32>(m_arrSmoothEntityPath.size());
for (uint32 i = 0; i < numSample6; i++)
{
m_arrSmoothEntityPath[i] = Vec3(ZERO);
}
uint32 numSample7 = m_arrRunStrafeSmoothing.size();
uint32 numSample7 = static_cast<uint32>(m_arrRunStrafeSmoothing.size());
for (uint32 i = 0; i < numSample7; i++)
{
m_arrRunStrafeSmoothing[i] = 0;
+1 -1
View File
@@ -105,7 +105,7 @@ public:
bool IsEmpty() const;
//! Get number of contained error records.
int GetErrorCount() const { return m_errors.size(); };
int GetErrorCount() const { return static_cast<int>(m_errors.size()); };
//! Get access to indexed error record.
CErrorRecord& GetError(int i);
//! Clear all error records.
+11 -11
View File
@@ -96,7 +96,7 @@ Export::CObject::CObject(const char* pName)
cameraTargetNodeName[0] = '\0';
m_pLastObject = 0;
m_pLastObject = nullptr;
}
@@ -116,14 +116,14 @@ void Export::CData::Clear()
// CExportManager
CExportManager::CExportManager()
: m_isPrecaching(false)
, m_pBaseObj(0)
, m_pBaseObj(nullptr)
, m_FBXBakedExportFPS(0.0f)
, m_fScale(100.0f)
, // this scale is used by CryEngine RC
m_bAnimationExport(false)
, m_bExportLocalCoords(false)
, m_numberOfExportFrames(0)
, m_pivotEntityObject(0)
, m_pivotEntityObject(nullptr)
, m_bBakedKeysSequenceExport(true)
, m_animTimeExportPrimarySequenceCurrentTime(0.0f)
, m_animKeyTimeExport(true)
@@ -290,7 +290,7 @@ void CExportManager::ProcessEntityAnimationTrack(
const AZ::EntityId entityId, Export::CObject* pObj, AnimParamType entityTrackParamType)
{
CTrackViewAnimNode* pEntityNode = GetIEditor()->GetSequenceManager()->GetActiveAnimNode(entityId);
CTrackViewTrack* pEntityTrack = (pEntityNode ? pEntityNode->GetTrackForParameter(entityTrackParamType) : 0);
CTrackViewTrack* pEntityTrack = (pEntityNode ? pEntityNode->GetTrackForParameter(entityTrackParamType) : nullptr);
if (!pEntityTrack)
{
@@ -397,7 +397,7 @@ void CExportManager::AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh
else
{
Export::CMesh* pMesh = new Export::CMesh();
if (meshDesc.m_nFaceCount == 0 && meshDesc.m_nIndexCount != 0 && meshDesc.m_pIndices != 0)
if (meshDesc.m_nFaceCount == 0 && meshDesc.m_nIndexCount != 0 && meshDesc.m_pIndices != nullptr)
{
const vtx_idx* pIndices = &meshDesc.m_pIndices[0];
int nTris = meshDesc.m_nIndexCount / 3;
@@ -431,7 +431,7 @@ void CExportManager::AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh
bool CExportManager::AddStatObj(Export::CObject* pObj, IStatObj* pStatObj, Matrix34A* pTm)
{
IIndexedMesh* pIndMesh = 0;
IIndexedMesh* pIndMesh = nullptr;
if (pStatObj->GetSubObjectCount())
{
@@ -440,7 +440,7 @@ bool CExportManager::AddStatObj(Export::CObject* pObj, IStatObj* pStatObj, Matri
IStatObj::SSubObject* pSubObj = pStatObj->GetSubObject(i);
if (pSubObj && pSubObj->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj)
{
pIndMesh = 0;
pIndMesh = nullptr;
if (m_isOccluder)
{
if (pSubObj->pStatObj->GetLodObject(2))
@@ -542,7 +542,7 @@ bool CExportManager::AddObject(CBaseObject* pBaseObj)
if (m_isPrecaching)
{
AddMeshes(0);
AddMeshes(nullptr);
return true;
}
@@ -554,7 +554,7 @@ bool CExportManager::AddObject(CBaseObject* pBaseObj)
m_objectMap[pBaseObj] = int(m_data.m_objects.size() - 1);
AddMeshes(pObj);
m_pBaseObj = 0;
m_pBaseObj = nullptr;
return true;
}
@@ -678,7 +678,7 @@ bool CExportManager::ProcessObjectsForExport()
for (size_t objectID = 0; objectID < m_data.m_objects.size(); ++objectID)
{
Export::CObject* pObj2 = m_data.m_objects[objectID];
CBaseObject* pObject = 0;
CBaseObject* pObject = nullptr;
if (QString::compare(pObj2->name, kPrimaryCameraName) == 0)
{
@@ -983,7 +983,7 @@ bool CExportManager::AddObjectsFromSequence(CTrackViewSequence* pSequence, XmlNo
{
if (pSubSequence && !pSubSequence->IsDisabled())
{
XmlNodeRef subSeqNode = 0;
XmlNodeRef subSeqNode = nullptr;
if (!seqNode)
{
+1 -1
View File
@@ -67,7 +67,7 @@ bool COBJExporter::ExportToFile(const char* filename, const Export::IData* pExpo
while (nParent >= 0 && nParent < pExportData->GetObjectCount())
{
const Export::Object* pParentObj = pExportData->GetObject(nParent);
assert(NULL != pParentObj);
assert(nullptr != pParentObj);
Vec3 pos2(pParentObj->pos.x, pParentObj->pos.y, pParentObj->pos.z);
Quat rot2(pParentObj->rot.w, pParentObj->rot.v.x, pParentObj->rot.v.y, pParentObj->rot.v.z);
+11 -11
View File
@@ -19,13 +19,13 @@
//////////////////////////////////////////////////////////////////////////
CTriMesh::CTriMesh()
{
pFaces = NULL;
pVertices = NULL;
pWSVertices = NULL;
pUV = NULL;
pColors = NULL;
pEdges = NULL;
pWeights = NULL;
pFaces = nullptr;
pVertices = nullptr;
pWSVertices = nullptr;
pUV = nullptr;
pColors = nullptr;
pEdges = nullptr;
pWeights = nullptr;
nFacesCount = 0;
nVertCount = 0;
@@ -67,7 +67,7 @@ void CTriMesh::ReallocStream(int stream, int nNewCount)
{
return; // Stream already have required size.
}
void* pStream = 0;
void* pStream = nullptr;
int nElementSize = 0;
GetStreamInfo(stream, pStream, nElementSize);
pStream = ReAllocElements(pStream, nNewCount, nElementSize);
@@ -256,7 +256,7 @@ void CTriMesh::SharePositions()
std::vector<int> arrHashTable[256];
CTriVertex* pNewVerts = new CTriVertex[GetVertexCount()];
SMeshColor* pNewColors = 0;
SMeshColor* pNewColors = nullptr;
if (pColors)
{
pNewColors = new SMeshColor[GetVertexCount()];
@@ -433,8 +433,8 @@ void CTriMesh::UpdateIndexedMesh(IIndexedMesh* pIndexedMesh) const
//////////////////////////////////////////////////////////////////////////
void CTriMesh::CopyStream(CTriMesh& fromMesh, int stream)
{
void* pTrgStream = 0;
void* pSrcStream = 0;
void* pTrgStream = nullptr;
void* pSrcStream = nullptr;
int nElemSize = 0;
fromMesh.GetStreamInfo(stream, pSrcStream, nElemSize);
if (pSrcStream)
+3 -3
View File
@@ -334,12 +334,12 @@ struct IAssetItem
virtual void OnEndPreview() = 0;
// Description:
// If the asset has a special preview panel with utility controls, to be placed at the top of the Preview window, it can return an child dialog window
// otherwise it can return NULL, if no panel is available
// otherwise it can return nullptr, if no panel is available
// Arguments:
// pParentWnd - a valid CDialog*, or NULL
// pParentWnd - a valid CDialog*, or nullptr
// Return Value:
// A valid child dialog window handle, if this asset wants to have a custom panel in the top side of the Asset Preview window,
// otherwise it can return NULL, if no panel is available
// otherwise it can return nullptr, if no panel is available
// See Also:
// OnBeginPreview(), OnEndPreview()
virtual QWidget* GetCustomPreviewPanelHeader(QWidget* pParentWnd) = 0;
+9 -2
View File
@@ -186,8 +186,15 @@ struct IFileUtil
virtual ECopyTreeResult CopyTree(const QString& strSourceDirectory, const QString& strTargetDirectory, bool boRecurse = true, bool boConfirmOverwrite = false) = 0;
//////////////////////////////////////////////////////////////////////////
// @param LPPROGRESS_ROUTINE pfnProgress - called by the system to notify of file copy progress
// @param LPBOOL pbCancel - when the contents of this BOOL are set to TRUE, the system cancels the copy operation
/**
* @brief CopyFile
* @param strSourceFile
* @param strTargetFile
* @param boConfirmOverwrite
* @param pfnProgress - called by the system to notify of file copy progress
* @param pbCancel - when the contents of this bool are set to true, the system cancels the copy operation
* @return
*/
virtual ECopyTreeResult CopyFile(const QString& strSourceFile, const QString& strTargetFile, bool boConfirmOverwrite = false, ProgressRoutine pfnProgress = nullptr, bool* pbCancel = nullptr) = 0;
// As we don't have a FileUtil interface here, we have to duplicate some code :-( in order to keep
+5 -5
View File
@@ -74,12 +74,12 @@ void DisplayContext::DrawTri(const Vec3& p1, const Vec3& p2, const Vec3& p3)
void DisplayContext::DrawTriangles(const AZStd::vector<Vec3>& vertices, const ColorB& color)
{
pRenderAuxGeom->DrawTriangles(vertices.begin(), vertices.size(), color);
pRenderAuxGeom->DrawTriangles(vertices.begin(), static_cast<uint32>(vertices.size()), color);
}
void DisplayContext::DrawTrianglesIndexed(const AZStd::vector<Vec3>& vertices, const AZStd::vector<vtx_idx>& indices, const ColorB& color)
{
pRenderAuxGeom->DrawTriangles(vertices.begin(), vertices.size(), indices.begin(), indices.size(), color);
pRenderAuxGeom->DrawTriangles(vertices.begin(), static_cast<uint32>(vertices.size()), indices.begin(), static_cast<uint32_t>(indices.size()), color);
}
//////////////////////////////////////////////////////////////////////////
@@ -862,7 +862,7 @@ void DisplayContext::DrawLine(const Vec3& p1, const Vec3& p2, const QColor& rgb1
//////////////////////////////////////////////////////////////////////////
void DisplayContext::DrawLines(const AZStd::vector<Vec3>& points, const ColorF& color)
{
pRenderAuxGeom->DrawLines(points.begin(), points.size(), color, m_thickness);
pRenderAuxGeom->DrawLines(points.begin(), static_cast<uint32>(points.size()), color, m_thickness);
}
//////////////////////////////////////////////////////////////////////////
@@ -1287,8 +1287,8 @@ void DisplayContext::Flush2D()
uvs[3] = 0;
uvt[3] = 0;
int nLabels = m_textureLabels.size();
for (int i = 0; i < nLabels; i++)
const size_t nLabels = m_textureLabels.size();
for (size_t i = 0; i < nLabels; i++)
{
STextureLabel& t = m_textureLabels[i];
float w2 = t.w * 0.5f;
+2 -2
View File
@@ -163,7 +163,7 @@ public:
//////////////////////////////////////////////////////////////////////////
//! Return number of event targets of Script.
int GetEventTargetCount() const { return m_eventTargets.size(); };
int GetEventTargetCount() const { return static_cast<int>(m_eventTargets.size()); };
CEntityEventTarget& GetEventTarget(int index) { return m_eventTargets[index]; };
//! Add new event target, returns index of created event target.
//! Event targets are Always entities.
@@ -176,7 +176,7 @@ public:
// Entity Links.
//////////////////////////////////////////////////////////////////////////
//! Return number of event targets of Script.
int GetEntityLinkCount() const { return m_links.size(); };
int GetEntityLinkCount() const { return static_cast<int>(m_links.size()); };
CEntityLink& GetEntityLink(int index) { return m_links[index]; };
virtual int AddEntityLink(const QString& name, GUID targetEntityId);
virtual bool EntityLinkExists(const QString& name, GUID targetEntityId);
+1 -1
View File
@@ -70,7 +70,7 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
CBaseObject* LoadObject(const XmlNodeRef& objNode, CBaseObject* pPrevObject = NULL);
//////////////////////////////////////////////////////////////////////////
int GetLoadedObjectsCount() { return m_loadedObjects.size(); }
int GetLoadedObjectsCount() { return static_cast<int>(m_loadedObjects.size()); }
CBaseObject* GetLoadedObject(int nIndex) const { return m_loadedObjects[nIndex].pObject; }
//! If true new loaded objects will be assigned new GUIDs.
+1 -1
View File
@@ -58,7 +58,7 @@ public:
class CBaseObjectsCache
{
public:
int GetObjectCount() const { return m_objects.size(); }
int GetObjectCount() const { return static_cast<int>(m_objects.size()); }
CBaseObject* GetObject(int nIndex) const { return m_objects[nIndex]; }
void AddObject(CBaseObject* object);
+1 -1
View File
@@ -71,7 +71,7 @@ public:
//! And save resulting objects to saveTo selection.
void FilterParents();
//! Get number of child filtered objects.
int GetFilteredCount() const { return m_filtered.size(); }
int GetFilteredCount() const { return static_cast<int>(m_filtered.size()); }
CBaseObject* GetFilteredObject(int i) const { return m_filtered[i]; }
//////////////////////////////////////////////////////////////////////////
@@ -803,7 +803,7 @@ void SandboxIntegrationManager::SetupLayerContextMenu(QMenu* menu)
menu->addSeparator();
const int selectedLayerCount = layersInSelection.size();
const int selectedLayerCount = static_cast<int>(layersInSelection.size());
QString saveTitle = QObject::tr("Save layer");
if(selectedLayerCount > 1)
{
@@ -259,7 +259,7 @@ QVariant OutlinerListModel::dataForName(const QModelIndex& index, int role) cons
if (highlightTextIndex >= 0)
{
const QString BACKGROUND_COLOR{ "#707070" };
label.insert(highlightTextIndex + m_filterString.length(), "</span>");
label.insert(static_cast<int>(highlightTextIndex + m_filterString.length()), "</span>");
label.insert(highlightTextIndex, "<span style=\"background-color: " + BACKGROUND_COLOR + "\">");
}
} while(highlightTextIndex > 0);
@@ -53,7 +53,7 @@ namespace PerforceConnection
setEnabled(false);
int numSettingsToGet = m_retrievedSettings.size();
int numSettingsToGet = static_cast<int>(m_retrievedSettings.size());
auto applySettingResultFunction = [this, &numSettingsToGet](AZStd::string setting, const SourceControlSettingInfo& info) -> void
{
+1 -1
View File
@@ -13,7 +13,7 @@
QCollapsibleGroupBox::QCollapsibleGroupBox(QWidget* parent)
: QGroupBox(parent)
, m_collapsed(false)
, m_toggleButton(0)
, m_toggleButton(nullptr)
{
m_toggleButton = new QToolButton(this);
m_toggleButton->setFixedSize(16, 16);
+1 -1
View File
@@ -60,7 +60,7 @@ public:
void DrawDome(const Matrix34& worldTM, const SGizmoParameters& setup, DisplayContext& dc, AABB& objectBox);
bool HitTest(const Matrix34& worldTM, const SGizmoParameters& setup, HitContext& hc);
bool HitTestForRotationCircle(const Matrix34& worldTM, IDisplayViewport* view, const QPoint& pos, float fHitWidth, Vec3* pOutHitPos = NULL, Vec3* pOutHitNormal = NULL);
bool HitTestForRotationCircle(const Matrix34& worldTM, IDisplayViewport* view, const QPoint& pos, float fHitWidth, Vec3* pOutHitPos = nullptr, Vec3* pOutHitNormal = nullptr);
void SetHighlightAxis(int axis) { m_highlightAxis = axis; };
int GetHighlightAxis() const { return m_highlightAxis; };
@@ -546,7 +546,7 @@ bool CAxisHelper::HitTestForRotationCircle(const Matrix34& worldTM, IDisplayView
Vec3 vShortestHitPos;
float shortestDist = 3e11f;
for (int i = 0, iCount(vList.size()); i < iCount; ++i)
for (int i = 0, iCount(static_cast<int>(vList.size())); i < iCount; ++i)
{
const Vec3& v0 = vList[i];
const Vec3& v1 = vList[(i + 1) % iCount];
+3 -3
View File
@@ -2342,7 +2342,7 @@ bool CRenderViewport::AddCameraMenuItems(QMenu* menu)
AZ::EBusAggregateResults<AZ::EntityId> getCameraResults;
Camera::CameraBus::BroadcastResult(getCameraResults, &Camera::CameraRequests::GetCameras);
const int numCameras = getCameraResults.values.size();
const int numCameras = static_cast<int>(getCameraResults.values.size());
// only enable if we're editing a sequence in Track View and have cameras in the level
bool enableSequenceCameraMenu = (GetIEditor()->GetAnimation()->GetSequence() && numCameras);
@@ -2354,7 +2354,7 @@ bool CRenderViewport::AddCameraMenuItems(QMenu* menu)
connect(action, &QAction::triggered, this, &CRenderViewport::SetSequenceCamera);
QVector<QAction*> additionalCameras;
additionalCameras.reserve(getCameraResults.values.size());
additionalCameras.reserve(static_cast<int>(getCameraResults.values.size()));
for (const AZ::EntityId& entityId : getCameraResults.values)
{
@@ -2930,7 +2930,7 @@ void CRenderViewport::RenderSelectedRegion()
// Draw volume
dc.DepthWriteOff();
dc.CullOff();
dc.pRenderAuxGeom->DrawTriangles(&verts[0], verts.size(), &inds[0], numInds, &colors[0]);
dc.pRenderAuxGeom->DrawTriangles(&verts[0], static_cast<uint32>(verts.size()), &inds[0], numInds, &colors[0]);
dc.CullOn();
dc.DepthWriteOn();
}
+3 -3
View File
@@ -275,19 +275,19 @@ public:
m_relCameraRotX = 0;
m_relCameraRotZ = 0;
uint32 numSample6 = m_arrAnimatedCharacterPath.size();
uint32 numSample6 = static_cast<uint32>(m_arrAnimatedCharacterPath.size());
for (uint32 i = 0; i < numSample6; i++)
{
m_arrAnimatedCharacterPath[i] = Vec3(ZERO);
}
numSample6 = m_arrSmoothEntityPath.size();
numSample6 = static_cast<uint32>(m_arrSmoothEntityPath.size());
for (uint32 i = 0; i < numSample6; i++)
{
m_arrSmoothEntityPath[i] = Vec3(ZERO);
}
uint32 numSample7 = m_arrRunStrafeSmoothing.size();
uint32 numSample7 = static_cast<uint32>(m_arrRunStrafeSmoothing.size());
for (uint32 i = 0; i < numSample7; i++)
{
m_arrRunStrafeSmoothing[i] = 0;
+2 -2
View File
@@ -1088,7 +1088,7 @@ void SEditorSettings::ConvertPath(const AZStd::string_view sourcePath, AZStd::st
AzToolsFramework::EditorSettingsAPIRequests::SettingOutcome SEditorSettings::GetValue(const AZStd::string_view path)
{
if (path.find("|") < 0)
if (path.find("|") == AZStd::string_view::npos)
{
return { AZStd::string("Invalid Path - could not find separator \"|\"") };
}
@@ -1106,7 +1106,7 @@ AzToolsFramework::EditorSettingsAPIRequests::SettingOutcome SEditorSettings::Get
AzToolsFramework::EditorSettingsAPIRequests::SettingOutcome SEditorSettings::SetValue(const AZStd::string_view path, const AZStd::any& value)
{
if (path.find("|") < 0)
if (path.find("|") == AZStd::string_view::npos)
{
return { AZStd::string("Invalid Path - could not find separator \"|\"") };
}
@@ -26,19 +26,19 @@ public:
CSmartVariableArray mv_table;
CSmartVariable<float> mv_value;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_value, "Value");
}
bool SupportTrackType([[maybe_unused]] const CAnimParamType& paramType, EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType([[maybe_unused]] const CAnimParamType& paramType, EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
return trackType == eAnimCurveType_BezierFloat;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 0; }
unsigned int GetPriority() const override { return 0; }
static const GUID& GetClassID()
{
@@ -41,7 +41,7 @@ public:
CSmartVariable<float> mv_blendInTime;
CSmartVariable<float> mv_blendOutTime;
virtual void OnCreateVars()
void OnCreateVars() override
{
// Init to an invalid id
AZ::Data::AssetId assetId;
@@ -62,15 +62,15 @@ public:
mv_timeScale->SetLimits(0.001f, 100.f);
}
bool SupportTrackType([[maybe_unused]] const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, AnimValueType valueType) const
bool SupportTrackType([[maybe_unused]] const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, AnimValueType valueType) const override
{
return valueType == AnimValueType::AssetBlend;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -27,7 +27,7 @@ public:
CSmartVariable<QString> mv_folder;
CSmartVariable<bool> mv_once;
virtual void OnCreateVars()
void OnCreateVars() override
{
mv_duration.GetVar()->SetLimits(0, 100000.0f);
mv_timeStep.GetVar()->SetLimits(0.001f, 1.0f);
@@ -39,14 +39,14 @@ public:
AddVariable(mv_table, mv_folder, "Output Folder");
AddVariable(mv_table, mv_once, "Just one frame?");
}
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
return paramType == AnimParamType::Capture;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -33,7 +33,7 @@ public:
CSmartVariable<float> mv_endTime;
CSmartVariable<float> mv_timeScale;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_animation, "Animation", IVariable::DT_ANIMATION);
@@ -45,14 +45,14 @@ public:
AddVariable(mv_table, mv_timeScale, "Time Scale");
mv_timeScale->SetLimits(0.001f, 100.f);
}
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, AnimValueType valueType) const override
{
return paramType == AnimParamType::Animation || valueType == AnimValueType::CharacterAnim;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -30,7 +30,7 @@ public:
CSmartVariableEnum<QString> mv_font;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_comment, "Comment");
@@ -41,13 +41,13 @@ public:
AddVariable(mv_table, mv_color, "Color", IVariable::DT_COLOR);
mv_align->SetEnumList(NULL);
mv_align->SetEnumList(nullptr);
mv_align->AddEnumItem("Left", ICommentKey::eTA_Left);
mv_align->AddEnumItem("Center", ICommentKey::eTA_Center);
mv_align->AddEnumItem("Right", ICommentKey::eTA_Right);
AddVariable(mv_table, mv_align, "Align");
mv_font->SetEnumList(NULL);
mv_font->SetEnumList(nullptr);
IFileUtil::FileArray fa;
CFileUtil::ScanDirectory((Path::GetEditingGameDataFolder() + "/Fonts/").c_str(), "*.xml", fa, true);
for (size_t i = 0; i < fa.size(); ++i)
@@ -58,14 +58,14 @@ public:
}
AddVariable(mv_table, mv_font, "Font");
}
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
return paramType == AnimParamType::CommentText;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -26,7 +26,7 @@ CCommentNodeAnimator::CCommentNodeAnimator(CTrackViewAnimNode* pCommentNode)
CCommentNodeAnimator::~CCommentNodeAnimator()
{
m_pCommentNode = 0;
m_pCommentNode = nullptr;
}
void CCommentNodeAnimator::Animate(CTrackViewAnimNode* pNode, const SAnimContext& ac)
@@ -24,19 +24,19 @@ public:
CSmartVariableArray mv_table;
CSmartVariable<QString> mv_command;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_command, "Command");
}
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
return paramType == AnimParamType::Console;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
+7 -7
View File
@@ -26,7 +26,7 @@ public:
CSmartVariable<QString> mv_value;
CSmartVariable<bool> mv_notrigger_in_scrubbing;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_event, "Event");
@@ -35,14 +35,14 @@ public:
AddVariable(mv_deprecated, "Deprecated");
AddVariable(mv_deprecated, mv_animation, "Animation");
}
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
return paramType == AnimParamType::Event;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -73,8 +73,8 @@ bool CEventKeyUIControls::OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys
CAnimParamType paramType = keyHandle.GetTrack()->GetParameterType();
if (paramType == AnimParamType::Event)
{
mv_event.SetEnumList(NULL);
mv_animation.SetEnumList(NULL);
mv_event.SetEnumList(nullptr);
mv_animation.SetEnumList(nullptr);
// Add <None> for empty, unset event
mv_event->AddEnumItem(QObject::tr("<None>"), "");
+5 -5
View File
@@ -24,12 +24,12 @@ public:
CSmartVariableArray mv_table;
CSmartVariable<float> mv_command;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_command, "Goto Time");
}
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
if (paramType == AnimParamType::Goto)
{
@@ -40,10 +40,10 @@ public:
return false;
}
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -33,23 +33,23 @@ class CScreenFaderKeyUIControls
public:
//-----------------------------------------------------------------------------
//!
virtual bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
return paramType == AnimParamType::ScreenFader;
}
//-----------------------------------------------------------------------------
//!
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
mv_fadeType->SetEnumList(NULL);
mv_fadeType->SetEnumList(nullptr);
mv_fadeType->AddEnumItem("FadeIn", IScreenFaderKey::eFT_FadeIn);
mv_fadeType->AddEnumItem("FadeOut", IScreenFaderKey::eFT_FadeOut);
AddVariable(mv_table, mv_fadeType, "Type");
mv_fadechangeType->SetEnumList(NULL);
mv_fadechangeType->SetEnumList(nullptr);
mv_fadechangeType->AddEnumItem("Linear", IScreenFaderKey::eFCT_Linear);
mv_fadechangeType->AddEnumItem("Square", IScreenFaderKey::eFCT_Square);
mv_fadechangeType->AddEnumItem("Cubic Square", IScreenFaderKey::eFCT_CubicSquare);
@@ -67,13 +67,13 @@ public:
//-----------------------------------------------------------------------------
//!
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& keys);
bool OnKeySelectionChange(CTrackViewKeyBundle& keys) override;
//-----------------------------------------------------------------------------
//!
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& keys);
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& keys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -22,7 +22,7 @@ class CSelectKeyUIControls
, protected AZ::EntitySystemBus::Handler
{
public:
CSelectKeyUIControls() {}
CSelectKeyUIControls() = default;
~CSelectKeyUIControls() override;
@@ -30,7 +30,7 @@ public:
CSmartVariableEnum<QString> mv_camera;
CSmartVariable<float> mv_BlendTime;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_camera, "Camera");
@@ -39,14 +39,14 @@ public:
Camera::CameraNotificationBus::Handler::BusConnect();
AZ::EntitySystemBus::Handler::BusConnect();
}
bool SupportTrackType([[maybe_unused]] const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, AnimValueType valueType) const
bool SupportTrackType([[maybe_unused]] const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, AnimValueType valueType) const override
{
return valueType == AnimValueType::Select;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -98,7 +98,7 @@ bool CSelectKeyUIControls::OnKeySelectionChange(CTrackViewKeyBundle& selectedKey
ResetCameraEntries();
// Get All cameras.
mv_camera.SetEnumList(NULL);
mv_camera.SetEnumList(nullptr);
mv_camera->AddEnumItem(QObject::tr("<None>"), QString::number(static_cast<AZ::u64>(AZ::EntityId::InvalidEntityId)));
@@ -217,7 +217,7 @@ void CSelectKeyUIControls::OnCameraRemoved(const AZ::EntityId & cameraId)
// We can't iterate or remove an item from the enum list, and Camera::CameraRequests::GetCameras
// still includes the deleted camera at this point. Reset the list anyway and filter out the
// deleted camera.
mv_camera->SetEnumList(NULL);
mv_camera->SetEnumList(nullptr);
mv_camera->AddEnumItem(QObject::tr("<None>"), QString::number(static_cast<AZ::u64>(AZ::EntityId::InvalidEntityId)));
AZ::EBusAggregateResults<AZ::EntityId> cameraComponentEntities;
@@ -256,7 +256,7 @@ void CSelectKeyUIControls::OnEntityNameChanged(const AZ::EntityId & entityId, [[
void CSelectKeyUIControls::ResetCameraEntries()
{
mv_camera.SetEnumList(NULL);
mv_camera.SetEnumList(nullptr);
mv_camera->AddEnumItem(QObject::tr("<None>"), QString::number(static_cast<AZ::u64>(AZ::EntityId::InvalidEntityId)));
// Find all Component Entity Cameras
@@ -117,8 +117,7 @@ CSequenceBatchRenderDialog::CSequenceBatchRenderDialog(float fps, QWidget* pPare
}
CSequenceBatchRenderDialog::~CSequenceBatchRenderDialog()
{
}
= default;
void CSequenceBatchRenderDialog::reject()
{
@@ -519,7 +518,7 @@ void CSequenceBatchRenderDialog::OnGo()
InitializeContext();
// Trigger the first item.
OnMovieEvent(IMovieListener::eMovieEvent_Stopped, NULL);
OnMovieEvent(IMovieListener::eMovieEvent_Stopped, nullptr);
}
}
@@ -728,7 +727,7 @@ bool CSequenceBatchRenderDialog::GetResolutionFromCustomResText(const char* cust
bool CSequenceBatchRenderDialog::LoadOutputOptions(const QString& pathname)
{
XmlNodeRef batchRenderOptionsNode = XmlHelpers::LoadXmlFromFile(pathname.toStdString().c_str());
if (batchRenderOptionsNode == NULL)
if (batchRenderOptionsNode == nullptr)
{
return true;
}
@@ -1391,7 +1390,7 @@ void CSequenceBatchRenderDialog::OnLoadBatch()
Path::GetUserSandboxFolder(), loadPath))
{
XmlNodeRef batchRenderListNode = XmlHelpers::LoadXmlFromFile(loadPath.toStdString().c_str());
if (batchRenderListNode == NULL)
if (batchRenderListNode == nullptr)
{
return;
}
@@ -1414,7 +1413,7 @@ void CSequenceBatchRenderDialog::OnLoadBatch()
// sequence
const QString seqName = itemNode->getAttr("sequence");
item.pSequence = GetIEditor()->GetMovieSystem()->FindLegacySequenceByName(seqName.toUtf8().data());
if (item.pSequence == NULL)
if (item.pSequence == nullptr)
{
QMessageBox::warning(this, tr("Sequence not found"), tr("A sequence of '%1' not found! This'll be skipped.").arg(seqName));
continue;
@@ -1431,7 +1430,7 @@ void CSequenceBatchRenderDialog::OnLoadBatch()
break;
}
}
if (item.pDirectorNode == NULL)
if (item.pDirectorNode == nullptr)
{
QMessageBox::warning(this, tr("Director node not found"), tr("A director node of '%1' not found in the sequence of '%2'! This'll be skipped.").arg(directorName).arg(seqName));
continue;
@@ -1544,7 +1543,7 @@ bool CSequenceBatchRenderDialog::SetUpNewRenderItem(SRenderItem& item)
break;
}
}
if (item.pDirectorNode == NULL)
if (item.pDirectorNode == nullptr)
{
return false;
}
@@ -81,8 +81,8 @@ protected:
bool disableDebugInfo;
bool bCreateVideo;
SRenderItem()
: pSequence(NULL)
, pDirectorNode(NULL)
: pSequence(nullptr)
, pDirectorNode(nullptr)
, disableDebugInfo(false)
, bCreateVideo(false) {}
bool operator==(const SRenderItem& item)
@@ -155,7 +155,7 @@ protected:
, expectedTotalTime(0)
, spentTime(0)
, flagBU(0)
, pActiveDirectorBU(NULL)
, pActiveDirectorBU(nullptr)
, cvarCustomResWidthBU(0)
, cvarCustomResHeightBU(0)
, cvarDisplayInfoBU(0)
@@ -27,7 +27,7 @@ public:
CSmartVariable<float> mv_startTime;
CSmartVariable<float> mv_endTime;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_sequence, "Sequence");
@@ -35,14 +35,14 @@ public:
AddVariable(mv_table, mv_startTime, "Start Time");
AddVariable(mv_table, mv_endTime, "End Time");
}
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
return paramType == AnimParamType::Sequence;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -78,7 +78,7 @@ bool CSequenceKeyUIControls::OnKeySelectionChange(CTrackViewKeyBundle& selectedK
/////////////////////////////////////////////////////////////////////////////////
// fill sequence comboBox with available sequences
mv_sequence.SetEnumList(NULL);
mv_sequence.SetEnumList(nullptr);
// Insert '<None>' empty enum
mv_sequence->AddEnumItem(QObject::tr("<None>"), CTrackViewDialog::GetEntityIdAsString(AZ::EntityId(AZ::EntityId::InvalidEntityId)));
@@ -193,7 +193,7 @@ void CSequenceKeyUIControls::OnUIChange(IVariable* pVar, CTrackViewKeyBundle& se
IMovieSystem* pMovieSystem = GetIEditor()->GetSystem()->GetIMovieSystem();
if (pMovieSystem != NULL)
if (pMovieSystem != nullptr)
{
pMovieSystem->SetStartEndTime(pSequence, sequenceKey.fStartTime, sequenceKey.fEndTime);
}
+5 -5
View File
@@ -29,7 +29,7 @@ public:
CSmartVariable<float> mv_duration;
CSmartVariable<Vec3> mv_customColor;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_startTrigger, "StartTrigger", IVariable::DT_AUDIO_TRIGGER);
@@ -38,14 +38,14 @@ public:
AddVariable(mv_options, "Options");
AddVariable(mv_options, mv_customColor, "Custom Color", IVariable::DT_COLOR);
}
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
return paramType == AnimParamType::Sound;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -344,7 +344,7 @@ void CTVCustomizeTrackColorsDlg::Export(const QString& fullPath) const
bool CTVCustomizeTrackColorsDlg::Import(const QString& fullPath)
{
XmlNodeRef customTrackColorsNode = XmlHelpers::LoadXmlFromFile(fullPath.toStdString().c_str());
if (customTrackColorsNode == NULL)
if (customTrackColorsNode == nullptr)
{
return false;
}
+1 -1
View File
@@ -211,7 +211,7 @@ public:
int GetNumberOfUsageAndFirstTimeUsed(const char* eventName, float& timeFirstUsed) const;
};
CTVEventsDialog::CTVEventsDialog(QWidget* pParent /*=NULL*/)
CTVEventsDialog::CTVEventsDialog(QWidget* pParent /*=nullptr*/)
: QDialog(pParent)
, m_ui(new Ui::TVEventsDialog)
{
+3 -3
View File
@@ -51,7 +51,7 @@ CTVSequenceProps::~CTVSequenceProps()
}
// CTVSequenceProps message handlers
BOOL CTVSequenceProps::OnInitDialog()
bool CTVSequenceProps::OnInitDialog()
{
ui->NAME->setText(m_pSequence->GetName());
int seqFlags = m_pSequence->GetFlags();
@@ -97,7 +97,7 @@ BOOL CTVSequenceProps::OnInitDialog()
ui->ORT_ONCE->setChecked(true);
}
return TRUE; // return TRUE unless you set the focus to a control
return true; // return true unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -259,7 +259,7 @@ void CTVSequenceProps::OnOK()
void CTVSequenceProps::ToggleCutsceneOptions(bool bActivated)
{
if (bActivated == FALSE)
if (bActivated == false)
{
ui->NOABORT->setChecked(false);
ui->DISABLEPLAYER->setChecked(false);
+2 -2
View File
@@ -28,7 +28,7 @@ class CTVSequenceProps
{
Q_OBJECT
public:
CTVSequenceProps(CTrackViewSequence* pSequence, float fps, QWidget* pParent = NULL); // standard constructor
CTVSequenceProps(CTrackViewSequence* pSequence, float fps, QWidget* pParent = nullptr); // standard constructor
~CTVSequenceProps();
private:
@@ -39,7 +39,7 @@ private:
};
CTrackViewSequence* m_pSequence;
virtual BOOL OnInitDialog();
virtual bool OnInitDialog();
virtual void OnOK();
void MoveScaleKeys();
@@ -27,7 +27,7 @@ public:
CSmartVariable<float> mv_timeScale;
CSmartVariable<bool> mv_bLoop;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_startTime, "Start Time");
@@ -36,14 +36,14 @@ public:
AddVariable(mv_table, mv_bLoop, "Loop");
mv_timeScale->SetLimits(0.001f, 100.f);
}
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
return paramType == AnimParamType::TimeRanges;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -26,21 +26,21 @@ public:
CSmartVariableEnum<QString> mv_event;
CSmartVariable<QString> mv_value;
virtual void OnCreateVars()
void OnCreateVars() override
{
AddVariable(mv_table, "Key Properties");
AddVariable(mv_table, mv_event, "Track Event");
mv_event->SetFlags(mv_event->GetFlags() | IVariable::UI_UNSORTED);
AddVariable(mv_table, mv_value, "Value");
}
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const
bool SupportTrackType(const CAnimParamType& paramType, [[maybe_unused]] EAnimCurveType trackType, [[maybe_unused]] AnimValueType valueType) const override
{
return paramType == AnimParamType::TrackEvent;
}
virtual bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys);
virtual void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys);
bool OnKeySelectionChange(CTrackViewKeyBundle& selectedKeys) override;
void OnUIChange(IVariable* pVar, CTrackViewKeyBundle& selectedKeys) override;
virtual unsigned int GetPriority() const { return 1; }
unsigned int GetPriority() const override { return 1; }
static const GUID& GetClassID()
{
@@ -182,7 +182,7 @@ void CTrackEventKeyUIControls::BuildEventDropDown(QString& curEvent, const QStri
{
bool curEventExists = false;
bool addedEventExists = false;
mv_event.SetEnumList(NULL);
mv_event.SetEnumList(nullptr);
const int eventCount = sequence->GetTrackEventsCount();
// Need to check if event exists before adding all events
+2 -2
View File
@@ -370,7 +370,7 @@ bool CTrackViewAnimNode::IsBoundToEditorObjects() const
else
{
// check if bound to legacy entity
return (m_animNode->GetNodeOwner() != NULL);
return (m_animNode->GetNodeOwner() != nullptr);
}
}
@@ -1468,7 +1468,7 @@ bool CTrackViewAnimNode::PasteNodesFromClipboard(QWidget* context)
}
XmlNodeRef animNodesRoot = clipboard.Get();
if (animNodesRoot == NULL || strcmp(animNodesRoot->getTag(), "CopyAnimNodesRoot") != 0)
if (animNodesRoot == nullptr || strcmp(animNodesRoot->getTag(), "CopyAnimNodesRoot") != 0)
{
return false;
}
+1 -1
View File
@@ -27,7 +27,7 @@ class QWidget;
class CTrackViewAnimNodeBundle
{
public:
unsigned int GetCount() const { return m_animNodes.size(); }
unsigned int GetCount() const { return static_cast<unsigned int>(m_animNodes.size()); }
CTrackViewAnimNode* GetNode(const unsigned int index) { return m_animNodes[index]; }
const CTrackViewAnimNode* GetNode(const unsigned int index) const { return m_animNodes[index]; }
+9 -9
View File
@@ -130,10 +130,10 @@ const GUID& CTrackViewDialog::GetClassID()
//////////////////////////////////////////////////////////////////////////
CTrackViewDialog* CTrackViewDialog::s_pTrackViewDialog = NULL;
CTrackViewDialog* CTrackViewDialog::s_pTrackViewDialog = nullptr;
//////////////////////////////////////////////////////////////////////////
CTrackViewDialog::CTrackViewDialog(QWidget* pParent /*=NULL*/)
CTrackViewDialog::CTrackViewDialog(QWidget* pParent /*=nullptr*/)
: QMainWindow(pParent)
{
s_pTrackViewDialog = this;
@@ -152,7 +152,7 @@ CTrackViewDialog::CTrackViewDialog(QWidget* pParent /*=NULL*/)
m_lazyInitDone = false;
m_bEditLock = false;
m_pNodeForTracksToolBar = NULL;
m_pNodeForTracksToolBar = nullptr;
m_currentToolBarParamTypeId = 0;
@@ -181,7 +181,7 @@ CTrackViewDialog::~CTrackViewDialog()
m_findDlg->deleteLater();
m_findDlg = nullptr;
}
s_pTrackViewDialog = 0;
s_pTrackViewDialog = nullptr;
const CTrackViewSequenceManager* pSequenceManager = GetIEditor()->GetSequenceManager();
CTrackViewSequence* sequence = pSequenceManager->GetSequenceByEntityId(m_currentSequenceEntityId);
@@ -210,7 +210,7 @@ void CTrackViewDialog::OnAddEntityNodeMenu()
}
//////////////////////////////////////////////////////////////////////////
BOOL CTrackViewDialog::OnInitDialog()
bool CTrackViewDialog::OnInitDialog()
{
InitToolbar();
InitMenu();
@@ -270,7 +270,7 @@ BOOL CTrackViewDialog::OnInitDialog()
QString cursorPosText = QString("0.000(%1fps)").arg(FloatToIntRet(m_wndCurveEditor->GetFPS()));
m_cursorPos->setText(cursorPosText);
return TRUE; // return TRUE unless you set the focus to a control
return true; // return true unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -621,7 +621,7 @@ void CTrackViewDialog::InitToolbar()
{
qaction2->setCheckable(true);
}
m_actions[ID_TV_SNAP_NONE]->setChecked(true);
m_tracksToolBar = addToolBar("Tracks Toolbar");
@@ -883,7 +883,7 @@ void CTrackViewDialog::Update()
// The active camera node means two conditions:
// 1. Sequence camera is currently active.
// 2. The camera which owns this node has been set as the current camera by the director node.
bool bSequenceCamInUse = gEnv->pMovieSystem->GetCallback() == NULL ||
bool bSequenceCamInUse = gEnv->pMovieSystem->GetCallback() == nullptr ||
gEnv->pMovieSystem->GetCallback()->IsSequenceCamUsed();
AZ::EntityId camId = gEnv->pMovieSystem->GetCameraParams().cameraEntityId;
if (camId.IsValid() && bSequenceCamInUse)
@@ -2049,7 +2049,7 @@ void CTrackViewDialog::ClearTracksToolBar()
m_tracksToolBar->clear();
m_tracksToolBar->addWidget(new QLabel("Tracks:"));
m_pNodeForTracksToolBar = NULL;
m_pNodeForTracksToolBar = nullptr;
m_toolBarParamTypes.clear();
m_currentToolBarParamTypeId = 0;
}
+2 -2
View File
@@ -52,7 +52,7 @@ class CTrackViewDialog
public:
friend CMovieCallback;
CTrackViewDialog(QWidget* pParent = NULL);
CTrackViewDialog(QWidget* pParent = nullptr);
~CTrackViewDialog();
static void RegisterViewClass();
@@ -183,7 +183,7 @@ private:
void OnAddEntityNodeMenu();
void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
BOOL OnInitDialog();
bool OnInitDialog();
void SaveLayouts();
void SaveMiscSettings() const;
@@ -88,7 +88,7 @@ CTrackViewDopeSheetBase::CTrackViewDopeSheetBase(QWidget* parent)
m_currentTime = 0.0f;
m_storedTime = m_currentTime;
m_rcSelect = QRect(0, 0, 0, 0);
m_rubberBand = 0;
m_rubberBand = nullptr;
m_scrollBar = new QScrollBar(Qt::Horizontal, this);
connect(m_scrollBar, &QScrollBar::valueChanged, this, &CTrackViewDopeSheetBase::OnHScroll);
m_keyTimeOffset = 0;
@@ -113,7 +113,7 @@ CTrackViewDopeSheetBase::CTrackViewDopeSheetBase(QWidget* parent)
m_bFastRedraw = false;
m_pLastTrackSelectedOnSpot = NULL;
m_pLastTrackSelectedOnSpot = nullptr;
m_wndPropsOnSpot = nullptr;
@@ -544,7 +544,7 @@ void CTrackViewDopeSheetBase::OnLButtonUp(Qt::KeyboardModifiers modifiers, const
SelectKeys(m_rcSelect, modifiers & Qt::ControlModifier);
m_rcSelect = QRect();
m_rubberBand->deleteLater();
m_rubberBand = 0;
m_rubberBand = nullptr;
}
else if (m_mouseMode == eTVMouseMode_SelectWithinTime)
{
@@ -552,7 +552,7 @@ void CTrackViewDopeSheetBase::OnLButtonUp(Qt::KeyboardModifiers modifiers, const
SelectAllKeysWithinTimeFrame(m_rcSelect, modifiers & Qt::ControlModifier);
m_rcSelect = QRect();
m_rubberBand->deleteLater();
m_rubberBand = 0;
m_rubberBand = nullptr;
}
else if (m_mouseMode == eTVMouseMode_DragTime)
{
@@ -744,7 +744,7 @@ void CTrackViewDopeSheetBase::OnRButtonDown(Qt::KeyboardModifiers modifiers, con
}
else
{
m_pLastTrackSelectedOnSpot = NULL;
m_pLastTrackSelectedOnSpot = nullptr;
}
ShowKeyPropertyCtrlOnSpot(p.x(), p.y(), selectedKeys.GetKeyCount() > 1, bKeyChangeInSameTrack);
@@ -783,7 +783,7 @@ void CTrackViewDopeSheetBase::OnRButtonUp([[maybe_unused]] Qt::KeyboardModifiers
if (!m_bCursorWasInKey)
{
const bool bHasCopiedKey = (GetKeysInClickboard() != NULL);
const bool bHasCopiedKey = (GetKeysInClickboard() != nullptr);
if (bHasCopiedKey && m_bMouseMovedAfterRButtonDown == false) // Once moved, it means the user wanted to scroll, so no paste pop-up.
{
@@ -1230,24 +1230,24 @@ XmlNodeRef CTrackViewDopeSheetBase::GetKeysInClickboard()
CClipboard clip(this);
if (clip.IsEmpty())
{
return NULL;
return nullptr;
}
if (clip.GetTitle() != "Track view keys")
{
return NULL;
return nullptr;
}
XmlNodeRef copyNode = clip.Get();
if (copyNode == NULL || strcmp(copyNode->getTag(), "CopyKeysNode"))
if (copyNode == nullptr || strcmp(copyNode->getTag(), "CopyKeysNode"))
{
return NULL;
return nullptr;
}
int nNumTracksToPaste = copyNode->getChildCount();
if (nNumTracksToPaste == 0)
{
return NULL;
return nullptr;
}
return copyNode;
@@ -1789,7 +1789,7 @@ float CTrackViewDopeSheetBase::FrameSnap(float time) const
//////////////////////////////////////////////////////////////////////////
void CTrackViewDopeSheetBase::ShowKeyPropertyCtrlOnSpot(int x, int y, [[maybe_unused]] bool bMultipleKeysSelected, bool bKeyChangeInSameTrack)
{
if (m_keyPropertiesDlg == NULL)
if (m_keyPropertiesDlg == nullptr)
{
return;
}
+2 -2
View File
@@ -24,13 +24,13 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
// CTrackViewFindDlg dialog
CTrackViewFindDlg::CTrackViewFindDlg(const char* title, QWidget* pParent /*=NULL*/)
CTrackViewFindDlg::CTrackViewFindDlg(const char* title, QWidget* pParent /*=nullptr*/)
: QDialog(pParent)
, ui(new Ui::TrackViewFindDlg)
{
setWindowTitle(title);
m_tvDlg = 0;
m_tvDlg = nullptr;
m_numSeqs = 0;
ui->setupUi(this);
+1 -1
View File
@@ -32,7 +32,7 @@ class CTrackViewFindDlg
Q_OBJECT
// Construction
public:
CTrackViewFindDlg(const char* title = NULL, QWidget* pParent = NULL); // standard constructor
CTrackViewFindDlg(const char* title = nullptr, QWidget* pParent = nullptr); // standard constructor
~CTrackViewFindDlg();
//Functions
@@ -328,8 +328,8 @@ bool CTrackViewTrackPropsDlg::OnKeySelectionChange(CTrackViewKeyBundle& selected
}
else
{
ui->PREVNEXT->setEnabled(FALSE);
ui->TIME->setEnabled(FALSE);
ui->PREVNEXT->setEnabled(false);
ui->TIME->setEnabled(false);
}
return true;
}
@@ -74,7 +74,7 @@ protected:
// Helper functions.
//////////////////////////////////////////////////////////////////////////
template <class T>
void SyncValue(CSmartVariable<T>& var, T& value, bool bCopyToUI, IVariable* pSrcVar = NULL)
void SyncValue(CSmartVariable<T>& var, T& value, bool bCopyToUI, IVariable* pSrcVar = nullptr)
{
if (bCopyToUI)
{
+2 -2
View File
@@ -123,7 +123,7 @@ public:
virtual bool AreAllKeysOfSameType() const override { return m_bAllOfSameType; }
virtual unsigned int GetKeyCount() const override { return m_keys.size(); }
virtual unsigned int GetKeyCount() const override { return static_cast<unsigned int>(m_keys.size()); }
virtual CTrackViewKeyHandle GetKey(unsigned int index) override { return m_keys[index]; }
virtual void SelectKeys(const bool bSelected) override;
@@ -174,7 +174,7 @@ public:
CTrackViewNode* GetParentNode() const { return m_pParentNode; }
// Children
unsigned int GetChildCount() const { return m_childNodes.size(); }
unsigned int GetChildCount() const { return static_cast<unsigned int>(m_childNodes.size()); }
CTrackViewNode* GetChild(unsigned int index) const { return m_childNodes[index].get(); }
// Snap time value to prev/next key in sequence
+8 -8
View File
@@ -69,7 +69,7 @@ public:
: QStyledItemDelegate(parent)
{}
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override
{
bool enabled = index.data(CTrackViewNodesCtrl::CRecord::EnableRole).toBool();
QStyleOptionViewItem opt = option;
@@ -106,7 +106,7 @@ protected:
return Qt::CopyAction | Qt::MoveAction;
}
void dragMoveEvent(QDragMoveEvent* event)
void dragMoveEvent(QDragMoveEvent* event) override
{
CTrackViewNodesCtrl::CRecord* record = (CTrackViewNodesCtrl::CRecord*) itemAt(event->pos());
if (!record)
@@ -144,7 +144,7 @@ protected:
}
}
void dropEvent(QDropEvent* event)
void dropEvent(QDropEvent* event) override
{
CTrackViewNodesCtrl::CRecord* record = (CTrackViewNodesCtrl::CRecord*) itemAt(event->pos());
if (!record)
@@ -200,7 +200,7 @@ protected:
}
}
void keyPressEvent(QKeyEvent* event)
void keyPressEvent(QKeyEvent* event) override
{
// HAVE TO INCLUDE CASES FOR THESE IN THE ShortcutOverride handler in ::event() below
switch (event->key())
@@ -242,7 +242,7 @@ protected:
}
bool focusNextPrevChild([[maybe_unused]] bool next)
bool focusNextPrevChild([[maybe_unused]] bool next) override
{
return false; // so we get the tab key
}
@@ -361,7 +361,7 @@ CTrackViewNodesCtrl::CTrackViewNodesCtrl(QWidget* hParentWnd, CTrackViewDialog*
, m_pTrackViewDialog(parent)
{
ui->setupUi(this);
m_pDopeSheet = 0;
m_pDopeSheet = nullptr;
m_currentMatchIndex = 0;
m_matchCount = 0;
@@ -954,7 +954,7 @@ void CTrackViewNodesCtrl::OnSelectionChanged()
//////////////////////////////////////////////////////////////////////////
void CTrackViewNodesCtrl::OnNMRclick(QPoint point)
{
CRecord* record = 0;
CRecord* record = nullptr;
bool isOnAzEntity = false;
CTrackViewSequence* sequence = GetIEditor()->GetAnimation()->GetSequence();
if (!sequence)
@@ -1605,7 +1605,7 @@ CTrackViewTrack* CTrackViewNodesCtrl::GetTrackViewTrack(const Export::EntityAnim
}
}
return 0;
return nullptr;
}
//////////////////////////////////////////////////////////////////////////
@@ -29,7 +29,7 @@ public:
virtual void OnEditorNotifyEvent(EEditorNotifyEvent event);
unsigned int GetCount() const { return m_sequences.size(); }
unsigned int GetCount() const { return static_cast<int>(m_sequences.size()); }
void CreateSequence(QString name, SequenceType sequenceType);
void DeleteSequence(CTrackViewSequence* pSequence);
+11 -11
View File
@@ -56,10 +56,10 @@ protected:
}
}
virtual int GetSize() { return sizeof(*this); }
virtual QString GetDescription() { return "UndoTrackViewSplineCtrl"; };
int GetSize() override { return sizeof(*this); }
QString GetDescription() override { return "UndoTrackViewSplineCtrl"; };
virtual void Undo(bool bUndo)
void Undo(bool bUndo) override
{
CTrackViewSplineCtrl* pCtrl = FindControl(m_pCtrl);
if (pCtrl)
@@ -103,7 +103,7 @@ protected:
}
}
virtual void Redo()
void Redo() override
{
const CTrackViewSequenceManager* pSequenceManager = GetIEditor()->GetSequenceManager();
CTrackViewSequence* sequence = pSequenceManager->GetSequenceByEntityId(m_sequenceEntityId);
@@ -136,7 +136,7 @@ protected:
sequence->OnKeySelectionChanged();
}
virtual bool IsSelectionChanged() const
bool IsSelectionChanged() const override
{
const CTrackViewSequenceManager* sequenceManager = GetIEditor()->GetSequenceManager();
CTrackViewSequence* sequence = sequenceManager->GetSequenceByEntityId(m_sequenceEntityId);
@@ -151,19 +151,19 @@ protected:
}
public:
typedef std::list<CTrackViewSplineCtrl*> CTrackViewSplineCtrls;
using CTrackViewSplineCtrls = std::list<CTrackViewSplineCtrl*>;
static CTrackViewSplineCtrl* FindControl(CTrackViewSplineCtrl* pCtrl)
{
if (!pCtrl)
{
return 0;
return nullptr;
}
auto iter = std::find(s_activeCtrls.begin(), s_activeCtrls.end(), pCtrl);
if (iter == s_activeCtrls.end())
{
return 0;
return nullptr;
}
return *iter;
@@ -449,7 +449,7 @@ void CTrackViewSplineCtrl::AddSpline(ISplineInterpolator* pSpline, CTrackViewTra
}
si.pSpline = pSpline;
si.pDetailSpline = NULL;
si.pDetailSpline = nullptr;
m_splines.push_back(si);
m_tracks.push_back(pTrack);
m_bKeyTimesDirty = true;
@@ -896,7 +896,7 @@ bool CTrackViewSplineCtrl::IsUnifiedKeyCurrentlySelected() const
{
ISplineInterpolator* pSpline = m_splines[splineIndex].pSpline;
if (pSpline == NULL)
if (pSpline == nullptr)
{
continue;
}
@@ -960,7 +960,7 @@ void CTrackViewSplineCtrl::mouseReleaseEvent(QMouseEvent* event)
if (GetIEditor()->GetAnimation()->GetSequence())
{
bool restoreRecordModeToTrue = (m_editMode == TimeMarkerMode && m_stashedRecordModeWhenDraggingTime);
SplineWidget::mouseReleaseEvent(event);
if (restoreRecordModeToTrue)
+1 -1
View File
@@ -27,7 +27,7 @@ public:
: m_bAllOfSameType(true)
, m_bHasRotationTrack(false) {}
unsigned int GetCount() const { return m_tracks.size(); }
unsigned int GetCount() const { return static_cast<unsigned int>(m_tracks.size()); }
CTrackViewTrack* GetTrack(const unsigned int index) { return m_tracks[index]; }
const CTrackViewTrack* GetTrack(const unsigned int index) const { return m_tracks[index]; }
+2 -2
View File
@@ -61,12 +61,12 @@ public:
// Confetti: Get the size of m_undoObjects
virtual int GetCount() const
{
return m_undoObjects.size();
return static_cast<int>(m_undoObjects.size());
}
virtual bool IsEmpty() const { return m_undoObjects.empty(); };
virtual void Undo(bool bUndo)
{
for (int i = m_undoObjects.size() - 1; i >= 0; i--)
for (int i = static_cast<int>(m_undoObjects.size() - 1); i >= 0; i--)
{
m_undoObjects[i]->Undo(bUndo);
}
+1 -1
View File
@@ -86,7 +86,7 @@ public:
//////////////////////////////////////////////////////////////////////////
//! Get number of currently existing viewports.
virtual int GetViewCount() { return m_viewports.size(); };
virtual int GetViewCount() { return static_cast<int>(m_viewports.size()); };
//! Get viewport by index.
//! @param index 0 <= index < GetViewportCount()
virtual CViewport* GetView(int index) { return m_viewports[index]; }
@@ -47,7 +47,7 @@ namespace AZ
}
auto stackEntry = AZStd::make_shared<BlockCache>(
cacheSize, blockSize, aznumeric_caster(hardware.m_maxPhysicalSectorSize), false);
cacheSize, aznumeric_cast<AZ::u32>(blockSize), aznumeric_cast<AZ::u32>(hardware.m_maxPhysicalSectorSize), false);
stackEntry->SetNext(AZStd::move(parent));
return stackEntry;
}
@@ -45,7 +45,7 @@ namespace AZ
}
auto stackEntry = AZStd::make_shared<DedicatedCache>(
cacheSize, blockSize, aznumeric_caster(hardware.m_maxPhysicalSectorSize), m_writeOnlyEpilog);
cacheSize, aznumeric_cast<AZ::u32>(blockSize), aznumeric_cast<AZ::u32>(hardware.m_maxPhysicalSectorSize), m_writeOnlyEpilog);
stackEntry->SetNext(AZStd::move(parent));
return stackEntry;
}
+1 -1
View File
@@ -43,7 +43,7 @@ namespace AZ
static Aabb CreateCenterRadius(const Vector3& center, float radius);
//! Creates an AABB which contains the specified points.
static Aabb CreatePoints(const Vector3* pts, int numPts);
static Aabb CreatePoints(const Vector3* pts, size_t numPts);
//! Creates an AABB which contains the specified OBB.
static Aabb CreateFromObb(const Obb& obb);
+2 -2
View File
@@ -60,10 +60,10 @@ namespace AZ
}
AZ_MATH_INLINE Aabb Aabb::CreatePoints(const Vector3* pts, int numPts)
AZ_MATH_INLINE Aabb Aabb::CreatePoints(const Vector3* pts, size_t numPts)
{
Aabb aabb = Aabb::CreateFromPoint(pts[0]);
for (int i = 1; i < numPts; ++i)
for (size_t i = 1; i < numPts; ++i)
{
aabb.AddPoint(pts[i]);
}
@@ -11,6 +11,7 @@
#include <AzCore/Memory/OSAllocator.h>
#include <AzCore/std/containers/unordered_map.h>
#include <AzCore/Math/Crc.h>
#include <AzCore/std/parallel/scoped_lock.h>
namespace AZ
{
@@ -75,6 +76,42 @@ namespace AZ
bool operator==(const OSStdAllocator& a, const OSStdAllocator& b) { (void)a; (void)b; return true; }
bool operator!=(const OSStdAllocator& a, const OSStdAllocator& b) { (void)a; (void)b; return false; }
void EnvironmentVariableHolderBase::UnregisterAndDestroy(DestructFunc destruct, bool moduleRelease)
{
const bool releaseByUseCount = (--m_useCount == 0);
// We take over the lock, and release it before potentially destroying/freeing ourselves
{
AZStd::scoped_lock envLockHolder(AZStd::adopt_lock, m_mutex);
const bool releaseByModule = (moduleRelease && !m_canTransferOwnership && m_moduleOwner == AZ::Environment::GetModuleId());
if (!releaseByModule && !releaseByUseCount)
{
return;
}
// if the environment that created us is gone the owner can be null
// which means (assuming intermodule allocator) that the variable is still alive
// but can't be found as it's not part of any environment.
if (m_environmentOwner)
{
m_environmentOwner->RemoveVariable(m_guid);
m_environmentOwner = nullptr;
}
if (m_isConstructed)
{
destruct(this, DestroyTarget::Member); // destruct the value
}
}
// m_mutex is no longer held here, envLockHolder has released it above.
if (releaseByUseCount)
{
// m_mutex is unlocked before this is deleted
Environment::AllocatorInterface* allocator = m_allocator;
// Call child class dtor and clear the memory
destruct(this, DestroyTarget::Self);
allocator->DeAllocate(this);
}
}
// instance of the environment
EnvironmentInterface* EnvironmentInterface::s_environment = nullptr;
@@ -110,7 +147,7 @@ namespace AZ
#ifdef AZ_ENVIRONMENT_VALIDATE_ON_EXIT
AZ_Assert(m_numAttached == 0, "We should not delete an environment while there are %d modules attached! Unload all DLLs first!", m_numAttached);
#endif
for (auto variableIt : m_variableMap)
{
EnvironmentVariableHolderBase* holder = reinterpret_cast<EnvironmentVariableHolderBase*>(variableIt.second);
@@ -200,6 +200,11 @@ namespace AZ
class EnvironmentVariableHolderBase
{
friend class EnvironmentImpl;
protected:
enum class DestroyTarget {
Member,
Self
};
public:
EnvironmentVariableHolderBase(u32 guid, AZ::Internal::EnvironmentInterface* environmentOwner, bool canOwnershipTransfer, Environment::AllocatorInterface* allocator)
: m_environmentOwner(environmentOwner)
@@ -217,12 +222,21 @@ namespace AZ
return m_isConstructed;
}
bool IsOwner() const
{
return m_moduleOwner == Environment::GetModuleId();
}
u32 GetId() const
{
return m_guid;
}
protected:
using DestructFunc = void (*)(EnvironmentVariableHolderBase *, DestroyTarget);
// Assumes the m_mutex is already locked.
// On return m_mutex is in an unlocked state.
void UnregisterAndDestroy(DestructFunc destruct, bool moduleRelease);
AZ::Internal::EnvironmentInterface* m_environmentOwner; ///< Used to know which environment we should use to free the variable if we can't transfer ownership
void* m_moduleOwner; ///< Used when the variable can't transfered across module and we need to destruct the variable when the module is going away
bool m_canTransferOwnership; ///< True if variable can be allocated in one module and freed in other. Usually true for POD types when they share allocator.
@@ -242,41 +256,29 @@ namespace AZ
memset(&m_value, 0, sizeof(T));
}
template <class... Args>
template<class... Args>
void ConstructImpl(const AZStd::false_type& /* AZStd::has_trivial_constructor<T> */, Args&&... args)
{
// Construction of non-trivial types is left up to the type's constructor.
new(&m_value) T(AZStd::forward<Args>(args)...);
}
void DestructImpl(const AZStd::true_type& /* AZStd::is_trivially_destructible<T> */)
static void DestructDispatchNoLock(EnvironmentVariableHolderBase *base, DestroyTarget selfDestruct)
{
// do nothing
}
void DestructImpl(const AZStd::false_type& /* AZStd::is_trivially_destructible<T> */)
{
reinterpret_cast<T*>(&m_value)->~T();
}
// Assumes the lock is already held
void UnregisterAndDestruct()
{
// if the environment that created us is gone the owner can be null
// which means (assuming intermodule allocator) that the variable is still alive
// but can't be found as it's not part of any environment.
if (m_environmentOwner)
auto *self = reinterpret_cast<EnvironmentVariableHolder *>(base);
if (selfDestruct == DestroyTarget::Self)
{
m_environmentOwner->RemoveVariable(m_guid);
m_environmentOwner = nullptr;
self->~EnvironmentVariableHolder();
return;
}
if (m_isConstructed)
AZ_Assert(self->m_isConstructed, "Variable is not constructed. Please check your logic and guard if needed!");
self->m_isConstructed = false;
self->m_moduleOwner = nullptr;
if constexpr(!AZStd::is_trivially_destructible_v<T>)
{
DestructNoLock();
reinterpret_cast<T*>(&self->m_value)->~T();
}
}
public:
EnvironmentVariableHolder(u32 guid, bool isOwnershipTransfer, Environment::AllocatorInterface* allocator)
: EnvironmentVariableHolderBase(guid, Environment::GetInstance(), isOwnershipTransfer, allocator)
@@ -287,12 +289,6 @@ namespace AZ
{
AZ_Assert(!m_isConstructed, "To get the destructor we should have already destructed the variable!");
}
bool IsOwner() const
{
return m_moduleOwner == Environment::GetModuleId();
}
void AddRef()
{
AZStd::lock_guard<AZStd::spin_mutex> lock(m_mutex);
@@ -303,30 +299,8 @@ namespace AZ
void Release()
{
m_mutex.lock();
if (--s_moduleUseCount == 0)
{
if (!m_canTransferOwnership && m_moduleOwner == AZ::Environment::GetModuleId())
{
UnregisterAndDestruct();
}
}
if (--m_useCount == 0)
{
UnregisterAndDestruct();
// unlock before this is deleted
m_mutex.unlock();
Environment::AllocatorInterface* allocator = m_allocator;
// Call dtor and clear the memory
this->~EnvironmentVariableHolder();
allocator->DeAllocate(this);
return;
}
m_mutex.unlock();
const bool moduleRelease = (--s_moduleUseCount == 0);
UnregisterAndDestroy(DestructDispatchNoLock, moduleRelease);
}
void Construct()
@@ -352,18 +326,10 @@ namespace AZ
}
}
void DestructNoLock()
{
AZ_Assert(m_isConstructed, "Variable is not constructed. Please check your logic and guard if needed!");
m_isConstructed = false;
m_moduleOwner = nullptr;
DestructImpl(typename AZStd::is_trivially_destructible<T>::type());
}
void Destruct()
{
AZStd::lock_guard<AZStd::spin_mutex> lock(m_mutex);
DestructNoLock();
DestructDispatchNoLock(this, DestroyTarget::Member);
}
// variable storage
@@ -71,7 +71,7 @@ namespace AZ
if (context.ShouldKeepDefaults() || !defaultValue || (valAsByteStream != *static_cast<const JsonByteStream*>(defaultValue)))
{
const auto base64ByteStream = AZ::StringFunc::Base64::Encode(valAsByteStream.data(), valAsByteStream.size());
outputValue.SetString(base64ByteStream.c_str(), base64ByteStream.size(), context.GetJsonAllocator());
outputValue.SetString(base64ByteStream.c_str(), static_cast<rapidjson::SizeType>(base64ByteStream.size()), context.GetJsonAllocator());
return context.Report(Tasks::WriteValue, Outcomes::Success, "ByteStream successfully stored.");
}
@@ -211,7 +211,7 @@ namespace AZStd
// 20.9.3.2, observer:
constexpr rep count() const { return m_rep; }
// 20.9.3.3, arithmetic:
constexpr duration operator+() const { *this; }
constexpr duration operator+() const { return *this; }
constexpr duration operator-() const { return duration(-m_rep); }
constexpr duration& operator++() { ++m_rep; return *this; }
constexpr duration operator++(int) { return duration(m_rep++); }
@@ -1056,7 +1056,7 @@ namespace AZStd
inline void insert(const iterator& pos, ForwardIterator first, ForwardIterator last, const AZStd::forward_iterator_tag&)
{
size_type size = AZStd::distance(first, last);
AZSTD_CONTAINER_ASSERT(size >= 0, "AZStd::ring_buffer::insert - there are no elements to insert!");
AZSTD_CONTAINER_ASSERT(first > last, "AZStd::ring_buffer::insert - there are no elements to insert!");
if (size == 0)
{
return;
+1 -1
View File
@@ -294,7 +294,7 @@ namespace AZStd
T& m_v;
constexpr addr_impl_ref(T& v)
: m_v(v) {}
constexpr addr_impl_ref& operator=(const addr_impl_ref& v) { m_v = v; }
constexpr addr_impl_ref& operator=(const addr_impl_ref& v) { m_v = v; return *this; }
constexpr operator T& () const { return m_v; }
};
@@ -163,7 +163,11 @@ namespace AzFramework
AZ_TracePrintfOnce("AssetSystemComponent", "Failed to find asset platform, setting 'pc'\n");
outputConnectionSettings.m_assetPlatform = "pc";
}
outputConnectionSettings.m_assetPlatform = assetsPlatform;
else
{
outputConnectionSettings.m_assetPlatform = assetsPlatform;
}
if (outputConnectionSettings.m_assetPlatform.empty())
{
assetsPlatform = AzFramework::OSPlatformToDefaultAssetPlatform(AZ_TRAIT_OS_PLATFORM_CODENAME);
@@ -269,7 +269,7 @@ namespace AzFramework
int numEnvironmentVars = 0;
if (processLaunchInfo.m_environmentVariables)
{
const int numEnvironmentVars = processLaunchInfo.m_environmentVariables->size();
numEnvironmentVars = processLaunchInfo.m_environmentVariables->size();
// Adding one more as exec expects the array to have a nullptr as the last element
environmentVariables = new char*[numEnvironmentVars + 1];
for (int i = 0; i < numEnvironmentVars; i++)
@@ -98,7 +98,7 @@ namespace UnitTest
// If an entry is removed from the octree as an unintended side effect of updating an existing entry,
// GetEntryCount can't be relied upon to report the actual entry count.
// So manually count the entries when using the entry count for validation.
uint32_t manualEntryCount = 0;
size_t manualEntryCount = 0;
visScene->EnumerateNoCull([&manualEntryCount](const AzFramework::IVisibilityScene::NodeData& nodeData) { manualEntryCount += nodeData.m_entries.size(); });
EXPECT_EQ(manualEntryCount, expectedEntryCount);
@@ -409,7 +409,7 @@ namespace UnitTest
}
// Expect all the entries to be in the scene
ValidateEntryCountEqualsExpectedCount(m_octreeScene, visEntries.size());
ValidateEntryCountEqualsExpectedCount(m_octreeScene, static_cast<uint32_t>(visEntries.size()));
// Update them, without making any actual changes
for (AzFramework::VisibilityEntry& entry : visEntries)
@@ -418,6 +418,6 @@ namespace UnitTest
}
// Expect all the entries to be in the scene
ValidateEntryCountEqualsExpectedCount(m_octreeScene, visEntries.size());
ValidateEntryCountEqualsExpectedCount(m_octreeScene, static_cast<uint32_t>(visEntries.size()));
}
}
@@ -170,7 +170,7 @@ namespace AzNetworking
}
timeoutItem->UpdateTimeoutTime(startTimeMs);
NetworkOutputSerializer serializer(buffer.GetBuffer(), buffer.GetSize());
NetworkOutputSerializer serializer(buffer.GetBuffer(), static_cast<uint32_t>(buffer.GetSize()));
if (m_state == ConnectionState::Connecting)
{
const ConnectResult connectResult = m_networkInterface.GetConnectionListener().ValidateConnect(GetRemoteAddress(), header, serializer);
@@ -198,7 +198,7 @@ namespace AzNetworking
{
TcpPacketEncodingBuffer buffer;
{
NetworkInputSerializer serializer(buffer.GetBuffer(), buffer.GetCapacity());
NetworkInputSerializer serializer(buffer.GetBuffer(), static_cast<uint32_t>(buffer.GetCapacity()));
if (!const_cast<IPacket&>(packet).Serialize(serializer))
{
AZ_Assert(false, "SendReliablePacket: Unable to serialize packet [Type: %d]", packet.GetPacketType());
@@ -272,7 +272,7 @@ namespace AzNetworking
{
TcpPacketHeader header(packetType, aznumeric_cast<uint16_t>(payloadBuffer.GetSize()));
header.SetPacketFlag(PacketFlag::Compressed, shouldCompress);
NetworkInputSerializer serializer(headerBuffer.GetBuffer(), headerBuffer.GetCapacity());
NetworkInputSerializer serializer(headerBuffer.GetBuffer(), static_cast<uint32_t>(headerBuffer.GetCapacity()));
if (!header.Serialize(serializer))
{
return false;
@@ -313,7 +313,7 @@ namespace AzNetworking
m_networkInterface.GetMetrics().m_sendBytesCompressedDelta += (payloadSize - compressionMemBytesUsed);
writeBuffer.Resize(aznumeric_cast<int32_t>(compressionMemBytesUsed));
payloadSize = writeBuffer.GetSize();
payloadSize = static_cast<uint32_t>(writeBuffer.GetSize());
srcData = writeBuffer.GetBuffer();
}
@@ -12,7 +12,7 @@ namespace AzNetworking
{
template <uint32_t SIZE>
inline TcpRingBuffer<SIZE>::TcpRingBuffer()
: m_impl(m_buffer.data(), m_buffer.size())
: m_impl(m_buffer.data(), static_cast<uint32_t>(m_buffer.size()))
{
;
}
@@ -84,7 +84,7 @@ namespace AzNetworking
if (dtlsData.GetSize() > 0)
{
const uint8_t* encryptedData = dtlsData.GetBuffer();
const uint32_t encryptedSize = dtlsData.GetSize();
const uint32_t encryptedSize = static_cast<uint32_t>(dtlsData.GetSize());
BIO_write(m_readBio, encryptedData, encryptedSize);
}
DtlsEndpoint::HandshakeState prevState = m_state;
@@ -196,7 +196,7 @@ namespace AzNetworking
// Need to do this... connection negotiation may have left data in the write bio that we need to send out
if (BIO_ctrl_pending(m_writeBio) > 0)
{
const uint32_t maxBufferSize = outHandshakeData.GetCapacity();
const uint32_t maxBufferSize = static_cast<uint32_t>(outHandshakeData.GetCapacity());
outHandshakeData.Resize(maxBufferSize);
const int32_t dataSize = BIO_read(m_writeBio, outHandshakeData.GetBuffer(), maxBufferSize);
outHandshakeData.Resize(dataSize);

Some files were not shown because too many files have changed in this diff Show More