- class TreeItemDataIterator
- {
- public:
- typedef T Type;
- typedef TreeItemIterator InternalIterator;
-
- //iterator traits, required by STL
- typedef ptrdiff_t difference_type;
- typedef Type* value_type;
- typedef Type** pointer;
- typedef Type*& reference;
- typedef std::forward_iterator_tag iterator_category;
-
- TreeItemDataIterator() {}
- TreeItemDataIterator(const TreeItemDataIterator& other)
- : iterator(other.iterator) {AdvanceToValidIterator(); }
- explicit TreeItemDataIterator(const InternalIterator& iterator)
- : iterator(iterator) {AdvanceToValidIterator(); }
-
- Type* operator*() {return reinterpret_cast(iterator.pCtrl->GetItemData(iterator.hItem)); }
- bool operator==(const TreeItemDataIterator& other) const {return iterator == other.iterator; }
- bool operator!=(const TreeItemDataIterator& other) const {return iterator != other.iterator; }
-
- HTREEITEM GetTreeItem() {return iterator.hItem; }
-
- TreeItemDataIterator& operator++()
- {
- ++iterator;
- AdvanceToValidIterator();
- return *this;
- }
-
- TreeItemDataIterator operator++(int) {TreeItemDataIterator old = *this; ++(*this); return old; }
-
- private:
- void AdvanceToValidIterator()
- {
- while (iterator.pCtrl && iterator.hItem && !iterator.pCtrl->GetItemData(iterator.hItem))
- {
- ++iterator;
- }
- }
-
- InternalIterator iterator;
- };
-
- template
- class RecursiveItemDataIteratorType
- {
- public: typedef TreeItemDataIterator type;
- };
- template
- inline TreeItemDataIterator BeginTreeItemDataRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0)
- {
- return TreeItemDataIterator(BeginTreeItemsRecursive(pCtrl, hItem));
- }
-
- template
- inline TreeItemDataIterator EndTreeItemDataRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0)
- {
- return TreeItemDataIterator(EndTreeItemsRecursive(pCtrl, hItem));
- }
-
- template
- class NonRecursiveItemDataIteratorType
- {
- typedef TreeItemDataIterator type;
- };
- template
- inline TreeItemDataIterator BeginTreeItemDataNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0)
- {
- return TreeItemDataIterator(BeginTreeItemsNonRecursive(pCtrl, hItem));
- }
-
- template
- inline TreeItemDataIterator EndTreeItemDataNonRecursive(CTreeCtrl* pCtrl, HTREEITEM hItem = 0)
- {
- return TreeItemDataIterator(EndTreeItemsNonRecursive(pCtrl, hItem));
- }
-
- class SelectedTreeItemIterator
- {
- public:
- SelectedTreeItemIterator()
- : pCtrl(0)
- , hItem(0) {}
- SelectedTreeItemIterator(const SelectedTreeItemIterator& other)
- : pCtrl(other.pCtrl)
- , hItem(other.hItem) {}
- SelectedTreeItemIterator(CXTTreeCtrl* pCtrl, HTREEITEM hItem)
- : pCtrl(pCtrl)
- , hItem(hItem) {}
-
- HTREEITEM operator*() {return hItem; }
- bool operator==(const SelectedTreeItemIterator& other) const {return pCtrl == other.pCtrl && hItem == other.hItem; }
- bool operator!=(const SelectedTreeItemIterator& other) const {return pCtrl != other.pCtrl || hItem != other.hItem; }
-
- SelectedTreeItemIterator& operator++()
- {
- hItem = (pCtrl ? pCtrl->GetNextSelectedItem(hItem) : 0);
-
- return *this;
- }
-
- SelectedTreeItemIterator operator++(int) {SelectedTreeItemIterator old = *this; ++(*this); return old; }
-
- CXTTreeCtrl* pCtrl;
- HTREEITEM hItem;
- };
-
- SelectedTreeItemIterator BeginSelectedTreeItems(CXTTreeCtrl* pCtrl)
- {
- return SelectedTreeItemIterator(pCtrl, (pCtrl ? pCtrl->GetFirstSelectedItem() : 0));
- }
-
- SelectedTreeItemIterator EndSelectedTreeItems(CXTTreeCtrl* pCtrl)
- {
- return SelectedTreeItemIterator(pCtrl, 0);
- }
-
- template
- class SelectedTreeItemDataIterator
- {
- public:
- typedef T Type;
- typedef SelectedTreeItemIterator InternalIterator;
-
- SelectedTreeItemDataIterator() {}
- SelectedTreeItemDataIterator(const SelectedTreeItemDataIterator& other)
- : iterator(other.iterator) {AdvanceToValidIterator(); }
- explicit SelectedTreeItemDataIterator(const InternalIterator& iterator)
- : iterator(iterator) {AdvanceToValidIterator(); }
-
- Type* operator*() {return reinterpret_cast(iterator.pCtrl->GetItemData(iterator.hItem)); }
- bool operator==(const SelectedTreeItemDataIterator& other) const {return iterator == other.iterator; }
- bool operator!=(const SelectedTreeItemDataIterator& other) const {return iterator != other.iterator; }
-
- HTREEITEM GetTreeItem() {return iterator.hItem; }
-
- SelectedTreeItemDataIterator& operator++()
- {
- ++iterator;
- AdvanceToValidIterator();
- return *this;
- }
-
- SelectedTreeItemDataIterator operator++(int) {SelectedTreeItemDataIterator old = *this; ++(*this); return old; }
-
- private:
- void AdvanceToValidIterator()
- {
- while (iterator.pCtrl && iterator.hItem && !iterator.pCtrl->GetItemData(iterator.hItem))
- {
- ++iterator;
- }
- }
-
- InternalIterator iterator;
- };
-
- template
- SelectedTreeItemDataIterator BeginSelectedTreeItemData(CXTTreeCtrl* pCtrl)
- {
- return SelectedTreeItemDataIterator(BeginSelectedTreeItems(pCtrl));
- }
-
- template
- SelectedTreeItemDataIterator EndSelectedTreeItemData(CXTTreeCtrl* pCtrl)
- {
- return SelectedTreeItemDataIterator(EndSelectedTreeItems(pCtrl));
- }
-}
-
-#endif // CRYINCLUDE_EDITOR_CONTROLS_TREECTRLUTILS_H
diff --git a/Code/Editor/Core/LevelEditorMenuHandler.cpp b/Code/Editor/Core/LevelEditorMenuHandler.cpp
index 70aff10f87..05f06c87aa 100644
--- a/Code/Editor/Core/LevelEditorMenuHandler.cpp
+++ b/Code/Editor/Core/LevelEditorMenuHandler.cpp
@@ -104,6 +104,11 @@ namespace
}
}
+ // Currently (December 13, 2021), this function is only used by slice editor code.
+ // When the slice editor is not enabled, there are no references to the
+ // HideActionWhileEntitiesDeselected function, causing a compiler warning and
+ // subsequently a build error.
+#ifdef ENABLE_SLICE_EDITOR
void HideActionWhileEntitiesDeselected(QAction* action, EEditorNotifyEvent editorNotifyEvent)
{
if (action == nullptr)
@@ -127,6 +132,7 @@ namespace
break;
}
}
+#endif
void DisableActionWhileInSimMode(QAction* action, EEditorNotifyEvent editorNotifyEvent)
{
@@ -374,7 +380,6 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu()
{
DisableActionWhileLevelChanges(fileOpenSlice, e);
}));
-#endif
// Save Selected Slice
auto saveSelectedSlice = fileMenu.AddAction(ID_FILE_SAVE_SELECTED_SLICE);
@@ -391,7 +396,7 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu()
{
HideActionWhileEntitiesDeselected(saveSliceToRoot, e);
}));
-
+#endif
// Open Recent
m_mostRecentLevelsMenu = fileMenu.AddMenu(tr("Open Recent"));
connect(m_mostRecentLevelsMenu, &QMenu::aboutToShow, this, &LevelEditorMenuHandler::UpdateMRUFiles);
@@ -439,9 +444,10 @@ QMenu* LevelEditorMenuHandler::CreateFileMenu()
// Show Log File
fileMenu.AddAction(ID_FILE_EDITLOGFILE);
+#ifdef ENABLE_SLICE_EDITOR
fileMenu.AddSeparator();
-
fileMenu.AddAction(ID_FILE_RESAVESLICES);
+#endif
fileMenu.AddSeparator();
@@ -538,6 +544,7 @@ void LevelEditorMenuHandler::PopulateEditMenu(ActionManager::MenuWrapper& editMe
auto snapMenu = modifyMenu.AddMenu(tr("Snap"));
snapMenu.AddAction(AzToolsFramework::SnapAngle);
+ snapMenu.AddAction(AzToolsFramework::SnapToGrid);
auto transformModeMenu = modifyMenu.AddMenu(tr("Transform Mode"));
transformModeMenu.AddAction(AzToolsFramework::EditModeMove);
@@ -723,7 +730,8 @@ QMenu* LevelEditorMenuHandler::CreateViewMenu()
// MISSING AVIRECORDER
viewportViewsMenuWrapper.AddSeparator();
- viewportViewsMenuWrapper.AddAction(ID_DISPLAY_SHOWHELPERS);
+ viewportViewsMenuWrapper.AddAction(AzToolsFramework::Helpers);
+ viewportViewsMenuWrapper.AddAction(AzToolsFramework::Icons);
// Refresh Style
viewMenu.AddAction(ID_SKINS_REFRESH);
diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp
index 3890a9e59a..77099761c1 100644
--- a/Code/Editor/CryEdit.cpp
+++ b/Code/Editor/CryEdit.cpp
@@ -380,13 +380,13 @@ void CCryEditApp::RegisterActionHandlers()
ON_COMMAND(ID_IMPORT_ASSET, OnOpenAssetImporter)
ON_COMMAND(ID_EDIT_LEVELDATA, OnEditLevelData)
ON_COMMAND(ID_FILE_EDITLOGFILE, OnFileEditLogFile)
- ON_COMMAND(ID_FILE_RESAVESLICES, OnFileResaveSlices)
ON_COMMAND(ID_FILE_EDITEDITORINI, OnFileEditEditorini)
ON_COMMAND(ID_PREFERENCES, OnPreferences)
ON_COMMAND(ID_REDO, OnRedo)
ON_COMMAND(ID_TOOLBAR_WIDGET_REDO, OnRedo)
ON_COMMAND(ID_FILE_OPEN_LEVEL, OnOpenLevel)
#ifdef ENABLE_SLICE_EDITOR
+ ON_COMMAND(ID_FILE_RESAVESLICES, OnFileResaveSlices)
ON_COMMAND(ID_FILE_NEW_SLICE, OnCreateSlice)
ON_COMMAND(ID_FILE_OPEN_SLICE, OnOpenSlice)
#endif
@@ -445,7 +445,6 @@ void CCryEditApp::RegisterActionHandlers()
ON_COMMAND(ID_OPEN_ASSET_BROWSER, OnOpenAssetBrowserView)
ON_COMMAND(ID_OPEN_AUDIO_CONTROLS_BROWSER, OnOpenAudioControlsEditor)
- ON_COMMAND(ID_DISPLAY_SHOWHELPERS, OnShowHelpers)
ON_COMMAND(ID_OPEN_TRACKVIEW, OnOpenTrackView)
ON_COMMAND(ID_OPEN_UICANVASEDITOR, OnOpenUICanvasEditor)
@@ -2617,12 +2616,6 @@ void CCryEditApp::OnUpdateSelected(QAction* action)
action->setEnabled(!GetIEditor()->GetSelection()->IsEmpty());
}
-void CCryEditApp::OnShowHelpers()
-{
- GetIEditor()->GetDisplaySettings()->DisplayHelpers(!GetIEditor()->GetDisplaySettings()->IsDisplayHelpers());
- GetIEditor()->Notify(eNotify_OnDisplayRenderUpdate);
-}
-
//////////////////////////////////////////////////////////////////////////
void CCryEditApp::OnEditLevelData()
{
@@ -2636,6 +2629,7 @@ void CCryEditApp::OnFileEditLogFile()
CFileUtil::EditTextFile(CLogFile::GetLogFileName(), 0, IFileUtil::FILE_TYPE_SCRIPT);
}
+#ifdef ENABLE_SLICE_EDITOR
void CCryEditApp::OnFileResaveSlices()
{
AZStd::vector sliceAssetInfos;
@@ -2766,6 +2760,7 @@ void CCryEditApp::OnFileResaveSlices()
}
}
+#endif
//////////////////////////////////////////////////////////////////////////
void CCryEditApp::OnFileEditEditorini()
diff --git a/Code/Editor/CryEdit.h b/Code/Editor/CryEdit.h
index 8c514170ae..97fcde8f34 100644
--- a/Code/Editor/CryEdit.h
+++ b/Code/Editor/CryEdit.h
@@ -237,7 +237,6 @@ public:
void OnSyncPlayerUpdate(QAction* action);
void OnResourcesReduceworkingset();
void OnDummyCommand() {};
- void OnShowHelpers();
void OnFileSave();
void OnUpdateDocumentReady(QAction* action);
void OnUpdateFileOpen(QAction* action);
diff --git a/Code/Editor/DisplaySettings.cpp b/Code/Editor/DisplaySettings.cpp
index ed4ca180b4..bfeac3e37f 100644
--- a/Code/Editor/DisplaySettings.cpp
+++ b/Code/Editor/DisplaySettings.cpp
@@ -68,8 +68,6 @@ void CDisplaySettings::SetObjectHideMask(int hideMask)
m_objectHideMask = hideMask;
gSettings.objectHideMask = m_objectHideMask;
-
- GetIEditor()->Notify(eNotify_OnDisplayRenderUpdate);
};
//////////////////////////////////////////////////////////////////////////
diff --git a/Code/Editor/EditorPanelUtils.cpp b/Code/Editor/EditorPanelUtils.cpp
deleted file mode 100644
index a270de5978..0000000000
--- a/Code/Editor/EditorPanelUtils.cpp
+++ /dev/null
@@ -1,542 +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 "EditorPanelUtils.h"
-
-#include
-
-// Qt
-#include
-#include
-#include
-
-// Editor
-#include "IEditorPanelUtils.h"
-#include "Objects/EntityObject.h"
-#include "CryEditDoc.h"
-#include "ViewManager.h"
-#include "Controls/QToolTipWidget.h"
-#include "Objects/SelectionGroup.h"
-
-
-
-#ifndef PI
-#define PI 3.14159265358979323f
-#endif
-
-
-struct ToolTip
-{
- bool isValid;
- QString title;
- QString content;
- QString specialContent;
- QString disabledContent;
-};
-
-// internal implementation for better compile times - should also never be used externally, use IParticleEditorUtils interface for that.
-class CEditorPanelUtils_Impl
- : public IEditorPanelUtils
-{
-public:
- void SetViewportDragOperation(void(* dropCallback)(CViewport* viewport, int dragPointX, int dragPointY, void* custom), void* custom) override
- {
- for (int i = 0; i < GetIEditor()->GetViewManager()->GetViewCount(); i++)
- {
- GetIEditor()->GetViewManager()->GetView(i)->SetGlobalDropCallback(dropCallback, custom);
- }
- }
-
-public:
-
- int PreviewWindow_GetDisplaySettingsDebugFlags(CDisplaySettings* settings) override
- {
- CRY_ASSERT(settings);
- return settings->GetDebugFlags();
- }
-
- void PreviewWindow_SetDisplaySettingsDebugFlags(CDisplaySettings* settings, int flags) override
- {
- CRY_ASSERT(settings);
- settings->SetDebugFlags(flags);
- }
-
-protected:
- QVector hotkeys;
- bool m_hotkeysAreEnabled;
-public:
-
- bool HotKey_Import() override
- {
- QVector > keys;
- QString filepath = QFileDialog::getOpenFileName(nullptr, "Select shortcut configuration to load",
- QString(), "HotKey Config Files (*.hkxml)");
- QFile file(filepath);
- if (!file.open(QIODevice::ReadOnly))
- {
- return false;
- }
- QXmlStreamReader stream(&file);
- bool result = true;
-
- while (!stream.isEndDocument())
- {
- if (stream.isStartElement())
- {
- if (stream.name() == "HotKey")
- {
- QPair key;
- QXmlStreamAttributes att = stream.attributes();
- for (QXmlStreamAttribute attr : att)
- {
- if (attr.name().compare(QLatin1String("path"), Qt::CaseInsensitive) == 0)
- {
- key.first = attr.value().toString();
- }
- if (attr.name().compare(QLatin1String("sequence"), Qt::CaseInsensitive) == 0)
- {
- key.second = attr.value().toString();
- }
- }
- if (!key.first.isEmpty())
- {
- keys.push_back(key); // we allow blank key sequences for unassigned shortcuts
- }
- else
- {
- result = false; //but not blank paths!
- }
- }
- }
- stream.readNext();
- }
- file.close();
-
- if (result)
- {
- HotKey_BuildDefaults();
- for (QPair key : keys)
- {
- for (int j = 0; j < hotkeys.count(); j++)
- {
- if (hotkeys[j].path.compare(key.first, Qt::CaseInsensitive) == 0)
- {
- hotkeys[j].SetPath(key.first.toStdString().c_str());
- hotkeys[j].SetSequenceFromString(key.second.toStdString().c_str());
- }
- }
- }
- }
- return result;
- }
-
- void HotKey_Export() override
- {
- auto settingDir = AZ::IO::FixedMaxPath(AZ::Utils::GetEnginePath()) / "Editor" / "Plugins" / "ParticleEditorPlugin" / "settings";
- QString filepath = QFileDialog::getSaveFileName(nullptr, "Select shortcut configuration to load", settingDir.c_str(), "HotKey Config Files (*.hkxml)");
- QFile file(filepath);
- if (!file.open(QIODevice::WriteOnly))
- {
- return;
- }
-
- QXmlStreamWriter stream(&file);
- stream.setAutoFormatting(true);
- stream.writeStartDocument();
- stream.writeStartElement("HotKeys");
-
- for (HotKey key : hotkeys)
- {
- stream.writeStartElement("HotKey");
- stream.writeAttribute("path", key.path);
- stream.writeAttribute("sequence", key.sequence.toString());
- stream.writeEndElement();
- }
- stream.writeEndElement();
- stream.writeEndDocument();
- file.close();
- }
-
- QKeySequence HotKey_GetShortcut(const char* path) override
- {
- for (HotKey combo : hotkeys)
- {
- if (combo.IsMatch(path))
- {
- return combo.sequence;
- }
- }
- return QKeySequence();
- }
-
- bool HotKey_IsPressed(const QKeyEvent* event, const char* path) override
- {
- if (!m_hotkeysAreEnabled)
- {
- return false;
- }
- unsigned int keyInt = 0;
- //Capture any modifiers
- Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers();
- if (modifiers & Qt::ShiftModifier)
- {
- keyInt += Qt::SHIFT;
- }
- if (modifiers & Qt::ControlModifier)
- {
- keyInt += Qt::CTRL;
- }
- if (modifiers & Qt::AltModifier)
- {
- keyInt += Qt::ALT;
- }
- if (modifiers & Qt::MetaModifier)
- {
- keyInt += Qt::META;
- }
- //Capture any key
- keyInt += event->key();
-
- QString t0 = QKeySequence(keyInt).toString();
- QString t1 = HotKey_GetShortcut(path).toString();
-
- //if strings match then shortcut is pressed
- if (t1.compare(t0, Qt::CaseInsensitive) == 0)
- {
- return true;
- }
- return false;
- }
-
- bool HotKey_IsPressed(const QShortcutEvent* event, const char* path) override
- {
- if (!m_hotkeysAreEnabled)
- {
- return false;
- }
-
- QString t0 = event->key().toString();
- QString t1 = HotKey_GetShortcut(path).toString();
-
- //if strings match then shortcut is pressed
- if (t1.compare(t0, Qt::CaseInsensitive) == 0)
- {
- return true;
- }
- return false;
- }
-
- bool HotKey_LoadExisting() override
- {
- QSettings settings("O3DE", "O3DE");
- QString group = "Hotkeys/";
-
- HotKey_BuildDefaults();
-
- int size = settings.beginReadArray(group);
-
- for (int i = 0; i < size; i++)
- {
- settings.setArrayIndex(i);
- QPair hotkey;
- hotkey.first = settings.value("name").toString();
- hotkey.second = settings.value("keySequence").toString();
- if (!hotkey.first.isEmpty())
- {
- for (int j = 0; j < hotkeys.count(); j++)
- {
- if (hotkeys[j].path.compare(hotkey.first, Qt::CaseInsensitive) == 0)
- {
- hotkeys[j].SetPath(hotkey.first.toStdString().c_str());
- hotkeys[j].SetSequenceFromString(hotkey.second.toStdString().c_str());
- }
- }
- }
- }
-
- settings.endArray();
- if (hotkeys.isEmpty())
- {
- return false;
- }
- return true;
- }
-
- void HotKey_SaveCurrent() override
- {
- QSettings settings("O3DE", "O3DE");
- QString group = "Hotkeys/";
- settings.remove("Hotkeys/");
- settings.sync();
- settings.beginWriteArray(group);
- int saveIndex = 0;
- for (HotKey key : hotkeys)
- {
- if (!key.path.isEmpty())
- {
- settings.setArrayIndex(saveIndex++);
- settings.setValue("name", key.path);
- settings.setValue("keySequence", key.sequence.toString());
- }
- }
- settings.endArray();
- settings.sync();
- }
-
- void HotKey_BuildDefaults() override
- {
- m_hotkeysAreEnabled = true;
- QVector > keys;
- while (hotkeys.count() > 0)
- {
- hotkeys.takeAt(0);
- }
-
- //MENU SELECTION SHORTCUTS////////////////////////////////////////////////
- keys.push_back(QPair("Menus.File Menu", "Alt+F"));
- keys.push_back(QPair("Menus.Edit Menu", "Alt+E"));
- keys.push_back(QPair("Menus.View Menu", "Alt+V"));
- //FILE MENU SHORTCUTS/////////////////////////////////////////////////////
- keys.push_back(QPair("File Menu.Create new emitter", "Ctrl+N"));
- keys.push_back(QPair("File Menu.Create new library", "Ctrl+Shift+N"));
- keys.push_back(QPair("File Menu.Create new folder", ""));
- keys.push_back(QPair("File Menu.Import", "Ctrl+I"));
- keys.push_back(QPair("File Menu.Import level library", "Ctrl+Shift+I"));
- keys.push_back(QPair("File Menu.Save", "Ctrl+S"));
- keys.push_back(QPair("File Menu.Close", "Ctrl+Q"));
- //EDIT MENU SHORTCUTS/////////////////////////////////////////////////////
- keys.push_back(QPair("Edit Menu.Copy", "Ctrl+C"));
- keys.push_back(QPair("Edit Menu.Paste", "Ctrl+V"));
- keys.push_back(QPair("Edit Menu.Duplicate", "Ctrl+D"));
- keys.push_back(QPair("Edit Menu.Undo", "Ctrl+Z"));
- keys.push_back(QPair("Edit Menu.Redo", "Ctrl+Shift+Z"));
- keys.push_back(QPair("Edit Menu.Group", "Ctrl+G"));
- keys.push_back(QPair("Edit Menu.Ungroup", "Ctrl+Shift+G"));
- keys.push_back(QPair("Edit Menu.Rename", "Ctrl+R"));
- keys.push_back(QPair("Edit Menu.Reset", ""));
- keys.push_back(QPair("Edit Menu.Edit Hotkeys", ""));
- keys.push_back(QPair("Edit Menu.Assign to selected", "Ctrl+Space"));
- keys.push_back(QPair("Edit Menu.Insert Comment", "Ctrl+Alt+M"));
- keys.push_back(QPair("Edit Menu.Enable/Disable Emitter", "Ctrl+E"));
- keys.push_back(QPair("File Menu.Enable All", ""));
- keys.push_back(QPair("File Menu.Disable All", ""));
- keys.push_back(QPair("Edit Menu.Delete", "Del"));
- //VIEW MENU SHORTCUTS/////////////////////////////////////////////////////
- keys.push_back(QPair("View Menu.Reset Layout", ""));
- //PLAYBACK CONTROL////////////////////////////////////////////////////////
- keys.push_back(QPair("Previewer.Play/Pause Toggle", "Space"));
- keys.push_back(QPair("Previewer.Step forward through time", "c"));
- keys.push_back(QPair("Previewer.Loop Toggle", "z"));
- keys.push_back(QPair("Previewer.Reset Playback", "x"));
- keys.push_back(QPair("Previewer.Focus", "Ctrl+F"));
- keys.push_back(QPair("Previewer.Zoom In", "w"));
- keys.push_back(QPair("Previewer.Zoom Out", "s"));
- keys.push_back(QPair("Previewer.Pan Left", "a"));
- keys.push_back(QPair("Previewer.Pan Right", "d"));
-
- for (QPair key : keys)
- {
- unsigned int index = hotkeys.count();
- hotkeys.push_back(HotKey());
- hotkeys[index].SetPath(key.first.toStdString().c_str());
- hotkeys[index].SetSequenceFromString(key.second.toStdString().c_str());
- }
- }
-
- void HotKey_SetKeys(QVector keys) override
- {
- hotkeys = keys;
- }
-
- QVector HotKey_GetKeys() override
- {
- return hotkeys;
- }
-
- QString HotKey_GetPressedHotkey(const QKeyEvent* event) override
- {
- if (!m_hotkeysAreEnabled)
- {
- return "";
- }
- for (HotKey key : hotkeys)
- {
- if (HotKey_IsPressed(event, key.path.toUtf8()))
- {
- return key.path;
- }
- }
- return "";
- }
- QString HotKey_GetPressedHotkey(const QShortcutEvent* event) override
- {
- if (!m_hotkeysAreEnabled)
- {
- return "";
- }
- for (HotKey key : hotkeys)
- {
- if (HotKey_IsPressed(event, key.path.toUtf8()))
- {
- return key.path;
- }
- }
- return "";
- }
- //building the default hotkey list re-enables hotkeys
- //do not use this when rebuilding the default list is a possibility.
- void HotKey_SetEnabled(bool val) override
- {
- m_hotkeysAreEnabled = val;
- }
-
- bool HotKey_IsEnabled() const override
- {
- return m_hotkeysAreEnabled;
- }
-
-protected:
- QMap m_tooltips;
-
- void ToolTip_ParseNode(XmlNodeRef node)
- {
- if (QString(node->getTag()).compare("tooltip", Qt::CaseInsensitive) != 0)
- {
- unsigned int childCount = node->getChildCount();
-
- for (unsigned int i = 0; i < childCount; i++)
- {
- ToolTip_ParseNode(node->getChild(i));
- }
- }
-
- QString title = node->getAttr("title");
- QString content = node->getAttr("content");
- QString specialContent = node->getAttr("special_content");
- QString disabledContent = node->getAttr("disabled_content");
-
- QMap::iterator itr = m_tooltips.insert(node->getAttr("path"), ToolTip());
- itr->isValid = true;
- itr->title = title;
- itr->content = content;
- itr->specialContent = specialContent;
- itr->disabledContent = disabledContent;
-
- unsigned int childCount = node->getChildCount();
-
- for (unsigned int i = 0; i < childCount; i++)
- {
- ToolTip_ParseNode(node->getChild(i));
- }
- }
-
- ToolTip GetToolTip(QString path)
- {
- if (m_tooltips.contains(path))
- {
- return m_tooltips[path];
- }
- ToolTip temp;
- temp.isValid = false;
- return temp;
- }
-
-public:
- void ToolTip_LoadConfigXML(QString filepath) override
- {
- XmlNodeRef node = GetIEditor()->GetSystem()->LoadXmlFromFile(filepath.toStdString().c_str());
- ToolTip_ParseNode(node);
- }
-
- void ToolTip_BuildFromConfig(IQToolTip* tooltip, QString path, QString option, QString optionalData = "", bool isEnabled = true) override
- {
- AZ_Assert(tooltip, "tooltip cannot be null");
-
- QString title = ToolTip_GetTitle(path, option);
- QString content = ToolTip_GetContent(path, option);
- QString specialContent = ToolTip_GetSpecialContentType(path, option);
- QString disabledContent = ToolTip_GetDisabledContent(path, option);
-
- // Even if these items are empty, we set them anyway to clear out any data that was left over from when the tooltip was used for a different object.
- tooltip->SetTitle(title);
- tooltip->SetContent(content);
-
- //this only handles simple creation...if you need complex call this then add specials separate
- if (!specialContent.contains("::"))
- {
- tooltip->AddSpecialContent(specialContent, optionalData);
- }
-
- if (!isEnabled) // If disabled, add disabled value
- {
- tooltip->AppendContent(disabledContent);
- }
- }
-
- QString ToolTip_GetTitle(QString path, QString option) override
- {
- if (!option.isEmpty() && GetToolTip(path + "." + option).isValid)
- {
- return GetToolTip(path + "." + option).title;
- }
- if (!option.isEmpty() && GetToolTip("Options." + option).isValid)
- {
- return GetToolTip("Options." + option).title;
- }
- return GetToolTip(path).title;
- }
-
- QString ToolTip_GetContent(QString path, QString option) override
- {
- if (!option.isEmpty() && GetToolTip(path + "." + option).isValid)
- {
- return GetToolTip(path + "." + option).content;
- }
- if (!option.isEmpty() && GetToolTip("Options." + option).isValid)
- {
- return GetToolTip("Options." + option).content;
- }
- return GetToolTip(path).content;
- }
-
- QString ToolTip_GetSpecialContentType(QString path, QString option) override
- {
- if (!option.isEmpty() && GetToolTip(path + "." + option).isValid)
- {
- return GetToolTip(path + "." + option).specialContent;
- }
- if (!option.isEmpty() && GetToolTip("Options." + option).isValid)
- {
- return GetToolTip("Options." + option).specialContent;
- }
- return GetToolTip(path).specialContent;
- }
-
- QString ToolTip_GetDisabledContent(QString path, QString option) override
- {
- if (!option.isEmpty() && GetToolTip(path + "." + option).isValid)
- {
- return GetToolTip(path + "." + option).disabledContent;
- }
- if (!option.isEmpty() && GetToolTip("Options." + option).isValid)
- {
- return GetToolTip("Options." + option).disabledContent;
- }
- return GetToolTip(path).disabledContent;
- }
-};
-
-IEditorPanelUtils* CreateEditorPanelUtils()
-{
- return new CEditorPanelUtils_Impl();
-}
-
diff --git a/Code/Editor/EditorPanelUtils.h b/Code/Editor/EditorPanelUtils.h
deleted file mode 100644
index 6ac15ebfc9..0000000000
--- a/Code/Editor/EditorPanelUtils.h
+++ /dev/null
@@ -1,16 +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
- *
- */
-// Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
-#ifndef CRYINCLUDE_CRYEDITOR_EDITORPANELUTILS_H
-#define CRYINCLUDE_CRYEDITOR_EDITORPANELUTILS_H
-#pragma once
-
-struct IEditorPanelUtils;
-IEditorPanelUtils* CreateEditorPanelUtils();
-
-#endif
diff --git a/Code/Editor/EditorPreferencesDialog.cpp b/Code/Editor/EditorPreferencesDialog.cpp
index a1859b0f14..665daf52a8 100644
--- a/Code/Editor/EditorPreferencesDialog.cpp
+++ b/Code/Editor/EditorPreferencesDialog.cpp
@@ -112,6 +112,31 @@ void EditorPreferencesDialog::showEvent(QShowEvent* event)
QDialog::showEvent(event);
}
+void WidgetHandleKeyPressEvent(QWidget* widget, QKeyEvent* event)
+{
+ // If the enter key is pressed during any text input, the dialog box will close
+ // making it inconvenient to do multiple edits. This routine captures the
+ // Key_Enter or Key_Return and clears the focus to give a visible cue that
+ // editing of that field has finished and then doesn't propogate it.
+ if (event->key() != Qt::Key::Key_Enter && event->key() != Qt::Key::Key_Return)
+ {
+ QApplication::sendEvent(widget, event);
+ }
+ else
+ {
+ if (QWidget* editWidget = QApplication::focusWidget())
+ {
+ editWidget->clearFocus();
+ }
+ }
+}
+
+
+void EditorPreferencesDialog::keyPressEvent(QKeyEvent* event)
+{
+ WidgetHandleKeyPressEvent(this, event);
+}
+
void EditorPreferencesDialog::OnTreeCurrentItemChanged()
{
QTreeWidgetItem* currentItem = ui->pageTree->currentItem();
diff --git a/Code/Editor/EditorPreferencesDialog.h b/Code/Editor/EditorPreferencesDialog.h
index 64f44d7ab5..a3f05ad00d 100644
--- a/Code/Editor/EditorPreferencesDialog.h
+++ b/Code/Editor/EditorPreferencesDialog.h
@@ -19,6 +19,8 @@ namespace Ui
class EditorPreferencesTreeWidgetItem;
+void WidgetHandleKeyPressEvent(QWidget* widget, QKeyEvent* event);
+
class EditorPreferencesDialog
: public QDialog
, public AzToolsFramework::IPropertyEditorNotify
@@ -36,6 +38,7 @@ public:
protected:
void showEvent(QShowEvent* event) override;
+ void keyPressEvent(QKeyEvent* event) override;
private:
void CreateImages();
diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp
index 7323da9e95..754ea84544 100644
--- a/Code/Editor/EditorViewportWidget.cpp
+++ b/Code/Editor/EditorViewportWidget.cpp
@@ -46,6 +46,7 @@
#include
#include
#include
+#include
#include
#include
@@ -665,13 +666,7 @@ void EditorViewportWidget::OnBeginPrepareRender()
RenderAll();
// Draw 2D helpers.
-#ifdef LYSHINE_ATOM_TODO
- TransformationMatrices backupSceneMatrices;
-#endif
m_debugDisplay->DepthTestOff();
-#ifdef LYSHINE_ATOM_TODO
- m_renderer->Set2DMode(m_rcClient.right(), m_rcClient.bottom(), backupSceneMatrices);
-#endif
auto prevState = m_debugDisplay->GetState();
m_debugDisplay->SetState(e_Mode3D | e_AlphaBlended | e_FillModeSolid | e_CullModeBack | e_DepthWriteOn | e_DepthTestOn);
@@ -1627,14 +1622,14 @@ Vec3 EditorViewportWidget::ViewToWorld(
auto ray = m_renderViewport->ViewportScreenToWorldRay(AzToolsFramework::ViewportInteraction::ScreenPointFromQPoint(vp));
const float maxDistance = 10000.f;
- Vec3 v = AZVec3ToLYVec3(ray.direction) * maxDistance;
+ Vec3 v = AZVec3ToLYVec3(ray.m_direction) * maxDistance;
if (!_finite(v.x) || !_finite(v.y) || !_finite(v.z))
{
return Vec3(0, 0, 0);
}
- Vec3 colp = AZVec3ToLYVec3(ray.origin) + 0.002f * v;
+ Vec3 colp = AZVec3ToLYVec3(ray.m_origin) + 0.002f * v;
return colp;
}
@@ -2426,6 +2421,16 @@ AZ::Vector3 EditorViewportSettings::DefaultEditorCameraPosition() const
return SandboxEditor::CameraDefaultEditorPosition();
}
+bool EditorViewportSettings::IconsVisible() const
+{
+ return AzToolsFramework::IconsVisible();
+}
+
+bool EditorViewportSettings::HelpersVisible() const
+{
+ return AzToolsFramework::HelpersVisible();
+}
+
AZ_CVAR_EXTERNED(bool, ed_previewGameInFullscreen_once);
bool EditorViewportWidget::ShouldPreviewFullscreen() const
diff --git a/Code/Editor/EditorViewportWidget.h b/Code/Editor/EditorViewportWidget.h
index 3d52b2416d..83ca655326 100644
--- a/Code/Editor/EditorViewportWidget.h
+++ b/Code/Editor/EditorViewportWidget.h
@@ -79,6 +79,8 @@ struct EditorViewportSettings : public AzToolsFramework::ViewportInteraction::Vi
float ManipulatorCircleBoundWidth() const override;
bool StickySelectEnabled() const override;
AZ::Vector3 DefaultEditorCameraPosition() const override;
+ bool IconsVisible() const override;
+ bool HelpersVisible() const override;
};
// EditorViewportWidget window
diff --git a/Code/Editor/GameEngine.cpp b/Code/Editor/GameEngine.cpp
index e82832fc21..db4c587f54 100644
--- a/Code/Editor/GameEngine.cpp
+++ b/Code/Editor/GameEngine.cpp
@@ -442,7 +442,7 @@ AZ::Outcome CGameEngine::Init(
REGISTER_COMMAND("quit", CGameEngine::HandleQuitRequest, VF_RESTRICTEDMODE, "Quit/Shutdown the engine");
EBUS_EVENT(CrySystemEventBus, OnCryEditorInitialized);
-
+
return AZ::Success();
}
@@ -465,7 +465,7 @@ void CGameEngine::SetLevelPath(const QString& path)
const char* oldExtension = EditorUtils::LevelFile::GetOldCryFileExtension();
const char* defaultExtension = EditorUtils::LevelFile::GetDefaultFileExtension();
- // Store off if
+ // Store off if
if (QFileInfo(path + oldExtension).exists())
{
m_levelExtension = oldExtension;
diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h
index 48c8392f32..d2d4998187 100644
--- a/Code/Editor/IEditor.h
+++ b/Code/Editor/IEditor.h
@@ -69,7 +69,6 @@ class CSelectionTreeManager;
struct SEditorSettings;
class CGameExporter;
class IAWSResourceManager;
-struct IEditorPanelUtils;
namespace WinWidget
{
@@ -168,8 +167,6 @@ enum EEditorNotifyEvent
eNotify_OnVegetationObjectSelection, // When vegetation objects selection change.
eNotify_OnVegetationPanelUpdate, // When vegetation objects selection change.
- eNotify_OnDisplayRenderUpdate, // Sent when editor finish terrain texture generation.
-
eNotify_OnDataBaseUpdate, // DataBase Library was modified.
eNotify_OnLayerImportBegin, //layer import was started
@@ -528,8 +525,6 @@ struct IEditor
virtual IEditorMaterialManager* GetIEditorMaterialManager() = 0; // Vladimir@Conffx
//! Returns IconManager.
virtual IIconManager* GetIconManager() = 0;
- //! Get Panel Editor Utilities
- virtual IEditorPanelUtils* GetEditorPanelUtils() = 0;
//! Get Music Manager.
virtual CMusicManager* GetMusicManager() = 0;
virtual float GetTerrainElevation(float x, float y) = 0;
diff --git a/Code/Editor/IEditorImpl.cpp b/Code/Editor/IEditorImpl.cpp
index e5df6be58e..0846cf8a9e 100644
--- a/Code/Editor/IEditorImpl.cpp
+++ b/Code/Editor/IEditorImpl.cpp
@@ -81,9 +81,6 @@ AZ_POP_DISABLE_WARNING
// AWSNativeSDK
#include
-#include "IEditorPanelUtils.h"
-#include "EditorPanelUtils.h"
-
#include "Core/QtEditorApplication.h" // for Editor::EditorQtApplication
static CCryEditDoc * theDocument;
@@ -143,7 +140,6 @@ CEditorImpl::CEditorImpl()
, m_QtApplication(static_cast(qApp))
, m_pImageUtil(nullptr)
, m_pLogFile(nullptr)
- , m_panelEditorUtils(nullptr)
{
// note that this is a call into EditorCore.dll, which stores the g_pEditorPointer for all shared modules that share EditorCore.dll
// this means that they don't need to do SetIEditor(...) themselves and its available immediately
@@ -167,8 +163,6 @@ CEditorImpl::CEditorImpl()
m_pDisplaySettings->LoadRegistry();
m_pPluginManager = new CPluginManager;
- m_panelEditorUtils = CreateEditorPanelUtils();
-
m_pObjectManager = new CObjectManager;
m_pViewManager = new CViewManager;
m_pIconManager = new CIconManager;
@@ -301,8 +295,6 @@ CEditorImpl::~CEditorImpl()
SAFE_DELETE(m_pViewManager)
SAFE_DELETE(m_pObjectManager) // relies on prefab manager
- SAFE_DELETE(m_panelEditorUtils);
-
// some plugins may be exporter - this must be above plugin manager delete.
SAFE_DELETE(m_pExportManager);
@@ -1445,7 +1437,7 @@ ISourceControl* CEditorImpl::GetSourceControl()
{
IClassDesc* pClass = classes[i];
ISourceControl* pSCM = nullptr;
- HRESULT hRes = pClass->QueryInterface(__uuidof(ISourceControl), (void**)&pSCM);
+ HRESULT hRes = pClass->QueryInterface(__az_uuidof(ISourceControl), (void**)&pSCM);
if (!FAILED(hRes) && pSCM)
{
m_pSourceControl = pSCM;
@@ -1658,8 +1650,3 @@ void CEditorImpl::DestroyQMimeData(QMimeData* data) const
{
delete data;
}
-
-IEditorPanelUtils* CEditorImpl::GetEditorPanelUtils()
-{
- return m_panelEditorUtils;
-}
diff --git a/Code/Editor/IEditorImpl.h b/Code/Editor/IEditorImpl.h
index 4976c0c1ca..d99b8ae802 100644
--- a/Code/Editor/IEditorImpl.h
+++ b/Code/Editor/IEditorImpl.h
@@ -298,7 +298,6 @@ public:
IEditorMaterialManager* GetIEditorMaterialManager() override; // Vladimir@Conffx
IImageUtil* GetImageUtil() override; // Vladimir@conffx
SEditorSettings* GetEditorSettings() override;
- IEditorPanelUtils* GetEditorPanelUtils() override;
ILogFile* GetLogFile() override { return m_pLogFile; }
void UnloadPlugins() override;
@@ -356,7 +355,6 @@ protected:
CErrorsDlg* m_pErrorsDlg;
//! Source control interface.
ISourceControl* m_pSourceControl;
- IEditorPanelUtils* m_panelEditorUtils;
CSelectionTreeManager* m_pSelectionTreeManager;
diff --git a/Code/Editor/IEditorPanelUtils.h b/Code/Editor/IEditorPanelUtils.h
deleted file mode 100644
index 4649213ae7..0000000000
--- a/Code/Editor/IEditorPanelUtils.h
+++ /dev/null
@@ -1,131 +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
- */
-
-#ifndef CRYINCLUDE_CRYEDITOR_IPANELEDITORUTILS_H
-#define CRYINCLUDE_CRYEDITOR_IPANELEDITORUTILS_H
-#pragma once
-
-#include "Cry_Vector3.h"
-
-#include "DisplaySettings.h"
-#include "Include/IDisplayViewport.h"
-#include "Include/IIconManager.h"
-#include
-#include
-#include
-#include
-
-class CBaseObject;
-class CViewport;
-class IQToolTip;
-
-struct HotKey
-{
- HotKey()
- : path("")
- , sequence(QKeySequence())
- {
- }
- void CopyFrom(const HotKey& other)
- {
- path = other.path;
- sequence = other.sequence;
- }
- void SetPath(const char* _path)
- {
- path = QString(_path);
- }
- void SetSequenceFromString(const char* _sequence)
- {
- sequence = QKeySequence::fromString(_sequence);
- }
- void SetSequence(const QKeySequence& other)
- {
- sequence = other;
- }
- bool IsMatch(QString _path)
- {
- return path.compare(_path, Qt::CaseInsensitive) == 0;
- }
- bool IsMatch(QKeySequence _sequence)
- {
- return sequence.matches(_sequence);
- }
- bool operator < (const HotKey& other) const
- {
- //split the paths into lists compare per level
- QStringList m_categories = path.split('.');
- QStringList o_categories = other.path.split('.');
- int m_catSize = m_categories.size();
- int o_catSize = o_categories.size();
- int size = (m_catSize < o_catSize) ? m_catSize : o_catSize;
-
- //sort categories to keep them together
- for (int i = 0; i < size; i++)
- {
- if (m_categories[i] < o_categories[i])
- {
- return true;
- }
- if (m_categories[i] > o_categories[i])
- {
- return false;
- }
- }
- //if comparing a category and a item in that category the category is < item
- return m_catSize > o_catSize;
- }
- QKeySequence sequence;
- QString path;
-};
-
-struct IEditorPanelUtils
-{
- virtual ~IEditorPanelUtils() {}
- virtual void SetViewportDragOperation(void(*)(CViewport* viewport, int dragPointX, int dragPointY, void* custom), void* custom) = 0;
-
- //PREVIEW WINDOW UTILS////////////////////////////////////////////////////
- virtual int PreviewWindow_GetDisplaySettingsDebugFlags(CDisplaySettings* settings) = 0;
- virtual void PreviewWindow_SetDisplaySettingsDebugFlags(CDisplaySettings* settings, int flags) = 0;
-
- //HOTKEY UTILS////////////////////////////////////////////////////////////
- virtual bool HotKey_Import() = 0;
- virtual void HotKey_Export() = 0;
- virtual QKeySequence HotKey_GetShortcut(const char* path) = 0;
- virtual bool HotKey_IsPressed(const QKeyEvent* event, const char* path) = 0;
- virtual bool HotKey_IsPressed(const QShortcutEvent* event, const char* path) = 0;
- virtual bool HotKey_LoadExisting() = 0;
- virtual void HotKey_SaveCurrent() = 0;
- virtual void HotKey_BuildDefaults() = 0;
- virtual void HotKey_SetKeys(QVector keys) = 0;
- virtual QVector HotKey_GetKeys() = 0;
- virtual QString HotKey_GetPressedHotkey(const QKeyEvent* event) = 0;
- virtual QString HotKey_GetPressedHotkey(const QShortcutEvent* event) = 0;
- virtual void HotKey_SetEnabled(bool val) = 0;
- virtual bool HotKey_IsEnabled() const = 0;
-
- //TOOLTIP UTILS///////////////////////////////////////////////////////////
-
- //! Loads a table of tooltip configuration data from an xml file.
- virtual void ToolTip_LoadConfigXML(QString filepath) = 0;
-
- //! Initializes a QToolTipWidget from loaded configuration data (see ToolTip_LoadConfigXML())
- //! \param tooltip Will be initialized using loaded configuration data
- //! \param path Variable serialization path. Will be used as the key for looking up data in the configuration table. (ex: "Rotation.Rotation_Rate_X")
- //! \param option Name of a sub-option of the variable specified by "path". (ex: "Emitter_Strength" will look up the tooltip data for "Rotation.Rotation_Rate_X.Emitter_Strength")
- //! \param optionalData The argument to be used with "special_content" feature. See ToolTip_GetSpecialContentType() and QToolTipWidget::AddSpecialContent().
- //! \param isEnabled If false, the tooltip will indicate the reason why the widget is disabled.
- virtual void ToolTip_BuildFromConfig(IQToolTip* tooltip, QString path, QString option, QString optionalData = "", bool isEnabled = true) = 0;
-
- virtual QString ToolTip_GetTitle(QString path, QString option = "") = 0;
- virtual QString ToolTip_GetContent(QString path, QString option = "") = 0;
- virtual QString ToolTip_GetSpecialContentType(QString path, QString option = "") = 0;
- virtual QString ToolTip_GetDisabledContent(QString path, QString option = "") = 0;
-};
-
-
-#endif
diff --git a/Code/Editor/Include/IEditorClassFactory.h b/Code/Editor/Include/IEditorClassFactory.h
index dd47f803e2..6c85192436 100644
--- a/Code/Editor/Include/IEditorClassFactory.h
+++ b/Code/Editor/Include/IEditorClassFactory.h
@@ -31,10 +31,7 @@ struct IUnknown
};
#endif
-#ifdef __uuidof
-#undef __uuidof
-#endif
-#define __uuidof(T) T::uuid()
+#define __az_uuidof(T) T::uuid()
#if defined(AZ_PLATFORM_LINUX) || defined(AZ_PLATFORM_MAC)
@@ -107,7 +104,7 @@ struct IClassDesc
template
HRESULT STDMETHODCALLTYPE QueryInterface(Q** pp)
{
- return QueryInterface(__uuidof(Q), (void**)pp);
+ return QueryInterface(__az_uuidof(Q), (void**)pp);
}
//////////////////////////////////////////////////////////////////////////
diff --git a/Code/Editor/Include/IViewPane.h b/Code/Editor/Include/IViewPane.h
index b4a25a87a9..f2425fb954 100644
--- a/Code/Editor/Include/IViewPane.h
+++ b/Code/Editor/Include/IViewPane.h
@@ -60,7 +60,7 @@ struct IViewPaneClass
//////////////////////////////////////////////////////////////////////////
HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj)
{
- if (riid == __uuidof(IViewPaneClass))
+ if (riid == __az_uuidof(IViewPaneClass))
{
*ppvObj = this;
return S_OK;
diff --git a/Code/Editor/Lib/Tests/IEditorMock.h b/Code/Editor/Lib/Tests/IEditorMock.h
index 390ffebe79..590f98e6d7 100644
--- a/Code/Editor/Lib/Tests/IEditorMock.h
+++ b/Code/Editor/Lib/Tests/IEditorMock.h
@@ -187,6 +187,5 @@ public:
MOCK_METHOD0(UnloadPlugins, void());
MOCK_METHOD0(LoadPlugins, void());
MOCK_METHOD1(GetSearchPath, QString(EEditorPathName));
- MOCK_METHOD0(GetEditorPanelUtils, IEditorPanelUtils* ());
};
diff --git a/Code/Editor/Lib/Tests/test_ClickableLabel.cpp b/Code/Editor/Lib/Tests/test_ClickableLabel.cpp
deleted file mode 100644
index a676714992..0000000000
--- a/Code/Editor/Lib/Tests/test_ClickableLabel.cpp
+++ /dev/null
@@ -1,58 +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
-#include
-#include
-
-#include
-
-using namespace AZ;
-using namespace ::testing;
-
-namespace UnitTest
-{
- class TestingClickableLabel
- : public ScopedAllocatorSetupFixture
- {
- public:
- ClickableLabel m_clickableLabel;
- };
-
- TEST_F(TestingClickableLabel, CursorDoesNotUpdateWhileDisabled)
- {
- m_clickableLabel.setEnabled(false);
-
- QApplication::setOverrideCursor(QCursor(Qt::BlankCursor));
- QEnterEvent enterEvent{ QPointF(), QPointF(), QPointF() };
- QApplication::sendEvent(&m_clickableLabel, &enterEvent);
-
- const Qt::CursorShape cursorShape = QApplication::overrideCursor()->shape();
- EXPECT_THAT(cursorShape, Ne(Qt::PointingHandCursor));
- EXPECT_THAT(cursorShape, Eq(Qt::BlankCursor));
- }
-
- TEST_F(TestingClickableLabel, DoesNotRespondToDblClickWhileDisabled)
- {
- m_clickableLabel.setEnabled(false);
-
- bool linkActivated = false;
- QObject::connect(&m_clickableLabel, &QLabel::linkActivated, [&linkActivated]()
- {
- linkActivated = true;
- });
-
- QMouseEvent mouseEvent {
- QEvent::MouseButtonDblClick, QPointF(),
- Qt::LeftButton, Qt::LeftButton, Qt::NoModifier };
- QApplication::sendEvent(&m_clickableLabel, &mouseEvent);
-
- EXPECT_THAT(linkActivated, Eq(false));
- }
-} // namespace UnitTest
diff --git a/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp b/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp
index 1fd70cb88c..fd65634d4e 100644
--- a/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp
+++ b/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp
@@ -12,6 +12,7 @@
#include
#include
#include
+#include
#include
#include
@@ -63,6 +64,11 @@ namespace DisplaySettingsPythonBindingsUnitTests
m_app.Start(appDesc);
m_app.RegisterComponentDescriptor(AzToolsFramework::DisplaySettingsComponent::CreateDescriptor());
+
+ // Without this, the user settings component would attempt to save on finalize/shutdown. Since the file is
+ // shared across the whole engine, if multiple tests are run in parallel, the saving could cause a crash
+ // in the unit tests.
+ AZ::UserSettingsComponentRequestBus::Broadcast(&AZ::UserSettingsComponentRequests::DisableSaveOnFinalize);
}
void TearDown() override
diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp
index 38e433c3a3..bbebac96a3 100644
--- a/Code/Editor/MainWindow.cpp
+++ b/Code/Editor/MainWindow.cpp
@@ -47,6 +47,7 @@ AZ_POP_DISABLE_WARNING
#include
#include
#include
+#include
#include
// AzQtComponents
@@ -445,11 +446,11 @@ void MainWindow::Initialize()
{
m_viewPaneManager->SetMainWindow(m_viewPaneHost, &m_settings, /*unused*/ QByteArray());
+ InitActions();
+
RegisterStdViewClasses();
InitCentralWidget();
- InitActions();
-
// load toolbars ("shelves") and macros
GetIEditor()->GetToolBoxManager()->Load(m_actionManager);
@@ -642,11 +643,11 @@ void MainWindow::InitActions()
.SetStatusTip(tr("Create a new slice"));
am->AddAction(ID_FILE_OPEN_SLICE, tr("Open Slice..."))
.SetStatusTip(tr("Open an existing slice"));
-#endif
am->AddAction(ID_FILE_SAVE_SELECTED_SLICE, tr("Save selected slice")).SetShortcut(tr("Alt+S"))
.SetStatusTip(tr("Save the selected slice to the first level root"));
am->AddAction(ID_FILE_SAVE_SLICE_TO_ROOT, tr("Save Slice to root")).SetShortcut(tr("Ctrl+Alt+S"))
.SetStatusTip(tr("Save the selected slice to the top level root"));
+#endif
am->AddAction(ID_FILE_SAVE_LEVEL, tr("&Save"))
.SetShortcut(tr("Ctrl+S"))
.SetReserved()
@@ -676,7 +677,9 @@ void MainWindow::InitActions()
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateSelected);
am->AddAction(ID_FILE_EXPORTOCCLUSIONMESH, tr("Export Occlusion Mesh"));
am->AddAction(ID_FILE_EDITLOGFILE, tr("Show Log File"));
+#ifdef ENABLE_SLICE_EDITOR
am->AddAction(ID_FILE_RESAVESLICES, tr("Resave All Slices"));
+#endif
am->AddAction(ID_FILE_PROJECT_MANAGER_SETTINGS, tr("Edit Project Settings..."));
am->AddAction(ID_FILE_PROJECT_MANAGER_NEW, tr("New Project..."));
am->AddAction(ID_FILE_PROJECT_MANAGER_OPEN, tr("Open Project..."));
@@ -798,27 +801,40 @@ void MainWindow::InitActions()
EditorTransformComponentSelectionRequests::Mode::Scale);
});
- am->AddAction(AzToolsFramework::SnapToGrid, tr("Snap to grid"))
+ am->AddAction(AzToolsFramework::SnapToGrid, tr("Grid snapping"))
.SetIcon(Style::icon("Grid"))
+ .SetStatusTip(tr("Toggle grid snapping"))
.SetShortcut(tr("G"))
- .SetToolTip(tr("Snap to grid (G)"))
- .SetStatusTip(tr("Toggles snap to grid"))
.SetCheckable(true)
- .RegisterUpdateCallback([](QAction* action) {
- Q_ASSERT(action->isCheckable());
- action->setChecked(SandboxEditor::GridSnappingEnabled());
- })
- .Connect(&QAction::triggered, []() { SandboxEditor::SetGridSnapping(!SandboxEditor::GridSnappingEnabled()); });
+ .RegisterUpdateCallback(
+ [](QAction* action)
+ {
+ Q_ASSERT(action->isCheckable());
+ action->setChecked(SandboxEditor::GridSnappingEnabled());
+ })
+ .Connect(
+ &QAction::triggered,
+ []
+ {
+ SandboxEditor::SetGridSnapping(!SandboxEditor::GridSnappingEnabled());
+ });
- am->AddAction(AzToolsFramework::SnapAngle, tr("Snap angle"))
+ am->AddAction(AzToolsFramework::SnapAngle, tr("Angle snapping"))
.SetIcon(Style::icon("Angle"))
- .SetStatusTip(tr("Snap angle"))
+ .SetStatusTip(tr("Toggle angle snapping"))
.SetCheckable(true)
- .RegisterUpdateCallback([](QAction* action) {
- Q_ASSERT(action->isCheckable());
- action->setChecked(SandboxEditor::AngleSnappingEnabled());
- })
- .Connect(&QAction::triggered, []() { SandboxEditor::SetAngleSnapping(!SandboxEditor::AngleSnappingEnabled()); });
+ .RegisterUpdateCallback(
+ [](QAction* action)
+ {
+ Q_ASSERT(action->isCheckable());
+ action->setChecked(SandboxEditor::AngleSnappingEnabled());
+ })
+ .Connect(
+ &QAction::triggered,
+ []
+ {
+ SandboxEditor::SetAngleSnapping(!SandboxEditor::AngleSnappingEnabled());
+ });
// Display actions
am->AddAction(ID_SWITCHCAMERA_DEFAULTCAMERA, tr("Default Camera")).SetCheckable(true)
@@ -918,9 +934,41 @@ void MainWindow::InitActions()
.SetStatusTip(tr("Cycle 2D Viewport"))
.RegisterUpdateCallback(cryEdit, &CCryEditApp::OnUpdateNonGameMode);
#endif
- am->AddAction(ID_DISPLAY_SHOWHELPERS, tr("Show/Hide Helpers"))
+ am->AddAction(AzToolsFramework::Helpers, tr("Show Helpers"))
.SetShortcut(tr("Shift+Space"))
- .SetToolTip(tr("Show/Hide Helpers (Shift+Space)"));
+ .SetToolTip(tr("Show/Hide Helpers (Shift+Space)"))
+ .SetCheckable(true)
+ .RegisterUpdateCallback(
+ [](QAction* action)
+ {
+ Q_ASSERT(action->isCheckable());
+ action->setChecked(AzToolsFramework::HelpersVisible());
+ })
+ .Connect(
+ &QAction::triggered,
+ []()
+ {
+ AzToolsFramework::SetHelpersVisible(!AzToolsFramework::HelpersVisible());
+ AzToolsFramework::ViewportInteraction::ViewportSettingsNotificationBus::Broadcast(
+ &AzToolsFramework::ViewportInteraction::ViewportSettingNotifications::OnDrawHelpersChanged,
+ AzToolsFramework::HelpersVisible());
+ });
+ am->AddAction(AzToolsFramework::Icons, tr("Show Icons"))
+ .SetShortcut(tr("Ctrl+Space"))
+ .SetToolTip(tr("Show/Hide Icons (Ctrl+Space)"))
+ .SetCheckable(true)
+ .RegisterUpdateCallback(
+ [](QAction* action)
+ {
+ Q_ASSERT(action->isCheckable());
+ action->setChecked(AzToolsFramework::IconsVisible());
+ })
+ .Connect(
+ &QAction::triggered,
+ []()
+ {
+ AzToolsFramework::SetIconsVisible(!AzToolsFramework::IconsVisible());
+ });
// Audio actions
am->AddAction(ID_SOUND_STOPALLSOUNDS, tr("Stop All Sounds"))
diff --git a/Code/Editor/Plugin.cpp b/Code/Editor/Plugin.cpp
index 68f8d8833b..16c386e31c 100644
--- a/Code/Editor/Plugin.cpp
+++ b/Code/Editor/Plugin.cpp
@@ -155,7 +155,7 @@ IViewPaneClass* CClassFactory::FindViewPaneClassByTitle(const char* pPaneTitle)
{
IViewPaneClass* viewPane = nullptr;
IClassDesc* desc = m_classes[i];
- if (SUCCEEDED(desc->QueryInterface(__uuidof(IViewPaneClass), (void**)&viewPane)))
+ if (SUCCEEDED(desc->QueryInterface(__az_uuidof(IViewPaneClass), (void**)&viewPane)))
{
if (QString::compare(viewPane->GetPaneTitle(), pPaneTitle) == 0)
{
diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp
index d5b903585e..69b195d243 100644
--- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp
+++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.cpp
@@ -1986,8 +1986,3 @@ void SandboxIntegrationManager::BrowseForAssets(AssetSelectionModel& selection)
{
AssetBrowserComponentRequestBus::Broadcast(&AssetBrowserComponentRequests::PickAssets, selection, GetMainWindow());
}
-
-bool SandboxIntegrationManager::DisplayHelpersVisible()
-{
- return GetIEditor()->GetDisplaySettings()->IsDisplayHelpers();
-}
diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h
index 79e7a4334d..c58f019c85 100644
--- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h
+++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/SandboxIntegration.h
@@ -165,7 +165,6 @@ private:
void InstantiateSliceFromAssetId(const AZ::Data::AssetId& assetId) override;
void ClearRedoStack() override;
int GetIconTextureIdFromEntityIconPath(const AZStd::string& entityIconPath) override;
- bool DisplayHelpersVisible() override;
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp
index af58ac4b6b..15bdfa9bf2 100644
--- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp
+++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerWidget.cpp
@@ -1281,6 +1281,8 @@ void OutlinerWidget::OnSearchTextChanged(const QString& activeTextFilter)
m_listModel->SearchStringChanged(filterString);
m_proxyModel->UpdateFilter();
+
+ m_gui->m_objectTree->expandAll();
}
void OutlinerWidget::OnFilterChanged(const AzQtComponents::SearchTypeFilterList& activeTypeFilters)
diff --git a/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h b/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h
index ec06fdc82a..794dca0f86 100644
--- a/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h
+++ b/Code/Editor/Plugins/PerforcePlugin/PerforceSourceControl.h
@@ -49,7 +49,7 @@ public:
// from IUnknown
HRESULT STDMETHODCALLTYPE QueryInterface(const IID& riid, void** ppvObj)
{
- if (riid == __uuidof(ISourceControl) /* && m_pIntegrator*/)
+ if (riid == __az_uuidof(ISourceControl) /* && m_pIntegrator*/)
{
*ppvObj = this;
return S_OK;
diff --git a/Code/Editor/PreferencesStdPages.cpp b/Code/Editor/PreferencesStdPages.cpp
index 1dd40702a7..77b912a44e 100644
--- a/Code/Editor/PreferencesStdPages.cpp
+++ b/Code/Editor/PreferencesStdPages.cpp
@@ -50,7 +50,7 @@ CStdPreferencesClassDesc::CStdPreferencesClassDesc()
HRESULT CStdPreferencesClassDesc::QueryInterface(const IID& riid, void** ppvObj)
{
- if (riid == __uuidof(IPreferencesPageCreator))
+ if (riid == __az_uuidof(IPreferencesPageCreator))
{
*ppvObj = (IPreferencesPageCreator*)this;
return S_OK;
diff --git a/Code/Editor/QtUI/ClickableLabel.cpp b/Code/Editor/QtUI/ClickableLabel.cpp
deleted file mode 100644
index b0694e5f18..0000000000
--- a/Code/Editor/QtUI/ClickableLabel.cpp
+++ /dev/null
@@ -1,101 +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 "ClickableLabel.h"
-
-
-ClickableLabel::ClickableLabel(const QString& text, QWidget* parent)
- : QLabel(parent)
- , m_text(text)
- , m_showDecoration(false)
-{
- setTextFormat(Qt::RichText);
- setTextInteractionFlags(Qt::TextBrowserInteraction);
-}
-
-ClickableLabel::ClickableLabel(QWidget* parent)
- : QLabel(parent)
- , m_showDecoration(false)
-{
- setTextFormat(Qt::RichText);
- setTextInteractionFlags(Qt::TextBrowserInteraction);
-}
-
-void ClickableLabel::showEvent([[maybe_unused]] QShowEvent* event)
-{
- updateFormatting(false);
-}
-
-void ClickableLabel::enterEvent(QEvent* ev)
-{
- if (!isEnabled())
- {
- return;
- }
-
- updateFormatting(true);
- QApplication::setOverrideCursor(QCursor(Qt::PointingHandCursor));
- QLabel::enterEvent(ev);
-}
-
-void ClickableLabel::leaveEvent(QEvent* ev)
-{
- if (!isEnabled())
- {
- return;
- }
-
- updateFormatting(false);
- QApplication::restoreOverrideCursor();
- QLabel::leaveEvent(ev);
-}
-
-void ClickableLabel::setText(const QString& text)
-{
- m_text = text;
- QLabel::setText(text);
- updateFormatting(false);
-}
-
-void ClickableLabel::setShowDecoration(bool b)
-{
- m_showDecoration = b;
- updateFormatting(false);
-}
-
-void ClickableLabel::updateFormatting(bool mouseOver)
-{
- //FIXME: this should be done differently. Using a style sheet would be easiest.
-
- QColor c = palette().color(QPalette::WindowText);
- if (mouseOver || m_showDecoration)
- {
- QLabel::setText(QString(R"(%2)").arg(c.name(), m_text));
- }
- else
- {
- QLabel::setText(m_text);
- }
-}
-
-bool ClickableLabel::event(QEvent* e)
-{
- if (isEnabled())
- {
- if (e->type() == QEvent::MouseButtonDblClick)
- {
- emit linkActivated(QString());
- return true; //ignore
- }
- }
-
- return QLabel::event(e);
-}
-
-#include
diff --git a/Code/Editor/QtUI/ClickableLabel.h b/Code/Editor/QtUI/ClickableLabel.h
deleted file mode 100644
index 2b14676eae..0000000000
--- a/Code/Editor/QtUI/ClickableLabel.h
+++ /dev/null
@@ -1,39 +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
-#ifndef CRYINCLUDE_EDITORCOMMON_CLICKABLELABEL_H
-#define CRYINCLUDE_EDITORCOMMON_CLICKABLELABEL_H
-
-#if !defined(Q_MOC_RUN)
-#include
-#endif
-
-class SANDBOX_API ClickableLabel
- : public QLabel
-{
- Q_OBJECT
-public:
- explicit ClickableLabel(const QString& text, QWidget* parent = nullptr);
- explicit ClickableLabel(QWidget* parent = nullptr);
- bool event(QEvent* e) override;
-
- void setText(const QString& text);
- void setShowDecoration(bool b);
-
-protected:
- void showEvent(QShowEvent* event) override;
- void enterEvent(QEvent* ev) override;
- void leaveEvent(QEvent* ev) override;
-
-private:
- void updateFormatting(bool mouseOver);
- QString m_text;
- bool m_showDecoration;
-};
-
-#endif
diff --git a/Code/Editor/Resource.h b/Code/Editor/Resource.h
index ba3cd39fe7..432f07a531 100644
--- a/Code/Editor/Resource.h
+++ b/Code/Editor/Resource.h
@@ -191,7 +191,6 @@
#define ID_BRUSH_CSGSUBSTRUCT 33837
#define ID_MATERIAL_PICKTOOL 33842
#define ID_MODIFY_AIPOINT_PICKIMPASSLINK 33865
-#define ID_DISPLAY_SHOWHELPERS 33871
#define ID_FILE_EXPORTSELECTION 33875
#define ID_EDIT_PASTE_WITH_LINKS 33893
#define ID_FILE_EXPORT_TERRAINAREA 33904
diff --git a/Code/Editor/Util/FileUtil.cpp b/Code/Editor/Util/FileUtil.cpp
index 9f96d45381..182a122ea8 100644
--- a/Code/Editor/Util/FileUtil.cpp
+++ b/Code/Editor/Util/FileUtil.cpp
@@ -251,7 +251,7 @@ bool CFileUtil::ExtractDccFilenameFromAssetDatabase(const QString& assetFilename
for (size_t i = 0; i < assetDatabasePlugins.size(); ++i)
{
- if (assetDatabasePlugins[i]->QueryInterface(__uuidof(IAssetItemDatabase), (void**)&pCurrentDatabaseInterface) == S_OK)
+ if (assetDatabasePlugins[i]->QueryInterface(__az_uuidof(IAssetItemDatabase), (void**)&pCurrentDatabaseInterface) == S_OK)
{
if (!pCurrentDatabaseInterface)
{
diff --git a/Code/Editor/ViewportManipulatorController.cpp b/Code/Editor/ViewportManipulatorController.cpp
index e46328eb65..9879a84b62 100644
--- a/Code/Editor/ViewportManipulatorController.cpp
+++ b/Code/Editor/ViewportManipulatorController.cpp
@@ -129,8 +129,8 @@ namespace SandboxEditor
ViewportInteractionRequestBus::EventResult(
ray, GetViewportId(), &ViewportInteractionRequestBus::Events::ViewportScreenToWorldRay, screenPoint);
- m_mouseInteraction.m_mousePick.m_rayOrigin = ray.origin;
- m_mouseInteraction.m_mousePick.m_rayDirection = ray.direction;
+ m_mouseInteraction.m_mousePick.m_rayOrigin = ray.m_origin;
+ m_mouseInteraction.m_mousePick.m_rayDirection = ray.m_direction;
m_mouseInteraction.m_mousePick.m_screenCoordinates = screenPoint;
}
diff --git a/Code/Editor/ViewportTitleDlg.cpp b/Code/Editor/ViewportTitleDlg.cpp
index 49459fad0f..888089fd72 100644
--- a/Code/Editor/ViewportTitleDlg.cpp
+++ b/Code/Editor/ViewportTitleDlg.cpp
@@ -6,7 +6,6 @@
*
*/
-
// Description : CViewportTitleDlg implementation file
#if !defined(Q_MOC_RUN)
@@ -42,38 +41,18 @@
#include
#include
#include
+#include
+#include
#include
AZ_PUSH_DISABLE_DLL_EXPORT_MEMBER_WARNING
#include "ui_ViewportTitleDlg.h"
AZ_POP_DISABLE_DLL_EXPORT_MEMBER_WARNING
-#endif //!defined(Q_MOC_RUN)
+#endif //! defined(Q_MOC_RUN)
// CViewportTitleDlg dialog
-inline namespace Helpers
-{
- void ToggleHelpers()
- {
- const bool newValue = !GetIEditor()->GetDisplaySettings()->IsDisplayHelpers();
- GetIEditor()->GetDisplaySettings()->DisplayHelpers(newValue);
- GetIEditor()->Notify(eNotify_OnDisplayRenderUpdate);
-
- if (newValue == false)
- {
- GetIEditor()->GetObjectManager()->SendEvent(EVENT_HIDE_HELPER);
- }
- AzToolsFramework::ViewportInteraction::ViewportSettingsNotificationBus::Broadcast(
- &AzToolsFramework::ViewportInteraction::ViewportSettingNotifications::OnDrawHelpersChanged, newValue);
- }
-
- bool IsHelpersShown()
- {
- return GetIEditor()->GetDisplaySettings()->IsDisplayHelpers();
- }
-}
-
namespace
{
class CViewportTitleDlgDisplayInfoHelper
@@ -98,7 +77,7 @@ namespace
emit ViewportInfoStatusUpdated(static_cast(state));
}
};
-} //end anonymous namespace
+} // end anonymous namespace
CViewportTitleDlg::CViewportTitleDlg(QWidget* pParent)
: QWidget(pParent)
@@ -215,13 +194,65 @@ void CViewportTitleDlg::SetupViewportInformationMenu()
m_ui->m_debugInformationMenu->setMenu(GetViewportInformationMenu());
connect(m_ui->m_debugInformationMenu, &QToolButton::clicked, this, &CViewportTitleDlg::OnToggleDisplayInfo);
m_ui->m_debugInformationMenu->setPopupMode(QToolButton::MenuButtonPopup);
-
}
void CViewportTitleDlg::SetupHelpersButton()
{
- connect(m_ui->m_helpers, &QToolButton::clicked, this, &CViewportTitleDlg::OnToggleHelpers);
- m_ui->m_helpers->setChecked(Helpers::IsHelpersShown());
+ if (m_helpersMenu == nullptr)
+ {
+ m_helpersMenu = new QMenu("Helpers State", this);
+
+ auto helperAction = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::Helpers);
+ connect(
+ helperAction, &QAction::triggered, this,
+ [this]
+ {
+ m_ui->m_helpers->setChecked(AzToolsFramework::HelpersVisible() || AzToolsFramework::IconsVisible());
+ });
+
+ auto iconAction = MainWindow::instance()->GetActionManager()->GetAction(AzToolsFramework::Icons);
+ connect(
+ iconAction, &QAction::triggered, this,
+ [this]
+ {
+ m_ui->m_helpers->setChecked(AzToolsFramework::HelpersVisible() || AzToolsFramework::IconsVisible());
+ });
+
+ m_helpersAction = new QAction(tr("Helpers"), m_helpersMenu);
+ m_helpersAction->setCheckable(true);
+ connect(
+ m_helpersAction, &QAction::triggered, this,
+ [helperAction]
+ {
+ helperAction->trigger();
+ });
+
+ m_iconsAction = new QAction(tr("Icons"), m_helpersMenu);
+ m_iconsAction->setCheckable(true);
+ connect(
+ m_iconsAction, &QAction::triggered, this,
+ [iconAction]
+ {
+ iconAction->trigger();
+ });
+
+ m_helpersMenu->addAction(m_helpersAction);
+ m_helpersMenu->addAction(m_iconsAction);
+
+ connect(
+ m_helpersMenu, &QMenu::aboutToShow, this,
+ [this]
+ {
+ m_helpersAction->setChecked(AzToolsFramework::HelpersVisible());
+ m_iconsAction->setChecked(AzToolsFramework::IconsVisible());
+ });
+
+ m_ui->m_helpers->setCheckable(true);
+ m_ui->m_helpers->setMenu(m_helpersMenu);
+ m_ui->m_helpers->setPopupMode(QToolButton::InstantPopup);
+ }
+
+ m_ui->m_helpers->setChecked(AzToolsFramework::HelpersVisible() || AzToolsFramework::IconsVisible());
}
void CViewportTitleDlg::SetupOverflowMenu()
@@ -279,15 +310,20 @@ void CViewportTitleDlg::SetupOverflowMenu()
UpdateMuteActionText();
}
-
//////////////////////////////////////////////////////////////////////////
void CViewportTitleDlg::SetViewPane(CLayoutViewPane* pViewPane)
{
if (m_pViewPane)
+ {
m_pViewPane->disconnect(this);
+ }
+
m_pViewPane = pViewPane;
+
if (m_pViewPane)
+ {
connect(this, &QWidget::customContextMenuRequested, m_pViewPane, &CLayoutViewPane::ShowTitleMenu);
+ }
}
//////////////////////////////////////////////////////////////////////////
@@ -318,7 +354,6 @@ void CViewportTitleDlg::OnInitDialog()
m_ui->m_prefabFocusPath->hide();
m_ui->m_prefabFocusBackButton->hide();
}
-
}
//////////////////////////////////////////////////////////////////////////
@@ -336,13 +371,6 @@ void CViewportTitleDlg::OnMaximize()
}
}
-//////////////////////////////////////////////////////////////////////////
-void CViewportTitleDlg::OnToggleHelpers()
-{
- Helpers::ToggleHelpers();
- m_ui->m_helpers->setChecked(Helpers::IsHelpersShown());
-}
-
void CViewportTitleDlg::SetNoViewportInfo()
{
AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Broadcast(
@@ -367,7 +395,6 @@ void CViewportTitleDlg::SetCompactViewportInfo()
&AZ::AtomBridge::AtomViewportInfoDisplayRequestBus::Events::SetDisplayState, AZ::AtomBridge::ViewportInfoDisplayState::CompactInfo);
}
-
//////////////////////////////////////////////////////////////////////////
void CViewportTitleDlg::UpdateDisplayInfo()
{
@@ -783,9 +810,6 @@ void CViewportTitleDlg::OnEditorNotifyEvent(EEditorNotifyEvent event)
{
switch (event)
{
- case eNotify_OnDisplayRenderUpdate:
- m_ui->m_helpers->setChecked(Helpers::IsHelpersShown());
- break;
case eNotify_OnBeginGameMode:
case eNotify_OnEndGameMode:
UpdateMuteActionText();
@@ -997,24 +1021,18 @@ void CViewportTitleDlg::UpdateOverFlowMenuState()
m_angleSizeActionWidget->setEnabled(angleSnappingActive);
}
-namespace
+ namespace
{
void PyToggleHelpers()
{
- GetIEditor()->GetDisplaySettings()->DisplayHelpers(!GetIEditor()->GetDisplaySettings()->IsDisplayHelpers());
- GetIEditor()->Notify(eNotify_OnDisplayRenderUpdate);
-
- if (GetIEditor()->GetDisplaySettings()->IsDisplayHelpers() == false)
- {
- GetIEditor()->GetObjectManager()->SendEvent(EVENT_HIDE_HELPER);
- }
+ AzToolsFramework::SetHelpersVisible(!AzToolsFramework::HelpersVisible());
}
bool PyIsHelpersShown()
{
- return GetIEditor()->GetDisplaySettings()->IsDisplayHelpers();
+ return AzToolsFramework::HelpersVisible();
}
-}
+} // namespace
namespace AzToolsFramework
{
@@ -1029,11 +1047,12 @@ namespace AzToolsFramework
->Attribute(AZ::Script::Attributes::Category, "Legacy/Editor")
->Attribute(AZ::Script::Attributes::Module, "legacy.general");
};
+
addLegacyGeneral(behaviorContext->Method("toggle_helpers", PyToggleHelpers, nullptr, "Toggles the display of helpers."));
addLegacyGeneral(behaviorContext->Method("is_helpers_shown", PyIsHelpersShown, nullptr, "Gets the display state of helpers."));
}
}
-}
+} // namespace AzToolsFramework
#include "ViewportTitleDlg.moc"
#include
diff --git a/Code/Editor/ViewportTitleDlg.h b/Code/Editor/ViewportTitleDlg.h
index a3e19837b4..ba3dba858a 100644
--- a/Code/Editor/ViewportTitleDlg.h
+++ b/Code/Editor/ViewportTitleDlg.h
@@ -80,7 +80,6 @@ protected:
void OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_PTR lparam) override;
void OnMaximize();
- void OnToggleHelpers();
void UpdateDisplayInfo();
void SetupCameraDropdownMenu();
@@ -153,6 +152,9 @@ protected:
QMenu* m_aspectMenu = nullptr;
QMenu* m_resolutionMenu = nullptr;
QMenu* m_viewportInformationMenu = nullptr;
+ QMenu* m_helpersMenu = nullptr;
+ QAction* m_helpersAction = nullptr;
+ QAction* m_iconsAction = nullptr;
QAction* m_noInformationAction = nullptr;
QAction* m_normalInformationAction = nullptr;
QAction* m_fullInformationAction = nullptr;
diff --git a/Code/Editor/editor_lib_files.cmake b/Code/Editor/editor_lib_files.cmake
index fa627176d8..a018333925 100644
--- a/Code/Editor/editor_lib_files.cmake
+++ b/Code/Editor/editor_lib_files.cmake
@@ -297,8 +297,6 @@ set(FILES
Util/AffineParts.cpp
Objects/BaseObject.cpp
Objects/BaseObject.h
- Animation/AnimationBipedBoneNames.cpp
- Animation/AnimationBipedBoneNames.h
AnimationContext.cpp
AnimationContext.h
AzAssetBrowser/AzAssetBrowserRequestHandler.cpp
@@ -336,23 +334,12 @@ set(FILES
Controls/ConsoleSCB.qrc
Controls/FolderTreeCtrl.cpp
Controls/FolderTreeCtrl.h
- Controls/HotTrackingTreeCtrl.cpp
- Controls/HotTrackingTreeCtrl.h
Controls/ImageHistogramCtrl.cpp
Controls/ImageHistogramCtrl.h
- Controls/ImageListCtrl.cpp
- Controls/ImageListCtrl.h
- Controls/MultiMonHelper.cpp
- Controls/MultiMonHelper.h
- Controls/NumberCtrl.cpp
- Controls/NumberCtrl.h
- Controls/NumberCtrl.h
Controls/SplineCtrl.cpp
Controls/SplineCtrl.h
Controls/SplineCtrlEx.cpp
Controls/SplineCtrlEx.h
- Controls/TextEditorCtrl.cpp
- Controls/TextEditorCtrl.h
Controls/TimelineCtrl.cpp
Controls/TimelineCtrl.h
Controls/WndGridHelper.h
@@ -526,8 +513,6 @@ set(FILES
PythonEditorFuncs.h
QtUI/QCollapsibleGroupBox.h
QtUI/QCollapsibleGroupBox.cpp
- QtUI/ClickableLabel.h
- QtUI/ClickableLabel.cpp
QtUI/PixmapLabelPreview.h
QtUI/PixmapLabelPreview.cpp
QtUI/WaitCursor.h
@@ -800,9 +785,6 @@ set(FILES
ViewportTitleDlg.h
EditorEnvironment.cpp
EditorEnvironment.h
- IEditorPanelUtils.h
- EditorPanelUtils.h
- EditorPanelUtils.cpp
)
diff --git a/Code/Editor/editor_lib_test_files.cmake b/Code/Editor/editor_lib_test_files.cmake
index 17f36228db..5b66357c41 100644
--- a/Code/Editor/editor_lib_test_files.cmake
+++ b/Code/Editor/editor_lib_test_files.cmake
@@ -8,7 +8,6 @@
set(FILES
Lib/Tests/IEditorMock.h
- Lib/Tests/test_ClickableLabel.cpp
Lib/Tests/test_CryEditPythonBindings.cpp
Lib/Tests/test_CryEditDocPythonBindings.cpp
Lib/Tests/test_EditorPythonBindings.cpp
diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h b/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h
index 2459764e52..e4d2c7612e 100644
--- a/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h
+++ b/Code/Framework/AzCore/AzCore/Asset/AssetCommon.h
@@ -168,7 +168,7 @@ namespace AZ
virtual bool IsRegisterReadonlyAndShareable() { return true; }
/**
- * Override this function to control automatic reload behavior.
+ * Override this function to control automatic reload behavior.
* By default, the asset will reload automatically.
* Return false to disable automatic reload. Potential use cases include:
* 1, If an asset is dependent on a parent asset(i.e.both assets need to be reloaded as a group) the parent asset can explicitly reload the child.
@@ -200,10 +200,10 @@ namespace AZ
AssetHandler* m_registeredHandler{ nullptr };
- // This is used to identify a unique asset and should only be set by the asset manager
+ // This is used to identify a unique asset and should only be set by the asset manager
// and therefore does not need to be atomic.
// All shared copy of an asset should have the same identifier and therefore
- // should not be modified while making copy of an existing asset.
+ // should not be modified while making copy of an existing asset.
int m_creationToken = s_defaultCreationToken;
// General purpose flags that should only be accessed within the asset mutex
AZStd::bitset<32> m_flags;
@@ -430,7 +430,7 @@ namespace AZ
*/
void UpgradeAssetInfo();
- /**
+ /**
* for debugging purposes - creates a string that represents the assets id, subid, hint, and name.
* You should use this function for any time you want to show the full details of an asset in a log message
* as it will always produce a consistent output string. By convention, don't surround the output of this call
@@ -586,26 +586,26 @@ namespace AZ
/// Called when an asset is loaded, patched and ready to be used.
virtual void OnAssetReady(Asset asset) { (void)asset; }
-
+
/// Called when an asset has been moved (usually due to de-fragmentation/compaction), if possible the only data pointer is provided otherwise NULL.
virtual void OnAssetMoved(Asset asset, void* oldDataPointer) { (void)asset; (void)oldDataPointer; }
-
+
/// Called before an asset reload has started.
virtual void OnAssetPreReload(Asset asset) { (void)asset; }
-
+
/// Called when an asset has been reloaded (usually in tool mode and loose more). It should not be called in final build.
virtual void OnAssetReloaded(Asset asset) { (void)asset; }
-
+
/// Called when an asset failed to reload.
virtual void OnAssetReloadError(Asset asset) { (void)asset; }
-
+
/// Called when an asset has been saved. In general most assets can't be saved (in a game) so make sure you check the flag.
virtual void OnAssetSaved(Asset asset, bool isSuccessful) { (void)asset; (void)isSuccessful; }
-
+
/// Called when an asset is unloaded.
virtual void OnAssetUnloaded(const AssetId assetId, const AssetType assetType) { (void)assetId; (void)assetType; }
-
- /**
+
+ /**
* Called when an error happened with an asset. When this message is received the asset should be considered broken by default.
* Note that this can happen when the asset errors during load, but also happens when the asset is missing (not in catalog etc.)
* in the case of an asset that is completely missing, the Asset passed in here will have no hint or other information about
@@ -1094,7 +1094,7 @@ namespace AZ
// if we are a different asset (or being swapped with a empty) then we just swap as usual.
AZStd::swap(m_assetHint, rhs.m_assetHint);
}
-
+
}
//=========================================================================
@@ -1218,7 +1218,7 @@ namespace AZ
/// Indiscriminately skips all asset references.
bool AssetFilterNoAssetLoading(const AssetFilterInfo& filterInfo);
- // Shared ProductDependency concepts between AP and LY
+ // Shared ProductDependency concepts between AP and LY
namespace ProductDependencyInfo
{
//! Corresponds to all ProductDependencyFlags, not just LoadBehaviors
diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp
index 305ec0617b..4794b04626 100644
--- a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp
+++ b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.cpp
@@ -83,7 +83,7 @@ namespace AZ::Data
AZ_PROFILE_SCOPE(AzCore, "AZ::Data::LoadAssetDataStreamCallback %s",
m_filePath.c_str());
- // Get the results
+ // Get the results
auto streamer = AZ::Interface::Get();
AZ::u64 bytesRead = 0;
streamer->GetReadRequestResult(fileHandle, m_buffer, bytesRead,
diff --git a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h
index d2b069b55b..79822c8db2 100644
--- a/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h
+++ b/Code/Framework/AzCore/AzCore/Asset/AssetDataStream.h
@@ -100,7 +100,7 @@ namespace AZ::Data
//! The path and file name of the asset being loaded
AZStd::string m_filePath;
- //! The offset into the file to start loading at.
+ //! The offset into the file to start loading at.
size_t m_fileOffset{ 0 };
//! The amount of data that's expected to be loaded.
diff --git a/Code/Framework/AzCore/AzCore/Component/Entity.cpp b/Code/Framework/AzCore/AzCore/Component/Entity.cpp
index 0fe201d448..c5cda98f2c 100644
--- a/Code/Framework/AzCore/AzCore/Component/Entity.cpp
+++ b/Code/Framework/AzCore/AzCore/Component/Entity.cpp
@@ -811,12 +811,12 @@ namespace AZ
if (behaviorContext)
{
behaviorContext->Class()
- ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
+ ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Attribute(AZ::Script::Attributes::Storage, AZ::Script::Attributes::StorageType::Value)
->Attribute(AZ::Script::Attributes::Scope, AZ::Script::Attributes::ScopeFlags::Common)
->Attribute(AZ::Script::Attributes::Module, "entity")
->Method("IsValid", &EntityId::IsValid)
- ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
+ ->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::ListOnly)
->Method("ToString", &EntityId::ToString)
->Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
->Attribute(AZ::Script::Attributes::ExcludeFrom, AZ::Script::Attributes::ExcludeFlags::All)
diff --git a/Code/Framework/AzCore/AzCore/Console/Console.cpp b/Code/Framework/AzCore/AzCore/Console/Console.cpp
index d6781e1370..ff7a08e127 100644
--- a/Code/Framework/AzCore/AzCore/Console/Console.cpp
+++ b/Code/Framework/AzCore/AzCore/Console/Console.cpp
@@ -243,7 +243,7 @@ namespace AZ
if (StringFunc::StartsWith(curr->m_name, command, false))
{
- AZLOG_INFO("- %s : %s\n", curr->m_name, curr->m_desc);
+ AZLOG_INFO("- %s : %s", curr->m_name, curr->m_desc);
if (commandSubset.size() < MaxConsoleCommandPlusArgsLength)
{
@@ -433,29 +433,29 @@ namespace AZ
{
if ((curr->GetFlags() & requiredSet) != requiredSet)
{
- AZLOG_WARN("%s failed required set flag check\n", curr->m_name);
+ AZLOG_WARN("%s failed required set flag check", curr->m_name);
continue;
}
if ((curr->GetFlags() & requiredClear) != ConsoleFunctorFlags::Null)
{
- AZLOG_WARN("%s failed required clear flag check\n", curr->m_name);
+ AZLOG_WARN("%s failed required clear flag check", curr->m_name);
continue;
}
if ((curr->GetFlags() & ConsoleFunctorFlags::IsCheat) != ConsoleFunctorFlags::Null)
{
- AZLOG_WARN("%s is marked as a cheat\n", curr->m_name);
+ AZLOG_WARN("%s is marked as a cheat", curr->m_name);
}
if ((curr->GetFlags() & ConsoleFunctorFlags::IsDeprecated) != ConsoleFunctorFlags::Null)
{
- AZLOG_WARN("%s is marked as deprecated\n", curr->m_name);
+ AZLOG_WARN("%s is marked as deprecated", curr->m_name);
}
if ((curr->GetFlags() & ConsoleFunctorFlags::NeedsReload) != ConsoleFunctorFlags::Null)
{
- AZLOG_WARN("Changes to %s will only take effect after level reload\n", curr->m_name);
+ AZLOG_WARN("Changes to %s will only take effect after level reload", curr->m_name);
}
// Letting this intentionally fall-through, since in editor we can register common variables multiple times
@@ -468,7 +468,7 @@ namespace AZ
{
CVarFixedString value;
curr->GetValue(value);
- AZLOG_INFO("> %s : %s\n", curr->GetName(), value.empty() ? "" : value.c_str());
+ AZLOG_INFO("> %s : %s", curr->GetName(), value.empty() ? "" : value.c_str());
}
flags = curr->GetFlags();
}
diff --git a/Code/Framework/AzCore/AzCore/Console/LoggerSystemComponent.cpp b/Code/Framework/AzCore/AzCore/Console/LoggerSystemComponent.cpp
index 4d00443186..2794dfdc40 100644
--- a/Code/Framework/AzCore/AzCore/Console/LoggerSystemComponent.cpp
+++ b/Code/Framework/AzCore/AzCore/Console/LoggerSystemComponent.cpp
@@ -119,25 +119,21 @@ namespace AZ
void LoggerSystemComponent::LogInternalV(LogLevel level, const char* format, const char* file, const char* function, int32_t line, va_list args)
{
constexpr AZStd::size_t MaxLogBufferSize = 1000;
- char buffer[MaxLogBufferSize];
+ auto buffer = AZStd::fixed_string::format_arg(format, args);
+ m_logEvent.Signal(level, buffer.c_str(), file, function, line);
+ buffer += '\n';
- const AZStd::size_t length = azvsnprintf(buffer, MaxLogBufferSize, format, args);
- buffer[AZStd::min(length + 1, MaxLogBufferSize - 1)] = '\0';
- m_logEvent.Signal(level, buffer, file, function, line);
-
- // Force a new-line before calling the AZ::Debug::Trace functions, as they assume a newline is present
- buffer[AZStd::min(length + 1, MaxLogBufferSize - 2)] = '\n';
switch (level)
{
case LogLevel::Warn:
- AZ_Warning("Logger", true, buffer);
+ AZ_Warning("Logger", true, buffer.c_str());
break;
case LogLevel::Error:
- AZ_Error("Logger", true, buffer);
+ AZ_Error("Logger", true, buffer.c_str());
break;
default:
// Catch all else with trace
- AZ::Debug::Trace::Output("Logger", buffer);
+ AZ::Debug::Trace::Output("Logger", buffer.c_str());
break;
}
}
diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.h b/Code/Framework/AzCore/AzCore/IO/Path/Path.h
index 094dee16f2..7f89809294 100644
--- a/Code/Framework/AzCore/AzCore/IO/Path/Path.h
+++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.h
@@ -484,6 +484,7 @@ namespace AZ::IO
// as_posix
//! Replicates the behavior of the Python pathlib as_posix method
//! by replacing the Windows Path Separator with the Posix Path Seperator
+ constexpr string_type AsPosix() const;
AZStd::string StringAsPosix() const;
constexpr AZStd::fixed_string FixedMaxPathStringAsPosix() const noexcept;
diff --git a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl
index 5ac15fc728..0dc1799528 100644
--- a/Code/Framework/AzCore/AzCore/IO/Path/Path.inl
+++ b/Code/Framework/AzCore/AzCore/IO/Path/Path.inl
@@ -1043,6 +1043,13 @@ namespace AZ::IO
// as_posix
// Returns a copy of the path with the path separators converted to PosixPathSeparator
template
+ constexpr auto BasicPath::AsPosix() const -> string_type
+ {
+ string_type resultPath(m_path.begin(), m_path.end());
+ AZStd::replace(resultPath.begin(), resultPath.end(), WindowsPathSeparator, PosixPathSeparator);
+ return resultPath;
+ }
+ template
AZStd::string BasicPath::StringAsPosix() const
{
AZStd::string resultPath(m_path.begin(), m_path.end());
diff --git a/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp b/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp
index 55a991f19f..1d0cdba66c 100644
--- a/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp
+++ b/Code/Framework/AzCore/AzCore/IO/Path/PathReflect.cpp
@@ -7,6 +7,8 @@
*/
#include
+#include
+#include
#include
#include
@@ -35,10 +37,8 @@ namespace AZ::IO
size_t Save(const void* classPtr, IO::GenericStream& stream, bool) override
{
/// Save paths out using the PosixPathSeparator
- PathType path(reinterpret_cast(classPtr)->Native(), AZ::IO::PosixPathSeparator);
- path.MakePreferred();
-
- return static_cast(stream.Write(path.Native().size(), path.c_str()));
+ auto posixPathString{ reinterpret_cast(classPtr)->AsPosix() };
+ return static_cast(stream.Write(posixPathString.size(), posixPathString.c_str()));
}
bool Load(void* classPtr, IO::GenericStream& stream, unsigned int, bool) override
@@ -73,5 +73,11 @@ namespace AZ::IO
AZ::SerializeContext::IDataSerializer::CreateDefaultDeleteDeleter() })
;
}
+ else if (auto jsonContext = azrtti_cast(context))
+ {
+ jsonContext->Serializer()
+ ->HandlesType()
+ ->HandlesType();
+ }
}
}
diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h
index 209721f9d9..90fb7ea193 100644
--- a/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h
+++ b/Code/Framework/AzCore/AzCore/IO/Streamer/BlockCache.h
@@ -19,144 +19,144 @@
#include
#include
-namespace AZ
+namespace AZ::IO
{
- namespace IO
+ struct BlockCacheConfig final :
+ public IStreamerStackConfig
{
- struct BlockCacheConfig final :
- public IStreamerStackConfig
+ AZ_RTTI(AZ::IO::BlockCacheConfig, "{70120525-88A4-40B6-A75B-BAA7E8FD77F3}", IStreamerStackConfig);
+ AZ_CLASS_ALLOCATOR(BlockCacheConfig, AZ::SystemAllocator, 0);
+
+ ~BlockCacheConfig() override = default;
+ AZStd::shared_ptr AddStreamStackEntry(
+ const HardwareInformation& hardware, AZStd::shared_ptr parent) override;
+ static void Reflect(AZ::ReflectContext* context);
+
+ //! Dynamic options for the blocks size.
+ //! It's possible to set static sizes or use the names from this enum to have AZ::IO::Streamer automatically fill in the sizes.
+ //! Fixed sizes are set through the Settings Registry with "BlockSize": 524288, while dynamic values are set like
+ //! "BlockSize": "MemoryAlignment". In the latter case AZ::IO::Streamer will use the available hardware information and fill
+ //! in the actual value.
+ enum BlockSize : u32
{
- AZ_RTTI(AZ::IO::BlockCacheConfig, "{70120525-88A4-40B6-A75B-BAA7E8FD77F3}", IStreamerStackConfig);
- AZ_CLASS_ALLOCATOR(BlockCacheConfig, AZ::SystemAllocator, 0);
-
- ~BlockCacheConfig() override = default;
- AZStd::shared_ptr AddStreamStackEntry(
- const HardwareInformation& hardware, AZStd::shared_ptr parent) override;
- static void Reflect(AZ::ReflectContext* context);
-
- //! Dynamic options for the blocks size.
- //! It's possible to set static sizes or use the names from this enum to have AZ::IO::Streamer automatically fill in the sizes.
- //! Fixed sizes are set through the Settings Registry with "BlockSize": 524288, while dynamic values are set like
- //! "BlockSize": "MemoryAlignment". In the latter case AZ::IO::Streamer will use the available hardware information and fill
- //! in the actual value.
- enum BlockSize : u32
- {
- MaxTransfer = AZStd::numeric_limits::max(), //!< The largest possible block size.
- MemoryAlignment = MaxTransfer - 1, //!< The size of the minimal memory requirement of the storage device.
- SizeAlignment = MemoryAlignment - 1 //!< The minimal read size required by the storage device.
- };
-
- //! The overall size of the cache in megabytes.
- u32 m_cacheSizeMib{ 8 };
- //! The size of the individual blocks inside the cache.
- BlockSize m_blockSize{ BlockSize::MemoryAlignment };
+ MaxTransfer = AZStd::numeric_limits::max(), //!< The largest possible block size.
+ MemoryAlignment = MaxTransfer - 1, //!< The size of the minimal memory requirement of the storage device.
+ SizeAlignment = MemoryAlignment - 1 //!< The minimal read size required by the storage device.
};
- class BlockCache
- : public StreamStackEntry
+ //! The overall size of the cache in megabytes.
+ u32 m_cacheSizeMib{ 8 };
+ //! The size of the individual blocks inside the cache.
+ BlockSize m_blockSize{ BlockSize::MemoryAlignment };
+ };
+
+ class BlockCache
+ : public StreamStackEntry
+ {
+ public:
+ BlockCache(u64 cacheSize, u32 blockSize, u32 alignment, bool onlyEpilogWrites);
+ BlockCache(BlockCache&& rhs) = delete;
+ BlockCache(const BlockCache& rhs) = delete;
+ ~BlockCache() override;
+
+ BlockCache& operator=(BlockCache&& rhs) = delete;
+ BlockCache& operator=(const BlockCache& rhs) = delete;
+
+ void QueueRequest(FileRequest* request) override;
+ bool ExecuteRequests() override;
+
+ void UpdateStatus(Status& status) const override;
+ void UpdateCompletionEstimates(AZStd::chrono::system_clock::time_point now, AZStd::vector& internalPending,
+ StreamerContext::PreparedQueue::iterator pendingBegin, StreamerContext::PreparedQueue::iterator pendingEnd) override;
+ void AddDelayedRequests(AZStd::vector& internalPending);
+ void UpdatePendingRequestEstimations();
+
+ void FlushCache(const RequestPath& filePath);
+ void FlushEntireCache();
+
+ void CollectStatistics(AZStd::vector& statistics) const override;
+
+ double CalculateHitRatePercentage() const;
+ double CalculateCacheableRatePercentage() const;
+ s32 CalculateAvailableRequestSlots() const;
+
+ protected:
+ static constexpr u32 s_fileNotCached = static_cast(-1);
+
+ enum class CacheResult
+ {
+ ReadFromCache, //!< Data was found in the cache and reused.
+ CacheMiss, //!< Data wasn't found in the cache and no sub request was queued.
+ Queued, //!< A sub request was created or appended and queued for processing on the next entry in the streamer stack.
+ Delayed //!< There's no more room to queue a new request, so delay the request until a slot becomes available.
+ };
+
+ struct Section
{
- public:
- BlockCache(u64 cacheSize, u32 blockSize, u32 alignment, bool onlyEpilogWrites);
- BlockCache(BlockCache&& rhs) = delete;
- BlockCache(const BlockCache& rhs) = delete;
- ~BlockCache() override;
-
- BlockCache& operator=(BlockCache&& rhs) = delete;
- BlockCache& operator=(const BlockCache& rhs) = delete;
-
- void QueueRequest(FileRequest* request) override;
- bool ExecuteRequests() override;
-
- void UpdateStatus(Status& status) const override;
- void UpdateCompletionEstimates(AZStd::chrono::system_clock::time_point now, AZStd::vector& internalPending,
- StreamerContext::PreparedQueue::iterator pendingBegin, StreamerContext::PreparedQueue::iterator pendingEnd) override;
- void AddDelayedRequests(AZStd::vector& internalPending);
- void UpdatePendingRequestEstimations();
-
- void FlushCache(const RequestPath& filePath);
- void FlushEntireCache();
-
- void CollectStatistics(AZStd::vector& statistics) const override;
-
- double CalculateHitRatePercentage() const;
- double CalculateCacheableRatePercentage() const;
- s32 CalculateAvailableRequestSlots() const;
-
- protected:
- static constexpr u32 s_fileNotCached = static_cast(-1);
-
- enum class CacheResult
- {
- ReadFromCache, //!< Data was found in the cache and reused.
- CacheMiss, //!< Data wasn't found in the cache and no sub request was queued.
- Queued, //!< A sub request was created or appended and queued for processing on the next entry in the streamer stack.
- Delayed //!< There's no more room to queue a new request, so delay the request until a slot becomes available.
- };
-
- struct Section
- {
- u8* m_output{ nullptr }; //!< The buffer to write the data to.
- FileRequest* m_parent{ nullptr }; //!< If set, the file request that is split up by this section.
- FileRequest* m_wait{ nullptr }; //!< If set, this contains a "wait"-operation that blocks an operation chain from continuing until this section has been loaded.
- u64 m_readOffset{ 0 }; //!< Offset into the file to start reading from.
- u64 m_readSize{ 0 }; //!< Number of bytes to read from file.
- u64 m_blockOffset{ 0 }; //!< Offset into the cache block to start copying from.
- u64 m_copySize{ 0 }; //!< Number of bytes to copy from cache.
- u32 m_cacheBlockIndex{ s_fileNotCached }; //!< If assigned, the index of the cache block assigned to this section.
- bool m_used{ false }; //!< Whether or not this section is used in further processing.
-
- // Add the provided section in front of this one.
- void Prefix(const Section& section);
- };
-
- using TimePoint = AZStd::chrono::system_clock::time_point;
-
- void ReadFile(FileRequest* request, FileRequest::ReadData& data);
- void ContinueReadFile(FileRequest* request, u64 fileLength);
- CacheResult ReadFromCache(FileRequest* request, Section& section, const RequestPath& filePath);
- CacheResult ReadFromCache(FileRequest* request, Section& section, u32 cacheBlock);
- CacheResult ServiceFromCache(FileRequest* request, Section& section, const RequestPath& filePath, bool sharedRead);
- void CompleteRead(FileRequest& request);
- bool SplitRequest(Section& prolog, Section& main, Section& epilog, const RequestPath& filePath, u64 fileLength,
- u64 offset, u64 size, u8* buffer) const;
-
- u8* GetCacheBlockData(u32 index);
- void TouchBlock(u32 index);
- AZ::u32 RecycleOldestBlock(const RequestPath& filePath, u64 offset);
- u32 FindInCache(const RequestPath& filePath, u64 offset) const;
- bool IsCacheBlockInFlight(u32 index) const;
- void ResetCacheEntry(u32 index);
- void ResetCache();
-
- //! Map of the file requests that are being processed and the sections of the parent requests they'll complete.
- AZStd::unordered_multimap m_pendingRequests;
- //! List of file sections that were delayed because the cache was full.
- AZStd::deque m_delayedSections;
-
- AZ::Statistics::RunningStatistic m_hitRateStat;
- AZ::Statistics::RunningStatistic m_cacheableStat;
-
- u8* m_cache;
- u64 m_cacheSize;
- u32 m_blockSize;
- u32 m_alignment;
- u32 m_numBlocks;
- s32 m_numInFlightRequests{ 0 };
- //! The file path associated with a cache block.
- AZStd::unique_ptr m_cachedPaths; // Array of m_numBlocks size.
- //! The offset into the file the cache blocks starts at.
- AZStd::unique_ptr m_cachedOffsets; // Array of m_numBlocks size.
- //! The last time the cache block was read from.
- AZStd::unique_ptr m_blockLastTouched; // Array of m_numBlocks size.
- //! The file request that's currently read data into the cache block. If null, the block has been read.
- AZStd::unique_ptr m_inFlightRequests; // Array of m_numbBlocks size.
-
- //! The number of requests waiting for meta data to be retrieved.
- s32 m_numMetaDataRetrievalInProgress{ 0 };
- //! Whether or not only the epilog ever writes to the cache.
- bool m_onlyEpilogWrites;
+ u8* m_output{ nullptr }; //!< The buffer to write the data to.
+ FileRequest* m_parent{ nullptr }; //!< If set, the file request that is split up by this section.
+ FileRequest* m_wait{ nullptr }; //!< If set, this contains a "wait"-operation that blocks an operation chain from continuing until this section has been loaded.
+ u64 m_readOffset{ 0 }; //!< Offset into the file to start reading from.
+ u64 m_readSize{ 0 }; //!< Number of bytes to read from file.
+ u64 m_blockOffset{ 0 }; //!< Offset into the cache block to start copying from.
+ u64 m_copySize{ 0 }; //!< Number of bytes to copy from cache.
+ u32 m_cacheBlockIndex{ s_fileNotCached }; //!< If assigned, the index of the cache block assigned to this section.
+ bool m_used{ false }; //!< Whether or not this section is used in further processing.
+
+ // Add the provided section in front of this one.
+ void Prefix(const Section& section);
};
- } // namespace IO
+ using TimePoint = AZStd::chrono::system_clock::time_point;
+
+ void ReadFile(FileRequest* request, FileRequest::ReadData& data);
+ void ContinueReadFile(FileRequest* request, u64 fileLength);
+ CacheResult ReadFromCache(FileRequest* request, Section& section, const RequestPath& filePath);
+ CacheResult ReadFromCache(FileRequest* request, Section& section, u32 cacheBlock);
+ CacheResult ServiceFromCache(FileRequest* request, Section& section, const RequestPath& filePath, bool sharedRead);
+ void CompleteRead(FileRequest& request);
+ bool SplitRequest(Section& prolog, Section& main, Section& epilog, const RequestPath& filePath, u64 fileLength,
+ u64 offset, u64 size, u8* buffer) const;
+
+ u8* GetCacheBlockData(u32 index);
+ void TouchBlock(u32 index);
+ AZ::u32 RecycleOldestBlock(const RequestPath& filePath, u64 offset);
+ u32 FindInCache(const RequestPath& filePath, u64 offset) const;
+ bool IsCacheBlockInFlight(u32 index) const;
+ void ResetCacheEntry(u32 index);
+ void ResetCache();
+
+ //! Map of the file requests that are being processed and the sections of the parent requests they'll complete.
+ AZStd::unordered_multimap m_pendingRequests;
+ //! List of file sections that were delayed because the cache was full.
+ AZStd::deque m_delayedSections;
+
+ AZ::Statistics::RunningStatistic m_hitRateStat;
+ AZ::Statistics::RunningStatistic m_cacheableStat;
+
+ u8* m_cache;
+ u64 m_cacheSize;
+ u32 m_blockSize;
+ u32 m_alignment;
+ u32 m_numBlocks;
+ s32 m_numInFlightRequests{ 0 };
+ //! The file path associated with a cache block.
+ AZStd::unique_ptr m_cachedPaths; // Array of m_numBlocks size.
+ //! The offset into the file the cache blocks starts at.
+ AZStd::unique_ptr m_cachedOffsets; // Array of m_numBlocks size.
+ //! The last time the cache block was read from.
+ AZStd::unique_ptr m_blockLastTouched; // Array of m_numBlocks size.
+ //! The file request that's currently read data into the cache block. If null, the block has been read.
+ AZStd::unique_ptr m_inFlightRequests; // Array of m_numbBlocks size.
+
+ //! The number of requests waiting for meta data to be retrieved.
+ s32 m_numMetaDataRetrievalInProgress{ 0 };
+ //! Whether or not only the epilog ever writes to the cache.
+ bool m_onlyEpilogWrites;
+ };
+} // namespace AZ::IO
+
+namespace AZ
+{
AZ_TYPE_INFO_SPECIALIZE(AZ::IO::BlockCacheConfig::BlockSize, "{5D4D597D-4605-462D-A27D-8046115C5381}");
} // namespace AZ
diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h
index 84ec091eaa..0ef2d879d3 100644
--- a/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h
+++ b/Code/Framework/AzCore/AzCore/IO/Streamer/DedicatedCache.h
@@ -18,77 +18,74 @@
#include
#include
-namespace AZ
+namespace AZ::IO
{
- namespace IO
+ struct DedicatedCacheConfig final :
+ public IStreamerStackConfig
{
- struct DedicatedCacheConfig final :
- public IStreamerStackConfig
- {
- AZ_RTTI(AZ::IO::DedicatedCacheConfig, "{DF0F6029-02B0-464C-9846-524654335BCC}", IStreamerStackConfig);
- AZ_CLASS_ALLOCATOR(DedicatedCacheConfig, AZ::SystemAllocator, 0);
-
- ~DedicatedCacheConfig() override = default;
- AZStd::shared_ptr AddStreamStackEntry(
- const HardwareInformation& hardware, AZStd::shared_ptr parent) override;
- static void Reflect(AZ::ReflectContext* context);
-
- //! The size of the individual blocks inside the cache.
- BlockCacheConfig::BlockSize m_blockSize{ BlockCacheConfig::BlockSize::MemoryAlignment };
- //! The overall size of the cache in megabytes.
- u32 m_cacheSizeMib{ 8 };
- //! If true, only the epilog is written otherwise the prolog and epilog are written. In either case both prolog and epilog are read.
- //! For uses of the cache that read mostly sequentially this flag should be set to true. If reads are more random than it's better
- //! to set this flag to false.
- bool m_writeOnlyEpilog{ true };
- };
-
- class DedicatedCache
- : public StreamStackEntry
- {
- public:
- DedicatedCache(u64 cacheSize, u32 blockSize, u32 alignment, bool onlyEpilogWrites);
-
- void SetNext(AZStd::shared_ptr next) override;
- void SetContext(StreamerContext& context) override;
-
- void PrepareRequest(FileRequest* request) override;
- void QueueRequest(FileRequest* request) override;
- bool ExecuteRequests() override;
-
- void UpdateStatus(Status& status) const override;
-
- void UpdateCompletionEstimates(AZStd::chrono::system_clock::time_point now, AZStd::vector& internalPending,
- StreamerContext::PreparedQueue::iterator pendingBegin, StreamerContext::PreparedQueue::iterator pendingEnd) override;
-
- void CollectStatistics(AZStd::vector& statistics) const override;
-
- private:
- void CreateDedicatedCache(FileRequest* request, FileRequest::CreateDedicatedCacheData& data);
- void DestroyDedicatedCache(FileRequest* request, FileRequest::DestroyDedicatedCacheData& data);
-
- void ReadFile(FileRequest* request, FileRequest::ReadData& data);
- size_t FindCache(const RequestPath& filename, FileRange range);
- size_t FindCache(const RequestPath& filename, u64 offset);
-
- void FlushCache(const RequestPath& filePath);
- void FlushEntireCache();
-
- AZStd::vector m_cachedFileNames;
- AZStd::vector m_cachedFileRanges;
- AZStd::vector> m_cachedFileCaches;
- AZStd::vector m_cachedFileRefCounts;
-
- AZ::Statistics::RunningStatistic m_usagePercentageStat;
+ AZ_RTTI(AZ::IO::DedicatedCacheConfig, "{DF0F6029-02B0-464C-9846-524654335BCC}", IStreamerStackConfig);
+ AZ_CLASS_ALLOCATOR(DedicatedCacheConfig, AZ::SystemAllocator, 0);
+
+ ~DedicatedCacheConfig() override = default;
+ AZStd::shared_ptr AddStreamStackEntry(
+ const HardwareInformation& hardware, AZStd::shared_ptr parent) override;
+ static void Reflect(AZ::ReflectContext* context);
+
+ //! The size of the individual blocks inside the cache.
+ BlockCacheConfig::BlockSize m_blockSize{ BlockCacheConfig::BlockSize::MemoryAlignment };
+ //! The overall size of the cache in megabytes.
+ u32 m_cacheSizeMib{ 8 };
+ //! If true, only the epilog is written otherwise the prolog and epilog are written. In either case both prolog and epilog are read.
+ //! For uses of the cache that read mostly sequentially this flag should be set to true. If reads are more random than it's better
+ //! to set this flag to false.
+ bool m_writeOnlyEpilog{ true };
+ };
+
+ class DedicatedCache
+ : public StreamStackEntry
+ {
+ public:
+ DedicatedCache(u64 cacheSize, u32 blockSize, u32 alignment, bool onlyEpilogWrites);
+
+ void SetNext(AZStd::shared_ptr next) override;
+ void SetContext(StreamerContext& context) override;
+
+ void PrepareRequest(FileRequest* request) override;
+ void QueueRequest(FileRequest* request) override;
+ bool ExecuteRequests() override;
+
+ void UpdateStatus(Status& status) const override;
+
+ void UpdateCompletionEstimates(AZStd::chrono::system_clock::time_point now, AZStd::vector& internalPending,
+ StreamerContext::PreparedQueue::iterator pendingBegin, StreamerContext::PreparedQueue::iterator pendingEnd) override;
+
+ void CollectStatistics(AZStd::vector& statistics) const override;
+
+ private:
+ void CreateDedicatedCache(FileRequest* request, FileRequest::CreateDedicatedCacheData& data);
+ void DestroyDedicatedCache(FileRequest* request, FileRequest::DestroyDedicatedCacheData& data);
+
+ void ReadFile(FileRequest* request, FileRequest::ReadData& data);
+ size_t FindCache(const RequestPath& filename, FileRange range);
+ size_t FindCache(const RequestPath& filename, u64 offset);
+
+ void FlushCache(const RequestPath& filePath);
+ void FlushEntireCache();
+
+ AZStd::vector m_cachedFileNames;
+ AZStd::vector m_cachedFileRanges;
+ AZStd::vector> m_cachedFileCaches;
+ AZStd::vector m_cachedFileRefCounts;
+
+ AZ::Statistics::RunningStatistic m_usagePercentageStat;
#if AZ_STREAMER_ADD_EXTRA_PROFILING_INFO
- AZ::Statistics::RunningStatistic m_overallHitRateStat;
- AZ::Statistics::RunningStatistic m_overallCacheableRateStat;
+ AZ::Statistics::RunningStatistic m_overallHitRateStat;
+ AZ::Statistics::RunningStatistic m_overallCacheableRateStat;
#endif
- u64 m_cacheSize;
- u32 m_alignment;
- u32 m_blockSize;
- bool m_onlyEpilogWrites;
- };
- } // namespace IO
-} // namespace AZ
+ u64 m_cacheSize;
+ u32 m_alignment;
+ u32 m_blockSize;
+ bool m_onlyEpilogWrites;
+ };
+} // namespace AZ::IO
diff --git a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h
index 387884d781..dd4dad2387 100644
--- a/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h
+++ b/Code/Framework/AzCore/AzCore/IO/Streamer/FileRequest.h
@@ -21,403 +21,401 @@
#include
#include
-namespace AZ
+namespace AZ::IO
{
- namespace IO
- {
- class StreamStackEntry;
- class ExternalFileRequest;
+ class StreamStackEntry;
+ class ExternalFileRequest;
- using FileRequestPtr = AZStd::intrusive_ptr;
-
- class FileRequest final
- {
- public:
- inline constexpr static AZStd::chrono::system_clock::time_point s_noDeadlineTime = AZStd::chrono::system_clock::time_point::max();
+ using FileRequestPtr = AZStd::intrusive_ptr;
- friend class StreamerContext;
- friend class ExternalFileRequest;
+ class FileRequest final
+ {
+ public:
+ inline constexpr static AZStd::chrono::system_clock::time_point s_noDeadlineTime = AZStd::chrono::system_clock::time_point::max();
- //! Stores a reference to the external request so it stays alive while the request is being processed.
- //! This is needed because Streamer supports fire-and-forget requests since completion can be handled by
- //! registering a callback.
- struct ExternalRequestData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
- inline constexpr static bool s_failWhenUnhandled = true;
+ friend class StreamerContext;
+ friend class ExternalFileRequest;
- explicit ExternalRequestData(FileRequestPtr&& request);
-
- FileRequestPtr m_request; //!< The request that was send to Streamer.
- };
+ //! Stores a reference to the external request so it stays alive while the request is being processed.
+ //! This is needed because Streamer supports fire-and-forget requests since completion can be handled by
+ //! registering a callback.
+ struct ExternalRequestData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
+ inline constexpr static bool s_failWhenUnhandled = true;
- //! Stores an instance of a RequestPath. To reduce copying instances of a RequestPath functions that
- //! need a path take them by reference to the original request. In some cases a path originates from
- //! within in the stack and temporary storage is needed. This struct allows for that temporary storage
- //! so it can be safely referenced later.
- struct RequestPathStoreData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
- inline constexpr static bool s_failWhenUnhandled = true;
+ explicit ExternalRequestData(FileRequestPtr&& request);
- explicit RequestPathStoreData(RequestPath path);
+ FileRequestPtr m_request; //!< The request that was send to Streamer.
+ };
- RequestPath m_path;
- };
+ //! Stores an instance of a RequestPath. To reduce copying instances of a RequestPath functions that
+ //! need a path take them by reference to the original request. In some cases a path originates from
+ //! within in the stack and temporary storage is needed. This struct allows for that temporary storage
+ //! so it can be safely referenced later.
+ struct RequestPathStoreData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
+ inline constexpr static bool s_failWhenUnhandled = true;
- //! Request to read data. This is an untranslated request and holds a relative path. The Scheduler
- //! will translate this to the appropriate ReadData or CompressedReadData.
- struct ReadRequestData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
- inline constexpr static bool s_failWhenUnhandled = true;
-
- ReadRequestData(RequestPath path, void* output, u64 outputSize, u64 offset, u64 size,
- AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority);
- ReadRequestData(RequestPath path, IStreamerTypes::RequestMemoryAllocator* allocator, u64 offset, u64 size,
- AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority);
- ~ReadRequestData();
-
- RequestPath m_path; //!< Relative path to the target file.
- IStreamerTypes::RequestMemoryAllocator* m_allocator; //!< Allocator used to manage the memory for this request.
- AZStd::chrono::system_clock::time_point m_deadline; //!< Time by which this request should have been completed.
- void* m_output; //!< The memory address assigned (during processing) to store the read data to.
- u64 m_outputSize; //!< The memory size of the addressed used to store the read data.
- u64 m_offset; //!< The offset in bytes into the file.
- u64 m_size; //!< The number of bytes to read from the file.
- IStreamerTypes::Priority m_priority; //!< Priority used for ordering requests. This is used when requests have the same deadline.
- IStreamerTypes::MemoryType m_memoryType; //!< The type of memory provided by the allocator if used.
- };
+ explicit RequestPathStoreData(RequestPath path);
- //! Request to read data. This is a translated request and holds an absolute path and has been
- //! resolved to the archive file if needed.
- struct ReadData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
- inline constexpr static bool s_failWhenUnhandled = true;
+ RequestPath m_path;
+ };
- ReadData(void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead);
+ //! Request to read data. This is an untranslated request and holds a relative path. The Scheduler
+ //! will translate this to the appropriate ReadData or CompressedReadData.
+ struct ReadRequestData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
+ inline constexpr static bool s_failWhenUnhandled = true;
- const RequestPath& m_path; //!< The path to the file that contains the requested data.
- void* m_output; //!< Target output to write the read data to.
- u64 m_outputSize; //!< Size of memory m_output points to. This needs to be at least as big as m_size, but can be bigger.
- u64 m_offset; //!< The offset in bytes into the file.
- u64 m_size; //!< The number of bytes to read from the file.
- bool m_sharedRead; //!< True if other code will be reading from the file or the stack entry can exclusively lock.
- };
+ ReadRequestData(RequestPath path, void* output, u64 outputSize, u64 offset, u64 size,
+ AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority);
+ ReadRequestData(RequestPath path, IStreamerTypes::RequestMemoryAllocator* allocator, u64 offset, u64 size,
+ AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority);
+ ~ReadRequestData();
+
+ RequestPath m_path; //!< Relative path to the target file.
+ IStreamerTypes::RequestMemoryAllocator* m_allocator; //!< Allocator used to manage the memory for this request.
+ AZStd::chrono::system_clock::time_point m_deadline; //!< Time by which this request should have been completed.
+ void* m_output; //!< The memory address assigned (during processing) to store the read data to.
+ u64 m_outputSize; //!< The memory size of the addressed used to store the read data.
+ u64 m_offset; //!< The offset in bytes into the file.
+ u64 m_size; //!< The number of bytes to read from the file.
+ IStreamerTypes::Priority m_priority; //!< Priority used for ordering requests. This is used when requests have the same deadline.
+ IStreamerTypes::MemoryType m_memoryType; //!< The type of memory provided by the allocator if used.
+ };
- //! Request to read and decompress data.
- struct CompressedReadData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
- inline constexpr static bool s_failWhenUnhandled = true;
+ //! Request to read data. This is a translated request and holds an absolute path and has been
+ //! resolved to the archive file if needed.
+ struct ReadData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
+ inline constexpr static bool s_failWhenUnhandled = true;
- CompressedReadData(CompressionInfo&& compressionInfo, void* output, u64 readOffset, u64 readSize);
+ ReadData(void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead);
- CompressionInfo m_compressionInfo;
- void* m_output; //!< Target output to write the read data to.
- u64 m_readOffset; //!< The offset into the decompressed to start copying from.
- u64 m_readSize; //!< Number of bytes to read from the decompressed file.
- };
+ const RequestPath& m_path; //!< The path to the file that contains the requested data.
+ void* m_output; //!< Target output to write the read data to.
+ u64 m_outputSize; //!< Size of memory m_output points to. This needs to be at least as big as m_size, but can be bigger.
+ u64 m_offset; //!< The offset in bytes into the file.
+ u64 m_size; //!< The number of bytes to read from the file.
+ bool m_sharedRead; //!< True if other code will be reading from the file or the stack entry can exclusively lock.
+ };
- //! Holds the progress of an operation chain until this request is explicitly completed.
- struct WaitData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
- inline constexpr static bool s_failWhenUnhandled = true;
- };
+ //! Request to read and decompress data.
+ struct CompressedReadData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
+ inline constexpr static bool s_failWhenUnhandled = true;
- //! Checks to see if any node in the stack can find a file at the provided path.
- struct FileExistsCheckData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
- inline constexpr static bool s_failWhenUnhandled = false;
+ CompressedReadData(CompressionInfo&& compressionInfo, void* output, u64 readOffset, u64 readSize);
- explicit FileExistsCheckData(const RequestPath& path);
+ CompressionInfo m_compressionInfo;
+ void* m_output; //!< Target output to write the read data to.
+ u64 m_readOffset; //!< The offset into the decompressed to start copying from.
+ u64 m_readSize; //!< Number of bytes to read from the decompressed file.
+ };
- const RequestPath& m_path;
- bool m_found{ false };
- };
+ //! Holds the progress of an operation chain until this request is explicitly completed.
+ struct WaitData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
+ inline constexpr static bool s_failWhenUnhandled = true;
+ };
- //! Searches for a file in the stack and retrieves the meta data. This may be slower than a file exists
- //! check.
- struct FileMetaDataRetrievalData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
- inline constexpr static bool s_failWhenUnhandled = false;
+ //! Checks to see if any node in the stack can find a file at the provided path.
+ struct FileExistsCheckData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
+ inline constexpr static bool s_failWhenUnhandled = false;
- explicit FileMetaDataRetrievalData(const RequestPath& path);
+ explicit FileExistsCheckData(const RequestPath& path);
- const RequestPath& m_path;
- u64 m_fileSize{ 0 };
- bool m_found{ false };
- };
+ const RequestPath& m_path;
+ bool m_found{ false };
+ };
- //! Cancels a request in the stream stack, if possible.
- struct CancelData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHighest;
- inline constexpr static bool s_failWhenUnhandled = false;
+ //! Searches for a file in the stack and retrieves the meta data. This may be slower than a file exists
+ //! check.
+ struct FileMetaDataRetrievalData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
+ inline constexpr static bool s_failWhenUnhandled = false;
- explicit CancelData(FileRequestPtr target);
+ explicit FileMetaDataRetrievalData(const RequestPath& path);
- FileRequestPtr m_target; //!< The request that will be canceled.
- };
+ const RequestPath& m_path;
+ u64 m_fileSize{ 0 };
+ bool m_found{ false };
+ };
- //! Updates the priority and deadline of a request that has not been queued yet.
- struct RescheduleData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
- inline constexpr static bool s_failWhenUnhandled = false;
+ //! Cancels a request in the stream stack, if possible.
+ struct CancelData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHighest;
+ inline constexpr static bool s_failWhenUnhandled = false;
- RescheduleData(FileRequestPtr target, AZStd::chrono::system_clock::time_point newDeadline, IStreamerTypes::Priority newPriority);
+ explicit CancelData(FileRequestPtr target);
- FileRequestPtr m_target; //!< The request that will be rescheduled.
- AZStd::chrono::system_clock::time_point m_newDeadline; //!< The new deadline for the request.
- IStreamerTypes::Priority m_newPriority; //!< The new priority for the request.
- };
+ FileRequestPtr m_target; //!< The request that will be canceled.
+ };
- //! Flushes all references to the provided file in the streaming stack.
- struct FlushData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
- inline constexpr static bool s_failWhenUnhandled = false;
+ //! Updates the priority and deadline of a request that has not been queued yet.
+ struct RescheduleData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
+ inline constexpr static bool s_failWhenUnhandled = false;
- explicit FlushData(RequestPath path);
+ RescheduleData(FileRequestPtr target, AZStd::chrono::system_clock::time_point newDeadline, IStreamerTypes::Priority newPriority);
- RequestPath m_path;
- };
+ FileRequestPtr m_target; //!< The request that will be rescheduled.
+ AZStd::chrono::system_clock::time_point m_newDeadline; //!< The new deadline for the request.
+ IStreamerTypes::Priority m_newPriority; //!< The new priority for the request.
+ };
- //! Flushes all caches in the streaming stack.
- struct FlushAllData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
- inline constexpr static bool s_failWhenUnhandled = false;
- };
+ //! Flushes all references to the provided file in the streaming stack.
+ struct FlushData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
+ inline constexpr static bool s_failWhenUnhandled = false;
- //! Creates a cache dedicated to a single file. This is best used for files where blocks are read from
- //! periodically such as audio banks of video files.
- struct CreateDedicatedCacheData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
- inline constexpr static bool s_failWhenUnhandled = false;
+ explicit FlushData(RequestPath path);
- CreateDedicatedCacheData(RequestPath path, const FileRange& range);
+ RequestPath m_path;
+ };
- RequestPath m_path;
- FileRange m_range;
- };
+ //! Flushes all caches in the streaming stack.
+ struct FlushAllData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
+ inline constexpr static bool s_failWhenUnhandled = false;
+ };
- //! Destroys a cache dedicated to a single file that was previously created by CreateDedicatedCache
- struct DestroyDedicatedCacheData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
- inline constexpr static bool s_failWhenUnhandled = false;
+ //! Creates a cache dedicated to a single file. This is best used for files where blocks are read from
+ //! periodically such as audio banks of video files.
+ struct CreateDedicatedCacheData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
+ inline constexpr static bool s_failWhenUnhandled = false;
- DestroyDedicatedCacheData(RequestPath path, const FileRange& range);
+ CreateDedicatedCacheData(RequestPath path, const FileRange& range);
- RequestPath m_path;
- FileRange m_range;
- };
+ RequestPath m_path;
+ FileRange m_range;
+ };
- struct ReportData
- {
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityLow;
- inline constexpr static bool s_failWhenUnhandled = false;
+ //! Destroys a cache dedicated to a single file that was previously created by CreateDedicatedCache
+ struct DestroyDedicatedCacheData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityHigh;
+ inline constexpr static bool s_failWhenUnhandled = false;
- enum class ReportType
- {
- FileLocks
- };
+ DestroyDedicatedCacheData(RequestPath path, const FileRange& range);
- explicit ReportData(ReportType reportType);
+ RequestPath m_path;
+ FileRange m_range;
+ };
- ReportType m_reportType;
- };
+ struct ReportData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityLow;
+ inline constexpr static bool s_failWhenUnhandled = false;
- //! Data for a custom command. This can be used by nodes added extensions that need data that can't be stored
- //! in the already provided data.
- struct CustomData
+ enum class ReportType
{
- inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
-
- CustomData(AZStd::any data, bool failWhenUnhandled);
-
- AZStd::any m_data; //!< The data for the custom request.
- bool m_failWhenUnhandled; //!< Whether or not the request is marked as failed or success when no node process it.
+ FileLocks
};
- using CommandVariant = AZStd::variant;
- using OnCompletionCallback = AZStd::function;
+ explicit ReportData(ReportType reportType);
- AZ_CLASS_ALLOCATOR(FileRequest, SystemAllocator, 0);
+ ReportType m_reportType;
+ };
- enum class Usage : u8
- {
- Internal,
- External
- };
+ //! Data for a custom command. This can be used by nodes added extensions that need data that can't be stored
+ //! in the already provided data.
+ struct CustomData
+ {
+ inline constexpr static IStreamerTypes::Priority s_orderPriority = IStreamerTypes::s_priorityMedium;
- void CreateRequestLink(FileRequestPtr&& request);
- void CreateRequestPathStore(FileRequest* parent, RequestPath path);
- void CreateReadRequest(RequestPath path, void* output, u64 outputSize, u64 offset, u64 size,
- AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority);
- void CreateReadRequest(RequestPath path, IStreamerTypes::RequestMemoryAllocator* allocator, u64 offset, u64 size,
- AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority);
- void CreateRead(FileRequest* parent, void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead = false);
- void CreateCompressedRead(FileRequest* parent, const CompressionInfo& compressionInfo, void* output,
- u64 readOffset, u64 readSize);
- void CreateCompressedRead(FileRequest* parent, CompressionInfo&& compressionInfo, void* output,
- u64 readOffset, u64 readSize);
- void CreateWait(FileRequest* parent);
- void CreateFileExistsCheck(const RequestPath& path);
- void CreateFileMetaDataRetrieval(const RequestPath& path);
- void CreateCancel(FileRequestPtr target);
- void CreateReschedule(FileRequestPtr target, AZStd::chrono::system_clock::time_point newDeadline, IStreamerTypes::Priority newPriority);
- void CreateFlush(RequestPath path);
- void CreateFlushAll();
- void CreateDedicatedCacheCreation(RequestPath path, const FileRange& range = {}, FileRequest* parent = nullptr);
- void CreateDedicatedCacheDestruction(RequestPath path, const FileRange& range = {}, FileRequest* parent = nullptr);
- void CreateReport(ReportData::ReportType reportType);
- void CreateCustom(AZStd::any data, bool failWhenUnhandled = true, FileRequest* parent = nullptr);
-
- void SetCompletionCallback(OnCompletionCallback callback);
-
- CommandVariant& GetCommand();
- const CommandVariant& GetCommand() const;
-
- IStreamerTypes::RequestStatus GetStatus() const;
- void SetStatus(IStreamerTypes::RequestStatus newStatus);
- FileRequest* GetParent();
- const FileRequest* GetParent() const;
- size_t GetNumDependencies() const;
- static constexpr size_t GetMaxNumDependencies();
- //! Whether or not this request should fail if no node in the chain has picked up the request.
- bool FailsWhenUnhandled() const;
-
- //! Checks the chain of request for the provided command. Returns the command if found, otherwise null.
- template T* GetCommandFromChain();
- //! Checks the chain of request for the provided command. Returns the command if found, otherwise null.
- template const T* GetCommandFromChain() const;
-
- //! Determines if this request is contributing to the external request.
- bool WorksOn(FileRequestPtr& request) const;
-
- //! Returns the id that's assigned to the request when it was added to the pending queue.
- //! The id will always increment so a smaller id means it was originally queued earlier.
- size_t GetPendingId() const;
-
- //! Set the estimated completion time for this request and it's immediate parent. The general approach
- //! to getting the final estimation is to bubble up the estimation, with ever entry in the stack adding
- //! it's own additional delay.
- void SetEstimatedCompletion(AZStd::chrono::system_clock::time_point time);
- AZStd::chrono::system_clock::time_point GetEstimatedCompletion() const;
-
- private:
- explicit FileRequest(Usage usage = Usage::Internal);
- ~FileRequest();
-
- void Reset();
- void SetOptionalParent(FileRequest* parent);
-
- inline static void OnCompletionPlaceholder(const FileRequest& /*request*/) {}
-
- //! Command and parameters for the request.
- CommandVariant m_command;
-
- //! Status of the request.
- AZStd::atomic m_status{ IStreamerTypes::RequestStatus::Pending };
-
- //! Called once the request has completed. This will always be called from the Streamer thread
- //! and thread safety is the responsibility of called function. When assigning a lambda avoid
- //! capturing a FileRequestPtr by value as this will cause a circular reference which causes
- //! the FileRequestPtr to never be released and causes a memory leak. This call will
- //! block the main Streamer thread until it returns so callbacks should be kept short. If
- //! a longer running task is needed consider using a job to do the work.
- OnCompletionCallback m_onCompletion;
-
- //! Estimated time this request will complete. This is an estimation and depends on many
- //! factors which can cause it to change drastically from moment to moment.
- AZStd::chrono::system_clock::time_point m_estimatedCompletion;
-
- //! The file request that has a dependency on this one. This can be null if there are no
- //! other request depending on this one to complete.
- FileRequest* m_parent{ nullptr };
-
- //! Id assigned when the request is added to the pending queue.
- size_t m_pendingId{ 0 };
-
- //! The number of dependent file request that need to complete before this one is done.
- u16 m_dependencies{ 0 };
-
- //! Internal request. If this is true the request is created inside the streaming stack and never
- //! leaves it. If true it will automatically be maintained by the scheduler, if false than it's
- //! up to the owner to recycle this request.
- Usage m_usage{ Usage::Internal };
-
- //! Whether or not this request is currently in a recycle bin. This allows detecting double deletes.
- bool m_inRecycleBin{ false };
+ CustomData(AZStd::any data, bool failWhenUnhandled);
+
+ AZStd::any m_data; //!< The data for the custom request.
+ bool m_failWhenUnhandled; //!< Whether or not the request is marked as failed or success when no node process it.
};
- class StreamerContext;
- class FileRequestHandle;
+ using CommandVariant = AZStd::variant;
+ using OnCompletionCallback = AZStd::function;
- //! ExternalFileRequest is a wrapper around the FileRequest so it's safe to use outside the
- //! Streaming Stack. The main differences are that ExternalFileRequest is used in a thread-safe
- //! context and it doesn't get automatically destroyed upon completion. Instead intrusive_ptr is
- //! used to handle clean up.
- class ExternalFileRequest final
- {
- friend struct AZStd::IntrusivePtrCountPolicy;
- friend class FileRequestHandle;
- friend class FileRequest;
- friend class Streamer;
- friend class StreamerContext;
- friend class Scheduler;
- friend class Device;
- friend bool operator==(const FileRequestHandle& lhs, const FileRequestPtr& rhs);
-
- public:
- AZ_CLASS_ALLOCATOR(ExternalFileRequest, SystemAllocator, 0);
-
- explicit ExternalFileRequest(StreamerContext* owner);
-
- private:
- void add_ref();
- void release();
-
- FileRequest m_request;
- AZStd::atomic_uint64_t m_refCount{ 0 };
- StreamerContext* m_owner;
- };
+ AZ_CLASS_ALLOCATOR(FileRequest, SystemAllocator, 0);
- class FileRequestHandle
+ enum class Usage : u8
{
- public:
- friend class Streamer;
- friend bool operator==(const FileRequestHandle& lhs, const FileRequestPtr& rhs);
-
- // Intentional cast operator.
- FileRequestHandle(FileRequest& request)
- : m_request(&request)
- {}
-
- // Intentional cast operator.
- FileRequestHandle(const FileRequestPtr& request)
- : m_request(request ? &request->m_request : nullptr)
- {}
-
- private:
- FileRequest* m_request;
+ Internal,
+ External
};
- bool operator==(const FileRequestHandle& lhs, const FileRequestPtr& rhs);
- bool operator==(const FileRequestPtr& lhs, const FileRequestHandle& rhs);
- bool operator!=(const FileRequestHandle& lhs, const FileRequestPtr& rhs);
- bool operator!=(const FileRequestPtr& lhs, const FileRequestHandle& rhs);
- } // namespace IO
-} // namespace AZ
+ void CreateRequestLink(FileRequestPtr&& request);
+ void CreateRequestPathStore(FileRequest* parent, RequestPath path);
+ void CreateReadRequest(RequestPath path, void* output, u64 outputSize, u64 offset, u64 size,
+ AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority);
+ void CreateReadRequest(RequestPath path, IStreamerTypes::RequestMemoryAllocator* allocator, u64 offset, u64 size,
+ AZStd::chrono::system_clock::time_point deadline, IStreamerTypes::Priority priority);
+ void CreateRead(FileRequest* parent, void* output, u64 outputSize, const RequestPath& path, u64 offset, u64 size, bool sharedRead = false);
+ void CreateCompressedRead(FileRequest* parent, const CompressionInfo& compressionInfo, void* output,
+ u64 readOffset, u64 readSize);
+ void CreateCompressedRead(FileRequest* parent, CompressionInfo&& compressionInfo, void* output,
+ u64 readOffset, u64 readSize);
+ void CreateWait(FileRequest* parent);
+ void CreateFileExistsCheck(const RequestPath& path);
+ void CreateFileMetaDataRetrieval(const RequestPath& path);
+ void CreateCancel(FileRequestPtr target);
+ void CreateReschedule(FileRequestPtr target, AZStd::chrono::system_clock::time_point newDeadline, IStreamerTypes::Priority newPriority);
+ void CreateFlush(RequestPath path);
+ void CreateFlushAll();
+ void CreateDedicatedCacheCreation(RequestPath path, const FileRange& range = {}, FileRequest* parent = nullptr);
+ void CreateDedicatedCacheDestruction(RequestPath path, const FileRange& range = {}, FileRequest* parent = nullptr);
+ void CreateReport(ReportData::ReportType reportType);
+ void CreateCustom(AZStd::any data, bool failWhenUnhandled = true, FileRequest* parent = nullptr);
+
+ void SetCompletionCallback(OnCompletionCallback callback);
+
+ CommandVariant& GetCommand();
+ const CommandVariant& GetCommand() const;
+
+ IStreamerTypes::RequestStatus GetStatus() const;
+ void SetStatus(IStreamerTypes::RequestStatus newStatus);
+ FileRequest* GetParent();
+ const FileRequest* GetParent() const;
+ size_t GetNumDependencies() const;
+ static constexpr size_t GetMaxNumDependencies();
+ //! Whether or not this request should fail if no node in the chain has picked up the request.
+ bool FailsWhenUnhandled() const;
+
+ //! Checks the chain of request for the provided command. Returns the command if found, otherwise null.
+ template T* GetCommandFromChain();
+ //! Checks the chain of request for the provided command. Returns the command if found, otherwise null.
+ template