diff --git a/Code/Editor/Core/LevelEditorMenuHandler.cpp b/Code/Editor/Core/LevelEditorMenuHandler.cpp index 8c757a361e..e568f05167 100644 --- a/Code/Editor/Core/LevelEditorMenuHandler.cpp +++ b/Code/Editor/Core/LevelEditorMenuHandler.cpp @@ -154,8 +154,7 @@ namespace } } -LevelEditorMenuHandler::LevelEditorMenuHandler( - MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager, [[maybe_unused]] QSettings& settings) +LevelEditorMenuHandler::LevelEditorMenuHandler(MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager) : QObject(mainWindow) , m_mainWindow(mainWindow) , m_viewPaneManager(viewPaneManager) diff --git a/Code/Editor/Core/LevelEditorMenuHandler.h b/Code/Editor/Core/LevelEditorMenuHandler.h index 95f2f70703..5ac8e63786 100644 --- a/Code/Editor/Core/LevelEditorMenuHandler.h +++ b/Code/Editor/Core/LevelEditorMenuHandler.h @@ -33,7 +33,7 @@ class LevelEditorMenuHandler { Q_OBJECT public: - LevelEditorMenuHandler(MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager, QSettings& settings); + LevelEditorMenuHandler(MainWindow* mainWindow, QtViewPaneManager* const viewPaneManager); ~LevelEditorMenuHandler(); void Initialize(); diff --git a/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.cpp b/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.cpp deleted file mode 100644 index 99f4ab1ca6..0000000000 --- a/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.cpp +++ /dev/null @@ -1,74 +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 - * - */ - - -// Description : Calculate the reference frame for sub-object selections. - -#include "EditorDefs.h" - -#include "SubObjectSelectionReferenceFrameCalculator.h" - -SubObjectSelectionReferenceFrameCalculator::SubObjectSelectionReferenceFrameCalculator([[maybe_unused]] ESubObjElementType selectionType) - : m_anySelected(false) - , pos(0.0f, 0.0f, 0.0f) - , normal(0.0f, 0.0f, 0.0f) - , nNormals(0) - , bUseExplicitFrame(false) - , bExplicitAnySelected(false) -{ -} - -void SubObjectSelectionReferenceFrameCalculator::SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame) -{ - this->m_refFrame = refFrame; - this->bUseExplicitFrame = true; - this->bExplicitAnySelected = bAnySelected; -} - -bool SubObjectSelectionReferenceFrameCalculator::GetFrame(Matrix34& refFrame) -{ - if (this->bUseExplicitFrame) - { - refFrame = this->m_refFrame; - return this->bExplicitAnySelected; - } - else - { - refFrame.SetIdentity(); - - if (this->nNormals > 0) - { - this->normal = this->normal / static_cast(this->nNormals); - if (!this->normal.IsZero()) - { - this->normal.Normalize(); - } - - // Average position. - this->pos = this->pos / static_cast(this->nNormals); - refFrame.SetTranslation(this->pos); - } - - if (this->m_anySelected) - { - if (!this->normal.IsZero()) - { - Vec3 xAxis(1, 0, 0), yAxis(0, 1, 0), zAxis(0, 0, 1); - if (this->normal.IsEquivalent(zAxis) || normal.IsEquivalent(-zAxis)) - { - zAxis = xAxis; - } - xAxis = this->normal.Cross(zAxis).GetNormalized(); - yAxis = xAxis.Cross(this->normal).GetNormalized(); - refFrame.SetFromVectors(xAxis, yAxis, normal, pos); - } - } - - return m_anySelected; - } -} diff --git a/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.h b/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.h deleted file mode 100644 index dd33342feb..0000000000 --- a/Code/Editor/EditMode/SubObjectSelectionReferenceFrameCalculator.h +++ /dev/null @@ -1,41 +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 - * - */ - - -// Description : Calculate the reference frame for sub-object selections. - - -#ifndef CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H -#define CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H -#pragma once - - -#include "ISubObjectSelectionReferenceFrameCalculator.h" -#include "Objects/SubObjSelection.h" - -class SubObjectSelectionReferenceFrameCalculator - : public ISubObjectSelectionReferenceFrameCalculator -{ -public: - SubObjectSelectionReferenceFrameCalculator(ESubObjElementType selectionType); - - virtual void SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame); - bool GetFrame(Matrix34& refFrame); - -private: - bool m_anySelected; - Vec3 pos; - Vec3 normal; - int nNormals; - std::vector positions; - Matrix34 m_refFrame; - bool bUseExplicitFrame; - bool bExplicitAnySelected; -}; - -#endif // CRYINCLUDE_EDITOR_EDITMODE_SUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H diff --git a/Code/Editor/Include/ISubObjectSelectionReferenceFrameCalculator.h b/Code/Editor/Include/ISubObjectSelectionReferenceFrameCalculator.h deleted file mode 100644 index ff82b57de1..0000000000 --- a/Code/Editor/Include/ISubObjectSelectionReferenceFrameCalculator.h +++ /dev/null @@ -1,24 +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 - * - */ - - -// Description : Calculate the reference frame for sub-object selections. - - -#ifndef CRYINCLUDE_EDITOR_INCLUDE_ISUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H -#define CRYINCLUDE_EDITOR_INCLUDE_ISUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H -#pragma once - - -class ISubObjectSelectionReferenceFrameCalculator -{ -public: - virtual void SetExplicitFrame(bool bAnySelected, const Matrix34& refFrame) = 0; -}; - -#endif // CRYINCLUDE_EDITOR_INCLUDE_ISUBOBJECTSELECTIONREFERENCEFRAMECALCULATOR_H diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp index bec61df984..beb338b732 100644 --- a/Code/Editor/MainWindow.cpp +++ b/Code/Editor/MainWindow.cpp @@ -297,7 +297,7 @@ MainWindow::MainWindow(QWidget* parent) , m_settings("O3DE", "O3DE") , m_toolbarManager(new ToolbarManager(m_actionManager, this)) , m_assetImporterManager(new AssetImporterManager(this)) - , m_levelEditorMenuHandler(new LevelEditorMenuHandler(this, m_viewPaneManager, m_settings)) + , m_levelEditorMenuHandler(new LevelEditorMenuHandler(this, m_viewPaneManager)) , m_sourceControlNotifHandler(new AzToolsFramework::QtSourceControlNotificationHandler(this)) , m_viewPaneHost(nullptr) , m_autoSaveTimer(nullptr) diff --git a/Code/Editor/Objects/BaseObject.h b/Code/Editor/Objects/BaseObject.h index 47dba99ab7..ece0bf67c3 100644 --- a/Code/Editor/Objects/BaseObject.h +++ b/Code/Editor/Objects/BaseObject.h @@ -33,7 +33,6 @@ class CGizmo; class CObjectArchive; struct SSubObjSelectionModifyContext; struct SRayHitInfo; -class ISubObjectSelectionReferenceFrameCalculator; class CPopupMenuItem; class QMenu; struct IRenderNode; @@ -571,7 +570,6 @@ public: // Return true if object support selecting of this sub object element type. virtual bool StartSubObjSelection([[maybe_unused]] int elemType) { return false; }; virtual void EndSubObjectSelection() {}; - virtual void CalculateSubObjectSelectionReferenceFrame([[maybe_unused]] ISubObjectSelectionReferenceFrameCalculator* pCalculator) { }; virtual void ModifySubObjSelection([[maybe_unused]] SSubObjSelectionModifyContext& modCtx) {}; virtual void AcceptSubObjectModify() {}; diff --git a/Code/Editor/Platform/Mac/main_dummy.cpp b/Code/Editor/Platform/Mac/main_dummy.cpp index 082384db58..814cbfde66 100644 --- a/Code/Editor/Platform/Mac/main_dummy.cpp +++ b/Code/Editor/Platform/Mac/main_dummy.cpp @@ -66,7 +66,7 @@ int main(int argc, char* argv[]) processLaunchInfo.m_environmentVariables = &envVars; processLaunchInfo.m_showWindow = true; - AzFramework::ProcessWatcher::LaunchProcess(processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE); + AZStd::unique_ptr processWatcher(AzFramework::ProcessWatcher::LaunchProcess(processLaunchInfo, AzFramework::ProcessCommunicationType::COMMUNICATOR_TYPE_NONE)); application.Destroy(); diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake index 6c5096a8f5..bc8f835fc7 100644 --- a/Code/Editor/editor_lib_files.cmake +++ b/Code/Editor/editor_lib_files.cmake @@ -290,7 +290,6 @@ set(FILES Include/IPreferencesPage.h Include/IRenderListener.h Include/ISourceControl.h - Include/ISubObjectSelectionReferenceFrameCalculator.h Include/ITextureDatabaseUpdater.h Include/ITransformManipulator.h Include/IViewPane.h @@ -460,8 +459,6 @@ set(FILES Dialogs/PythonScriptsDialog.ui Dialogs/Generic/UserOptions.cpp Dialogs/Generic/UserOptions.h - EditMode/SubObjectSelectionReferenceFrameCalculator.cpp - EditMode/SubObjectSelectionReferenceFrameCalculator.h Export/ExportManager.cpp Export/ExportManager.h Export/OBJExporter.cpp diff --git a/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp b/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp index 255a740e32..2dac9a566e 100644 --- a/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp +++ b/Code/Framework/AzCore/AzCore/Debug/BudgetTracker.cpp @@ -17,8 +17,6 @@ namespace AZ::Debug { - constexpr static const char* BudgetTrackerEnvName = "budgetTrackerEnv"; - struct BudgetTracker::BudgetTrackerImpl { AZStd::unordered_map m_budgets; diff --git a/Code/Framework/AzCore/AzCore/Math/Guid.h b/Code/Framework/AzCore/AzCore/Math/Guid.h index 9889092743..3a2db1693f 100644 --- a/Code/Framework/AzCore/AzCore/Math/Guid.h +++ b/Code/Framework/AzCore/AzCore/Math/Guid.h @@ -10,23 +10,16 @@ #ifndef GUID_DEFINED #define GUID_DEFINED -typedef struct _GUID { - _GUID(unsigned long d1, unsigned short d2, unsigned short d3, std::initializer_list d4) - : Data1(d1), - Data2(d2), - Data3(d3) - { - for (auto it = d4.begin(); it != d4.end(); ++it) - Data4[it - d4.begin()] = *it; - } - _GUID() = default; +#include +struct _GUID { uint32_t Data1; unsigned short Data2; unsigned short Data3; - unsigned char Data4[ 8 ]; -} GUID; + AZStd::array Data4; +}; +using GUID = _GUID; #endif // GUID_DEFINED #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_ @@ -36,7 +29,7 @@ static bool inline operator==(const _GUID& lhs, const _GUID& rhs) return lhs.Data1 == rhs.Data1 && lhs.Data2 == rhs.Data2 && lhs.Data3 == rhs.Data3 && - memcmp(lhs.Data4, rhs.Data4, 8) == 0; + lhs.Data4 == rhs.Data4; } static bool inline operator!=(const _GUID& lhs, const _GUID& rhs) { @@ -66,10 +59,9 @@ typedef const GUID& REFIID; const GUID name \ = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } -inline REFGUID GUID_NULL() +inline constexpr GUID GUID_NULL() { - static GUID guid = { 0x00000000L, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; - return guid; + return { 0x00000000L, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} }; } #define GUID_NULL GUID_NULL() diff --git a/Code/Framework/AzCore/AzCore/Memory/AllocatorScope.h b/Code/Framework/AzCore/AzCore/Memory/AllocatorScope.h index 7637db3967..4f9aabb4be 100644 --- a/Code/Framework/AzCore/AzCore/Memory/AllocatorScope.h +++ b/Code/Framework/AzCore/AzCore/Memory/AllocatorScope.h @@ -20,9 +20,7 @@ namespace AZ public: void ActivateAllocators() { - // Note the parameter pack expansion, this creates the equivalent of a fold expression - // For each type, call InitAllocator(), then put 0 in the initializer list - [[maybe_unused]] std::initializer_list init{(InitAllocator(), 0)...}; + (InitAllocator(), ...); } void DeactivateAllocators() diff --git a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h index 48bb72dd52..f02c37492b 100644 --- a/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h +++ b/Code/Framework/AzCore/AzCore/RTTI/BehaviorContext.h @@ -3774,8 +3774,7 @@ namespace AZ template inline void OnDemandReflectFunctions(OnDemandReflectionOwner* onDemandReflection, AZStd::Internal::pack_traits_arg_sequence) { - using PackExpander = bool[]; - [[maybe_unused]] PackExpander pe = { true, (BehaviorOnDemandReflectHelper::raw_fp_type>::QueueReflect(onDemandReflection), true)... }; + (BehaviorOnDemandReflectHelper::raw_fp_type>::QueueReflect(onDemandReflection), ...); } // Assumes parameters array is big enough to store all parameters diff --git a/Code/Framework/AzCore/AzCore/std/string/string_view.h b/Code/Framework/AzCore/AzCore/std/string/string_view.h index 29589ec063..d831f0d276 100644 --- a/Code/Framework/AzCore/AzCore/std/string/string_view.h +++ b/Code/Framework/AzCore/AzCore/std/string/string_view.h @@ -869,30 +869,13 @@ namespace AZStd constexpr size_t hash_string(RandomAccessIterator first, size_t length) { size_t hash = 14695981039346656037ULL; -#if AZ_COMPILER_MSVC >= 1924 constexpr size_t fnvPrime = 1099511628211ULL; -#endif const RandomAccessIterator last(first + length); for (; first != last; ++first) { hash ^= static_cast(*first); -#if AZ_COMPILER_MSVC < 1924 - // Workaround for integer overflow warning for hash function when used in a constexpr context - // The warning must be disabled at the call site and is a compiler bug that has been fixed - // with Visual Studio 2019 version 16.4 - // https://developercommunity.visualstudio.com/content/problem/211134/unsigned-integer-overflows-in-constexpr-functionsa.html?childToView=211580#comment-211580 - constexpr size_t fnvPrimeHigh{ 0x100ULL }; - constexpr size_t fnvPrimeLow{ 0x000001b3 }; - const uint64_t hashHigh{ hash >> 32 }; - const uint64_t hashLow{ hash & 0xFFFF'FFFF }; - const uint64_t lowResult{ hashLow * fnvPrimeLow }; - const uint64_t fnvPrimeHighResult{ hashLow * fnvPrimeHigh }; - const uint64_t hashHighResult{ hashHigh * fnvPrimeLow }; - hash = (lowResult & 0xffff'ffff) + (((lowResult >> 32) + (fnvPrimeHighResult & 0xffff'ffff) + (hashHighResult & 0xffff'ffff)) << 32); -#else hash *= fnvPrime; -#endif } return hash; } diff --git a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/VersionExplorer.cpp b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/VersionExplorer.cpp index a039ad7b53..738cfd8d22 100644 --- a/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/VersionExplorer.cpp +++ b/Gems/ScriptCanvas/Code/Editor/View/Windows/Tools/UpgradeTool/VersionExplorer.cpp @@ -762,7 +762,7 @@ namespace ScriptCanvasEditor rowGoToButton->setEnabled(false); m_inProgressAsset = AZStd::find_if(m_assetsToUpgrade.begin(), m_assetsToUpgrade.end() - , [this, asset](const UpgradeAssets::value_type& assetToUpgrade) + , [asset](const UpgradeAssets::value_type& assetToUpgrade) { return assetToUpgrade.GetId() == asset.GetId(); });