merging latest development

Signed-off-by: kberg-amzn <karlberg@amazon.com>
This commit is contained in:
kberg-amzn
2021-09-08 19:09:14 -07:00
2375 changed files with 14414 additions and 37962 deletions
+3 -12
View File
@@ -236,10 +236,7 @@ QString CEditorCommandManager::Execute(const AZStd::string& module, const AZStd:
}
else
{
QString errMsg;
errMsg = QStringLiteral("Error: Trying to execute a unknown command, '%1'!").arg(fullName.c_str());
CryLogAlways(errMsg.toUtf8().data());
CryLogAlways("Error: Trying to execute a unknown command, '%s'!", fullName.c_str());
}
return "";
@@ -272,10 +269,7 @@ QString CEditorCommandManager::Execute(const AZStd::string& cmdLine)
}
else
{
QString errMsg;
errMsg = QStringLiteral("Error: Trying to execute a unknown command, '%1'!").arg(cmdLine.c_str());
CryLogAlways(errMsg.toUtf8().data());
CryLogAlways("Error: Trying to execute a unknown command, '%s'!", cmdLine.c_str());
}
return "";
@@ -294,10 +288,7 @@ void CEditorCommandManager::Execute(int commandId)
}
else
{
QString errMsg;
errMsg = QStringLiteral("Error: Trying to execute a unknown command of ID '%1'!").arg(commandId);
CryLogAlways(errMsg.toUtf8().data());
CryLogAlways("Error: Trying to execute a unknown command of ID '%d'!", commandId);
}
}
+1 -1
View File
@@ -36,7 +36,7 @@ void CConsoleDialog::SetInfoText(const char* text)
{
if (gEnv && gEnv->pLog) // before log system was initialized
{
CryLogAlways(text);
CryLogAlways("%s", text);
}
}
+8 -10
View File
@@ -26,9 +26,6 @@
#include <AzQtComponents/Components/Widgets/ScrollBar.h>
#include <AzQtComponents/Components/Widgets/SliderCombo.h>
// CryCommon
#include <CryCommon/SFunctor.h>
// Editor
#include "QtViewPaneManager.h"
#include "Core/QtEditorApplication.h"
@@ -392,7 +389,7 @@ void CConsoleSCB::RegisterViewClass()
opts.showInMenu = true;
opts.builtInActionId = ID_VIEW_CONSOLEWINDOW;
opts.shortcut = QKeySequence(Qt::Key_QuoteLeft);
AzToolsFramework::RegisterViewPane<CConsoleSCB>(LyViewPane::Console, LyViewPane::CategoryTools, opts);
}
@@ -421,9 +418,6 @@ void CConsoleSCB::RefreshStyle()
m_colorTable[6] = QColor(0xff, 0xaa, 0x22); // Warning (Yellow)
}
m_colorTable[0] = textColor;
m_colorTable[1] = textColor;
const bool uiAndDark = !GetIEditor()->IsInConsolewMode() && CConsoleSCB::GetCreatedInstance() && m_backgroundTheme == AzToolsFramework::ConsoleColorTheme::Dark;
QColor bgColor;
@@ -435,8 +429,13 @@ void CConsoleSCB::RefreshStyle()
else
{
bgColor = Qt::white;
textColor = Qt::black;
AzQtComponents::ScrollBar::applyDarkStyle(ui->textEdit);
}
m_colorTable[0] = textColor;
m_colorTable[1] = textColor;
ui->textEdit->setBackgroundVisible(!uiAndDark);
ui->textEdit->setStyleSheet(uiAndDark ? QString() : QString("QPlainTextEdit{ background: %1 }").arg(bgColor.name(QColor::HexRgb)));
@@ -604,8 +603,7 @@ static CVarBlock* VarBlockFromConsoleVars()
// Add our on change handler so we can update the CVariable created for
// the matching ICVar that has been modified
SFunctor onChange;
onChange.Set(OnVariableUpdated, i, pCVar);
AZStd::function<void()> onChange = [row=i,pCVar=pCVar]() { OnVariableUpdated(row,pCVar); };
pCVar->AddOnChangeFunctor(onChange);
pVariable->SetDescription(pCVar->GetHelp());
@@ -927,7 +925,7 @@ QWidget* ConsoleVariableItemDelegate::createEditor(QWidget* parent, const QStyle
return editor;
}
}
// If we get here, value being edited is a string, so use our styled line
// edit widget
AzQtComponents::StyledLineEdit* lineEdit = new AzQtComponents::StyledLineEdit(parent);
-10
View File
@@ -1887,16 +1887,6 @@ void CCryEditDoc::SetDocumentReady(bool bReady)
m_bDocumentReady = bReady;
}
void CCryEditDoc::GetMemoryUsage(ICrySizer* pSizer) const
{
{
SIZER_COMPONENT_NAME(pSizer, "UndoManager(estimate)");
GetIEditor()->GetUndoManager()->GetMemoryUsage(pSizer);
}
pSizer->Add(*this);
}
void CCryEditDoc::RegisterConsoleVariables()
{
doc_validate_surface_types = gEnv->pConsole->GetCVar("doc_validate_surface_types");
-2
View File
@@ -129,8 +129,6 @@ public: // Create from serialization only
void RegisterListener(IDocListener* listener);
void UnregisterListener(IDocListener* listener);
void GetMemoryUsage(ICrySizer* pSizer) const;
static bool IsBackupOrTempLevelSubdirectory(const QString& folderName);
protected:
+4 -4
View File
@@ -27,8 +27,8 @@
#include "EditorPreferencesPageGeneral.h"
#include "EditorPreferencesPageFiles.h"
#include "EditorPreferencesPageViewportGeneral.h"
#include "EditorPreferencesPageViewportGizmo.h"
#include "EditorPreferencesPageViewportMovement.h"
#include "EditorPreferencesPageViewportManipulator.h"
#include "EditorPreferencesPageViewportCamera.h"
#include "EditorPreferencesPageViewportDebug.h"
#include "EditorPreferencesPageExperimentalLighting.h"
#include "EditorPreferencesPageAWS.h"
@@ -65,8 +65,8 @@ EditorPreferencesDialog::EditorPreferencesDialog(QWidget* pParent)
CEditorPreferencesPage_General::Reflect(*serializeContext);
CEditorPreferencesPage_Files::Reflect(*serializeContext);
CEditorPreferencesPage_ViewportGeneral::Reflect(*serializeContext);
CEditorPreferencesPage_ViewportGizmo::Reflect(*serializeContext);
CEditorPreferencesPage_ViewportMovement::Reflect(*serializeContext);
CEditorPreferencesPage_ViewportManipulator::Reflect(*serializeContext);
CEditorPreferencesPage_ViewportCamera::Reflect(*serializeContext);
CEditorPreferencesPage_ViewportDebug::Reflect(*serializeContext);
CEditorPreferencesPage_ExperimentalLighting::Reflect(*serializeContext);
CEditorPreferencesPage_AWS::Reflect(*serializeContext);
@@ -8,7 +8,7 @@
#include "EditorDefs.h"
#include "EditorPreferencesPageViewportMovement.h"
#include "EditorPreferencesPageViewportCamera.h"
#include <AzCore/std/sort.h>
#include <AzFramework/Input/Buses/Requests/InputDeviceRequestBus.h>
@@ -58,7 +58,7 @@ static AZStd::vector<AZStd::string> GetEditorInputNames()
return inputNames;
}
void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& serialize)
void CEditorPreferencesPage_ViewportCamera::Reflect(AZ::SerializeContext& serialize)
{
serialize.Class<CameraMovementSettings>()
->Version(2)
@@ -93,36 +93,37 @@ void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& seri
->Field("OrbitDolly", &CameraInputSettings::m_orbitDollyChannelId)
->Field("OrbitPan", &CameraInputSettings::m_orbitPanChannelId);
serialize.Class<CEditorPreferencesPage_ViewportMovement>()
serialize.Class<CEditorPreferencesPage_ViewportCamera>()
->Version(1)
->Field("CameraMovementSettings", &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings)
->Field("CameraInputSettings", &CEditorPreferencesPage_ViewportMovement::m_cameraInputSettings);
->Field("CameraMovementSettings", &CEditorPreferencesPage_ViewportCamera::m_cameraMovementSettings)
->Field("CameraInputSettings", &CEditorPreferencesPage_ViewportCamera::m_cameraInputSettings);
if (AZ::EditContext* editContext = serialize.GetEditContext())
{
const float minValue = 0.0001f;
editContext->Class<CameraMovementSettings>("Camera Movement Settings", "")
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_translateSpeed, "Camera Movement Speed", "Camera movement speed")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Min, minValue)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_rotateSpeed, "Camera Rotation Speed", "Camera rotation speed")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Min, minValue)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_boostMultiplier, "Camera Boost Multiplier",
"Camera boost multiplier to apply to movement speed")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Min, minValue)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_scrollSpeed, "Camera Scroll Speed",
"Camera movement speed while using scroll/wheel input")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Min, minValue)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_dollySpeed, "Camera Dolly Speed",
"Camera movement speed while using mouse motion to move in and out")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Min, minValue)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_panSpeed, "Camera Pan Speed",
"Camera movement speed while panning using the mouse")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Min, minValue)
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_rotateSmoothing, "Camera Rotate Smoothing",
"Is camera rotation smoothing enabled or disabled")
@@ -130,7 +131,7 @@ void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& seri
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_rotateSmoothness, "Camera Rotate Smoothness",
"Amount of camera smoothing to apply while rotating the camera")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Min, minValue)
->Attribute(AZ::Edit::Attributes::Visibility, &CameraMovementSettings::RotateSmoothingVisibility)
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_translateSmoothing, "Camera Translate Smoothing",
@@ -139,7 +140,7 @@ void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& seri
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &CameraMovementSettings::m_translateSmoothness, "Camera Translate Smoothness",
"Amount of camera smoothing to apply while translating the camera")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Min, minValue)
->Attribute(AZ::Edit::Attributes::Visibility, &CameraMovementSettings::TranslateSmoothingVisibility)
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &CameraMovementSettings::m_orbitYawRotationInverted, "Camera Orbit Yaw Inverted",
@@ -207,35 +208,50 @@ void CEditorPreferencesPage_ViewportMovement::Reflect(AZ::SerializeContext& seri
"Key/button to begin camera orbit pan")
->Attribute(AZ::Edit::Attributes::StringList, &GetEditorInputNames);
editContext->Class<CEditorPreferencesPage_ViewportMovement>("Viewport Preferences", "Viewport Preferences")
editContext->Class<CEditorPreferencesPage_ViewportCamera>("Viewport Preferences", "Viewport Preferences")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Visibility, AZ_CRC("PropertyVisibility_ShowChildrenOnly", 0xef428f20))
->DataElement(
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportMovement::m_cameraMovementSettings,
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportCamera::m_cameraMovementSettings,
"Camera Movement Settings", "Camera Movement Settings")
->DataElement(
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportMovement::m_cameraInputSettings, "Camera Input Settings",
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportCamera::m_cameraInputSettings, "Camera Input Settings",
"Camera Input Settings");
}
}
CEditorPreferencesPage_ViewportMovement::CEditorPreferencesPage_ViewportMovement()
CEditorPreferencesPage_ViewportCamera::CEditorPreferencesPage_ViewportCamera()
{
InitializeSettings();
m_icon = QIcon(":/res/Camera.svg");
}
const char* CEditorPreferencesPage_ViewportMovement::GetTitle()
const char* CEditorPreferencesPage_ViewportCamera::GetCategory()
{
return "Viewports";
}
const char* CEditorPreferencesPage_ViewportCamera::GetTitle()
{
return "Camera";
}
QIcon& CEditorPreferencesPage_ViewportMovement::GetIcon()
QIcon& CEditorPreferencesPage_ViewportCamera::GetIcon()
{
return m_icon;
}
void CEditorPreferencesPage_ViewportMovement::OnApply()
void CEditorPreferencesPage_ViewportCamera::OnCancel()
{
// noop
}
bool CEditorPreferencesPage_ViewportCamera::OnQueryCancel()
{
return true;
}
void CEditorPreferencesPage_ViewportCamera::OnApply()
{
SandboxEditor::SetCameraTranslateSpeed(m_cameraMovementSettings.m_translateSpeed);
SandboxEditor::SetCameraRotateSpeed(m_cameraMovementSettings.m_rotateSpeed);
@@ -270,7 +286,7 @@ void CEditorPreferencesPage_ViewportMovement::OnApply()
&SandboxEditor::EditorModularViewportCameraComposerNotificationBus::Events::OnEditorModularViewportCameraComposerSettingsChanged);
}
void CEditorPreferencesPage_ViewportMovement::InitializeSettings()
void CEditorPreferencesPage_ViewportCamera::InitializeSettings()
{
m_cameraMovementSettings.m_translateSpeed = SandboxEditor::CameraTranslateSpeed();
m_cameraMovementSettings.m_rotateSpeed = SandboxEditor::CameraRotateSpeed();
@@ -19,32 +19,22 @@ inline AZ::Crc32 EditorPropertyVisibility(const bool enabled)
return enabled ? AZ::Edit::PropertyVisibility::Show : AZ::Edit::PropertyVisibility::Hide;
}
class CEditorPreferencesPage_ViewportMovement : public IPreferencesPage
class CEditorPreferencesPage_ViewportCamera : public IPreferencesPage
{
public:
AZ_RTTI(CEditorPreferencesPage_ViewportMovement, "{BC593332-7EAF-4171-8A35-1C5DE5B40909}", IPreferencesPage)
AZ_RTTI(CEditorPreferencesPage_ViewportCamera, "{BC593332-7EAF-4171-8A35-1C5DE5B40909}", IPreferencesPage)
static void Reflect(AZ::SerializeContext& serialize);
CEditorPreferencesPage_ViewportMovement();
virtual ~CEditorPreferencesPage_ViewportMovement() = default;
CEditorPreferencesPage_ViewportCamera();
virtual ~CEditorPreferencesPage_ViewportCamera() = default;
virtual const char* GetCategory() override
{
return "Viewports";
}
virtual const char* GetTitle();
virtual QIcon& GetIcon() override;
virtual void OnApply() override;
virtual void OnCancel() override
{
}
virtual bool OnQueryCancel() override
{
return true;
}
const char* GetCategory() override;
const char* GetTitle() override;
QIcon& GetIcon() override;
void OnApply() override;
void OnCancel() override;
bool OnQueryCancel() override;
private:
void InitializeSettings();
@@ -1,100 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "EditorDefs.h"
#include "EditorPreferencesPageViewportGizmo.h"
// Editor
#include "Settings.h"
void CEditorPreferencesPage_ViewportGizmo::Reflect(AZ::SerializeContext& serialize)
{
serialize.Class<AxisGizmo>()
->Version(1)
->Field("Size", &AxisGizmo::m_size)
->Field("Text", &AxisGizmo::m_text)
->Field("MaxCount", &AxisGizmo::m_maxCount);
serialize.Class<Helpers>()
->Version(1)
->Field("LabelsOn", &Helpers::m_helpersGlobalScale)
->Field("LabelsOn", &Helpers::m_tagpointScaleMulti)
->Field("LabelsOn", &Helpers::m_rulerSphereScale)
->Field("LabelsDistance", &Helpers::m_rulerSphereTrans);
serialize.Class<CEditorPreferencesPage_ViewportGizmo>()
->Version(1)
->Field("Axis Gizmo", &CEditorPreferencesPage_ViewportGizmo::m_axisGizmo)
->Field("Helpers", &CEditorPreferencesPage_ViewportGizmo::m_helpers);
AZ::EditContext* editContext = serialize.GetEditContext();
if (editContext)
{
editContext->Class<AxisGizmo>("Axis Gizmo", "")
->DataElement(AZ::Edit::UIHandlers::SpinBox, &AxisGizmo::m_size, "Size", "Axis Gizmo Size")
->DataElement(AZ::Edit::UIHandlers::CheckBox, &AxisGizmo::m_text, "Text Labels", "Text Labels on Axis Gizmo")
->DataElement(AZ::Edit::UIHandlers::SpinBox, &AxisGizmo::m_maxCount, "Max Count", "Max Count of Axis Gizmos");
editContext->Class<Helpers>("Helpers", "")
->DataElement(AZ::Edit::UIHandlers::SpinBox, &Helpers::m_helpersGlobalScale, "Helpers Scale", "Helpers Scale")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Max, 100.0f)
->DataElement(AZ::Edit::UIHandlers::SpinBox, &Helpers::m_tagpointScaleMulti, "Tagpoint Scale Multiplier", "Tagpoint Scale Multiplier")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Max, 100.0f)
->DataElement(AZ::Edit::UIHandlers::SpinBox, &Helpers::m_rulerSphereScale, "Ruler Sphere Scale", "Ruler Sphere Scale")
->Attribute(AZ::Edit::Attributes::Min, 0.1f)
->Attribute(AZ::Edit::Attributes::Max, 100.0f)
->Attribute(AZ::Edit::Attributes::Step, 0.1f)
->DataElement(AZ::Edit::UIHandlers::SpinBox, &Helpers::m_rulerSphereTrans, "Ruler Sphere Transparency", "Ruler Sphere Transparency")
->Attribute(AZ::Edit::Attributes::Min, 0.01f)
->Attribute(AZ::Edit::Attributes::Max, 100.0f);
editContext->Class<CEditorPreferencesPage_ViewportGizmo>("Gizmo Viewport Preferences", "Gizmo Viewport Preferences")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Visibility, AZ_CRC("PropertyVisibility_ShowChildrenOnly", 0xef428f20))
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGizmo::m_axisGizmo, "Axis Gizmo", "Axis Gizmo")
->DataElement(AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportGizmo::m_helpers, "Helpers", "Helpers");
}
}
CEditorPreferencesPage_ViewportGizmo::CEditorPreferencesPage_ViewportGizmo()
{
InitializeSettings();
m_icon = QIcon(":/res/Gizmos.svg");
}
QIcon& CEditorPreferencesPage_ViewportGizmo::GetIcon()
{
return m_icon;
}
void CEditorPreferencesPage_ViewportGizmo::OnApply()
{
gSettings.gizmo.axisGizmoSize = m_axisGizmo.m_size;
gSettings.gizmo.axisGizmoText = m_axisGizmo.m_text;
gSettings.gizmo.axisGizmoMaxCount = m_axisGizmo.m_maxCount;
gSettings.gizmo.helpersScale = m_helpers.m_helpersGlobalScale;
gSettings.gizmo.tagpointScaleMulti = m_helpers.m_tagpointScaleMulti;
gSettings.gizmo.rulerSphereScale = m_helpers.m_rulerSphereScale;
gSettings.gizmo.rulerSphereTrans = m_helpers.m_rulerSphereTrans;
}
void CEditorPreferencesPage_ViewportGizmo::InitializeSettings()
{
m_axisGizmo.m_size = gSettings.gizmo.axisGizmoSize;
m_axisGizmo.m_text = gSettings.gizmo.axisGizmoText;
m_axisGizmo.m_maxCount = gSettings.gizmo.axisGizmoMaxCount;
m_helpers.m_helpersGlobalScale = gSettings.gizmo.helpersScale;
m_helpers.m_tagpointScaleMulti = gSettings.gizmo.tagpointScaleMulti;
m_helpers.m_rulerSphereScale = gSettings.gizmo.rulerSphereScale;
m_helpers.m_rulerSphereTrans = gSettings.gizmo.rulerSphereTrans;
}
@@ -1,63 +0,0 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include "Include/IPreferencesPage.h"
#include <AzCore/Serialization/SerializeContext.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/RTTI/RTTI.h>
#include <AzCore/Math/Vector3.h>
#include <QIcon>
class CEditorPreferencesPage_ViewportGizmo
: public IPreferencesPage
{
public:
AZ_RTTI(CEditorPreferencesPage_ViewportGizmo, "{14433511-8175-4348-954E-82D903475B06}", IPreferencesPage)
static void Reflect(AZ::SerializeContext& serialize);
CEditorPreferencesPage_ViewportGizmo();
virtual ~CEditorPreferencesPage_ViewportGizmo() = default;
virtual const char* GetCategory() override { return "Viewports"; }
virtual const char* GetTitle() override { return "Gizmos"; }
virtual QIcon& GetIcon() override;
virtual void OnApply() override;
virtual void OnCancel() override {}
virtual bool OnQueryCancel() override { return true; }
private:
void InitializeSettings();
struct AxisGizmo
{
AZ_TYPE_INFO(AxisGizmo, "{7D90D60E-996B-4F54-8748-B26EFA781EE2}")
float m_size;
bool m_text;
int m_maxCount;
};
struct Helpers
{
AZ_TYPE_INFO(Helpers, "{EC99922E-F61C-4AA0-9A51-630E09AB55AA}")
float m_helpersGlobalScale;
float m_tagpointScaleMulti;
float m_rulerSphereScale;
float m_rulerSphereTrans;
};
AxisGizmo m_axisGizmo;
Helpers m_helpers;
QIcon m_icon;
};
@@ -0,0 +1,91 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "EditorDefs.h"
#include "EditorPreferencesPageViewportManipulator.h"
// Editor
#include "EditorViewportSettings.h"
#include "Settings.h"
void CEditorPreferencesPage_ViewportManipulator::Reflect(AZ::SerializeContext& serialize)
{
serialize.Class<Manipulators>()
->Version(1)
->Field("LineBoundWidth", &Manipulators::m_manipulatorLineBoundWidth)
->Field("CircleBoundWidth", &Manipulators::m_manipulatorCircleBoundWidth);
serialize.Class<CEditorPreferencesPage_ViewportManipulator>()->Version(2)->Field(
"Manipulators", &CEditorPreferencesPage_ViewportManipulator::m_manipulators);
if (AZ::EditContext* editContext = serialize.GetEditContext())
{
editContext->Class<Manipulators>("Manipulators", "")
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &Manipulators::m_manipulatorLineBoundWidth, "Line Bound Width",
"Manipulator Line Bound Width")
->Attribute(AZ::Edit::Attributes::Min, 0.001f)
->Attribute(AZ::Edit::Attributes::Max, 2.0f)
->DataElement(
AZ::Edit::UIHandlers::SpinBox, &Manipulators::m_manipulatorCircleBoundWidth, "Circle Bound Width",
"Manipulator Circle Bound Width")
->Attribute(AZ::Edit::Attributes::Min, 0.001f)
->Attribute(AZ::Edit::Attributes::Max, 2.0f);
editContext
->Class<CEditorPreferencesPage_ViewportManipulator>("Manipulator Viewport Preferences", "Manipulator Viewport Preferences")
->ClassElement(AZ::Edit::ClassElements::EditorData, "")
->Attribute(AZ::Edit::Attributes::Visibility, AZ_CRC("PropertyVisibility_ShowChildrenOnly", 0xef428f20))
->DataElement(
AZ::Edit::UIHandlers::Default, &CEditorPreferencesPage_ViewportManipulator::m_manipulators, "Manipulators", "Manipulators");
}
}
CEditorPreferencesPage_ViewportManipulator::CEditorPreferencesPage_ViewportManipulator()
{
InitializeSettings();
m_icon = QIcon(":/res/Gizmos.svg");
}
const char* CEditorPreferencesPage_ViewportManipulator::GetCategory()
{
return "Viewports";
}
const char* CEditorPreferencesPage_ViewportManipulator::GetTitle()
{
return "Manipulators";
}
QIcon& CEditorPreferencesPage_ViewportManipulator::GetIcon()
{
return m_icon;
}
void CEditorPreferencesPage_ViewportManipulator::OnCancel()
{
// noop
}
bool CEditorPreferencesPage_ViewportManipulator::OnQueryCancel()
{
return true;
}
void CEditorPreferencesPage_ViewportManipulator::OnApply()
{
SandboxEditor::SetManipulatorLineBoundWidth(m_manipulators.m_manipulatorLineBoundWidth);
SandboxEditor::SetManipulatorCircleBoundWidth(m_manipulators.m_manipulatorCircleBoundWidth);
}
void CEditorPreferencesPage_ViewportManipulator::InitializeSettings()
{
m_manipulators.m_manipulatorLineBoundWidth = SandboxEditor::ManipulatorLineBoundWidth();
m_manipulators.m_manipulatorCircleBoundWidth = SandboxEditor::ManipulatorCircleBoundWidth();
}
@@ -0,0 +1,48 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#pragma once
#include "Include/IPreferencesPage.h"
#include <AzCore/Math/Vector3.h>
#include <AzCore/RTTI/RTTI.h>
#include <AzCore/Serialization/EditContext.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <QIcon>
class CEditorPreferencesPage_ViewportManipulator : public IPreferencesPage
{
public:
AZ_RTTI(CEditorPreferencesPage_ViewportManipulator, "{14433511-8175-4348-954E-82D903475B06}", IPreferencesPage)
static void Reflect(AZ::SerializeContext& serialize);
CEditorPreferencesPage_ViewportManipulator();
virtual ~CEditorPreferencesPage_ViewportManipulator() = default;
const char* GetCategory() override;
const char* GetTitle() override;
QIcon& GetIcon() override;
void OnApply() override;
void OnCancel() override;
bool OnQueryCancel() override;
private:
void InitializeSettings();
struct Manipulators
{
AZ_TYPE_INFO(Manipulators, "{2974439C-4839-41F6-B526-F317999B9DB9}")
float m_manipulatorLineBoundWidth = 0.0f;
float m_manipulatorCircleBoundWidth = 0.0f;
};
Manipulators m_manipulators;
QIcon m_icon;
};
+22
View File
@@ -20,6 +20,8 @@ namespace SandboxEditor
constexpr AZStd::string_view AngleSnappingSetting = "/Amazon/Preferences/Editor/AngleSnapping";
constexpr AZStd::string_view AngleSizeSetting = "/Amazon/Preferences/Editor/AngleSize";
constexpr AZStd::string_view ShowGridSetting = "/Amazon/Preferences/Editor/ShowGrid";
constexpr AZStd::string_view ManipulatorLineBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/LineBoundWidth";
constexpr AZStd::string_view ManipulatorCircleBoundWidthSetting = "/Amazon/Preferences/Editor/Manipulator/CircleBoundWidth";
constexpr AZStd::string_view CameraTranslateSpeedSetting = "/Amazon/Preferences/Editor/Camera/TranslateSpeed";
constexpr AZStd::string_view CameraBoostMultiplierSetting = "/Amazon/Preferences/Editor/Camera/BoostMultiplier";
constexpr AZStd::string_view CameraRotateSpeedSetting = "/Amazon/Preferences/Editor/Camera/RotateSpeed";
@@ -156,6 +158,26 @@ namespace SandboxEditor
SetRegistry(ShowGridSetting, showing);
}
float ManipulatorLineBoundWidth()
{
return aznumeric_cast<float>(GetRegistry(ManipulatorLineBoundWidthSetting, 0.1));
}
void SetManipulatorLineBoundWidth(const float lineBoundWidth)
{
SetRegistry(ManipulatorLineBoundWidthSetting, lineBoundWidth);
}
float ManipulatorCircleBoundWidth()
{
return aznumeric_cast<float>(GetRegistry(ManipulatorCircleBoundWidthSetting, 0.1));
}
void SetManipulatorCircleBoundWidth(const float circleBoundWidth)
{
SetRegistry(ManipulatorCircleBoundWidthSetting, circleBoundWidth);
}
float CameraTranslateSpeed()
{
return aznumeric_cast<float>(GetRegistry(CameraTranslateSpeedSetting, 10.0));
+6
View File
@@ -47,6 +47,12 @@ namespace SandboxEditor
SANDBOX_API bool ShowingGrid();
SANDBOX_API void SetShowingGrid(bool showing);
SANDBOX_API float ManipulatorLineBoundWidth();
SANDBOX_API void SetManipulatorLineBoundWidth(float lineBoundWidth);
SANDBOX_API float ManipulatorCircleBoundWidth();
SANDBOX_API void SetManipulatorCircleBoundWidth(float circleBoundWidth);
SANDBOX_API float CameraTranslateSpeed();
SANDBOX_API void SetCameraTranslateSpeed(float speed);
+24 -13
View File
@@ -113,18 +113,6 @@ void StartFixedCursorMode(QObject *viewport);
#define RENDER_MESH_TEST_DISTANCE (0.2f)
#define CURSOR_FONT_HEIGHT 8.0f
//! Viewport settings for the EditorViewportWidget
struct EditorViewportSettings : public AzToolsFramework::ViewportInteraction::ViewportSettings
{
bool GridSnappingEnabled() const override;
float GridSize() const override;
bool ShowGrid() const override;
bool AngleSnappingEnabled() const override;
float AngleStep() const override;
};
static const EditorViewportSettings g_EditorViewportSettings;
namespace AZ::ViewportHelpers
{
static const char TextCantCreateCameraNoLevel[] = "Cannot create camera when no level is loaded.";
@@ -218,6 +206,7 @@ EditorViewportWidget::~EditorViewportWidget()
m_pPrimaryViewport = nullptr;
}
m_editorViewportSettings.Disconnect();
DisconnectViewportInteractionRequestBus();
m_editorEntityNotifications.reset();
Camera::EditorCameraRequestBus::Handler::BusDisconnect();
@@ -1073,7 +1062,7 @@ void EditorViewportWidget::SetViewportId(int id)
m_editorModularViewportCameraComposer = AZStd::make_unique<SandboxEditor::EditorModularViewportCameraComposer>(AzFramework::ViewportId(id));
m_renderViewport->GetControllerList()->Add(m_editorModularViewportCameraComposer->CreateModularViewportCameraController());
m_renderViewport->SetViewportSettings(&g_EditorViewportSettings);
m_editorViewportSettings.Connect(AzFramework::ViewportId(id));
UpdateScene();
@@ -1098,6 +1087,7 @@ void EditorViewportWidget::ConnectViewportInteractionRequestBus()
{
AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Handler::BusConnect(GetViewportId());
AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler::BusConnect(GetViewportId());
AzToolsFramework::ViewportInteraction::EditorEntityViewportInteractionRequestBus::Handler::BusConnect(GetViewportId());
m_viewportUi.ConnectViewportUiBus(GetViewportId());
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusConnect();
@@ -1108,6 +1098,7 @@ void EditorViewportWidget::DisconnectViewportInteractionRequestBus()
AzFramework::InputSystemCursorConstraintRequestBus::Handler::BusDisconnect();
m_viewportUi.DisconnectViewportUiBus();
AzToolsFramework::ViewportInteraction::EditorEntityViewportInteractionRequestBus::Handler::BusDisconnect();
AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler::BusDisconnect();
AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Handler::BusDisconnect();
}
@@ -2534,6 +2525,16 @@ void EditorViewportWidget::SetAsActiveViewport()
}
}
void EditorViewportSettings::Connect(const AzFramework::ViewportId viewportId)
{
AzToolsFramework::ViewportInteraction::ViewportSettingsRequestBus::Handler::BusConnect(viewportId);
}
void EditorViewportSettings::Disconnect()
{
AzToolsFramework::ViewportInteraction::ViewportSettingsRequestBus::Handler::BusDisconnect();
}
bool EditorViewportSettings::GridSnappingEnabled() const
{
return SandboxEditor::GridSnappingEnabled();
@@ -2559,6 +2560,16 @@ float EditorViewportSettings::AngleStep() const
return SandboxEditor::AngleSnappingSize();
}
float EditorViewportSettings::ManipulatorLineBoundWidth() const
{
return SandboxEditor::ManipulatorLineBoundWidth();
}
float EditorViewportSettings::ManipulatorCircleBoundWidth() const
{
return SandboxEditor::ManipulatorCircleBoundWidth();
}
AZ_CVAR_EXTERNED(bool, ed_previewGameInFullscreen_once);
bool EditorViewportWidget::ShouldPreviewFullscreen() const
+37 -12
View File
@@ -63,6 +63,22 @@ namespace AzToolsFramework
class ManipulatorManager;
}
//! Viewport settings for the EditorViewportWidget
struct EditorViewportSettings : public AzToolsFramework::ViewportInteraction::ViewportSettingsRequestBus::Handler
{
void Connect(AzFramework::ViewportId viewportId);
void Disconnect();
// ViewportSettingsRequestBus overrides ...
bool GridSnappingEnabled() const override;
float GridSize() const override;
bool ShowGrid() const override;
bool AngleSnappingEnabled() const override;
float AngleStep() const override;
float ManipulatorLineBoundWidth() const override;
float ManipulatorCircleBoundWidth() const override;
};
// EditorViewportWidget window
AZ_PUSH_DISABLE_DLL_EXPORT_BASECLASS_WARNING
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
@@ -75,6 +91,7 @@ class SANDBOX_API EditorViewportWidget final
, private AzFramework::InputSystemCursorConstraintRequestBus::Handler
, private AzToolsFramework::ViewportInteraction::ViewportFreezeRequestBus::Handler
, private AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Handler
, private AzToolsFramework::ViewportInteraction::EditorEntityViewportInteractionRequestBus::Handler
, private AzFramework::AssetCatalogEventBus::Handler
, private AZ::RPI::SceneNotificationBus::Handler
{
@@ -112,10 +129,12 @@ private:
CameraComponent,
ViewSourceTypesCount,
};
enum class PlayInEditorState
{
Editor, Starting, Started
};
enum class KeyPressedState
{
AllUp,
@@ -126,7 +145,7 @@ private:
////////////////////////////////////////////////////////////////////////
// Method overrides ...
// QWidget
// QWidget overrides ...
void focusOutEvent(QFocusEvent* event) override;
void keyPressEvent(QKeyEvent* event) override;
bool event(QEvent* event) override;
@@ -134,7 +153,7 @@ private:
void paintEvent(QPaintEvent* event) override;
void mousePressEvent(QMouseEvent* event) override;
// QtViewport/IDisplayViewport/CViewport
// QtViewport/IDisplayViewport/CViewport overrides ...
EViewportType GetType() const override { return ET_ViewportCamera; }
void SetType([[maybe_unused]] EViewportType type) override { assert(type == ET_ViewportCamera); };
AzToolsFramework::ViewportInteraction::MouseInteraction BuildMouseInteraction(
@@ -160,16 +179,17 @@ private:
void Update() override;
void UpdateContent(int flags) override;
// SceneNotificationBus
// SceneNotificationBus overrides ...
void OnBeginPrepareRender() override;
// Camera::CameraNotificationBus
// Camera::CameraNotificationBus overrides ...
void OnActiveViewChanged(const AZ::EntityId&) override;
// IEditorEventListener
// IEditorEventListener overrides ...
void OnEditorNotifyEvent(EEditorNotifyEvent event) override;
// AzToolsFramework::EditorEntityContextNotificationBus (handler moved to cpp to resolve link issues in unity builds)
// AzToolsFramework::EditorEntityContextNotificationBus overrides ...
// note: handler moved to cpp to resolve link issues in unity builds
void OnStartPlayInEditor();
void OnStopPlayInEditor();
void OnStartPlayInEditorBegin();
@@ -178,10 +198,10 @@ private:
void BeginUndoTransaction() override;
void EndUndoTransaction() override;
// AzFramework::InputSystemCursorConstraintRequestBus
// AzFramework::InputSystemCursorConstraintRequestBus overrides ...
void* GetSystemCursorConstraintWindow() const override;
// AzToolsFramework::ViewportFreezeRequestBus
// AzToolsFramework::ViewportFreezeRequestBus overrides ...
bool IsViewportInputFrozen() override;
void FreezeViewportInput(bool freeze) override;
@@ -189,13 +209,15 @@ private:
AZ::EntityId PickEntity(const AzFramework::ScreenPoint& point) override;
AZ::Vector3 PickTerrain(const AzFramework::ScreenPoint& point) override;
float TerrainHeight(const AZ::Vector2& position) override;
void FindVisibleEntities(AZStd::vector<AZ::EntityId>& visibleEntitiesOut) override;
bool ShowingWorldSpace() override;
QWidget* GetWidgetForViewportContextMenu() override;
void BeginWidgetContext() override;
void EndWidgetContext() override;
// Camera::EditorCameraRequestBus
// EditorEntityViewportInteractionRequestBus overrides ...
void FindVisibleEntities(AZStd::vector<AZ::EntityId>& visibleEntities) override;
// Camera::EditorCameraRequestBus overrides ...
void SetViewFromEntityPerspective(const AZ::EntityId& entityId) override;
void SetViewAndMovementLockFromEntityPerspective(const AZ::EntityId& entityId, bool lockCameraMovement) override;
AZ::EntityId GetCurrentViewEntityId() override;
@@ -311,7 +333,7 @@ private:
// Determines also if the current camera for this viewport is default editor camera
ViewSourceType m_viewSourceType = ViewSourceType::None;
// During play game in editor, holds the editor entity ID of the last
// During play game in editor, holds the editor entity ID of the last
AZ::EntityId m_viewEntityIdCachedForEditMode;
// The editor camera TM before switching to game mode
@@ -338,7 +360,7 @@ private:
// Note that any attempts to draw anything with this object will crash. Exists here for legacy "reasons"
DisplayContext m_displayContext;
// Re-entrency guard for on paint events
// Reentrancy guard for on paint events
bool m_isOnPaint = false;
// Shapes of various safe frame helpers which can be displayed in the editor
@@ -381,6 +403,9 @@ private:
// Atom debug display
AzFramework::DebugDisplayRequests* m_debugDisplay = nullptr;
// Type to return current state of editor viewport settings
EditorViewportSettings m_editorViewportSettings;
// The default view created for the viewport context, which is used as the "Editor Camera"
AZ::RPI::ViewPtr m_defaultView;
-54
View File
@@ -249,60 +249,6 @@ void CErrorReport::SetImmediateMode(bool bEnable)
}
}
//////////////////////////////////////////////////////////////////////////
void CErrorReport::Report(SValidatorRecord& record)
{
if ((record.flags & VALIDATOR_FLAG_IGNORE_IN_EDITOR))
{
return;
}
CErrorRecord err;
if (record.text)
{
err.error = record.text;
}
if (record.description)
{
err.description = record.description;
}
if (record.file)
{
err.file = record.file;
}
else
{
err.file = m_currentFilename;
}
err.severity = (CErrorRecord::ESeverity)record.severity;
err.assetScope = record.assetScope;
err.flags = 0;
if (record.flags & VALIDATOR_FLAG_FILE)
{
err.flags |= CErrorRecord::FLAG_NOFILE;
}
if (record.flags & VALIDATOR_FLAG_TEXTURE)
{
err.flags |= CErrorRecord::FLAG_TEXTURE;
}
if (record.flags & VALIDATOR_FLAG_SCRIPT)
{
err.flags |= CErrorRecord::FLAG_SCRIPT;
}
if (record.flags & VALIDATOR_FLAG_AI)
{
err.flags |= CErrorRecord::FLAG_AI;
}
err.module = record.module;
err.pObject = m_pObject;
err.pItem = m_pItem;
ReportError(err);
}
//////////////////////////////////////////////////////////////////////////
void CErrorReport::SetCurrentValidatorObject(CBaseObject* pObject)
{
-5
View File
@@ -121,11 +121,6 @@ public:
//! Assign current filename.
void SetCurrentFile(const QString& file);
//////////////////////////////////////////////////////////////////////////
// Implement IValidator interface.
//////////////////////////////////////////////////////////////////////////
virtual void Report(SValidatorRecord& record);
private:
//! Array of all error records added to report.
std::vector<CErrorRecord> m_errors;
-5
View File
@@ -176,11 +176,6 @@ struct SSystemUserCallback
return CryMessageBox(text, caption, uType);
}
void GetMemoryUsage(ICrySizer* pSizer) override
{
GetIEditor()->GetMemoryUsage(pSizer);
}
void OnSplashScreenDone()
{
m_pLogo = nullptr;
+1 -7
View File
@@ -5,10 +5,6 @@
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#ifndef CRYINCLUDE_EDITOR_GAMEEXPORTER_H
#define CRYINCLUDE_EDITOR_GAMEEXPORTER_H
#pragma once
#include "Util/PakFile.h"
@@ -62,7 +58,7 @@ public:
// In auto exporting mode, highest possible settings will be chosen and no UI dialogs will be shown.
void SetAutoExportMode(bool bAuto) { m_bAutoExportMode = bAuto; }
bool Export(unsigned int flags = 0, EEndian eExportEndian = GetPlatformEndian(), const char* subdirectory = 0);
bool Export(unsigned int flags = 0, EEndian eExportEndian = eEndianness_Little, const char* subdirectory = 0);
static CGameExporter* GetCurrentExporter() { return m_pCurrentExporter; }
@@ -116,5 +112,3 @@ void SetupTerrainInfo(const size_t octreeCompiledDataSize, Func&& setupTerrainFn
setupTerrainFn(octreeCompiledDataSize);
}
}
#endif // CRYINCLUDE_EDITOR_GAMEEXPORTER_H
-1
View File
@@ -701,7 +701,6 @@ struct IEditor
virtual CUIEnumsDatabase* GetUIEnumsDatabase() = 0;
virtual void AddUIEnums() = 0;
virtual void GetMemoryUsage(ICrySizer* pSizer) = 0;
virtual void ReduceMemory() = 0;
//! Export manager for exporting objects and a terrain from the game to DCC tools
+2 -14
View File
@@ -680,8 +680,8 @@ const SGizmoParameters& CEditorImpl::GetGlobalGizmoParameters()
m_pGizmoParameters->axisConstraint = m_selectedAxis;
m_pGizmoParameters->referenceCoordSys = m_refCoordsSys;
m_pGizmoParameters->axisGizmoScale = gSettings.gizmo.axisGizmoSize;
m_pGizmoParameters->axisGizmoText = gSettings.gizmo.axisGizmoText;
m_pGizmoParameters->axisGizmoScale = 1.0f;
m_pGizmoParameters->axisGizmoText = false;
return *m_pGizmoParameters;
}
@@ -1506,18 +1506,6 @@ void CEditorImpl::ShowStatusText(bool bEnable)
m_bShowStatusText = bEnable;
}
void CEditorImpl::GetMemoryUsage(ICrySizer* pSizer)
{
SIZER_COMPONENT_NAME(pSizer, "Editor");
if (GetDocument())
{
SIZER_COMPONENT_NAME(pSizer, "Document");
GetDocument()->GetMemoryUsage(pSizer);
}
}
void CEditorImpl::ReduceMemory()
{
GetIEditor()->GetUndoManager()->ClearRedoStack();
-1
View File
@@ -280,7 +280,6 @@ public:
void SetMatEditMode(bool bIsMatEditMode);
CUIEnumsDatabase* GetUIEnumsDatabase() { return m_pUIEnumsDatabase; };
void AddUIEnums();
void GetMemoryUsage(ICrySizer* pSizer);
void ReduceMemory();
// Get Export manager
IExportManager* GetExportManager();
+1 -4
View File
@@ -64,10 +64,7 @@ void CIconManager::Reset()
int i;
for (i = 0; i < sizeof(m_objects) / sizeof(m_objects[0]); i++)
{
if (m_objects[i])
{
m_objects[i]->Release();
}
delete m_objects[i];
m_objects[i] = nullptr;
}
for (i = 0; i < eIcon_COUNT; i++)
+6 -7
View File
@@ -24,16 +24,15 @@ inline AZStd::string ToString(const QString& s)
class CCommand
{
static inline bool FromString(int32 &val, const char* s) {
if(!s)
static inline bool FromString(int32& val, const char* s)
{
if (!s)
{
return false;
}
val = (int)strtol(s, nullptr, 10);
if(val==0 && errno!=0) {
return false;
}
return true;
val = static_cast<int>(strtol(s, nullptr, 10));
const bool parsing_error = val == 0 && errno != 0;
return !parsing_error;
}
public:
CCommand(
+1 -1
View File
@@ -15,6 +15,6 @@ struct IEditorMaterial
: public CBaseLibraryItem
{
virtual int GetFlags() const = 0;
virtual _smart_ptr<IMaterial> GetMatInfo(bool bUseExistingEngineMaterial = false) = 0;
virtual IMaterial* GetMatInfo(bool bUseExistingEngineMaterial = false) = 0;
virtual void DisableHighlightForFrame() = 0;
};
+1 -1
View File
@@ -19,7 +19,7 @@
struct IEditorMaterialManager
{
virtual void GotoMaterial(_smart_ptr<IMaterial> pMaterial) = 0;
virtual void GotoMaterial(IMaterial* pMaterial) = 0;
};
#endif // CRYINCLUDE_EDITOR_MATERIAL_MATERIALMANAGER_H
+1 -14
View File
@@ -9,23 +9,18 @@
// Description : Class that collects error reports to present them later.
#ifndef CRYINCLUDE_EDITOR_INTERFACE_ERRORREPORT_H
#define CRYINCLUDE_EDITOR_INTERFACE_ERRORREPORT_H
#pragma once
#include <IValidator.h>
// forward declarations.
class CParticleItem;
class CBaseObject;
class CBaseLibraryItem;
class CErrorRecord;
class QString;
/*! Error report manages collection of errors occurred during map analyzes or level load.
*/
struct IErrorReport
: public IValidator
{
virtual ~IErrorReport(){}
@@ -62,12 +57,4 @@ struct IErrorReport
//! Assign current filename.
virtual void SetCurrentFile(const QString& file) = 0;
//////////////////////////////////////////////////////////////////////////
// Implement IValidator interface.
//////////////////////////////////////////////////////////////////////////
virtual void Report(SValidatorRecord& record) = 0;
};
#endif // CRYINCLUDE_EDITOR_ERRORREPORT_H
-1
View File
@@ -89,7 +89,6 @@ public:
//! Get array of objects, managed by manager (not contain sub objects of groups).
//! @param layer if 0 get objects for all layers, or layer to get objects from.
virtual void GetObjects(CBaseObjectsArray& objects) const = 0;
//virtual void GetObjects(DynArray<CBaseObject*>& objects) const = 0;
//! Get array of objects that pass the filter.
//! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
-1
View File
@@ -170,7 +170,6 @@ public:
MOCK_METHOD0(IsSourceControlConnected, bool());
MOCK_METHOD0(GetUIEnumsDatabase, CUIEnumsDatabase* ());
MOCK_METHOD0(AddUIEnums, void());
MOCK_METHOD1(GetMemoryUsage, void(ICrySizer* ));
MOCK_METHOD0(ReduceMemory, void());
MOCK_METHOD0(GetExportManager, IExportManager* ());
MOCK_METHOD2(SetEditorConfigSpec, void(ESystemConfigSpec , ESystemConfigPlatform ));
+3 -3
View File
@@ -67,7 +67,7 @@ SANDBOX_API void ErrorV(const char* format, va_list argList)
str += szBuffer;
//CLogFile::WriteLine( str );
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_ERROR, str.toUtf8().data());
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_ERROR, "%s", str.toUtf8().data());
if (!CCryEditApp::instance()->IsInTestMode() && !CCryEditApp::instance()->IsInExportMode() && !CCryEditApp::instance()->IsInLevelLoadTestMode())
{
@@ -95,7 +95,7 @@ SANDBOX_API void WarningV(const char* format, va_list argList)
char szBuffer[MAX_LOGBUFFER_SIZE];
azvsnprintf(szBuffer, MAX_LOGBUFFER_SIZE, format, argList);
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, szBuffer);
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, "%s", szBuffer);
bool bNoUI = false;
ICVar* pCVar = gEnv->pConsole->GetCVar("sys_no_crash_dialog");
@@ -478,7 +478,7 @@ void CLogFile::WriteString(const char* pszString)
{
if (gEnv && gEnv->pLog)
{
gEnv->pLog->LogPlus(pszString);
gEnv->pLog->LogPlus("%s", pszString);
}
}
+2 -2
View File
@@ -2735,7 +2735,7 @@ bool CBaseObject::IntersectRayMesh(const Vec3& raySrc, const Vec3& rayDir, SRayH
return false;
}
Matrix34A worldTM;
Matrix34 worldTM;
IStatObj* pStatObj = pRenderNode->GetEntityStatObj(0, 0, &worldTM);
if (!pStatObj)
{
@@ -2743,7 +2743,7 @@ bool CBaseObject::IntersectRayMesh(const Vec3& raySrc, const Vec3& rayDir, SRayH
}
// transform decal into object space
Matrix34A worldTM_Inverted = worldTM.GetInverted();
Matrix34 worldTM_Inverted = worldTM.GetInverted();
Matrix33 worldRot(worldTM_Inverted);
worldRot.Transpose();
// put hit direction into the object space
+2 -13
View File
@@ -709,7 +709,7 @@ void CObjectManager::ShowDuplicationMsgWarning(CBaseObject* obj, const QString&
);
// If id is taken.
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, sRenameWarning.toUtf8().data());
CryWarning(VALIDATOR_MODULE_EDITOR, VALIDATOR_WARNING, "%s", sRenameWarning.toUtf8().data());
if (bShowMsgBox)
{
@@ -759,17 +759,6 @@ void CObjectManager::GetObjects(CBaseObjectsArray& objects) const
}
}
//void CObjectManager::GetObjects(DynArray<CBaseObject*>& objects) const
//{
// CBaseObjectsArray objectArray;
// GetObjects(objectArray);
// objects.clear();
// for (size_t i = 0, iCount(objectArray.size()); i < iCount; ++i)
// {
// objects.push_back(objectArray[i]);
// }
//}
void CObjectManager::GetObjects(CBaseObjectsArray& objects, BaseObjectFilterFunctor const& filter) const
{
objects.clear();
@@ -2378,7 +2367,7 @@ void CObjectManager::SetObjectSelected(CBaseObject* pObject, bool bSelect)
if (bSelect && !GetIEditor()->GetTransformManipulator())
{
if (CAxisGizmo::GetGlobalAxisGizmoCount() < gSettings.gizmo.axisGizmoMaxCount)
if (CAxisGizmo::GetGlobalAxisGizmoCount() < 1 /*legacy axisGizmoMaxCount*/)
{
// Create axis gizmo for this object.
m_gizmoManager->AddGizmo(new CAxisGizmo(pObject));
-1
View File
@@ -122,7 +122,6 @@ public:
//! Get array of objects, managed by manager (not contain sub objects of groups).
//! @param layer if 0 get objects for all layers, or layer to get objects from.
void GetObjects(CBaseObjectsArray& objects) const;
//void GetObjects(DynArray<CBaseObject*>& objects) const;
//! Get array of objects that pass the filter.
//! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
@@ -33,7 +33,7 @@
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128 _2x.png",
"filename" : "icon_128_2x.png",
"scale" : "2x"
},
{
@@ -45,7 +45,7 @@
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256 _2x.png",
"filename" : "icon_256_2x.png",
"scale" : "2x"
},
{
@@ -65,4 +65,4 @@
"version" : 1,
"author" : "xcode"
}
}
}
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e38257b6917cdf5d73e90e6009f10c8736d62b20c4e785085305075c7e6320e2
size 32037
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9f41a37d2347a617e93bd97adaf6d4c161c471ca3ef7e04b98c65ddda52396dc
size 27833
oid sha256:94cb43469dfb05d348845883914ac6d5936e851c93ae6e76d16efea90cdc27da
size 5980
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:94cb43469dfb05d348845883914ac6d5936e851c93ae6e76d16efea90cdc27da
size 5980
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b07984494059bf827bc485cbea06d12e0283811face1a18799495f9ba7ae8af1
size 20779
oid sha256:cc6a4cf056f9814a23a4f74ea0aa9cd3628a03c2349bef73c64edfed75788cb7
size 644
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e645142d284de40aafb7a4a858f3df92b6a5ba9b03fa5f1a2d3cb25211597926
size 21857
oid sha256:cc6a4cf056f9814a23a4f74ea0aa9cd3628a03c2349bef73c64edfed75788cb7
size 644
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:07631f41b8dea80713d2463f81a713a9a93798975b6fb50afbeeb13d26c57fa2
size 48899
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e38257b6917cdf5d73e90e6009f10c8736d62b20c4e785085305075c7e6320e2
size 32037
oid sha256:f0e52fba265079da19fb72aefe1cb0a4b9f8075e10341084fffb38a1b0850cd6
size 12600
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f0e52fba265079da19fb72aefe1cb0a4b9f8075e10341084fffb38a1b0850cd6
size 12600
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e645142d284de40aafb7a4a858f3df92b6a5ba9b03fa5f1a2d3cb25211597926
size 21857
oid sha256:53abfa6e6b4d3eff79851a2a95c762223bc610a6646e3370fd1113c57cc8e0e6
size 1295
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad83faf98b49f4e37112baedeae726f4f8d71bcdd1961d9cdad31f043f8ca666
size 24003
oid sha256:53abfa6e6b4d3eff79851a2a95c762223bc610a6646e3370fd1113c57cc8e0e6
size 1295
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68529a6c11d5ffa7ecd9d5bbb11ceea28e6852bd45946b525af09602c9a1e1bf
size 48899
oid sha256:f778e4aa9577faca2609343d435da745dc6f342ea7a726573441cecc870bf542
size 19204
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8a70003840b418848b2ce6c18ed7cbbfcd6fcf76598a6601dca8b98d9b6c1a2f
size 114706
oid sha256:f778e4aa9577faca2609343d435da745dc6f342ea7a726573441cecc870bf542
size 19204
@@ -33,7 +33,7 @@
{
"size" : "128x128",
"idiom" : "mac",
"filename" : "icon_128 _2x.png",
"filename" : "icon_128_2x.png",
"scale" : "2x"
},
{
@@ -45,7 +45,7 @@
{
"size" : "256x256",
"idiom" : "mac",
"filename" : "icon_256 _2x.png",
"filename" : "icon_256_2x.png",
"scale" : "2x"
},
{
@@ -65,4 +65,4 @@
"version" : 1,
"author" : "xcode"
}
}
}
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e38257b6917cdf5d73e90e6009f10c8736d62b20c4e785085305075c7e6320e2
size 32037
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9f41a37d2347a617e93bd97adaf6d4c161c471ca3ef7e04b98c65ddda52396dc
size 27833
oid sha256:94cb43469dfb05d348845883914ac6d5936e851c93ae6e76d16efea90cdc27da
size 5980
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:94cb43469dfb05d348845883914ac6d5936e851c93ae6e76d16efea90cdc27da
size 5980
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b07984494059bf827bc485cbea06d12e0283811face1a18799495f9ba7ae8af1
size 20779
oid sha256:cc6a4cf056f9814a23a4f74ea0aa9cd3628a03c2349bef73c64edfed75788cb7
size 644
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e645142d284de40aafb7a4a858f3df92b6a5ba9b03fa5f1a2d3cb25211597926
size 21857
oid sha256:cc6a4cf056f9814a23a4f74ea0aa9cd3628a03c2349bef73c64edfed75788cb7
size 644
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:07631f41b8dea80713d2463f81a713a9a93798975b6fb50afbeeb13d26c57fa2
size 48899
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e38257b6917cdf5d73e90e6009f10c8736d62b20c4e785085305075c7e6320e2
size 32037
oid sha256:f0e52fba265079da19fb72aefe1cb0a4b9f8075e10341084fffb38a1b0850cd6
size 12600
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f0e52fba265079da19fb72aefe1cb0a4b9f8075e10341084fffb38a1b0850cd6
size 12600
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e645142d284de40aafb7a4a858f3df92b6a5ba9b03fa5f1a2d3cb25211597926
size 21857
oid sha256:53abfa6e6b4d3eff79851a2a95c762223bc610a6646e3370fd1113c57cc8e0e6
size 1295
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad83faf98b49f4e37112baedeae726f4f8d71bcdd1961d9cdad31f043f8ca666
size 24003
oid sha256:53abfa6e6b4d3eff79851a2a95c762223bc610a6646e3370fd1113c57cc8e0e6
size 1295
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:68529a6c11d5ffa7ecd9d5bbb11ceea28e6852bd45946b525af09602c9a1e1bf
size 48899
oid sha256:f778e4aa9577faca2609343d435da745dc6f342ea7a726573441cecc870bf542
size 19204
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8a70003840b418848b2ce6c18ed7cbbfcd6fcf76598a6601dca8b98d9b6c1a2f
size 114706
oid sha256:f778e4aa9577faca2609343d435da745dc6f342ea7a726573441cecc870bf542
size 19204
@@ -37,7 +37,6 @@
#include <AzToolsFramework/ToolsComponents/EditorEntityIconComponentBus.h>
#include <AzToolsFramework/Undo/UndoCacheInterface.h>
#include <LmbrCentral/Rendering/RenderNodeBus.h>
#include <LmbrCentral/Rendering/MaterialOwnerBus.h>
#include <IDisplayViewport.h>
#include <CryCommon/Cry_GeoIntersect.h>
+1 -5
View File
@@ -24,11 +24,7 @@ PLUGIN_API IPlugin* CreatePluginInstance(PLUGIN_INIT_PARAM* pInitParam)
// Make sure the ffmpeg command can be executed before registering the command
if (!CFFMPEGPlugin::RuntimeTest())
{
AZStd::string msg =
"FFMPEG plugin: Failed to execute FFmepg. Please run Setup Assistant, "
"go to the 'Optional software' section of the 'Install software' tab, "
"and make sure the FFmpeg executable is correctly configured.";
GetIEditor()->GetSystem()->GetILog()->Log(msg.c_str());
GetIEditor()->GetSystem()->GetILog()->Log("FFMPEG plugin: Failed to execute FFmpeg. Please install FFmpeg.");
}
else
{
+4 -4
View File
@@ -17,8 +17,8 @@
#include "EditorPreferencesPageGeneral.h"
#include "EditorPreferencesPageFiles.h"
#include "EditorPreferencesPageViewportGeneral.h"
#include "EditorPreferencesPageViewportGizmo.h"
#include "EditorPreferencesPageViewportMovement.h"
#include "EditorPreferencesPageViewportManipulator.h"
#include "EditorPreferencesPageViewportCamera.h"
#include "EditorPreferencesPageViewportDebug.h"
#include "EditorPreferencesPageExperimentalLighting.h"
#include "EditorPreferencesPageAWS.h"
@@ -35,8 +35,8 @@ CStdPreferencesClassDesc::CStdPreferencesClassDesc()
[](){ return new CEditorPreferencesPage_General(); },
[](){ return new CEditorPreferencesPage_Files(); },
[](){ return new CEditorPreferencesPage_ViewportGeneral(); },
[](){ return new CEditorPreferencesPage_ViewportMovement(); },
[](){ return new CEditorPreferencesPage_ViewportGizmo(); },
[](){ return new CEditorPreferencesPage_ViewportCamera(); },
[](){ return new CEditorPreferencesPage_ViewportManipulator(); },
[](){ return new CEditorPreferencesPage_ViewportDebug(); }
};
+1 -1
View File
@@ -313,7 +313,7 @@ namespace
{
if (strcmp(pMessage, "") != 0)
{
CryLogAlways(pMessage);
CryLogAlways("%s", pMessage);
}
}
-37
View File
@@ -82,7 +82,6 @@ private:
namespace
{
class QtApplicationListener
: public AzToolsFramework::EditorEvents::Bus::Handler
{
@@ -99,20 +98,8 @@ namespace
delete this;
}
};
}
//////////////////////////////////////////////////////////////////////////
SGizmoSettings::SGizmoSettings()
{
axisGizmoSize = 0.2f;
axisGizmoText = true;
axisGizmoMaxCount = 50;
helpersScale = 1.f;
tagpointScaleMulti = 0.5f;
rulerSphereScale = 0.5f;
rulerSphereTrans = 0.5f;
}
//////////////////////////////////////////////////////////////////////////
SEditorSettings::SEditorSettings()
{
@@ -564,18 +551,6 @@ void SEditorSettings::Save()
SaveValue("Settings", "ShowScaleWarnings", viewports.bShowScaleWarnings);
SaveValue("Settings", "ShowRotationWarnings", viewports.bShowRotationWarnings);
//////////////////////////////////////////////////////////////////////////
// Gizmos.
//////////////////////////////////////////////////////////////////////////
SaveValue("Settings", "AxisGizmoSize", gizmo.axisGizmoSize);
SaveValue("Settings", "AxisGizmoText", gizmo.axisGizmoText);
SaveValue("Settings", "AxisGizmoMaxCount", gizmo.axisGizmoMaxCount);
SaveValue("Settings", "HelpersScale", gizmo.helpersScale);
SaveValue("Settings", "TagPointScaleMulti", gizmo.tagpointScaleMulti);
SaveValue("Settings", "RulerSphereScale", gizmo.rulerSphereScale);
SaveValue("Settings", "RulerSphereTrans", gizmo.rulerSphereTrans);
//////////////////////////////////////////////////////////////////////////
SaveValue("Settings", "TextEditorScript", textEditorForScript);
SaveValue("Settings", "TextEditorShaders", textEditorForShaders);
SaveValue("Settings", "TextEditorBSpaces", textEditorForBspaces);
@@ -769,18 +744,6 @@ void SEditorSettings::Load()
LoadValue("Settings", "ShowScaleWarnings", viewports.bShowScaleWarnings);
LoadValue("Settings", "ShowRotationWarnings", viewports.bShowRotationWarnings);
//////////////////////////////////////////////////////////////////////////
// Gizmos.
//////////////////////////////////////////////////////////////////////////
LoadValue("Settings", "AxisGizmoSize", gizmo.axisGizmoSize);
LoadValue("Settings", "AxisGizmoText", gizmo.axisGizmoText);
LoadValue("Settings", "AxisGizmoMaxCount", gizmo.axisGizmoMaxCount);
LoadValue("Settings", "HelpersScale", gizmo.helpersScale);
LoadValue("Settings", "TagPointScaleMulti", gizmo.tagpointScaleMulti);
LoadValue("Settings", "RulerSphereScale", gizmo.rulerSphereScale);
LoadValue("Settings", "RulerSphereTrans", gizmo.rulerSphereTrans);
//////////////////////////////////////////////////////////////////////////
LoadValue("Settings", "TextEditorScript", textEditorForScript);
LoadValue("Settings", "TextEditorShaders", textEditorForShaders);
LoadValue("Settings", "TextEditorBSpaces", textEditorForBspaces);
-18
View File
@@ -22,22 +22,6 @@
#include <AzQtComponents/Components/Widgets/ToolBar.h>
struct SGizmoSettings
{
float axisGizmoSize;
bool axisGizmoText;
int axisGizmoMaxCount;
float helpersScale;
float tagpointScaleMulti;
// Scale size and transparency for debug spheres when using Ruler tool
float rulerSphereScale;
float rulerSphereTrans;
SGizmoSettings();
};
//////////////////////////////////////////////////////////////////////////
// Settings for snapping in the viewports.
//////////////////////////////////////////////////////////////////////////
@@ -381,8 +365,6 @@ AZ_POP_DISABLE_DLL_EXPORT_BASECLASS_WARNING
//! Keeps the editor active even if no focus is set
int keepEditorActive;
SGizmoSettings gizmo;
// Settings of the snapping.
SSnapSettings snap;
@@ -719,8 +719,7 @@ bool CSequenceBatchRenderDialog::GetResolutionFromCustomResText(const char* cust
int scannedWidth = retCustomWidth; // initialize with default fall-back values - they'll be overwritten in the case of a succesful sscanf below.
int scannedHeight = retCustomHeight;
QString strFormat = QString::fromLatin1(customResFormat).replace(QRegularExpression(QStringLiteral("%\\d")), QStringLiteral("%d"));
scanSuccess = (azsscanf(customResText, strFormat.toStdString().c_str(), &scannedWidth, &scannedHeight) == 2);
scanSuccess = (azsscanf(customResText, "Custom(%d x %d)...", &scannedWidth, &scannedHeight) == 2);
if (scanSuccess)
{
retCustomWidth = scannedWidth;
-36
View File
@@ -62,17 +62,6 @@ public:
}
}
// to get memory statistics
void GetMemoryUsage(ICrySizer* pSizer)
{
for (int i = 0; i < m_undoSteps.size(); i++)
{
m_undoSteps[i]->GetMemoryUsage(pSizer);
}
pSizer->Add(*this);
}
private:
//! Undo steps included in this step.
std::vector<CUndoStep*> m_undoSteps;
@@ -746,31 +735,6 @@ int CUndoManager::GetMaxUndoStep() const
return GetIEditor()->GetEditorSettings()->undoLevels;
}
void CUndoManager::GetMemoryUsage(ICrySizer* pSizer)
{
if (m_currentUndo)
{
m_currentUndo->GetMemoryUsage(pSizer);
}
if (m_superUndo)
{
m_superUndo->GetMemoryUsage(pSizer);
}
for (std::list<CUndoStep*>::const_iterator it = m_undoStack.begin(); it != m_undoStack.end(); it++)
{
(*it)->GetMemoryUsage(pSizer);
}
for (std::list<CUndoStep*>::const_iterator it = m_redoStack.begin(); it != m_redoStack.end(); it++)
{
(*it)->GetMemoryUsage(pSizer);
}
pSizer->Add(*this);
}
void CUndoManager::AddListener(IUndoManagerListener* pListener)
{
stl::push_back_unique(m_listeners, pListener);
+1 -18
View File
@@ -12,9 +12,9 @@
#pragma once
#include "IUndoManagerListener.h"
#include "CrySizer.h" // ICrySizer
#include "IUndoObject.h"
#include <AzCore/Asset/AssetManager.h>
#include <CryCommon/StlUtils.h>
struct IUndoObject;
class CSuperUndoStep;
@@ -79,20 +79,6 @@ public:
}
}
// to get memory statistics
void GetMemoryUsage(ICrySizer* pSizer)
{
size_t nThisSize = sizeof(*this);
for (int i = 0; i < m_undoObjects.size(); i++)
{
nThisSize += m_undoObjects[i]->GetSize();
}
pSizer->Add(m_name);
pSizer->Add(this, nThisSize);
}
// get undo object at index i
IUndoObject* GetUndoObject(int i = 0)
{
@@ -241,9 +227,6 @@ public:
void ClearUndoStack(int num);
void ClearRedoStack(int num);
// to get memory statistics
void GetMemoryUsage(ICrySizer* pSizer);
void AddListener(IUndoManagerListener* pListener);
void RemoveListener(IUndoManagerListener* pListener);
-3
View File
@@ -20,9 +20,6 @@
#include <Cry_Color.h>
#include <CryCommon/ISystem.h>
//! Typedef for quaternion.
//typedef CryQuat Quat;
#include <QColor>
#include <QDataStream>
#include <QGuiApplication>
+1 -1
View File
@@ -52,7 +52,7 @@ bool CImageASC::Save(const QString& fileName, const CFloatImage& image)
}
// First print the file header
fprintf(file, fileHeader.c_str());
fprintf(file, "%s", fileHeader.c_str());
// Then print all the pixels.
for (uint32 y = 0; y < height; y++)
+1 -1
View File
@@ -103,7 +103,7 @@ bool CImageUtil::SavePGM(const QString& fileName, const CImageEx& image)
}
// First print the file header
fprintf(file, fileHeader.c_str());
fprintf(file, "%s", fileHeader.c_str());
// Then print all the pixels.
for (uint32 y = 0; y < height; y++)
+1 -1
View File
@@ -37,7 +37,7 @@ public:
struct SStatObj
{
Matrix34 tm;
_smart_ptr<IStatObj> pStatObj;
IStatObj* pStatObj;
};
private:
+1 -1
View File
@@ -78,7 +78,7 @@ bool CMemoryBlock::Allocate(int size, int uncompressedSize)
{
QString str;
str = QStringLiteral("CMemoryBlock::Allocate failed to allocate %1Mb of Memory").arg(size / (1024 * 1024));
CryLogAlways(str.toUtf8().data());
CryLogAlways("%s", str.toUtf8().data());
QMessageBox::critical(QApplication::activeWindow(), QString(), str + QString("\r\nSandbox will try to reduce its working memory set to free memory for this allocation."));
GetIEditor()->ReduceMemory();
+2 -3
View File
@@ -1092,9 +1092,8 @@ bool QtViewport::HitTest(const QPoint& point, HitContext& hitInfo)
const int viewportId = GetViewportId();
AzToolsFramework::EntityIdList visibleEntityIds;
AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequestBus::Event(
viewportId,
&AzToolsFramework::ViewportInteraction::MainEditorViewportInteractionRequests::FindVisibleEntities,
AzToolsFramework::ViewportInteraction::EditorEntityViewportInteractionRequestBus::Event(
viewportId, &AzToolsFramework::ViewportInteraction::EditorEntityViewportInteractionRequestBus::Events::FindVisibleEntities,
visibleEntityIds);
// Look through all visible entities to find the closest one to the specified mouse point
+4 -4
View File
@@ -554,10 +554,10 @@ set(FILES
EditorPreferencesPageFiles.cpp
EditorPreferencesPageViewportGeneral.h
EditorPreferencesPageViewportGeneral.cpp
EditorPreferencesPageViewportGizmo.h
EditorPreferencesPageViewportGizmo.cpp
EditorPreferencesPageViewportMovement.h
EditorPreferencesPageViewportMovement.cpp
EditorPreferencesPageViewportManipulator.h
EditorPreferencesPageViewportManipulator.cpp
EditorPreferencesPageViewportCamera.h
EditorPreferencesPageViewportCamera.cpp
EditorPreferencesPageViewportDebug.h
EditorPreferencesPageViewportDebug.cpp
EditorPreferencesPageExperimentalLighting.h
@@ -456,7 +456,7 @@ namespace AZ
{
if (loadBehavior & (1 << thisFlag))
{
returnFlags[thisFlag] = 1;
returnFlags[thisFlag] = true;
}
}
return returnFlags;
@@ -71,8 +71,8 @@ namespace AZ
//////////////////////////////////////////////////////////////////////////
// EBusTraits overrides
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById;
typedef AssetId BusIdType;
typedef AZStd::recursive_mutex MutexType;
using BusIdType = AssetId;
using MutexType = AZStd::recursive_mutex;
template <class Bus>
struct AssetJobConnectionPolicy
@@ -107,7 +107,7 @@ namespace AZ
virtual void OnLoadCanceled(AssetId assetId) = 0;
};
typedef EBus<BlockingAssetLoadEvents> BlockingAssetLoadBus;
using BlockingAssetLoadBus = EBus<BlockingAssetLoadEvents>;
/*
* This class processes async AssetDatabase load jobs
@@ -645,7 +645,7 @@ namespace AZ
NameDictionary::Create();
// Call this and child class's reflects
ReflectionEnvironment::GetReflectionManager()->Reflect(azrtti_typeid(this), AZStd::bind(&ComponentApplication::Reflect, this, AZStd::placeholders::_1));
ReflectionEnvironment::GetReflectionManager()->Reflect(azrtti_typeid(this), [this](ReflectContext* context) {Reflect(context); });
RegisterCoreComponents();
TickBus::AllowFunctionQueuing(true);
@@ -970,7 +970,12 @@ namespace AZ
{
if (ReflectionEnvironment::GetReflectionManager())
{
ReflectionEnvironment::GetReflectionManager()->Reflect(descriptor->GetUuid(), AZStd::bind(&ComponentDescriptor::Reflect, descriptor, AZStd::placeholders::_1));
ReflectionEnvironment::GetReflectionManager()->Reflect(
descriptor->GetUuid(),
[descriptor](ReflectContext* context)
{
descriptor->Reflect(context);
});
}
}
@@ -23,8 +23,8 @@ using namespace AZ;
// [3/21/2011]
//=========================================================================
ZLib::ZLib(IAllocator* workMemAllocator)
: m_strDeflate(NULL)
, m_strInflate(NULL)
: m_strDeflate(nullptr)
, m_strInflate(nullptr)
{
m_workMemoryAllocator = workMemAllocator ? workMemAllocator->GetAllocationSource() : nullptr;
if (!m_workMemoryAllocator)
@@ -75,7 +75,7 @@ void ZLib::FreeMem(void* userData, void* address)
//=========================================================================
void ZLib::StartCompressor(unsigned int compressionLevel)
{
AZ_Assert(m_strDeflate == NULL, "Compressor already started!");
AZ_Assert(m_strDeflate == nullptr, "Compressor already started!");
m_strDeflate = reinterpret_cast< z_stream* >(AllocateMem(m_workMemoryAllocator, 1, sizeof(z_stream)));
m_strDeflate->zalloc = &ZLib::AllocateMem;
m_strDeflate->zfree = &ZLib::FreeMem;
@@ -91,10 +91,10 @@ void ZLib::StartCompressor(unsigned int compressionLevel)
//=========================================================================
void ZLib::StopCompressor()
{
AZ_Assert(m_strDeflate != NULL, "Compressor not started!");
AZ_Assert(m_strDeflate != nullptr, "Compressor not started!");
deflateEnd(m_strDeflate);
FreeMem(m_workMemoryAllocator, m_strDeflate);
m_strDeflate = NULL;
m_strDeflate = nullptr;
}
//=========================================================================
@@ -103,7 +103,7 @@ void ZLib::StopCompressor()
//=========================================================================
void ZLib::ResetCompressor()
{
AZ_Assert(m_strDeflate != NULL, "Compressor not started!");
AZ_Assert(m_strDeflate != nullptr, "Compressor not started!");
int r = deflateReset(m_strDeflate);
(void)r;
AZ_Assert(r == Z_OK, "ZLib inconsistent state - deflateReset() failed !!!\n");
@@ -115,7 +115,7 @@ void ZLib::ResetCompressor()
//=========================================================================
unsigned int ZLib::Compress(const void* data, unsigned int& dataSize, void* compressedData, unsigned int compressedDataSize, FlushType flushType)
{
AZ_Assert(m_strDeflate != NULL, "Compressor not started!");
AZ_Assert(m_strDeflate != nullptr, "Compressor not started!");
m_strDeflate->avail_in = dataSize;
m_strDeflate->next_in = (unsigned char*)data;
m_strDeflate->avail_out = compressedDataSize;
@@ -158,7 +158,7 @@ unsigned int ZLib::Compress(const void* data, unsigned int& dataSize, void* comp
//=========================================================================
unsigned int ZLib::GetMinCompressedBufferSize(unsigned int sourceDataSize)
{
AZ_Assert(m_strDeflate != NULL, "Compressor not started!");
AZ_Assert(m_strDeflate != nullptr, "Compressor not started!");
return static_cast<unsigned int>(deflateBound(m_strDeflate, sourceDataSize));
}
@@ -168,7 +168,7 @@ unsigned int ZLib::GetMinCompressedBufferSize(unsigned int sourceDataSize)
//=========================================================================
void ZLib::StartDecompressor(Header* header)
{
AZ_Assert(m_strInflate == NULL, "Decompressor already started!");
AZ_Assert(m_strInflate == nullptr, "Decompressor already started!");
m_strInflate = reinterpret_cast< z_stream* >(AllocateMem(m_workMemoryAllocator, 1, sizeof(z_stream)));
m_strInflate->zalloc = &ZLib::AllocateMem;
m_strInflate->zfree = &ZLib::FreeMem;
@@ -188,10 +188,10 @@ void ZLib::StartDecompressor(Header* header)
//=========================================================================
void ZLib::StopDecompressor()
{
AZ_Assert(m_strInflate != NULL, "Decompressor not started!");
AZ_Assert(m_strInflate != nullptr, "Decompressor not started!");
inflateEnd(m_strInflate);
FreeMem(m_workMemoryAllocator, m_strInflate);
m_strInflate = NULL;
m_strInflate = nullptr;
}
//=========================================================================
@@ -200,7 +200,7 @@ void ZLib::StopDecompressor()
//=========================================================================
void ZLib::ResetDecompressor(Header* header)
{
AZ_Assert(m_strInflate != NULL, "Decompressor not started!");
AZ_Assert(m_strInflate != nullptr, "Decompressor not started!");
int r = inflateReset(m_strInflate);
(void)r;
AZ_Assert(r == Z_OK, "ZLib inconsistent state - inflateReset() failed !!!\n");
@@ -229,7 +229,7 @@ void ZLib::SetupDecompressHeader(Header header)
//=========================================================================
unsigned int ZLib::Decompress(const void* compressedData, unsigned int compressedDataSize, void* data, unsigned int& dataSize, FlushType flushType)
{
AZ_Assert(m_strInflate != NULL, "Decompressor not started!");
AZ_Assert(m_strInflate != nullptr, "Decompressor not started!");
m_strInflate->avail_in = compressedDataSize;
m_strInflate->next_in = (unsigned char*)compressedData;
m_strInflate->avail_out = dataSize;
@@ -242,7 +242,9 @@ namespace AZ::Debug
ThreadData* threadData = threadStorage.m_data;
// Set to nullptr so other threads doing a flush can't pick this up.
while (!threadStorage.m_data.compare_exchange_strong(threadData, nullptr));
while (!threadStorage.m_data.compare_exchange_strong(threadData, nullptr))
{
}
uint32_t writeSize = AZ_SIZE_ALIGN_UP(sizeof(EventHeader) + size, EventBoundary);
if (threadData->m_usedBytes + writeSize >= ThreadData::BufferSize)
@@ -270,7 +272,9 @@ namespace AZ::Debug
// swap the pending data to commit the event
ThreadStorage& threadStorage = GetThreadStorage();
ThreadData* expectedData = nullptr;
while (!threadStorage.m_data.compare_exchange_strong(expectedData, threadStorage.m_pendingData));
while (!threadStorage.m_data.compare_exchange_strong(expectedData, threadStorage.m_pendingData))
{
}
threadStorage.m_pendingData = nullptr;
}
+2 -2
View File
@@ -154,7 +154,7 @@ namespace AZ
}
bool
Trace::WaitForDebugger(float timeoutSeconds/*=-1.f*/)
Trace::WaitForDebugger([[maybe_unused]] float timeoutSeconds/*=-1.f*/)
{
#if defined(AZ_ENABLE_DEBUG_TOOLS)
using AZStd::chrono::system_clock;
@@ -218,7 +218,7 @@ namespace AZ
void Debug::Trace::Crash()
{
int* p = 0;
int* p = nullptr;
*p = 1;
}
+6 -6
View File
@@ -19,7 +19,7 @@ namespace AZ
{
void OutputToDebugger(const char* window, const char* message);
}
/// Global instance to the tracer.
extern class Trace g_tracer;
@@ -41,7 +41,7 @@ namespace AZ
static void Destroy();
static int GetAssertVerbosityLevel();
static void SetAssertVerbosityLevel(int level);
/**
* Returns the default string used for a system window.
* It can be useful for Trace message handlers to easily validate if the window they received is the fallback window used by this class,
@@ -109,7 +109,7 @@ namespace AZ
* Correct usage:
* AZ_Assert(false, "Fail always");
*/
namespace AZ
{
namespace TraceInternal
@@ -121,7 +121,7 @@ namespace AZ
static constexpr ExpressionValidResult value = ExpressionValidResult::Valid;
};
template<>
struct ExpressionIsValid<const char*&>
struct ExpressionIsValid<const char*&>
{
static constexpr ExpressionValidResult value = ExpressionValidResult::Valid;
};
@@ -228,7 +228,7 @@ namespace AZ
{ \
AZ::Debug::Trace::Instance().Printf(window, __VA_ARGS__); \
}
//! The AZ_TrancePrintfOnce macro output the result of the format string only once for each use of the macro
//! It does not take into account the result of the format string to determine whether to output the string or not
@@ -278,7 +278,7 @@ namespace AZ
#define AZ_Printf(window, ...) AZ::Debug::Trace::Instance().Printf(window, __VA_ARGS__);
#if !defined(RELEASE) || defined(PERFORMANCE_BUILD)
#if !defined(RELEASE)
// Unconditional critical error log, enabled up to Performance config
#define AZ_Fatal(window, format, ...) AZ::Debug::Trace::Instance().Printf(window, "[FATAL] " format "\n", ##__VA_ARGS__);
#define AZ_Crash() AZ::Debug::Trace::Instance().Crash();
@@ -208,7 +208,7 @@ namespace AZ
{
if (drillerList.empty())
{
return NULL;
return nullptr;
}
m_sessions.push_back();
@@ -246,21 +246,21 @@ namespace AZ
AZStd::lock_guard<DrillerEBusMutex::MutexType> lock(DrillerEBusMutex::GetMutex()); ///< Make sure no driller is writing to the stream
for (DrillerListType::const_iterator iDriller = drillerList.begin(); iDriller != drillerList.end(); ++iDriller)
{
Driller* driller = NULL;
Driller* driller = nullptr;
const DrillerInfo& di = *iDriller;
for (size_t iDesc = 0; iDesc < m_drillers.size(); ++iDesc)
{
if (m_drillers[iDesc]->GetId() == di.id)
{
driller = m_drillers[iDesc];
AZ_Assert(driller->m_output == NULL, "Driller with id %08x is already have an output stream %p (currently we support only 1 at a time)", di.id, driller->m_output);
AZ_Assert(driller->m_output == nullptr, "Driller with id %08x is already have an output stream %p (currently we support only 1 at a time)", di.id, driller->m_output);
driller->m_output = &output;
driller->Start(di.params.data(), static_cast<unsigned int>(di.params.size()));
s.drillers.push_back(driller);
break;
}
}
AZ_Warning("Driller", driller != NULL, "We can't start a driller with id %d!", di.id);
AZ_Warning("Driller", driller != nullptr, "We can't start a driller with id %d!", di.id);
}
}
return &s;
@@ -293,7 +293,7 @@ namespace AZ
for (size_t i = 0; i < s.drillers.size(); ++i)
{
s.drillers[i]->Stop();
s.drillers[i]->m_output = NULL;
s.drillers[i]->m_output = nullptr;
}
}
s.output->EndTag(AZ_CRC("Frame", 0xb5f83ccd));
@@ -677,7 +677,7 @@ namespace AZ
AZStd::endian_swap(crc32);
}
stringPtr = m_stringPool->Find(crc32);
AZ_Assert(stringPtr != NULL, "Failed to find string with id 0x%08x in the string pool, proper stream read is impossible!", crc32);
AZ_Assert(stringPtr != nullptr, "Failed to find string with id 0x%08x in the string pool, proper stream read is impossible!", crc32);
stringLength = static_cast<unsigned int>(strlen(stringPtr));
}
else if (m_isPooledString)
@@ -710,7 +710,7 @@ namespace AZ
//=========================================================================
const DrillerDOMParser::Node* DrillerDOMParser::Node::GetTag(u32 tagName) const
{
const Node* tagNode = NULL;
const Node* tagNode = nullptr;
for (Node::NodeListType::const_iterator i = m_tags.begin(); i != m_tags.end(); ++i)
{
if ((*i).m_name == tagName)
@@ -728,7 +728,7 @@ namespace AZ
//=========================================================================
const DrillerDOMParser::Data* DrillerDOMParser::Node::GetData(u32 dataName) const
{
const Data* dataNode = NULL;
const Data* dataNode = nullptr;
for (Node::DataListType::const_iterator i = m_data.begin(); i != m_data.end(); ++i)
{
if (i->m_name == dataName)
@@ -749,7 +749,7 @@ namespace AZ
, m_isPersistentInputData(isPersistentInputData)
{
m_root.m_name = 0;
m_root.m_parent = NULL;
m_root.m_parent = nullptr;
m_topNode = &m_root;
}
static int g_numFree = 0;
@@ -850,14 +850,14 @@ namespace AZ
return;
}
DrillerHandlerParser* childHandler = NULL;
DrillerHandlerParser* childHandler = nullptr;
DrillerHandlerParser* currentHandler = m_stack.back();
if (isOpen)
{
if (currentHandler != NULL)
if (currentHandler != nullptr)
{
childHandler = currentHandler->OnEnterTag(name);
AZ_Warning("Driller", !currentHandler->IsWarnOnUnsupportedTags() || childHandler != NULL, "Could not find handler for tag 0x%08x", name);
AZ_Warning("Driller", !currentHandler->IsWarnOnUnsupportedTags() || childHandler != nullptr, "Could not find handler for tag 0x%08x", name);
}
m_stack.push_back(childHandler);
}
@@ -22,10 +22,10 @@ namespace AZ
// [12/13/2012]
//=========================================================================
CompressorZLib::CompressorZLib(unsigned int decompressionCachePerStream, unsigned int dataBufferSize)
: m_lastReadStream(NULL)
: m_lastReadStream(nullptr)
, m_lastReadStreamOffset(0)
, m_lastReadStreamSize(0)
, m_compressedDataBuffer(NULL)
, m_compressedDataBuffer(nullptr)
, m_compressedDataBufferSize(dataBufferSize)
, m_compressedDataBufferUseCount(0)
, m_decompressionCachePerStream(decompressionCachePerStream)
@@ -63,7 +63,7 @@ namespace AZ
//=========================================================================
bool CompressorZLib::ReadHeaderAndData(CompressorStream* stream, AZ::u8* data, unsigned int dataSize)
{
if (stream->GetCompressorData() != NULL) // we already have compressor data
if (stream->GetCompressorData() != nullptr) // we already have compressor data
{
return false;
}
@@ -347,7 +347,7 @@ namespace AZ
AZ_Assert(stream && stream->GetCompressorData(), "This stream doesn't have compression enabled! Call Stream::WriteCompressed after you create the file!");
AZ_Assert(offset == SizeType(-1) || offset == stream->GetCurPos(), "We can write compressed data only at the end of the stream!");
m_lastReadStream = NULL; // invalidate last read position, otherwise m_dataBuffer will be corrupted (as we are about to write in it).
m_lastReadStream = nullptr; // invalidate last read position, otherwise m_dataBuffer will be corrupted (as we are about to write in it).
CompressorZLibData* zlibData = static_cast<CompressorZLibData*>(stream->GetCompressorData());
AZ_Assert(!zlibData->m_zlib.IsDecompressorStarted(), "You can't write while reading/decompressing a compressed stream!");
@@ -398,13 +398,13 @@ namespace AZ
AZ_Assert(stream && stream->GetCompressorData(), "This stream doesn't have compression enabled! Call Stream::WriteCompressed after you create the file!");
CompressorZLibData* zlibData = static_cast<CompressorZLibData*>(stream->GetCompressorData());
m_lastReadStream = NULL; // invalidate last read position, otherwise m_dataBuffer will be corrupted (as we are about to write in it).
m_lastReadStream = nullptr; // invalidate last read position, otherwise m_dataBuffer will be corrupted (as we are about to write in it).
unsigned int compressedSize;
unsigned int dataToCompress = 0;
do
{
compressedSize = zlibData->m_zlib.Compress(NULL, dataToCompress, m_compressedDataBuffer, m_compressedDataBufferSize, ZLib::FT_FULL_FLUSH);
compressedSize = zlibData->m_zlib.Compress(nullptr, dataToCompress, m_compressedDataBuffer, m_compressedDataBufferSize, ZLib::FT_FULL_FLUSH);
if (compressedSize)
{
GenericStream* baseStream = stream->GetWrappedStream();
@@ -429,7 +429,7 @@ namespace AZ
//=========================================================================
bool CompressorZLib::StartCompressor(CompressorStream* stream, int compressionLevel, SizeType autoSeekDataSize)
{
AZ_Assert(stream && stream->GetCompressorData() == NULL, "Stream has compressor already enabled!");
AZ_Assert(stream && stream->GetCompressorData() == nullptr, "Stream has compressor already enabled!");
AcquireDataBuffer();
@@ -470,14 +470,14 @@ namespace AZ
bool result = true;
if (zlibData->m_zlib.IsCompressorStarted())
{
m_lastReadStream = NULL; // invalidate last read position, otherwise m_dataBuffer will be corrupted (as we are about to write in it).
m_lastReadStream = nullptr; // invalidate last read position, otherwise m_dataBuffer will be corrupted (as we are about to write in it).
// flush all compressed data
unsigned int compressedSize;
unsigned int dataToCompress = 0;
do
{
compressedSize = zlibData->m_zlib.Compress(NULL, dataToCompress, m_compressedDataBuffer, m_compressedDataBufferSize, ZLib::FT_FINISH);
compressedSize = zlibData->m_zlib.Compress(nullptr, dataToCompress, m_compressedDataBuffer, m_compressedDataBufferSize, ZLib::FT_FINISH);
if (compressedSize)
{
baseStream->Write(compressedSize, m_compressedDataBuffer);
@@ -502,7 +502,7 @@ namespace AZ
{
if (m_lastReadStream == stream)
{
m_lastReadStream = NULL; // invalidate the data in m_dataBuffer if it was from the current stream.
m_lastReadStream = nullptr; // invalidate the data in m_dataBuffer if it was from the current stream.
}
}
@@ -525,11 +525,11 @@ namespace AZ
//=========================================================================
void CompressorZLib::AcquireDataBuffer()
{
if (m_compressedDataBuffer == NULL)
if (m_compressedDataBuffer == nullptr)
{
AZ_Assert(m_compressedDataBufferUseCount == 0, "Buffer usecount should be 0 if the buffer is NULL");
m_compressedDataBuffer = reinterpret_cast<unsigned char*>(azmalloc(m_compressedDataBufferSize, m_CompressedDataBufferAlignment, AZ::SystemAllocator, "CompressorZLib"));
m_lastReadStream = NULL; // reset the cache info in the m_dataBuffer
m_lastReadStream = nullptr; // reset the cache info in the m_dataBuffer
}
++m_compressedDataBufferUseCount;
}
@@ -543,10 +543,10 @@ namespace AZ
--m_compressedDataBufferUseCount;
if (m_compressedDataBufferUseCount == 0)
{
AZ_Assert(m_compressedDataBuffer != NULL, "Invalid data buffer! We should have a non null pointer!");
AZ_Assert(m_compressedDataBuffer != nullptr, "Invalid data buffer! We should have a non null pointer!");
azfree(m_compressedDataBuffer, AZ::SystemAllocator, m_compressedDataBufferSize, m_CompressedDataBufferAlignment);
m_compressedDataBuffer = NULL;
m_lastReadStream = NULL; // reset the cache info in the m_dataBuffer
m_compressedDataBuffer = nullptr;
m_lastReadStream = nullptr; // reset the cache info in the m_dataBuffer
}
}
} // namespace IO
@@ -127,7 +127,7 @@ bool SystemFile::Open(const char* fileName, int mode, int platformFlags)
bool SystemFile::ReOpen(int mode, int platformFlags)
{
AZ_Assert(!m_fileName.empty(), "Missing filename. You must call open first!");
return Open(0, mode, platformFlags);
return Open(nullptr, mode, platformFlags);
}
void SystemFile::Close()
@@ -125,7 +125,7 @@ SharedMemory::Close()
bool
SharedMemory::Map(AccessMode mode, unsigned int size)
{
AZ_Assert(m_mappedBase == NULL, "We already have data mapped");
AZ_Assert(m_mappedBase == nullptr, "We already have data mapped");
AZ_Assert(Platform::IsMapHandleValid(), "You must call Map() first!");
bool result = Platform::Map(mode, size);
@@ -232,7 +232,7 @@ bool SharedMemory::CheckMappedBaseValid()
// [4/29/2011]
//=========================================================================
SharedMemoryRingBuffer::SharedMemoryRingBuffer()
: m_info(NULL)
: m_info(nullptr)
{}
//=========================================================================
@@ -279,7 +279,7 @@ SharedMemoryRingBuffer::Map(AccessMode mode, unsigned int size)
bool
SharedMemoryRingBuffer::UnMap()
{
m_info = NULL;
m_info = nullptr;
return SharedMemory::UnMap();
}
@@ -291,7 +291,7 @@ bool
SharedMemoryRingBuffer::Write(const void* data, unsigned int dataSize)
{
AZ_Warning("AZSystem", !Platform::IsWaitFailed(), "You are writing the ring buffer %s while the Global lock is NOT locked! This can lead to data corruption!", m_name);
AZ_Assert(m_info != NULL, "You need to Create and Map the buffer first!");
AZ_Assert(m_info != nullptr, "You need to Create and Map the buffer first!");
if (m_info->m_writeOffset >= m_info->m_readOffset)
{
unsigned int freeSpace = m_dataSize - (m_info->m_writeOffset - m_info->m_readOffset);
@@ -346,7 +346,7 @@ SharedMemoryRingBuffer::Read(void* data, unsigned int maxDataSize)
return 0;
}
AZ_Assert(m_info != NULL, "You need to Create and Map the buffer first!");
AZ_Assert(m_info != nullptr, "You need to Create and Map the buffer first!");
unsigned int dataRead;
if (m_info->m_writeOffset > m_info->m_readOffset)
{
@@ -192,15 +192,15 @@ void JobManagerWorkStealing::SuspendJobUntilReady(Job* job)
ThreadInfo* info = GetCurrentOrCreateThreadInfo();
AZ_Assert(info->m_currentJob == job, ("Can't suspend a job which isn't currently running"));
info->m_currentJob = NULL; //clear current job
info->m_currentJob = nullptr; //clear current job
if (IsAsynchronous())
{
ProcessJobsAssist(info, job, NULL);
ProcessJobsAssist(info, job, nullptr);
}
else
{
ProcessJobsSynchronous(info, job, NULL);
ProcessJobsSynchronous(info, job, nullptr);
}
info->m_currentJob = job; //restore current job
@@ -223,11 +223,11 @@ void JobManagerWorkStealing::StartJobAndAssistUntilComplete(Job* job)
//the processing functions will return when the empty job dependent count has reached 1
if (IsAsynchronous())
{
ProcessJobsAssist(info, NULL, &notifyFlag);
ProcessJobsAssist(info, nullptr, &notifyFlag);
}
else
{
ProcessJobsSynchronous(info, NULL, &notifyFlag);
ProcessJobsSynchronous(info, nullptr, &notifyFlag);
}
AZ_Assert(!m_currentThreadInfo, "");
@@ -306,9 +306,9 @@ void JobManagerWorkStealing::ProcessJobsWorker(ThreadInfo* info)
//setup thread-local storage
m_currentThreadInfo = info;
ProcessJobsInternal(info, NULL, NULL);
ProcessJobsInternal(info, nullptr, nullptr);
m_currentThreadInfo = NULL;
m_currentThreadInfo = nullptr;
}
void JobManagerWorkStealing::ProcessJobsAssist(ThreadInfo* info, Job* suspendedJob, AZStd::atomic<bool>* notifyFlag)
@@ -529,7 +529,7 @@ void JobManagerWorkStealing::ProcessJobsSynchronous(ThreadInfo* info, Job* suspe
info->m_currentJob = job;
Process(job);
info->m_currentJob = NULL;
info->m_currentJob = nullptr;
//...after calling Process we cannot use the job pointer again, the job has completed and may not exist anymore
#ifdef JOBMANAGER_ENABLE_STATS
+2 -2
View File
@@ -36,7 +36,7 @@ namespace AZ
}
countAndFlags |= (unsigned int)((priority << FLAG_PRIORITY_START_BIT) & FLAG_PRIORITY_MASK);
SetDependentCountAndFlags(countAndFlags);
StoreDependent(NULL);
StoreDependent(nullptr);
#ifdef AZ_DEBUG_JOB_STATE
SetState(STATE_SETUP);
@@ -66,7 +66,7 @@ namespace AZ
SetDependentCountAndFlags(countAndFlags);
if (isClearDependent)
{
StoreDependent(NULL);
StoreDependent(nullptr);
}
else
{
@@ -628,7 +628,7 @@ int AZ::Intersect::IntersectRayCappedCylinder(
int AZ::Intersect::IntersectRayCone(
const Vector3& rayOrigin, const Vector3& rayDir,
const Vector3& coneApex, const Vector3& coneDir, float coneHeight,
float coneBaseRaidus, float& t1, float& t2)
float coneBaseRadius, float& t1, float& t2)
{
// Q = rayOrgin, A = coneApex
Vector3 AQ = rayOrigin - coneApex;
@@ -646,7 +646,7 @@ int AZ::Intersect::IntersectRayCone(
return 0;
}
float r2 = coneBaseRaidus * coneBaseRaidus;
float r2 = coneBaseRadius * coneBaseRadius;
float h2 = coneHeight * coneHeight;
float m2 = m * m;
@@ -240,7 +240,7 @@ namespace AZ
//! @return The number of intersecting points.
int IntersectRayCone(
const Vector3& rayOrigin, const Vector3& rayDir,
const Vector3& coneApex, const Vector3& coneDir, float coneHeight, float coneBaseRaidus,
const Vector3& coneApex, const Vector3& coneDir, float coneHeight, float coneBaseRadius,
float& t1, float& t2);
//! Test intersection between a ray and a plane in 3D.
+2 -2
View File
@@ -56,7 +56,7 @@ namespace AZ
Uuid Uuid::CreateStringSkipWarnings(const char* string, size_t stringLength, [[maybe_unused]] bool skipWarnings)
{
if (string == NULL)
if (string == nullptr)
{
return Uuid::CreateNull();
}
@@ -71,7 +71,7 @@ namespace AZ
if (len < 32 || len > 38)
{
AZ_Warning("Math", skipWarnings, "Invalid UUID format %s (must be) {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} (or without dashes and braces)", string != NULL ? string : "null");
AZ_Warning("Math", skipWarnings, "Invalid UUID format %s (must be) {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} (or without dashes and braces)", string != nullptr ? string : "null");
return Uuid::CreateNull();
}
@@ -169,7 +169,7 @@ AllocationRecords::RegisterAllocation(void* address, size_t byteSize, size_t ali
ai.m_timeStamp = AZStd::GetTimeNowMicroSecond();
// if we don't have a fileName,lineNum record the stack or if the user requested it.
if ((fileName == 0 && m_mode == RECORD_STACK_IF_NO_FILE_LINE) || m_mode == RECORD_FULL)
if ((fileName == nullptr && m_mode == RECORD_STACK_IF_NO_FILE_LINE) || m_mode == RECORD_FULL)
{
ai.m_stackFrames = m_numStackLevels ? reinterpret_cast<AZ::Debug::StackFrame*>(m_records.get_allocator().allocate(sizeof(AZ::Debug::StackFrame)*m_numStackLevels, 1)) : nullptr;
if (ai.m_stackFrames)
@@ -39,9 +39,9 @@ namespace AZ
return AZStd::hash<AZStd::string_view>{}(key);
}
};
typedef AZStd::basic_string<char, AZStd::char_traits<char>, AZStdIAllocator> AMString;
typedef AZStd::unordered_map<AMString, IAllocator*, AMStringHasher, AZStd::equal_to<>, AZStdIAllocator> AllocatorNameMap;
typedef AZStd::unordered_map<AMString, AMString, AMStringHasher, AZStd::equal_to<>, AZStdIAllocator> AllocatorRemappings;
using AMString = AZStd::basic_string<char, AZStd::char_traits<char>, AZStdIAllocator>;
using AllocatorNameMap = AZStd::unordered_map<AMString, IAllocator*, AMStringHasher, AZStd::equal_to<>, AZStdIAllocator>;
using AllocatorRemappings = AZStd::unordered_map<AMString, AMString, AMStringHasher, AZStd::equal_to<>, AZStdIAllocator>;
// For allocators that are created before we have an environment, we keep some module-local data for them so that we can register them
// properly once the environment is attached.
@@ -403,7 +403,7 @@ AllocatorManager::AddOutOfMemoryListener(const OutOfMemoryCBType& cb)
void
AllocatorManager::RemoveOutOfMemoryListener()
{
m_outOfMemoryListener = 0;
m_outOfMemoryListener = nullptr;
}
//=========================================================================
@@ -660,13 +660,13 @@ void AllocatorManager::GetAllocatorStats(size_t& allocatedBytes, size_t& capacit
//=========================================================================
AllocatorManager::MemoryBreak::MemoryBreak()
{
addressStart = NULL;
addressEnd = NULL;
addressStart = nullptr;
addressEnd = nullptr;
byteSize = 0;
alignment = static_cast<size_t>(0xffffffff);
name = NULL;
name = nullptr;
fileName = NULL;
fileName = nullptr;
lineNum = -1;
}
@@ -729,14 +729,14 @@ AllocatorManager::DebugBreak(void* address, const Debug::AllocationInfo& info)
AZ_Assert(!(m_memoryBreak[i].alignment == info.m_alignment), "User triggered breakpoint - alignment (%d)", info.m_alignment);
AZ_Assert(!(m_memoryBreak[i].byteSize == info.m_byteSize), "User triggered breakpoint - allocation size (%d)", info.m_byteSize);
AZ_Assert(!(info.m_name != NULL && m_memoryBreak[i].name != NULL && strcmp(m_memoryBreak[i].name, info.m_name) == 0), "User triggered breakpoint - name \"%s\"", info.m_name);
AZ_Assert(!(info.m_name != nullptr && m_memoryBreak[i].name != nullptr && strcmp(m_memoryBreak[i].name, info.m_name) == 0), "User triggered breakpoint - name \"%s\"", info.m_name);
if (m_memoryBreak[i].lineNum != 0)
{
AZ_Assert(!(info.m_fileName != NULL && m_memoryBreak[i].fileName != NULL && strcmp(m_memoryBreak[i].fileName, info.m_fileName) == 0 && m_memoryBreak[i].lineNum == info.m_lineNum), "User triggered breakpoint - file/line number : %s(%d)", info.m_fileName, info.m_lineNum);
AZ_Assert(!(info.m_fileName != nullptr && m_memoryBreak[i].fileName != nullptr && strcmp(m_memoryBreak[i].fileName, info.m_fileName) == 0 && m_memoryBreak[i].lineNum == info.m_lineNum), "User triggered breakpoint - file/line number : %s(%d)", info.m_fileName, info.m_lineNum);
}
else
{
AZ_Assert(!(info.m_fileName != NULL && m_memoryBreak[i].fileName != NULL && strcmp(m_memoryBreak[i].fileName, info.m_fileName) == 0), "User triggered breakpoint - file name \"%s\"", info.m_fileName);
AZ_Assert(!(info.m_fileName != nullptr && m_memoryBreak[i].fileName != nullptr && strcmp(m_memoryBreak[i].fileName, info.m_fileName) == 0), "User triggered breakpoint - file name \"%s\"", info.m_fileName);
}
}
}
@@ -22,7 +22,7 @@ using namespace AZ;
//=========================================================================
BestFitExternalMapAllocator::BestFitExternalMapAllocator()
: AllocatorBase(this, "BestFitExternalMapAllocator", "Best fit allocator with external tracking storage!")
, m_schema(NULL)
, m_schema(nullptr)
{}
//=========================================================================
@@ -47,7 +47,7 @@ BestFitExternalMapAllocator::Create(const Descriptor& desc)
schemaDesc.m_memoryBlockByteSize = desc.m_memoryBlockByteSize;
m_schema = azcreate(BestFitExternalMapSchema, (schemaDesc), SystemAllocator);
if (m_schema == NULL)
if (m_schema == nullptr)
{
isReady = false;
}
@@ -63,7 +63,7 @@ void
BestFitExternalMapAllocator::Destroy()
{
azdestroy(m_schema, SystemAllocator);
m_schema = NULL;
m_schema = nullptr;
}
AllocatorDebugConfig BestFitExternalMapAllocator::GetDebugConfig()
@@ -89,7 +89,7 @@ BestFitExternalMapAllocator::Allocate(size_type byteSize, size_type alignment, i
byteSize = MemorySizeAdjustedUp(byteSize);
BestFitExternalMapAllocator::pointer_type address = m_schema->Allocate(byteSize, alignment, flags);
if (address == 0)
if (address == nullptr)
{
if (!OnOutOfMemory(byteSize, alignment, flags, name, fileName, lineNum))
{
@@ -100,7 +100,7 @@ BestFitExternalMapAllocator::Allocate(size_type byteSize, size_type alignment, i
}
}
AZ_Assert(address != 0, "BestFitExternalMapAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum);
AZ_Assert(address != nullptr, "BestFitExternalMapAllocator: Failed to allocate %d bytes aligned on %d (flags: 0x%08x) %s : %s (%d)!", byteSize, alignment, flags, name ? name : "(no name)", fileName ? fileName : "(no file name)", lineNum);
AZ_MEMORY_PROFILE(ProfileAllocation(address, byteSize, alignment, name, fileName, lineNum, suppressStackRecord + 1));
return address;
@@ -145,7 +145,7 @@ BestFitExternalMapAllocator::ReAllocate(pointer_type ptr, size_type newSize, siz
(void)newSize;
(void)newAlignment;
AZ_Assert(false, "Not supported!");
return NULL;
return nullptr;
}
//=========================================================================
@@ -18,15 +18,15 @@ using namespace AZ;
BestFitExternalMapSchema::BestFitExternalMapSchema(const Descriptor& desc)
: m_desc(desc)
, m_used(0)
, m_freeChunksMap(FreeMapType::key_compare(), AZStdIAllocator(desc.m_mapAllocator != NULL ? desc.m_mapAllocator : &AllocatorInstance<SystemAllocator>::Get()))
, m_allocChunksMap(AllocMapType::hasher(), AllocMapType::key_eq(), AZStdIAllocator(desc.m_mapAllocator != NULL ? desc.m_mapAllocator : &AllocatorInstance<SystemAllocator>::Get()))
, m_freeChunksMap(FreeMapType::key_compare(), AZStdIAllocator(desc.m_mapAllocator != nullptr ? desc.m_mapAllocator : &AllocatorInstance<SystemAllocator>::Get()))
, m_allocChunksMap(AllocMapType::hasher(), AllocMapType::key_eq(), AZStdIAllocator(desc.m_mapAllocator != nullptr ? desc.m_mapAllocator : &AllocatorInstance<SystemAllocator>::Get()))
{
if (m_desc.m_mapAllocator == NULL)
if (m_desc.m_mapAllocator == nullptr)
{
m_desc.m_mapAllocator = &AllocatorInstance<SystemAllocator>::Get(); // used as our sub allocator
}
AZ_Assert(m_desc.m_memoryBlockByteSize > 0, "You must provide memory block size!");
AZ_Assert(m_desc.m_memoryBlock != NULL, "You must provide memory block allocated as you with!");
AZ_Assert(m_desc.m_memoryBlock != nullptr, "You must provide memory block allocated as you with!");
//if( m_desc.m_memoryBlock == NULL) there is no point to automate this cause we need to flag this memory special, otherwise there is no point to use this allocator at all
// m_desc.m_memoryBlock = azmalloc(SystemAllocator,m_desc.m_memoryBlockByteSize,16);
m_freeChunksMap.insert(AZStd::make_pair(m_desc.m_memoryBlockByteSize, reinterpret_cast<char*>(m_desc.m_memoryBlock)));
@@ -40,13 +40,13 @@ BestFitExternalMapSchema::pointer_type
BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int flags)
{
(void)flags;
char* address = NULL;
char* address = nullptr;
AZ_Assert(alignment > 0 && (alignment & (alignment - 1)) == 0, "Alignment must be >0 and power of 2!");
for (int i = 0; i < 2; ++i) // max 2 attempts to allocate
{
FreeMapType::iterator iter = m_freeChunksMap.find(byteSize);
size_t blockSize = 0;
char* blockAddress = NULL;
char* blockAddress = nullptr;
size_t preAllocBlockSize = 0;
while (iter != m_freeChunksMap.end())
{
@@ -64,7 +64,7 @@ BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int
}
++iter;
}
if (address != NULL)
if (address != nullptr)
{
// split blocks
if (preAllocBlockSize) // if we have a block before the alignment
@@ -94,7 +94,7 @@ BestFitExternalMapSchema::Allocate(size_type byteSize, size_type alignment, int
void
BestFitExternalMapSchema::DeAllocate(pointer_type ptr)
{
if (ptr == 0)
if (ptr == nullptr)
{
return;
}
@@ -107,17 +107,17 @@ namespace AZ
m_used = 0;
m_desc = desc;
m_subAllocator = 0;
m_subAllocator = nullptr;
for (int i = 0; i < Descriptor::m_maxNumBlocks; ++i)
{
m_memSpaces[i] = 0;
m_memSpaces[i] = nullptr;
m_ownMemoryBlock[i] = false;
}
for (int i = 0; i < m_desc.m_numMemoryBlocks; ++i)
{
if (m_desc.m_memoryBlocks[i] == 0) // Allocate memory block if requested!
if (m_desc.m_memoryBlocks[i] == nullptr) // Allocate memory block if requested!
{
AZ_Assert(AllocatorInstance<SystemAllocator>::IsReady(), "You requested to allocate memory using the system allocator, but it's not created yet!");
m_subAllocator = &AllocatorInstance<SystemAllocator>::Get();
@@ -152,7 +152,7 @@ namespace AZ
if (m_memSpaces[i])
{
AZDLMalloc::destroy_mspace(m_memSpaces[i]);
m_memSpaces[i] = 0;
m_memSpaces[i] = nullptr;
if (m_ownMemoryBlock[i])
{
@@ -172,7 +172,7 @@ namespace AZ
AZ_UNUSED(lineNum);
AZ_UNUSED(suppressStackRecord);
int blockId = flags;
AZ_Assert(m_memSpaces[blockId]!=0, "Invalid block id!");
AZ_Assert(m_memSpaces[blockId]!=nullptr, "Invalid block id!");
HeapSchema::pointer_type address = AZDLMalloc::mspace_memalign(m_memSpaces[blockId], alignment, byteSize);
if (address)
{
@@ -186,7 +186,7 @@ namespace AZ
{
AZ_UNUSED(byteSize);
AZ_UNUSED(alignment);
if (ptr==0)
if (ptr==nullptr)
{
return;
}
@@ -194,7 +194,7 @@ namespace AZ
// if we use m_spaces just count the chunk sizes.
m_used -= ChunckSize(ptr);
#ifdef FOOTERS
AZDLMalloc::mspace_free(0, ptr); ///< We use footers so we know which memspace the pointer belongs to.
AZDLMalloc::mspace_free(nullptr, ptr); ///< We use footers so we know which memspace the pointer belongs to.
#else
int i = 0;
for (; i < m_desc.m_numMemoryBlocks; ++i)
@@ -248,7 +248,7 @@ namespace AZ
HeapSchema::ChunckSize(pointer_type ptr)
{
// based on azmalloc_usable_size + the overhead
if (ptr != 0)
if (ptr != nullptr)
{
mchunkptr p = mem2chunk(ptr);
//if (is_inuse(p)) // we can even skip this check since we track for double free and so on anyway
@@ -784,17 +784,17 @@ namespace AZ {
// size == 0 acts as free
void* realloc(void* ptr, size_t size)
{
if (ptr == NULL)
if (ptr == nullptr)
{
return alloc(size);
}
if (size == 0)
{
free(ptr);
return NULL;
return nullptr;
}
debug_check(ptr);
void* newPtr = NULL;
void* newPtr = nullptr;
if (ptr_in_bucket(ptr))
{
if (is_small_allocation(size)) // no point to check m_isPoolAllocations as if it's false pointer can't be in a bucket.
@@ -853,21 +853,21 @@ namespace AZ {
{
return realloc(ptr, size);
}
if (ptr == NULL)
if (ptr == nullptr)
{
return alloc(size, alignment);
}
if (size == 0)
{
free(ptr);
return NULL;
return nullptr;
}
if ((size_t)ptr & (alignment - 1))
{
void* newPtr = alloc(size, alignment);
if (!newPtr)
{
return NULL;
return nullptr;
}
size_t count = this->size(ptr);
if (count > size)
@@ -879,7 +879,7 @@ namespace AZ {
return newPtr;
}
debug_check(ptr);
void* newPtr = NULL;
void* newPtr = nullptr;
if (ptr_in_bucket(ptr))
{
if (is_small_allocation(size) && alignment <= MAX_SMALL_ALLOCATION) // no point to check m_isPoolAllocations as if it was false, pointer can't be in a bucket
@@ -931,7 +931,7 @@ namespace AZ {
// returns the size of the resulting memory block
inline size_t resize(void* ptr, size_t size)
{
if (ptr == NULL)
if (ptr == nullptr)
{
return 0;
}
@@ -957,7 +957,7 @@ namespace AZ {
// query the size of the memory block
inline size_t size(void* ptr) const
{
if (ptr == NULL)
if (ptr == nullptr)
{
return 0;
}
@@ -993,7 +993,7 @@ namespace AZ {
// free the memory block
inline void free(void* ptr)
{
if (ptr == NULL)
if (ptr == nullptr)
{
return;
}
@@ -1009,7 +1009,7 @@ namespace AZ {
// free the memory block supplying the original size with DEFAULT_ALIGNMENT
inline void free(void* ptr, size_t origSize)
{
if (ptr == NULL)
if (ptr == nullptr)
{
return;
}
@@ -1027,7 +1027,7 @@ namespace AZ {
// free the memory block supplying the original size and alignment
inline void free(void* ptr, size_t origSize, size_t oldAlignment)
{
if (ptr == NULL)
if (ptr == nullptr)
{
return;
}
@@ -1134,10 +1134,10 @@ namespace AZ {
// If m_systemChunkSize is specified, use that size for allocating tree blocks from the OS
// m_treePageAlignment should be OS_VIRTUAL_PAGE_SIZE in all cases with this trait as we work
// with virtual memory addresses when the tree grows and we cannot specify an alignment in all cases
: m_treePageSize(desc.m_fixedMemoryBlock != NULL ? desc.m_pageSize :
: m_treePageSize(desc.m_fixedMemoryBlock != nullptr ? desc.m_pageSize :
desc.m_systemChunkSize != 0 ? desc.m_systemChunkSize : OS_VIRTUAL_PAGE_SIZE)
, m_treePageAlignment(desc.m_pageSize)
, m_poolPageSize(desc.m_fixedMemoryBlock != NULL ? desc.m_poolPageSize : OS_VIRTUAL_PAGE_SIZE)
, m_poolPageSize(desc.m_fixedMemoryBlock != nullptr ? desc.m_poolPageSize : OS_VIRTUAL_PAGE_SIZE)
, m_subAllocator(desc.m_subAllocator)
{
#ifdef DEBUG_ALLOCATOR
@@ -1246,7 +1246,7 @@ namespace AZ {
return p;
}
}
return NULL;
return nullptr;
}
const HpAllocator::page* HpAllocator::bucket::get_free_page() const
@@ -1259,7 +1259,7 @@ namespace AZ {
return p;
}
}
return NULL;
return nullptr;
}
void* HpAllocator::bucket::alloc(page* p)
@@ -1359,7 +1359,7 @@ namespace AZ {
p = bucket_grow(bsize, mBuckets[bi].marker());
if (!p)
{
return NULL;
return nullptr;
}
mBuckets[bi].add_free_page(p);
}
@@ -1385,7 +1385,7 @@ namespace AZ {
p = bucket_grow(bsize, mBuckets[bi].marker());
if (!p)
{
return NULL;
return nullptr;
}
mBuckets[bi].add_free_page(p);
}
@@ -1406,7 +1406,7 @@ namespace AZ {
void* newPtr = bucket_alloc(size);
if (!newPtr)
{
return NULL;
return nullptr;
}
memcpy(newPtr, ptr, AZStd::GetMin(elemSize - MEMORY_GUARD_SIZE, size - MEMORY_GUARD_SIZE));
bucket_free(ptr);
@@ -1426,7 +1426,7 @@ namespace AZ {
void* newPtr = bucket_alloc_direct(bucket_spacing_function(AZ::SizeAlignUp(size, alignment)));
if (!newPtr)
{
return NULL;
return nullptr;
}
memcpy(newPtr, ptr, AZStd::GetMin(elemSize - MEMORY_GUARD_SIZE, size - MEMORY_GUARD_SIZE));
bucket_free(ptr);
@@ -1638,7 +1638,7 @@ namespace AZ {
// create a dummy block to avoid prev() NULL checks and allow easy block shifts
// potentially this dummy block might grow (due to shift_block) but not more than sizeof(free_node)
block_header* front = (block_header*)mem;
front->prev(0);
front->prev(nullptr);
front->size(0);
front->set_used();
block_header* back = (block_header*)front->mem();
@@ -1777,7 +1777,7 @@ namespace AZ {
newBl = tree_grow(size);
if (!newBl)
{
return NULL;
return nullptr;
}
}
HPPA_ASSERT(!newBl->used());
@@ -1956,7 +1956,7 @@ namespace AZ {
tree_free(ptr);
return newPtr;
}
return NULL;
return nullptr;
}
void* HpAllocator::tree_realloc_aligned(void* ptr, size_t size, size_t alignment)
@@ -2044,7 +2044,7 @@ namespace AZ {
tree_free(ptr);
return newPtr;
}
return NULL;
return nullptr;
}
size_t HpAllocator::tree_resize(void* ptr, size_t size)
@@ -2121,7 +2121,7 @@ namespace AZ {
HPPA_ASSERT(!bl->used());
HPPA_ASSERT(bl->prev() && bl->prev()->used());
HPPA_ASSERT(bl->next() && bl->next()->used());
if (bl->prev()->prev() == NULL && bl->next()->size() == 0)
if (bl->prev()->prev() == nullptr && bl->next()->size() == 0)
{
tree_detach(bl);
char* memStart = (char*)bl->prev();
@@ -2539,11 +2539,11 @@ namespace AZ {
if (m_desc.m_fixedMemoryBlockByteSize > 0)
{
AZ_Assert((m_desc.m_fixedMemoryBlockByteSize & (m_desc.m_pageSize - 1)) == 0, "Memory block size %d MUST be multiples of the of the page size %d!", m_desc.m_fixedMemoryBlockByteSize, m_desc.m_pageSize);
if (m_desc.m_fixedMemoryBlock == NULL)
if (m_desc.m_fixedMemoryBlock == nullptr)
{
AZ_Assert(m_desc.m_subAllocator != NULL, "Sub allocator must point to a valid allocator if m_fixedMemoryBlock is NOT allocated (NULL)!");
AZ_Assert(m_desc.m_subAllocator != nullptr, "Sub allocator must point to a valid allocator if m_fixedMemoryBlock is NOT allocated (NULL)!");
m_desc.m_fixedMemoryBlock = m_desc.m_subAllocator->Allocate(m_desc.m_fixedMemoryBlockByteSize, m_desc.m_fixedMemoryBlockAlignment, 0, "HphaSchema", __FILE__, __LINE__, 1);
AZ_Assert(m_desc.m_fixedMemoryBlock != NULL, "Failed to allocate %d bytes!", m_desc.m_fixedMemoryBlockByteSize);
AZ_Assert(m_desc.m_fixedMemoryBlock != nullptr, "Failed to allocate %d bytes!", m_desc.m_fixedMemoryBlockByteSize);
m_ownMemoryBlock = true;
}
AZ_Assert((reinterpret_cast<size_t>(m_desc.m_fixedMemoryBlock) & static_cast<size_t>(desc.m_fixedMemoryBlockAlignment - 1)) == 0, "Memory block must be page size (%d bytes) aligned!", desc.m_fixedMemoryBlockAlignment);
@@ -2570,7 +2570,7 @@ namespace AZ {
if (m_ownMemoryBlock)
{
m_desc.m_subAllocator->DeAllocate(m_desc.m_fixedMemoryBlock, m_desc.m_fixedMemoryBlockByteSize, m_desc.m_fixedMemoryBlockAlignment);
m_desc.m_fixedMemoryBlock = NULL;
m_desc.m_fixedMemoryBlock = nullptr;
}
}
@@ -2587,7 +2587,7 @@ namespace AZ {
(void)lineNum;
(void)suppressStackRecord;
pointer_type address = m_allocator->alloc(byteSize, alignment);
if (address == NULL)
if (address == nullptr)
{
GarbageCollect();
address = m_allocator->alloc(byteSize, alignment);
@@ -2603,7 +2603,7 @@ namespace AZ {
HphaSchema::ReAllocate(pointer_type ptr, size_type newSize, size_type newAlignment)
{
pointer_type address = m_allocator->realloc(ptr, newSize, newAlignment);
if (address == NULL && newSize > 0)
if (address == nullptr && newSize > 0)
{
GarbageCollect();
address = m_allocator->realloc(ptr, newSize, newAlignment);
@@ -2618,7 +2618,7 @@ namespace AZ {
void
HphaSchema::DeAllocate(pointer_type ptr, size_type size, size_type alignment)
{
if (ptr == 0)
if (ptr == nullptr)
{
return;
}
@@ -106,7 +106,7 @@ namespace AZ
m_allAllocatorRecords.push_back(allocator->GetRecords());
if (m_output == NULL)
if (m_output == nullptr)
{
return; // we have no active output
}
@@ -154,7 +154,7 @@ namespace AZ
delete allocatorRecords;
allocator->SetRecords(nullptr);
if (m_output == NULL)
if (m_output == nullptr)
{
return; // we have no active output
}
@@ -173,7 +173,7 @@ namespace AZ
if (records)
{
const AllocationInfo* info = records->RegisterAllocation(address, byteSize, alignment, name, fileName, lineNum, stackSuppressCount + 1);
if (m_output == NULL)
if (m_output == nullptr)
{
return; // we have no active output
}
@@ -226,7 +226,7 @@ namespace AZ
{
records->UnregisterAllocation(address, byteSize, alignment, info);
if (m_output == NULL)
if (m_output == nullptr)
{
return; // we have no active output
}
@@ -261,7 +261,7 @@ namespace AZ
{
records->ResizeAllocation(address, newSize);
if (m_output == NULL)
if (m_output == nullptr)
{
return; // we have no active output
}

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