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:
@@ -28,8 +28,7 @@
|
||||
#include "HitContext.h"
|
||||
#include "Objects/SelectionGroup.h"
|
||||
|
||||
#include <IEntityRenderState.h>
|
||||
#include <IStatObj.h>
|
||||
static constexpr int VIEW_DISTANCE_MULTIPLIER_MAX = 100;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Undo Entity Link
|
||||
@@ -58,7 +57,6 @@ public:
|
||||
protected:
|
||||
void Release() override { delete this; };
|
||||
int GetSize() override { return sizeof(*this); }; // Return size of xml state.
|
||||
QString GetDescription() override { return "Entity Link"; };
|
||||
QString GetObjectName() override{ return ""; };
|
||||
|
||||
void Undo([[maybe_unused]] bool bUndo) override
|
||||
@@ -139,7 +137,6 @@ private:
|
||||
}
|
||||
|
||||
int GetSize() override { return sizeof(CUndoAttachEntity); }
|
||||
QString GetDescription() override { return "Attachment Changed"; }
|
||||
|
||||
GUID m_attachedEntityGUID;
|
||||
CEntityObject::EAttachmentType m_attachmentType;
|
||||
@@ -151,8 +148,6 @@ private:
|
||||
// CBase implementation.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
float CEntityObject::m_helperScale = 1;
|
||||
|
||||
namespace
|
||||
{
|
||||
CEntityObject* s_pPropertyPanelEntityObject = nullptr;
|
||||
@@ -163,12 +158,9 @@ namespace
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CEntityObject::CEntityObject()
|
||||
: m_listeners(1)
|
||||
{
|
||||
m_bLoadFailed = false;
|
||||
|
||||
m_visualObject = nullptr;
|
||||
|
||||
m_box.min.Set(0, 0, 0);
|
||||
m_box.max.Set(0, 0, 0);
|
||||
|
||||
@@ -223,7 +215,7 @@ CEntityObject::CEntityObject()
|
||||
mv_ratioLOD = 100;
|
||||
mv_viewDistanceMultiplier = 1.0f;
|
||||
mv_ratioLOD.SetLimits(0, 255);
|
||||
mv_viewDistanceMultiplier.SetLimits(0.0f, IRenderNode::VIEW_DISTANCE_MULTIPLIER_MAX);
|
||||
mv_viewDistanceMultiplier.SetLimits(0.0f, VIEW_DISTANCE_MULTIPLIER_MAX);
|
||||
|
||||
m_physicsState = nullptr;
|
||||
|
||||
@@ -247,7 +239,6 @@ CEntityObject::CEntityObject()
|
||||
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectInAllDirsChange(var); });
|
||||
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectorFOVChange(var); });
|
||||
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnProjectorTextureChange(var); });
|
||||
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnPropertyChange(var); });
|
||||
m_onSetCallbacksCache.emplace_back([this](IVariable* var) { OnRadiusChange(var); });
|
||||
}
|
||||
|
||||
@@ -295,11 +286,6 @@ void CEntityObject::Done()
|
||||
ReleaseEventTargets();
|
||||
RemoveAllEntityLinks();
|
||||
|
||||
for (CListenerSet<IEntityObjectListener*>::Notifier notifier(m_listeners); notifier.IsValid(); notifier.Next())
|
||||
{
|
||||
notifier->OnDone();
|
||||
}
|
||||
|
||||
CBaseObject::Done();
|
||||
}
|
||||
|
||||
@@ -365,12 +351,6 @@ void CEntityObject::SetTransformDelegate(ITransformDelegate* pTransformDelegate)
|
||||
ResetCallbacks();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CEntityObject::IsSameClass(CBaseObject* obj)
|
||||
{
|
||||
return (GetClassDesc() == obj->GetClassDesc());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CEntityObject::ConvertFromObject(CBaseObject* object)
|
||||
{
|
||||
@@ -458,33 +438,10 @@ bool CEntityObject::HitTest(HitContext& hc)
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CEntityObject::HitHelperTest(HitContext& hc)
|
||||
{
|
||||
bool bResult = CBaseObject::HitHelperTest(hc);
|
||||
if (bResult)
|
||||
{
|
||||
hc.object = this;
|
||||
}
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CEntityObject::HitTestRect(HitContext& hc)
|
||||
{
|
||||
bool bResult = false;
|
||||
|
||||
if (m_visualObject && !gSettings.viewports.bShowIcons && !gSettings.viewports.bShowSizeBasedIcons)
|
||||
{
|
||||
AABB box;
|
||||
box.SetTransformedAABB(GetWorldTM(), m_visualObject->GetAABB());
|
||||
bResult = HitTestRectBounds(hc, box);
|
||||
}
|
||||
else
|
||||
{
|
||||
bResult = CBaseObject::HitTestRect(hc);
|
||||
}
|
||||
bool bResult = CBaseObject::HitTestRect(hc);
|
||||
|
||||
if (bResult)
|
||||
{
|
||||
@@ -494,42 +451,6 @@ bool CEntityObject::HitTestRect(HitContext& hc)
|
||||
return bResult;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
int CEntityObject::MouseCreateCallback(CViewport* view, EMouseEvent event, QPoint& point, int flags)
|
||||
{
|
||||
AZ_PROFILE_FUNCTION(Entity);
|
||||
|
||||
if (event == eMouseMove || event == eMouseLDown)
|
||||
{
|
||||
Vec3 pos;
|
||||
// Rise Entity above ground on Bounding box amount.
|
||||
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.z = pos.z - m_box.min.z;
|
||||
}
|
||||
pos = view->SnapToGrid(pos);
|
||||
}
|
||||
SetPos(pos);
|
||||
|
||||
if (event == eMouseLDown)
|
||||
{
|
||||
return MOUSECREATE_OK;
|
||||
}
|
||||
return MOUSECREATE_CONTINUE;
|
||||
}
|
||||
return CBaseObject::MouseCreateCallback(view, event, point, flags);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
IVariable* CEntityObject::FindVariableInSubBlock(CVarBlockPtr& properties, IVariable* pSubBlockVar, const char* pVarName)
|
||||
{
|
||||
@@ -680,11 +601,6 @@ void CEntityObject::SetName(const QString& name)
|
||||
|
||||
CBaseObject::SetName(name);
|
||||
|
||||
CListenerSet<IEntityObjectListener*> listeners = m_listeners;
|
||||
for (CListenerSet<IEntityObjectListener*>::Notifier notifier(listeners); notifier.IsValid(); notifier.Next())
|
||||
{
|
||||
notifier->OnNameChanged(name.toUtf8().data());
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -697,19 +613,6 @@ void CEntityObject::SetSelected(bool bSelect)
|
||||
UpdateLightProperty();
|
||||
}
|
||||
|
||||
for (CListenerSet<IEntityObjectListener*>::Notifier notifier(m_listeners); notifier.IsValid(); notifier.Next())
|
||||
{
|
||||
notifier->OnSelectionChanged(bSelect);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CEntityObject::OnPropertyChange([[maybe_unused]] IVariable* var)
|
||||
{
|
||||
if (s_ignorePropertiesUpdate)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@@ -941,11 +844,9 @@ void CEntityObject::Serialize(CObjectArchive& ar)
|
||||
m_eventTargets.emplace_back(AZStd::move(et));
|
||||
if (targetId != GUID_NULL)
|
||||
{
|
||||
using namespace AZStd::placeholders;
|
||||
ar.SetResolveCallback(
|
||||
this, targetId,
|
||||
[this](CBaseObject* object, unsigned int index) { ResolveEventTarget(object, index); },
|
||||
i);
|
||||
[this,i](CBaseObject* object) { ResolveEventTarget(object, i); });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1154,12 +1055,6 @@ XmlNodeRef CEntityObject::Export([[maybe_unused]] const QString& levelPath, XmlN
|
||||
objNode->setAttr("MinSpec", ( uint32 )GetMinSpec());
|
||||
}
|
||||
|
||||
uint32 nMtlLayersMask = GetMaterialLayersMask();
|
||||
if (nMtlLayersMask != 0)
|
||||
{
|
||||
objNode->setAttr("MatLayersMask", nMtlLayersMask);
|
||||
}
|
||||
|
||||
if (mv_hiddenInGame)
|
||||
{
|
||||
objNode->setAttr("HiddenInGame", true);
|
||||
@@ -1256,11 +1151,6 @@ void CEntityObject::OnEvent(ObjectEvent event)
|
||||
|
||||
case EVENT_CONFIG_SPEC_CHANGE:
|
||||
{
|
||||
IObjectManager* objMan = GetIEditor()->GetObjectManager();
|
||||
if (objMan && objMan->IsLightClass(this))
|
||||
{
|
||||
OnPropertyChange(nullptr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -1350,56 +1240,6 @@ QString CEntityObject::GetLightAnimation() const
|
||||
return "";
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CEntityObject::PostClone(CBaseObject* pFromObject, CObjectCloneContext& ctx)
|
||||
{
|
||||
CBaseObject::PostClone(pFromObject, ctx);
|
||||
|
||||
CEntityObject* pFromEntity = ( CEntityObject* )pFromObject;
|
||||
// Clone event targets.
|
||||
if (!pFromEntity->m_eventTargets.empty())
|
||||
{
|
||||
size_t numTargets = pFromEntity->m_eventTargets.size();
|
||||
for (size_t i = 0; i < numTargets; i++)
|
||||
{
|
||||
CEntityEventTarget& et = pFromEntity->m_eventTargets[i];
|
||||
CBaseObject* pClonedTarget = ctx.FindClone(et.target);
|
||||
if (!pClonedTarget)
|
||||
{
|
||||
pClonedTarget = et.target; // If target not cloned, link to original target.
|
||||
}
|
||||
|
||||
// Add cloned event.
|
||||
AddEventTarget(pClonedTarget, et.event, et.sourceEvent, true);
|
||||
}
|
||||
}
|
||||
|
||||
// Clone links.
|
||||
if (!pFromEntity->m_links.empty())
|
||||
{
|
||||
int numTargets = static_cast<int>(pFromEntity->m_links.size());
|
||||
for (int i = 0; i < numTargets; i++)
|
||||
{
|
||||
CEntityLink& et = pFromEntity->m_links[i];
|
||||
CBaseObject* pClonedTarget = ctx.FindClone(et.target);
|
||||
if (!pClonedTarget)
|
||||
{
|
||||
pClonedTarget = et.target; // If target not cloned, link to original target.
|
||||
}
|
||||
|
||||
// Add cloned event.
|
||||
if (pClonedTarget)
|
||||
{
|
||||
AddEntityLink(et.name, pClonedTarget->GetId());
|
||||
}
|
||||
else
|
||||
{
|
||||
AddEntityLink(et.name, GUID_NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CEntityObject::ResolveEventTarget(CBaseObject* object, unsigned int index)
|
||||
{
|
||||
@@ -1554,7 +1394,7 @@ void CEntityObject::OnObjectEvent(CBaseObject* target, int event)
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
int CEntityObject::AddEventTarget(CBaseObject* target, const QString& event, const QString& sourceEvent, [[maybe_unused]] bool bUpdateScript)
|
||||
{
|
||||
StoreUndo("Add EventTarget");
|
||||
StoreUndo();
|
||||
CEntityEventTarget et;
|
||||
et.target = target;
|
||||
et.event = event;
|
||||
@@ -1588,7 +1428,7 @@ void CEntityObject::RemoveEventTarget(int index, [[maybe_unused]] bool bUpdateSc
|
||||
{
|
||||
if (index >= 0 && index < m_eventTargets.size())
|
||||
{
|
||||
StoreUndo("Remove EventTarget");
|
||||
StoreUndo();
|
||||
|
||||
if (m_eventTargets[index].pLineGizmo)
|
||||
{
|
||||
@@ -1624,7 +1464,7 @@ int CEntityObject::AddEntityLink(const QString& name, GUID targetEntityId)
|
||||
}
|
||||
}
|
||||
|
||||
StoreUndo("Add EntityLink");
|
||||
StoreUndo();
|
||||
|
||||
CLineGizmo* pLineGizmo = nullptr;
|
||||
|
||||
@@ -1672,7 +1512,7 @@ void CEntityObject::RemoveEntityLink(int index)
|
||||
if (index >= 0 && index < m_links.size())
|
||||
{
|
||||
CEntityLink& link = m_links[index];
|
||||
StoreUndo("Remove EntityLink");
|
||||
StoreUndo();
|
||||
|
||||
if (link.pLineGizmo)
|
||||
{
|
||||
@@ -1695,7 +1535,7 @@ void CEntityObject::RenameEntityLink(int index, const QString& newName)
|
||||
{
|
||||
if (index >= 0 && index < m_links.size())
|
||||
{
|
||||
StoreUndo("Rename EntityLink");
|
||||
StoreUndo();
|
||||
|
||||
if (m_links[index].pLineGizmo)
|
||||
{
|
||||
@@ -1842,18 +1682,6 @@ void CEntityObject::OnLoadFailed()
|
||||
GetIEditor()->GetErrorReport()->ReportError(err);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CEntityObject::SetHelperScale(float scale)
|
||||
{
|
||||
m_helperScale = scale;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
float CEntityObject::GetHelperScale()
|
||||
{
|
||||
return m_helperScale;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Analyze errors for this object.
|
||||
void CEntityObject::Validate(IErrorReport* report)
|
||||
@@ -1901,19 +1729,6 @@ bool CEntityObject::IsSimilarObject(CBaseObject* pObject)
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CEntityObject::OnContextMenu(QMenu* pMenu)
|
||||
{
|
||||
if (!pMenu->isEmpty())
|
||||
{
|
||||
pMenu->addSeparator();
|
||||
}
|
||||
|
||||
// Events
|
||||
|
||||
CBaseObject::OnContextMenu(pMenu);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CEntityObject::PreInitLightProperty()
|
||||
{
|
||||
@@ -2171,16 +1986,6 @@ void CEntityObject::StoreUndoEntityLink(CSelectionGroup* pGroup)
|
||||
}
|
||||
}
|
||||
|
||||
void CEntityObject::RegisterListener(IEntityObjectListener* pListener)
|
||||
{
|
||||
m_listeners.Add(pListener);
|
||||
}
|
||||
|
||||
void CEntityObject::UnregisterListener(IEntityObjectListener* pListener)
|
||||
{
|
||||
m_listeners.Remove(pListener);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T CEntityObject::GetEntityProperty(const char* pName, T defaultvalue) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user