Cry Legacy: the Lessening (#5961)
* Generic Cleanup Removals: * Unused cvars,member variables and defines * Windows media center edition support routines * CSystem - removed debug_GetCallStackRaw/GetRootWindowMessageHandler/ UnloadDLL/ShutdownModuleLibraries Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Fix CryMessageBox return values in Windows build Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove named selection group and a few smaller unused functionalities Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove ObjectManager export functionality + 2 deprecated functions Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove object legacy freeze/hide support from ObjectManager Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove ObjectManager duplicate name dection, as well as object renaming Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove ObjectManager serialization and selection callbacks Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * ObjectManager - remove MoveObjects/HitTestObject/EndEditParams and related members/functions Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove a bunch of unused clone related functionality + misc Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * ObjectManager - misc removals Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * ObjectManager - more removals Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove unused object selection/retrieval in ObjectManager and LoadObjects in ObjectLoader Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * CBaseObject - remove unused material layers mask support Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * More CBaseObject cleanups. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * CBaseObject - remove SubObj functions and IMouseCreateCallback Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove unused procedural floor management, helper scale and tags. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * CBaseObject - remove more unused methods. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Removals in multiple places. CBaseObject - unused `OBJTYPE_DUMMY` flag removed, member `IsSameClass` CObjectArchive removed unused methods/members CObjectManager removed unused `Update` method Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * More removals IDisplayViewport - HitTestLine/GetGridStep/setHitcontext/ GetConstructionPlane Unused Cry_Matrix44 template specializations. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * O3DE.exe Project-Centric "Open Editor" fix (#5852) * The O3DE.exe Open Editor button now attempts to open the Editor in the build directory of the project being opened. If their is no Editor within the build directory of the Project, it uses the Editor.exe in the current O3DE.exe executable directory if it exists Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Engine .gitignore now ignores the build directory if placed in the AutomatedTesting project Previously it was just ignoring a `[Bb]uild` directory if it was directly within the engine root. This change matches the behavior of the project templates. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Renamed the ProjectUtils GetEditorDirectory function to GetEditorExecutablePath Added a platform specific implementation for retrieving the path to the Editor executable in the GetEditorExectuablePath function. It first attempts to locate the Editor via checking the project build directory for an Editor executable before falling back to checking the binary directory of the currently running O3DE executable. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Correct the MacOS GetEditorExecutablePath to return the Editor path Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Adding missing C++20 std::erase implementations (#5735) There were already implementations for std::erase_if. This adds the counterpart AZStd::erase versions resolves #5734 Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * More removals and refactors `ShowMessage` and `CryMessageBox` return void now Simplify code in `CSystem::WarningV` Remove unused `CryGetTicksPerSec` Remove unused WinBase functionality Replace `nanosleep` call in WinBase with `std::this_thread::sleep_for` Remove unused Win32Wrapper routines Remove unused IFunctorBase.h and IEntityObjectListener.h Fix VectorAndArray.cpp compilation Use QMessageBox instead of CryMessageBox in the editor. Remove empty ArchiveVars platform specific files Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Fix test code. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove an unused function Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * CBaseObject and undo description removals. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * A bunch of removals * Remove IRenderNode * Remove editor's KDTree * Remove StatObjBus, InstanceStatObjEventBus::ReleaseData is redundant ( same functionality in the only available handler is triggered by `OnCryEditorCloseScene`) * Remove CExportManager::AddStatObj/AddMeshes/AddMesh, IExportManager::ExportSingleStatObj * Remove CIconManager/IIconManager::GetObject * Remove CBaseObject::IntersectRayMesh * Remove IIndexedMesh and related structs. * Unused IUndoObject::GetDescription and all derived implementations. * Unused CUndoBaseLibrary/CUndoBaseLibraryManager * Unused Matrix34_tpl typedefs * Legacy Xml classes cleanup Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove unused `Vec3ToVector3D` helper Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * fix - remove unused static variable Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
#include <AzToolsFramework/ToolsComponents/EditorSelectionAccentSystemComponent.h>
|
||||
#include <AzToolsFramework/ToolsComponents/EditorEntityIconComponentBus.h>
|
||||
#include <AzToolsFramework/Undo/UndoCacheInterface.h>
|
||||
#include <LmbrCentral/Rendering/RenderNodeBus.h>
|
||||
|
||||
#include <IDisplayViewport.h>
|
||||
#include <CryCommon/Cry_GeoIntersect.h>
|
||||
@@ -48,14 +47,12 @@
|
||||
/**
|
||||
* Scalars for icon drawing behavior.
|
||||
*/
|
||||
static const int s_kIconSize = 36; /// Icon display size (in pixels)
|
||||
|
||||
CComponentEntityObject::CComponentEntityObject()
|
||||
: m_hasIcon(false)
|
||||
: m_accentType(AzToolsFramework::EntityAccentType::None)
|
||||
, m_hasIcon(false)
|
||||
, m_entityIconVisible(false)
|
||||
, m_iconOnlyHitTest(false)
|
||||
, m_drawAccents(true)
|
||||
, m_accentType(AzToolsFramework::EntityAccentType::None)
|
||||
, m_isIsolated(false)
|
||||
, m_iconTexture(nullptr)
|
||||
{
|
||||
@@ -243,7 +240,7 @@ void CComponentEntityObject::SetSelected(bool bSelect)
|
||||
}
|
||||
|
||||
bool anySelected = false;
|
||||
|
||||
|
||||
AzToolsFramework::ToolsApplicationRequestBus::BroadcastResult(anySelected, &AzToolsFramework::ToolsApplicationRequests::AreAnyEntitiesSelected);
|
||||
|
||||
if (!anySelected)
|
||||
@@ -266,18 +263,6 @@ void CComponentEntityObject::SetHighlight(bool bHighlight)
|
||||
}
|
||||
}
|
||||
|
||||
IRenderNode* CComponentEntityObject::GetEngineNode() const
|
||||
{
|
||||
// It's possible for AZ::Entities to have multiple IRenderNodes.
|
||||
// However, the editor currently expects a single IRenderNode per "editor object".
|
||||
// Therefore, return the highest priority handler.
|
||||
if (auto* renderNodeHandler = LmbrCentral::RenderNodeRequestBus::FindFirstHandler(m_entityId))
|
||||
{
|
||||
return renderNodeHandler->GetRenderNode();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CComponentEntityObject::OnEntityNameChanged(const AZStd::string& name)
|
||||
{
|
||||
if (m_nameReentryGuard)
|
||||
@@ -331,14 +316,6 @@ void CComponentEntityObject::DetachThis(bool /*bKeepPos*/)
|
||||
}
|
||||
}
|
||||
|
||||
CBaseObject* CComponentEntityObject::GetLinkParent() const
|
||||
{
|
||||
AZ::EntityId parentId;
|
||||
EBUS_EVENT_ID_RESULT(parentId, m_entityId, AZ::TransformBus, GetParentId);
|
||||
|
||||
return CComponentEntityObject::FindObjectForEntity(parentId);
|
||||
}
|
||||
|
||||
bool CComponentEntityObject::IsFrozen() const
|
||||
{
|
||||
return CheckFlags(OBJFLAG_FROZEN);
|
||||
@@ -358,16 +335,6 @@ void CComponentEntityObject::OnEntityLockChanged(bool locked)
|
||||
CEntityObject::SetFrozen(locked);
|
||||
}
|
||||
|
||||
void CComponentEntityObject::SetHidden(
|
||||
bool bHidden, [[maybe_unused]] uint64 hiddenId /*=CBaseObject::s_invalidHiddenID*/, [[maybe_unused]] bool bAnimated /*=false*/)
|
||||
{
|
||||
if (m_visibilityFlagReentryGuard)
|
||||
{
|
||||
EditorActionScope flagChange(m_visibilityFlagReentryGuard);
|
||||
AzToolsFramework::SetEntityVisibility(m_entityId, !bHidden);
|
||||
}
|
||||
}
|
||||
|
||||
void CComponentEntityObject::OnEntityVisibilityChanged(bool visible)
|
||||
{
|
||||
CEntityObject::SetHidden(!visible);
|
||||
@@ -612,66 +579,6 @@ void CComponentEntityObject::OnTransformChanged([[maybe_unused]] const AZ::Trans
|
||||
}
|
||||
}
|
||||
|
||||
int CComponentEntityObject::MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags)
|
||||
{
|
||||
if (event == eMouseMove || event == eMouseLDown)
|
||||
{
|
||||
Vec3 pos;
|
||||
if (GetIEditor()->GetAxisConstrains() != AXIS_TERRAIN)
|
||||
{
|
||||
pos = view->MapViewToCP(point);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Snap to terrain.
|
||||
bool hitTerrain;
|
||||
pos = view->ViewToWorld(point, &hitTerrain);
|
||||
if (hitTerrain)
|
||||
{
|
||||
pos.z = GetIEditor()->GetTerrainElevation(pos.x, pos.y);
|
||||
}
|
||||
pos = view->SnapToGrid(pos);
|
||||
}
|
||||
|
||||
pos = view->SnapToGrid(pos);
|
||||
SetPos(pos);
|
||||
|
||||
if (event == eMouseLDown)
|
||||
{
|
||||
return MOUSECREATE_OK;
|
||||
}
|
||||
|
||||
return MOUSECREATE_CONTINUE;
|
||||
}
|
||||
|
||||
return CBaseObject::MouseCreateCallback(view, event, point, flags);
|
||||
}
|
||||
|
||||
bool CComponentEntityObject::HitHelperTest(HitContext& hc)
|
||||
{
|
||||
bool hit = CEntityObject::HitHelperTest(hc);
|
||||
if (!hit && m_entityId.IsValid())
|
||||
{
|
||||
// Pick against icon in screen space.
|
||||
if (IsEntityIconVisible())
|
||||
{
|
||||
const QPoint entityScreenPos = hc.view->WorldToView(GetWorldPos());
|
||||
const float screenPosX = static_cast<float>(entityScreenPos.x());
|
||||
const float screenPosY = static_cast<float>(entityScreenPos.y());
|
||||
const float iconRange = static_cast<float>(s_kIconSize / 2);
|
||||
|
||||
if ((hc.point2d.x() >= screenPosX - iconRange && hc.point2d.x() <= screenPosX + iconRange)
|
||||
&& (hc.point2d.y() >= screenPosY - iconRange && hc.point2d.y() <= screenPosY + iconRange))
|
||||
{
|
||||
hc.dist = hc.raySrc.GetDistance(GetWorldPos());
|
||||
hc.iconHit = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return hit;
|
||||
}
|
||||
|
||||
bool CComponentEntityObject::HitTest(HitContext& hc)
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(Entity);
|
||||
@@ -907,11 +814,6 @@ void CComponentEntityObject::DrawDefault(DisplayContext& dc, const QColor& label
|
||||
DrawAccent(dc);
|
||||
}
|
||||
|
||||
IStatObj* CComponentEntityObject::GetIStatObj()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool CComponentEntityObject::IsIsolated() const
|
||||
{
|
||||
return m_isIsolated;
|
||||
@@ -952,11 +854,6 @@ void CComponentEntityObject::SetWorldPos(const Vec3& pos, int flags)
|
||||
CEntityObject::SetWorldPos(pos, flags);
|
||||
}
|
||||
|
||||
void CComponentEntityObject::OnContextMenu(QMenu* /*pMenu*/)
|
||||
{
|
||||
// Deliberately bypass the base class implementation (CEntityObject::OnContextMenu()).
|
||||
}
|
||||
|
||||
void CComponentEntityObject::SetupEntityIcon()
|
||||
{
|
||||
bool hideIconInViewport = false;
|
||||
|
||||
@@ -56,27 +56,21 @@ public:
|
||||
bool SetScale(const Vec3& scale, int flags) override;
|
||||
void InvalidateTM(int nWhyFlags) override;
|
||||
void Display(DisplayContext& disp) override;
|
||||
void OnContextMenu(QMenu* pMenu) override;
|
||||
int MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags) override;
|
||||
bool HitHelperTest(HitContext& hc) override;
|
||||
bool HitTest(HitContext& hc) override;
|
||||
void GetLocalBounds(AABB& box) override;
|
||||
void GetBoundBox(AABB& box) override;
|
||||
void SetName(const QString& name) override;
|
||||
bool IsFrozen() const override;
|
||||
void SetFrozen(bool bFrozen) override;
|
||||
void SetHidden(bool bHidden, uint64 hiddenId = CBaseObject::s_invalidHiddenID, bool bAnimated = false) override;
|
||||
void SetSelected(bool bSelect) override;
|
||||
void SetHighlight(bool bHighlight) override;
|
||||
IRenderNode* GetEngineNode() const override;
|
||||
void AttachChild(CBaseObject* child, bool bKeepPos = true) override;
|
||||
void DetachAll(bool bKeepPos = true) override;
|
||||
void DetachThis(bool bKeepPos = true) override;
|
||||
CBaseObject* GetLinkParent() const override;
|
||||
XmlNodeRef Export(const QString& levelPath, XmlNodeRef& xmlNode) override;
|
||||
void DeleteEntity() override;
|
||||
void DrawDefault(DisplayContext& dc, const QColor& labelColor = QColor(255, 255, 255)) override;
|
||||
IStatObj* GetIStatObj() override;
|
||||
|
||||
bool IsIsolated() const override;
|
||||
bool IsSelected() const override;
|
||||
bool IsSelectable() const override;
|
||||
@@ -88,12 +82,6 @@ public:
|
||||
// Component entity highlighting (accenting) is taken care of elsewhere
|
||||
void DrawHighlight(DisplayContext& /*dc*/) override {};
|
||||
|
||||
// Don't auto-clone children. Cloning happens in groups with reference fixups,
|
||||
// and individually selected objercts should be cloned as individuals.
|
||||
bool ShouldCloneChildren() const override { return false; }
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -447,7 +447,7 @@ void SandboxIntegrationManager::OnEndUndo(const char* label, bool changed)
|
||||
// Add the undo only after we know it's got a legit change, we can't remove undos from the cry undo system so we do it here instead of OnBeginUndo
|
||||
if (changed && CUndo::IsRecording())
|
||||
{
|
||||
CUndo::Record(new CToolsApplicationUndoLink(label));
|
||||
CUndo::Record(new CToolsApplicationUndoLink());
|
||||
}
|
||||
if (m_startedUndoRecordingNestingLevel)
|
||||
{
|
||||
|
||||
@@ -306,8 +306,7 @@ class CToolsApplicationUndoLink
|
||||
{
|
||||
public:
|
||||
|
||||
CToolsApplicationUndoLink(const char* description)
|
||||
: m_description(description)
|
||||
CToolsApplicationUndoLink()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -316,11 +315,6 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
QString GetDescription() override
|
||||
{
|
||||
return m_description.c_str();
|
||||
}
|
||||
|
||||
void Undo(bool bUndo = true) override
|
||||
{
|
||||
// Always run the undo even if the flag was set to false, that just means that undo wasn't expressly desired, but can be used in cases of canceling the current super undo.
|
||||
@@ -354,8 +348,6 @@ public:
|
||||
w->setFocus(Qt::OtherFocusReason);
|
||||
}
|
||||
}
|
||||
|
||||
AZStd::string m_description;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_COMPONENTENTITYEDITORPLUGIN_SANDBOXINTEGRATION_H
|
||||
|
||||
Reference in New Issue
Block a user