Editor code: tidy up BOOLs,NULLs and overrides pt6.

Merge pull request #2877 from nemerle/tidy_up_editor_code_a_bit_split6
monroegm-disable-blank-issue-2
hultonha 4 years ago committed by GitHub
commit 9a711cbb8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -103,7 +103,7 @@ public:
static const char* GetConfigGroupName(); static const char* GetConfigGroupName();
CLayoutViewPane* FindViewByClass(const QString& viewClassName); CLayoutViewPane* FindViewByClass(const QString& viewClassName);
void BindViewport(CLayoutViewPane* vp, const QString& viewClassName, QWidget* pViewport = NULL); void BindViewport(CLayoutViewPane* vp, const QString& viewClassName, QWidget* pViewport = nullptr);
QString ViewportTypeToClassName(EViewportType viewType); QString ViewportTypeToClassName(EViewportType viewType);
//! Switch 2D viewports. //! Switch 2D viewports.

@ -93,7 +93,7 @@ void CLevelInfo::ValidateObjects()
pObject->Validate(m_pReport); pObject->Validate(m_pReport);
m_pReport->SetCurrentValidatorObject(NULL); m_pReport->SetCurrentValidatorObject(nullptr);
} }
CLogFile::WriteLine("Validating Duplicate Objects..."); CLogFile::WriteLine("Validating Duplicate Objects...");

@ -380,7 +380,7 @@ AZ_POP_DISABLE_WARNING
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
#if defined(AZ_PLATFORM_WINDOWS) #if defined(AZ_PLATFORM_WINDOWS)
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &DisplayConfig); EnumDisplaySettings(nullptr, ENUM_CURRENT_SETTINGS, &DisplayConfig);
GetPrivateProfileString("boot.description", "display.drv", GetPrivateProfileString("boot.description", "display.drv",
"(Unknown graphics card)", szProfileBuffer, sizeof(szProfileBuffer), "(Unknown graphics card)", szProfileBuffer, sizeof(szProfileBuffer),
"system.ini"); "system.ini");

@ -161,45 +161,45 @@ public:
} }
} }
~EngineConnectionListener() ~EngineConnectionListener() override
{ {
AzFramework::AssetSystemInfoBus::Handler::BusDisconnect(); AzFramework::AssetSystemInfoBus::Handler::BusDisconnect();
AzFramework::EngineConnectionEvents::Bus::Handler::BusDisconnect(); AzFramework::EngineConnectionEvents::Bus::Handler::BusDisconnect();
} }
public: public:
virtual void Connected([[maybe_unused]] AzFramework::SocketConnection* connection) void Connected([[maybe_unused]] AzFramework::SocketConnection* connection) override
{ {
m_state = EConnectionState::Connected; m_state = EConnectionState::Connected;
} }
virtual void Connecting([[maybe_unused]] AzFramework::SocketConnection* connection) void Connecting([[maybe_unused]] AzFramework::SocketConnection* connection) override
{ {
m_state = EConnectionState::Connecting; m_state = EConnectionState::Connecting;
} }
virtual void Listening([[maybe_unused]] AzFramework::SocketConnection* connection) void Listening([[maybe_unused]] AzFramework::SocketConnection* connection) override
{ {
m_state = EConnectionState::Listening; m_state = EConnectionState::Listening;
} }
virtual void Disconnecting([[maybe_unused]] AzFramework::SocketConnection* connection) void Disconnecting([[maybe_unused]] AzFramework::SocketConnection* connection) override
{ {
m_state = EConnectionState::Disconnecting; m_state = EConnectionState::Disconnecting;
} }
virtual void Disconnected([[maybe_unused]] AzFramework::SocketConnection* connection) void Disconnected([[maybe_unused]] AzFramework::SocketConnection* connection) override
{ {
m_state = EConnectionState::Disconnected; m_state = EConnectionState::Disconnected;
} }
virtual void AssetCompilationSuccess(const AZStd::string& assetPath) override void AssetCompilationSuccess(const AZStd::string& assetPath) override
{ {
m_lastAssetProcessorTask = assetPath; m_lastAssetProcessorTask = assetPath;
} }
virtual void AssetCompilationFailed(const AZStd::string& assetPath) override void AssetCompilationFailed(const AZStd::string& assetPath) override
{ {
m_failedJobs.insert(assetPath); m_failedJobs.insert(assetPath);
} }
virtual void CountOfAssetsInQueue(const int& count) override void CountOfAssetsInQueue(const int& count) override
{ {
m_pendingJobsCount = count; m_pendingJobsCount = count;
} }
@ -299,7 +299,7 @@ MainWindow::MainWindow(QWidget* parent)
, m_undoStateAdapter(new UndoStackStateAdapter(this)) , m_undoStateAdapter(new UndoStackStateAdapter(this))
, m_keyboardCustomization(nullptr) , m_keyboardCustomization(nullptr)
, m_activeView(nullptr) , m_activeView(nullptr)
, m_settings("O3DE", "O3DE") , m_settings("O3DE", "O3DE")
, m_toolbarManager(new ToolbarManager(m_actionManager, this)) , m_toolbarManager(new ToolbarManager(m_actionManager, this))
, m_assetImporterManager(new AssetImporterManager(this)) , m_assetImporterManager(new AssetImporterManager(this))
, m_levelEditorMenuHandler(new LevelEditorMenuHandler(this, m_viewPaneManager, m_settings)) , m_levelEditorMenuHandler(new LevelEditorMenuHandler(this, m_viewPaneManager, m_settings))
@ -574,7 +574,7 @@ void MainWindow::closeEvent(QCloseEvent* event)
if (GetIEditor()->GetDocument()) if (GetIEditor()->GetDocument())
{ {
GetIEditor()->GetDocument()->SetModifiedFlag(FALSE); GetIEditor()->GetDocument()->SetModifiedFlag(false);
GetIEditor()->GetDocument()->SetModifiedModules(eModifiedNothing); GetIEditor()->GetDocument()->SetModifiedModules(eModifiedNothing);
} }
// Close all edit panels. // Close all edit panels.
@ -582,7 +582,7 @@ void MainWindow::closeEvent(QCloseEvent* event)
GetIEditor()->GetObjectManager()->EndEditParams(); GetIEditor()->GetObjectManager()->EndEditParams();
// force clean up of all deferred deletes, so that we don't have any issues with windows from plugins not being deleted yet // force clean up of all deferred deletes, so that we don't have any issues with windows from plugins not being deleted yet
qApp->sendPostedEvents(0, QEvent::DeferredDelete); qApp->sendPostedEvents(nullptr, QEvent::DeferredDelete);
QMainWindow::closeEvent(event); QMainWindow::closeEvent(event);
} }
@ -1296,7 +1296,7 @@ void MainWindow::OnEditorNotifyEvent(EEditorNotifyEvent ev)
auto cryEdit = CCryEditApp::instance(); auto cryEdit = CCryEditApp::instance();
if (cryEdit) if (cryEdit)
{ {
cryEdit->SetEditorWindowTitle(0, AZ::Utils::GetProjectName().c_str(), GetIEditor()->GetGameEngine()->GetLevelName()); cryEdit->SetEditorWindowTitle(nullptr, AZ::Utils::GetProjectName().c_str(), GetIEditor()->GetGameEngine()->GetLevelName());
} }
} }
break; break;
@ -1305,7 +1305,7 @@ void MainWindow::OnEditorNotifyEvent(EEditorNotifyEvent ev)
auto cryEdit = CCryEditApp::instance(); auto cryEdit = CCryEditApp::instance();
if (cryEdit) if (cryEdit)
{ {
cryEdit->SetEditorWindowTitle(0, AZ::Utils::GetProjectName().c_str(), 0); cryEdit->SetEditorWindowTitle(nullptr, AZ::Utils::GetProjectName().c_str(), nullptr);
} }
} }
break; break;
@ -1404,8 +1404,8 @@ void MainWindow::ResetAutoSaveTimers(bool bForceInit)
{ {
delete m_autoRemindTimer; delete m_autoRemindTimer;
} }
m_autoSaveTimer = 0; m_autoSaveTimer = nullptr;
m_autoRemindTimer = 0; m_autoRemindTimer = nullptr;
if (bForceInit) if (bForceInit)
{ {
@ -1442,7 +1442,7 @@ void MainWindow::ResetBackgroundUpdateTimer()
if (m_backgroundUpdateTimer) if (m_backgroundUpdateTimer)
{ {
delete m_backgroundUpdateTimer; delete m_backgroundUpdateTimer;
m_backgroundUpdateTimer = 0; m_backgroundUpdateTimer = nullptr;
} }
ICVar* pBackgroundUpdatePeriod = gEnv->pConsole->GetCVar("ed_backgroundUpdatePeriod"); ICVar* pBackgroundUpdatePeriod = gEnv->pConsole->GetCVar("ed_backgroundUpdatePeriod");
@ -1488,7 +1488,7 @@ void MainWindow::OnRefreshAudioSystem()
if (QString::compare(sLevelName, "Untitled", Qt::CaseInsensitive) == 0) if (QString::compare(sLevelName, "Untitled", Qt::CaseInsensitive) == 0)
{ {
// Rather pass NULL to indicate that no level is loaded! // Rather pass nullptr to indicate that no level is loaded!
sLevelName = QString(); sLevelName = QString();
} }
@ -1921,7 +1921,7 @@ QWidget* MainWindow::CreateToolbarWidget(int actionId)
break; break;
case ID_TOOLBAR_WIDGET_SPACER_RIGHT: case ID_TOOLBAR_WIDGET_SPACER_RIGHT:
w = CreateSpacerRightWidget(); w = CreateSpacerRightWidget();
break; break;
default: default:
qWarning() << Q_FUNC_INFO << "Unknown id " << actionId; qWarning() << Q_FUNC_INFO << "Unknown id " << actionId;
return nullptr; return nullptr;

@ -19,7 +19,7 @@
#include <QToolButton> #include <QToolButton>
// Editor // Editor
#include "NewTerrainDialog.h" #include "NewTerrainDialog.h"
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
#include <ui_NewLevelDialog.h> #include <ui_NewLevelDialog.h>
@ -54,7 +54,7 @@ private:
// CNewLevelDialog dialog // CNewLevelDialog dialog
CNewLevelDialog::CNewLevelDialog(QWidget* pParent /*=NULL*/) CNewLevelDialog::CNewLevelDialog(QWidget* pParent /*=nullptr*/)
: QDialog(pParent) : QDialog(pParent)
, m_bUpdate(false) , m_bUpdate(false)
, ui(new Ui::CNewLevelDialog) , ui(new Ui::CNewLevelDialog)
@ -69,7 +69,7 @@ CNewLevelDialog::CNewLevelDialog(QWidget* pParent /*=NULL*/)
m_bIsResize = false; m_bIsResize = false;
ui->TITLE->setText(tr("Assign a name and location to the new level.")); ui->TITLE->setText(tr("Assign a name and location to the new level."));
ui->STATIC1->setText(tr("Location:")); ui->STATIC1->setText(tr("Location:"));
ui->STATIC2->setText(tr("Name:")); ui->STATIC2->setText(tr("Name:"));
@ -98,7 +98,7 @@ CNewLevelDialog::CNewLevelDialog(QWidget* pParent /*=NULL*/)
m_levelFolders = GetLevelsFolder(); m_levelFolders = GetLevelsFolder();
m_level = ""; m_level = "";
// First of all, keyboard focus is related to widget tab order, and the default tab order is based on the order in which // First of all, keyboard focus is related to widget tab order, and the default tab order is based on the order in which
// widgets are constructed. Therefore, creating more widgets changes the keyboard focus. That is why setFocus() is called last. // widgets are constructed. Therefore, creating more widgets changes the keyboard focus. That is why setFocus() is called last.
// Secondly, using singleShot() allows setFocus() slot of the QLineEdit instance to be invoked right after the event system // Secondly, using singleShot() allows setFocus() slot of the QLineEdit instance to be invoked right after the event system
// is ready to do so. Therefore, it is better to use singleShot() than directly call setFocus(). // is ready to do so. Therefore, it is better to use singleShot() than directly call setFocus().

@ -19,7 +19,7 @@ AZ_POP_DISABLE_WARNING
CNewTerrainDialog::CNewTerrainDialog(QWidget* pParent /*=NULL*/) CNewTerrainDialog::CNewTerrainDialog(QWidget* pParent /*=nullptr*/)
: QDialog(pParent) : QDialog(pParent)
, m_terrainResolutionIndex(0) , m_terrainResolutionIndex(0)
, m_terrainUnitsIndex(0) , m_terrainUnitsIndex(0)

@ -133,7 +133,7 @@ IClassDesc* CClassFactory::FindClass(const char* pClassName) const
if (!pSubClassName) if (!pSubClassName)
{ {
return NULL; return nullptr;
} }
QString name = QString(pClassName).left(pSubClassName - pClassName); QString name = QString(pClassName).left(pSubClassName - pClassName);
@ -169,7 +169,7 @@ void CClassFactory::UnregisterClass(const char* pClassName)
{ {
IClassDesc* pClassDesc = FindClass(pClassName); IClassDesc* pClassDesc = FindClass(pClassName);
if (pClassDesc == NULL) if (pClassDesc == nullptr)
{ {
return; return;
} }

@ -18,8 +18,8 @@
#include "Include/IPlugin.h" #include "Include/IPlugin.h"
typedef IPlugin* (* TPfnCreatePluginInstance)(PLUGIN_INIT_PARAM* pInitParam); using TPfnCreatePluginInstance = IPlugin *(*)(PLUGIN_INIT_PARAM *pInitParam);
typedef void (* TPfnQueryPluginSettings)(SPluginSettings&); using TPfnQueryPluginSettings = void (*)(SPluginSettings &);
CPluginManager::CPluginManager() CPluginManager::CPluginManager()
{ {
@ -210,7 +210,7 @@ bool CPluginManager::LoadPlugins(const char* pPathWithMask)
continue; continue;
} }
IPlugin* pPlugin = NULL; IPlugin* pPlugin = nullptr;
PLUGIN_INIT_PARAM sInitParam = PLUGIN_INIT_PARAM sInitParam =
{ {
GetIEditor(), GetIEditor(),
@ -279,7 +279,7 @@ IPlugin* CPluginManager::GetPluginByGUID(const char* pGUID)
} }
} }
return NULL; return nullptr;
} }
IPlugin* CPluginManager::GetPluginByUIID(uint8 iUserInterfaceID) IPlugin* CPluginManager::GetPluginByUIID(uint8 iUserInterfaceID)
@ -290,7 +290,7 @@ IPlugin* CPluginManager::GetPluginByUIID(uint8 iUserInterfaceID)
if (it == m_uuidPluginMap.end()) if (it == m_uuidPluginMap.end())
{ {
return NULL; return nullptr;
} }
return (*it).second; return (*it).second;
@ -302,7 +302,7 @@ IUIEvent* CPluginManager::GetEventByIDAndPluginID(uint8 aPluginID, uint8 aEventI
// specified by its ID and the user interface ID of the plugin which // specified by its ID and the user interface ID of the plugin which
// created the UI element // created the UI element
IPlugin* pPlugin = NULL; IPlugin* pPlugin = nullptr;
TEventHandlerIt eventIt; TEventHandlerIt eventIt;
TPluginEventIt pluginIt; TPluginEventIt pluginIt;
@ -310,21 +310,21 @@ IUIEvent* CPluginManager::GetEventByIDAndPluginID(uint8 aPluginID, uint8 aEventI
if (!pPlugin) if (!pPlugin)
{ {
return NULL; return nullptr;
} }
pluginIt = m_pluginEventMap.find(pPlugin); pluginIt = m_pluginEventMap.find(pPlugin);
if (pluginIt == m_pluginEventMap.end()) if (pluginIt == m_pluginEventMap.end())
{ {
return NULL; return nullptr;
} }
eventIt = (*pluginIt).second.find(aEventID); eventIt = (*pluginIt).second.find(aEventID);
if (eventIt == (*pluginIt).second.end()) if (eventIt == (*pluginIt).second.end())
{ {
return NULL; return nullptr;
} }
return (*eventIt).second; return (*eventIt).second;

@ -323,7 +323,7 @@ namespace
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void GetPythonArgumentsVector(const char* pArguments, QStringList& inputArguments) void GetPythonArgumentsVector(const char* pArguments, QStringList& inputArguments)
{ {
if (pArguments == NULL) if (pArguments == nullptr)
{ {
return; return;
} }

@ -89,7 +89,7 @@ int ResizeResolutionModel::SizeRow(uint32 dwSize) const
// CResizeResolutionDialog dialog // CResizeResolutionDialog dialog
CResizeResolutionDialog::CResizeResolutionDialog(QWidget* pParent /*=NULL*/) CResizeResolutionDialog::CResizeResolutionDialog(QWidget* pParent /*=nullptr*/)
: QDialog(pParent) : QDialog(pParent)
, m_model(new ResizeResolutionModel(this)) , m_model(new ResizeResolutionModel(this))
, ui(new Ui::CResizeResolutionDialog) , ui(new Ui::CResizeResolutionDialog)

@ -101,7 +101,7 @@ public:
} }
private: private:
typedef std::map<string, const SStaticResourceSelectorEntry*, stl::less_stricmp<string> > TTypeMap; using TTypeMap = std::map<string, const SStaticResourceSelectorEntry *, stl::less_stricmp<string>>;
TTypeMap m_typeMap; TTypeMap m_typeMap;
std::map<string, string> m_globallySelectedResources; std::map<string, string> m_globallySelectedResources;

@ -49,7 +49,7 @@ QString CSelectEAXPresetDlg::GetCurrPreset() const
{ {
return m_ui->listView->currentIndex().data().toString(); return m_ui->listView->currentIndex().data().toString();
} }
// EXCEPTION: OCX Property Pages should return FALSE // EXCEPTION: OCX Property Pages should return false
return QString(); return QString();
} }

@ -244,7 +244,7 @@ SEditorSettings::SEditorSettings()
gui.nToolbarIconSize = static_cast<int>(AzQtComponents::ToolBar::ToolBarIconSize::Default); gui.nToolbarIconSize = static_cast<int>(AzQtComponents::ToolBar::ToolBarIconSize::Default);
int lfHeight = 8;// -MulDiv(8, GetDeviceCaps(GetDC(NULL), LOGPIXELSY), 72); int lfHeight = 8;// -MulDiv(8, GetDeviceCaps(GetDC(nullptr), LOGPIXELSY), 72);
gui.nDefaultFontHieght = lfHeight; gui.nDefaultFontHieght = lfHeight;
gui.hSystemFont = QFont("Ms Shell Dlg 2", lfHeight, QFont::Normal); gui.hSystemFont = QFont("Ms Shell Dlg 2", lfHeight, QFont::Normal);
gui.hSystemFontBold = QFont("Ms Shell Dlg 2", lfHeight, QFont::Bold); gui.hSystemFontBold = QFont("Ms Shell Dlg 2", lfHeight, QFont::Bold);
@ -533,7 +533,7 @@ void SEditorSettings::Save()
SaveValue("Settings", "ShowTimeInConsole", bShowTimeInConsole); SaveValue("Settings", "ShowTimeInConsole", bShowTimeInConsole);
SaveValue("Settings", "EnableSceneInspector", enableSceneInspector); SaveValue("Settings", "EnableSceneInspector", enableSceneInspector);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Viewport settings. // Viewport settings.
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -626,7 +626,7 @@ void SEditorSettings::Save()
SaveValue("Settings\\AssetBrowser", "AutoFilterFromViewportSelection", sAssetBrowserSettings.bAutoFilterFromViewportSelection); SaveValue("Settings\\AssetBrowser", "AutoFilterFromViewportSelection", sAssetBrowserSettings.bAutoFilterFromViewportSelection);
SaveValue("Settings\\AssetBrowser", "VisibleColumnNames", sAssetBrowserSettings.sVisibleColumnNames); SaveValue("Settings\\AssetBrowser", "VisibleColumnNames", sAssetBrowserSettings.sVisibleColumnNames);
SaveValue("Settings\\AssetBrowser", "ColumnNames", sAssetBrowserSettings.sColumnNames); SaveValue("Settings\\AssetBrowser", "ColumnNames", sAssetBrowserSettings.sColumnNames);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Deep Selection Settings // Deep Selection Settings
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -705,7 +705,7 @@ void SEditorSettings::Load()
QString strPlaceholderString; QString strPlaceholderString;
// Load settings from registry. // Load settings from registry.
LoadValue("Settings", "UndoLevels", undoLevels); LoadValue("Settings", "UndoLevels", undoLevels);
LoadValue("Settings", "UndoSliceOverrideSaveValue", m_undoSliceOverrideSaveValue); LoadValue("Settings", "UndoSliceOverrideSaveValue", m_undoSliceOverrideSaveValue);
LoadValue("Settings", "ShowWelcomeScreenAtStartup", bShowDashboardAtStartup); LoadValue("Settings", "ShowWelcomeScreenAtStartup", bShowDashboardAtStartup);
LoadValue("Settings", "ShowCircularDependencyError", m_showCircularDependencyError); LoadValue("Settings", "ShowCircularDependencyError", m_showCircularDependencyError);
LoadValue("Settings", "LoadLastLevelAtStartup", bAutoloadLastLevelAtStartup); LoadValue("Settings", "LoadLastLevelAtStartup", bAutoloadLastLevelAtStartup);

@ -105,7 +105,7 @@ bool CSettingsManager::CreateDefaultLayoutSettingsFile()
AZStd::vector<AZStd::string> CSettingsManager::BuildSettingsList() AZStd::vector<AZStd::string> CSettingsManager::BuildSettingsList()
{ {
XmlNodeRef root = NULL; XmlNodeRef root = nullptr;
root = m_pSettingsManagerMemoryNode; root = m_pSettingsManagerMemoryNode;
@ -132,8 +132,8 @@ void CSettingsManager::BuildSettingsList_Helper(const XmlNodeRef& node, const AZ
{ {
for (int i = 0; i < node->getNumAttributes(); ++i) for (int i = 0; i < node->getNumAttributes(); ++i)
{ {
const char* key = NULL; const char* key = nullptr;
const char* value = NULL; const char* value = nullptr;
node->getAttributeByIndex(i, &key, &value); node->getAttributeByIndex(i, &key, &value);
if (!pathToNode.empty()) if (!pathToNode.empty())
{ {
@ -163,7 +163,7 @@ void CSettingsManager::BuildSettingsList_Helper(const XmlNodeRef& node, const AZ
result result
); );
} }
} }
} }
} }
@ -190,7 +190,7 @@ void CSettingsManager::SaveSetting(const QString& path, const QString& attr, con
// Spaces in node names not allowed // Spaces in node names not allowed
writeAttr.replace(" ", ""); writeAttr.replace(" ", "");
XmlNodeRef root = NULL; XmlNodeRef root = nullptr;
root = m_pSettingsManagerMemoryNode; root = m_pSettingsManagerMemoryNode;
@ -276,11 +276,11 @@ XmlNodeRef CSettingsManager::LoadSetting(const QString& path, const QString& att
// Spaces in node names not allowed // Spaces in node names not allowed
readAttr.replace(" ", ""); readAttr.replace(" ", "");
XmlNodeRef root = NULL; XmlNodeRef root = nullptr;
root = m_pSettingsManagerMemoryNode; root = m_pSettingsManagerMemoryNode;
XmlNodeRef tmpNode = NULL; XmlNodeRef tmpNode = nullptr;
if (NeedSettingsNode(path)) if (NeedSettingsNode(path))
{ {
@ -293,7 +293,7 @@ XmlNodeRef CSettingsManager::LoadSetting(const QString& path, const QString& att
if (!tmpNode) if (!tmpNode)
{ {
return 0; return nullptr;
} }
for (int i = 0; i < strNodes.size(); ++i) for (int i = 0; i < strNodes.size(); ++i)
@ -304,13 +304,13 @@ XmlNodeRef CSettingsManager::LoadSetting(const QString& path, const QString& att
} }
else else
{ {
return 0; return nullptr;
} }
} }
if (!tmpNode->findChild(readAttr.toUtf8().data())) if (!tmpNode->findChild(readAttr.toUtf8().data()))
{ {
return 0; return nullptr;
} }
else else
{ {
@ -360,7 +360,7 @@ void CSettingsManager::AddToolVersion(const QString& toolName, const QString& to
return; return;
} }
if (stl::find_in_map(m_toolNames, toolName, NULL) == "") if (stl::find_in_map(m_toolNames, toolName, nullptr) == "")
{ {
if (!toolVersion.isEmpty()) if (!toolVersion.isEmpty())
{ {
@ -380,7 +380,7 @@ void CSettingsManager::AddToolName(const QString& toolName, const QString& human
return; return;
} }
if (stl::find_in_map(m_toolNames, toolName, NULL) == "") if (stl::find_in_map(m_toolNames, toolName, nullptr) == "")
{ {
if (!humanReadableName.isEmpty()) if (!humanReadableName.isEmpty())
{ {
@ -499,7 +499,7 @@ void CSettingsManager::GetMatchingLayoutNames(TToolNamesMap& foundTools, XmlNode
return; return;
} }
TToolNamesMap* toolNames = NULL; TToolNamesMap* toolNames = nullptr;
if (!foundTools.empty()) if (!foundTools.empty())
{ {
@ -593,11 +593,11 @@ bool CSettingsManager::NeedSettingsNode(const QString& path)
{ {
if ((path != EDITOR_LAYOUT_ROOT_NODE) && (path != TOOLBOX_NODE) && (path != TOOLBOXMACROS_NODE)) if ((path != EDITOR_LAYOUT_ROOT_NODE) && (path != TOOLBOX_NODE) && (path != TOOLBOXMACROS_NODE))
{ {
return TRUE; return true;
} }
else else
{ {
return FALSE; return false;
} }
} }
@ -605,13 +605,13 @@ void CSettingsManager::SerializeCVars(XmlNodeRef& node, bool bLoad)
{ {
int nNumberOfVariables(0); int nNumberOfVariables(0);
int nCurrentVariable(0); int nCurrentVariable(0);
IConsole* piConsole(NULL); IConsole* piConsole(nullptr);
ICVar* piVariable(NULL); ICVar* piVariable(nullptr);
std::vector<char*> cszVariableNames; std::vector<char*> cszVariableNames;
char* szKey(NULL); char* szKey(nullptr);
char* szValue(NULL); char* szValue(nullptr);
ICVar* piCVar(NULL); ICVar* piCVar(nullptr);
piConsole = gEnv->pConsole; piConsole = gEnv->pConsole;
@ -622,7 +622,7 @@ void CSettingsManager::SerializeCVars(XmlNodeRef& node, bool bLoad)
if (bLoad) if (bLoad)
{ {
XmlNodeRef readNode = NULL; XmlNodeRef readNode = nullptr;
XmlNodeRef inputCVarsNode = node->findChild(CVARS_NODE); XmlNodeRef inputCVarsNode = node->findChild(CVARS_NODE);
if (!inputCVarsNode) if (!inputCVarsNode)
@ -649,7 +649,7 @@ void CSettingsManager::SerializeCVars(XmlNodeRef& node, bool bLoad)
} }
else else
{ {
XmlNodeRef newCVarNode = NULL; XmlNodeRef newCVarNode = nullptr;
XmlNodeRef oldCVarsNode = node->findChild(CVARS_NODE); XmlNodeRef oldCVarsNode = node->findChild(CVARS_NODE);
if (oldCVarsNode) if (oldCVarsNode)
@ -660,9 +660,9 @@ void CSettingsManager::SerializeCVars(XmlNodeRef& node, bool bLoad)
XmlNodeRef cvarsNode = XmlHelpers::CreateXmlNode(CVARS_NODE); XmlNodeRef cvarsNode = XmlHelpers::CreateXmlNode(CVARS_NODE);
nNumberOfVariables = piConsole->GetNumVisibleVars(); nNumberOfVariables = piConsole->GetNumVisibleVars();
cszVariableNames.resize(nNumberOfVariables, NULL); cszVariableNames.resize(nNumberOfVariables, nullptr);
if (piConsole->GetSortedVars((const char**)&cszVariableNames.front(), nNumberOfVariables, NULL) != nNumberOfVariables) if (piConsole->GetSortedVars((const char**)&cszVariableNames.front(), nNumberOfVariables, nullptr) != nNumberOfVariables)
{ {
assert(false); assert(false);
return; return;
@ -711,8 +711,8 @@ void CSettingsManager::ReadValueStr(XmlNodeRef& sourceNode, const QString& path,
// Spaces in node names not allowed // Spaces in node names not allowed
readAttr.replace(" ", ""); readAttr.replace(" ", "");
XmlNodeRef root = NULL; XmlNodeRef root = nullptr;
XmlNodeRef tmpNode = NULL; XmlNodeRef tmpNode = nullptr;
if (NeedSettingsNode(path)) if (NeedSettingsNode(path))
{ {
@ -809,7 +809,7 @@ bool CSettingsManager::IsEventSafe(const SEventLog& event)
if (!root) if (!root)
{ {
return TRUE; return true;
} }
QString eventName = event.m_eventName; QString eventName = event.m_eventName;
@ -823,7 +823,7 @@ bool CSettingsManager::IsEventSafe(const SEventLog& event)
// Log entry not found, so it is safe to start // Log entry not found, so it is safe to start
if (!resNode) if (!resNode)
{ {
return TRUE; return true;
} }
XmlNodeRef callerVersion = resNode->findChild(EVENT_LOG_CALLER_VERSION); XmlNodeRef callerVersion = resNode->findChild(EVENT_LOG_CALLER_VERSION);
@ -841,15 +841,15 @@ bool CSettingsManager::IsEventSafe(const SEventLog& event)
{ {
if (callerVersionStr != GetToolVersion(eventName)) if (callerVersionStr != GetToolVersion(eventName))
{ {
return TRUE; return true;
} }
} }
// The same version of tool/level found // The same version of tool/level found
return FALSE; return false;
} }
return TRUE; return true;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -947,15 +947,15 @@ XmlNodeRef CSettingsManager::LoadLogEventSetting(const QString& path, const QStr
if (!root) if (!root)
{ {
return 0; return nullptr;
} }
XmlNodeRef tmpNode = NULL; XmlNodeRef tmpNode = nullptr;
tmpNode = root; tmpNode = root;
if (!tmpNode) if (!tmpNode)
{ {
return 0; return nullptr;
} }
for (int i = 0; i < strNodes.size(); ++i) for (int i = 0; i < strNodes.size(); ++i)
@ -966,7 +966,7 @@ XmlNodeRef CSettingsManager::LoadLogEventSetting(const QString& path, const QStr
} }
else else
{ {
return 0; return nullptr;
} }
} }
@ -975,7 +975,7 @@ XmlNodeRef CSettingsManager::LoadLogEventSetting(const QString& path, const QStr
return tmpNode; return tmpNode;
} }
return 0; return nullptr;
} }
QString CSettingsManager::GenerateContentHash(XmlNodeRef& node, QString sourceName) QString CSettingsManager::GenerateContentHash(XmlNodeRef& node, QString sourceName)

@ -84,7 +84,7 @@ void CSettingsManagerDialog::OnReadBtnClick()
ui->m_layoutListBox->clear(); ui->m_layoutListBox->clear();
TToolNamesMap toolNames; TToolNamesMap toolNames;
XmlNodeRef dummyNode = NULL; XmlNodeRef dummyNode = nullptr;
GetIEditor()->GetSettingsManager()->GetMatchingLayoutNames(toolNames, dummyNode, m_importFileStr); GetIEditor()->GetSettingsManager()->GetMatchingLayoutNames(toolNames, dummyNode, m_importFileStr);

@ -27,14 +27,14 @@ AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CStartupLogoDialog dialog // CStartupLogoDialog dialog
CStartupLogoDialog* CStartupLogoDialog::s_pLogoWindow = 0; CStartupLogoDialog* CStartupLogoDialog::s_pLogoWindow = nullptr;
CStartupLogoDialog::CStartupLogoDialog(QString versionText, QString richTextCopyrightNotice, QWidget* pParent /*=NULL*/) CStartupLogoDialog::CStartupLogoDialog(QString versionText, QString richTextCopyrightNotice, QWidget* pParent /*=nullptr*/)
: QWidget(pParent, Qt::Dialog | Qt::FramelessWindowHint) : QWidget(pParent, Qt::Dialog | Qt::FramelessWindowHint)
, m_ui(new Ui::StartupLogoDialog) , m_ui(new Ui::StartupLogoDialog)
{ {
m_ui->setupUi(this); m_ui->setupUi(this);
s_pLogoWindow = this; s_pLogoWindow = this;
m_backgroundImage = QPixmap(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg")); m_backgroundImage = QPixmap(QStringLiteral(":/StartupLogoDialog/splashscreen_background_developer_preview.jpg"));
@ -61,7 +61,7 @@ CStartupLogoDialog::CStartupLogoDialog(QString versionText, QString richTextCopy
CStartupLogoDialog::~CStartupLogoDialog() CStartupLogoDialog::~CStartupLogoDialog()
{ {
s_pLogoWindow = 0; s_pLogoWindow = nullptr;
} }
void CStartupLogoDialog::SetText(const char* text) void CStartupLogoDialog::SetText(const char* text)

@ -25,7 +25,7 @@ typedef bool (StringDlgPredicate)(QString input);
class StringDlg : public QInputDialog class StringDlg : public QInputDialog
{ {
public: public:
StringDlg(const QString &title, QWidget* pParent = NULL, bool bFileNameLimitation = false); StringDlg(const QString &title, QWidget* pParent = nullptr, bool bFileNameLimitation = false);
void SetCheckCallback(const std::function<StringDlgPredicate>& Check) { void SetCheckCallback(const std::function<StringDlgPredicate>& Check) {
m_Check = Check; m_Check = Check;

@ -186,7 +186,7 @@ const CToolBoxMacro* CToolBoxManager::GetMacro(int iIndex, bool bToolbox) const
assert(0 <= iIndex && iIndex < m_shelveMacros.size()); assert(0 <= iIndex && iIndex < m_shelveMacros.size());
return m_shelveMacros[iIndex]; return m_shelveMacros[iIndex];
} }
return NULL; return nullptr;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -202,7 +202,7 @@ CToolBoxMacro* CToolBoxManager::GetMacro(int iIndex, bool bToolbox)
assert(0 <= iIndex && iIndex < m_shelveMacros.size()); assert(0 <= iIndex && iIndex < m_shelveMacros.size());
return m_shelveMacros[iIndex]; return m_shelveMacros[iIndex];
} }
return NULL; return nullptr;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -240,14 +240,14 @@ CToolBoxMacro* CToolBoxManager::NewMacro(const QString& title, bool bToolbox, in
const int macroCount = m_macros.size(); const int macroCount = m_macros.size();
if (macroCount > ID_TOOL_LAST - ID_TOOL_FIRST + 1) if (macroCount > ID_TOOL_LAST - ID_TOOL_FIRST + 1)
{ {
return NULL; return nullptr;
} }
for (size_t i = 0; i < macroCount; ++i) for (size_t i = 0; i < macroCount; ++i)
{ {
if (QString::compare(m_macros[i]->GetTitle(), title, Qt::CaseInsensitive) == 0) if (QString::compare(m_macros[i]->GetTitle(), title, Qt::CaseInsensitive) == 0)
{ {
return NULL; return nullptr;
} }
} }
@ -264,7 +264,7 @@ CToolBoxMacro* CToolBoxManager::NewMacro(const QString& title, bool bToolbox, in
const int shelveMacroCount = m_shelveMacros.size(); const int shelveMacroCount = m_shelveMacros.size();
if (shelveMacroCount > ID_TOOL_SHELVE_LAST - ID_TOOL_SHELVE_FIRST + 1) if (shelveMacroCount > ID_TOOL_SHELVE_LAST - ID_TOOL_SHELVE_FIRST + 1)
{ {
return NULL; return nullptr;
} }
CToolBoxMacro* pNewTool = new CToolBoxMacro(title); CToolBoxMacro* pNewTool = new CToolBoxMacro(title);
@ -275,7 +275,7 @@ CToolBoxMacro* CToolBoxManager::NewMacro(const QString& title, bool bToolbox, in
m_shelveMacros.push_back(pNewTool); m_shelveMacros.push_back(pNewTool);
return pNewTool; return pNewTool;
} }
return NULL; return nullptr;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -333,7 +333,7 @@ void CToolBoxManager::Load([[maybe_unused]] ActionManager* actionManager)
void CToolBoxManager::Load(QString xmlpath, AmazonToolbar* pToolbar, bool bToolbox, ActionManager* actionManager) void CToolBoxManager::Load(QString xmlpath, AmazonToolbar* pToolbar, bool bToolbox, ActionManager* actionManager)
{ {
XmlNodeRef toolBoxNode = XmlHelpers::LoadXmlFromFile(xmlpath.toUtf8().data()); XmlNodeRef toolBoxNode = XmlHelpers::LoadXmlFromFile(xmlpath.toUtf8().data());
if (toolBoxNode == NULL) if (toolBoxNode == nullptr)
{ {
return; return;
} }

@ -137,7 +137,7 @@ public:
CToolBoxMacro* GetMacro(int iIndex, bool bToolbox); CToolBoxMacro* GetMacro(int iIndex, bool bToolbox);
//! Get the index of a macro from its title. //! Get the index of a macro from its title.
int GetMacroIndex(const QString& title, bool bToolbox) const; int GetMacroIndex(const QString& title, bool bToolbox) const;
//! Creates a new macro in the manager. If the title is duplicate, this returns NULL. //! Creates a new macro in the manager. If the title is duplicate, this returns nullptr.
CToolBoxMacro* NewMacro(const QString& title, bool bToolbox, int* newIdx); CToolBoxMacro* NewMacro(const QString& title, bool bToolbox, int* newIdx);
//! Try to change the title of a macro. If the title is duplicate, the change is aborted and this returns false. //! Try to change the title of a macro. If the title is duplicate, the change is aborted and this returns false.
bool SetMacroTitle(int index, const QString& title, bool bToolbox); bool SetMacroTitle(int index, const QString& title, bool bToolbox);

@ -109,7 +109,7 @@ private:
QStringList m_iconFiles; QStringList m_iconFiles;
}; };
CIconListDialog::CIconListDialog(QWidget* pParent /* = NULL */) CIconListDialog::CIconListDialog(QWidget* pParent /* = nullptr */)
: QDialog(pParent) : QDialog(pParent)
, m_ui(new Ui::IconListDialog) , m_ui(new Ui::IconListDialog)
{ {
@ -498,7 +498,7 @@ CToolsConfigPage::CToolsConfigPage(QWidget* parent)
QKeySequence shortcut(value); QKeySequence shortcut(value);
m_ui->m_macroShortcutKey->setKeySequence(shortcut); m_ui->m_macroShortcutKey->setKeySequence(shortcut);
} }
if (m_ui->m_macroShortcutKey->keySequence().count() >= 1) if (m_ui->m_macroShortcutKey->keySequence().count() >= 1)
{ {
m_ui->m_assignShortcut->setEnabled(true); m_ui->m_assignShortcut->setEnabled(true);
@ -703,7 +703,7 @@ void CToolsConfigPage::OnAssignMacroShortcut()
{ {
auto pShortcutMgr = MainWindow::instance()->GetShortcutManager(); auto pShortcutMgr = MainWindow::instance()->GetShortcutManager();
if (pShortcutMgr == NULL) if (pShortcutMgr == nullptr)
{ {
return; return;
} }

@ -59,7 +59,7 @@ void CUIEnumsDatabase::SetEnumStrings(const QString& enumName, const QStringList
{ {
int nStringCount = sStringsArray.size(); int nStringCount = sStringsArray.size();
CUIEnumsDatabase_SEnum* pEnum = stl::find_in_map(m_enums, enumName, 0); CUIEnumsDatabase_SEnum* pEnum = stl::find_in_map(m_enums, enumName, nullptr);
if (!pEnum) if (!pEnum)
{ {
pEnum = new CUIEnumsDatabase_SEnum; pEnum = new CUIEnumsDatabase_SEnum;
@ -86,6 +86,6 @@ void CUIEnumsDatabase::SetEnumStrings(const QString& enumName, const QStringList
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
CUIEnumsDatabase_SEnum* CUIEnumsDatabase::FindEnum(const QString& enumName) const CUIEnumsDatabase_SEnum* CUIEnumsDatabase::FindEnum(const QString& enumName) const
{ {
CUIEnumsDatabase_SEnum* pEnum = stl::find_in_map(m_enums, enumName, 0); CUIEnumsDatabase_SEnum* pEnum = stl::find_in_map(m_enums, enumName, nullptr);
return pEnum; return pEnum;
} }

@ -56,7 +56,7 @@ public:
m_manager.AddListener(this); m_manager.AddListener(this);
} }
virtual ~UndoDropDownListModel() ~UndoDropDownListModel() override
{ {
m_manager.RemoveListener(this); m_manager.RemoveListener(this);
} }
@ -81,7 +81,7 @@ public:
return m_stackNames[index.row()]; return m_stackNames[index.row()];
} }
void SignalNumUndoRedo(const unsigned int& numUndo, const unsigned int& numRedo) void SignalNumUndoRedo(const unsigned int& numUndo, const unsigned int& numRedo) override
{ {
std::vector<QString> fresh; std::vector<QString> fresh;
if (UndoRedoDirection::Undo == m_direction && m_stackNames.size() != numUndo) if (UndoRedoDirection::Undo == m_direction && m_stackNames.size() != numUndo)

@ -55,7 +55,7 @@ CViewManager::CViewManager()
m_updateRegion.min = Vec3(-100000, -100000, -100000); m_updateRegion.min = Vec3(-100000, -100000, -100000);
m_updateRegion.max = Vec3(100000, 100000, 100000); m_updateRegion.max = Vec3(100000, 100000, 100000);
m_pSelectedView = NULL; m_pSelectedView = nullptr;
m_nGameViewports = 0; m_nGameViewports = 0;
m_bGameViewportsUpdated = false; m_bGameViewportsUpdated = false;
@ -117,7 +117,7 @@ void CViewManager::UnregisterViewport(CViewport* pViewport)
{ {
if (m_pSelectedView == pViewport) if (m_pSelectedView == pViewport)
{ {
m_pSelectedView = NULL; m_pSelectedView = nullptr;
} }
stl::find_and_erase(m_viewports, pViewport); stl::find_and_erase(m_viewports, pViewport);
m_bGameViewportsUpdated = false; m_bGameViewportsUpdated = false;
@ -137,7 +137,7 @@ CViewport* CViewManager::GetViewport(EViewportType type) const
return m_viewports[i]; return m_viewports[i];
} }
} }
return 0; return nullptr;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -150,7 +150,7 @@ CViewport* CViewManager::GetViewport(const QString& name) const
return m_viewports[i]; return m_viewports[i];
} }
} }
return 0; return nullptr;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -234,7 +234,7 @@ void CViewManager::SelectViewport(CViewport* pViewport)
{ {
// Audio: Handle viewport change for listeners // Audio: Handle viewport change for listeners
if (m_pSelectedView != NULL && m_pSelectedView != pViewport) if (m_pSelectedView != nullptr && m_pSelectedView != pViewport)
{ {
m_pSelectedView->SetSelected(false); m_pSelectedView->SetSelected(false);
@ -242,7 +242,7 @@ void CViewManager::SelectViewport(CViewport* pViewport)
m_pSelectedView = pViewport; m_pSelectedView = pViewport;
if (m_pSelectedView != NULL) if (m_pSelectedView != nullptr)
{ {
m_pSelectedView->SetSelected(true); m_pSelectedView->SetSelected(true);
} }

@ -93,7 +93,7 @@ public:
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
//! Get current layout window. //! Get current layout window.
//! @return Pointer to the layout window, can be NULL. //! @return Pointer to the layout window, can be nullptr.
virtual CLayoutWnd* GetLayout() const; virtual CLayoutWnd* GetLayout() const;
//! Cycle between different 2D viewports type on same view pane. //! Cycle between different 2D viewports type on same view pane.

@ -159,8 +159,8 @@ CLayoutViewPane::CLayoutViewPane(QWidget* parent)
, m_viewportTitleDlg(this) , m_viewportTitleDlg(this)
, m_expanderWatcher(new ViewportTitleExpanderWatcher(this, &m_viewportTitleDlg)) , m_expanderWatcher(new ViewportTitleExpanderWatcher(this, &m_viewportTitleDlg))
{ {
m_viewport = 0; m_viewport = nullptr;
m_active = 0; m_active = false;
m_nBorder = VIEW_BORDER; m_nBorder = VIEW_BORDER;
m_bFullscreen = false; m_bFullscreen = false;
@ -338,7 +338,7 @@ void CLayoutViewPane::DetachViewport()
{ {
DisconnectRenderViewportInteractionRequestBus(); DisconnectRenderViewportInteractionRequestBus();
OnFOVChanged(gSettings.viewports.fDefaultFov); OnFOVChanged(gSettings.viewports.fDefaultFov);
m_viewport = 0; m_viewport = nullptr;
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@ -348,7 +348,7 @@ void CLayoutViewPane::ReleaseViewport()
{ {
DisconnectRenderViewportInteractionRequestBus(); DisconnectRenderViewportInteractionRequestBus();
m_viewport->deleteLater(); m_viewport->deleteLater();
m_viewport = 0; m_viewport = nullptr;
} }
} }

@ -192,7 +192,7 @@ QtViewport::QtViewport(QWidget* parent)
m_viewTM.SetIdentity(); m_viewTM.SetIdentity();
m_screenTM.SetIdentity(); m_screenTM.SetIdentity();
m_pMouseOverObject = 0; m_pMouseOverObject = nullptr;
m_bAdvancedSelectMode = false; m_bAdvancedSelectMode = false;
@ -398,7 +398,7 @@ void QtViewport::OnDeactivate()
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void QtViewport::ResetContent() void QtViewport::ResetContent()
{ {
m_pMouseOverObject = 0; m_pMouseOverObject = nullptr;
// Need to clear visual object cache. // Need to clear visual object cache.
// Right after loading new level, some code(e.g. OnMouseMove) access invalid // Right after loading new level, some code(e.g. OnMouseMove) access invalid

@ -113,7 +113,7 @@ public:
virtual void AddPostRenderer(IPostRenderer* pPostRenderer) = 0; virtual void AddPostRenderer(IPostRenderer* pPostRenderer) = 0;
virtual bool RemovePostRenderer(IPostRenderer* pPostRenderer) = 0; virtual bool RemovePostRenderer(IPostRenderer* pPostRenderer) = 0;
virtual BOOL DestroyWindow() { return FALSE; } virtual bool DestroyWindow() { return false; }
/** Get type of this viewport. /** Get type of this viewport.
*/ */
@ -252,7 +252,7 @@ public:
virtual void SetCursorString(const QString& str) = 0; virtual void SetCursorString(const QString& str) = 0;
virtual void SetFocus() = 0; virtual void SetFocus() = 0;
virtual void Invalidate(BOOL bErase = 1) = 0; virtual void Invalidate(bool bErase = 1) = 0;
// Is overridden by RenderViewport // Is overridden by RenderViewport
virtual void SetFOV([[maybe_unused]] float fov) {} virtual void SetFOV([[maybe_unused]] float fov) {}
@ -266,8 +266,8 @@ public:
void SetViewPane(CLayoutViewPane* viewPane) { m_viewPane = viewPane; } void SetViewPane(CLayoutViewPane* viewPane) { m_viewPane = viewPane; }
//Child classes can override these to provide extra logic that wraps //Child classes can override these to provide extra logic that wraps
//widget rendering. Needed by the RenderViewport to handle raycasts //widget rendering. Needed by the RenderViewport to handle raycasts
//from screen-space to world-space. //from screen-space to world-space.
virtual void PreWidgetRendering() {} virtual void PreWidgetRendering() {}
virtual void PostWidgetRendering() {} virtual void PostWidgetRendering() {}
@ -346,7 +346,7 @@ public:
QString GetName() const; QString GetName() const;
virtual void SetFocus() { setFocus(); } virtual void SetFocus() { setFocus(); }
virtual void Invalidate([[maybe_unused]] BOOL bErase = 1) { update(); } virtual void Invalidate([[maybe_unused]] bool bErase = 1) { update(); }
// Is overridden by RenderViewport // Is overridden by RenderViewport
virtual void SetFOV([[maybe_unused]] float fov) {} virtual void SetFOV([[maybe_unused]] float fov) {}

@ -91,7 +91,7 @@ namespace
void ViewportInfoStatusUpdated(int newIndex); void ViewportInfoStatusUpdated(int newIndex);
private: private:
void OnViewportInfoDisplayStateChanged(AZ::AtomBridge::ViewportInfoDisplayState state) void OnViewportInfoDisplayStateChanged(AZ::AtomBridge::ViewportInfoDisplayState state) override
{ {
emit ViewportInfoStatusUpdated(static_cast<int>(state)); emit ViewportInfoStatusUpdated(static_cast<int>(state));
} }

@ -19,7 +19,7 @@ const char* CWipFeatureManager::kWipFeaturesFilename = "@user@\\Editor\\UI\\WipF
#else #else
const char* CWipFeatureManager::kWipFeaturesFilename = "@user@/Editor/UI/WipFeatures.xml"; const char* CWipFeatureManager::kWipFeaturesFilename = "@user@/Editor/UI/WipFeatures.xml";
#endif #endif
CWipFeatureManager* CWipFeatureManager::s_pInstance = NULL; CWipFeatureManager* CWipFeatureManager::s_pInstance = nullptr;
static void WipFeatureVarChange(ICVar* pVar) static void WipFeatureVarChange(ICVar* pVar)
{ {
@ -162,7 +162,7 @@ void CWipFeatureManager::Shutdown()
{ {
CWipFeatureManager::Instance()->Save(); CWipFeatureManager::Instance()->Save();
delete s_pInstance; delete s_pInstance;
s_pInstance = NULL; s_pInstance = nullptr;
} }
bool CWipFeatureManager::Load(const char* pFilename, bool bClearExisting) bool CWipFeatureManager::Load(const char* pFilename, bool bClearExisting)
@ -350,7 +350,7 @@ void CWipFeatureManager::ShowFeature(int aFeatureId, bool bShow)
if (m_features[aFeatureId].m_pfnUpdateFeature) if (m_features[aFeatureId].m_pfnUpdateFeature)
{ {
m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, &bShow, NULL, NULL, NULL); m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, &bShow, nullptr, nullptr, nullptr);
} }
} }
@ -360,7 +360,7 @@ void CWipFeatureManager::EnableFeature(int aFeatureId, bool bEnable)
if (m_features[aFeatureId].m_pfnUpdateFeature) if (m_features[aFeatureId].m_pfnUpdateFeature)
{ {
m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, NULL, &bEnable, NULL, NULL); m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, nullptr, &bEnable, nullptr, nullptr);
} }
} }
@ -370,7 +370,7 @@ void CWipFeatureManager::SetFeatureSafeMode(int aFeatureId, bool bSafeMode)
if (m_features[aFeatureId].m_pfnUpdateFeature) if (m_features[aFeatureId].m_pfnUpdateFeature)
{ {
m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, NULL, NULL, &bSafeMode, NULL); m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, nullptr, nullptr, &bSafeMode, nullptr);
} }
} }
@ -380,7 +380,7 @@ void CWipFeatureManager::SetFeatureParams(int aFeatureId, const char* pParams)
if (m_features[aFeatureId].m_pfnUpdateFeature) if (m_features[aFeatureId].m_pfnUpdateFeature)
{ {
m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, NULL, NULL, NULL, pParams); m_features[aFeatureId].m_pfnUpdateFeature(aFeatureId, nullptr, nullptr, nullptr, pParams);
} }
} }
@ -392,7 +392,7 @@ void CWipFeatureManager::ShowAllFeatures(bool bShow)
if (iter->second.m_pfnUpdateFeature) if (iter->second.m_pfnUpdateFeature)
{ {
iter->second.m_pfnUpdateFeature(iter->first, &bShow, NULL, NULL, NULL); iter->second.m_pfnUpdateFeature(iter->first, &bShow, nullptr, nullptr, nullptr);
} }
} }
} }
@ -405,7 +405,7 @@ void CWipFeatureManager::EnableAllFeatures(bool bEnable)
if (iter->second.m_pfnUpdateFeature) if (iter->second.m_pfnUpdateFeature)
{ {
iter->second.m_pfnUpdateFeature(iter->first, NULL, &bEnable, NULL, NULL); iter->second.m_pfnUpdateFeature(iter->first, nullptr, &bEnable, nullptr, nullptr);
} }
} }
} }
@ -418,7 +418,7 @@ void CWipFeatureManager::SetAllFeaturesSafeMode(bool bSafeMode)
if (iter->second.m_pfnUpdateFeature) if (iter->second.m_pfnUpdateFeature)
{ {
iter->second.m_pfnUpdateFeature(iter->first, NULL, NULL, &bSafeMode, NULL); iter->second.m_pfnUpdateFeature(iter->first, nullptr, nullptr, &bSafeMode, nullptr);
} }
} }
} }
@ -431,7 +431,7 @@ void CWipFeatureManager::SetAllFeaturesParams(const char* pParams)
if (iter->second.m_pfnUpdateFeature) if (iter->second.m_pfnUpdateFeature)
{ {
iter->second.m_pfnUpdateFeature(iter->first, NULL, NULL, NULL, pParams); iter->second.m_pfnUpdateFeature(iter->first, nullptr, nullptr, nullptr, pParams);
} }
} }
} }

@ -48,7 +48,7 @@ public:
static const char* kWipFeaturesFilename; static const char* kWipFeaturesFilename;
// Used to register a callback function to update the state of features whitin the editor // Used to register a callback function to update the state of features whitin the editor
// pbVisible, pbEnabled, pbSafeMode, pParams - if the pointer is NULL, then that attribute was not changed // pbVisible, pbEnabled, pbSafeMode, pParams - if the pointer is nullptr, then that attribute was not changed
typedef void (* TWipFeatureUpdateCallback)(int aFeatureId, const bool* const pbVisible, const bool* const pbEnabled, const bool* const pbSafeMode, const char* pParams); typedef void (* TWipFeatureUpdateCallback)(int aFeatureId, const bool* const pbVisible, const bool* const pbEnabled, const bool* const pbSafeMode, const char* pParams);
// wip feature registerer auto create object, used for static auto feature creation with the REGISTER_WIP_FEATURE macro // wip feature registerer auto create object, used for static auto feature creation with the REGISTER_WIP_FEATURE macro
@ -71,7 +71,7 @@ public:
, m_bVisible(true) , m_bVisible(true)
, m_bEnabled(true) , m_bEnabled(true)
, m_bSafeMode(false) , m_bSafeMode(false)
, m_pfnUpdateFeature(NULL) , m_pfnUpdateFeature(nullptr)
, m_bLoadedFromXml(false) , m_bLoadedFromXml(false)
{} {}

@ -152,7 +152,7 @@ public:
} }
}; };
CWipFeaturesDlg::CWipFeaturesDlg(QWidget* pParent /*=NULL*/) CWipFeaturesDlg::CWipFeaturesDlg(QWidget* pParent /*=nullptr*/)
: QDialog(pParent) : QDialog(pParent)
, m_ui(new Ui::WipFeaturesDlg) , m_ui(new Ui::WipFeaturesDlg)
{ {

@ -29,7 +29,7 @@ class CWipFeaturesDlg
{ {
Q_OBJECT Q_OBJECT
public: public:
CWipFeaturesDlg(QWidget* pParent = NULL); // standard constructor CWipFeaturesDlg(QWidget* pParent = nullptr); // standard constructor
virtual ~CWipFeaturesDlg(); virtual ~CWipFeaturesDlg();
private: private:

Loading…
Cancel
Save