Legacy cleanup, part 2 (#3659)

* Legacy cleanup, part 2

There are still things that can be removed, those will be likely done in part three:
`The Return of the Cleanup` :)

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>

* Fix windows build

Somehow there were some unfixed errors from enabled warnings?
I'm unsure if I've pulled repo in unstable state, or those were somehow
missed.

Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
This commit is contained in:
Artur K
2021-08-30 22:40:02 +02:00
committed by GitHub
parent fa0f2a1007
commit 96a5f06ca3
116 changed files with 189 additions and 18706 deletions
-190
View File
@@ -11,7 +11,6 @@
#include "smartptr.h" // TYPEDEF_AUTOPTR
#include "IMaterial.h"
#include "ISerialize.h"
// forward declarations
//////////////////////////////////////////////////////////////////////
@@ -35,15 +34,12 @@ struct phys_geometry;
struct IChunkFile;
// General forward declaration.
class CRenderObject;
struct SMeshLodInfo;
#include "CryHeaders.h"
#include "Cry_Color.h"
#include "Cry_Math.h"
#include "Cry_Geo.h"
#include "CrySizer.h"
#include "stridedptr.h"
#define MAX_STATOBJ_LODS_NUM 6
@@ -150,70 +146,6 @@ enum EFileStreamingStatus
ecss_Ready
};
// Interface for streaming of objects like CStatObj.
struct IStreamable
{
struct SInstancePriorityInfo
{
int nRoundId;
float fMaxImportance;
};
IStreamable()
{
ZeroStruct(m_arrUpdateStreamingPrioriryRoundInfo);
m_eStreamingStatus = ecss_NotLoaded;
fCurImportance = 0;
m_nSelectedFrameId = 0;
m_nStatsInUse = 0;
}
bool UpdateStreamingPrioriryLowLevel(float fImportance, int nRoundId, bool bFullUpdate)
{
bool bRegister = false;
if (m_arrUpdateStreamingPrioriryRoundInfo[0].nRoundId != nRoundId)
{
if (!m_arrUpdateStreamingPrioriryRoundInfo[0].nRoundId)
{
bRegister = true;
}
m_arrUpdateStreamingPrioriryRoundInfo[1] = m_arrUpdateStreamingPrioriryRoundInfo[0];
m_arrUpdateStreamingPrioriryRoundInfo[0].nRoundId = nRoundId;
m_arrUpdateStreamingPrioriryRoundInfo[0].fMaxImportance = fImportance;
}
else
{
m_arrUpdateStreamingPrioriryRoundInfo[0].fMaxImportance = max(m_arrUpdateStreamingPrioriryRoundInfo[0].fMaxImportance, fImportance);
}
if (bFullUpdate)
{
m_arrUpdateStreamingPrioriryRoundInfo[1] = m_arrUpdateStreamingPrioriryRoundInfo[0];
m_arrUpdateStreamingPrioriryRoundInfo[1].nRoundId--;
}
return bRegister;
}
// <interfuscator:shuffle>
virtual ~IStreamable(){}
virtual void StartStreaming(bool bFinishNow, IReadStream_AutoPtr* ppStream) = 0;
virtual int GetStreamableContentMemoryUsage(bool bJustForDebug = false) = 0;
virtual void ReleaseStreamableContent() = 0;
virtual void GetStreamableName(AZStd::string& sName) = 0;
virtual uint32 GetLastDrawMainFrameId() = 0;
virtual bool IsUnloadable() const = 0;
SInstancePriorityInfo m_arrUpdateStreamingPrioriryRoundInfo[2];
float fCurImportance;
EFileStreamingStatus m_eStreamingStatus;
uint32 m_nSelectedFrameId : 31;
uint32 m_nStatsInUse : 1;
};
struct SMeshBoneMapping_uint8;
struct SSpine;
struct SMeshColor;
@@ -221,7 +153,6 @@ struct SMeshColor;
// Summary:
// Interface to hold static object data
struct IStatObj
: public IStreamable
{
//! Loading flags
enum ELoadingFlags
@@ -262,50 +193,6 @@ struct IStatObj
};
//////////////////////////////////////////////////////////////////////////
// Statistics information about this object.
struct SStatistics
{
int nVertices;
int nVerticesPerLod[MAX_STATOBJ_LODS_NUM];
int nIndices;
int nIndicesPerLod[MAX_STATOBJ_LODS_NUM];
int nMeshSize;
int nMeshSizeLoaded;
int nPhysProxySize;
int nPhysProxySizeMax;
int nPhysPrimitives;
int nDrawCalls;
int nLods;
int nSubMeshCount;
int nNumRefs;
bool bSplitLods; // Lods split between files.
// Optional texture sizer.
ICrySizer* pTextureSizer;
ICrySizer* pTextureSizer2;
SStatistics() { Reset(); }
void Reset()
{
pTextureSizer = NULL;
pTextureSizer2 = NULL;
nVertices = 0;
nIndices = 0;
nMeshSize = 0;
nMeshSizeLoaded = 0;
nNumRefs = 0;
nPhysProxySize = 0;
nPhysPrimitives = 0;
nDrawCalls = 0;
nLods = 0;
nSubMeshCount = 0;
bSplitLods = false;
ZeroStruct(nVerticesPerLod);
ZeroStruct(nIndicesPerLod);
}
};
// <interfuscator:shuffle>
// Description:
// Increase the reference count of the object.
@@ -337,10 +224,6 @@ struct IStatObj
// Retrieves the internal flag m_nVehicleOnlyPhysics.
virtual unsigned int GetVehicleOnlyPhysics() = 0;
// Description:
// Retrieves the internal flag m_nIdMaterialBreakable.
virtual int GetIDMatBreakable() = 0;
// Description:
// Retrieves the internal flag m_bBreakableByGame.
virtual unsigned int GetBreakableByGame() = 0;
@@ -364,34 +247,6 @@ struct IStatObj
//! Access to rendering geometry for indoor engine ( optimized vert arrays, lists of shader pointers )
virtual struct IRenderMesh* GetRenderMesh() = 0;
// Description:
// Returns the physical representation of the object.
// Arguments:
// nType - one of PHYS_GEOM_TYPE_'s, or an explicit slot index
// Return Value:
// A pointer to a phys_geometry structure.
// Summary:
// Get the physic representation
virtual phys_geometry* GetPhysGeom(int nType = PHYS_GEOM_TYPE_DEFAULT) = 0;
// Description:
// Updates rendermesh's vertices, normals, and tangents with the data provided
// Summary:
// Updates vertices in the range [iVtx0..iVtx0+nVtx-1], vertices are in their original order
// (as they are physicalized). Clones the object if necessary to make the modifications
// Return Value:
// modified IStatObj (a clone or this one, if it's already a clone)
virtual IStatObj* UpdateVertices(strided_pointer<Vec3> pVtx, strided_pointer<Vec3> pNormals, int iVtx0, int nVtx, int* pVtxMap = 0, float rscale = 1.f) = 0;
// Description:
// Skins rendermesh's vertices based on skeleton vertices
// Summary:
// Skins vertices based on mtxSkelToMesh[pSkelVtx[i]]
// Clones the object if necessary to make the modifications
// Return Value:
// modified IStatObj (a clone or this one, if it's already a clone)
virtual IStatObj* SkinVertices(strided_pointer<Vec3> pSkelVtx, const Matrix34& mtxSkelToMesh) = 0;
// Description:
// Sets and replaces the physical representation of the object.
// Arguments:
@@ -431,18 +286,6 @@ struct IStatObj
// Get the minimal bounding box component
virtual Vec3 GetBoxMax() = 0;
// Return Value:
// A Vec3 object containing the bounding box center.
// Summary:
// Get the center of bounding box
virtual const Vec3 GetVegCenter() = 0;
// Arguments:
// Minimum bounding box component
// Summary:
// Set the minimum bounding box component
virtual void SetBBoxMin(const Vec3& vBBoxMin) = 0;
// Arguments:
// Minimum bounding box component
// Summary:
@@ -502,17 +345,9 @@ struct IStatObj
virtual int FindNearesLoadedLOD(int nLodIn, bool bSearchUp = false) = 0;
virtual int FindHighestLOD(int nBias) = 0;
virtual bool LoadCGF(const char* filename, bool bLod, unsigned long nLoadingFlags, const void* pData, const int nDataSize) = 0;
virtual void DisableStreaming() = 0;
virtual void TryMergeSubObjects(bool bFromStreaming) = 0;
virtual bool IsUnloadable() const = 0;
virtual void SetCanUnload(bool value) = 0;
virtual AZStd::string& GetFileName() = 0;
virtual const AZStd::string& GetFileName() const = 0;
virtual const AZStd::string& GetCGFNodeName() const = 0;
// Summary:
// Returns the filename of the object
// Return Value:
@@ -527,25 +362,6 @@ struct IStatObj
// None
virtual void SetFilePath(const char* szFileName) = 0;
// Summary:
// Returns the name of the geometry
// Return Value:
// A null terminated string which contains the name of the geometry
virtual const char* GetGeoName() = 0;
// Summary:
// Sets the name of the geometry
virtual void SetGeoName(const char* szGeoName) = 0;
// Summary:
// Compares if another object is the same
// Arguments:
// szFileName - Filename of the object to compare
// szGeomName - Geometry name of the object to compare (optional)
// Return Value:
// A boolean which equals to true in case both object are the same, or false in the opposite case.
virtual bool IsSameObject(const char* szFileName, const char* szGeomName) = 0;
// Description:
// Will return the position of the helper named in the argument. The
// helper should have been specified during the exporting process of
@@ -679,9 +495,6 @@ struct IStatObj
// hides all non-physicalized geometry, clones the object if necessary
virtual IStatObj* HideFoliage() = 0;
// serializes the StatObj's mesh into a stream
virtual int Serialize(TSerialize ser) = 0;
// Get object properties as loaded from CGF.
virtual const char* GetProperties() = 0;
@@ -702,9 +515,6 @@ struct IStatObj
// Debug Draw this static object.
virtual void DebugDraw(const struct SGeometryDebugDrawInfo& info, float fExtrdueScale = 0.01f) = 0;
// Fill statistics about the level.
virtual void GetStatistics(SStatistics& stats) = 0;
// Returns initial hide mask
virtual uint64 GetInitialHideMask() = 0;