- 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 a90b0a597a..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();
diff --git a/Code/Editor/CryEdit.cpp b/Code/Editor/CryEdit.cpp
index 4415308730..1c4e22b99e 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
@@ -1352,8 +1352,27 @@ void CCryEditApp::CompileCriticalAssets() const
}
}
assetsInQueueNotifcation.BusDisconnect();
- CCryEditApp::OutputStartupMessage(QString("Asset Processor is now ready."));
+ // Signal the "CriticalAssetsCompiled" lifecycle event
+ // Also reload the "assetcatalog.xml" if it exists
+ if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
+ {
+ AZ::ComponentApplicationLifecycle::SignalEvent(*settingsRegistry, "CriticalAssetsCompiled", R"({})");
+ // Reload the assetcatalog.xml at this point again
+ // Start Monitoring Asset changes over the network and load the AssetCatalog
+ auto LoadCatalog = [settingsRegistry](AZ::Data::AssetCatalogRequests* assetCatalogRequests)
+ {
+ if (AZ::IO::FixedMaxPath assetCatalogPath;
+ settingsRegistry->Get(assetCatalogPath.Native(), AZ::SettingsRegistryMergeUtils::FilePathKey_CacheRootFolder))
+ {
+ assetCatalogPath /= "assetcatalog.xml";
+ assetCatalogRequests->LoadCatalog(assetCatalogPath.c_str());
+ }
+ };
+ AZ::Data::AssetCatalogRequestBus::Broadcast(AZStd::move(LoadCatalog));
+ }
+
+ CCryEditApp::OutputStartupMessage(QString("Asset Processor is now ready."));
}
bool CCryEditApp::ConnectToAssetProcessor() const
@@ -1669,7 +1688,7 @@ bool CCryEditApp::InitInstance()
return false;
}
- if (AZ::SettingsRegistryInterface* settingsRegistry = AZ::SettingsRegistry::Get())
+ if (auto settingsRegistry = AZ::SettingsRegistry::Get(); settingsRegistry != nullptr)
{
AZ::ComponentApplicationLifecycle::SignalEvent(*settingsRegistry, "LegacySystemInterfaceCreated", R"({})");
}
@@ -2629,6 +2648,7 @@ void CCryEditApp::OnFileEditLogFile()
CFileUtil::EditTextFile(CLogFile::GetLogFileName(), 0, IFileUtil::FILE_TYPE_SCRIPT);
}
+#ifdef ENABLE_SLICE_EDITOR
void CCryEditApp::OnFileResaveSlices()
{
AZStd::vector sliceAssetInfos;
@@ -2759,6 +2779,7 @@ void CCryEditApp::OnFileResaveSlices()
}
}
+#endif
//////////////////////////////////////////////////////////////////////////
void CCryEditApp::OnFileEditEditorini()
diff --git a/Code/Editor/EditMode/DeepSelection.cpp b/Code/Editor/EditMode/DeepSelection.cpp
deleted file mode 100644
index 3e232a230c..0000000000
--- a/Code/Editor/EditMode/DeepSelection.cpp
+++ /dev/null
@@ -1,138 +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 "DeepSelection.h"
-
-// Editor
-#include "Objects/BaseObject.h"
-
-
-//! Functor for sorting selected objects on deep selection mode.
-struct NearDistance
-{
- NearDistance(){}
- bool operator()(const CDeepSelection::RayHitObject& lhs, const CDeepSelection::RayHitObject& rhs) const
- {
- return lhs.distance < rhs.distance;
- }
-};
-
-//-----------------------------------------------------------------------------
-CDeepSelection::CDeepSelection()
- : m_Mode(DSM_NONE)
- , m_previousMode(DSM_NONE)
- , m_CandidateObjectCount(0)
- , m_CurrentSelectedPos(-1)
-{
- m_LastPickPoint = QPoint(-1, -1);
-}
-
-//-----------------------------------------------------------------------------
-CDeepSelection::~CDeepSelection()
-{
-}
-
-//-----------------------------------------------------------------------------
-void CDeepSelection::Reset(bool bResetLastPick)
-{
- for (int i = 0; i < m_CandidateObjectCount; ++i)
- {
- m_RayHitObjects[i].object->ClearFlags(OBJFLAG_NO_HITTEST);
- }
-
- m_CandidateObjectCount = 0;
- m_CurrentSelectedPos = -1;
-
- m_RayHitObjects.clear();
-
- if (bResetLastPick)
- {
- m_LastPickPoint = QPoint(-1, -1);
- }
-}
-
-//-----------------------------------------------------------------------------
-void CDeepSelection::AddObject(float distance, CBaseObject* pObj)
-{
- m_RayHitObjects.push_back(RayHitObject(distance, pObj));
-}
-
-//-----------------------------------------------------------------------------
-bool CDeepSelection::OnCycling (const QPoint& pt)
-{
- QPoint diff = m_LastPickPoint - pt;
- LONG epsilon = 2;
- m_LastPickPoint = pt;
-
- if (abs(diff.x()) < epsilon && abs(diff.y()) < epsilon)
- {
- return true;
- }
- else
- {
- return false;
- }
-}
-
-//-----------------------------------------------------------------------------
-void CDeepSelection::ExcludeHitTest(int except)
-{
- int nExcept = except % m_CandidateObjectCount;
-
- for (int i = 0; i < m_CandidateObjectCount; ++i)
- {
- m_RayHitObjects[i].object->SetFlags(OBJFLAG_NO_HITTEST);
- }
-
- m_RayHitObjects[nExcept].object->ClearFlags(OBJFLAG_NO_HITTEST);
-}
-
-//-----------------------------------------------------------------------------
-int CDeepSelection::CollectCandidate(float fMinDistance, float fRange)
-{
- m_CandidateObjectCount = 0;
-
- if (!m_RayHitObjects.empty())
- {
- std::sort(m_RayHitObjects.begin(), m_RayHitObjects.end(), NearDistance());
-
- for (std::vector::iterator itr = m_RayHitObjects.begin();
- itr != m_RayHitObjects.end(); ++itr)
- {
- if (itr->distance - fMinDistance < fRange)
- {
- ++m_CandidateObjectCount;
- }
- else
- {
- break;
- }
- }
- }
-
- return m_CandidateObjectCount;
-}
-
-//-----------------------------------------------------------------------------
-CBaseObject* CDeepSelection::GetCandidateObject(int index)
-{
- m_CurrentSelectedPos = index % m_CandidateObjectCount;
-
- return m_RayHitObjects[m_CurrentSelectedPos].object;
-}
-
-//-----------------------------------------------------------------------------
-//!
-void CDeepSelection::SetMode(EDeepSelectionMode mode)
-{
- m_previousMode = m_Mode;
- m_Mode = mode;
-}
diff --git a/Code/Editor/EditMode/DeepSelection.h b/Code/Editor/EditMode/DeepSelection.h
deleted file mode 100644
index b6f652abc5..0000000000
--- a/Code/Editor/EditMode/DeepSelection.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-// Description : Deep Selection Header
-
-
-#ifndef CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H
-#define CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H
-#pragma once
-
-class CBaseObject;
-
-//! Deep Selection
-//! Additional output information of HitContext on using "deep selection mode".
-//! At the deep selection mode, it supports second selection pass for easy
-//! selection on crowded area with two different method.
-//! One is to show pop menu of candidate objects list. Another is the cyclic
-//! selection on pick clicking.
-class CDeepSelection
- : public _i_reference_target_t
-{
-public:
- //! Deep Selection Mode Definition
- enum EDeepSelectionMode
- {
- DSM_NONE = 0, // Not using deep selection.
- DSM_POP = 1, // Deep selection mode with pop context menu.
- DSM_CYCLE = 2 // Deep selection mode with cyclic selection on each clinking same point.
- };
-
- //! Subclass for container of the selected object with hit distance.
- struct RayHitObject
- {
- RayHitObject(float dist, CBaseObject* pObj)
- : distance(dist)
- , object(pObj)
- {
- }
-
- float distance;
- CBaseObject* object;
- };
-
- //! Constructor
- CDeepSelection();
- virtual ~CDeepSelection();
-
- void Reset(bool bResetLastPick = false);
- void AddObject(float distance, CBaseObject* pObj);
- //! Check if clicking point is same position with last position,
- //! to decide whether to continue cycling mode.
- bool OnCycling (const QPoint& pt);
- //! All objects in list are excluded for hitting test except one, current selection.
- void ExcludeHitTest(int except);
- void SetMode(EDeepSelectionMode mode);
- inline EDeepSelectionMode GetMode() const { return m_Mode; }
- inline EDeepSelectionMode GetPreviousMode() const { return m_previousMode; }
- //! Collect object in the deep selection range. The distance from the minimum
- //! distance is less than deep selection range.
- int CollectCandidate(float fMinDistance, float fRange);
- //! Return the candidate object in index position, then it is to be current
- //! selection position.
- CBaseObject* GetCandidateObject(int index);
- //! Return the current selection position that is update in "GetCandidateObject"
- //! function call.
- inline int GetCurrentSelectPos() const { return m_CurrentSelectedPos; }
- //! Return the number of objects in the deep selection range.
- inline int GetCandidateObjectCount() const { return m_CandidateObjectCount; }
-
-private:
- //! Current mode
- EDeepSelectionMode m_Mode;
- EDeepSelectionMode m_previousMode;
- //! Last picking point to check whether cyclic selection continue.
- QPoint m_LastPickPoint;
- //! List of the selected objects with ray hitting
- std::vector m_RayHitObjects;
- int m_CandidateObjectCount;
- int m_CurrentSelectedPos;
-};
-#endif // CRYINCLUDE_EDITOR_EDITMODE_DEEPSELECTION_H
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/EditorPreferencesPageAWS.cpp b/Code/Editor/EditorPreferencesPageAWS.cpp
index 68a9d6889f..9279dce7bc 100644
--- a/Code/Editor/EditorPreferencesPageAWS.cpp
+++ b/Code/Editor/EditorPreferencesPageAWS.cpp
@@ -28,7 +28,7 @@ void CEditorPreferencesPage_AWS::Reflect(AZ::SerializeContext& serialize)
if (editContext)
{
editContext->Class("Options", "")
- ->DataElement(AZ::Edit::UIHandlers::CheckBox, &UsageOptions::m_awsAttributionEnabled, "Allow O3DE to send information about your use of AWS Core Gem to AWS",
+ ->DataElement(AZ::Edit::UIHandlers::CheckBox, &UsageOptions::m_awsAttributionEnabled, "Allow O3DE to send information about your use of AWS Core Gem to AWS",
"");
editContext->Class("AWS Preferences", "AWS Preferences")
diff --git a/Code/Editor/EditorPreferencesPageViewportGeneral.cpp b/Code/Editor/EditorPreferencesPageViewportGeneral.cpp
index 77560e24f8..f33cc3f725 100644
--- a/Code/Editor/EditorPreferencesPageViewportGeneral.cpp
+++ b/Code/Editor/EditorPreferencesPageViewportGeneral.cpp
@@ -41,8 +41,6 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria
->Field("ShowBBoxes", &Display::m_showBBoxes)
->Field("DrawEntityLabels", &Display::m_drawEntityLabels)
->Field("ShowTriggerBounds", &Display::m_showTriggerBounds)
- ->Field("ShowIcons", &Display::m_showIcons)
- ->Field("DistanceScaleIcons", &Display::m_distanceScaleIcons)
->Field("ShowFrozenHelpers", &Display::m_showFrozenHelpers)
->Field("FillSelectedShapes", &Display::m_fillSelectedShapes)
->Field("ShowGridGuide", &Display::m_showGridGuide)
@@ -118,10 +116,6 @@ void CEditorPreferencesPage_ViewportGeneral::Reflect(AZ::SerializeContext& seria
AZ::Edit::UIHandlers::CheckBox, &Display::m_drawEntityLabels, "Always Draw Entity Labels", "Always Draw Entity Labels")
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &Display::m_showTriggerBounds, "Always Show Trigger Bounds", "Always Show Trigger Bounds")
- ->DataElement(AZ::Edit::UIHandlers::CheckBox, &Display::m_showIcons, "Show Object Icons", "Show Object Icons")
- ->DataElement(
- AZ::Edit::UIHandlers::CheckBox, &Display::m_distanceScaleIcons, "Scale Object Icons with Distance",
- "Scale Object Icons with Distance")
->DataElement(
AZ::Edit::UIHandlers::CheckBox, &Display::m_showFrozenHelpers, "Show Helpers of Frozen Objects",
"Show Helpers of Frozen Objects")
@@ -244,8 +238,6 @@ void CEditorPreferencesPage_ViewportGeneral::OnApply()
}
gSettings.viewports.bDrawEntityLabels = m_display.m_drawEntityLabels;
gSettings.viewports.bShowTriggerBounds = m_display.m_showTriggerBounds;
- gSettings.viewports.bShowIcons = m_display.m_showIcons;
- gSettings.viewports.bDistanceScaleIcons = m_display.m_distanceScaleIcons;
gSettings.viewports.nShowFrozenHelpers = m_display.m_showFrozenHelpers;
gSettings.viewports.bFillSelectedShapes = m_display.m_fillSelectedShapes;
gSettings.viewports.bShowGridGuide = m_display.m_showGridGuide;
@@ -300,8 +292,6 @@ void CEditorPreferencesPage_ViewportGeneral::InitializeSettings()
m_display.m_showBBoxes = (ds->GetRenderFlags() & RENDER_FLAG_BBOX) == RENDER_FLAG_BBOX;
m_display.m_drawEntityLabels = gSettings.viewports.bDrawEntityLabels;
m_display.m_showTriggerBounds = gSettings.viewports.bShowTriggerBounds;
- m_display.m_showIcons = gSettings.viewports.bShowIcons;
- m_display.m_distanceScaleIcons = gSettings.viewports.bDistanceScaleIcons;
m_display.m_showFrozenHelpers = gSettings.viewports.nShowFrozenHelpers;
m_display.m_fillSelectedShapes = gSettings.viewports.bFillSelectedShapes;
m_display.m_showGridGuide = gSettings.viewports.bShowGridGuide;
diff --git a/Code/Editor/EditorPreferencesPageViewportGeneral.h b/Code/Editor/EditorPreferencesPageViewportGeneral.h
index be89cc6df4..2d2a207d6c 100644
--- a/Code/Editor/EditorPreferencesPageViewportGeneral.h
+++ b/Code/Editor/EditorPreferencesPageViewportGeneral.h
@@ -62,8 +62,6 @@ private:
bool m_showBBoxes;
bool m_drawEntityLabels;
bool m_showTriggerBounds;
- bool m_showIcons;
- bool m_distanceScaleIcons;
bool m_showFrozenHelpers;
bool m_fillSelectedShapes;
bool m_showGridGuide;
diff --git a/Code/Editor/EditorViewportWidget.cpp b/Code/Editor/EditorViewportWidget.cpp
index 754ea84544..a8180bcace 100644
--- a/Code/Editor/EditorViewportWidget.cpp
+++ b/Code/Editor/EditorViewportWidget.cpp
@@ -454,9 +454,6 @@ void EditorViewportWidget::Update()
// Render
{
- // TODO: Move out this logic to a controller and refactor to work with Atom
- ProcessRenderLisneters(m_displayContext);
-
m_displayContext.Flush2D();
// Post Render Callback
@@ -585,11 +582,11 @@ void EditorViewportWidget::OnEditorNotifyEvent(EEditorNotifyEvent event)
case eNotify_OnCloseScene:
m_renderViewport->SetScene(nullptr);
- SetDefaultCamera();
break;
case eNotify_OnEndSceneOpen:
UpdateScene();
+ SetDefaultCamera();
break;
case eNotify_OnBeginNewScene:
@@ -1030,8 +1027,6 @@ void EditorViewportWidget::OnTitleMenu(QMenu* menu)
AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Safe Frame"), &gSettings.viewports.bShowSafeFrame);
AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Construction Plane"), &gSettings.snap.constructPlaneDisplay);
AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Trigger Bounds"), &gSettings.viewports.bShowTriggerBounds);
- AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Icons"), &gSettings.viewports.bShowIcons, &gSettings.viewports.bShowSizeBasedIcons);
- AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Size-based Icons"), &gSettings.viewports.bShowSizeBasedIcons, &gSettings.viewports.bShowIcons);
AZ::ViewportHelpers::AddCheckbox(menu, tr("Show Helpers of Frozen Objects"), &gSettings.viewports.nShowFrozenHelpers);
if (!m_predefinedAspectRatios.IsEmpty())
diff --git a/Code/Editor/ErrorRecorder.cpp b/Code/Editor/ErrorRecorder.cpp
index 999dab323c..253e103527 100644
--- a/Code/Editor/ErrorRecorder.cpp
+++ b/Code/Editor/ErrorRecorder.cpp
@@ -7,7 +7,6 @@
*/
#include "EditorDefs.h"
#include "ErrorRecorder.h"
-#include "BaseLibraryItem.h"
#include "Include/IErrorReport.h"
diff --git a/Code/Editor/ErrorRecorder.h b/Code/Editor/ErrorRecorder.h
index e4b3706a16..beacc3f0e5 100644
--- a/Code/Editor/ErrorRecorder.h
+++ b/Code/Editor/ErrorRecorder.h
@@ -14,6 +14,8 @@
#define CRYINCLUDE_EDITOR_CORE_ERRORRECORDER_H
#pragma once
+#include "Include/EditorCoreAPI.h"
+
//////////////////////////////////////////////////////////////////////////
//! Automatic class to record and display error.
class EDITOR_CORE_API CErrorsRecorder
diff --git a/Code/Editor/ErrorReport.cpp b/Code/Editor/ErrorReport.cpp
index 4fd7d41a96..f93ea7606d 100644
--- a/Code/Editor/ErrorReport.cpp
+++ b/Code/Editor/ErrorReport.cpp
@@ -67,24 +67,6 @@ QString CErrorRecord::GetErrorText() const
{
str += QString("\t ");
}
- if (pItem)
- {
- switch (pItem->GetType())
- {
- case EDB_TYPE_MATERIAL:
- str += QString("\t Material=\"");
- break;
- case EDB_TYPE_PARTICLE:
- str += QString("\t Particle=\"");
- break;
- case EDB_TYPE_MUSIC:
- str += QString("\t Music=\"");
- break;
- default:
- str += QString("\t Item=\"");
- }
- str += pItem->GetFullName() + "\"";
- }
if (pObject)
{
str += QString("\t Object=\"") + pObject->GetName() + "\"";
@@ -101,7 +83,6 @@ CErrorReport::CErrorReport()
m_bImmediateMode = true;
m_bShowErrors = true;
m_pObject = nullptr;
- m_pItem = nullptr;
m_pParticle = nullptr;
}
@@ -140,10 +121,6 @@ void CErrorReport::ReportError(CErrorRecord& err)
{
err.pObject = m_pObject;
}
- else if (err.pItem == nullptr && m_pItem != nullptr)
- {
- err.pItem = m_pItem;
- }
m_errors.push_back(err);
}
bNoRecurse = false;
@@ -255,12 +232,6 @@ void CErrorReport::SetCurrentValidatorObject(CBaseObject* pObject)
m_pObject = pObject;
}
-//////////////////////////////////////////////////////////////////////////
-void CErrorReport::SetCurrentValidatorItem(CBaseLibraryItem* pItem)
-{
- m_pItem = pItem;
-}
-
//////////////////////////////////////////////////////////////////////////
void CErrorReport::SetCurrentFile(const QString& file)
{
diff --git a/Code/Editor/ErrorReport.h b/Code/Editor/ErrorReport.h
index 3b9a860301..98d230e383 100644
--- a/Code/Editor/ErrorReport.h
+++ b/Code/Editor/ErrorReport.h
@@ -17,8 +17,11 @@
// forward declarations.
class CParticleItem;
-#include "BaseLibraryItem.h"
+#include
+#include
+
#include "Objects/BaseObject.h"
+#include "Include/EditorCoreAPI.h"
#include "Include/IErrorReport.h"
#include "ErrorRecorder.h"
@@ -56,16 +59,13 @@ public:
int count;
//! Object that caused this error.
_smart_ptr pObject;
- //! Library Item that caused this error.
- _smart_ptr pItem;
int flags;
CErrorRecord(CBaseObject* object, ESeverity _severity, const QString& _error, int _flags = 0, int _count = 0,
- CBaseLibraryItem* item = 0, EValidatorModule _module = VALIDATOR_MODULE_EDITOR)
+ EValidatorModule _module = VALIDATOR_MODULE_EDITOR)
: severity(_severity)
, module(_module)
, pObject(object)
- , pItem(item)
, flags(_flags)
, count(_count)
, error(_error)
@@ -77,7 +77,6 @@ public:
severity = ESEVERITY_WARNING;
module = VALIDATOR_MODULE_EDITOR;
pObject = 0;
- pItem = 0;
flags = 0;
count = 0;
}
@@ -116,8 +115,6 @@ public:
//! Assign current Object to which new reported warnings are assigned.
void SetCurrentValidatorObject(CBaseObject* pObject);
- //! Assign current Item to which new reported warnings are assigned.
- void SetCurrentValidatorItem(CBaseLibraryItem* pItem);
//! Assign current filename.
void SetCurrentFile(const QString& file);
@@ -127,7 +124,6 @@ private:
bool m_bImmediateMode;
bool m_bShowErrors;
_smart_ptr m_pObject;
- _smart_ptr m_pItem;
CParticleItem* m_pParticle;
QString m_currentFilename;
};
diff --git a/Code/Editor/ErrorReportDialog.cpp b/Code/Editor/ErrorReportDialog.cpp
index 2d551d6c8b..bbeede79ef 100644
--- a/Code/Editor/ErrorReportDialog.cpp
+++ b/Code/Editor/ErrorReportDialog.cpp
@@ -362,10 +362,6 @@ void CErrorReportDialog::CopyToClipboard()
{
str += QString::fromLatin1(" [Object: %1]").arg(pRecord->pObject->GetName());
}
- if (pRecord->pItem)
- {
- str += QString::fromLatin1(" [Material: %1]").arg(pRecord->pItem->GetName());
- }
str += QString::fromLatin1("\r\n");
}
}
diff --git a/Code/Editor/ErrorReportTableModel.cpp b/Code/Editor/ErrorReportTableModel.cpp
index f5dce1a86d..923991bb62 100644
--- a/Code/Editor/ErrorReportTableModel.cpp
+++ b/Code/Editor/ErrorReportTableModel.cpp
@@ -149,11 +149,7 @@ QVariant CErrorReportTableModel::data(const CErrorRecord& record, int column, in
case ColumnFile:
return record.file;
case ColumnObject:
- if (record.pItem)
- {
- return record.pItem->GetFullName();
- }
- else if (record.pObject)
+ if (record.pObject)
{
return record.pObject->GetName();
}
diff --git a/Code/Editor/Geometry/TriMesh.cpp b/Code/Editor/Geometry/TriMesh.cpp
deleted file mode 100644
index efc201095d..0000000000
--- a/Code/Editor/Geometry/TriMesh.cpp
+++ /dev/null
@@ -1,587 +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 "TriMesh.h"
-
-// Editor
-#include "Util/fastlib.h"
-#include "Objects/SubObjSelection.h"
-
-
-//////////////////////////////////////////////////////////////////////////
-CTriMesh::CTriMesh()
-{
- pFaces = nullptr;
- pVertices = nullptr;
- pWSVertices = nullptr;
- pUV = nullptr;
- pColors = nullptr;
- pEdges = nullptr;
- pWeights = nullptr;
-
- nFacesCount = 0;
- nVertCount = 0;
- nUVCount = 0;
- nEdgeCount = 0;
-
- selectionType = SO_ELEM_NONE;
-
- memset(m_streamSize, 0, sizeof(m_streamSize));
- memset(m_streamSel, 0, sizeof(m_streamSel));
- streamSelMask = 0;
-
- m_streamSel[VERTICES] = &vertSel;
- m_streamSel[EDGES] = &edgeSel;
- m_streamSel[FACES] = &faceSel;
-}
-
-//////////////////////////////////////////////////////////////////////////
-CTriMesh::~CTriMesh()
-{
- free(pFaces);
- free(pEdges);
- free(pVertices);
- free(pUV);
- free(pColors);
- free(pWSVertices);
- free(pWeights);
-}
-
-// Set stream size.
-void CTriMesh::ReallocStream(int stream, int nNewCount)
-{
- assert(stream >= 0 && stream < LAST_STREAM);
- if (stream < 0 || stream >= LAST_STREAM)
- {
- return;
- }
- if (m_streamSize[stream] == nNewCount)
- {
- return; // Stream already have required size.
- }
- void* pStream = nullptr;
- int nElementSize = 0;
- GetStreamInfo(stream, pStream, nElementSize);
- pStream = ReAllocElements(pStream, nNewCount, nElementSize);
- m_streamSize[stream] = nNewCount;
-
- switch (stream)
- {
- case VERTICES:
- pVertices = (CTriVertex*)pStream;
- nVertCount = nNewCount;
- vertSel.resize(nNewCount);
- break;
- case FACES:
- pFaces = (CTriFace*)pStream;
- nFacesCount = nNewCount;
- faceSel.resize(nNewCount);
- break;
- case EDGES:
- pEdges = (CTriEdge*)pStream;
- nEdgeCount = nNewCount;
- edgeSel.resize(nNewCount);
- break;
- case TEXCOORDS:
- pUV = (SMeshTexCoord*)pStream;
- nUVCount = nNewCount;
- break;
- case COLORS:
- pColors = (SMeshColor*)pStream;
- break;
- case WEIGHTS:
- pWeights = (float*)pStream;
- break;
- case LINES:
- pLines = (CTriLine*)pStream;
- break;
- case WS_POSITIONS:
- pWSVertices = (Vec3*)pStream;
- break;
- default:
- assert(0); // unknown stream.
- }
- m_streamSize[stream] = nNewCount;
-}
-
-// Set stream size.
-void CTriMesh::GetStreamInfo(int stream, void*& pStream, int& nElementSize) const
-{
- assert(stream >= 0 && stream < LAST_STREAM);
- switch (stream)
- {
- case VERTICES:
- pStream = pVertices;
- nElementSize = sizeof(CTriVertex);
- break;
- case FACES:
- pStream = pFaces;
- nElementSize = sizeof(CTriFace);
- break;
- case EDGES:
- pStream = pEdges;
- nElementSize = sizeof(CTriEdge);
- break;
- case TEXCOORDS:
- pStream = pUV;
- nElementSize = sizeof(SMeshTexCoord);
- break;
- case COLORS:
- pStream = pColors;
- nElementSize = sizeof(SMeshColor);
- break;
- case WEIGHTS:
- pStream = pWeights;
- nElementSize = sizeof(float);
- break;
- case LINES:
- pStream = pLines;
- nElementSize = sizeof(CTriLine);
- break;
- case WS_POSITIONS:
- pStream = pWSVertices;
- nElementSize = sizeof(Vec3);
- break;
- default:
- assert(0); // unknown stream.
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void* CTriMesh::ReAllocElements(void* old_ptr, int new_elem_num, int size_of_element)
-{
- return realloc(old_ptr, new_elem_num * size_of_element);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////
-inline int FindVertexInHash(const Vec3& vPosToFind, const CTriVertex* pVectors, std::vector& hash, float fEpsilon)
-{
- for (uint32 i = 0; i < hash.size(); i++)
- {
- const Vec3& v0 = pVectors[hash[i]].pos;
- const Vec3& v1 = vPosToFind;
- if (fabsf(v0.y - v1.y) < fEpsilon && fabsf(v0.x - v1.x) < fEpsilon && fabsf(v0.z - v1.z) < fEpsilon)
- {
- return hash[i];
- }
- }
- return -1;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////
-inline int FindTexCoordInHash(const SMeshTexCoord& coordToFind, const SMeshTexCoord* pCoords, std::vector& hash, float fEpsilon)
-{
- for (uint32 i = 0; i < hash.size(); i++)
- {
- const SMeshTexCoord& t0 = pCoords[hash[i]];
- const SMeshTexCoord& t1 = coordToFind;
-
- if (t0.IsEquivalent(t1, fEpsilon))
- {
- return hash[i];
- }
- }
- return -1;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-void CTriMesh::SharePositions()
-{
- float fEpsilon = 0.0001f;
- float fHashScale = 256.0f / MAX(bbox.GetSize().GetLength(), fEpsilon);
- std::vector arrHashTable[256];
-
- CTriVertex* pNewVerts = new CTriVertex[GetVertexCount()];
- SMeshColor* pNewColors = nullptr;
- if (pColors)
- {
- pNewColors = new SMeshColor[GetVertexCount()];
- }
-
- int nLastIndex = 0;
- for (int f = 0; f < GetFacesCount(); f++)
- {
- CTriFace& face = pFaces[f];
- for (int i = 0; i < 3; i++)
- {
- const Vec3& v = pVertices[face.v[i]].pos;
- uint8 nHash = static_cast(RoundFloatToInt((v.x + v.y + v.z) * fHashScale));
-
- int find = FindVertexInHash(v, pNewVerts, arrHashTable[nHash], fEpsilon);
- if (find < 0)
- {
- pNewVerts[nLastIndex] = pVertices[face.v[i]];
- if (pColors)
- {
- pNewColors[nLastIndex] = pColors[face.v[i]];
- }
- face.v[i] = nLastIndex;
- // Reserve some space already.
- arrHashTable[nHash].reserve(100);
- arrHashTable[nHash].push_back(nLastIndex);
- nLastIndex++;
- }
- else
- {
- face.v[i] = find;
- }
- }
- }
-
- SetVertexCount(nLastIndex);
- memcpy(pVertices, pNewVerts, nLastIndex * sizeof(CTriVertex));
- delete []pNewVerts;
-
- if (pColors)
- {
- SetColorsCount(nLastIndex);
- memcpy(pColors, pNewColors, nLastIndex * sizeof(SMeshColor));
- delete []pNewColors;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CTriMesh::ShareUV()
-{
- float fEpsilon = 0.0001f;
- float fHashScale = 256.0f;
- std::vector arrHashTable[256];
-
- SMeshTexCoord* pNewUV = new SMeshTexCoord[GetUVCount()];
-
- int nLastIndex = 0;
- for (int f = 0; f < GetFacesCount(); f++)
- {
- CTriFace& face = pFaces[f];
- for (int i = 0; i < 3; i++)
- {
- const Vec2 uv = pUV[face.uv[i]].GetUV();
- uint8 nHash = static_cast(RoundFloatToInt((uv.x + uv.y) * fHashScale));
-
- int find = FindTexCoordInHash(pUV[face.uv[i]], pNewUV, arrHashTable[nHash], fEpsilon);
- if (find < 0)
- {
- pNewUV[nLastIndex] = pUV[face.uv[i]];
- face.uv[i] = nLastIndex;
- arrHashTable[nHash].reserve(100);
- arrHashTable[nHash].push_back(nLastIndex);
- nLastIndex++;
- }
- else
- {
- face.uv[i] = find;
- }
- }
- }
-
- SetUVCount(nLastIndex);
- memcpy(pUV, pNewUV, nLastIndex * sizeof(SMeshTexCoord));
- delete []pNewUV;
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CTriMesh::CalcFaceNormals()
-{
- for (int i = 0; i < nFacesCount; i++)
- {
- CTriFace& face = pFaces[i];
- Vec3 p1 = pVertices[face.v[0]].pos;
- Vec3 p2 = pVertices[face.v[1]].pos;
- Vec3 p3 = pVertices[face.v[2]].pos;
- face.normal = (p2 - p1).Cross(p3 - p1);
- face.normal.Normalize();
- }
-}
-
-#define TEX_EPS 0.001f
-#define VER_EPS 0.001f
-
-//////////////////////////////////////////////////////////////////////////
-void CTriMesh::CopyStream(CTriMesh& fromMesh, int stream)
-{
- void* pTrgStream = nullptr;
- void* pSrcStream = nullptr;
- int nElemSize = 0;
- fromMesh.GetStreamInfo(stream, pSrcStream, nElemSize);
- if (pSrcStream)
- {
- ReallocStream(stream, fromMesh.GetStreamSize(stream));
- GetStreamInfo(stream, pTrgStream, nElemSize);
- memcpy(pTrgStream, pSrcStream, nElemSize * fromMesh.GetStreamSize(stream));
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CTriMesh::Copy(CTriMesh& fromMesh, int nCopyFlags)
-{
- streamSelMask = fromMesh.streamSelMask;
-
- if (nCopyFlags & COPY_VERTICES)
- {
- CopyStream(fromMesh, VERTICES);
- }
- if (nCopyFlags & COPY_FACES)
- {
- CopyStream(fromMesh, FACES);
- }
- if (nCopyFlags & COPY_EDGES)
- {
- CopyStream(fromMesh, EDGES);
- }
- if (nCopyFlags & COPY_TEXCOORDS)
- {
- CopyStream(fromMesh, TEXCOORDS);
- }
- if (nCopyFlags & COPY_COLORS)
- {
- CopyStream(fromMesh, COLORS);
- }
- if (nCopyFlags & COPY_WEIGHTS)
- {
- CopyStream(fromMesh, WEIGHTS);
- }
- if (nCopyFlags & COPY_LINES)
- {
- CopyStream(fromMesh, LINES);
- }
-
- if (nCopyFlags & COPY_VERT_SEL)
- {
- vertSel = fromMesh.vertSel;
- }
- if (nCopyFlags & COPY_EDGE_SEL)
- {
- edgeSel = fromMesh.edgeSel;
- }
- if (nCopyFlags & COPY_FACE_SEL)
- {
- faceSel = fromMesh.faceSel;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CTriMesh::UpdateEdges()
-{
- SetEdgeCount(GetFacesCount() * 3);
-
- std::map edgemap;
-
- int nEdges = 0;
- for (int i = 0; i < GetFacesCount(); i++)
- {
- CTriFace& face = pFaces[i];
- for (int j = 0; j < 3; j++)
- {
- int v0 = j;
- int v1 = (j != 2) ? j + 1 : 0;
- CTriEdge edge;
- edge.flags = 0;
-
- // First vertex index must always be smaller.
- if (face.v[v0] < face.v[v1])
- {
- edge.v[0] = face.v[v0];
- edge.v[1] = face.v[v1];
- }
- else
- {
- edge.v[0] = face.v[v1];
- edge.v[1] = face.v[v0];
- }
- edge.face[0] = i;
- edge.face[1] = -1;
- int nedge = stl::find_in_map(edgemap, edge, -1);
- if (nedge >= 0)
- {
- // Assign this face as a second member of the edge.
- if (pEdges[nedge].face[1] < 0)
- {
- pEdges[nedge].face[1] = i;
- }
-
- face.edge[j] = nedge;
- }
- else
- {
- edgemap[edge] = nEdges;
- pEdges[nEdges] = edge;
- face.edge[j] = nEdges;
- nEdges++;
- }
- }
- }
-
- SetEdgeCount(nEdges);
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CTriMesh::SoftSelection(const SSubObjSelOptions& options)
-{
- int i;
- int nVerts = GetVertexCount();
- CTriVertex* pVerts = pVertices;
-
- for (i = 0; i < nVerts; i++)
- {
- if (pWeights[i] == 1.0f)
- {
- const Vec3& vp = pVerts[i].pos;
- for (int j = 0; j < nVerts; j++)
- {
- if (pWeights[j] != 1.0f)
- {
- if (vp.IsEquivalent(pVerts[j].pos, options.fSoftSelFalloff))
- {
- float fDist = vp.GetDistance(pVerts[j].pos);
- if (fDist < options.fSoftSelFalloff)
- {
- float fWeight = 1.0f - (fDist / options.fSoftSelFalloff);
- if (fWeight > pWeights[j])
- {
- pWeights[j] = fWeight;
- }
- }
- }
- }
- }
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CTriMesh::UpdateSelection()
-{
- bool bAnySelected = false;
- if (selectionType == SO_ELEM_VERTEX)
- {
- for (int i = 0; i < GetVertexCount(); i++)
- {
- if (vertSel[i])
- {
- bAnySelected = true;
- pWeights[i] = 1.0f;
- }
- else
- {
- pWeights[i] = 0;
- }
- }
- }
- if (selectionType == SO_ELEM_EDGE)
- {
- // Clear weights.
- for (int i = 0; i < GetVertexCount(); i++)
- {
- pWeights[i] = 0;
- }
-
- for (int i = 0; i < GetEdgeCount(); i++)
- {
- if (edgeSel[i])
- {
- bAnySelected = true;
- CTriEdge& edge = pEdges[i];
- for (int j = 0; j < 2; j++)
- {
- pWeights[edge.v[j]] = 1.0f;
- }
- }
- }
- }
- else if (selectionType == SO_ELEM_FACE)
- {
- // Clear weights.
- for (int i = 0; i < GetVertexCount(); i++)
- {
- pWeights[i] = 0;
- }
-
- for (int i = 0; i < GetFacesCount(); i++)
- {
- if (faceSel[i])
- {
- bAnySelected = true;
- CTriFace& face = pFaces[i];
- for (int j = 0; j < 3; j++)
- {
- pWeights[face.v[j]] = 1.0f;
- }
- }
- }
- }
- return bAnySelected;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-bool CTriMesh::ClearSelection()
-{
- bool bWasSelected = false;
- // Remove all selections.
- int i;
- for (i = 0; i < GetVertexCount(); i++)
- {
- pWeights[i] = 0;
- }
- streamSelMask = 0;
- for (int ii = 0; ii < LAST_STREAM; ii++)
- {
- if (m_streamSel[ii] && !m_streamSel[ii]->is_zero())
- {
- bWasSelected = true;
- m_streamSel[ii]->clear();
- }
- }
- return bWasSelected;
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CTriMesh::GetEdgesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outEdges)
-{
- // Brute force algorithm using binary search.
- // for every edge check if edge vertex is inside inVertices array.
- std::sort(inVertices.begin(), inVertices.end());
- for (int i = 0; i < GetEdgeCount(); i++)
- {
- if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pEdges[i].v[0])) != inVertices.end())
- {
- outEdges.push_back(i);
- }
- else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pEdges[i].v[1])) != inVertices.end())
- {
- outEdges.push_back(i);
- }
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CTriMesh::GetFacesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outFaces)
-{
- // Brute force algorithm using binary search.
- // for every face check if face vertex is inside inVertices array.
- std::sort(inVertices.begin(), inVertices.end());
- for (int i = 0; i < GetFacesCount(); i++)
- {
- if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[0])) != inVertices.end())
- {
- outFaces.push_back(i);
- }
- else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[1])) != inVertices.end())
- {
- outFaces.push_back(i);
- }
- else if (stl::binary_find(inVertices.begin(), inVertices.end(), static_cast(pFaces[i].v[2])) != inVertices.end())
- {
- outFaces.push_back(i);
- }
- }
-}
diff --git a/Code/Editor/Geometry/TriMesh.h b/Code/Editor/Geometry/TriMesh.h
deleted file mode 100644
index a6c58b8f9d..0000000000
--- a/Code/Editor/Geometry/TriMesh.h
+++ /dev/null
@@ -1,238 +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_EDITOR_GEOMETRY_TRIMESH_H
-#define CRYINCLUDE_EDITOR_GEOMETRY_TRIMESH_H
-#pragma once
-
-#include
-#include "Util/bitarray.h"
-
-struct SSubObjSelOptions;
-
-typedef std::vector MeshElementsArray;
-
-//////////////////////////////////////////////////////////////////////////
-// Vertex used in the TriMesh.
-//////////////////////////////////////////////////////////////////////////
-struct CTriVertex
-{
- Vec3 pos;
- //float weight; // Selection weight in 0-1 range.
-};
-
-//////////////////////////////////////////////////////////////////////////
-// Triangle face used by the Triangle mesh.
-//////////////////////////////////////////////////////////////////////////
-struct CTriFace
-{
- uint32 v[3]; // Indices to vertices array.
- uint32 uv[3]; // Indices to texture coordinates array.
- Vec3 n[3]; // Vertex normals at face vertices.
- Vec3 normal; // Face normal.
- uint32 edge[3]; // Indices to the face edges.
- unsigned char MatID; // Index of face sub material.
- unsigned char flags; // see ETriMeshFlags
-};
-
-//////////////////////////////////////////////////////////////////////////
-// Mesh edge.
-//////////////////////////////////////////////////////////////////////////
-struct CTriEdge
-{
- uint32 v[2]; // Indices to edge vertices.
- int face[2]; // Indices to edge faces (-1 if no face).
- uint32 flags; // see ETriMeshFlags
-
- CTriEdge() {}
- bool operator==(const CTriEdge& edge) const
- {
- if ((v[0] == edge.v[0] && v[1] == edge.v[1]) ||
- (v[0] == edge.v[1] && v[1] == edge.v[0]))
- {
- return true;
- }
- return false;
- }
- bool operator!=(const CTriEdge& edge) const { return !(*this == edge); }
- bool operator<(const CTriEdge& edge) const { return (*(uint64*)v < *(uint64*)edge.v); }
- bool operator>(const CTriEdge& edge) const { return (*(uint64*)v > *(uint64*)edge.v); }
-};
-
-//////////////////////////////////////////////////////////////////////////
-// Mesh line.
-//////////////////////////////////////////////////////////////////////////
-struct CTriLine
-{
- uint32 v[2]; // Indices to edge vertices.
-
- CTriLine() {}
- bool operator==(const CTriLine& edge) const
- {
- if ((v[0] == edge.v[0] && v[1] == edge.v[1]) ||
- (v[0] == edge.v[1] && v[1] == edge.v[0]))
- {
- return true;
- }
- return false;
- }
- bool operator!=(const CTriLine& edge) const { return !(*this == edge); }
- bool operator<(const CTriLine& edge) const { return (*(uint64*)v < *(uint64*)edge.v); }
- bool operator>(const CTriLine& edge) const { return (*(uint64*)v > *(uint64*)edge.v); }
-};
-
-//////////////////////////////////////////////////////////////////////////
-struct CTriMeshPoly
-{
- std::vector v; // Indices to vertices array.
- std::vector uv; // Indices to texture coordinates array.
- std::vector n; // Vertex normals at face vertices.
- Vec3 normal; // Polygon normal.
- uint32 edge[3]; // Indices to the face edges.
- unsigned char MatID; // Index of face sub material.
- unsigned char flags; // optional flags.
-};
-
-//////////////////////////////////////////////////////////////////////////
-// CTriMesh is used in the Editor as a general purpose editable triangle mesh.
-//////////////////////////////////////////////////////////////////////////
-class CTriMesh
-{
-public:
- enum EStream
- {
- VERTICES,
- FACES,
- EDGES,
- TEXCOORDS,
- COLORS,
- WEIGHTS,
- LINES,
- WS_POSITIONS,
- LAST_STREAM,
- };
- enum ECopyFlags
- {
- COPY_VERTICES = BIT(1),
- COPY_FACES = BIT(2),
- COPY_EDGES = BIT(3),
- COPY_TEXCOORDS = BIT(4),
- COPY_COLORS = BIT(5),
- COPY_VERT_SEL = BIT(6),
- COPY_EDGE_SEL = BIT(7),
- COPY_FACE_SEL = BIT(8),
- COPY_WEIGHTS = BIT(9),
- COPY_LINES = BIT(10),
- COPY_ALL = 0xFFFF,
- };
- // geometry data
- CTriFace* pFaces;
- CTriEdge* pEdges;
- CTriVertex* pVertices;
- SMeshTexCoord* pUV;
- SMeshColor* pColors; // If allocated same size as pVerts array.
- Vec3* pWSVertices; // World space vertices.
- float* pWeights;
- CTriLine* pLines;
-
- int nFacesCount;
- int nVertCount;
- int nUVCount;
- int nEdgeCount;
- int nLinesCount;
-
- AABB bbox;
-
- //////////////////////////////////////////////////////////////////////////
- // Selections.
- //////////////////////////////////////////////////////////////////////////
- CBitArray vertSel;
- CBitArray edgeSel;
- CBitArray faceSel;
- // Every bit of the selection mask correspond to a stream, if bit is set this stream have some elements selected
- int streamSelMask;
-
- // Selection element type.
- // see ESubObjElementType
- int selectionType;
-
- //////////////////////////////////////////////////////////////////////////
- // Vertices of the front facing triangles.
- CBitArray frontFacingVerts;
-
- //////////////////////////////////////////////////////////////////////////
- // Functions.
- //////////////////////////////////////////////////////////////////////////
- CTriMesh();
- ~CTriMesh();
-
- int GetFacesCount() const { return nFacesCount; }
- int GetVertexCount() const { return nVertCount; }
- int GetUVCount() const { return nUVCount; }
- int GetEdgeCount() const { return nEdgeCount; }
- int GetLinesCount() const { return nLinesCount; }
-
- //////////////////////////////////////////////////////////////////////////
- void SetFacesCount(int nNewCount) { ReallocStream(FACES, nNewCount); }
- void SetVertexCount(int nNewCount)
- {
- ReallocStream(VERTICES, nNewCount);
- if (pColors)
- {
- ReallocStream(COLORS, nNewCount);
- }
- ReallocStream(WEIGHTS, nNewCount);
- }
- void SetColorsCount(int nNewCount) { ReallocStream(COLORS, nNewCount); }
- void SetUVCount(int nNewCount) { ReallocStream(TEXCOORDS, nNewCount); }
- void SetEdgeCount(int nNewCount) { ReallocStream(EDGES, nNewCount); }
- void SetLinesCount(int nNewCount) { ReallocStream(LINES, nNewCount); }
-
- void ReallocStream(int stream, int nNewCount);
- void GetStreamInfo(int stream, void*& pStream, int& nElementSize) const;
- int GetStreamSize(int stream) const { return m_streamSize[stream]; };
-
- // Calculate per face normal.
- void CalcFaceNormals();
-
- //////////////////////////////////////////////////////////////////////////
- // Welding functions.
- //////////////////////////////////////////////////////////////////////////
- void SharePositions();
- void ShareUV();
- //////////////////////////////////////////////////////////////////////////
- // Recreate edges of the mesh.
- void UpdateEdges();
-
- void Copy(CTriMesh& fromMesh, int nCopyFlags = COPY_ALL);
-
- //////////////////////////////////////////////////////////////////////////
- // Sub-object selection specific methods.
- //////////////////////////////////////////////////////////////////////////
- // Return true if something is selected.
- bool UpdateSelection();
- // Clear all selections, return true if something was selected.
- bool ClearSelection();
- void SoftSelection(const SSubObjSelOptions& options);
- CBitArray* GetStreamSelection(int nStream) { return m_streamSel[nStream]; };
- // Returns true if specified stream have any selected elements.
- bool StreamHaveSelection(int nStream) { return streamSelMask & (1 << nStream); }
- void GetEdgesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outEdges);
- void GetFacesByVertex(MeshElementsArray& inVertices, MeshElementsArray& outFaces);
-
-private:
- void* ReAllocElements(void* old_ptr, int new_elem_num, int size_of_element);
- void CopyStream(CTriMesh& fromMesh, int stream);
-
- // For internal use.
- int m_streamSize[LAST_STREAM];
- CBitArray* m_streamSel[LAST_STREAM];
-};
-
-#endif // CRYINCLUDE_EDITOR_GEOMETRY_TRIMESH_H
diff --git a/Code/Editor/IEditor.h b/Code/Editor/IEditor.h
index c6f72a7dbc..90f1b63f55 100644
--- a/Code/Editor/IEditor.h
+++ b/Code/Editor/IEditor.h
@@ -44,7 +44,6 @@ class CMusicManager;
struct IEditorParticleManager;
class CEAXPresetManager;
class CErrorReport;
-class CBaseLibraryItem;
class ICommandManager;
class CEditorCommandManager;
class CHyperGraphManager;
@@ -52,10 +51,7 @@ class CConsoleSynchronization;
class CUIEnumsDatabase;
struct ISourceControl;
struct IEditorClassFactory;
-struct IDataBaseItem;
struct ITransformManipulator;
-struct IDataBaseManager;
-class IFacialEditor;
class CDialog;
#if defined(AZ_PLATFORM_WINDOWS)
class C3DConnexionDriver;
@@ -69,7 +65,6 @@ class CSelectionTreeManager;
struct SEditorSettings;
class CGameExporter;
class IAWSResourceManager;
-struct IEditorPanelUtils;
namespace WinWidget
{
@@ -83,8 +78,6 @@ struct IEventLoopHook;
struct IErrorReport; // Vladimir@conffx
struct IFileUtil; // Vladimir@conffx
struct IEditorLog; // Vladimir@conffx
-struct IEditorMaterialManager; // Vladimir@conffx
-struct IBaseLibraryManager; // Vladimir@conffx
struct IImageUtil; // Vladimir@conffx
struct IEditorParticleUtils; // Leroy@conffx
struct ILogFile; // Vladimir@conffx
@@ -520,14 +513,8 @@ struct IEditor
//! Get access to object manager.
virtual struct IObjectManager* GetObjectManager() = 0;
virtual CSettingsManager* GetSettingsManager() = 0;
- //! Get DB manager that own items of specified type.
- virtual IDataBaseManager* GetDBItemManager(EDataBaseItemType itemType) = 0;
- virtual IBaseLibraryManager* GetMaterialManagerLibrary() = 0; // Vladimir@conffx
- 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..38006c6fca 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);
@@ -900,11 +892,6 @@ void CEditorImpl::CloseView(const GUID& classId)
}
}
-IDataBaseManager* CEditorImpl::GetDBItemManager([[maybe_unused]] EDataBaseItemType itemType)
-{
- return nullptr;
-}
-
bool CEditorImpl::SelectColor(QColor& color, QWidget* parent)
{
const AZ::Color c = AzQtComponents::fromQColor(color);
@@ -1445,7 +1432,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;
@@ -1632,18 +1619,6 @@ SEditorSettings* CEditorImpl::GetEditorSettings()
return &gSettings;
}
-// Vladimir@Conffx
-IBaseLibraryManager* CEditorImpl::GetMaterialManagerLibrary()
-{
- return nullptr;
-}
-
-// Vladimir@Conffx
-IEditorMaterialManager* CEditorImpl::GetIEditorMaterialManager()
-{
- return nullptr;
-}
-
IImageUtil* CEditorImpl::GetImageUtil()
{
return m_pImageUtil;
@@ -1658,8 +1633,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..7867912941 100644
--- a/Code/Editor/IEditorImpl.h
+++ b/Code/Editor/IEditorImpl.h
@@ -157,7 +157,6 @@ public:
void LockSelection(bool bLock) override;
bool IsSelectionLocked() override;
- IDataBaseManager* GetDBItemManager(EDataBaseItemType itemType) override;
CMusicManager* GetMusicManager() override { return m_pMusicManager; };
IEditorFileMonitor* GetFileMonitor() override;
@@ -294,11 +293,8 @@ public:
void RegisterObjectContextMenuExtension(TContextMenuExtensionFunc func) override;
SSystemGlobalEnvironment* GetEnv() override;
- IBaseLibraryManager* GetMaterialManagerLibrary() override; // Vladimir@Conffx
- 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 +352,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/HitContext.h b/Code/Editor/Include/HitContext.h
index ceff0adb22..b49117bb60 100644
--- a/Code/Editor/Include/HitContext.h
+++ b/Code/Editor/Include/HitContext.h
@@ -17,7 +17,6 @@
class CGizmo;
class CBaseObject;
struct IDisplayViewport;
-class CDeepSelection;
struct AABB;
#include
@@ -105,8 +104,6 @@ struct HitContext
CBaseObject* object;
//! gizmo object that have been hit.
CGizmo* gizmo;
- //! for deep selection mode
- CDeepSelection* pDeepSelection;
//! For linking tool
const char* name;
//! true if this hit was from the object icon
@@ -131,7 +128,6 @@ struct HitContext
bIgnoreAxis = false;
bOnlyGizmo = false;
bUseSelectionHelpers = false;
- pDeepSelection = 0;
name = nullptr;
iconHit = false;
}
diff --git a/Code/Editor/Include/IAnimationCompressionManager.h b/Code/Editor/Include/IAnimationCompressionManager.h
deleted file mode 100644
index 64cebf620a..0000000000
--- a/Code/Editor/Include/IAnimationCompressionManager.h
+++ /dev/null
@@ -1,20 +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_EDITOR_INCLUDE_IANIMATIONCOMPRESSIONMANAGER_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IANIMATIONCOMPRESSIONMANAGER_H
-#pragma once
-
-struct IAnimationCompressionManager
-{
- virtual bool IsEnabled() const = 0;
- virtual void UpdateLocalAnimations() = 0;
-};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IANIMATIONCOMPRESSIONMANAGER_H
diff --git a/Code/Editor/Include/IAssetItem.h b/Code/Editor/Include/IAssetItem.h
deleted file mode 100644
index ff80331af5..0000000000
--- a/Code/Editor/Include/IAssetItem.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-// Description : Standard interface for asset display in the asset browser,
-// this header should be used to create plugins.
-// The method Release of this interface should NOT be called.
-// Instead, the FreeData from the database (from IAssetItemDatabase) should
-// be used as it will safely release all the items from the database.
-// It is still possible to call the release method, but this is not the
-// recomended method, specially for usage outside of the plugins because there
-// is no guarantee that a the asset will be properly removed from the database
-// manager.
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_IASSETITEM_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IASSETITEM_H
-#pragma once
-
-struct IAssetItemDatabase;
-
-namespace AssetViewer
-{
- // Used in GetAssetFieldValue for each asset type to check if field name is the right one
- inline bool IsFieldName(const char* pIncomingFieldName, const char* pFieldName)
- {
- return !strncmp(pIncomingFieldName, pFieldName, strlen(pIncomingFieldName));
- }
-}
-
-// Description:
-// This interface allows the programmer to extend asset display types visible in the asset browser.
-struct IAssetItem
- : public IUnknown
-{
- DEFINE_UUID(0x04F20346, 0x2EC3, 0x43f2, 0xBD, 0xA1, 0x2C, 0x0B, 0x97, 0x76, 0xF3, 0x84);
-
- // The supported asset flags
- enum EAssetFlags
- {
- // asset is visible in the database for filtering and sorting (not asset view control related)
- eFlag_Visible = BIT(0),
- // the asset is loaded
- eFlag_Loaded = BIT(1),
- // the asset is loaded
- eFlag_Cached = BIT(2),
- // the asset is selected in a selection set
- eFlag_Selected = BIT(3),
- // this asset is invalid, no thumb is shown/available
- eFlag_Invalid = BIT(4),
- // this asset has some errors/warnings, in the asset browser it will show some blinking/red elements
- // and the user can check out the errors. Error text will be fetched using GetAssetFieldValue( "errors", &someStringVar )
- eFlag_HasErrors = BIT(5),
- // this flag is set when the asset is rendering its contents using GDI, and not the engine's rendering capabilities
- // (this flags is used as hint for the preview tool, which will use a double-buffer canvas if this flag is set,
- // and send a memory HDC to the OnBeginPreview method, for drawing of the asset)
- eFlag_UseGdiRendering = BIT(6),
- // set if this asset is draggable into the render viewports, and can be created there
- eFlag_CanBeDraggedInViewports = BIT(7),
- // set if this asset can be moved after creation, otherwise the asset instance will just be created where user clicked
- eFlag_CanBeMovedAfterDroppedIntoViewport = BIT(8),
- // the asset thumbnail image is loaded
- eFlag_ThumbnailLoaded = BIT(9),
- // the asset thumbnail image is loaded
- eFlag_UsedInLevel = BIT(10)
- };
-
- // Asset field name and field values map
- typedef std::map < QString/*fieldName*/, QString/*value*/ > TAssetFieldValuesMap;
- // Dependency category names and corresponding files map, example: "Textures"=>{ "foam.dds","water.dds","normal.dds" }
- typedef std::map < QString/*dependencyCategory*/, std::set/*dependency filenames*/ > TAssetDependenciesMap;
-
- virtual ~IAssetItem() {
- }
-
- // Description:
- // Get the hash number/key used for database thumbnail and info records management
- virtual uint32 GetHash() const = 0;
- // Description:
- // Set the hash number/key used for database thumbnail and info records management
- virtual void SetHash(uint32 hash) = 0;
- // Description:
- // Get the owner database for this asset
- // Return Value:
- // The owner database for this asset
- // See Also:
- // SetOwnerDatabase()
- virtual IAssetItemDatabase* GetOwnerDatabase() const = 0;
- // Description:
- // Set the owner database for this asset
- // Arguments:
- // piOwnerDisplayDatabase - the owner database
- // See Also:
- // GetOwnerDatabase()
- virtual void SetOwnerDatabase(IAssetItemDatabase* pOwnerDisplayDatabase) = 0;
- // Description:
- // Get the asset's dependency files / objects
- // Return Value:
- // The vector with filenames which this asset is dependent upon, ex.: ["Textures"].(vector of textures)
- virtual const TAssetDependenciesMap& GetDependencies() const = 0;
- // Description:
- // Set the file size of this asset in bytes
- // Arguments:
- // aSize - size of the file in bytes
- // See Also:
- // GetFileSize()
- virtual void SetFileSize(quint64 aSize) = 0;
- // Description:
- // Get the file size of this asset in bytes
- // Return Value:
- // The file size of this asset in bytes
- // See Also:
- // SetFileSize()
- virtual quint64 GetFileSize() const = 0;
- // Description:
- // Set asset filename (extension included and no path)
- // Arguments:
- // pName - the asset filename (extension included and no path)
- // See Also:
- // GetFilename()
- virtual void SetFilename(const char* pName) = 0;
- // Description:
- // Get asset filename (extension included and no path)
- // Return Value:
- // The asset filename (extension included and no path)
- // See Also:
- // SetFilename()
- virtual QString GetFilename() const = 0;
- // Description:
- // Set the asset's relative path
- // Arguments:
- // pName - file's relative path
- // See Also:
- // GetRelativePath()
- virtual void SetRelativePath(const char* pName) = 0;
- // Description:
- // Get the asset's relative path
- // Return Value:
- // The asset's relative path
- // See Also:
- // SetRelativePath()
- virtual QString GetRelativePath() const = 0;
- // Description:
- // Set the file extension ( dot(s) must be included )
- // Arguments:
- // pExt - the file's extension
- // See Also:
- // GetFileExtension()
- virtual void SetFileExtension(const char* pExt) = 0;
- // Description:
- // Get the file extension ( dot(s) included )
- // Return Value:
- // The file extension ( dot(s) included )
- // See Also:
- // SetFileExtension()
- virtual QString GetFileExtension() const = 0;
- // Description:
- // Get the asset flags, with values from IAssetItem::EAssetFlags
- // Return Value:
- // The asset flags, with values from IAssetItem::EAssetFlags
- // See Also:
- // SetFlags(), SetFlag(), IsFlagSet()
- virtual UINT GetFlags() const = 0;
- // Description:
- // Set the asset flags
- // Arguments:
- // aFlags - flags, OR-ed values from IAssetItem::EAssetFlags
- // See Also:
- // GetFlags(), SetFlag(), IsFlagSet()
- virtual void SetFlags(UINT aFlags) = 0;
- // Description:
- // Set/clear a single flag bit for the asset
- // Arguments:
- // aFlag - the flag to set/clear, with values from IAssetItem::EAssetFlags
- // See Also:
- // GetFlags(), SetFlags(), IsFlagSet()
- virtual void SetFlag(EAssetFlags aFlag, bool bSet = true) = 0;
- // Description:
- // Check if a specified flag is set
- // Arguments:
- // aFlag - the flag to check, with values from IAssetItem::EAssetFlags
- // Return Value:
- // True if the flag is set
- // See Also:
- // GetFlags(), SetFlags(), SetFlag()
- virtual bool IsFlagSet(EAssetFlags aFlag) const = 0;
- // Description:
- // Set this asset's index; used in sorting, selections, and to know where an asset is in the current list
- // Arguments:
- // aIndex - the asset's index
- // See Also:
- // GetIndex()
- virtual void SetIndex(UINT aIndex) = 0;
- // Description:
- // Get the asset's index in the current list
- // Return Value:
- // The asset's index in the current list
- // See Also:
- // SetIndex()
- virtual UINT GetIndex() const = 0;
- // Description:
- // Get the asset's field raw data value into a user location, you must check the field's type ( from asset item's owner database )
- // before using this function and send the correct pointer to destination according to the type ( int8, float32, string, etc. )
- // Arguments:
- // pFieldName - the asset field name to query the value for
- // pDest - the destination variable address, must be the same type as the field type
- // Return Value:
- // True if the asset field name is found and the value is returned correctly
- // See Also:
- // SetAssetFieldValue()
- virtual QVariant GetAssetFieldValue(const char* pFieldName) const = 0;
- // Description:
- // Set the asset's field raw data value from a user location, you must check the field's type ( from asset item's owner database )
- // before using this function and send the correct pointer to source according to the type ( int8, float32, string, etc. )
- // Arguments:
- // pFieldName - the asset field name to set the value for
- // pSrc - the source variable address, must be the same type as the field type
- // Return Value:
- // True if the asset field name is found and the value is set correctly
- // See Also:
- // GetAssetFieldValue()
- virtual bool SetAssetFieldValue(const char* pFieldName, void* pSrc) = 0;
- // Description:
- // Get the drawing rectangle for the asset's thumb ( absolute viewer canvas location )
- // Arguments:
- // rstDrawingRectangle - destination location to set with the asset's thumbnail rectangle location
- // See Also:
- // SetDrawingRectangle()
- virtual void GetDrawingRectangle(QRect& rstDrawingRectangle) const = 0;
- // Description:
- // Set the drawing rectangle for the asset's thumb ( absolute viewer canvas location )
- // Arguments:
- // crstDrawingRectangle - source to set the asset's thumbnail rectangle
- // See Also:
- // GetDrawingRectangle()
- virtual void SetDrawingRectangle(const QRect& crstDrawingRectangle) = 0;
- // Description:
- // Checks if the given 2D point is inside the asset's thumb rectangle
- // Arguments:
- // nX - mouse pointer position on X axis, relative to the asset viewer control
- // nY - mouse pointer position on Y axis, relative to the asset viewer control
- // Return Value:
- // True if the given 2D point is inside the asset's thumb rectangle
- // See Also:
- // HitTest(CRect)
- virtual bool HitTest(int nX, int nY) const = 0;
- // Description:
- // Checks if the given rectangle intersects the asset thumb's rectangle
- // Arguments:
- // nX - mouse pointer position on X axis, relative to the asset viewer control
- // nY - mouse pointer position on Y axis, relative to the asset viewer control
- // Return Value:
- // True if the given rectangle intersects the asset thumb's rectangle
- // See Also:
- // HitTest(int nX,int nY)
- virtual bool HitTest(const QRect& roTestRect) const = 0;
- // Description:
- // When user drags this asset item into a viewport, this method is called when the dragging operation ends
- // and the mouse button is released, for the asset to return an instance of the asset object to be placed in the level
- // Arguments:
- // aX - instance's X position component in world coordinates
- // aY - instance's Y position component in world coordinates
- // aZ - instance's Z position component in world coordinates
- // Return Value:
- // The newly created asset instance (Example: BrushObject*)
- // See Also:
- // MoveInstanceInViewport()
- virtual void* CreateInstanceInViewport(float aX, float aY, float aZ) = 0;
- // Description:
- // When the mouse button is released after level object creation, the user now can move the mouse
- // and move the asset instance in the 3D world
- // Arguments:
- // pDraggedObject - the actual entity or brush object (CBaseObject* usually) to be moved around with the mouse
- // returned by the CreateInstanceInViewport()
- // aNewX - the new X world coordinates of the asset instance
- // aNewY - the new Y world coordinates of the asset instance
- // aNewZ - the new Z world coordinates of the asset instance
- // Return Value:
- // True if asset instance was moved properly
- // See Also:
- // CreateInstanceInViewport()
- virtual bool MoveInstanceInViewport(const void* pDraggedObject, float aNewX, float aNewY, float aNewZ) = 0;
- // Description:
- // This will be called when the user presses ESCAPE key when dragging the asset in the viewport, you must delete the given object
- // because the creation was aborted
- // Arguments:
- // pDraggedObject - the asset instance to be deleted ( you must cast to the needed type, and delete it properly )
- // See Also:
- // CreateInstanceInViewport()
- virtual void AbortCreateInstanceInViewport(const void* pDraggedObject) = 0;
- // Description:
- // This method is used to cache/load asset's data, so it can be previewed/rendered
- // Return Value:
- // True if the asset was successfully cached
- // See Also:
- // UnCache()
- virtual bool Cache() = 0;
- // Description:
- // This method is used to force cache/load asset's data, so it can be previewed/rendered
- // Return Value:
- // True if the asset was successfully forced cached
- // See Also:
- // UnCache(), Cache()
- virtual bool ForceCache() = 0;
- // Description:
- // This method is used to load the thumbnail image of the asset
- // Return Value:
- // True if thumb loaded ok
- // See Also:
- // UnloadThumbnail()
- virtual bool LoadThumbnail() = 0;
- // Description:
- // This method is used to unload the thumbnail image of the asset
- // See Also:
- // LoadThumbnail()
- virtual void UnloadThumbnail() = 0;
- // Description:
- // This is called when the asset starts to be previewed in full detail, so here you can load the whole asset, in fine detail
- // ( textures are fully loaded, models etc. ). It is called once, when the Preview dialog is shown
- // Arguments:
- // hPreviewWnd - the window handle of the quick preview dialog
- // hMemDC - the memory DC used to render assets that can render themselves in the DC, otherwise they will render in the dialog's HWND
- // See Also:
- // OnEndPreview(), GetCustomPreviewPanelHeader()
- virtual void OnBeginPreview(QWidget* hPreviewWnd) = 0;
- // Description:
- // Called when the Preview dialog is closed, you may release the detail asset data here
- // See Also:
- // OnBeginPreview(), GetCustomPreviewPanelHeader()
- virtual void OnEndPreview() = 0;
- // Description:
- // If the asset has a special preview panel with utility controls, to be placed at the top of the Preview window, it can return an child dialog window
- // otherwise it can return nullptr, if no panel is available
- // Arguments:
- // pParentWnd - a valid CDialog*, or nullptr
- // Return Value:
- // A valid child dialog window handle, if this asset wants to have a custom panel in the top side of the Asset Preview window,
- // otherwise it can return nullptr, if no panel is available
- // See Also:
- // OnBeginPreview(), OnEndPreview()
- virtual QWidget* GetCustomPreviewPanelHeader(QWidget* pParentWnd) = 0;
- virtual QWidget* GetCustomPreviewPanelFooter(QWidget* pParentWnd) = 0;
- // Description:
- // Used when dragging/rotate/zoom a model, or other asset that can support preview
- // Arguments:
- // hRenderWindow - the rendering window handle
- // rstViewport - the viewport rectangle
- // aMouseX - the render window relative mouse pointer X coordinate
- // aMouseY - the render window relative mouse pointer Y coordinate
- // aMouseDeltaX - the X coordinate delta between two mouse movements
- // aMouseDeltaY - the Y coordinate delta between two mouse movements
- // aMouseWheelDelta - the mouse wheel scroll delta/step
- // aKeyFlags - the key flags, see WM_LBUTTONUP
- // See Also:
- // OnPreviewRenderKeyEvent()
- virtual void PreviewRender(
- QWidget* hRenderWindow,
- const QRect& rstViewport,
- int aMouseX = 0, int aMouseY = 0,
- int aMouseDeltaX = 0, int aMouseDeltaY = 0,
- int aMouseWheelDelta = 0, UINT aKeyFlags = 0) = 0;
- // Description:
- // This is called when the user manipulates the assets in interactive render and a key is pressed ( with down or up state )
- // Arguments:
- // bKeyDown - true if this is a WM_KEYDOWN event, else it is a WM_KEYUP event
- // aChar - the char/key code pressed/released
- // aKeyFlags - the key flags, compatible with WM_KEYDOWN/UP events
- // See Also:
- // InteractiveRender()
- virtual void OnPreviewRenderKeyEvent(bool bKeyDown, UINT aChar, UINT aKeyFlags) = 0;
- // Description:
- // Called when user clicked once on the thumb image
- // Arguments:
- // point - mouse coordinates relative to the thumbnail rectangle
- // aKeyFlags - the key flags, see WM_LBUTTONDOWN
- // See Also:
- // OnThumbDblClick()
- virtual void OnThumbClick(const QPoint& point, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) = 0;
- // Description:
- // Called when user double clicked on the thumb image
- // Arguments:
- // point - mouse coordinates relative to the thumbnail rectangle
- // aKeyFlags - the key flags, see WM_LBUTTONDOWN
- // See Also:
- // OnThumbClick()
- //! called when user clicked twice on the thumb image
- virtual void OnThumbDblClick(const QPoint& point, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) = 0;
- // Description:
- // Draw the cached thumb bitmap only, if any, no other kind of rendering
- // Arguments:
- // hDC - the destination DC, where to draw the thumb
- // rRect - the destination rectangle
- // Return Value:
- // True if drawing of the thumbnail was done OK
- // See Also:
- // Render()
- virtual bool DrawThumbImage(QPainter* painter, const QRect& rRect) = 0;
- // Description:
- // Writes asset info to a XML node.
- // This is needed to save cached info as a persistent XML file for the next run of the editor.
- // Arguments:
- // node - An XML node to contain the info
- // See Also:
- // FromXML()
- virtual void ToXML(XmlNodeRef& node) const = 0;
- // Description:
- // Gets asset info from a XML node.
- // This is needed to get the asset info from previous runs of the editor without re-caching it.
- // Arguments:
- // node - An XML node that contains info for this asset
- // See Also:
- // ToXML()
- virtual void FromXML(const XmlNodeRef& node) = 0;
-
- // From IUnknown
- virtual HRESULT STDMETHODCALLTYPE QueryInterface([[maybe_unused]] const IID& riid, [[maybe_unused]] void** ppvObject)
- {
- return E_NOINTERFACE;
- };
- virtual ULONG STDMETHODCALLTYPE AddRef()
- {
- return 0;
- };
- virtual ULONG STDMETHODCALLTYPE Release()
- {
- return 0;
- };
-};
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IASSETITEM_H
diff --git a/Code/Editor/Include/IAssetItemDatabase.h b/Code/Editor/Include/IAssetItemDatabase.h
deleted file mode 100644
index 39fd60e8c6..0000000000
--- a/Code/Editor/Include/IAssetItemDatabase.h
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-// Description : Standard interface for asset database creators used to
-// create an asset plugin for the asset browser
-// The category of the plugin must be Asset Item DB
-
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_IASSETITEMDATABASE_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IASSETITEMDATABASE_H
-#pragma once
-struct IAssetItem;
-struct IAssetViewer;
-
-class QString;
-class QStringList;
-
-// Description:
-// This struct keeps the info, filter and sorting settings for an asset field
-struct SAssetField
-{
- // the condition for the current filter on the field
- enum EAssetFilterCondition
- {
- eCondition_Any = 0,
- // string conditions
- // this also supports '*' and '?' as wildcards inside text
- eCondition_Contains,
- // this filter will search the target for at least one of the words specified
- // ( ex: filter: "water car moon" , field value : "the_great_moon.dds", this will pass the test
- // it also supports '*' and '?' as wildcards inside words text
- eCondition_ContainsOneOfTheWords,
- eCondition_StartsWith,
- eCondition_EndsWith,
- // string & numerical conditions
- eCondition_Equal,
- eCondition_Greater,
- eCondition_Less,
- eCondition_GreaterOrEqual,
- eCondition_LessOrEqual,
- eCondition_Not,
- eCondition_InsideRange
- };
-
- // the asset field type
- enum EAssetFieldType
- {
- eType_None = 0,
- eType_Bool,
- eType_Int8,
- eType_Int16,
- eType_Int32,
- eType_Int64,
- eType_Float,
- eType_Double,
- eType_String
- };
-
- // used when a field can have different specific values
- typedef QStringList TFieldEnumValues;
-
- SAssetField(
- const char* pFieldName = "",
- const char* pDisplayName = "Unnamed field",
- EAssetFieldType aFieldType = eType_None,
- UINT aColumnWidth = 50,
- bool bVisibleInUI = true,
- bool bReadOnly = true)
- {
- m_fieldName = pFieldName;
- m_displayName = pDisplayName;
- m_fieldType = aFieldType;
- m_filterCondition = eCondition_Equal;
- m_bUseEnumValues = false;
- m_bReadOnly = bReadOnly;
- m_listColumnWidth = aColumnWidth;
- m_bFieldVisibleInUI = bVisibleInUI;
- m_bPostFilter = false;
-
- SetupEnumValues();
- }
-
- void SetupEnumValues()
- {
- m_bUseEnumValues = true;
-
- if (m_fieldType == eType_Bool)
- {
- m_enumValues.clear();
- m_enumValues.push_back("Yes");
- m_enumValues.push_back("No");
- }
- }
-
- // the field's display name, used in UI
- QString m_displayName,
- // the field internal name, used in C++ code
- m_fieldName,
- // the current filter value, if its empty "" then no filter is applied
- m_filterValue,
- // the field's max value, valid when the field's filter condition is eAssertFilterCondition_InsideRange
- m_maxFilterValue,
- // the name of the database holding this field, used in Asset Browser preset editor, if its "" then the field
- // is common to all current databases
- m_parentDatabaseName;
- // is this field visible in the UI ?
- bool m_bFieldVisibleInUI,
- // if true, then you cannot modify this field of an asset item, only use it
- m_bReadOnly,
- // this field filter is applied after the other filters
- m_bPostFilter;
- // the field data type
- EAssetFieldType m_fieldType;
- // the filter's condition
- EAssetFilterCondition m_filterCondition;
- // use the enum list values to choose a value for the field ?
- bool m_bUseEnumValues;
- // this map is used when asset field has m_bUseEnumValues on true,
- // choose a value for the field from this list in the UI
- TFieldEnumValues m_enumValues;
- // recommended list column width
- unsigned int m_listColumnWidth;
-};
-
-struct SFieldFiltersPreset
-{
- QString presetName2;
- QStringList checkedDatabaseNames;
- bool bUsedInLevel;
- std::vector fields;
-};
-
-// Description:
-// This interface allows the programmer to extend asset display types
-// visible in the asset browser.
-struct IAssetItemDatabase
- : public IUnknown
-{
- DEFINE_UUID(0xFB09B039, 0x1D9D, 0x4057, 0xA5, 0xF0, 0xAA, 0x3C, 0x7B, 0x97, 0xAE, 0xA8)
-
- typedef std::vector TAssetFields;
- typedef std::map < QString/*field name*/, SAssetField > TAssetFieldFiltersMap;
- typedef std::map < QString/*asset filename*/, IAssetItem* > TFilenameAssetMap;
- typedef AZStd::function MetaDataChangeListener;
-
- // Description:
- // Refresh the database by scanning the folders/paks for files, does not load the files, only filename and filesize are fetched
- virtual void Refresh() = 0;
- // Description:
- // Fills the asset meta data from the loaded xml meta data DB.
- // Arguments:
- // db - the database XML node from where to cache the info
- virtual void PrecacheFieldsInfoFromFileDB(const XmlNodeRef& db) = 0;
- // Description:
- // Return all assets loaded/scanned by this database
- // Return Value:
- // The assets map reference (filename-asset)
- virtual TFilenameAssetMap& GetAssets() = 0;
- // Description:
- // Get an asset item by its filename
- // Return Value:
- // A single asset from the database given the filename
- virtual IAssetItem* GetAsset(const char* pAssetFilename) = 0;
- // Description:
- // Return the asset fields this database's items support
- // Return Value:
- // The asset fields vector reference
- virtual TAssetFields& GetAssetFields() = 0;
- // Description:
- // Return an asset field object pointer by the field internal name
- // Arguments:
- // pFieldName - the internal field's name (ex: "filename", "relativepath")
- // Return Value:
- // The asset field object pointer
- virtual SAssetField* GetAssetFieldByName(const char* pFieldName) = 0;
- // Description:
- // Get the database name
- // Return Value:
- // Returns the database name, ex: "Textures"
- virtual const char* GetDatabaseName() const = 0;
- // Description:
- // Get the database supported file name extension(s)
- // Return Value:
- // Returns the supported extensions, separated by comma, ex: "tga,bmp,dds"
- virtual const char* GetSupportedExtensions() const = 0;
- // Description:
- // Free the database internal data structures
- virtual void FreeData() = 0;
- // Description:
- // Apply filters to this database which will set/unset the IAssetItem::eAssetFlag_Visible of each asset, based
- // on the given field filters
- // Arguments:
- // rFieldFilters - a reference to the field filters map (fieldname-field)
- // See Also:
- // ClearFilters()
- virtual void ApplyFilters(const TAssetFieldFiltersMap& rFieldFilters) = 0;
- // Description:
- // Clear the current filters, by setting the IAssetItem::eAssetFlag_Visible of each asset to true
- // See Also:
- // ApplyFilters()
- virtual void ClearFilters() = 0;
- virtual QWidget* CreateDbFilterDialog(QWidget* pParent, IAssetViewer* pViewerCtrl) = 0;
- virtual void UpdateDbFilterDialogUI(QWidget* pDlg) = 0;
- virtual void OnAssetBrowserOpen() = 0;
- virtual void OnAssetBrowserClose() = 0;
- // Description:
- // Gets the filename for saving new cached asset info.
- // Return Value:
- // A file name to save new transactions to the persistent asset info DB
- // See Also:
- // CAssetInfoFileDB, IAssetItem::ToXML(), IAssetItem::FromXML()
- virtual const char* GetTransactionFilename() const = 0;
- // Description:
- // Adds a callback to be called when the meta data of this asset changed.
- // Arguments:
- // callBack - A functor to be added
- // Return Value:
- // True if successful, false otherwise.
- // See Also:
- // RemoveMetaDataChangeListener()
- virtual bool AddMetaDataChangeListener(MetaDataChangeListener callBack) = 0;
- // Description:
- // Removes a callback from the list of meta data change listeners.
- // Arguments:
- // callBack - A functor to be removed
- // Return Value:
- // True if successful, false otherwise.
- // See Also:
- // AddMetaDataCHangeListener()
- virtual bool RemoveMetaDataChangeListener(MetaDataChangeListener callBack) = 0;
- // Description:
- // The method that should be called when the meta data of an asset item changes to notify all listeners
- // Arguments:
- // pAssetItem - An asset item whose meta data have changed
- // See Also:
- // AddMetaDataCHangeListener(), RemoveMetaDataChangeListener()
- virtual void OnMetaDataChange(const IAssetItem* pAssetItem) = 0;
-
- //! from IUnknown
- virtual HRESULT STDMETHODCALLTYPE QueryInterface([[maybe_unused]] REFIID riid, [[maybe_unused]] void** ppvObject)
- {
- return E_NOINTERFACE;
- };
- virtual ULONG STDMETHODCALLTYPE AddRef()
- {
- return 0;
- };
- virtual ULONG STDMETHODCALLTYPE Release()
- {
- return 0;
- };
-};
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IASSETITEMDATABASE_H
diff --git a/Code/Editor/Include/IAssetViewer.h b/Code/Editor/Include/IAssetViewer.h
deleted file mode 100644
index 488ee8e508..0000000000
--- a/Code/Editor/Include/IAssetViewer.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-// Description : This file declares a control which objective is to display
-// multiple assets allowing selection and preview of such things
-// It also handles scrolling and changes in the thumbnail display size
-
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_IASSETVIEWER_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IASSETVIEWER_H
-#pragma once
-#include "IObservable.h"
-#include "IAssetItemDatabase.h"
-
-struct IAssetItem;
-struct IAssetItemDatabase;
-
-// Description:
-// Observer for the asset viewer events
-struct IAssetViewerObserver
-{
- virtual void OnChangeStatusBarInfo(UINT nSelectedItems, UINT nVisibleItems, UINT nTotalItems) {};
- virtual void OnSelectionChanged() {};
- virtual void OnChangedPreviewedAsset(IAssetItem* pAsset) {};
- virtual void OnAssetDblClick(IAssetItem* pAsset) {};
- virtual void OnAssetFilterChanged() {};
-};
-
-// Description:
-// The asset viewer interface for the asset database plugins to use
-struct IAssetViewer
-{
- DEFINE_OBSERVABLE_PURE_METHODS(IAssetViewerObserver);
-
- virtual HWND GetRenderWindow() = 0;
- virtual void ApplyFilters(const IAssetItemDatabase::TAssetFieldFiltersMap& rFieldFilters) = 0;
- virtual const IAssetItemDatabase::TAssetFieldFiltersMap& GetCurrentFilters() = 0;
- virtual void ClearFilters() = 0;
-};
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IASSETVIEWER_H
diff --git a/Code/Editor/Include/IBaseLibraryManager.h b/Code/Editor/Include/IBaseLibraryManager.h
deleted file mode 100644
index 4116b573fa..0000000000
--- a/Code/Editor/Include/IBaseLibraryManager.h
+++ /dev/null
@@ -1,143 +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_EDITOR_INCLUDE_IBASELIBRARYMANAGER_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IBASELIBRARYMANAGER_H
-#pragma once
-
-#include
-#include "Include/IDataBaseItem.h"
-#include "Include/IDataBaseLibrary.h"
-#include "Include/IDataBaseManager.h"
-#include "Util/TRefCountBase.h"
-
-class CBaseLibraryItem;
-class CBaseLibrary;
-
-struct IBaseLibraryManager
- : public TRefCountBase
- , public IEditorNotifyListener
-{
- //! Clear all libraries.
- virtual void ClearAll() = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // IDocListener implementation.
- //////////////////////////////////////////////////////////////////////////
- virtual void OnEditorNotifyEvent(EEditorNotifyEvent event) = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Library items.
- //////////////////////////////////////////////////////////////////////////
- //! Make a new item in specified library.
- virtual IDataBaseItem* CreateItem(IDataBaseLibrary* pLibrary) = 0;
- //! Delete item from library and manager.
- virtual void DeleteItem(IDataBaseItem* pItem) = 0;
-
- //! Find Item by its GUID.
- virtual IDataBaseItem* FindItem(REFGUID guid) const = 0;
- virtual IDataBaseItem* FindItemByName(const QString& fullItemName) = 0;
- virtual IDataBaseItem* LoadItemByName(const QString& fullItemName) = 0;
-
- virtual IDataBaseItemEnumerator* GetItemEnumerator() = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Set item currently selected.
- virtual void SetSelectedItem(IDataBaseItem* pItem) = 0;
- // Get currently selected item.
- virtual IDataBaseItem* GetSelectedItem() const = 0;
- virtual IDataBaseItem* GetSelectedParentItem() const = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Libraries.
- //////////////////////////////////////////////////////////////////////////
- //! Add Item library.
- virtual IDataBaseLibrary* AddLibrary(const QString& library, bool isLevelLibrary = false, bool bIsLoading = true) = 0;
- virtual void DeleteLibrary(const QString& library, bool forceDeleteLevel = false) = 0;
- //! Get number of libraries.
- virtual int GetLibraryCount() const = 0;
- //! Get number of modified libraries.
- virtual int GetModifiedLibraryCount() const = 0;
-
- //! Get Item library by index.
- virtual IDataBaseLibrary* GetLibrary(int index) const = 0;
-
- //! Get Level Item library.
- virtual IDataBaseLibrary* GetLevelLibrary() const = 0;
-
- //! Find Items Library by name.
- virtual IDataBaseLibrary* FindLibrary(const QString& library) = 0;
-
- //! Find the Library's index by name.
- virtual int FindLibraryIndex(const QString& library) = 0;
-
- //! Load Items library.
-#ifdef LoadLibrary
-#undef LoadLibrary
-#endif
- virtual IDataBaseLibrary* LoadLibrary(const QString& filename, bool bReload = false) = 0;
-
- //! Save all modified libraries.
- virtual void SaveAllLibs() = 0;
-
- //! Serialize property manager.
- virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0;
-
- //! Export items to game.
- virtual void Export(XmlNodeRef& node) = 0;
-
- //! Returns unique name base on input name.
- // Vera@conffx, add LibName parameter so we could make an unique name depends on input library.
- // Arguments:
- // - name: name of the item
- // - libName: The library of the item. Given the library name, the function will return a unique name in the library
- // Default value "": The function will ignore the library name and return a unique name in the manager
- virtual QString MakeUniqueItemName(const QString& name, const QString& libName = "") = 0;
- virtual QString MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) = 0;
-
- //! Root node where this library will be saved.
- virtual QString GetRootNodeName() = 0;
- //! Path to libraries in this manager.
- virtual QString GetLibsPath() = 0;
-
- //////////////////////////////////////////////////////////////////////////
- //! Validate library items for errors.
- virtual void Validate() = 0;
-
- //////////////////////////////////////////////////////////////////////////
- virtual void GatherUsedResources(CUsedResources& resources) = 0;
-
- virtual void AddListener(IDataBaseManagerListener* pListener) = 0;
- virtual void RemoveListener(IDataBaseManagerListener* pListener) = 0;
-
- //////////////////////////////////////////////////////////////////////////
- virtual void RegisterItem(CBaseLibraryItem* pItem, REFGUID newGuid) = 0;
- virtual void RegisterItem(CBaseLibraryItem* pItem) = 0;
- virtual void UnregisterItem(CBaseLibraryItem* pItem) = 0;
-
- // Only Used internally.
- virtual void OnRenameItem(CBaseLibraryItem* pItem, const QString& oldName) = 0;
-
- // Called by items to indicated that they have been modified.
- // Sends item changed event to listeners.
- virtual void OnItemChanged(IDataBaseItem* pItem) = 0;
- virtual void OnUpdateProperties(IDataBaseItem* pItem, bool bRefresh) = 0;
-
- //CONFETTI BEGIN
- // Used to change the library item order
- virtual void ChangeLibraryOrder(IDataBaseLibrary* lib, unsigned int newLocation) = 0;
- // simplifies the library renaming process
- virtual bool SetLibraryName(CBaseLibrary* lib, const QString& name) = 0;
-
-
- //Check if the file name is unique.
- //Params: library: library name. NOT the file path.
- virtual bool IsUniqueFilename(const QString& library) = 0;
- //CONFETTI END
-};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IBASELIBRARYMANAGER_H
diff --git a/Code/Editor/Include/IConsoleConnectivity.h b/Code/Editor/Include/IConsoleConnectivity.h
deleted file mode 100644
index 0f5e9bf35c..0000000000
--- a/Code/Editor/Include/IConsoleConnectivity.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-// Description : Standard interface for console connectivity plugins.
-
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_ICONSOLECONNECTIVITY_H
-#define CRYINCLUDE_EDITOR_INCLUDE_ICONSOLECONNECTIVITY_H
-#pragma once
-
-
-//////////////////////////////////////////////////////////////////////////
-// Description
-// This interface provide access to the console connectivity
-// functionality.
-//////////////////////////////////////////////////////////////////////////
-struct IConsoleConnectivity
- : public IUnknown
-{
- DEFINE_UUID(0x4DAA85E1, 0x8498, 0x402f, 0x9B, 0x85, 0x7F, 0x62, 0x9D, 0x76, 0x79, 0x8A);
-
- //////////////////////////////////////////////////////////////////////////
- //TODO: Must add the useful interface here.
- //////////////////////////////////////////////////////////////////////////
-
- // Description:
- // Checks if a development console is connected to the development PC.
- // See Also:
- // Arguments:
- // Nothing
- // Return:
- // bool - true if it is connected, false otherwise.
- virtual bool IsConnectedToConsole() = 0;
-
- // Description:
- // Send a file from the specified local filename to the console platform creating the full path
- // as required so it can copy to the remote filename.
- // See Also:
- // Nothing
- // Arguments:
- // szLocalFileName - is the local filename from which you want to copy the file.
- // szRemoteFilename - is the full path and filename to where you want to copy the file.
- // Return:
- // bool - true if the copy succeeded, false otherwise.
- virtual bool SendFile(const char* szLocalFileName, const char* szRemoteFilename) = 0;
-
- // Description:
- // Notifies to the console that a file has been changed, typically uploaded.
- // This will be usually called after a SendFile (see above) call, so that the
- // system running on the console may decide what to do with this new file.
- // Typically the system will have to load or reloads this new file.
- // See Also:
- // SendFile
- // Arguments:
- // szRemoteFilename - is the full path and filename in the console of the changed
- // file.
- // Return:
- // bool - true if succeeded sending the notification, false otherwise.
- virtual bool NotifyFileChange(const char* szRemoteFilename) = 0;
-
-
- // Description:
- // Gets the the title IP for the connected console .
- // Arguments:
- // dwConsoleAddressPlaceholder - is the pointer to the placeholder of the variable
- // which will contain the title IP of the console.
- // Return:
- // bool - true if dwConsoleAddressPlaceholder now contains the IP address, else false.
- virtual bool GetConsoleAddress(DWORD* dwConsoleAddressPlaceholder) = 0;
- //////////////////////////////////////////////////////////////////////////
- // IUnknown
- //////////////////////////////////////////////////////////////////////////
- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) { return E_NOINTERFACE; };
- virtual ULONG STDMETHODCALLTYPE AddRef() { return 0; };
- virtual ULONG STDMETHODCALLTYPE Release() { return 0; };
- //////////////////////////////////////////////////////////////////////////
-};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_ICONSOLECONNECTIVITY_H
diff --git a/Code/Editor/Include/IDataBaseItem.h b/Code/Editor/Include/IDataBaseItem.h
deleted file mode 100644
index 6be5f49c2d..0000000000
--- a/Code/Editor/Include/IDataBaseItem.h
+++ /dev/null
@@ -1,92 +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_EDITOR_INCLUDE_IDATABASEITEM_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IDATABASEITEM_H
-#pragma once
-
-#include
-#include
-
-struct IDataBaseLibrary;
-class CUsedResources;
-
-//////////////////////////////////////////////////////////////////////////
-/** Base class for all items contained in BaseLibraray.
-*/
-struct IDataBaseItem
-{
- struct SerializeContext
- {
- XmlNodeRef node;
- bool bUndo;
- bool bLoading;
- bool bCopyPaste;
- bool bIgnoreChilds;
- bool bUniqName;
- SerializeContext()
- : node(0)
- , bLoading(false)
- , bCopyPaste(false)
- , bIgnoreChilds(false)
- , bUniqName(false)
- , bUndo(false) {};
- SerializeContext(XmlNodeRef _node, bool bLoad)
- : node(_node)
- , bLoading(bLoad)
- , bCopyPaste(false)
- , bIgnoreChilds(false)
- , bUniqName(false)
- , bUndo(false) {};
- SerializeContext(const SerializeContext& ctx)
- : node(ctx.node)
- , bLoading(ctx.bLoading)
- , bCopyPaste(ctx.bCopyPaste)
- , bIgnoreChilds(ctx.bIgnoreChilds)
- , bUniqName(ctx.bUniqName)
- , bUndo(ctx.bUndo) {};
- };
-
- virtual EDataBaseItemType GetType() const = 0;
-
- //! Return Library this item are contained in.
- //! Item can only be at one library.
- virtual IDataBaseLibrary* GetLibrary() const = 0;
-
- //! Change item name.
- virtual void SetName(const QString& name) = 0;
- //! Get item name.
- virtual const QString& GetName() const = 0;
-
- //! Get full item name, including name of library.
- //! Name formed by adding dot after name of library
- //! eg. library Pickup and item PickupRL form full item name: "Pickups.PickupRL".
- virtual QString GetFullName() const = 0;
-
- //! Get only nameof group from prototype.
- virtual QString GetGroupName() = 0;
- //! Get short name of prototype without group.
- virtual QString GetShortName() = 0;
-
- //! Serialize library item to archive.
- virtual void Serialize(SerializeContext& ctx) = 0;
-
- //! Generate new unique id for this item.
- virtual void GenerateId() = 0;
- //! Returns GUID of this material.
- virtual const GUID& GetGUID() const = 0;
-
- //! Validate item for errors.
- virtual void Validate() {};
-
- //! Gathers resources by this item.
- virtual void GatherUsedResources([[maybe_unused]] CUsedResources& resources) {};
-};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IDATABASEITEM_H
diff --git a/Code/Editor/Include/IDataBaseLibrary.h b/Code/Editor/Include/IDataBaseLibrary.h
deleted file mode 100644
index 75437d93e2..0000000000
--- a/Code/Editor/Include/IDataBaseLibrary.h
+++ /dev/null
@@ -1,118 +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_EDITOR_INCLUDE_IDATABASELIBRARY_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IDATABASELIBRARY_H
-#pragma once
-
-
-struct IDataBaseManager;
-struct IDataBaseItem;
-
-class QString;
-class XmlNodeRef;
-
-//////////////////////////////////////////////////////////////////////////
-// Description:
-// Interface to access specific library of editor data base.
-// Ex. Archetype library, Material Library.
-// See Also:
-// IDataBaseItem,IDataBaseManager
-//////////////////////////////////////////////////////////////////////////
-struct IDataBaseLibrary
-{
- // Description:
- // Return IDataBaseManager interface to the manager for items stored in this library.
- virtual IDataBaseManager* GetManager() = 0;
-
- // Description:
- // Return library name.
- virtual const QString& GetName() const = 0;
-
- // Description:
- // Return filename where this library is stored.
- virtual const QString& GetFilename() const = 0;
-
- // Description:
- // Save contents of library to file.
- virtual bool Save() = 0;
-
- // Description:
- // Load library from file.
- // Arguments:
- // filename - Full specified library filename (relative to root game folder).
- virtual bool Load(const QString& filename) = 0;
-
- // Description:
- // Serialize library parameters and items to/from XML node.
- virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0;
-
- // Description:
- // Marks library as modified, indicates that some item in library was modified.
- virtual void SetModified(bool bModified = true) = 0;
-
- // Description:
- // Check if library parameters or any items where modified.
- // If any item was modified library may need saving before closing editor.
- virtual bool IsModified() const = 0;
-
- // Description:
- // Check if this library is not shared and internal to current level.
- virtual bool IsLevelLibrary() const = 0;
-
- // Description:
- // Make this library accessible only from current Level. (not shared)
- virtual void SetLevelLibrary(bool bEnable) = 0;
-
- // Description:
- // Associate a new item with the library.
- // Watch out if item was already in another library.
- virtual void AddItem(IDataBaseItem* pItem, bool bRegister = true) = 0;
-
- // Description:
- // Return number of items in library.
- virtual int GetItemCount() const = 0;
-
- // Description:
- // Get item by index.
- // See Also:
- // GetItemCount
- // Arguments:
- // index - Index from 0 to GetItemCount()
- virtual IDataBaseItem* GetItem(int index) = 0;
-
- // Description:
- // Remove item from library, does not destroy item,
- // only unliks it from this library, to delete item use IDataBaseManager.
- // See Also:
- // AddItem
- virtual void RemoveItem(IDataBaseItem* item) = 0;
-
- // Description:
- // Remove all items from library, does not destroy items,
- // only unliks them from this library, to delete item use IDataBaseManager.
- // See Also:
- // RemoveItem,AddItem
- virtual void RemoveAllItems() = 0;
-
- // Description:
- // Find item in library by name.
- // This function usually uses linear search so it is not particularry fast.
- // See Also:
- // GetItem
- virtual IDataBaseItem* FindItem(const QString& name) = 0;
-
-
- //CONFETTI BEGIN
- // Used to change the library item order
- virtual void ChangeItemOrder(CBaseLibraryItem* item, unsigned int newLocation) = 0;
- //CONFETTI END
-};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IDATABASELIBRARY_H
diff --git a/Code/Editor/Include/IDataBaseManager.h b/Code/Editor/Include/IDataBaseManager.h
deleted file mode 100644
index 3d701d51fc..0000000000
--- a/Code/Editor/Include/IDataBaseManager.h
+++ /dev/null
@@ -1,134 +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_EDITOR_INCLUDE_IDATABASEMANAGER_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IDATABASEMANAGER_H
-#pragma once
-
-#include
-
-struct IDataBaseItem;
-struct IDataBaseLibrary;
-class CUsedResources;
-
-enum EDataBaseItemEvent
-{
- EDB_ITEM_EVENT_ADD,
- EDB_ITEM_EVENT_DELETE,
- EDB_ITEM_EVENT_CHANGED,
- EDB_ITEM_EVENT_SELECTED,
- EDB_ITEM_EVENT_UPDATE_PROPERTIES,
- EDB_ITEM_EVENT_UPDATE_PROPERTIES_NO_EDITOR_REFRESH
-};
-
-//////////////////////////////////////////////////////////////////////////
-// Description:
-// Callback class to intercept item creation and deletion events.
-//////////////////////////////////////////////////////////////////////////
-struct IDataBaseManagerListener
-{
- virtual void OnDataBaseItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event) = 0;
-};
-
-//////////////////////////////////////////////////////////////////////////
-// Description:
-// his interface is used to enumerate al items registered to the database manager.
-//////////////////////////////////////////////////////////////////////////
-struct IDataBaseItemEnumerator
-{
- virtual ~IDataBaseItemEnumerator() = default;
-
- virtual void Release() = 0;
- virtual IDataBaseItem* GetFirst() = 0;
- virtual IDataBaseItem* GetNext() = 0;
-};
-
-//////////////////////////////////////////////////////////////////////////
-//
-// Interface to the collection of all items or specific type
-// in data base libraries.
-//
-//////////////////////////////////////////////////////////////////////////
-struct IDataBaseManager
-{
- //! Clear all libraries.
- virtual void ClearAll() = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Library items.
- //////////////////////////////////////////////////////////////////////////
- //! Make a new item in specified library.
- virtual IDataBaseItem* CreateItem(IDataBaseLibrary* pLibrary) = 0;
- //! Delete item from library and manager.
- virtual void DeleteItem(IDataBaseItem* pItem) = 0;
-
- //! Find Item by its GUID.
- virtual IDataBaseItem* FindItem(REFGUID guid) const = 0;
- virtual IDataBaseItem* FindItemByName(const QString& fullItemName) = 0;
-
- virtual IDataBaseItemEnumerator* GetItemEnumerator() = 0;
-
- // Select one item in DB.
- virtual void SetSelectedItem(IDataBaseItem* pItem) = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Libraries.
- //////////////////////////////////////////////////////////////////////////
- //! Add Item library. Set isLevelLibrary to true if its the "level" library which gets saved inside the level
- virtual IDataBaseLibrary* AddLibrary(const QString& library, bool isLevelLibrary = false, bool bIsLoading = true) = 0;
- virtual void DeleteLibrary(const QString& library, bool forceDeleteLibrary = false) = 0;
- //! Get number of libraries.
- virtual int GetLibraryCount() const = 0;
- //! Get Item library by index.
- virtual IDataBaseLibrary* GetLibrary(int index) const = 0;
-
- //! Find Items Library by name.
- virtual IDataBaseLibrary* FindLibrary(const QString& library) = 0;
-
- //! Load Items library.
-#ifdef LoadLibrary
-#undef LoadLibrary
-#endif
- virtual IDataBaseLibrary* LoadLibrary(const QString& filename, bool bReload = false) = 0;
-
- //! Save all modified libraries.
- virtual void SaveAllLibs() = 0;
-
- //! Serialize property manager.
- virtual void Serialize(XmlNodeRef& node, bool bLoading) = 0;
-
- //! Export items to game.
- virtual void Export([[maybe_unused]] XmlNodeRef& node) {};
-
- //! Returns unique name base on input name.
- virtual QString MakeUniqueItemName(const QString& name, const QString& libName = "") = 0;
- virtual QString MakeFullItemName(IDataBaseLibrary* pLibrary, const QString& group, const QString& itemName) = 0;
-
- //! Root node where this library will be saved.
- virtual QString GetRootNodeName() = 0;
- //! Path to libraries in this manager.
- virtual QString GetLibsPath() = 0;
-
- //////////////////////////////////////////////////////////////////////////
- //! Validate library items for errors.
- virtual void Validate() = 0;
-
- // Description:
- // Collects names of all resource files used by managed items.
- // Arguments:
- // resources - Structure where all filenames are collected.
- virtual void GatherUsedResources(CUsedResources& resources) = 0;
-
- //////////////////////////////////////////////////////////////////////////
- // Register listeners.
- virtual void AddListener(IDataBaseManagerListener* pListener) = 0;
- virtual void RemoveListener(IDataBaseManagerListener* pListener) = 0;
-};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IDATABASEMANAGER_H
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/IEditorMaterial.h b/Code/Editor/Include/IEditorMaterial.h
deleted file mode 100644
index 329b0ae53f..0000000000
--- a/Code/Editor/Include/IEditorMaterial.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-#pragma once
-
-
-#include "BaseLibraryItem.h"
-#include
-
-struct IEditorMaterial
- : public CBaseLibraryItem
-{
- virtual int GetFlags() const = 0;
- virtual IMaterial* GetMatInfo(bool bUseExistingEngineMaterial = false) = 0;
- virtual void DisableHighlightForFrame() = 0;
-};
diff --git a/Code/Editor/Include/IEditorMaterialManager.h b/Code/Editor/Include/IEditorMaterialManager.h
deleted file mode 100644
index 6f71c5ddd1..0000000000
--- a/Code/Editor/Include/IEditorMaterialManager.h
+++ /dev/null
@@ -1,21 +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_EDITOR_MATERIAL_IEDITORMATERIALMANAGER_H
-#define CRYINCLUDE_EDITOR_MATERIAL_IEDITORMATERIALMANAGER_H
-#pragma once
-
-#include
-#include
-
-
-struct IEditorMaterialManager
-{
- virtual void GotoMaterial(IMaterial* pMaterial) = 0;
-};
-
-#endif // CRYINCLUDE_EDITOR_MATERIAL_MATERIALMANAGER_H
diff --git a/Code/Editor/Include/IErrorReport.h b/Code/Editor/Include/IErrorReport.h
index 7bf00d6973..c409dbc7dd 100644
--- a/Code/Editor/Include/IErrorReport.h
+++ b/Code/Editor/Include/IErrorReport.h
@@ -14,7 +14,6 @@
// forward declarations.
class CParticleItem;
class CBaseObject;
-class CBaseLibraryItem;
class CErrorRecord;
class QString;
@@ -52,9 +51,6 @@ struct IErrorReport
//! Assign current Object to which new reported warnings are assigned.
virtual void SetCurrentValidatorObject(CBaseObject* pObject) = 0;
- //! Assign current Item to which new reported warnings are assigned.
- virtual void SetCurrentValidatorItem(CBaseLibraryItem* pItem) = 0;
-
//! Assign current filename.
virtual void SetCurrentFile(const QString& file) = 0;
};
diff --git a/Code/Editor/Include/IFacialEditor.h b/Code/Editor/Include/IFacialEditor.h
deleted file mode 100644
index 5dfa9ab03f..0000000000
--- a/Code/Editor/Include/IFacialEditor.h
+++ /dev/null
@@ -1,43 +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_EDITOR_INCLUDE_IFACIALEDITOR_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IFACIALEDITOR_H
-#pragma once
-
-
-class IFacialEditor
-{
-public:
- enum EyeType
- {
- EYE_LEFT,
- EYE_RIGHT
- };
-
- virtual int GetNumMorphTargets() const = 0;
- virtual const char* GetMorphTargetName(int index) const = 0;
- virtual void PreviewEffector(int index, float value) = 0;
- virtual void ClearAllPreviewEffectors() = 0;
- virtual void SetForcedNeckRotation(const Quat& rotation) = 0;
- virtual void SetForcedEyeRotation(const Quat& rotation, EyeType eye) = 0;
- virtual int GetJoystickCount() const = 0;
- virtual const char* GetJoystickName(int joystickIndex) const = 0;
- virtual void SetJoystickPosition(int joystickIndex, float x, float y) = 0;
- virtual void GetJoystickPosition(int joystickIndex, float& x, float& y) const = 0;
- virtual void LoadJoystickFile(const char* filename) = 0;
- virtual void LoadCharacter(const char* filename) = 0;
- virtual void LoadSequence(const char* filename) = 0;
- virtual void SetVideoFrameResolution(int width, int height, int bpp) = 0;
- virtual int GetVideoFramePitch() = 0;
- virtual void* GetVideoFrameBits() = 0;
- virtual void ShowVideoFramePane() = 0;
-};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IFACIALEDITOR_H
diff --git a/Code/Editor/Include/IFileUtil.h b/Code/Editor/Include/IFileUtil.h
index 036a0bc5ee..ea2fe1f1a3 100644
--- a/Code/Editor/Include/IFileUtil.h
+++ b/Code/Editor/Include/IFileUtil.h
@@ -116,9 +116,6 @@ struct IFileUtil
virtual bool ExtractFile(QString& file, bool bMsgBoxAskForExtraction = true, const char* pDestinationFilename = nullptr) = 0;
virtual void EditTextureFile(const char* txtureFile, bool bUseGameFolder) = 0;
- //! dcc filename calculation and extraction sub-routines
- virtual bool CalculateDccFilename(const QString& assetFilename, QString& dccFilename) = 0;
-
//! Reformat filter string for (MFC) CFileDialog style file filtering
virtual void FormatFilterString(QString& filter) = 0;
diff --git a/Code/Editor/Include/IRenderListener.h b/Code/Editor/Include/IRenderListener.h
deleted file mode 100644
index 892a42b701..0000000000
--- a/Code/Editor/Include/IRenderListener.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-// Description : Interface for rendering custom 3D elements in the main
-// render viewport. Particularly usefull for debug geometries.
-
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_IRENDERLISTENER_H
-#define CRYINCLUDE_EDITOR_INCLUDE_IRENDERLISTENER_H
-#pragma once
-
-
-struct DisplayContext;
-
-struct IRenderListener
- : public IUnknown
-{
- DEFINE_UUID(0x8D52F857, 0x1027, 0x4346, 0xAC, 0x7B, 0xF6, 0x20, 0xDA, 0x7C, 0xCE, 0x42)
-
- virtual void Render(DisplayContext& rDisplayContext) = 0;
-};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_IRENDERLISTENER_H
diff --git a/Code/Editor/Include/ITextureDatabaseUpdater.h b/Code/Editor/Include/ITextureDatabaseUpdater.h
deleted file mode 100644
index 4482135b47..0000000000
--- a/Code/Editor/Include/ITextureDatabaseUpdater.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
-
-// Description : This file declares the interface used by the texture viewer
-// and (implemented first implemented by the Texture Database Creator) to
-// syncronize their threads. A thread interace could be useful there.
-
-#ifndef CRYINCLUDE_EDITOR_INCLUDE_ITEXTUREDATABASEUPDATER_H
-#define CRYINCLUDE_EDITOR_INCLUDE_ITEXTUREDATABASEUPDATER_H
-#pragma once
-
-
-class CTextureDatabaseItem;
-
-struct ITextureDatabaseUpdater
-{
-public:
- //////////////////////////////////////////////////////////////////////////
- // Thread control
- virtual void NotifyShutDown() = 0;
- virtual void Lock() = 0;
- virtual void Unlock() = 0;
- virtual void WaitForThread() = 0;
- //////////////////////////////////////////////////////////////////////////
-
- //////////////////////////////////////////////////////////////////////////
- // Data access
- virtual CTextureDatabaseItem* GetItem(const char* szAddItem) = 0;
- //////////////////////////////////////////////////////////////////////////
-};
-
-#endif // CRYINCLUDE_EDITOR_INCLUDE_ITEXTUREDATABASEUPDATER_H
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..aaee34c2c6 100644
--- a/Code/Editor/Lib/Tests/IEditorMock.h
+++ b/Code/Editor/Lib/Tests/IEditorMock.h
@@ -85,9 +85,6 @@ public:
MOCK_METHOD0(IsSelectionLocked, bool());
MOCK_METHOD0(GetObjectManager, struct IObjectManager* ());
MOCK_METHOD0(GetSettingsManager, CSettingsManager* ());
- MOCK_METHOD1(GetDBItemManager, IDataBaseManager* (EDataBaseItemType));
- MOCK_METHOD0(GetMaterialManagerLibrary, IBaseLibraryManager* ());
- MOCK_METHOD0(GetIEditorMaterialManager, IEditorMaterialManager* ());
MOCK_METHOD0(GetIconManager, IIconManager* ());
MOCK_METHOD0(GetMusicManager, CMusicManager* ());
MOCK_METHOD2(GetTerrainElevation, float(float , float ));
@@ -187,6 +184,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 fd65634d4e..b73cb039ea 100644
--- a/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp
+++ b/Code/Editor/Lib/Tests/test_DisplaySettingsPythonBindings.cpp
@@ -35,6 +35,11 @@ namespace DisplaySettingsPythonBindingsUnitTests
m_app.Start(appDesc);
m_app.RegisterComponentDescriptor(AzToolsFramework::DisplaySettingsPythonFuncsHandler::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/LightmapCompiler/SimpleTriangleRasterizer.cpp b/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.cpp
deleted file mode 100644
index 736465cac1..0000000000
--- a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.cpp
+++ /dev/null
@@ -1,506 +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 "SimpleTriangleRasterizer.h"
-
-#include
-
-#if !defined FLT_MAX
-#define FLT_MAX 3.402823466e+38F
-#endif
-
-void CSimpleTriangleRasterizer::lambertHorizlineConservative(float fx1, float fx2, int yy, IRasterizeSink* inpSink)
-{
- int x1 = (int)floorf(fx1 + 0.25f), x2 = (int)floorf(fx2 + .75f);
-
- if (x1 < m_iMinX)
- {
- x1 = m_iMinX;
- }
- if (x2 > m_iMaxX + 1)
- {
- x2 = m_iMaxX + 1;
- }
- if (x1 > m_iMaxX + 1)
- {
- x1 = m_iMaxX + 1;
- }
- if (x2 < m_iMinX)
- {
- x2 = m_iMinX;
- }
-
-
- inpSink->Line(fx1, fx2, x1, x2, yy);
-}
-
-void CSimpleTriangleRasterizer::lambertHorizlineSubpixelCorrect(float fx1, float fx2, int yy, IRasterizeSink* inpSink)
-{
- int x1 = (int)floorf(fx1 + 0.5f), x2 = (int)floorf(fx2 + 0.5f);
- // int x1=(int)floorf(fx1*1023.f/1024.f+1.f),x2=(int)floorf(fx2*1023.f/1024.f+1.f);
-
- if (x1 < m_iMinX)
- {
- x1 = m_iMinX;
- }
- if (x2 > m_iMaxX)
- {
- x2 = m_iMaxX;
- }
- if (x1 > m_iMaxX)
- {
- x1 = m_iMaxX;
- }
- if (x2 < m_iMinX)
- {
- x2 = m_iMinX;
- }
-
- inpSink->Line(fx1, fx2, x1, x2, yy);
-}
-
-// optimizable
-void CSimpleTriangleRasterizer::CopyAndSortY(const float infX[3], const float infY[3], float outfX[3], float outfY[3])
-{
- outfX[0] = infX[0];
- outfY[0] = infY[0];
- outfX[1] = infX[1];
- outfY[1] = infY[1];
- outfX[2] = infX[2];
- outfY[2] = infY[2];
-
- // Sort the coordinates, so that (x[1], y[1]) becomes the highest coord
- float tmp;
-
- if (outfY[0] > outfY[1])
- {
- if (outfY[1] > outfY[2])
- {
- tmp = outfY[0];
- outfY[0] = outfY[1];
- outfY[1] = tmp;
- tmp = outfX[0];
- outfX[0] = outfX[1];
- outfX[1] = tmp;
- tmp = outfY[1];
- outfY[1] = outfY[2];
- outfY[2] = tmp;
- tmp = outfX[1];
- outfX[1] = outfX[2];
- outfX[2] = tmp;
-
- if (outfY[0] > outfY[1])
- {
- tmp = outfY[0];
- outfY[0] = outfY[1];
- outfY[1] = tmp;
- tmp = outfX[0];
- outfX[0] = outfX[1];
- outfX[1] = tmp;
- }
- }
- else
- {
- tmp = outfY[0];
- outfY[0] = outfY[1];
- outfY[1] = tmp;
- tmp = outfX[0];
- outfX[0] = outfX[1];
- outfX[1] = tmp;
-
- if (outfY[1] > outfY[2])
- {
- tmp = outfY[1];
- outfY[1] = outfY[2];
- outfY[2] = tmp;
- tmp = outfX[1];
- outfX[1] = outfX[2];
- outfX[2] = tmp;
- }
- }
- }
- else
- {
- if (outfY[1] > outfY[2])
- {
- tmp = outfY[1];
- outfY[1] = outfY[2];
- outfY[2] = tmp;
- tmp = outfX[1];
- outfX[1] = outfX[2];
- outfX[2] = tmp;
-
- if (outfY[0] > outfY[1])
- {
- tmp = outfY[0];
- outfY[0] = outfY[1];
- outfY[1] = tmp;
- tmp = outfX[0];
- outfX[0] = outfX[1];
- outfX[1] = tmp;
- }
- }
- }
-}
-
-void CSimpleTriangleRasterizer::CallbackFillRectConservative(float _x[3], float _y[3], IRasterizeSink* inpSink)
-{
- inpSink->Triangle(m_iMinY);
-
- float fMinX = (std::min)(_x[0], (std::min)(_x[1], _x[2]));
- float fMaxX = (std::max)(_x[0], (std::max)(_x[1], _x[2]));
- float fMinY = (std::min)(_y[0], (std::min)(_y[1], _y[2]));
- float fMaxY = (std::max)(_y[0], (std::max)(_y[1], _y[2]));
-
- int iMinX = (std::max)(m_iMinX, (int)floorf(fMinX));
- int iMaxX = (std::min)(m_iMaxX + 1, (int)ceilf(fMaxX));
- int iMinY = (std::max)(m_iMinY, (int)floorf(fMinY));
- int iMaxY = (std::min)(m_iMaxY + 1, (int)ceilf(fMaxY));
-
- for (int y = iMinY; y < iMaxY; y++)
- {
- inpSink->Line(fMinX, fMaxX, iMinX, iMaxX, y);
- }
-}
-
-
-
-
-void CSimpleTriangleRasterizer::CallbackFillConservative(float _x[3], float _y[3], IRasterizeSink* inpSink)
-{
- float x[3], y[3];
-
- CopyAndSortY(_x, _y, x, y);
-
- // Calculate interpolation steps
- float fX1toX2step = 0.0f;
- float fX1toX3step = 0.0f;
- float fX2toX3step = 0.0f;
- if (fabsf(y[1] - y[0]) > FLT_EPSILON)
- {
- fX1toX2step = (x[1] - x[0]) / (float)(y[1] - y[0]);
- }
- if (fabsf(y[2] - y[0]) > FLT_EPSILON)
- {
- fX1toX3step = (x[2] - x[0]) / (float)(y[2] - y[0]);
- }
- if (fabsf(y[2] - y[1]) > FLT_EPSILON)
- {
- fX2toX3step = (x[2] - x[1]) / (float)(y[2] - y[1]);
- }
-
- float fX1toX2 = x[0], fX1toX3 = x[0], fX2toX3 = x[1];
- bool bFirstLine = true;
- bool bTriangleCallDone = false;
-
- // Go through the scanlines of the triangle
- int yy = (int)floorf(y[0]); // was floor
-
- for (; yy <= (int)floorf(y[2]); yy++)
- // for(yy=m_iMinY; yy<=m_iMaxY; yy++) // juhu
- {
- float fSubPixelYStart = 0.0f, fSubPixelYEnd = 1.0f;
- float start, end;
-
- // first line
- if (bFirstLine)
- {
- fSubPixelYStart = y[0] - floorf(y[0]);
- start = x[0];
- end = x[0];
- bFirstLine = false;
- }
- else
- {
- // top part without middle corner line
- if (yy <= (int)floorf(y[1]))
- {
- start = (std::min)(fX1toX2, fX1toX3);
- end = (std::max)(fX1toX2, fX1toX3);
- }
- else
- {
- start = (std::min)(fX2toX3, fX1toX3);
- end = (std::max)(fX2toX3, fX1toX3);
- }
- }
-
- // middle corner line
- if (yy == (int)floorf(y[1]))
- {
- fSubPixelYEnd = y[1] - floorf(y[1]);
-
- fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart);
- start = (std::min)(start, fX1toX3);
- end = (std::max)(end, fX1toX3);
- start = (std::min)(start, x[1]);
- end = (std::max)(end, x[1]);
-
- fSubPixelYStart = fSubPixelYEnd;
- fSubPixelYEnd = 1.0f;
- }
-
- // last line
- if (yy == (int)floorf(y[2]))
- {
- start = (std::min)(start, x[2]);
- end = (std::max)(end, x[2]);
- }
- else
- {
- // top part without middle corner line
- if (yy < (int)floorf(y[1]))
- {
- fX1toX2 += fX1toX2step * (fSubPixelYEnd - fSubPixelYStart);
- start = (std::min)(start, fX1toX2);
- end = (std::max)(end, fX1toX2);
- }
- else
- {
- fX2toX3 += fX2toX3step * (fSubPixelYEnd - fSubPixelYStart);
- start = (std::min)(start, fX2toX3);
- end = (std::max)(end, fX2toX3);
- }
-
- fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart);
- start = (std::min)(start, fX1toX3);
- end = (std::max)(end, fX1toX3);
- }
-
- if (yy >= m_iMinY && yy <= m_iMaxY)
- {
- if (!bTriangleCallDone)
- {
- inpSink->Triangle(yy);
- bTriangleCallDone = true;
- }
-
- lambertHorizlineConservative(start, end, yy, inpSink);
- }
- }
-}
-
-
-
-void CSimpleTriangleRasterizer::CallbackFillSubpixelCorrect(float _x[3], float _y[3], IRasterizeSink* inpSink)
-{
- float x[3], y[3];
-
- CopyAndSortY(_x, _y, x, y);
-
- if (fabs(y[0] - floorf(y[0])) < FLT_EPSILON)
- {
- y[0] -= FLT_EPSILON;
- }
-
- // Calculate interpolation steps
- float fX1toX2step = 0.0f;
- float fX1toX3step = 0.0f;
- float fX2toX3step = 0.0f;
- if (fabsf(y[1] - y[0]) > FLT_EPSILON)
- {
- fX1toX2step = (x[1] - x[0]) / (y[1] - y[0]);
- }
- if (fabsf(y[2] - y[0]) > FLT_EPSILON)
- {
- fX1toX3step = (x[2] - x[0]) / (y[2] - y[0]);
- }
- if (fabsf(y[2] - y[1]) > FLT_EPSILON)
- {
- fX2toX3step = (x[2] - x[1]) / (y[2] - y[1]);
- }
-
- float fX1toX2 = x[0], fX1toX3 = x[0], fX2toX3 = x[1];
- bool bFirstLine = true;
- bool bTriangleCallDone = false;
-
- y[0] -= 0.5f;
- y[1] -= 0.5f;
- y[2] -= 0.5f;
- // y[0]=y[0]*1023.f/1024.f+1.f;
- // y[1]=y[1]*1023.f/1024.f+1.f;
- // y[2]=y[2]*1023.f/1024.f+1.f;
-
- for (int yy = (int)floorf(y[0]); yy <= (int)floorf(y[2]); yy++)
- {
- float fSubPixelYStart = 0.0f, fSubPixelYEnd = 1.0f;
- float start, end;
-
- // first line
- if (bFirstLine)
- {
- fSubPixelYStart = y[0] - floorf(y[0]);
- start = x[0];
- end = x[0];
- bFirstLine = false;
- }
- else
- {
- // top part without middle corner line
- if (yy <= (int)floorf(y[1]))
- {
- start = (std::min)(fX1toX2, fX1toX3);
- end = (std::max)(fX1toX2, fX1toX3);
- }
- else
- {
- start = (std::min)(fX2toX3, fX1toX3);
- end = (std::max)(fX2toX3, fX1toX3);
- }
- }
-
- // middle corner line
- if (yy == (int)floorf(y[1]))
- {
- fSubPixelYEnd = y[1] - floorf(y[1]);
-
- fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart);
-
- fSubPixelYStart = fSubPixelYEnd;
- fSubPixelYEnd = 1.0f;
- }
-
- // last line
- if (yy != (int)floorf(y[2]))
- {
- // top part without middle corner line
- if (yy < (int)floorf(y[1]))
- {
- fX1toX2 += fX1toX2step * (fSubPixelYEnd - fSubPixelYStart);
- }
- else
- {
- fX2toX3 += fX2toX3step * (fSubPixelYEnd - fSubPixelYStart);
- }
-
- fX1toX3 += fX1toX3step * (fSubPixelYEnd - fSubPixelYStart);
- }
-
- if (start != end)
- {
- if (yy >= m_iMinY && yy <= m_iMaxY)
- {
- if (!bTriangleCallDone)
- {
- inpSink->Triangle(yy);
- bTriangleCallDone = true;
- }
-
- lambertHorizlineSubpixelCorrect(start, end, yy, inpSink);
- }
- }
- }
-}
-
-
-
-
-// shrink triangle by n pixel, optimizable
-void CSimpleTriangleRasterizer::ShrinkTriangle(float inoutfX[3], float inoutfY[3], float infAmount)
-{
- float fX[3] = { inoutfX[0], inoutfX[1], inoutfX[2] };
- float fY[3] = { inoutfY[0], inoutfY[1], inoutfY[2] };
-
- /*
- // move edge to opposing vertex
- float dx,dy,fLength;
-
- for(int a=0;a<3;a++)
- {
- int b=a+1;if(b>=3)b=0;
- int c=b+1;if(c>=3)c=0;
-
- dx=fX[a]-(fX[b]+fX[c])*0.5f;
- dy=fY[a]-(fY[b]+fY[c])*0.5f;
- fLength=(float)sqrt(dx*dx+dy*dy);
- if(fLength>1.0f)
- {
- dx/=fLength;dy/=fLength;
- inoutfX[b]+=dx;inoutfY[b]+=dy;
- inoutfX[c]+=dx;inoutfY[c]+=dy;
- }
- }
- */
-
- /*
- // move vertex to opposing edge
- float dx,dy,fLength;
-
- for(int a=0;a<3;a++)
- {
- int b=a+1;if(b>=3)b=0;
- int c=b+1;if(c>=3)c=0;
-
- dx=fX[a]-(fX[b]+fX[c])*0.5f;
- dy=fY[a]-(fY[b]+fY[c])*0.5f;
- fLength=(float)sqrt(dx*dx+dy*dy);
- if(fLength>1.0f)
- {
- dx/=fLength;dy/=fLength;
- inoutfX[a]-=dx;inoutfY[a]-=dy;
- }
- }
- */
-
- // move vertex to get edges shifted perpendicular for 1 unit
- for (int a = 0; a < 3; a++)
- {
- float dx1, dy1, dx2, dy2, fLength;
-
- int b = a + 1;
- if (b >= 3)
- {
- b = 0;
- }
- int c = b + 1;
- if (c >= 3)
- {
- c = 0;
- }
-
- dx1 = fX[b] - fX[a];
- dy1 = fY[b] - fY[a];
- fLength = (float)sqrt(dx1 * dx1 + dy1 * dy1);
- if (infAmount > 0)
- {
- if (fLength < infAmount)
- {
- continue;
- }
- }
- if (fLength == 0.0f)
- {
- continue;
- }
- dx1 /= fLength;
- dy1 /= fLength;
-
- dx2 = fX[c] - fX[a];
- dy2 = fY[c] - fY[a];
- fLength = (float)sqrt(dx2 * dx2 + dy2 * dy2);
- if (infAmount > 0)
- {
- if (fLength < infAmount)
- {
- continue;
- }
- }
- if (fLength == 0.0f)
- {
- continue;
- }
- dx2 /= fLength;
- dy2 /= fLength;
-
- inoutfX[a] += (dx1 + dx2) * infAmount;
- inoutfY[a] += (dy1 + dy2) * infAmount;
- }
-}
diff --git a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h b/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h
deleted file mode 100644
index bcfdd7b6da..0000000000
--- a/Code/Editor/LightmapCompiler/SimpleTriangleRasterizer.h
+++ /dev/null
@@ -1,181 +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_EDITOR_LIGHTMAPCOMPILER_SIMPLETRIANGLERASTERIZER_H
-#define CRYINCLUDE_EDITOR_LIGHTMAPCOMPILER_SIMPLETRIANGLERASTERIZER_H
-#pragma once
-
-class CSimpleTriangleRasterizer
-{
-public:
-
- class IRasterizeSink
- {
- public:
-
- //! is called once per triangel for the first possible visible line
- //! /param iniStartY
- virtual void Triangle([[maybe_unused]] const int iniStartY)
- {
- }
-
- //! callback function
- //! /param infXLeft included - not clipped against left and reight border
- //! /param infXRight excluded - not clipped against left and reight border
- //! /param iniXLeft included
- //! /param iniXRight excluded
- //! /param iniY
- virtual void Line(const float infXLeft, const float infXRight,
- const int iniXLeft, const int iniXRight, const int iniY) = 0;
- };
-
- typedef unsigned long DWORD;
-
- // -----------------------------------------------------
-
- //! implementation sink sample
- class CDWORDFlatFill
- : public IRasterizeSink
- {
- public:
-
- //! constructor
- CDWORDFlatFill(DWORD* inpBuffer, const DWORD indwPitchInPixels, DWORD indwValue)
- {
- m_dwValue = indwValue;
- m_pBuffer = inpBuffer;
- m_dwPitchInPixels = indwPitchInPixels;
- }
-
- virtual void Triangle(const int iniY)
- {
- m_pBufferLine = &m_pBuffer[iniY * m_dwPitchInPixels];
- }
-
- virtual void Line([[maybe_unused]] const float infXLeft, [[maybe_unused]] const float infXRight,
- const int iniLeft, const int iniRight, [[maybe_unused]] const int iniY)
- {
- DWORD* mem = &m_pBufferLine[iniLeft];
-
- for (int x = iniLeft; x < iniRight; x++)
- {
- *mem++ = m_dwValue;
- }
-
- m_pBufferLine += m_dwPitchInPixels;
- }
-
- private:
- DWORD m_dwValue; //!< fill value
- DWORD* m_pBufferLine; //!< to get rid of the multiplication per line
-
- DWORD m_dwPitchInPixels; //!< in DWORDS, not in Bytes
- DWORD* m_pBuffer; //!< pointer to the buffer
- };
-
- // -----------------------------------------------------
-
- //! constructor
- //! /param iniWidth excluded
- //! /param iniHeight excluded
- CSimpleTriangleRasterizer(const int iniWidth, const int iniHeight)
- {
- m_iMinX = 0;
- m_iMinY = 0;
- m_iMaxX = iniWidth - 1;
- m_iMaxY = iniHeight - 1;
- }
- /*
- //! constructor
- //! /param iniMinX included
- //! /param iniMinY included
- //! /param iniMaxX included
- //! /param iniMaxY included
- CSimpleTriangleRasterizer( const int iniMinX, const int iniMinY, const int iniMaxX, const int iniMaxY )
- {
- m_iMinX=iniMinX;
- m_iMinY=iniMinY;
- m_iMaxX=iniMaxX;
- m_iMaxY=iniMaxY;
- }
- */
- //! simple triangle filler with clipping (optimizable), not subpixel correct
- //! /param pBuffer pointer o the color buffer
- //! /param indwWidth width of the color buffer
- //! /param indwHeight height of the color buffer
- //! /param x array of the x coordiantes of the three vertices
- //! /param y array of the x coordiantes of the three vertices
- //! /param indwValue value of the triangle
- void DWORDFlatFill(DWORD* inpBuffer, const DWORD indwPitchInPixels, float x[3], float y[3], DWORD indwValue, bool inbConservative)
- {
- CDWORDFlatFill pix(inpBuffer, indwPitchInPixels, indwValue);
-
- if (inbConservative)
- {
- CallbackFillConservative(x, y, &pix);
- }
- else
- {
- CallbackFillSubpixelCorrect(x, y, &pix);
- }
- }
-
- // Rectangle around triangle - more stable - use for debugging purpose
- void CallbackFillRectConservative(float x[3], float y[3], IRasterizeSink * inpSink);
-
-
- //! subpixel correct triangle filler (conservative or not conservative)
- //! \param pBuffer pointe to the DWORD
- //! \param indwWidth width of the buffer pBuffer pointes to
- //! \param indwHeight height of the buffer pBuffer pointes to
- //! \param x array of the x coordiantes of the three vertices
- //! \param y array of the x coordiantes of the three vertices
- //! \param inpSink pointer to the sink interface (is called per triangle and per triangle line)
- void CallbackFillConservative(float x[3], float y[3], IRasterizeSink * inpSink);
-
- //! subpixel correct triangle filler (conservative or not conservative)
- //! \param pBuffer pointe to the DWORD
- //! \param indwWidth width of the buffer pBuffer pointes to
- //! \param indwHeight height of the buffer pBuffer pointes to
- //! \param x array of the x coordiantes of the three vertices
- //! \param y array of the x coordiantes of the three vertices
- //! \param inpSink pointer to the sink interface (is called per triangle and per triangle line)
- void CallbackFillSubpixelCorrect(float x[3], float y[3], IRasterizeSink * inpSink);
-
- //!
- //! /param inoutfX
- //! /param inoutfY
- //! /param infAmount could be positive or negative
- static void ShrinkTriangle(float inoutfX[3], float inoutfY[3], float infAmount);
-
-private:
-
- // Clipping Rect;
-
- int m_iMinX; //!< minimum x value included
- int m_iMinY; //!< minimum y value included
- int m_iMaxX; //!< maximum x value included
- int m_iMaxY; //!< maximum x value included
-
- void lambertHorizlineConservative(float fx1, float fx2, int y, IRasterizeSink* inpSink);
- void lambertHorizlineSubpixelCorrect(float fx1, float fx2, int y, IRasterizeSink* inpSink);
- void CopyAndSortY(const float infX[3], const float infY[3], float outfX[3], float outfY[3]);
-};
-
-
-// extension ideas:
-// * callback with coverage mask (possible non ordered sampling)
-// * z-buffer behaviour
-// * gouraud shading
-// * texture mapping with nearest/bicubic/bilinear filter
-// * further primitives: thick line, ellipse
-// * build a template version
-// *
-
-#endif // CRYINCLUDE_EDITOR_LIGHTMAPCOMPILER_SIMPLETRIANGLERASTERIZER_H
diff --git a/Code/Editor/MainWindow.cpp b/Code/Editor/MainWindow.cpp
index f92e39f285..bbebac96a3 100644
--- a/Code/Editor/MainWindow.cpp
+++ b/Code/Editor/MainWindow.cpp
@@ -643,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()
@@ -677,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..."));
diff --git a/Code/Editor/MainWindow.qrc b/Code/Editor/MainWindow.qrc
index 4506a4a2a8..c68e05ef41 100644
--- a/Code/Editor/MainWindow.qrc
+++ b/Code/Editor/MainWindow.qrc
@@ -166,7 +166,6 @@
arhitype_tree_01.png
arhitype_tree_02.png
arhitype_tree_03.png
- water.png
bmp00005_00.png
bmp00005_01.png
bmp00005_02.png
diff --git a/Code/Editor/NewLevelDialog.cpp b/Code/Editor/NewLevelDialog.cpp
index c773acdb6f..a97eb30f57 100644
--- a/Code/Editor/NewLevelDialog.cpp
+++ b/Code/Editor/NewLevelDialog.cpp
@@ -115,7 +115,6 @@ CNewLevelDialog::~CNewLevelDialog()
void CNewLevelDialog::OnStartup()
{
UpdateData(false);
- setFocus();
}
void CNewLevelDialog::UpdateData(bool fromUi)
diff --git a/Code/Editor/NewLevelDialog.ui b/Code/Editor/NewLevelDialog.ui
index 14227fbb53..93a88dc897 100644
--- a/Code/Editor/NewLevelDialog.ui
+++ b/Code/Editor/NewLevelDialog.ui
@@ -133,6 +133,9 @@
1
+
+ LEVEL
+
diff --git a/Code/Editor/Objects/BaseObject.cpp b/Code/Editor/Objects/BaseObject.cpp
index 86840789dd..c14547407b 100644
--- a/Code/Editor/Objects/BaseObject.cpp
+++ b/Code/Editor/Objects/BaseObject.cpp
@@ -36,12 +36,6 @@
// To use the Andrew's algorithm in order to make convex hull from the points, this header is needed.
#include "Util/GeometryUtil.h"
-namespace {
- QColor kLinkColorParent = QColor(0, 255, 255);
- QColor kLinkColorChild = QColor(0, 0, 255);
- QColor kLinkColorGray = QColor(128, 128, 128);
-}
-
extern CObjectManager* g_pObjectManager;
//////////////////////////////////////////////////////////////////////////
@@ -761,72 +755,6 @@ void CBaseObject::SetModified(bool)
{
}
-void CBaseObject::DrawDefault(DisplayContext& dc, const QColor& labelColor)
-{
- Vec3 wp = GetWorldPos();
-
- bool bDisplaySelectionHelper = false;
- if (!CanBeDrawn(dc, bDisplaySelectionHelper))
- {
- return;
- }
-
- // Draw link between parent and child.
- if (dc.flags & DISPLAY_LINKS)
- {
- if (GetParent())
- {
- dc.DrawLine(GetParentAttachPointWorldTM().GetTranslation(), wp, IsFrozen() ? kLinkColorGray : kLinkColorParent, IsFrozen() ? kLinkColorGray : kLinkColorChild);
- }
- size_t nChildCount = GetChildCount();
- for (size_t i = 0; i < nChildCount; ++i)
- {
- const CBaseObject* pChild = GetChild(i);
- dc.DrawLine(pChild->GetParentAttachPointWorldTM().GetTranslation(), pChild->GetWorldPos(), pChild->IsFrozen() ? kLinkColorGray : kLinkColorParent, pChild->IsFrozen() ? kLinkColorGray : kLinkColorChild);
- }
- }
-
- // Draw Bounding box
- if (dc.flags & DISPLAY_BBOX)
- {
- AABB box;
- GetBoundBox(box);
- dc.SetColor(Vec3(1, 1, 1));
- dc.DrawWireBox(box.min, box.max);
- }
-
- if (IsHighlighted())
- {
- DrawHighlight(dc);
- }
-
- if (IsSelected())
- {
- DrawArea(dc);
-
- CSelectionGroup* pSelection = GetObjectManager()->GetSelection();
-
- // If the number of selected object is over 2, the merged boundbox should be used to render the measurement axis.
- if (!pSelection || (pSelection && pSelection->GetCount() == 1))
- {
- DrawDimensions(dc);
- }
- }
-
- if (bDisplaySelectionHelper)
- {
- DrawSelectionHelper(dc, wp, labelColor, 1.0f);
- }
- else if (!(dc.flags & DISPLAY_HIDENAMES))
- {
- DrawLabel(dc, wp, labelColor);
- }
-
- SetDrawTextureIconProperties(dc, wp);
- DrawTextureIcon(dc, wp);
- DrawWarningIcons(dc, wp);
-}
-
//////////////////////////////////////////////////////////////////////////
void CBaseObject::DrawDimensions(DisplayContext&, AABB*)
{
@@ -850,91 +778,6 @@ void CBaseObject::DrawSelectionHelper(DisplayContext& dc, const Vec3& pos, const
dc.SetState(nPrevState);
}
-//////////////////////////////////////////////////////////////////////////
-void CBaseObject::SetDrawTextureIconProperties(DisplayContext& dc, const Vec3& pos, float alpha, int texIconFlags)
-{
- if (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons)
- {
- if (IsHighlighted())
- {
- dc.SetColor(QColor(255, 120, 0), 0.8f * alpha);
- }
- else if (IsSelected())
- {
- dc.SetSelectedColor(alpha);
- }
- else if (IsFrozen())
- {
- dc.SetFreezeColor();
- }
- else
- {
- dc.SetColor(QColor(255, 255, 255), alpha);
- }
-
- m_vDrawIconPos = pos;
-
- int nIconFlags = texIconFlags;
- if (CheckFlags(OBJFLAG_SHOW_ICONONTOP))
- {
- Vec3 objectPos = GetWorldPos();
-
- AABB box;
- GetBoundBox(box);
- m_vDrawIconPos.z = (m_vDrawIconPos.z - objectPos.z) + box.max.z;
- nIconFlags |= DisplayContext::TEXICON_ALIGN_BOTTOM;
- }
- m_nIconFlags = nIconFlags;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CBaseObject::DrawTextureIcon(DisplayContext& dc, [[maybe_unused]] const Vec3& pos, [[maybe_unused]] float alpha)
-{
- if (m_nTextureIcon && (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons))
- {
- dc.DrawTextureLabel(GetTextureIconDrawPos(), OBJECT_TEXTURE_ICON_SIZEX, OBJECT_TEXTURE_ICON_SIZEY, GetTextureIcon(), GetTextureIconFlags());
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CBaseObject::DrawWarningIcons(DisplayContext& dc, const Vec3&)
-{
- if (gSettings.viewports.bShowIcons || gSettings.viewports.bShowSizeBasedIcons)
- {
- const int warningIconSizeX = OBJECT_TEXTURE_ICON_SIZEX / 2;
- const int warningIconSizeY = OBJECT_TEXTURE_ICON_SIZEY / 2;
-
- const int iconOffsetX = m_nTextureIcon ? (-OBJECT_TEXTURE_ICON_SIZEX / 2) : 0;
- const int iconOffsetY = m_nTextureIcon ? (-OBJECT_TEXTURE_ICON_SIZEY / 2) : 0;
-
- if (gSettings.viewports.bShowScaleWarnings)
- {
- const EScaleWarningLevel scaleWarningLevel = GetScaleWarningLevel();
-
- if (scaleWarningLevel != eScaleWarningLevel_None)
- {
- dc.SetColor(QColor(255, scaleWarningLevel == eScaleWarningLevel_RescaledNonUniform ? 50 : 255, 50), 1.0f);
- dc.DrawTextureLabel(GetTextureIconDrawPos(), warningIconSizeX, warningIconSizeY,
- GetIEditor()->GetIconManager()->GetIconTexture(eIcon_ScaleWarning), GetTextureIconFlags(),
- -warningIconSizeX / 2, iconOffsetX - (warningIconSizeY / 2));
- }
- }
-
- if (gSettings.viewports.bShowRotationWarnings)
- {
- const ERotationWarningLevel rotationWarningLevel = GetRotationWarningLevel();
- if (rotationWarningLevel != eRotationWarningLevel_None)
- {
- dc.SetColor(QColor(255, rotationWarningLevel == eRotationWarningLevel_RotatedNonRectangular ? 50 : 255, 50), 1.0f);
- dc.DrawTextureLabel(GetTextureIconDrawPos(), warningIconSizeX, warningIconSizeY,
- GetIEditor()->GetIconManager()->GetIconTexture(eIcon_RotationWarning), GetTextureIconFlags(),
- warningIconSizeX / 2, iconOffsetY - (warningIconSizeY / 2));
- }
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////
void CBaseObject::DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& lC, float alpha, float size)
{
diff --git a/Code/Editor/Objects/BaseObject.h b/Code/Editor/Objects/BaseObject.h
index f78755e81d..fea248c7f7 100644
--- a/Code/Editor/Objects/BaseObject.h
+++ b/Code/Editor/Objects/BaseObject.h
@@ -398,9 +398,6 @@ public:
// Interface to be implemented in plugins.
//////////////////////////////////////////////////////////////////////////
- //! Draw object to specified viewport.
- virtual void Display([[maybe_unused]] DisplayContext& disp) {}
-
//! Perform intersection testing of this object.
//! Return true if was hit.
virtual bool HitTest([[maybe_unused]] HitContext& hc) { return false; };
@@ -529,8 +526,6 @@ protected:
void ResolveParent(CBaseObject* object);
void SetColor(const QColor& color);
- //! Draw default object items.
- virtual void DrawDefault(DisplayContext& dc, const QColor& labelColor = QColor(255, 255, 255));
//! Draw object label.
void DrawLabel(DisplayContext& dc, const Vec3& pos, const QColor& labelColor = QColor(255, 255, 255), float alpha = 1.0f, float size = 1.f);
//! Draw 3D Axis at object position.
@@ -539,10 +534,6 @@ protected:
void DrawArea(DisplayContext& dc);
//! Draw selection helper.
void DrawSelectionHelper(DisplayContext& dc, const Vec3& pos, const QColor& labelColor = QColor(255, 255, 255), float alpha = 1.0f);
- //! Draw helper icon.
- virtual void DrawTextureIcon(DisplayContext& dc, const Vec3& pos, float alpha = 1.0f);
- //! Draw warning icons
- virtual void DrawWarningIcons(DisplayContext& dc, const Vec3& pos);
//! Check if dimension's figures can be displayed before draw them.
virtual void DrawDimensions(DisplayContext& dc, AABB* pMergedBoundBox = nullptr);
@@ -575,7 +566,6 @@ protected:
//! Only used by ObjectManager.
bool IsPotentiallyVisible() const;
- void SetDrawTextureIconProperties(DisplayContext& dc, const Vec3& pos, float alpha = 1.0f, int texIconFlags = 0);
const Vec3& GetTextureIconDrawPos(){ return m_vDrawIconPos; };
int GetTextureIconFlags(){ return m_nIconFlags; };
diff --git a/Code/Editor/Objects/EntityObject.h b/Code/Editor/Objects/EntityObject.h
index c3e379bccc..c6b7e4ce2d 100644
--- a/Code/Editor/Objects/EntityObject.h
+++ b/Code/Editor/Objects/EntityObject.h
@@ -27,6 +27,7 @@
#define CLASS_ENVIRONMENT_LIGHT "EnvironmentLight"
class CEntityObject;
+class CSelectionGroup;
class QMenu;
/*!
diff --git a/Code/Editor/Objects/ObjectLoader.h b/Code/Editor/Objects/ObjectLoader.h
index fc1014ad03..fa576fa983 100644
--- a/Code/Editor/Objects/ObjectLoader.h
+++ b/Code/Editor/Objects/ObjectLoader.h
@@ -13,6 +13,8 @@
#include "ErrorReport.h"
#include
+#include
+
class CErrorRecord;
struct IObjectManager;
diff --git a/Code/Editor/Objects/ObjectManager.cpp b/Code/Editor/Objects/ObjectManager.cpp
index 1dea6ece7f..06233d4dd2 100644
--- a/Code/Editor/Objects/ObjectManager.cpp
+++ b/Code/Editor/Objects/ObjectManager.cpp
@@ -26,7 +26,6 @@
#include "Util/Image.h"
#include "ObjectManagerLegacyUndo.h"
#include "Include/HitContext.h"
-#include "EditMode/DeepSelection.h"
#include "Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h"
#include
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/Objects/ComponentEntityObject.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp
index fbb700723b..a70c200417 100644
--- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp
+++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.cpp
@@ -723,97 +723,6 @@ CComponentEntityObject* CComponentEntityObject::FindObjectForEntity(AZ::EntityId
return nullptr;
}
-void CComponentEntityObject::Display(DisplayContext& dc)
-{
- if (!(dc.flags & DISPLAY_2D))
- {
- m_entityIconVisible = false;
- }
-
- bool displaySelectionHelper = false;
- if (!CanBeDrawn(dc, displaySelectionHelper))
- {
- return;
- }
-
- DrawDefault(dc);
-
- bool showIcons = m_hasIcon;
- if (showIcons)
- {
- SEditorSettings* editorSettings = GetIEditor()->GetEditorSettings();
- if (!editorSettings->viewports.bShowIcons && !editorSettings->viewports.bShowSizeBasedIcons)
- {
- showIcons = false;
- }
- }
-
- if (m_entityId.IsValid())
- {
- // Draw link to parent if this or the parent object are selected.
- {
- AZ::EntityId parentId;
- EBUS_EVENT_ID_RESULT(parentId, m_entityId, AZ::TransformBus, GetParentId);
- if (parentId.IsValid())
- {
- bool isParentVisible = false;
- AzToolsFramework::EditorEntityInfoRequestBus::EventResult(isParentVisible, parentId, &AzToolsFramework::EditorEntityInfoRequestBus::Events::IsVisible);
-
- CComponentEntityObject* parentObject = CComponentEntityObject::FindObjectForEntity(parentId);
- if (isParentVisible && (IsSelected() || (parentObject && parentObject->IsSelected())))
- {
- const QColor kLinkColorParent(0, 255, 255);
- const QColor kLinkColorChild(0, 0, 255);
-
- AZ::Vector3 parentTranslation;
- EBUS_EVENT_ID_RESULT(parentTranslation, parentId, AZ::TransformBus, GetWorldTranslation);
- dc.DrawLine(AZVec3ToLYVec3(parentTranslation), GetWorldTM().GetTranslation(), kLinkColorParent, kLinkColorChild);
- }
- }
- }
-
- // Don't draw icons if we have an ancestor in the same location that has an icon - makes sure
- // ancestor icons draw on top and are able to be selected over children. Also check if a descendant
- // is selected at the same location. In cases of entity hierarchies where numerous ancestors have
- // no position offset, we need this so the ancestors don't draw over us when we're selected
- if (showIcons)
- {
- if ((dc.flags & DISPLAY_2D) ||
- IsSelected() ||
- IsAncestorIconDrawingAtSameLocation() ||
- IsDescendantSelectedAtSameLocation())
- {
- showIcons = false;
- }
- }
-
- // Allow components to override in-editor visualization.
- {
- const AzFramework::DisplayContextRequestGuard displayContextGuard(dc);
-
- AzFramework::DebugDisplayRequestBus::BusPtr debugDisplayBus;
- AzFramework::DebugDisplayRequestBus::Bind(
- debugDisplayBus, AzFramework::g_defaultSceneEntityDebugDisplayId);
- AZ_Assert(debugDisplayBus, "Invalid DebugDisplayRequestBus.");
-
- AzFramework::DebugDisplayRequests* debugDisplay =
- AzFramework::DebugDisplayRequestBus::FindFirstHandler(debugDisplayBus);
-
- AzFramework::EntityDebugDisplayEventBus::Event(
- m_entityId, &AzFramework::EntityDebugDisplayEvents::DisplayEntityViewport,
- AzFramework::ViewportInfo{ dc.GetView()->asCViewport()->GetViewportId() },
- *debugDisplay);
- }
- }
-}
-
-void CComponentEntityObject::DrawDefault(DisplayContext& dc, const QColor& labelColor)
-{
- CEntityObject::DrawDefault(dc, labelColor);
-
- DrawAccent(dc);
-}
-
bool CComponentEntityObject::IsIsolated() const
{
return m_isIsolated;
diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h
index 7ccea8da84..62209965a5 100644
--- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h
+++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/Objects/ComponentEntityObject.h
@@ -55,7 +55,6 @@ public:
bool SetRotation(const Quat& rotate, int flags) override;
bool SetScale(const Vec3& scale, int flags) override;
void InvalidateTM(int nWhyFlags) override;
- void Display(DisplayContext& disp) override;
bool HitTest(HitContext& hc) override;
void GetLocalBounds(AABB& box) override;
void GetBoundBox(AABB& box) override;
@@ -69,7 +68,6 @@ public:
void DetachThis(bool bKeepPos = true) override;
XmlNodeRef Export(const QString& levelPath, XmlNodeRef& xmlNode) override;
void DeleteEntity() override;
- void DrawDefault(DisplayContext& dc, const QColor& labelColor = QColor(255, 255, 255)) override;
bool IsIsolated() const override;
bool IsSelected() const override;
diff --git a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp
index 08d79adcf5..1c361b050d 100644
--- a/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp
+++ b/Code/Editor/Plugins/ComponentEntityEditorPlugin/UI/Outliner/OutlinerListModel.cpp
@@ -53,6 +53,7 @@
#include
#include
#include
+#include
#include "OutlinerDisplayOptionsMenu.h"
#include "OutlinerSortFilterProxyModel.hxx"
@@ -252,17 +253,7 @@ QVariant OutlinerListModel::dataForName(const QModelIndex& index, int role) cons
if (s_paintingName && !m_filterString.empty())
{
// highlight characters in filter
- int highlightTextIndex = 0;
- do
- {
- highlightTextIndex = label.lastIndexOf(QString(m_filterString.c_str()), highlightTextIndex - 1, Qt::CaseInsensitive);
- if (highlightTextIndex >= 0)
- {
- const QString BACKGROUND_COLOR{ "#707070" };
- label.insert(static_cast(highlightTextIndex + m_filterString.length()), "");
- label.insert(highlightTextIndex, "");
- }
- } while(highlightTextIndex > 0);
+ label = AzToolsFramework::RichTextHighlighter::HighlightText(label, m_filterString.c_str());
}
return label;
}
@@ -2609,16 +2600,11 @@ void OutlinerItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem&
optionV4.widget->style()->drawControl(QStyle::CE_ItemViewItem, &optionV4, painter);
// Now we setup a Text Document so it can draw the rich text
- QTextDocument textDoc;
- textDoc.setDefaultFont(optionV4.font);
- textDoc.setDefaultStyleSheet("body {color: white}");
- textDoc.setHtml("" + entityNameRichText + "");
int verticalOffset = GetEntityNameVerticalOffset(entityId);
painter->translate(textRect.topLeft() + QPoint(0, verticalOffset));
- textDoc.setTextWidth(textRect.width());
- textDoc.drawContents(painter, QRectF(0, 0, textRect.width(), textRect.height()));
- painter->restore();
+ AzToolsFramework::RichTextHighlighter::PaintHighlightedRichText(entityNameRichText, painter, optionV4, textRect);
+
OutlinerListModel::s_paintingName = false;
}
else
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 432f07a531..ef72bfc9be 100644
--- a/Code/Editor/Resource.h
+++ b/Code/Editor/Resource.h
@@ -196,7 +196,6 @@
#define ID_FILE_EXPORT_TERRAINAREA 33904
#define ID_FILE_EXPORT_TERRAINAREAWITHOBJECTS 33910
#define ID_FILE_EXPORT_SELECTEDOBJECTS 33911
-#define ID_TERRAIN_TIMEOFDAY 33912
#define ID_SPLINE_PREVIOUS_KEY 33916
#define ID_SPLINE_NEXT_KEY 33917
#define ID_SPLINE_FLATTEN_ALL 33918
@@ -290,7 +289,6 @@
#define ID_TV_TRACKS_TOOLBAR_LAST 35183 // for up to 100 "Add Tracks..." dynamically added Track View Track buttons
#define ID_OPEN_TERRAIN_EDITOR 36007
#define ID_OPEN_UICANVASEDITOR 36010
-#define ID_TERRAIN_TIMEOFDAYBUTTON 36011
#define ID_OPEN_TERRAINTEXTURE_EDITOR 36012
#define ID_SKINS_REFRESH 36014
#define ID_FILE_GENERATETERRAIN 36016
diff --git a/Code/Editor/Settings.cpp b/Code/Editor/Settings.cpp
index acb48c3545..8561e6dba3 100644
--- a/Code/Editor/Settings.cpp
+++ b/Code/Editor/Settings.cpp
@@ -142,9 +142,6 @@ SEditorSettings::SEditorSettings()
viewports.bShowMeshStatsOnMouseOver = false;
viewports.bDrawEntityLabels = false;
viewports.bShowTriggerBounds = false;
- viewports.bShowIcons = true;
- viewports.bDistanceScaleIcons = true;
- viewports.bShowSizeBasedIcons = false;
viewports.nShowFrozenHelpers = true;
viewports.bFillSelectedShapes = false;
viewports.nTopMapTextureResolution = 512;
@@ -534,8 +531,6 @@ void SEditorSettings::Save(bool isEditorClosing)
SaveValue("Settings", "ShowMeshStatsOnMouseOver", viewports.bShowMeshStatsOnMouseOver);
SaveValue("Settings", "DrawEntityLabels", viewports.bDrawEntityLabels);
SaveValue("Settings", "ShowTriggerBounds", viewports.bShowTriggerBounds);
- SaveValue("Settings", "ShowIcons", viewports.bShowIcons);
- SaveValue("Settings", "ShowSizeBasedIcons", viewports.bShowSizeBasedIcons);
SaveValue("Settings", "ShowFrozenHelpers", viewports.nShowFrozenHelpers);
SaveValue("Settings", "FillSelectedShapes", viewports.bFillSelectedShapes);
SaveValue("Settings", "MapTextureResolution", viewports.nTopMapTextureResolution);
@@ -736,8 +731,6 @@ void SEditorSettings::Load()
LoadValue("Settings", "ShowMeshStatsOnMouseOver", viewports.bShowMeshStatsOnMouseOver);
LoadValue("Settings", "DrawEntityLabels", viewports.bDrawEntityLabels);
LoadValue("Settings", "ShowTriggerBounds", viewports.bShowTriggerBounds);
- LoadValue("Settings", "ShowIcons", viewports.bShowIcons);
- LoadValue("Settings", "ShowSizeBasedIcons", viewports.bShowSizeBasedIcons);
LoadValue("Settings", "ShowFrozenHelpers", viewports.nShowFrozenHelpers);
LoadValue("Settings", "FillSelectedShapes", viewports.bFillSelectedShapes);
LoadValue("Settings", "MapTextureResolution", viewports.nTopMapTextureResolution);
diff --git a/Code/Editor/Settings.h b/Code/Editor/Settings.h
index 9276d9b715..0ebb70501d 100644
--- a/Code/Editor/Settings.h
+++ b/Code/Editor/Settings.h
@@ -136,13 +136,6 @@ struct SViewportsSettings
bool bDrawEntityLabels;
//! Show Trigger bounds.
bool bShowTriggerBounds;
- //! Show Icons in viewport.
- bool bShowIcons;
- //! Scale icons with distance, so they aren't a fixed size no matter how far away you are
- bool bDistanceScaleIcons;
-
- //! Show Size-based Icons in viewport.
- bool bShowSizeBasedIcons;
//! Show Helpers in viewport for frozen objects.
int nShowFrozenHelpers;
diff --git a/Code/Editor/TimeOfDay/main-00.png b/Code/Editor/TimeOfDay/main-00.png
deleted file mode 100644
index 2c44fec541..0000000000
--- a/Code/Editor/TimeOfDay/main-00.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5201dbba6c8114914ed680b04b72a5e18e22c0519a514bcccdc7ae8d32670b4e
-size 993
diff --git a/Code/Editor/TimeOfDay/main-01.png b/Code/Editor/TimeOfDay/main-01.png
deleted file mode 100644
index 5cc1bf33d8..0000000000
--- a/Code/Editor/TimeOfDay/main-01.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:48a7250ad41c5e298079ddd13910b58baca2ef592defcc162ccc9df542d28905
-size 981
diff --git a/Code/Editor/TimeOfDay/main-02.png b/Code/Editor/TimeOfDay/main-02.png
deleted file mode 100644
index b7d90648a3..0000000000
--- a/Code/Editor/TimeOfDay/main-02.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:98b9e9abcc54b4f3e6903ad74bb50f364bfe4c8cd9fedc9653a6603d64a1ee0a
-size 838
diff --git a/Code/Editor/TimeOfDay/main-03.png b/Code/Editor/TimeOfDay/main-03.png
deleted file mode 100644
index e073dbf60b..0000000000
--- a/Code/Editor/TimeOfDay/main-03.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:1199c834fc8de69f9d7c76e8c7fbd84e9b92713b9f07b513137085e5089432cb
-size 857
diff --git a/Code/Editor/TimeOfDay/main-04.png b/Code/Editor/TimeOfDay/main-04.png
deleted file mode 100644
index 6049dbfe18..0000000000
--- a/Code/Editor/TimeOfDay/main-04.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:79b44be1dbe5518e06dc8c8823d00462136d39ffe60a32ef4f64dc0712654d33
-size 646
diff --git a/Code/Editor/TimeOfDay/main-05.png b/Code/Editor/TimeOfDay/main-05.png
deleted file mode 100644
index 054419f39a..0000000000
--- a/Code/Editor/TimeOfDay/main-05.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:6ea7450c1a278570e2a1dba3a8b4d7d4e5f0d054e8371139ebdb5220c405d355
-size 537
diff --git a/Code/Editor/TimeOfDay/main-06.png b/Code/Editor/TimeOfDay/main-06.png
deleted file mode 100644
index 35f8afdae2..0000000000
--- a/Code/Editor/TimeOfDay/main-06.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:bc73f0720f2ff877aff5c6646938b7fc509a69d92e766fecb9fa010eecadee7b
-size 606
diff --git a/Code/Editor/TimeOfDay/main-07.png b/Code/Editor/TimeOfDay/main-07.png
deleted file mode 100644
index aca9597355..0000000000
--- a/Code/Editor/TimeOfDay/main-07.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e63519ed54fc19a4b4a2a38cb2c5f148b7404ac614d4aab039b71fee64cd7425
-size 569
diff --git a/Code/Editor/TimeOfDay/main-08.png b/Code/Editor/TimeOfDay/main-08.png
deleted file mode 100644
index abeb114fc2..0000000000
--- a/Code/Editor/TimeOfDay/main-08.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:8742cad4b8f8f5bba59abb9cc028db84de222ed8b393398f6837fea16bb4a1d8
-size 563
diff --git a/Code/Editor/TimeOfDay/main-09.png b/Code/Editor/TimeOfDay/main-09.png
deleted file mode 100644
index cc77b8c9e2..0000000000
--- a/Code/Editor/TimeOfDay/main-09.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:ef85628301b4edc4f858f0988e4f072772be3feb92d27a2ec33b72a27bcee7ff
-size 583
diff --git a/Code/Editor/TimeOfDay/main-10.png b/Code/Editor/TimeOfDay/main-10.png
deleted file mode 100644
index dc463c6497..0000000000
--- a/Code/Editor/TimeOfDay/main-10.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:d17bfbdee6d37566b241adf64241ef47b62145aaac3e9e8f9691d1fb866b5fcb
-size 717
diff --git a/Code/Editor/TimeOfDay/main-11.png b/Code/Editor/TimeOfDay/main-11.png
deleted file mode 100644
index d686ab18c8..0000000000
--- a/Code/Editor/TimeOfDay/main-11.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:98b629abf927bcea41d8857b1761d12a37836471d7106b2f5210337c0ace0d9c
-size 1103
diff --git a/Code/Editor/TimeOfDay/main-12.png b/Code/Editor/TimeOfDay/main-12.png
deleted file mode 100644
index 069510ab24..0000000000
--- a/Code/Editor/TimeOfDay/main-12.png
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:e949111b33e28834995807cab30ecb58d988a81a2d58fa166117962c85b8e149
-size 849
diff --git a/Code/Editor/TrackView/TrackViewSequence.h b/Code/Editor/TrackView/TrackViewSequence.h
index a392ad00f9..8f686af0cb 100644
--- a/Code/Editor/TrackView/TrackViewSequence.h
+++ b/Code/Editor/TrackView/TrackViewSequence.h
@@ -11,6 +11,7 @@
#define CRYINCLUDE_EDITOR_TRACKVIEW_TRACKVIEWSEQUENCE_H
#pragma once
+#include
#include "IMovieSystem.h"
#include
diff --git a/Code/Editor/TrackView/TrackViewSequenceManager.cpp b/Code/Editor/TrackView/TrackViewSequenceManager.cpp
index d7c1e3c709..515af4df38 100644
--- a/Code/Editor/TrackView/TrackViewSequenceManager.cpp
+++ b/Code/Editor/TrackView/TrackViewSequenceManager.cpp
@@ -408,20 +408,6 @@ void CTrackViewSequenceManager::OnSequenceRemoved(CTrackViewSequence* sequence)
}
}
-////////////////////////////////////////////////////////////////////////////
-void CTrackViewSequenceManager::OnDataBaseItemEvent([[maybe_unused]] IDataBaseItem* pItem, EDataBaseItemEvent event)
-{
- if (event != EDataBaseItemEvent::EDB_ITEM_EVENT_ADD)
- {
- const size_t numSequences = m_sequences.size();
-
- for (size_t i = 0; i < numSequences; ++i)
- {
- m_sequences[i]->UpdateDynamicParams();
- }
- }
-}
-
////////////////////////////////////////////////////////////////////////////
CTrackViewAnimNodeBundle CTrackViewSequenceManager::GetAllRelatedAnimNodes(const AZ::EntityId entityId) const
{
diff --git a/Code/Editor/TrackView/TrackViewSequenceManager.h b/Code/Editor/TrackView/TrackViewSequenceManager.h
index 1474323dc6..6c65a7f1a9 100644
--- a/Code/Editor/TrackView/TrackViewSequenceManager.h
+++ b/Code/Editor/TrackView/TrackViewSequenceManager.h
@@ -13,13 +13,11 @@
#include "TrackViewSequence.h"
-#include "IDataBaseManager.h"
#include
class CTrackViewSequenceManager
: public IEditorNotifyListener
- , public IDataBaseManagerListener
, public ITrackViewSequenceManager
, public AZ::EntitySystemBus::Handler
{
@@ -65,8 +63,6 @@ private:
void OnSequenceAdded(CTrackViewSequence* pSequence);
void OnSequenceRemoved(CTrackViewSequence* pSequence);
- void OnDataBaseItemEvent(IDataBaseItem* pItem, EDataBaseItemEvent event) override;
-
// AZ::EntitySystemBus
void OnEntityNameChanged(const AZ::EntityId& entityId, const AZStd::string& name) override;
void OnEntityDestruction(const AZ::EntityId& entityId) override;
diff --git a/Code/Editor/Util/EditorUtils.cpp b/Code/Editor/Util/EditorUtils.cpp
index adae34773a..47264a51ab 100644
--- a/Code/Editor/Util/EditorUtils.cpp
+++ b/Code/Editor/Util/EditorUtils.cpp
@@ -176,23 +176,6 @@ QString TrimTrailingZeros(QString str)
return str;
}
-//////////////////////////////////////////////////////////////////////////
-// This function is supposed to format float in user-friendly way,
-// omitting the exponent notation.
-//
-// Why not using printf? Its formatting rules has following drawbacks:
-// %g - will use exponent for small numbers;
-// %.Nf - doesn't allow to control total amount of significant numbers,
-// which exposes limited precision during binary-to-decimal fraction
-// conversion.
-//////////////////////////////////////////////////////////////////////////
-void FormatFloatForUI(QString& str, int significantDigits, double value)
-{
- str = TrimTrailingZeros(QString::number(value, 'f', significantDigits));
- return;
-}
-//////////////////////////////////////////////////////////////////////////-
-
//////////////////////////////////////////////////////////////////////////
QColor ColorLinearToGamma(ColorF col)
{
diff --git a/Code/Editor/Util/EditorUtils.h b/Code/Editor/Util/EditorUtils.h
index e950d75012..5a69633d0f 100644
--- a/Code/Editor/Util/EditorUtils.h
+++ b/Code/Editor/Util/EditorUtils.h
@@ -212,22 +212,6 @@ namespace XmlHelpers
//////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////
-// Drag Drop helper functions
-//////////////////////////////////////////////////////////////////////////
-namespace EditorDragDropHelpers
-{
- inline QString GetAnimationNameClipboardFormat()
- {
- return QStringLiteral("application/x-animation-browser-copy");
- }
-
- inline QString GetFragmentClipboardFormat()
- {
- return QStringLiteral("application/x-preview-fragment-properties");
- }
-}
-
//////////////////////////////////////////////////////////////////////////
/*!
@@ -292,116 +276,6 @@ public:
}
};
-
-//////////////////////////////////////////////////////////////////////////
-//
-// Convert String representation of color to RGB integer value.
-//
-//////////////////////////////////////////////////////////////////////////
-inline QColor String2Color(const QString& val)
-{
- unsigned int r = 0, g = 0, b = 0;
- int res = 0;
- res = azsscanf(val.toUtf8().data(), "R:%d,G:%d,B:%d", &r, &g, &b);
- if (res != 3)
- {
- res = azsscanf(val.toUtf8().data(), "R:%d G:%d B:%d", &r, &g, &b);
- }
- if (res != 3)
- {
- res = azsscanf(val.toUtf8().data(), "%d,%d,%d", &r, &g, &b);
- }
- if (res != 3)
- {
- res = azsscanf(val.toUtf8().data(), "%d %d %d", &r, &g, &b);
- }
- if (res != 3)
- {
- azsscanf(val.toUtf8().data(), "%x", &r);
- return r;
- }
-
- return QColor(r, g, b);
-}
-
-// Converts QColor to Vector.
-inline Vec3 Rgb2Vec(const QColor& color)
-{
- return Vec3(aznumeric_cast(color.redF()), aznumeric_cast(color.greenF()), aznumeric_cast(color.blueF()));
-}
-
-// Converts QColor to ColorF.
-inline ColorF Rgb2ColorF(const QColor& color)
-{
- return ColorF(aznumeric_cast(color.redF()), aznumeric_cast(color.greenF()), aznumeric_cast(color.blueF()), 1.0f);
-}
-
-// Converts QColor to Vector.
-inline QColor Vec2Rgb(const Vec3& color)
-{
- return QColor(aznumeric_cast(color.x * 255), aznumeric_cast(color.y * 255), aznumeric_cast(color.z * 255));
-}
-
-// Converts ColorF to QColor.
-inline QColor ColorF2Rgb(const ColorF& color)
-{
- return QColor(aznumeric_cast(color.r * 255), aznumeric_cast(color.g * 255), aznumeric_cast(color.b * 255));
-}
-
-//////////////////////////////////////////////////////////////////////////
-// Tokenize string.
-//////////////////////////////////////////////////////////////////////////
-inline QString TokenizeString(const QString& s, LPCSTR pszTokens, int& iStart)
-{
- assert(iStart >= 0);
-
- QByteArray str = s.toUtf8();
-
- if (pszTokens == nullptr)
- {
- return str;
- }
-
- auto pszPlace = str.begin() + iStart;
- auto pszEnd = str.end();
- if (pszPlace < pszEnd)
- {
- int nIncluding = (int)strspn(pszPlace, pszTokens);
- ;
-
- if ((pszPlace + nIncluding) < pszEnd)
- {
- pszPlace += nIncluding;
- int nExcluding = (int)strcspn(pszPlace, pszTokens);
-
- int iFrom = iStart + nIncluding;
- int nUntil = nExcluding;
- iStart = iFrom + nUntil + 1;
-
- return (str.mid(iFrom, nUntil));
- }
- }
-
- // return empty string, done tokenizing
- iStart = -1;
- return "";
-}
-
-// This template function will join strings from a vector into a single string, using a separator char
-template
-inline void JoinStrings(const QList& rStrings, QString& rDestStr, char aSeparator = ',')
-{
- for (size_t i = 0, iCount = rStrings.size(); i < iCount; ++i)
- {
- rDestStr += rStrings[i];
-
- if (i < iCount - 1)
- {
- rDestStr += aSeparator;
- }
- }
-}
-
// This function will split a string containing separated strings, into a vector of strings
// better version of TokenizeString
inline void SplitString(const QString& rSrcStr, QStringList& rDestStrings, char aSeparator = ',')
@@ -435,45 +309,6 @@ inline void SplitString(const QString& rSrcStr, QStringList& rDestStrings, char
}
}
-// Format unsigned number to string with 1000s separator
-inline QString FormatWithThousandsSeperator(const unsigned int number)
-{
- QString string;
-
- string = QString::number(number);
-
- for (int p = string.length() - 3; p > 0; p -= 3)
- {
- string.insert(p, ',');
- }
-
- return string;
-}
-
-
-void FormatFloatForUI(QString& str, int significantDigits, double value);
-
-//////////////////////////////////////////////////////////////////////////
-// Simply sub string searching case insensitive.
-//////////////////////////////////////////////////////////////////////////
-inline const char* strstri(const char* pString, const char* pSubstring)
-{
- int i, j, k;
- for (i = 0; pString[i]; i++)
- {
- for (j = i, k = 0; tolower(pString[j]) == tolower(pSubstring[k]); j++, k++)
- {
- if (!pSubstring[k + 1])
- {
- return (pString + i);
- }
- }
- }
-
- return nullptr;
-}
-
-
inline bool CheckVirtualKey(Qt::MouseButton button)
{
return (qApp->property("pressedMouseButtons").toInt() & button) != 0;
diff --git a/Code/Editor/Util/FileUtil.cpp b/Code/Editor/Util/FileUtil.cpp
index 9f96d45381..ce2d399dcc 100644
--- a/Code/Editor/Util/FileUtil.cpp
+++ b/Code/Editor/Util/FileUtil.cpp
@@ -42,8 +42,6 @@
#include "CheckOutDialog.h"
#include "ISourceControl.h"
#include "Dialogs/Generic/UserOptions.h"
-#include "IAssetItem.h"
-#include "IAssetItemDatabase.h"
#include "Include/IObjectManager.h"
#include "UsedResources.h"
#include "Objects/BaseObject.h"
@@ -223,106 +221,6 @@ void CFileUtil::EditTextureFile(const char* textureFile, [[maybe_unused]] bool b
}
}
-
-//////////////////////////////////////////////////////////////////////////
-bool CFileUtil::CalculateDccFilename(const QString& assetFilename, QString& dccFilename)
-{
- if (ExtractDccFilenameFromAssetDatabase(assetFilename, dccFilename))
- {
- return true;
- }
-
- if (ExtractDccFilenameUsingNamingConventions(assetFilename, dccFilename))
- {
- return true;
- }
-
- GetIEditor()->GetEnv()->pLog->LogError("Failed to find psd file for texture: '%s'", assetFilename.toUtf8().data());
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CFileUtil::ExtractDccFilenameFromAssetDatabase(const QString& assetFilename, QString& dccFilename)
-{
- IAssetItemDatabase* pCurrentDatabaseInterface = nullptr;
- std::vector assetDatabasePlugins;
- IEditorClassFactory* pClassFactory = GetIEditor()->GetClassFactory();
- pClassFactory->GetClassesByCategory("Asset Item DB", assetDatabasePlugins);
-
- for (size_t i = 0; i < assetDatabasePlugins.size(); ++i)
- {
- if (assetDatabasePlugins[i]->QueryInterface(__uuidof(IAssetItemDatabase), (void**)&pCurrentDatabaseInterface) == S_OK)
- {
- if (!pCurrentDatabaseInterface)
- {
- continue;
- }
-
- QString assetDatabaseDccFilename;
- IAssetItem* pAssetItem = pCurrentDatabaseInterface->GetAsset(assetFilename.toUtf8().data());
- if (pAssetItem)
- {
- if ((pAssetItem->GetFlags() & IAssetItem::eFlag_Cached))
- {
- QVariant v = pAssetItem->GetAssetFieldValue("dccfilename");
- assetDatabaseDccFilename = v.toString();
- if (!v.isNull())
- {
- dccFilename = assetDatabaseDccFilename;
- dccFilename = Path::GetRelativePath(dccFilename, false);
-
- uint32 attr = CFileUtil::GetAttributes(dccFilename.toUtf8().data());
-
- if (CFileUtil::FileExists(dccFilename))
- {
- return true;
- }
- else if (GetIEditor()->IsSourceControlAvailable() && (attr & SCC_FILE_ATTRIBUTE_MANAGED))
- {
- return CFileUtil::GetLatestFromSourceControl(dccFilename.toUtf8().data());
- }
- }
- }
- }
- }
- }
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool CFileUtil::ExtractDccFilenameUsingNamingConventions(const QString& assetFilename, QString& dccFilename)
-{
- //else to try find it by naming conventions
- QString tempStr = assetFilename;
- int foundSplit = -1;
- if ((foundSplit = tempStr.lastIndexOf('.')) > 0)
- {
- QString first = tempStr.mid(0, foundSplit);
- tempStr = first + ".psd";
- }
- if (CFileUtil::FileExists(tempStr))
- {
- dccFilename = tempStr;
- return true;
- }
-
- //else try to find it by replacing post fix _