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,19 +28,12 @@ CObjectArchive::CObjectArchive(IObjectManager* objMan, XmlNodeRef xmlRoot, bool
|
||||
m_nFlags = 0;
|
||||
node = xmlRoot;
|
||||
m_pCurrentErrorReport = GetIEditor()->GetErrorReport();
|
||||
m_pGeometryPak = nullptr;
|
||||
m_pCurrentObject = nullptr;
|
||||
m_bNeedResolveObjects = false;
|
||||
m_bProgressBarEnabled = true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CObjectArchive::~CObjectArchive()
|
||||
{
|
||||
if (m_pGeometryPak)
|
||||
{
|
||||
delete m_pGeometryPak;
|
||||
}
|
||||
// Always make sure objects are resolved when loading from archive.
|
||||
if (bLoading && m_bNeedResolveObjects)
|
||||
{
|
||||
@@ -74,31 +67,6 @@ void CObjectArchive::SetResolveCallback(CBaseObject* fromObject, REFGUID objectI
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CObjectArchive::SetResolveCallback(CBaseObject* fromObject, REFGUID objectId, ResolveObjRefFunctor2 func, uint32 userData)
|
||||
{
|
||||
if (objectId == GUID_NULL)
|
||||
{
|
||||
func(0, userData);
|
||||
return;
|
||||
}
|
||||
|
||||
CBaseObject* object = m_objectManager->FindObject(objectId);
|
||||
if (object && !(m_nFlags & eObjectLoader_MakeNewIDs))
|
||||
{
|
||||
// Object is already resolved. immidiatly call callback.
|
||||
func(object, userData);
|
||||
}
|
||||
else
|
||||
{
|
||||
Callback cb;
|
||||
cb.fromObject = fromObject;
|
||||
cb.func2 = func;
|
||||
cb.userData = userData;
|
||||
m_resolveCallbacks.insert(Callbacks::value_type(objectId, cb));
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
GUID CObjectArchive::ResolveID(REFGUID id)
|
||||
{
|
||||
@@ -117,10 +85,7 @@ void CObjectArchive::ResolveObjects()
|
||||
|
||||
{
|
||||
CWaitProgress wait("Loading Objects", false);
|
||||
if (m_bProgressBarEnabled)
|
||||
{
|
||||
wait.Start();
|
||||
}
|
||||
wait.Start();
|
||||
|
||||
GetIEditor()->SuspendUndo();
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -129,10 +94,7 @@ void CObjectArchive::ResolveObjects()
|
||||
int numObj = static_cast<int>(m_loadedObjects.size());
|
||||
for (i = 0; i < numObj; i++)
|
||||
{
|
||||
if (m_bProgressBarEnabled)
|
||||
{
|
||||
wait.Step((i * 100) / numObj);
|
||||
}
|
||||
wait.Step((i * 100) / numObj);
|
||||
|
||||
SLoadedObjectInfo& obj = m_loadedObjects[i];
|
||||
m_pCurrentErrorReport->SetCurrentValidatorObject(obj.pObject);
|
||||
@@ -204,30 +166,20 @@ void CObjectArchive::ResolveObjects()
|
||||
{
|
||||
(cb.func1)(object);
|
||||
}
|
||||
if (cb.func2)
|
||||
{
|
||||
(cb.func2)(object, cb.userData);
|
||||
}
|
||||
}
|
||||
m_resolveCallbacks.clear();
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
{
|
||||
CWaitProgress wait("Creating Objects", false);
|
||||
if (m_bProgressBarEnabled)
|
||||
{
|
||||
wait.Start();
|
||||
}
|
||||
wait.Start();
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Serialize All Objects from XML.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
int numObj = static_cast<int>(m_loadedObjects.size());
|
||||
for (i = 0; i < numObj; i++)
|
||||
{
|
||||
if (m_bProgressBarEnabled)
|
||||
{
|
||||
wait.Step((i * 100) / numObj);
|
||||
}
|
||||
wait.Step((i * 100) / numObj);
|
||||
|
||||
SLoadedObjectInfo& obj = m_loadedObjects[i];
|
||||
m_pCurrentErrorReport->SetCurrentValidatorObject(obj.pObject);
|
||||
@@ -258,8 +210,6 @@ void CObjectArchive::ResolveObjects()
|
||||
|
||||
m_bNeedResolveObjects = false;
|
||||
m_pCurrentErrorReport->SetCurrentValidatorObject(nullptr);
|
||||
m_sequenceIdRemap.clear();
|
||||
m_pendingIds.clear();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -272,7 +222,6 @@ void CObjectArchive::SaveObject(CBaseObject* pObject)
|
||||
|
||||
if (m_savedObjects.find(pObject) == m_savedObjects.end())
|
||||
{
|
||||
m_pCurrentObject = pObject;
|
||||
m_savedObjects.insert(pObject);
|
||||
// If this object was not saved before.
|
||||
XmlNodeRef objNode = node->newChild("Object");
|
||||
@@ -307,45 +256,6 @@ CBaseObject* CObjectArchive::LoadObject(const XmlNodeRef& objNode, CBaseObject*
|
||||
return pObject;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CObjectArchive::LoadObjects(XmlNodeRef& rootObjectsNode)
|
||||
{
|
||||
int numObjects = rootObjectsNode->getChildCount();
|
||||
for (int i = 0; i < numObjects; i++)
|
||||
{
|
||||
XmlNodeRef objNode = rootObjectsNode->getChild(i);
|
||||
LoadObject(objNode, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CObjectArchive::ReportError(CErrorRecord& err)
|
||||
{
|
||||
if (m_pCurrentErrorReport)
|
||||
{
|
||||
m_pCurrentErrorReport->ReportError(err);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CObjectArchive::SetErrorReport(CErrorReport* errReport)
|
||||
{
|
||||
if (errReport)
|
||||
{
|
||||
m_pCurrentErrorReport = errReport;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pCurrentErrorReport = GetIEditor()->GetErrorReport();
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CObjectArchive::ShowErrors()
|
||||
{
|
||||
GetIEditor()->GetErrorReport()->Display();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CObjectArchive::MakeNewIds(bool bEnable)
|
||||
{
|
||||
@@ -359,70 +269,8 @@ void CObjectArchive::MakeNewIds(bool bEnable)
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CObjectArchive::SetShouldResetInternalMembers(bool reset)
|
||||
{
|
||||
if (reset)
|
||||
{
|
||||
m_nFlags |= eObjectLoader_ResetInternalMembers;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_nFlags &= ~(eObjectLoader_ResetInternalMembers);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CObjectArchive::RemapID(REFGUID oldId, REFGUID newId)
|
||||
{
|
||||
m_IdRemap[oldId] = newId;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CPakFile* CObjectArchive::GetGeometryPak(const char* sFilename)
|
||||
{
|
||||
if (m_pGeometryPak)
|
||||
{
|
||||
return m_pGeometryPak;
|
||||
}
|
||||
m_pGeometryPak = new CPakFile;
|
||||
m_pGeometryPak->Open(sFilename);
|
||||
return m_pGeometryPak;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
CBaseObject* CObjectArchive::GetCurrentObject()
|
||||
{
|
||||
return m_pCurrentObject;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CObjectArchive::AddSequenceIdMapping(uint32 oldId, uint32 newId)
|
||||
{
|
||||
assert(oldId != newId);
|
||||
assert(GetIEditor()->GetMovieSystem()->FindSequenceById(oldId) || stl::find(m_pendingIds, oldId));
|
||||
assert(GetIEditor()->GetMovieSystem()->FindSequenceById(newId) == nullptr);
|
||||
assert(stl::find(m_pendingIds, newId) == false);
|
||||
m_sequenceIdRemap[oldId] = newId;
|
||||
m_pendingIds.push_back(newId);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
uint32 CObjectArchive::RemapSequenceId(uint32 id) const
|
||||
{
|
||||
std::map<uint32, uint32>::const_iterator itr = m_sequenceIdRemap.find(id);
|
||||
if (itr == m_sequenceIdRemap.end())
|
||||
{
|
||||
return id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return itr->second;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CObjectArchive::IsAmongPendingIds(uint32 id) const
|
||||
{
|
||||
return stl::find(m_pendingIds, id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user