Editor code: tidy up BOOLs,NULLs and overrides pt1.
Merge pull request #2872 from nemerle/tidy_up_editor_code_a_bit_split1
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
CBitmapToolTip(QWidget* parent = nullptr);
|
||||
virtual ~CBitmapToolTip();
|
||||
|
||||
BOOL Create(const RECT& rect);
|
||||
bool Create(const RECT& rect);
|
||||
|
||||
// Attributes
|
||||
public:
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -26,7 +26,7 @@ class EditorCoreTestEnvironment
|
||||
public:
|
||||
AZ_TEST_CLASS_ALLOCATOR(EditorCoreTestEnvironment);
|
||||
|
||||
virtual ~EditorCoreTestEnvironment()
|
||||
~EditorCoreTestEnvironment() override
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user