Legacy code cleanup - part 3 (#3903)
* Legacy cleanup - part 3 Not much is left that can be easily removed, so I think this will be last cleanup before the legacy functionality is replaced. Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * fix windows build, remove a few more things, re-add one file Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove legacy RenderBus + more cleanups Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com> * Remove MaterialOwnerBus.h Clean-up in Cry_Matrix34/33 Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
This commit is contained in:
@@ -26,9 +26,6 @@
|
||||
#include <AzQtComponents/Components/Widgets/ScrollBar.h>
|
||||
#include <AzQtComponents/Components/Widgets/SliderCombo.h>
|
||||
|
||||
// CryCommon
|
||||
#include <CryCommon/SFunctor.h>
|
||||
|
||||
// Editor
|
||||
#include "QtViewPaneManager.h"
|
||||
#include "Core/QtEditorApplication.h"
|
||||
@@ -392,7 +389,7 @@ void CConsoleSCB::RegisterViewClass()
|
||||
opts.showInMenu = true;
|
||||
opts.builtInActionId = ID_VIEW_CONSOLEWINDOW;
|
||||
opts.shortcut = QKeySequence(Qt::Key_QuoteLeft);
|
||||
|
||||
|
||||
AzToolsFramework::RegisterViewPane<CConsoleSCB>(LyViewPane::Console, LyViewPane::CategoryTools, opts);
|
||||
}
|
||||
|
||||
@@ -606,8 +603,7 @@ static CVarBlock* VarBlockFromConsoleVars()
|
||||
|
||||
// Add our on change handler so we can update the CVariable created for
|
||||
// the matching ICVar that has been modified
|
||||
SFunctor onChange;
|
||||
onChange.Set(OnVariableUpdated, i, pCVar);
|
||||
AZStd::function<void()> onChange = [row=i,pCVar=pCVar]() { OnVariableUpdated(row,pCVar); };
|
||||
pCVar->AddOnChangeFunctor(onChange);
|
||||
|
||||
pVariable->SetDescription(pCVar->GetHelp());
|
||||
@@ -929,7 +925,7 @@ QWidget* ConsoleVariableItemDelegate::createEditor(QWidget* parent, const QStyle
|
||||
return editor;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// If we get here, value being edited is a string, so use our styled line
|
||||
// edit widget
|
||||
AzQtComponents::StyledLineEdit* lineEdit = new AzQtComponents::StyledLineEdit(parent);
|
||||
|
||||
@@ -1887,16 +1887,6 @@ void CCryEditDoc::SetDocumentReady(bool bReady)
|
||||
m_bDocumentReady = bReady;
|
||||
}
|
||||
|
||||
void CCryEditDoc::GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
{
|
||||
SIZER_COMPONENT_NAME(pSizer, "UndoManager(estimate)");
|
||||
GetIEditor()->GetUndoManager()->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
pSizer->Add(*this);
|
||||
}
|
||||
|
||||
void CCryEditDoc::RegisterConsoleVariables()
|
||||
{
|
||||
doc_validate_surface_types = gEnv->pConsole->GetCVar("doc_validate_surface_types");
|
||||
|
||||
@@ -129,8 +129,6 @@ public: // Create from serialization only
|
||||
void RegisterListener(IDocListener* listener);
|
||||
void UnregisterListener(IDocListener* listener);
|
||||
|
||||
void GetMemoryUsage(ICrySizer* pSizer) const;
|
||||
|
||||
static bool IsBackupOrTempLevelSubdirectory(const QString& folderName);
|
||||
protected:
|
||||
|
||||
|
||||
@@ -249,60 +249,6 @@ void CErrorReport::SetImmediateMode(bool bEnable)
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CErrorReport::Report(SValidatorRecord& record)
|
||||
{
|
||||
if ((record.flags & VALIDATOR_FLAG_IGNORE_IN_EDITOR))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CErrorRecord err;
|
||||
if (record.text)
|
||||
{
|
||||
err.error = record.text;
|
||||
}
|
||||
if (record.description)
|
||||
{
|
||||
err.description = record.description;
|
||||
}
|
||||
if (record.file)
|
||||
{
|
||||
err.file = record.file;
|
||||
}
|
||||
else
|
||||
{
|
||||
err.file = m_currentFilename;
|
||||
}
|
||||
err.severity = (CErrorRecord::ESeverity)record.severity;
|
||||
|
||||
err.assetScope = record.assetScope;
|
||||
|
||||
err.flags = 0;
|
||||
if (record.flags & VALIDATOR_FLAG_FILE)
|
||||
{
|
||||
err.flags |= CErrorRecord::FLAG_NOFILE;
|
||||
}
|
||||
if (record.flags & VALIDATOR_FLAG_TEXTURE)
|
||||
{
|
||||
err.flags |= CErrorRecord::FLAG_TEXTURE;
|
||||
}
|
||||
if (record.flags & VALIDATOR_FLAG_SCRIPT)
|
||||
{
|
||||
err.flags |= CErrorRecord::FLAG_SCRIPT;
|
||||
}
|
||||
if (record.flags & VALIDATOR_FLAG_AI)
|
||||
{
|
||||
err.flags |= CErrorRecord::FLAG_AI;
|
||||
}
|
||||
|
||||
err.module = record.module;
|
||||
err.pObject = m_pObject;
|
||||
err.pItem = m_pItem;
|
||||
|
||||
ReportError(err);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CErrorReport::SetCurrentValidatorObject(CBaseObject* pObject)
|
||||
{
|
||||
|
||||
@@ -121,11 +121,6 @@ public:
|
||||
//! Assign current filename.
|
||||
void SetCurrentFile(const QString& file);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Implement IValidator interface.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void Report(SValidatorRecord& record);
|
||||
|
||||
private:
|
||||
//! Array of all error records added to report.
|
||||
std::vector<CErrorRecord> m_errors;
|
||||
|
||||
@@ -176,11 +176,6 @@ struct SSystemUserCallback
|
||||
return CryMessageBox(text, caption, uType);
|
||||
}
|
||||
|
||||
void GetMemoryUsage(ICrySizer* pSizer) override
|
||||
{
|
||||
GetIEditor()->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
void OnSplashScreenDone()
|
||||
{
|
||||
m_pLogo = nullptr;
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_GAMEEXPORTER_H
|
||||
#define CRYINCLUDE_EDITOR_GAMEEXPORTER_H
|
||||
#pragma once
|
||||
|
||||
#include "Util/PakFile.h"
|
||||
@@ -62,7 +58,7 @@ public:
|
||||
// In auto exporting mode, highest possible settings will be chosen and no UI dialogs will be shown.
|
||||
void SetAutoExportMode(bool bAuto) { m_bAutoExportMode = bAuto; }
|
||||
|
||||
bool Export(unsigned int flags = 0, EEndian eExportEndian = GetPlatformEndian(), const char* subdirectory = 0);
|
||||
bool Export(unsigned int flags = 0, EEndian eExportEndian = eEndianness_Little, const char* subdirectory = 0);
|
||||
|
||||
static CGameExporter* GetCurrentExporter() { return m_pCurrentExporter; }
|
||||
|
||||
@@ -116,5 +112,3 @@ void SetupTerrainInfo(const size_t octreeCompiledDataSize, Func&& setupTerrainFn
|
||||
setupTerrainFn(octreeCompiledDataSize);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_GAMEEXPORTER_H
|
||||
|
||||
@@ -701,7 +701,6 @@ struct IEditor
|
||||
|
||||
virtual CUIEnumsDatabase* GetUIEnumsDatabase() = 0;
|
||||
virtual void AddUIEnums() = 0;
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) = 0;
|
||||
virtual void ReduceMemory() = 0;
|
||||
|
||||
//! Export manager for exporting objects and a terrain from the game to DCC tools
|
||||
|
||||
@@ -1506,18 +1506,6 @@ void CEditorImpl::ShowStatusText(bool bEnable)
|
||||
m_bShowStatusText = bEnable;
|
||||
}
|
||||
|
||||
void CEditorImpl::GetMemoryUsage(ICrySizer* pSizer)
|
||||
{
|
||||
SIZER_COMPONENT_NAME(pSizer, "Editor");
|
||||
|
||||
if (GetDocument())
|
||||
{
|
||||
SIZER_COMPONENT_NAME(pSizer, "Document");
|
||||
|
||||
GetDocument()->GetMemoryUsage(pSizer);
|
||||
}
|
||||
}
|
||||
|
||||
void CEditorImpl::ReduceMemory()
|
||||
{
|
||||
GetIEditor()->GetUndoManager()->ClearRedoStack();
|
||||
|
||||
@@ -280,7 +280,6 @@ public:
|
||||
void SetMatEditMode(bool bIsMatEditMode);
|
||||
CUIEnumsDatabase* GetUIEnumsDatabase() { return m_pUIEnumsDatabase; };
|
||||
void AddUIEnums();
|
||||
void GetMemoryUsage(ICrySizer* pSizer);
|
||||
void ReduceMemory();
|
||||
// Get Export manager
|
||||
IExportManager* GetExportManager();
|
||||
|
||||
@@ -64,10 +64,7 @@ void CIconManager::Reset()
|
||||
int i;
|
||||
for (i = 0; i < sizeof(m_objects) / sizeof(m_objects[0]); i++)
|
||||
{
|
||||
if (m_objects[i])
|
||||
{
|
||||
m_objects[i]->Release();
|
||||
}
|
||||
delete m_objects[i];
|
||||
m_objects[i] = nullptr;
|
||||
}
|
||||
for (i = 0; i < eIcon_COUNT; i++)
|
||||
|
||||
@@ -24,16 +24,15 @@ inline AZStd::string ToString(const QString& s)
|
||||
|
||||
class CCommand
|
||||
{
|
||||
static inline bool FromString(int32 &val, const char* s) {
|
||||
if(!s)
|
||||
static inline bool FromString(int32& val, const char* s)
|
||||
{
|
||||
if (!s)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
val = (int)strtol(s, nullptr, 10);
|
||||
if(val==0 && errno!=0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
val = static_cast<int>(strtol(s, nullptr, 10));
|
||||
const bool parsing_error = val == 0 && errno != 0;
|
||||
return !parsing_error;
|
||||
}
|
||||
public:
|
||||
CCommand(
|
||||
|
||||
@@ -15,6 +15,6 @@ struct IEditorMaterial
|
||||
: public CBaseLibraryItem
|
||||
{
|
||||
virtual int GetFlags() const = 0;
|
||||
virtual _smart_ptr<IMaterial> GetMatInfo(bool bUseExistingEngineMaterial = false) = 0;
|
||||
virtual IMaterial* GetMatInfo(bool bUseExistingEngineMaterial = false) = 0;
|
||||
virtual void DisableHighlightForFrame() = 0;
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
struct IEditorMaterialManager
|
||||
{
|
||||
virtual void GotoMaterial(_smart_ptr<IMaterial> pMaterial) = 0;
|
||||
virtual void GotoMaterial(IMaterial* pMaterial) = 0;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_MATERIAL_MATERIALMANAGER_H
|
||||
|
||||
@@ -9,23 +9,18 @@
|
||||
|
||||
|
||||
// Description : Class that collects error reports to present them later.
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_INTERFACE_ERRORREPORT_H
|
||||
#define CRYINCLUDE_EDITOR_INTERFACE_ERRORREPORT_H
|
||||
#pragma once
|
||||
|
||||
#include <IValidator.h>
|
||||
|
||||
// forward declarations.
|
||||
class CParticleItem;
|
||||
class CBaseObject;
|
||||
class CBaseLibraryItem;
|
||||
class CErrorRecord;
|
||||
class QString;
|
||||
|
||||
/*! Error report manages collection of errors occurred during map analyzes or level load.
|
||||
*/
|
||||
struct IErrorReport
|
||||
: public IValidator
|
||||
{
|
||||
virtual ~IErrorReport(){}
|
||||
|
||||
@@ -62,12 +57,4 @@ struct IErrorReport
|
||||
|
||||
//! Assign current filename.
|
||||
virtual void SetCurrentFile(const QString& file) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Implement IValidator interface.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void Report(SValidatorRecord& record) = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_EDITOR_ERRORREPORT_H
|
||||
|
||||
@@ -89,7 +89,6 @@ public:
|
||||
//! Get array of objects, managed by manager (not contain sub objects of groups).
|
||||
//! @param layer if 0 get objects for all layers, or layer to get objects from.
|
||||
virtual void GetObjects(CBaseObjectsArray& objects) const = 0;
|
||||
//virtual void GetObjects(DynArray<CBaseObject*>& objects) const = 0;
|
||||
|
||||
//! Get array of objects that pass the filter.
|
||||
//! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
|
||||
|
||||
@@ -170,7 +170,6 @@ public:
|
||||
MOCK_METHOD0(IsSourceControlConnected, bool());
|
||||
MOCK_METHOD0(GetUIEnumsDatabase, CUIEnumsDatabase* ());
|
||||
MOCK_METHOD0(AddUIEnums, void());
|
||||
MOCK_METHOD1(GetMemoryUsage, void(ICrySizer* ));
|
||||
MOCK_METHOD0(ReduceMemory, void());
|
||||
MOCK_METHOD0(GetExportManager, IExportManager* ());
|
||||
MOCK_METHOD2(SetEditorConfigSpec, void(ESystemConfigSpec , ESystemConfigPlatform ));
|
||||
|
||||
@@ -2735,7 +2735,7 @@ bool CBaseObject::IntersectRayMesh(const Vec3& raySrc, const Vec3& rayDir, SRayH
|
||||
return false;
|
||||
}
|
||||
|
||||
Matrix34A worldTM;
|
||||
Matrix34 worldTM;
|
||||
IStatObj* pStatObj = pRenderNode->GetEntityStatObj(0, 0, &worldTM);
|
||||
if (!pStatObj)
|
||||
{
|
||||
@@ -2743,7 +2743,7 @@ bool CBaseObject::IntersectRayMesh(const Vec3& raySrc, const Vec3& rayDir, SRayH
|
||||
}
|
||||
|
||||
// transform decal into object space
|
||||
Matrix34A worldTM_Inverted = worldTM.GetInverted();
|
||||
Matrix34 worldTM_Inverted = worldTM.GetInverted();
|
||||
Matrix33 worldRot(worldTM_Inverted);
|
||||
worldRot.Transpose();
|
||||
// put hit direction into the object space
|
||||
|
||||
@@ -759,17 +759,6 @@ void CObjectManager::GetObjects(CBaseObjectsArray& objects) const
|
||||
}
|
||||
}
|
||||
|
||||
//void CObjectManager::GetObjects(DynArray<CBaseObject*>& objects) const
|
||||
//{
|
||||
// CBaseObjectsArray objectArray;
|
||||
// GetObjects(objectArray);
|
||||
// objects.clear();
|
||||
// for (size_t i = 0, iCount(objectArray.size()); i < iCount; ++i)
|
||||
// {
|
||||
// objects.push_back(objectArray[i]);
|
||||
// }
|
||||
//}
|
||||
|
||||
void CObjectManager::GetObjects(CBaseObjectsArray& objects, BaseObjectFilterFunctor const& filter) const
|
||||
{
|
||||
objects.clear();
|
||||
|
||||
@@ -122,7 +122,6 @@ public:
|
||||
//! Get array of objects, managed by manager (not contain sub objects of groups).
|
||||
//! @param layer if 0 get objects for all layers, or layer to get objects from.
|
||||
void GetObjects(CBaseObjectsArray& objects) const;
|
||||
//void GetObjects(DynArray<CBaseObject*>& objects) const;
|
||||
|
||||
//! Get array of objects that pass the filter.
|
||||
//! @param filter The filter functor, return true if you want to get the certain obj, return false if want to skip it.
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include <AzToolsFramework/ToolsComponents/EditorEntityIconComponentBus.h>
|
||||
#include <AzToolsFramework/Undo/UndoCacheInterface.h>
|
||||
#include <LmbrCentral/Rendering/RenderNodeBus.h>
|
||||
#include <LmbrCentral/Rendering/MaterialOwnerBus.h>
|
||||
|
||||
#include <IDisplayViewport.h>
|
||||
#include <CryCommon/Cry_GeoIntersect.h>
|
||||
|
||||
@@ -62,17 +62,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// to get memory statistics
|
||||
void GetMemoryUsage(ICrySizer* pSizer)
|
||||
{
|
||||
for (int i = 0; i < m_undoSteps.size(); i++)
|
||||
{
|
||||
m_undoSteps[i]->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
pSizer->Add(*this);
|
||||
}
|
||||
|
||||
private:
|
||||
//! Undo steps included in this step.
|
||||
std::vector<CUndoStep*> m_undoSteps;
|
||||
@@ -746,31 +735,6 @@ int CUndoManager::GetMaxUndoStep() const
|
||||
return GetIEditor()->GetEditorSettings()->undoLevels;
|
||||
}
|
||||
|
||||
void CUndoManager::GetMemoryUsage(ICrySizer* pSizer)
|
||||
{
|
||||
if (m_currentUndo)
|
||||
{
|
||||
m_currentUndo->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
if (m_superUndo)
|
||||
{
|
||||
m_superUndo->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
for (std::list<CUndoStep*>::const_iterator it = m_undoStack.begin(); it != m_undoStack.end(); it++)
|
||||
{
|
||||
(*it)->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
for (std::list<CUndoStep*>::const_iterator it = m_redoStack.begin(); it != m_redoStack.end(); it++)
|
||||
{
|
||||
(*it)->GetMemoryUsage(pSizer);
|
||||
}
|
||||
|
||||
pSizer->Add(*this);
|
||||
}
|
||||
|
||||
void CUndoManager::AddListener(IUndoManagerListener* pListener)
|
||||
{
|
||||
stl::push_back_unique(m_listeners, pListener);
|
||||
|
||||
+1
-18
@@ -12,9 +12,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "IUndoManagerListener.h"
|
||||
#include "CrySizer.h" // ICrySizer
|
||||
#include "IUndoObject.h"
|
||||
#include <AzCore/Asset/AssetManager.h>
|
||||
#include <CryCommon/StlUtils.h>
|
||||
|
||||
struct IUndoObject;
|
||||
class CSuperUndoStep;
|
||||
@@ -79,20 +79,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
// to get memory statistics
|
||||
void GetMemoryUsage(ICrySizer* pSizer)
|
||||
{
|
||||
size_t nThisSize = sizeof(*this);
|
||||
|
||||
for (int i = 0; i < m_undoObjects.size(); i++)
|
||||
{
|
||||
nThisSize += m_undoObjects[i]->GetSize();
|
||||
}
|
||||
|
||||
pSizer->Add(m_name);
|
||||
pSizer->Add(this, nThisSize);
|
||||
}
|
||||
|
||||
// get undo object at index i
|
||||
IUndoObject* GetUndoObject(int i = 0)
|
||||
{
|
||||
@@ -241,9 +227,6 @@ public:
|
||||
void ClearUndoStack(int num);
|
||||
void ClearRedoStack(int num);
|
||||
|
||||
// to get memory statistics
|
||||
void GetMemoryUsage(ICrySizer* pSizer);
|
||||
|
||||
void AddListener(IUndoManagerListener* pListener);
|
||||
void RemoveListener(IUndoManagerListener* pListener);
|
||||
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
#include <Cry_Color.h>
|
||||
#include <CryCommon/ISystem.h>
|
||||
|
||||
//! Typedef for quaternion.
|
||||
//typedef CryQuat Quat;
|
||||
|
||||
#include <QColor>
|
||||
#include <QDataStream>
|
||||
#include <QGuiApplication>
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
struct SStatObj
|
||||
{
|
||||
Matrix34 tm;
|
||||
_smart_ptr<IStatObj> pStatObj;
|
||||
IStatObj* pStatObj;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user