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:
@@ -188,7 +188,7 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event)
|
||||
float scale = 0;
|
||||
|
||||
i = static_cast<int>(((float)x / graphWidth) * (kNumColorLevels - 1));
|
||||
i = CLAMP(i, 0, kNumColorLevels - 1);
|
||||
i = AZStd::clamp(i, 0, kNumColorLevels - 1);
|
||||
|
||||
switch (m_drawMode)
|
||||
{
|
||||
@@ -253,7 +253,7 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event)
|
||||
for (size_t x = 0, xCount = abs(rcGraph.width()); x < xCount; ++x)
|
||||
{
|
||||
i = static_cast<int>(((float)x / graphWidth) * (kNumColorLevels - 1));
|
||||
i = CLAMP(i, 0, kNumColorLevels - 1);
|
||||
i = AZStd::clamp(i, 0, kNumColorLevels - 1);
|
||||
crtX = static_cast<UINT>(rcGraph.left() + x + 1);
|
||||
scaleR = scaleG = scaleB = scaleA = 0;
|
||||
|
||||
@@ -345,7 +345,7 @@ void CImageHistogramDisplay::paintEvent([[maybe_unused]] QPaintEvent* event)
|
||||
{
|
||||
pos = (float)x / graphWidth;
|
||||
i = static_cast<int>((float)((int)(pos * kNumColorLevels) % aThirdOfNumColorLevels) / aThirdOfNumColorLevels * kNumColorLevels);
|
||||
i = CLAMP(i, 0, kNumColorLevels - 1);
|
||||
i = AZStd::clamp(i, 0, kNumColorLevels - 1);
|
||||
scale = 0;
|
||||
|
||||
// R
|
||||
|
||||
@@ -101,7 +101,7 @@ void CSplineCtrl::PointToTimeValue(const QPoint& point, float& time, float& valu
|
||||
{
|
||||
time = XOfsToTime(point.x());
|
||||
float t = float(m_rcSpline.bottom() - point.y()) / m_rcSpline.height();
|
||||
value = LERP(m_fMinValue, m_fMaxValue, t);
|
||||
value = AZ::Lerp(m_fMinValue, m_fMaxValue, t);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -109,7 +109,7 @@ float CSplineCtrl::XOfsToTime(int x)
|
||||
{
|
||||
// m_fMinTime to m_fMaxTime time range.
|
||||
float t = float(x - m_rcSpline.left()) / m_rcSpline.width();
|
||||
return LERP(m_fMinTime, m_fMaxTime, t);
|
||||
return AZ::Lerp(m_fMinTime, m_fMaxTime, t);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
// CryCommon
|
||||
#include <CryCommon/HMDBus.h>
|
||||
#include <CryCommon/IRenderAuxGeom.h>
|
||||
#include <CryCommon/physinterface.h>
|
||||
|
||||
// AzFramework
|
||||
#include <AzFramework/Render/IntersectorInterface.h>
|
||||
@@ -70,7 +69,6 @@
|
||||
#include "Include/IDisplayViewport.h"
|
||||
#include "Objects/ObjectManager.h"
|
||||
#include "ProcessInfo.h"
|
||||
#include "IPostEffectGroup.h"
|
||||
#include "EditorPreferencesPageGeneral.h"
|
||||
#include "ViewportManipulatorController.h"
|
||||
#include "EditorViewportSettings.h"
|
||||
@@ -100,7 +98,6 @@
|
||||
#include <QtGui/private/qhighdpiscaling_p.h>
|
||||
|
||||
#include <IEntityRenderState.h>
|
||||
#include <IPhysics.h>
|
||||
#include <IStatObj.h>
|
||||
|
||||
AZ_CVAR(
|
||||
|
||||
@@ -356,10 +356,9 @@ void CExportManager::AddMesh(Export::CObject* pObj, const IIndexedMesh* pIndMesh
|
||||
|
||||
for (int v = 0; v < meshDesc.m_nCoorCount; ++v)
|
||||
{
|
||||
Export::UV tc;
|
||||
meshDesc.m_pTexCoord[v].ExportTo(tc.u, tc.v);
|
||||
tc.v = 1.0f - tc.v;
|
||||
pObj->m_texCoords.push_back(tc);
|
||||
Vec2 uv = meshDesc.m_pTexCoord[v].GetUV();
|
||||
uv.y = 1.0f - uv.y;
|
||||
pObj->m_texCoords.push_back({uv.x,uv.y});
|
||||
}
|
||||
|
||||
if (pIndMesh->GetSubSetCount() && !(pIndMesh->GetSubSetCount() == 1 && pIndMesh->GetSubSet(0).nNumIndices == 0))
|
||||
|
||||
@@ -161,61 +161,6 @@ void* CTriMesh::ReAllocElements(void* old_ptr, int new_elem_num, int size_of_ele
|
||||
return realloc(old_ptr, new_elem_num * size_of_element);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Unshare all vertices and split on 3 arrays, positions/texcoords.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CTriMesh::SetFromMesh(CMesh& mesh)
|
||||
{
|
||||
bbox = mesh.m_bbox;
|
||||
|
||||
int maxVerts = mesh.GetIndexCount();
|
||||
|
||||
SetVertexCount(maxVerts);
|
||||
SetUVCount(maxVerts);
|
||||
if (mesh.m_pColor0)
|
||||
{
|
||||
SetColorsCount(maxVerts);
|
||||
}
|
||||
|
||||
SetFacesCount(mesh.GetIndexCount());
|
||||
|
||||
int numv = 0;
|
||||
int numface = 0;
|
||||
for (int nSubset = 0; nSubset < mesh.GetSubSetCount(); nSubset++)
|
||||
{
|
||||
SMeshSubset& subset = mesh.m_subsets[nSubset];
|
||||
for (int i = subset.nFirstIndexId; i < subset.nFirstIndexId + subset.nNumIndices; i += 3)
|
||||
{
|
||||
CTriFace& face = pFaces[numface++];
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
int idx = mesh.m_pIndices[i + j];
|
||||
pVertices[numv].pos = mesh.m_pPositions ? mesh.m_pPositions[idx] : mesh.m_pPositionsF16[idx].ToVec3();
|
||||
pWeights[numv] = 0.0f;
|
||||
pUV[numv] = mesh.m_pTexCoord[idx];
|
||||
if (mesh.m_pColor0)
|
||||
{
|
||||
pColors[numv] = mesh.m_pColor0[idx];
|
||||
}
|
||||
|
||||
face.v [j] = numv;
|
||||
face.uv[j] = numv;
|
||||
face.n [j] = mesh.m_pNorms[idx].GetN();
|
||||
face.MatID = static_cast<unsigned char>(subset.nMatID);
|
||||
face.flags = 0;
|
||||
|
||||
numv++;
|
||||
}
|
||||
}
|
||||
}
|
||||
SetFacesCount(numface);
|
||||
SharePositions();
|
||||
ShareUV();
|
||||
UpdateEdges();
|
||||
|
||||
CalcFaceNormals();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
inline int FindVertexInHash(const Vec3& vPosToFind, const CTriVertex* pVectors, std::vector<int>& hash, float fEpsilon)
|
||||
{
|
||||
@@ -360,76 +305,6 @@ void CTriMesh::CalcFaceNormals()
|
||||
#define TEX_EPS 0.001f
|
||||
#define VER_EPS 0.001f
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CTriMesh::UpdateIndexedMesh(IIndexedMesh* pIndexedMesh) const
|
||||
{
|
||||
{
|
||||
const int maxVerts = nFacesCount * 3;
|
||||
|
||||
pIndexedMesh->SetVertexCount(maxVerts);
|
||||
pIndexedMesh->SetTexCoordCount(maxVerts);
|
||||
if (pColors)
|
||||
{
|
||||
pIndexedMesh->SetColorCount(maxVerts);
|
||||
}
|
||||
pIndexedMesh->SetIndexCount(0);
|
||||
pIndexedMesh->SetFaceCount(nFacesCount);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// To find really used materials
|
||||
std::vector<int> usedMaterialIds;
|
||||
uint16 MatIdToSubset[MAX_SUB_MATERIALS];
|
||||
uint16 nLastSubsetId = 0;
|
||||
memset(MatIdToSubset, 0, sizeof(MatIdToSubset));
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CMesh& mesh = *pIndexedMesh->GetMesh();
|
||||
AABB bb;
|
||||
bb.Reset();
|
||||
for (int i = 0; i < nFacesCount; ++i)
|
||||
{
|
||||
const CTriFace& face = pFaces[i];
|
||||
SMeshFace& meshFace = mesh.m_pFaces[i];
|
||||
|
||||
// Remap new used material ID to index of chunk id.
|
||||
if (!MatIdToSubset[face.MatID])
|
||||
{
|
||||
MatIdToSubset[face.MatID] = 1 + nLastSubsetId++;
|
||||
usedMaterialIds.push_back(face.MatID); // Order of material ids in usedMaterialIds correspond to the indices of chunks.
|
||||
}
|
||||
meshFace.nSubset = static_cast<unsigned char>(MatIdToSubset[face.MatID] - 1);
|
||||
|
||||
for (int j = 0; j < 3; ++j)
|
||||
{
|
||||
const int dstVIdx = i * 3 + j;
|
||||
|
||||
mesh.m_pPositions[dstVIdx] = pVertices[face.v[j]].pos;
|
||||
mesh.m_pNorms[dstVIdx] = SMeshNormal(face.n[j]);
|
||||
mesh.m_pTexCoord[dstVIdx] = pUV[face.uv[j]];
|
||||
if (pColors)
|
||||
{
|
||||
mesh.m_pColor0[dstVIdx] = pColors[face.v[j]];
|
||||
}
|
||||
|
||||
meshFace.v[j] = dstVIdx;
|
||||
|
||||
bb.Add(mesh.m_pPositions[dstVIdx]);
|
||||
}
|
||||
}
|
||||
|
||||
pIndexedMesh->SetBBox(bb);
|
||||
|
||||
pIndexedMesh->SetSubSetCount(static_cast<int>(usedMaterialIds.size()));
|
||||
for (int i = 0; i < usedMaterialIds.size(); i++)
|
||||
{
|
||||
pIndexedMesh->SetSubsetMaterialId(i, usedMaterialIds[i]);
|
||||
}
|
||||
|
||||
pIndexedMesh->Optimize();
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CTriMesh::CopyStream(CTriMesh& fromMesh, int stream)
|
||||
{
|
||||
|
||||
@@ -198,8 +198,6 @@ public:
|
||||
void GetStreamInfo(int stream, void*& pStream, int& nElementSize) const;
|
||||
int GetStreamSize(int stream) const { return m_streamSize[stream]; };
|
||||
|
||||
void SetFromMesh(CMesh& mesh);
|
||||
void UpdateIndexedMesh(IIndexedMesh* pIndexedMesh) const;
|
||||
// Calculate per face normal.
|
||||
void CalcFaceNormals();
|
||||
|
||||
|
||||
@@ -8,14 +8,12 @@
|
||||
|
||||
|
||||
// Description : Classes to deal with commands
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H
|
||||
#define CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H
|
||||
#pragma once
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <AzCore/std/string/conversions.h>
|
||||
#include <CryCommon/LegacyAllocator.h>
|
||||
#include "Util/EditorUtils.h"
|
||||
|
||||
inline AZStd::string ToString(const QString& s)
|
||||
@@ -23,8 +21,20 @@ inline AZStd::string ToString(const QString& s)
|
||||
return s.toUtf8().data();
|
||||
}
|
||||
|
||||
|
||||
class CCommand
|
||||
{
|
||||
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;
|
||||
}
|
||||
public:
|
||||
CCommand(
|
||||
const AZStd::string& module,
|
||||
@@ -77,7 +87,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
int GetArgCount() const
|
||||
size_t GetArgCount() const
|
||||
{ return m_args.size(); }
|
||||
const AZStd::string& GetArg(int i) const
|
||||
{
|
||||
@@ -85,7 +95,7 @@ public:
|
||||
return m_args[i];
|
||||
}
|
||||
private:
|
||||
DynArray<AZStd::string> m_args;
|
||||
AZStd::vector<AZStd::string,AZ::StdLegacyAllocator> m_args;
|
||||
unsigned char m_stringFlags; // This is needed to quote string parameters when logging a command.
|
||||
};
|
||||
|
||||
@@ -115,7 +125,7 @@ protected:
|
||||
static inline AZStd::string ToString_(const char* val)
|
||||
{ return val; }
|
||||
template <typename T>
|
||||
static bool FromString_(T& t, const char* s) { return ::FromString(t, s); }
|
||||
static bool FromString_(T& t, const char* s) { return FromString(t, s); }
|
||||
static inline bool FromString_(const char*& val, const char* s)
|
||||
{ return (val = s) != 0; }
|
||||
|
||||
@@ -789,4 +799,3 @@ QString CCommand6<LIST(6, P)>::Execute(const CCommand::CArgs& args)
|
||||
}
|
||||
return "";
|
||||
}
|
||||
#endif // CRYINCLUDE_EDITOR_INCLUDE_COMMAND_H
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../Include/SandboxAPI.h"
|
||||
#include <CryCommon/LegacyAllocator.h>
|
||||
#include <set>
|
||||
|
||||
class QWidget;
|
||||
@@ -103,7 +104,7 @@ struct IFileUtil
|
||||
}
|
||||
};
|
||||
|
||||
typedef DynArray<FileDesc> FileArray;
|
||||
using FileArray = AZStd::vector<FileDesc, AZ::StdLegacyAllocator>;
|
||||
|
||||
typedef bool (* ScanDirectoryUpdateCallBack)(const QString& msg);
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ 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;
|
||||
//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.
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#include <AzTest/AzTest.h>
|
||||
#include <IEditor.h>
|
||||
#include <SFunctor.h>
|
||||
#include <RenderHelpers/AxisHelper.h>
|
||||
|
||||
class CEditorMock
|
||||
@@ -85,8 +84,8 @@ public:
|
||||
MOCK_METHOD0(GetObjectManager, struct IObjectManager* ());
|
||||
MOCK_METHOD0(GetSettingsManager, CSettingsManager* ());
|
||||
MOCK_METHOD1(GetDBItemManager, IDataBaseManager* (EDataBaseItemType));
|
||||
MOCK_METHOD0(GetMaterialManagerLibrary, IBaseLibraryManager* ());
|
||||
MOCK_METHOD0(GetIEditorMaterialManager, IEditorMaterialManager* ());
|
||||
MOCK_METHOD0(GetMaterialManagerLibrary, IBaseLibraryManager* ());
|
||||
MOCK_METHOD0(GetIEditorMaterialManager, IEditorMaterialManager* ());
|
||||
MOCK_METHOD0(GetIconManager, IIconManager* ());
|
||||
MOCK_METHOD0(GetMusicManager, CMusicManager* ());
|
||||
MOCK_METHOD2(GetTerrainElevation, float(float , float ));
|
||||
@@ -183,7 +182,7 @@ public:
|
||||
MOCK_METHOD0(GetEnv, SSystemGlobalEnvironment* ());
|
||||
MOCK_METHOD0(GetImageUtil, IImageUtil* ());
|
||||
MOCK_METHOD0(GetEditorSettings, SEditorSettings* ());
|
||||
MOCK_METHOD0(GetLogFile, ILogFile* ());
|
||||
MOCK_METHOD0(GetLogFile, ILogFile* ());
|
||||
MOCK_METHOD0(UnloadPlugins, void());
|
||||
MOCK_METHOD0(LoadPlugins, void());
|
||||
MOCK_METHOD1(GetSearchPath, QString(EEditorPathName));
|
||||
|
||||
@@ -2057,53 +2057,7 @@ bool CBaseObject::IsChildOf(CBaseObject* node)
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::GetAllChildren(TBaseObjects& outAllChildren, CBaseObject* pObj) const
|
||||
{
|
||||
const CBaseObject* pBaseObj = pObj ? pObj : this;
|
||||
|
||||
for (size_t i = 0, iChildCount(pBaseObj->GetChildCount()); i < iChildCount; ++i)
|
||||
{
|
||||
CBaseObject* pChild = pBaseObj->GetChild(i);
|
||||
if (pChild == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
outAllChildren.push_back(pChild);
|
||||
GetAllChildren(outAllChildren, pChild);
|
||||
}
|
||||
}
|
||||
|
||||
void CBaseObject::GetAllChildren(DynArray< _smart_ptr<CBaseObject> >& outAllChildren, CBaseObject* pObj) const
|
||||
{
|
||||
const CBaseObject* pBaseObj = pObj ? pObj : this;
|
||||
|
||||
for (size_t i = 0, iChildCount(pBaseObj->GetChildCount()); i < iChildCount; ++i)
|
||||
{
|
||||
CBaseObject* pChild = pBaseObj->GetChild(i);
|
||||
if (pChild == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
outAllChildren.push_back(pChild);
|
||||
GetAllChildren(outAllChildren, pChild);
|
||||
}
|
||||
}
|
||||
|
||||
void CBaseObject::GetAllChildren(CSelectionGroup& outAllChildren, CBaseObject* pObj) const
|
||||
{
|
||||
const CBaseObject* pBaseObj = pObj ? pObj : this;
|
||||
|
||||
for (size_t i = 0, iChildCount(pBaseObj->GetChildCount()); i < iChildCount; ++i)
|
||||
{
|
||||
CBaseObject* pChild = pBaseObj->GetChild(i);
|
||||
if (pChild == nullptr)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
outAllChildren.AddObject(pChild);
|
||||
GetAllChildren(outAllChildren, pChild);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CBaseObject::CloneChildren(CBaseObject* pFromObject)
|
||||
|
||||
@@ -408,10 +408,6 @@ public:
|
||||
CBaseObject* GetParent() const { return m_parent; };
|
||||
//! Scans hierarchy up to determine if we child of specified node.
|
||||
virtual bool IsChildOf(CBaseObject* node);
|
||||
//! Get all child objects
|
||||
void GetAllChildren(TBaseObjects& outAllChildren, CBaseObject* pObj = nullptr) const;
|
||||
void GetAllChildren(DynArray< _smart_ptr<CBaseObject> >& outAllChildren, CBaseObject* pObj = nullptr) const;
|
||||
void GetAllChildren(CSelectionGroup& outAllChildren, CBaseObject* pObj = nullptr) const;
|
||||
//! Clone Children
|
||||
void CloneChildren(CBaseObject* pFromObject);
|
||||
//! Attach new child node.
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "SandboxAPI.h"
|
||||
#include <Cry_Color.h>
|
||||
#include <Cry_Geo.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
|
||||
#include <QColor>
|
||||
|
||||
|
||||
@@ -759,16 +759,16 @@ 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(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
|
||||
{
|
||||
|
||||
@@ -122,7 +122,7 @@ 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;
|
||||
//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.
|
||||
|
||||
@@ -59,8 +59,8 @@ public:
|
||||
}
|
||||
const QString iconsDir = gSettings.searchPaths[EDITOR_PATH_UI_ICONS][0];
|
||||
CFileUtil::ScanDirectory(iconsDir, "*.png", pngFiles);
|
||||
m_iconImages.reserve(pngFiles.size());
|
||||
m_iconFiles.reserve(pngFiles.size());
|
||||
m_iconImages.reserve(static_cast<int>(pngFiles.size()));
|
||||
m_iconFiles.reserve(static_cast<int>(pngFiles.size()));
|
||||
for (size_t i = 0; i < pngFiles.size(); ++i)
|
||||
{
|
||||
const QString path = Path::Make(iconsDir, pngFiles[i].filename);
|
||||
|
||||
@@ -62,11 +62,6 @@ CDynamicArray2D::~CDynamicArray2D()
|
||||
}
|
||||
|
||||
|
||||
void CDynamicArray2D::GetMemoryUsage(ICrySizer* pSizer)
|
||||
{
|
||||
pSizer->Add((char*)this, m_Dimension1 * m_Dimension2 * sizeof(float) + sizeof(*this));
|
||||
}
|
||||
|
||||
void CDynamicArray2D::ScaleImage(CDynamicArray2D* pDestination)
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -24,8 +24,6 @@ public:
|
||||
virtual ~CDynamicArray2D();
|
||||
//
|
||||
void ScaleImage(CDynamicArray2D* pDestination);
|
||||
//
|
||||
void GetMemoryUsage(ICrySizer* pSizer);
|
||||
|
||||
|
||||
float** m_Array; //
|
||||
|
||||
@@ -28,7 +28,7 @@ QColor ScaleColor(const QColor& c, float aScale)
|
||||
const float g = static_cast<float>(aColor.green()) * aScale;
|
||||
const float b = static_cast<float>(aColor.blue()) * aScale;
|
||||
|
||||
return QColor(CLAMP(static_cast<int>(r), 0, 255), CLAMP(static_cast<int>(g), 0, 255), CLAMP(static_cast<int>(b), 0, 255));
|
||||
return QColor(AZStd::clamp(static_cast<int>(r), 0, 255), AZStd::clamp(static_cast<int>(g), 0, 255), AZStd::clamp(static_cast<int>(b), 0, 255));
|
||||
}
|
||||
|
||||
CAlphaBitmap::CAlphaBitmap()
|
||||
|
||||
@@ -105,7 +105,7 @@ void CImageHistogram::ComputeHistogram(BYTE* pImageData, UINT aWidth, UINT aHeig
|
||||
++m_count[3][a];
|
||||
|
||||
lumIndex = (r + b + g) / 3;
|
||||
lumIndex = CLAMP(lumIndex, 0, kNumColorLevels - 1);
|
||||
lumIndex = AZStd::clamp(lumIndex, 0, kNumColorLevels - 1);
|
||||
++m_lumCount[lumIndex];
|
||||
|
||||
if (m_maxCount[0] < m_count[0][r])
|
||||
|
||||
@@ -1491,7 +1491,7 @@ void QtViewport::OnRawInput([[maybe_unused]] UINT wParam, HRAWINPUT lParam)
|
||||
float as = 0.001f * gSettings.cameraMoveSpeed;
|
||||
Ang3 ypr = CCamera::CreateAnglesYPR(Matrix33(viewTM));
|
||||
ypr.x += -all6DOFs[5] * as * fScaleYPR;
|
||||
ypr.y = CLAMP(ypr.y + all6DOFs[3] * as * fScaleYPR, -1.5f, 1.5f); // to keep rotation in reasonable range
|
||||
ypr.y = AZStd::clamp(ypr.y + all6DOFs[3] * as * fScaleYPR, -1.5f, 1.5f); // to keep rotation in reasonable range
|
||||
ypr.z = 0; // to have camera always upward
|
||||
|
||||
viewTM = Matrix34(CCamera::CreateOrientationYPR(ypr), viewTM.GetTranslation());
|
||||
|
||||
@@ -19,9 +19,6 @@
|
||||
|
||||
#include <AtomLyIntegration/AtomViewportDisplayInfo/AtomViewportInfoDisplayBus.h>
|
||||
|
||||
// CryCommon
|
||||
#include <CryCommon/SFunctor.h>
|
||||
|
||||
// Editor
|
||||
#include "Settings.h"
|
||||
#include "ViewPane.h"
|
||||
@@ -800,8 +797,8 @@ void CViewportTitleDlg::OnSystemEvent(ESystemEvent event, UINT_PTR wparam, UINT_
|
||||
const int eventHeight = static_cast<int>(lparam);
|
||||
const QWidget* viewport = m_pViewPane->GetViewport();
|
||||
|
||||
// This should eventually be converted to an EBus to make it easy to connect to the correct viewport
|
||||
// sending the event. But for now, just detect that we've gotten width/height values that match our
|
||||
// This should eventually be converted to an EBus to make it easy to connect to the correct viewport
|
||||
// sending the event. But for now, just detect that we've gotten width/height values that match our
|
||||
// associated viewport
|
||||
if (viewport && (eventWidth == viewport->width()) && (eventHeight == viewport->height()))
|
||||
{
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
#include <AzCore/PlatformDef.h> // for AZ_COMMAND_LINE_LEN
|
||||
#include <AzCore/Debug/Trace.h>
|
||||
#include <AzCore/IO/SystemFile.h>
|
||||
#include <AzCore/Memory/Memory.h>
|
||||
#include <CryCommon/platform.h>
|
||||
#include <CryCommon/LegacyAllocator.h>
|
||||
|
||||
struct IOutputPrintSink;
|
||||
|
||||
@@ -34,7 +36,7 @@ namespace O3DELauncher
|
||||
|
||||
#define COMMAND_LINE_ARG_COUNT_LIMIT (AZ_COMMAND_LINE_LEN+1) / 2 // Assume that the limit to how many arguments we can maintain is the max buffer size divided by 2
|
||||
// to account for an argument and a spec in between each argument (with the worse case scenario being
|
||||
|
||||
|
||||
struct PlatformMainInfo
|
||||
{
|
||||
typedef bool (*ResourceLimitUpdater)();
|
||||
@@ -69,7 +71,7 @@ namespace O3DELauncher
|
||||
|
||||
void* m_window = nullptr; //!< maps to \ref SSystemInitParams::hWnd
|
||||
void* m_instance = nullptr; //!< maps to \ref SSystemInitParams::hInstance
|
||||
IOutputPrintSink* m_printSink = nullptr; //!< maps to \ref SSystemInitParams::pPrintSync
|
||||
IOutputPrintSink* m_printSink = nullptr; //!< maps to \ref SSystemInitParams::pPrintSync
|
||||
};
|
||||
|
||||
enum class ReturnCode : unsigned char
|
||||
|
||||
@@ -7,150 +7,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "TypeInfo_impl.h"
|
||||
#include "Cry_Geo.h"
|
||||
|
||||
STRUCT_INFO_T_BEGIN(Vec2_tpl, class, F)
|
||||
VAR_INFO(x)
|
||||
VAR_INFO(y)
|
||||
STRUCT_INFO_T_END(Vec2_tpl, class, F)
|
||||
|
||||
#include "Cry_Color.h"
|
||||
#include "Cry_Vector3.h"
|
||||
|
||||
STRUCT_INFO_T_BEGIN(Vec3_tpl, typename, F)
|
||||
VAR_INFO(x)
|
||||
VAR_INFO(y)
|
||||
VAR_INFO(z)
|
||||
STRUCT_INFO_T_END(Vec3_tpl, typename, F)
|
||||
|
||||
typedef TFixed<unsigned char, 1, 255, 0> TFixedUChar_1_255_0;
|
||||
STRUCT_INFO_T_INSTANTIATE(Vec3_tpl, TFixedUChar_1_255_0)
|
||||
|
||||
STRUCT_INFO_T_BEGIN(Vec4_tpl, typename, F)
|
||||
VAR_INFO(x)
|
||||
VAR_INFO(y)
|
||||
VAR_INFO(z)
|
||||
VAR_INFO(w)
|
||||
STRUCT_INFO_T_END(Vec4_tpl, typename, F)
|
||||
|
||||
STRUCT_INFO_T_INSTANTIATE(Vec4_tpl, short)
|
||||
|
||||
STRUCT_INFO_T_BEGIN(Ang3_tpl, typename, F)
|
||||
VAR_INFO(x)
|
||||
VAR_INFO(y)
|
||||
VAR_INFO(z)
|
||||
STRUCT_INFO_T_END(Ang3_tpl, typename, F)
|
||||
|
||||
STRUCT_INFO_T_BEGIN(Plane_tpl, typename, F)
|
||||
VAR_INFO(n)
|
||||
VAR_INFO(d)
|
||||
STRUCT_INFO_T_END(Plane_tpl, typename, F)
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
//#include "Cry_Quat_info.h"
|
||||
STRUCT_INFO_T_BEGIN(Quat_tpl, typename, F)
|
||||
VAR_INFO(v)
|
||||
VAR_INFO(w)
|
||||
STRUCT_INFO_T_END(Quat_tpl, typename, F)
|
||||
|
||||
STRUCT_INFO_T_INSTANTIATE(Quat_tpl, float)
|
||||
|
||||
STRUCT_INFO_T_BEGIN(QuatT_tpl, typename, F)
|
||||
VAR_INFO(q)
|
||||
VAR_INFO(t)
|
||||
STRUCT_INFO_T_END(QuatT_tpl, typename, F)
|
||||
|
||||
STRUCT_INFO_T_INSTANTIATE(QuatT_tpl, float)
|
||||
|
||||
STRUCT_INFO_T_BEGIN(QuatTS_tpl, typename, F)
|
||||
VAR_INFO(q)
|
||||
VAR_INFO(t)
|
||||
VAR_INFO(s)
|
||||
STRUCT_INFO_T_END(QuatTS_tpl, typename, F)
|
||||
|
||||
STRUCT_INFO_T_BEGIN(DualQuat_tpl, typename, F)
|
||||
VAR_INFO(nq)
|
||||
VAR_INFO(dq)
|
||||
STRUCT_INFO_T_END(DualQuat_tpl, typename, F)
|
||||
|
||||
|
||||
//------------------------------------------------------------
|
||||
//#include "Cry_Matrix_info.h"
|
||||
STRUCT_INFO_T_BEGIN(Matrix33_tpl, typename, F)
|
||||
VAR_INFO(m00)
|
||||
VAR_INFO(m01)
|
||||
VAR_INFO(m02)
|
||||
VAR_INFO(m10)
|
||||
VAR_INFO(m11)
|
||||
VAR_INFO(m12)
|
||||
VAR_INFO(m20)
|
||||
VAR_INFO(m21)
|
||||
VAR_INFO(m22)
|
||||
STRUCT_INFO_T_END(Matrix33_tpl, typename, F)
|
||||
|
||||
STRUCT_INFO_T_BEGIN(Matrix34_tpl, typename, F)
|
||||
VAR_INFO(m00)
|
||||
VAR_INFO(m01)
|
||||
VAR_INFO(m02)
|
||||
VAR_INFO(m03)
|
||||
VAR_INFO(m10)
|
||||
VAR_INFO(m11)
|
||||
VAR_INFO(m12)
|
||||
VAR_INFO(m13)
|
||||
VAR_INFO(m20)
|
||||
VAR_INFO(m21)
|
||||
VAR_INFO(m22)
|
||||
VAR_INFO(m23)
|
||||
STRUCT_INFO_T_END(Matrix34_tpl, typename, F)
|
||||
|
||||
STRUCT_INFO_T_INSTANTIATE(Matrix34_tpl, float)
|
||||
|
||||
STRUCT_INFO_T_BEGIN(Matrix44_tpl, typename, F)
|
||||
VAR_INFO(m00)
|
||||
VAR_INFO(m01)
|
||||
VAR_INFO(m02)
|
||||
VAR_INFO(m03)
|
||||
VAR_INFO(m10)
|
||||
VAR_INFO(m11)
|
||||
VAR_INFO(m12)
|
||||
VAR_INFO(m13)
|
||||
VAR_INFO(m20)
|
||||
VAR_INFO(m21)
|
||||
VAR_INFO(m22)
|
||||
VAR_INFO(m23)
|
||||
VAR_INFO(m30)
|
||||
VAR_INFO(m31)
|
||||
VAR_INFO(m32)
|
||||
VAR_INFO(m33)
|
||||
STRUCT_INFO_T_END(Matrix44_tpl, typename, F)
|
||||
|
||||
|
||||
//#include "Cry_Color_info.h"
|
||||
STRUCT_INFO_T_BEGIN(Color_tpl, class, T)
|
||||
VAR_INFO(r)
|
||||
VAR_INFO(g)
|
||||
VAR_INFO(b)
|
||||
VAR_INFO(a)
|
||||
STRUCT_INFO_T_END(Color_tpl, class, T)
|
||||
|
||||
STRUCT_INFO_T_INSTANTIATE(Color_tpl, unsigned char)
|
||||
|
||||
//#include "Cry_Geo_info.h"
|
||||
STRUCT_INFO_BEGIN(AABB)
|
||||
VAR_INFO(min)
|
||||
VAR_INFO(max)
|
||||
STRUCT_INFO_END(AABB)
|
||||
|
||||
STRUCT_INFO_BEGIN(RectF)
|
||||
VAR_INFO(x)
|
||||
VAR_INFO(y)
|
||||
VAR_INFO(w)
|
||||
VAR_INFO(h)
|
||||
STRUCT_INFO_END(RectF)
|
||||
|
||||
#include "TimeValue_info.h"
|
||||
#include "CryHalf_info.h"
|
||||
|
||||
// Manually instantiate templates as needed here.
|
||||
template struct Vec3_tpl<float>;
|
||||
template struct Vec4_tpl<float>;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// This contains compiled code that is used by other projects in the solution.
|
||||
// Because we don't want static DLL dependencies, the CryCommon project is not compiled into a library.
|
||||
// Instead, this .cpp file is included in every project which needs it.
|
||||
// But we also include it in the CryCommon project (disabled in the build),
|
||||
// so that CryCommon can have the same editable settings as other projects.
|
||||
|
||||
// Set this to 1 to get an output of some pre-defined compiler symbols.
|
||||
|
||||
#if 0
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma message("_WIN32")
|
||||
#endif
|
||||
#ifdef _WIN64
|
||||
#pragma message("_WIN64")
|
||||
#endif
|
||||
|
||||
#ifdef _M_IX86
|
||||
#pragma message("_M_IX86")
|
||||
#endif
|
||||
#ifdef _M_PPC
|
||||
#pragma message("_M_PPC")
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
#pragma message("_DEBUG")
|
||||
#endif
|
||||
|
||||
#ifdef _DLL
|
||||
#pragma message("_DLL")
|
||||
#endif
|
||||
#ifdef _USRDLL
|
||||
#pragma message("_USRDLL")
|
||||
#endif
|
||||
#ifdef _MT
|
||||
#pragma message("_MT")
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include <AzCore/PlatformIncl.h>
|
||||
|
||||
#include "TypeInfo_impl.h"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -141,7 +141,6 @@ struct CryHalf2
|
||||
|
||||
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const {}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct CryHalf4
|
||||
@@ -197,7 +196,6 @@ struct CryHalf4
|
||||
|
||||
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const {}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
#endif // #ifndef CRY_HALF_INL
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_CRYHALF_INFO_H
|
||||
#define CRYINCLUDE_CRYCOMMON_CRYHALF_INFO_H
|
||||
#pragma once
|
||||
|
||||
#include "CryHalf.inl"
|
||||
|
||||
STRUCT_INFO_BEGIN(CryHalf2)
|
||||
STRUCT_VAR_INFO(x, TYPE_INFO(CryHalf))
|
||||
STRUCT_VAR_INFO(y, TYPE_INFO(CryHalf))
|
||||
STRUCT_INFO_END(CryHalf2)
|
||||
|
||||
STRUCT_INFO_BEGIN(CryHalf4)
|
||||
STRUCT_VAR_INFO(x, TYPE_INFO(CryHalf))
|
||||
STRUCT_VAR_INFO(y, TYPE_INFO(CryHalf))
|
||||
STRUCT_VAR_INFO(z, TYPE_INFO(CryHalf))
|
||||
STRUCT_VAR_INFO(w, TYPE_INFO(CryHalf))
|
||||
STRUCT_INFO_END(CryHalf4)
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_CRYHALF_INFO_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,486 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "TypeInfo_impl.h"
|
||||
#include "CryHeaders.h"
|
||||
|
||||
STRUCT_INFO_BEGIN(CryVertex)
|
||||
STRUCT_VAR_INFO(p, TYPE_INFO(Vec3))
|
||||
STRUCT_VAR_INFO(n, TYPE_INFO(Vec3))
|
||||
STRUCT_INFO_END(CryVertex)
|
||||
|
||||
STRUCT_INFO_BEGIN(CryFace)
|
||||
STRUCT_VAR_INFO(v0, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(v1, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(v2, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(MatID, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(CryFace)
|
||||
|
||||
STRUCT_INFO_BEGIN(CryUV)
|
||||
STRUCT_VAR_INFO(u, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(v, TYPE_INFO(float))
|
||||
STRUCT_INFO_END(CryUV)
|
||||
|
||||
STRUCT_INFO_BEGIN(CrySkinVtx)
|
||||
STRUCT_VAR_INFO(bVolumetric, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(idx, TYPE_INFO_ARRAY(4, TYPE_INFO(int)))
|
||||
STRUCT_VAR_INFO(w, TYPE_INFO_ARRAY(4, TYPE_INFO(float)))
|
||||
STRUCT_VAR_INFO(M, TYPE_INFO(Matrix33))
|
||||
STRUCT_INFO_END(CrySkinVtx)
|
||||
|
||||
STRUCT_INFO_BEGIN(CryLink)
|
||||
STRUCT_VAR_INFO(BoneID, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(offset, TYPE_INFO(Vec3))
|
||||
STRUCT_VAR_INFO(Blending, TYPE_INFO(float))
|
||||
STRUCT_INFO_END(CryLink)
|
||||
|
||||
STRUCT_INFO_BEGIN(CryIRGB)
|
||||
STRUCT_VAR_INFO(r, TYPE_INFO(unsigned char))
|
||||
STRUCT_VAR_INFO(g, TYPE_INFO(unsigned char))
|
||||
STRUCT_VAR_INFO(b, TYPE_INFO(unsigned char))
|
||||
STRUCT_INFO_END(CryIRGB)
|
||||
|
||||
STRUCT_INFO_BEGIN(CryBonePhysics_Comp)
|
||||
STRUCT_VAR_INFO(nPhysGeom, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(flags, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(min, TYPE_ARRAY(3, TYPE_INFO(float)))
|
||||
STRUCT_VAR_INFO(max, TYPE_ARRAY(3, TYPE_INFO(float)))
|
||||
STRUCT_VAR_INFO(spring_angle, TYPE_ARRAY(3, TYPE_INFO(float)))
|
||||
STRUCT_VAR_INFO(spring_tension, TYPE_ARRAY(3, TYPE_INFO(float)))
|
||||
STRUCT_VAR_INFO(damping, TYPE_ARRAY(3, TYPE_INFO(float)))
|
||||
STRUCT_VAR_INFO(framemtx, TYPE_ARRAY(3, TYPE_ARRAY(3, TYPE_INFO(float))))
|
||||
STRUCT_INFO_END(CryBonePhysics_Comp)
|
||||
|
||||
STRUCT_INFO_BEGIN(CryBoneDescData_Comp)
|
||||
STRUCT_VAR_INFO(m_nControllerID, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(m_PhysInfo, TYPE_ARRAY(2, TYPE_INFO(BONE_PHYSICS_COMP)))
|
||||
STRUCT_VAR_INFO(m_fMass, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(m_DefaultW2B, TYPE_INFO(Matrix34))
|
||||
STRUCT_VAR_INFO(m_DefaultB2W, TYPE_INFO(Matrix34))
|
||||
STRUCT_VAR_INFO(m_arrBoneName, TYPE_ARRAY(256, TYPE_INFO(char)))
|
||||
STRUCT_VAR_INFO(m_nLimbId, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(m_nOffsetParent, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(m_numChildren, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(m_nOffsetChildren, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(CryBoneDescData_Comp)
|
||||
|
||||
STRUCT_INFO_BEGIN(BONE_ENTITY)
|
||||
STRUCT_VAR_INFO(BoneID, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(ParentID, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nChildren, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(ControllerID, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(prop, TYPE_ARRAY(32, TYPE_INFO(char)))
|
||||
STRUCT_VAR_INFO(phys, TYPE_INFO(BONE_PHYSICS_COMP))
|
||||
STRUCT_INFO_END(BONE_ENTITY)
|
||||
|
||||
ENUM_INFO_BEGIN(ChunkTypes)
|
||||
ENUM_ELEM_INFO(, ChunkType_ANY)
|
||||
ENUM_ELEM_INFO(, ChunkType_Mesh)
|
||||
ENUM_ELEM_INFO(, ChunkType_Helper)
|
||||
ENUM_ELEM_INFO(, ChunkType_VertAnim)
|
||||
ENUM_ELEM_INFO(, ChunkType_BoneAnim)
|
||||
ENUM_ELEM_INFO(, ChunkType_GeomNameList)
|
||||
ENUM_ELEM_INFO(, ChunkType_BoneNameList)
|
||||
ENUM_ELEM_INFO(, ChunkType_MtlList)
|
||||
ENUM_ELEM_INFO(, ChunkType_MRM)
|
||||
ENUM_ELEM_INFO(, ChunkType_SceneProps)
|
||||
ENUM_ELEM_INFO(, ChunkType_Light)
|
||||
ENUM_ELEM_INFO(, ChunkType_PatchMesh)
|
||||
ENUM_ELEM_INFO(, ChunkType_Node)
|
||||
ENUM_ELEM_INFO(, ChunkType_Mtl)
|
||||
ENUM_ELEM_INFO(, ChunkType_Controller)
|
||||
ENUM_ELEM_INFO(, ChunkType_Timing)
|
||||
ENUM_ELEM_INFO(, ChunkType_BoneMesh)
|
||||
ENUM_ELEM_INFO(, ChunkType_BoneLightBinding)
|
||||
ENUM_ELEM_INFO(, ChunkType_MeshMorphTarget)
|
||||
ENUM_ELEM_INFO(, ChunkType_BoneInitialPos)
|
||||
ENUM_ELEM_INFO(, ChunkType_SourceInfo)
|
||||
ENUM_ELEM_INFO(, ChunkType_MtlName)
|
||||
ENUM_ELEM_INFO(, ChunkType_ExportFlags)
|
||||
ENUM_ELEM_INFO(, ChunkType_DataStream)
|
||||
ENUM_ELEM_INFO(, ChunkType_MeshSubsets)
|
||||
ENUM_ELEM_INFO(, ChunkType_MeshPhysicsData)
|
||||
ENUM_ELEM_INFO(, ChunkType_CompiledBones)
|
||||
ENUM_ELEM_INFO(, ChunkType_CompiledPhysicalBones)
|
||||
ENUM_ELEM_INFO(, ChunkType_CompiledMorphTargets)
|
||||
ENUM_ELEM_INFO(, ChunkType_CompiledPhysicalProxies)
|
||||
ENUM_ELEM_INFO(, ChunkType_CompiledIntFaces)
|
||||
ENUM_ELEM_INFO(, ChunkType_CompiledIntSkinVertices)
|
||||
ENUM_ELEM_INFO(, ChunkType_CompiledExt2IntMap)
|
||||
ENUM_ELEM_INFO(, ChunkType_BreakablePhysics)
|
||||
ENUM_ELEM_INFO(, ChunkType_FaceMap)
|
||||
ENUM_ELEM_INFO(, ChunkType_MotionParameters)
|
||||
ENUM_ELEM_INFO(, ChunkType_FootPlantInfo)
|
||||
ENUM_ELEM_INFO(, ChunkType_BonesBoxes)
|
||||
ENUM_ELEM_INFO(, ChunkType_FoliageInfo)
|
||||
ENUM_INFO_END(ChunkTypes)
|
||||
|
||||
STRUCT_INFO_BEGIN(RANGE_ENTITY)
|
||||
STRUCT_VAR_INFO(name, TYPE_ARRAY(32, TYPE_INFO(char)))
|
||||
STRUCT_VAR_INFO(start, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(end, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(RANGE_ENTITY)
|
||||
|
||||
STRUCT_INFO_BEGIN(TIMING_CHUNK_DESC_0918)
|
||||
STRUCT_VAR_INFO(m_SecsPerTick, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(m_TicksPerFrame, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(global_range, TYPE_INFO(RANGE_ENTITY))
|
||||
STRUCT_VAR_INFO(qqqqnSubRanges, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(TIMING_CHUNK_DESC_0918)
|
||||
|
||||
|
||||
STRUCT_INFO_BEGIN(SPEED_CHUNK_DESC_2)
|
||||
STRUCT_VAR_INFO(Speed, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(Distance, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(Slope, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(AnimFlags, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(MoveDir, TYPE_ARRAY(3, TYPE_INFO(f32)))
|
||||
STRUCT_VAR_INFO(StartPosition, TYPE_INFO(QuatT))
|
||||
STRUCT_INFO_END(SPEED_CHUNK_DESC_2)
|
||||
|
||||
STRUCT_INFO_BEGIN(MTL_NAME_CHUNK_DESC_0800)
|
||||
STRUCT_VAR_INFO(nFlags, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nFlags2, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(name, TYPE_ARRAY(128, TYPE_INFO(char)))
|
||||
STRUCT_VAR_INFO(nPhysicalizeType, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nSubMaterials, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nSubMatChunkId, TYPE_ARRAY(MTL_NAME_CHUNK_DESC_0800_MAX_SUB_MATERIALS, TYPE_INFO(int)))
|
||||
STRUCT_VAR_INFO(nAdvancedDataChunkId, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(sh_opacity, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(reserve, TYPE_ARRAY(32, TYPE_INFO(int)))
|
||||
STRUCT_INFO_END(MTL_NAME_CHUNK_DESC_0800)
|
||||
|
||||
STRUCT_INFO_BEGIN(MTL_NAME_CHUNK_DESC_0802)
|
||||
STRUCT_VAR_INFO(name, TYPE_ARRAY(128, TYPE_INFO(char)))
|
||||
STRUCT_VAR_INFO(nSubMaterials, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(MTL_NAME_CHUNK_DESC_0802)
|
||||
|
||||
STRUCT_INFO_BEGIN(MESH_CHUNK_DESC_0745)
|
||||
STRUCT_VAR_INFO(flags1, TYPE_INFO(unsigned char))
|
||||
STRUCT_VAR_INFO(flags2, TYPE_INFO(unsigned char))
|
||||
STRUCT_VAR_INFO(nVerts, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nTVerts, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nFaces, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(VertAnimID, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(MESH_CHUNK_DESC_0745)
|
||||
|
||||
STRUCT_INFO_BEGIN(MESH_CHUNK_DESC_0801)
|
||||
STRUCT_VAR_INFO(nFlags, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nFlags2, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nVerts, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nIndices, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nSubsets, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nSubsetsChunkId, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nVertAnimID, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nStreamChunkID, TYPE_ARRAY(16, TYPE_INFO(int)))
|
||||
STRUCT_VAR_INFO(nPhysicsDataChunkId, TYPE_ARRAY(4, TYPE_INFO(int)))
|
||||
STRUCT_VAR_INFO(bboxMin, TYPE_INFO(Vec3))
|
||||
STRUCT_VAR_INFO(bboxMax, TYPE_INFO(Vec3))
|
||||
STRUCT_VAR_INFO(texMappingDensity, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(geometricMeanFaceArea, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(reserved, TYPE_ARRAY(30, TYPE_INFO(int)))
|
||||
STRUCT_INFO_END(MESH_CHUNK_DESC_0801)
|
||||
|
||||
STRUCT_INFO_BEGIN(MESH_CHUNK_DESC_0802)
|
||||
STRUCT_VAR_INFO(nFlags, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nFlags2, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nVerts, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nIndices, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nSubsets, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nSubsetsChunkId, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nVertAnimID, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nStreamChunkID, TYPE_ARRAY(16, TYPE_ARRAY(8, TYPE_INFO(int))))
|
||||
STRUCT_VAR_INFO(nPhysicsDataChunkId, TYPE_ARRAY(4, TYPE_INFO(int)))
|
||||
STRUCT_VAR_INFO(bboxMin, TYPE_INFO(Vec3))
|
||||
STRUCT_VAR_INFO(bboxMax, TYPE_INFO(Vec3))
|
||||
STRUCT_VAR_INFO(texMappingDensity, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(geometricMeanFaceArea, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(reserved, TYPE_ARRAY(30, TYPE_INFO(int)))
|
||||
STRUCT_INFO_END(MESH_CHUNK_DESC_0802)
|
||||
|
||||
STRUCT_INFO_BEGIN(STREAM_DATA_CHUNK_DESC_0800)
|
||||
STRUCT_VAR_INFO(nFlags, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nStreamType, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nCount, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nElementSize, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(reserved, TYPE_ARRAY(2, TYPE_INFO(int)))
|
||||
STRUCT_INFO_END(STREAM_DATA_CHUNK_DESC_0800)
|
||||
|
||||
STRUCT_INFO_BEGIN(STREAM_DATA_CHUNK_DESC_0801)
|
||||
STRUCT_VAR_INFO(nFlags, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nStreamType, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nStreamIndex, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nCount, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nElementSize, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(reserved, TYPE_ARRAY(2, TYPE_INFO(int)))
|
||||
STRUCT_INFO_END(STREAM_DATA_CHUNK_DESC_0801)
|
||||
|
||||
STRUCT_INFO_BEGIN(MESH_SUBSETS_CHUNK_DESC_0800::MeshSubset)
|
||||
STRUCT_VAR_INFO(nFirstIndexId, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nNumIndices, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nFirstVertId, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nNumVerts, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nMatID, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(fRadius, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(vCenter, TYPE_INFO(Vec3))
|
||||
STRUCT_INFO_END(MESH_SUBSETS_CHUNK_DESC_0800::MeshSubset)
|
||||
|
||||
STRUCT_INFO_BEGIN(MESH_SUBSETS_CHUNK_DESC_0800::MeshBoneIDs)
|
||||
STRUCT_VAR_INFO(numBoneIDs, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(arrBoneIDs, TYPE_ARRAY(128, TYPE_INFO(uint16)))
|
||||
STRUCT_INFO_END(MESH_SUBSETS_CHUNK_DESC_0800::MeshBoneIDs)
|
||||
|
||||
STRUCT_INFO_BEGIN(MESH_SUBSETS_CHUNK_DESC_0800::MeshSubsetTexelDensity)
|
||||
STRUCT_VAR_INFO(texelDensity, TYPE_INFO(float))
|
||||
STRUCT_INFO_END(MESH_SUBSETS_CHUNK_DESC_0800::MeshSubsetTexelDensity)
|
||||
|
||||
|
||||
STRUCT_INFO_BEGIN(MESH_SUBSETS_CHUNK_DESC_0800)
|
||||
STRUCT_VAR_INFO(nFlags, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nCount, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(reserved, TYPE_ARRAY(2, TYPE_INFO(int)))
|
||||
STRUCT_INFO_END(MESH_SUBSETS_CHUNK_DESC_0800)
|
||||
|
||||
STRUCT_INFO_BEGIN(MESH_PHYSICS_DATA_CHUNK_DESC_0800)
|
||||
STRUCT_VAR_INFO(nDataSize, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nFlags, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nTetrahedraDataSize, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nTetrahedraChunkId, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(reserved, TYPE_ARRAY(2, TYPE_INFO(int)))
|
||||
STRUCT_INFO_END(MESH_PHYSICS_DATA_CHUNK_DESC_0800)
|
||||
|
||||
STRUCT_INFO_BEGIN(BONEANIM_CHUNK_DESC_0290)
|
||||
STRUCT_VAR_INFO(nBones, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(BONEANIM_CHUNK_DESC_0290)
|
||||
|
||||
STRUCT_INFO_BEGIN(BONENAMELIST_CHUNK_DESC_0745)
|
||||
STRUCT_VAR_INFO(numEntities, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(BONENAMELIST_CHUNK_DESC_0745)
|
||||
|
||||
STRUCT_INFO_BEGIN(COMPILED_BONE_CHUNK_DESC_0800)
|
||||
STRUCT_VAR_INFO(reserved, TYPE_ARRAY(32, TYPE_INFO(char)))
|
||||
STRUCT_INFO_END(COMPILED_BONE_CHUNK_DESC_0800)
|
||||
|
||||
STRUCT_INFO_BEGIN(COMPILED_PHYSICALBONE_CHUNK_DESC_0800)
|
||||
STRUCT_VAR_INFO(reserved, TYPE_ARRAY(32, TYPE_INFO(char)))
|
||||
STRUCT_INFO_END(COMPILED_PHYSICALBONE_CHUNK_DESC_0800)
|
||||
|
||||
STRUCT_INFO_BEGIN(COMPILED_PHYSICALPROXY_CHUNK_DESC_0800)
|
||||
STRUCT_VAR_INFO(numPhysicalProxies, TYPE_INFO(uint32))
|
||||
STRUCT_INFO_END(COMPILED_PHYSICALPROXY_CHUNK_DESC_0800)
|
||||
|
||||
STRUCT_INFO_BEGIN(COMPILED_MORPHTARGETS_CHUNK_DESC_0800)
|
||||
STRUCT_VAR_INFO(numMorphTargets, TYPE_INFO(uint32))
|
||||
STRUCT_INFO_END(COMPILED_MORPHTARGETS_CHUNK_DESC_0800)
|
||||
|
||||
STRUCT_INFO_BEGIN(COMPILED_INTSKINVERTICES_CHUNK_DESC_0800)
|
||||
STRUCT_VAR_INFO(reserved, TYPE_ARRAY(32, TYPE_INFO(char)))
|
||||
STRUCT_INFO_END(COMPILED_INTSKINVERTICES_CHUNK_DESC_0800)
|
||||
|
||||
STRUCT_INFO_BEGIN(BaseKey)
|
||||
STRUCT_VAR_INFO(time, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(BaseKey)
|
||||
|
||||
STRUCT_INFO_BEGIN(BaseTCB)
|
||||
STRUCT_VAR_INFO(t, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(c, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(b, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(ein, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(eout, TYPE_INFO(float))
|
||||
STRUCT_INFO_END(BaseTCB)
|
||||
|
||||
STRUCT_INFO_BEGIN(BaseKey3)
|
||||
STRUCT_BASE_INFO(BaseKey)
|
||||
STRUCT_VAR_INFO(val, TYPE_INFO(Vec3))
|
||||
STRUCT_INFO_END(BaseKey3)
|
||||
|
||||
STRUCT_INFO_BEGIN(BaseKeyQ)
|
||||
STRUCT_BASE_INFO(BaseKey)
|
||||
STRUCT_VAR_INFO(val, TYPE_INFO(CryQuat))
|
||||
STRUCT_INFO_END(BaseKeyQ)
|
||||
|
||||
STRUCT_INFO_BEGIN(CryTCB3Key)
|
||||
STRUCT_BASE_INFO(BaseKey3)
|
||||
STRUCT_BASE_INFO(BaseTCB)
|
||||
STRUCT_INFO_END(CryTCB3Key)
|
||||
|
||||
STRUCT_INFO_BEGIN(CryTCBQKey)
|
||||
STRUCT_BASE_INFO(BaseKeyQ)
|
||||
STRUCT_BASE_INFO(BaseTCB)
|
||||
STRUCT_INFO_END(CryTCBQKey)
|
||||
|
||||
STRUCT_INFO_BEGIN(CryKeyPQLog)
|
||||
STRUCT_VAR_INFO(nTime, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(vPos, TYPE_INFO(Vec3))
|
||||
STRUCT_VAR_INFO(vRotLog, TYPE_INFO(Vec3))
|
||||
STRUCT_INFO_END(CryKeyPQLog)
|
||||
|
||||
ENUM_INFO_BEGIN(CtrlTypes)
|
||||
ENUM_ELEM_INFO(, CTRL_NONE)
|
||||
ENUM_ELEM_INFO(, CTRL_CRYBONE)
|
||||
ENUM_ELEM_INFO(, CTRL_LINEER1)
|
||||
ENUM_ELEM_INFO(, CTRL_LINEER3)
|
||||
ENUM_ELEM_INFO(, CTRL_LINEERQ)
|
||||
ENUM_ELEM_INFO(, CTRL_BEZIER1)
|
||||
ENUM_ELEM_INFO(, CTRL_BEZIER3)
|
||||
ENUM_ELEM_INFO(, CTRL_BEZIERQ)
|
||||
ENUM_ELEM_INFO(, CTRL_TCB1)
|
||||
ENUM_ELEM_INFO(, CTRL_TCB3)
|
||||
ENUM_ELEM_INFO(, CTRL_TCBQ)
|
||||
ENUM_ELEM_INFO(, CTRL_BSPLINE_2O)
|
||||
ENUM_ELEM_INFO(, CTRL_BSPLINE_1O)
|
||||
ENUM_ELEM_INFO(, CTRL_BSPLINE_2C)
|
||||
ENUM_ELEM_INFO(, CTRL_BSPLINE_1C)
|
||||
ENUM_ELEM_INFO(, CTRL_CONST)
|
||||
ENUM_INFO_END(CtrlTypes)
|
||||
|
||||
STRUCT_INFO_BEGIN(CONTROLLER_CHUNK_DESC_0826)
|
||||
STRUCT_VAR_INFO(type, TYPE_INFO(CtrlTypes))
|
||||
STRUCT_VAR_INFO(nKeys, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nFlags, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(nControllerId, TYPE_INFO(unsigned int))
|
||||
STRUCT_INFO_END(CONTROLLER_CHUNK_DESC_0826)
|
||||
|
||||
STRUCT_INFO_BEGIN(CONTROLLER_CHUNK_DESC_0827)
|
||||
STRUCT_VAR_INFO(numKeys, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(nControllerId, TYPE_INFO(unsigned int))
|
||||
STRUCT_INFO_END(CONTROLLER_CHUNK_DESC_0827)
|
||||
|
||||
STRUCT_INFO_BEGIN(CONTROLLER_CHUNK_DESC_0829)
|
||||
STRUCT_VAR_INFO(nControllerId, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(numRotationKeys, TYPE_INFO(uint16))
|
||||
STRUCT_VAR_INFO(numPositionKeys, TYPE_INFO(uint16))
|
||||
STRUCT_VAR_INFO(RotationFormat, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(RotationTimeFormat, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(PositionFormat, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(PositionKeysInfo, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(PositionTimeFormat, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(TracksAligned, TYPE_INFO(uint8))
|
||||
STRUCT_INFO_END(CONTROLLER_CHUNK_DESC_0829)
|
||||
|
||||
STRUCT_INFO_BEGIN(CONTROLLER_CHUNK_DESC_0830)
|
||||
STRUCT_VAR_INFO(numKeys, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(nFlags, Type_info(unsigned int))
|
||||
STRUCT_VAR_INFO(nControllerId, TYPE_INFO(unsigned int))
|
||||
STRUCT_INFO_END(CONTROLLER_CHUNK_DESC_0830)
|
||||
|
||||
STRUCT_INFO_BEGIN(CONTROLLER_CHUNK_DESC_0831)
|
||||
STRUCT_VAR_INFO(nControllerId, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(nFlags, Type_info(unsigned int))
|
||||
STRUCT_VAR_INFO(numRotationKeys, TYPE_INFO(uint16))
|
||||
STRUCT_VAR_INFO(numPositionKeys, TYPE_INFO(uint16))
|
||||
STRUCT_VAR_INFO(RotationFormat, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(RotationTimeFormat, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(PositionFormat, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(PositionKeysInfo, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(PositionTimeFormat, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(TracksAligned, TYPE_INFO(uint8))
|
||||
STRUCT_INFO_END(CONTROLLER_CHUNK_DESC_0831)
|
||||
|
||||
STRUCT_INFO_BEGIN(CONTROLLER_CHUNK_DESC_0905)
|
||||
STRUCT_VAR_INFO(numKeyPos, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(numKeyRot, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(numKeyTime, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(numAnims, TYPE_INFO(uint32))
|
||||
STRUCT_INFO_END(CONTROLLER_CHUNK_DESC_0905)
|
||||
|
||||
STRUCT_INFO_BEGIN(NODE_CHUNK_DESC_0824)
|
||||
STRUCT_VAR_INFO(name, TYPE_ARRAY(64, TYPE_INFO(char)))
|
||||
STRUCT_VAR_INFO(ObjectID, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(ParentID, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nChildren, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(MatID, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(_obsoleteA_, TYPE_ARRAY(4, TYPE_INFO(uint8)))
|
||||
STRUCT_VAR_INFO(tm, TYPE_ARRAY(4, TYPE_ARRAY(4, TYPE_INFO(float))))
|
||||
STRUCT_VAR_INFO(_obsoleteB_, TYPE_ARRAY(3, TYPE_INFO(float)))
|
||||
STRUCT_VAR_INFO(_obsoleteC_, TYPE_ARRAY(4, TYPE_INFO(float)))
|
||||
STRUCT_VAR_INFO(_obsoleteD_, TYPE_ARRAY(3, TYPE_INFO(float)))
|
||||
STRUCT_VAR_INFO(pos_cont_id, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(rot_cont_id, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(scl_cont_id, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(PropStrLen, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(NODE_CHUNK_DESC_0824)
|
||||
|
||||
ENUM_INFO_BEGIN(HelperTypes)
|
||||
ENUM_ELEM_INFO(, HP_POINT)
|
||||
ENUM_ELEM_INFO(, HP_DUMMY)
|
||||
ENUM_ELEM_INFO(, HP_XREF)
|
||||
ENUM_ELEM_INFO(, HP_CAMERA)
|
||||
ENUM_ELEM_INFO(, HP_GEOMETRY)
|
||||
ENUM_INFO_END(HelperTypes)
|
||||
|
||||
STRUCT_INFO_BEGIN(HELPER_CHUNK_DESC_0744)
|
||||
STRUCT_VAR_INFO(type, TYPE_INFO(HelperTypes))
|
||||
STRUCT_VAR_INFO(size, TYPE_INFO(Vec3))
|
||||
STRUCT_INFO_END(HELPER_CHUNK_DESC_0744)
|
||||
|
||||
STRUCT_INFO_BEGIN(MESHMORPHTARGET_CHUNK_DESC_0001)
|
||||
STRUCT_VAR_INFO(nChunkIdMesh, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(numMorphVertices, TYPE_INFO(unsigned int))
|
||||
STRUCT_INFO_END(MESHMORPHTARGET_CHUNK_DESC_0001)
|
||||
|
||||
STRUCT_INFO_BEGIN(SMeshMorphTargetVertex)
|
||||
STRUCT_VAR_INFO(nVertexId, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(ptVertex, TYPE_INFO(Vec3))
|
||||
STRUCT_INFO_END(SMeshMorphTargetVertex)
|
||||
|
||||
STRUCT_INFO_BEGIN(SMeshMorphTargetHeader)
|
||||
STRUCT_VAR_INFO(MeshID, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(NameLength, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(numIntVertices, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(numExtVertices, TYPE_INFO(uint32))
|
||||
STRUCT_INFO_END(SMeshMorphTargetHeader)
|
||||
|
||||
STRUCT_INFO_BEGIN(SMeshPhysicalProxyHeader)
|
||||
STRUCT_VAR_INFO(ChunkID, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(numPoints, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(numIndices, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(numMaterials, TYPE_INFO(uint32))
|
||||
STRUCT_INFO_END(SMeshPhysicalProxyHeader)
|
||||
|
||||
STRUCT_INFO_BEGIN(BONEINITIALPOS_CHUNK_DESC_0001)
|
||||
STRUCT_VAR_INFO(nChunkIdMesh, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(numBones, TYPE_INFO(unsigned int))
|
||||
STRUCT_INFO_END(BONEINITIALPOS_CHUNK_DESC_0001)
|
||||
|
||||
STRUCT_INFO_BEGIN(SBoneInitPosMatrix)
|
||||
STRUCT_VAR_INFO(mx, TYPE_ARRAY(4, TYPE_ARRAY(3, TYPE_INFO(float))))
|
||||
STRUCT_INFO_END(SBoneInitPosMatrix)
|
||||
|
||||
STRUCT_INFO_BEGIN(EXPORT_FLAGS_CHUNK_DESC)
|
||||
STRUCT_VAR_INFO(flags, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(rc_version, TYPE_ARRAY(4, TYPE_INFO(unsigned int)))
|
||||
STRUCT_VAR_INFO(rc_version_string, TYPE_ARRAY(16, TYPE_INFO(char)))
|
||||
STRUCT_VAR_INFO(assetAuthorTool, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(authorToolVersion, TYPE_INFO(uint32))
|
||||
STRUCT_VAR_INFO(reserved, TYPE_ARRAY(30, TYPE_INFO(unsigned int)))
|
||||
STRUCT_INFO_END(EXPORT_FLAGS_CHUNK_DESC)
|
||||
|
||||
STRUCT_INFO_BEGIN(BREAKABLE_PHYSICS_CHUNK_DESC)
|
||||
STRUCT_VAR_INFO(granularity, TYPE_INFO(unsigned int))
|
||||
STRUCT_VAR_INFO(nMode, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nRetVtx, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nRetTets, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nReserved, TYPE_ARRAY(10, TYPE_INFO(int)))
|
||||
STRUCT_INFO_END(BREAKABLE_PHYSICS_CHUNK_DESC)
|
||||
|
||||
STRUCT_INFO_BEGIN(FOLIAGE_INFO_CHUNK_DESC)
|
||||
STRUCT_VAR_INFO(nSpines, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nSpineVtx, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nSkinnedVtx, TYPE_INFO(int))
|
||||
STRUCT_VAR_INFO(nBoneIds, TYPE_INFO(int))
|
||||
STRUCT_INFO_END(FOLIAGE_INFO_CHUNK_DESC)
|
||||
|
||||
STRUCT_INFO_BEGIN(FOLIAGE_SPINE_SUB_CHUNK)
|
||||
STRUCT_VAR_INFO(nVtx, TYPE_INFO(char))
|
||||
STRUCT_VAR_INFO(len, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(navg, TYPE_INFO(Vec3))
|
||||
STRUCT_VAR_INFO(iAttachSpine, TYPE_INFO(unsigned char))
|
||||
STRUCT_VAR_INFO(iAttachSeg, TYPE_INFO(unsigned char))
|
||||
STRUCT_INFO_END(FOLIAGE_SPINE_SUB_CHUNK)
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#include "Cry_Math.h"
|
||||
#include <StlUtils.h>
|
||||
#include <Tarray.h>
|
||||
#include <CryPodArray.h>
|
||||
#include <Cry_Vector3.h>
|
||||
#include <Cry_Quat.h>
|
||||
@@ -36,7 +35,6 @@
|
||||
struct AABB;
|
||||
struct SVF_P3F;
|
||||
struct SVF_P3F_C4B_T2F;
|
||||
struct SVF_P3F_C4B_T2S;
|
||||
struct SVF_P3S_C4B_T2S;
|
||||
struct SPipTangents;
|
||||
|
||||
@@ -237,7 +235,6 @@ public:
|
||||
void AddObject(const AABB&) {}
|
||||
void AddObject(const SVF_P3F&) {}
|
||||
void AddObject(const SVF_P3F_C4B_T2F&) {}
|
||||
void AddObject(const SVF_P3F_C4B_T2S&) {}
|
||||
void AddObject(const SVF_P3S_C4B_T2S&) {}
|
||||
void AddObject(const SPipTangents&) {}
|
||||
void AddObject([[maybe_unused]] const AZ::Vector3& rObj) {}
|
||||
@@ -301,26 +298,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T, typename I, typename S>
|
||||
void AddObject(const DynArray<T, I, S>& rVector)
|
||||
{
|
||||
if (rVector.empty())
|
||||
{
|
||||
this->AddObject(rVector.begin(), rVector.get_alloc_size());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this->AddObject(rVector.begin(), rVector.get_alloc_size()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (typename DynArray<T, I, S>::const_iterator it = rVector.begin(); it != rVector.end(); ++it)
|
||||
{
|
||||
this->AddObject(*it);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void AddObject(const PodArray<T>& rVector)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,219 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Description : Declaration of CTypeInfo and related types.
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_CRYTYPEINFO_H
|
||||
#define CRYINCLUDE_CRYCOMMON_CRYTYPEINFO_H
|
||||
#pragma once
|
||||
|
||||
#include <platform.h>
|
||||
#include "CryArray.h"
|
||||
#include "Options.h"
|
||||
#include "TypeInfo_decl.h"
|
||||
|
||||
class ICrySizer;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Specify options for converting data to/from strings
|
||||
struct FToString
|
||||
{
|
||||
OPT_STRUCT(FToString)
|
||||
OPT_VAR(bool, SkipDefault) // Omit default values on writing.
|
||||
OPT_VAR(bool, NamedFields) // Add Name= text to sub-values.
|
||||
OPT_VAR(bool, Sub) // Write sub-structures (internal usage).
|
||||
};
|
||||
|
||||
struct FFromString
|
||||
{
|
||||
OPT_STRUCT(FFromString)
|
||||
OPT_VAR(bool, SkipEmpty) // Do not set values from empty strings (otherwise, set to zero).
|
||||
};
|
||||
|
||||
// Specify which limits a variable has
|
||||
enum ENumericLimit
|
||||
{
|
||||
eLimit_Min,
|
||||
eLimit_Max,
|
||||
eLimit_SoftMin,
|
||||
eLimit_SoftMax,
|
||||
eLimit_MinIsInfinite,
|
||||
eLimit_Step,
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Type info base class, and default implementation
|
||||
|
||||
struct CTypeInfo
|
||||
{
|
||||
cstr Name;
|
||||
size_t Size;
|
||||
size_t Alignment;
|
||||
|
||||
CTypeInfo(cstr name, size_t size, size_t align)
|
||||
: Name(name)
|
||||
, Size(size)
|
||||
, Alignment(align) {}
|
||||
|
||||
virtual ~CTypeInfo()
|
||||
{}
|
||||
|
||||
//
|
||||
// Inheritance.
|
||||
//
|
||||
virtual bool IsType(CTypeInfo const& Info) const
|
||||
{ return this == &Info; }
|
||||
|
||||
template<class T>
|
||||
bool IsType() const
|
||||
{ return IsType(TypeInfo((T*)0)); }
|
||||
|
||||
//
|
||||
// Data access interface.
|
||||
//
|
||||
|
||||
// Convert value to string.
|
||||
virtual AZStd::string ToString([[maybe_unused]] const void* data, [[maybe_unused]] FToString flags = 0, [[maybe_unused]] const void* def_data = 0) const
|
||||
{ return ""; }
|
||||
|
||||
// Write value from string, return success.
|
||||
virtual bool FromString([[maybe_unused]] void* data, [[maybe_unused]] cstr str, [[maybe_unused]] FFromString flags = 0) const
|
||||
{ return false; }
|
||||
|
||||
// Read and write values of a specified type.
|
||||
virtual bool ToValue([[maybe_unused]] const void* data, [[maybe_unused]] void* value, [[maybe_unused]] const CTypeInfo& typeVal) const
|
||||
{ return false; }
|
||||
|
||||
virtual bool FromValue([[maybe_unused]] void* data, [[maybe_unused]] const void* value, [[maybe_unused]] const CTypeInfo& typeVal) const
|
||||
{ return false; }
|
||||
|
||||
// Templated interface to above functions.
|
||||
template<class T>
|
||||
bool ToValue(const void* data, T& value) const
|
||||
{ return ToValue(data, &value, TypeInfo(&value)); }
|
||||
template<class T>
|
||||
bool FromValue(void* data, const T& value) const
|
||||
{ return FromValue(data, &value, TypeInfo(&value)); }
|
||||
|
||||
virtual bool ValueEqual(const void* data, const void* def_data = 0) const
|
||||
{ return ToString(data, FToString().SkipDefault(1), def_data).empty(); }
|
||||
|
||||
virtual bool GetLimit([[maybe_unused]] ENumericLimit eLimit, [[maybe_unused]] float& fVal) const
|
||||
{ return false; }
|
||||
|
||||
// Convert numeric formats from big-to-little endian or vice versa.
|
||||
// Swaps bitfield order as well (which may be separate from integer bit order).
|
||||
virtual void SwapEndian(void* pData, size_t nCount, bool bWriting) const;
|
||||
|
||||
// Track memory used by any internal structures (not counting object size itself).
|
||||
// Add to CrySizer as needed, return remaining mem count.
|
||||
virtual void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer, [[maybe_unused]] const void* data) const
|
||||
{}
|
||||
|
||||
//
|
||||
// Structure interface.
|
||||
//
|
||||
struct CVarInfo
|
||||
{
|
||||
const CTypeInfo& Type; // Info for type of variable.
|
||||
cstr Name; // Display name of variable.
|
||||
cstr Attrs; // Var-specific attribute string, of form:
|
||||
// "<name=value>" for each attr, concatenated.
|
||||
// Remaining text considered as comment.
|
||||
uint32 Offset; // Offset in bytes from struct start.
|
||||
uint32 ArrayDim : 22, // Number of array elements, or bits if bitfield.
|
||||
bBaseClass : 1, // Sub-var is actually a base class.
|
||||
bBitfield : 1, // Var is a bitfield, ArrayDim is number of bits.
|
||||
BitOffset : 6, // Additional offset in bits for bitfields.
|
||||
// Bit offset is computed in declaration order; on some platforms, it goes high to low.
|
||||
BitWordWidth : 2; // Width of bitfield = 1 byte << BitWordWidth
|
||||
|
||||
|
||||
// Accessors.
|
||||
cstr GetName() const { return Name; }
|
||||
size_t GetDim() const { return bBitfield ? 1 : ArrayDim; }
|
||||
size_t GetSize() const { return bBitfield ? (size_t)1 << BitWordWidth : Type.Size* ArrayDim; }
|
||||
size_t GetElemSize() const { return bBitfield ? (size_t)1 << BitWordWidth : Type.Size; }
|
||||
size_t GetBits() const { return bBitfield ? ArrayDim : ArrayDim* Type.Size* 8; }
|
||||
bool IsBaseClass() const { return bBaseClass; }
|
||||
bool IsInline() const
|
||||
{
|
||||
if (bBaseClass && Offset == 0)
|
||||
{
|
||||
const CVarInfo* pFirst = Type.NextSubVar(0);
|
||||
if (pFirst)
|
||||
{
|
||||
return pFirst->IsBaseClass();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GetLimit(ENumericLimit eLimit, float& fVal) const
|
||||
{
|
||||
return Type.GetLimit(eLimit, fVal);
|
||||
}
|
||||
|
||||
// Useful functions.
|
||||
void* GetAddress(void* base) const
|
||||
{
|
||||
return (char*)base + Offset;
|
||||
}
|
||||
const void* GetAddress(const void* base) const
|
||||
{
|
||||
return (const char*)base + Offset;
|
||||
}
|
||||
bool FromString(void* base, cstr str, FFromString flags = 0) const
|
||||
{
|
||||
assert(!bBitfield);
|
||||
return Type.FromString((char*)base + Offset, str, flags);
|
||||
}
|
||||
AZStd::string ToString(const void* base, FToString flags = 0, const void* def_base = 0) const
|
||||
{
|
||||
assert(!bBitfield);
|
||||
return Type.ToString((const char*)base + Offset, flags, def_base ? (const char*)def_base + Offset : 0);
|
||||
}
|
||||
|
||||
// Attribute access. Not fast.
|
||||
bool GetAttr(cstr name) const;
|
||||
bool GetAttr(cstr name, float& val) const;
|
||||
bool GetAttr(cstr name, AZStd::string& val) const;
|
||||
|
||||
// Comment, excluding attributes.
|
||||
cstr GetComment() const;
|
||||
};
|
||||
|
||||
// Structure var iteration.
|
||||
virtual CVarInfo const* NextSubVar([[maybe_unused]] CVarInfo const* pPrev, [[maybe_unused]] bool bRecurseBase = false) const
|
||||
{ return 0; }
|
||||
inline bool HasSubVars() const
|
||||
{ return NextSubVar(0) != 0; }
|
||||
#define AllSubVars(pVar, Info) \
|
||||
(const CTypeInfo::CVarInfo* pVar = (Info).NextSubVar(0); pVar; pVar = (Info).NextSubVar(pVar))
|
||||
|
||||
// Named var search.
|
||||
virtual const CVarInfo* FindSubVar([[maybe_unused]] cstr name) const
|
||||
{ return 0; }
|
||||
|
||||
virtual CTypeInfo const* const* NextTemplateType([[maybe_unused]] CTypeInfo const* const* pPrev) const
|
||||
{ return 0; }
|
||||
inline bool IsTemplate() const
|
||||
{ return NextTemplateType(0) != 0; }
|
||||
|
||||
//
|
||||
// String enumeration interface.
|
||||
// Return sequential strings in enumeration, then 0 when out of range.
|
||||
// String/int conversion is handled by ToString/FromString.
|
||||
//
|
||||
virtual cstr EnumElem([[maybe_unused]] uint nIndex) const { return 0; }
|
||||
};
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_CRYTYPEINFO_H
|
||||
@@ -17,7 +17,6 @@
|
||||
//DOC-IGNORE-BEGIN
|
||||
#include <Cry_Math.h>
|
||||
#include <Cry_Geo.h>
|
||||
#include <MemoryAccess.h>
|
||||
//DOC-IGNORE-END
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -546,7 +545,7 @@ public:
|
||||
ILINE void SetMatrixNoUpdate(const Matrix34& mat) { assert(mat.IsOrthonormal()); m_Matrix = mat; };
|
||||
ILINE const Matrix34& GetMatrix() const { return m_Matrix; };
|
||||
ILINE Vec3 GetViewdir() const { return m_Matrix.GetColumn1(); };
|
||||
|
||||
|
||||
ILINE void SetEntityRotation(const Quat& entityRot) { m_entityRot = entityRot; }
|
||||
ILINE Quat GetEntityRotation() { return m_entityRot; }
|
||||
ILINE void SetEntityPos(const Vec3& entityPos) { m_entityPos = entityPos; }
|
||||
@@ -626,11 +625,6 @@ public:
|
||||
uint8 IsAABBVisible_EH(const ::AABB& aabb, bool* pAllInside) const;
|
||||
uint8 IsAABBVisible_EH(const ::AABB& aabb) const;
|
||||
|
||||
// Multi-camera
|
||||
bool IsAABBVisible_EHM(const ::AABB& aabb, bool* pAllInside) const;
|
||||
bool IsAABBVisible_EM(const ::AABB& aabb) const;
|
||||
bool IsAABBVisible_FM(const ::AABB& aabb) const;
|
||||
|
||||
//OBB-frustum test
|
||||
bool IsOBBVisible_F(const Vec3& wpos, const OBB& obb) const;
|
||||
uint8 IsOBBVisible_FH(const Vec3& wpos, const OBB& obb) const;
|
||||
@@ -648,7 +642,6 @@ public:
|
||||
SetFrustum(640, 480);
|
||||
m_zrangeMin = 0.0f;
|
||||
m_zrangeMax = 1.0f;
|
||||
m_pMultiCamera = NULL;
|
||||
m_pPortal = NULL;
|
||||
m_JustActivated = 0;
|
||||
m_nPosX = m_nPosY = m_nSizeX = m_nSizeY = 0;
|
||||
@@ -704,8 +697,8 @@ private:
|
||||
Vec3 m_edge_flt; // this is the left/upper vertex of the far-clip-plane
|
||||
|
||||
f32 m_asymLeft, m_asymRight, m_asymBottom, m_asymTop; // Shift to create asymmetric frustum (only used for GPU culling of tessellated objects)
|
||||
f32 m_asymLeftProj, m_asymRightProj, m_asymBottomProj, m_asymTopProj;
|
||||
f32 m_asymLeftFar, m_asymRightFar, m_asymBottomFar, m_asymTopFar;
|
||||
f32 m_asymLeftProj, m_asymRightProj, m_asymBottomProj, m_asymTopProj;
|
||||
f32 m_asymLeftFar, m_asymRightFar, m_asymBottomFar, m_asymTopFar;
|
||||
|
||||
//usually we update these values every frame (they depend on m_Matrix)
|
||||
Vec3 m_cltp, m_crtp, m_clbp, m_crbp; //this are the 4 vertices of the projection-plane in cam-space
|
||||
@@ -774,7 +767,6 @@ public:
|
||||
uint16 x1, y1, x2, y2;
|
||||
};
|
||||
ScissorInfo m_ScissorInfo;
|
||||
class PodArray<CCamera>* m_pMultiCamera; // maybe used for culling instead of this camera
|
||||
|
||||
Vec3 m_OccPosition; //Position for calculate occlusions (needed for portals rendering)
|
||||
inline const Vec3& GetOccPos() const { return(m_OccPosition); }
|
||||
@@ -930,7 +922,7 @@ inline void CCamera::SetFrustum(int nWidth, int nHeight, f32 FOV, f32 nearplane,
|
||||
|
||||
//Apply asym shift to the camera frustum - Necessary for properly culling tessellated objects in VR
|
||||
//These are applied in UpdateFrustum to the camera space frustum planes
|
||||
//Can't apply asym shift to frustum edges here. That would only apply to the top left corner
|
||||
//Can't apply asym shift to frustum edges here. That would only apply to the top left corner
|
||||
//rather than the whole frustum. It would also interfere with shadow map application
|
||||
|
||||
//m_asym is at the near plane, we want it at the projection plane too
|
||||
@@ -1576,102 +1568,6 @@ inline uint8 CCamera::IsAABBVisible_EH(const AABB& aabb) const
|
||||
return AdditionalCheck(aabb); //result is either "exclusion" or "overlap"
|
||||
}
|
||||
|
||||
// Description:
|
||||
// Makes culling taking into account presence of m_pMultiCamera
|
||||
// If m_pMultiCamera exists - object is visible if at least one of cameras see's it
|
||||
//
|
||||
// return values:
|
||||
// true - box visible
|
||||
// true - not visible
|
||||
inline bool CCamera::IsAABBVisible_EHM(const AABB& aabb, bool* pAllInside) const
|
||||
{
|
||||
assert(pAllInside && *pAllInside == false);
|
||||
|
||||
if (!m_pMultiCamera) // use main camera
|
||||
{
|
||||
return IsAABBVisible_EH(aabb, pAllInside) != CULL_EXCLUSION;
|
||||
}
|
||||
|
||||
bool bVisible = false;
|
||||
|
||||
for (int i = 0; i < m_pMultiCamera->Count(); i++)
|
||||
{
|
||||
bool bAllIn = false;
|
||||
|
||||
if (m_pMultiCamera->GetAt(i).IsAABBVisible_EH(aabb, &bAllIn))
|
||||
{
|
||||
bVisible = true;
|
||||
|
||||
// don't break here always because another camera may include bbox completely
|
||||
if (bAllIn)
|
||||
{
|
||||
*pAllInside = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bVisible;
|
||||
}
|
||||
|
||||
// Description:
|
||||
// Makes culling taking into account presence of m_pMultiCamera
|
||||
// If m_pMultiCamera exists - object is visible if at least one of cameras see's it
|
||||
//
|
||||
// return values:
|
||||
// true - box visible
|
||||
// true - not visible
|
||||
ILINE bool CCamera::IsAABBVisible_EM(const AABB& aabb) const
|
||||
{
|
||||
if (!m_pMultiCamera) // use main camera
|
||||
{
|
||||
return IsAABBVisible_E(aabb) != CULL_EXCLUSION;
|
||||
}
|
||||
|
||||
// check several parallel cameras - object is visible if at least one camera see's it
|
||||
|
||||
for (int i = 0; i < m_pMultiCamera->Count(); i++)
|
||||
{
|
||||
if (m_pMultiCamera->GetAt(i).IsAABBVisible_E(aabb))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Description:
|
||||
// Makes culling taking into account presence of m_pMultiCamera
|
||||
// If m_pMultiCamera exists - object is visible if at least one of cameras see's it
|
||||
//
|
||||
// return values:
|
||||
// true - box visible
|
||||
// true - not visible
|
||||
ILINE bool CCamera::IsAABBVisible_FM(const AABB& aabb) const
|
||||
{
|
||||
PrefetchLine(&aabb, sizeof(AABB));
|
||||
|
||||
if (!m_pMultiCamera) // use main camera
|
||||
{
|
||||
return IsAABBVisible_F(aabb) != CULL_EXCLUSION;
|
||||
}
|
||||
|
||||
// check several parallel cameras - object is visible if at least one camera see's it
|
||||
|
||||
for (int i = 0; i < m_pMultiCamera->Count(); i++)
|
||||
{
|
||||
if (m_pMultiCamera->GetAt(i).IsAABBVisible_F(aabb))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Description
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
#define CRYINCLUDE_CRYCOMMON_CRY_COLOR_H
|
||||
#pragma once
|
||||
|
||||
#include <CryHeaders.h>
|
||||
#include <platform.h>
|
||||
#include <AzCore/std/containers/array.h>
|
||||
#include "Cry_Math.h"
|
||||
|
||||
ILINE float FClamp(float X, float Min, float Max)
|
||||
{
|
||||
@@ -362,8 +362,6 @@ struct Color_tpl
|
||||
AZStd::array<T, 4> primitiveArray = { { r, g, b, a } };
|
||||
return primitiveArray;
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ enum EGeomForm
|
||||
|
||||
MaxGeomForm
|
||||
};
|
||||
AUTO_TYPE_INFO(EGeomForm)
|
||||
|
||||
enum EGeomType
|
||||
{
|
||||
@@ -63,7 +62,6 @@ enum EGeomType
|
||||
GeomType_Physics,
|
||||
GeomType_Render,
|
||||
};
|
||||
AUTO_TYPE_INFO(EGeomType)
|
||||
|
||||
struct PosNorm
|
||||
{
|
||||
@@ -104,7 +102,6 @@ struct RectF
|
||||
, h(1)
|
||||
{
|
||||
}
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct RectI
|
||||
@@ -705,8 +702,6 @@ struct AABB
|
||||
result.Add(c.mTip);
|
||||
return result;
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
ILINE bool IsEquivalent(const AABB& a, const AABB& b, float epsilon = VEC_EPSILON)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@
|
||||
#include "Cry_ValidNumber.h"
|
||||
#include <CryEndian.h> // eLittleEndian
|
||||
#include <CryHalf.inl>
|
||||
#include <MetaUtils.h>
|
||||
//#include <MetaUtils.h>
|
||||
#include <float.h>
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Forward declarations //
|
||||
|
||||
@@ -1194,8 +1194,6 @@ struct Matrix33_tpl
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1213,8 +1213,6 @@ struct Matrix34_tpl
|
||||
m.m23 = pdotn * n.z;
|
||||
return m;
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -655,8 +655,6 @@ struct Matrix44_tpl
|
||||
(fabs_tpl(m0.m30 - m1.m30) <= e) && (fabs_tpl(m0.m31 - m1.m31) <= e) && (fabs_tpl(m0.m32 - m1.m32) <= e) && (fabs_tpl(m0.m33 - m1.m33) <= e)
|
||||
);
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -888,9 +888,6 @@ struct Quat_tpl
|
||||
{
|
||||
return CreateNlerp(IDENTITY, *this, scale);
|
||||
}
|
||||
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
|
||||
@@ -1409,8 +1406,6 @@ struct QuatT_tpl
|
||||
{
|
||||
return QuatT_tpl<F>(t * scale, q.GetScaled(scale));
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
typedef QuatT_tpl<f32> QuatT; //always 32 bit
|
||||
@@ -1690,8 +1685,6 @@ struct QuatTS_tpl
|
||||
ILINE Vec3_tpl<F> GetRow0() const { return q.GetRow0(); }
|
||||
ILINE Vec3_tpl<F> GetRow1() const { return q.GetRow1(); }
|
||||
ILINE Vec3_tpl<F> GetRow2() const { return q.GetRow2(); }
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
typedef QuatTS_tpl<f32> QuatTS; //always 64 bit
|
||||
@@ -1947,8 +1940,6 @@ struct QuatTNS_tpl
|
||||
ILINE Vec3_tpl<F> GetRow0() const { return q.GetRow0(); }
|
||||
ILINE Vec3_tpl<F> GetRow1() const { return q.GetRow1(); }
|
||||
ILINE Vec3_tpl<F> GetRow2() const { return q.GetRow2(); }
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
typedef QuatTNS_tpl<f32> QuatTNS;
|
||||
@@ -2097,8 +2088,6 @@ struct DualQuat_tpl
|
||||
nq *= norm;
|
||||
dq *= norm;
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
#ifndef MAX_API_NUM
|
||||
|
||||
@@ -295,8 +295,6 @@ struct Vec2_tpl
|
||||
{
|
||||
return sqrt_tpl((x - vec1.x) * (x - vec1.x) + (y - vec1.y) * (y - vec1.y));
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -845,8 +845,6 @@ struct Vec3_tpl
|
||||
{
|
||||
return Vec3_tpl<F1>(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x);
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
// dot product (2 versions)
|
||||
@@ -1175,8 +1173,6 @@ struct Ang3_tpl
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
typedef Ang3_tpl<f32> Ang3;
|
||||
@@ -1406,8 +1402,6 @@ struct Plane_tpl
|
||||
Vec3_tpl<F> MirrorPosition(const Vec3_tpl<F>& i) { return i - n * (2 * ((n | i) + d)); }
|
||||
|
||||
ILINE bool IsValid() const { return !n.IsZeroFast(); } //A plane with a zero normal isn't valid.
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
typedef Plane_tpl<f32> Plane; //always 32 bit
|
||||
|
||||
@@ -227,8 +227,6 @@ struct Vec4_tpl
|
||||
|
||||
ILINE void SetLerp(const Vec4_tpl<F>& p, const Vec4_tpl<F>& q, F t) { *this = p * (1.0f - t) + q * t; }
|
||||
ILINE static Vec4_tpl<F> CreateLerp(const Vec4_tpl<F>& p, const Vec4_tpl<F>& q, F t) { return p * (1.0f - t) + q * t; }
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <ISystem.h>
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
#include <AzCore/Math/Transform.h>
|
||||
#include <IStereoRenderer.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
#include <AzCore/Math/Quaternion.h>
|
||||
#include <AzCore/RTTI/ReflectContext.h>
|
||||
@@ -36,7 +35,7 @@ namespace AZ
|
||||
* Event triggered when an HMD initializes successfully
|
||||
*/
|
||||
virtual void OnHMDInitialized() {}
|
||||
|
||||
|
||||
/**
|
||||
* Event triggered when an HMD shuts down
|
||||
*/
|
||||
@@ -56,7 +55,7 @@ namespace AZ
|
||||
virtual ~HMDInitBus() {}
|
||||
|
||||
///
|
||||
/// Attempt to initialize this device. If initialization is initially successful (device exists and is able to startup) then this device should connect to the
|
||||
/// Attempt to initialize this device. If initialization is initially successful (device exists and is able to startup) then this device should connect to the
|
||||
/// HMDDeviceRequestBus in order to be used as an HMD from the main Open 3D Engine system.
|
||||
///
|
||||
/// @return If true, initialization fully succeeded.
|
||||
@@ -120,21 +119,10 @@ namespace AZ
|
||||
};
|
||||
|
||||
///
|
||||
/// Get per-eye camera info from the device. The specific info to get is defined in the EyeCameraInfo struct. This function can be used to setup
|
||||
/// rendering cameras per-eye. Note that each eye may have different projection matrix information.
|
||||
///
|
||||
/// @param eye The specific eye to get camera data for.
|
||||
/// @param nearPlane Near distance for the main render camera.
|
||||
/// @param farPlane Far distance for the main render camera.
|
||||
/// @param cameraInfo Returned camera information for this particular eye.
|
||||
///
|
||||
virtual void GetPerEyeCameraInfo([[maybe_unused]] const EStereoEye eye, [[maybe_unused]] const float nearPlane, [[maybe_unused]] const float farPlane, [[maybe_unused]] PerEyeCameraInfo& cameraInfo) {}
|
||||
|
||||
///
|
||||
/// Update the HMD's internal state and handle events
|
||||
/// This is NOT where tracking is updated. This is for game-time
|
||||
/// events such as controllers connecting/disconnecting or
|
||||
/// certain compositor events being triggered.
|
||||
/// certain compositor events being triggered.
|
||||
///
|
||||
virtual void UpdateInternalState() {}
|
||||
|
||||
@@ -164,9 +152,9 @@ namespace AZ
|
||||
///
|
||||
/// Retrieve the latest tracking state that was cached since the last call
|
||||
/// to UpdateTrackingStates.
|
||||
///
|
||||
/// TODO: Differentiate between tracking states viable for rendering and
|
||||
/// tracking states viable for game simulation.
|
||||
///
|
||||
/// TODO: Differentiate between tracking states viable for rendering and
|
||||
/// tracking states viable for game simulation.
|
||||
///
|
||||
virtual TrackingState* GetTrackingState() { return nullptr; }
|
||||
|
||||
@@ -196,7 +184,7 @@ namespace AZ
|
||||
|
||||
///
|
||||
/// Set the current tracking level of the HMD. Supported tracking levels are defined in struct TrackingLevel.
|
||||
///
|
||||
///
|
||||
/// @param level The tracking level we want to use with this HMD
|
||||
///
|
||||
virtual void SetTrackingLevel([[maybe_unused]] const AZ::VR::HMDTrackingLevel level) {}
|
||||
@@ -209,7 +197,7 @@ namespace AZ
|
||||
///
|
||||
/// Enable/disable debugging for this device. The device can decide what the most appropriate debugging information is
|
||||
/// displayed to the user (e.g. HMD position, performance info, latency timing, etc.).
|
||||
///
|
||||
///
|
||||
/// @param enable Set to true to enable debugging
|
||||
///
|
||||
virtual void EnableDebugging([[maybe_unused]] bool enable) {}
|
||||
@@ -230,16 +218,16 @@ namespace AZ
|
||||
virtual HMDDeviceInfo* GetDeviceInfo() { return nullptr; }
|
||||
|
||||
///
|
||||
/// Get whether or not the HMD has been initialized. The HMD has been initialized when it has fully established an interface
|
||||
/// with its necessary SDK and is ready to be used.
|
||||
///
|
||||
/// Get whether or not the HMD has been initialized. The HMD has been initialized when it has fully established an interface
|
||||
/// with its necessary SDK and is ready to be used.
|
||||
///
|
||||
/// @return True if the device has been initialized and is usable
|
||||
///
|
||||
virtual bool IsInitialized() { return false; }
|
||||
|
||||
///
|
||||
/// Get the play space of the device, if exists
|
||||
///
|
||||
///
|
||||
/// @return True if the device has been initialized and is usable
|
||||
///
|
||||
virtual const Playspace* GetPlayspace() { return nullptr; }
|
||||
@@ -251,21 +239,13 @@ namespace AZ
|
||||
///
|
||||
virtual void UpdateTrackingStates() {}
|
||||
|
||||
///
|
||||
/// Retrieves the current index into the VR system's swapchain that should be used.
|
||||
/// This only really need to be overridden by VR implementations that keep track
|
||||
/// of an internal swapchain like Oculus. OpenVR will handle swapchains
|
||||
/// internally and can just return 0.
|
||||
///
|
||||
virtual AZ::u32 GetSwapchainIndex([[maybe_unused]] const EStereoEye& eye) { return 0; }
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
using HMDDeviceRequestBus = AZ::EBus<HMDDeviceBus>;
|
||||
|
||||
///
|
||||
/// Bus to define HMD debugging. This includes visualization of any HMD-specific objects as well as any
|
||||
/// Bus to define HMD debugging. This includes visualization of any HMD-specific objects as well as any
|
||||
/// VR performance metrics displayed in the HMD.
|
||||
///
|
||||
class HMDDebuggerBus
|
||||
|
||||
@@ -6,12 +6,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_ICONSOLE_H
|
||||
#define CRYINCLUDE_CRYCOMMON_ICONSOLE_H
|
||||
#pragma once
|
||||
|
||||
#include <CryCommon/platform.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <AzCore/std/string/string_view.h>
|
||||
|
||||
struct SFunctor;
|
||||
|
||||
@@ -454,24 +453,6 @@ struct IConsole
|
||||
virtual void DumpKeyBinds(IKeyBindDumpSink* pCallback) = 0;
|
||||
virtual const char* FindKeyBind(const char* sCmd) const = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Hashing of cvars (for anti-cheat). Separates setting of range, calculation,
|
||||
// and retrieval of result so calculation can be done at a known safe point
|
||||
// (e.g end of frame) when we know cvars won't be modified or in temporary state
|
||||
|
||||
// Get Number of cvars that can be hashed
|
||||
virtual int GetNumCheatVars() = 0;
|
||||
// Set the range of cvars
|
||||
virtual void SetCheatVarHashRange(size_t firstVar, size_t lastVar) = 0;
|
||||
// Calculate the hash from current cvars
|
||||
virtual void CalcCheatVarHash() = 0;
|
||||
// Since hash is calculated async, check if it's completed
|
||||
virtual bool IsHashCalculated() = 0;
|
||||
// Get the hash calculated
|
||||
virtual uint64 GetCheatVarHash() = 0;
|
||||
virtual void PrintCheatVars(bool bUseLastHashRange) = 0;
|
||||
virtual char* GetCheatVarAt(uint32 nOffset) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Console variable sink.
|
||||
// Adds a new console variables sink callback.
|
||||
@@ -644,19 +625,6 @@ struct ICVar
|
||||
// Returns an ID to use when getting or removing the functor
|
||||
virtual uint64 AddOnChangeFunctor(const SFunctor& pChangeFunctor) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Returns the number of registered on change functos.
|
||||
virtual uint64 GetNumberOfOnChangeFunctors() const = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Returns the functors with the specified id.
|
||||
virtual const SFunctor& GetOnChangeFunctor(uint64 nFunctorId) const = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Removes an on change functor
|
||||
// returns true if removal was successful.
|
||||
virtual bool RemoveOnChangeFunctor(uint64 nFunctorId) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Get the current callback function.
|
||||
virtual ConsoleVarFunc GetOnChangeCallback() const = 0;
|
||||
@@ -685,5 +653,3 @@ struct ICVar
|
||||
// Set the data probe string value of the variable
|
||||
virtual void SetDataProbeString(const char* pDataProbeString) = 0;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_ICONSOLE_H
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
#include <IRenderer.h>
|
||||
#include <limits>
|
||||
#include <AzCore/Component/EntityId.h>
|
||||
#include <AzCore/std/algorithm.h>
|
||||
|
||||
|
||||
namespace AZ
|
||||
namespace AZ
|
||||
{
|
||||
class Vector2;
|
||||
}
|
||||
@@ -29,560 +30,16 @@ struct SFrameLodInfo;
|
||||
struct pe_params_area;
|
||||
struct pe_articgeomparams;
|
||||
|
||||
// @NOTE: When removing an item from this enum, replace it with a dummy - ID's from this enum are stored in data and should not change.
|
||||
enum EERType
|
||||
{
|
||||
eERType_NotRenderNode,
|
||||
eERType_Dummy_10,
|
||||
eERType_Dummy8,
|
||||
eERType_Light,
|
||||
eERType_Cloud,
|
||||
eERType_TerrainSystem, // used to be eERType_Dummy_1 which used to be eERType_VoxelObject, preserve order for compatibility
|
||||
eERType_FogVolume,
|
||||
eERType_Decal,
|
||||
eERType_Dummy_6, // used to be eERType_ParticleEmitter, preserve order for compatibility
|
||||
eERType_WaterVolume,
|
||||
eERType_Dummy_5, // used to be eERType_WaterWave, preserve order for compatibility
|
||||
eERType_Dummy_7, // used to be eERType_Road, preserve order for compatibility
|
||||
eERType_DistanceCloud,
|
||||
eERType_VolumeObject,
|
||||
eERType_Dummy_0, // used to be eERType_AutoCubeMap, preserve order for compatibility
|
||||
eERType_Rope,
|
||||
eERType_PrismObject,
|
||||
eERType_Dummy_2, // used to be eERType_IsoMesh, preserve order for compatibility
|
||||
eERType_Dummy_4,
|
||||
eERType_RenderComponent,
|
||||
eERType_GameEffect,
|
||||
eERType_BreakableGlass,
|
||||
eERType_Dummy_3, // used to be eERType_LightShape, preserve order for compatibility
|
||||
eERType_Dummy_9,
|
||||
eERType_GeomCache,
|
||||
eERType_StaticMeshRenderComponent,
|
||||
eERType_DynamicMeshRenderComponent,
|
||||
eERType_SkinnedMeshRenderComponent,
|
||||
eERType_TypesNum, // MUST BE AT END TOTAL NUMBER OF ERTYPES
|
||||
};
|
||||
|
||||
enum ERNListType
|
||||
{
|
||||
eRNListType_Unknown,
|
||||
eRNListType_DecalsAndRoads,
|
||||
eRNListType_ListsNum,
|
||||
eRNListType_First = eRNListType_Unknown, // This should be the last member
|
||||
// And it counts on eRNListType_Unknown
|
||||
// being the first enum element.
|
||||
};
|
||||
|
||||
enum EOcclusionObjectType
|
||||
{
|
||||
eoot_OCCLUDER,
|
||||
eoot_OCEAN,
|
||||
eoot_OCCELL,
|
||||
eoot_OCCELL_OCCLUDER,
|
||||
eoot_OBJECT,
|
||||
eoot_OBJECT_TO_LIGHT,
|
||||
eoot_TERRAIN_NODE,
|
||||
eoot_PORTAL,
|
||||
};
|
||||
|
||||
// RenderNode flags
|
||||
|
||||
#define ERF_GOOD_OCCLUDER BIT(0)
|
||||
#define ERF_PROCEDURAL BIT(1)
|
||||
#define ERF_CLONE_SOURCE BIT(2) // set if this object was cloned from another one
|
||||
#define ERF_CASTSHADOWMAPS BIT(3) // if you ever set this flag, be sure also to set ERF_HAS_CASTSHADOWMAPS
|
||||
#define ERF_RENDER_ALWAYS BIT(4)
|
||||
#define ERF_DYNAMIC_DISTANCESHADOWS BIT(5)
|
||||
#define ERF_HIDABLE BIT(6)
|
||||
#define ERF_HIDABLE_SECONDARY BIT(7)
|
||||
#define ERF_HIDDEN BIT(8)
|
||||
#define ERF_SELECTED BIT(9)
|
||||
#define ERF_PROCEDURAL_ENTITY BIT(10) // this is an object generated at runtime which has a limited lifetime (matches procedural entity)
|
||||
#define ERF_OUTDOORONLY BIT(11)
|
||||
#define ERF_NODYNWATER BIT(12)
|
||||
#define ERF_EXCLUDE_FROM_TRIANGULATION BIT(13)
|
||||
#define ERF_REGISTER_BY_BBOX BIT(14)
|
||||
#define ERF_STATIC_INSTANCING BIT(15)
|
||||
#define ERF_VOXELIZE_STATIC BIT(16)
|
||||
#define ERF_NO_PHYSICS BIT(17)
|
||||
#define ERF_NO_DECALNODE_DECALS BIT(18)
|
||||
#define ERF_REGISTER_BY_POSITION BIT(19)
|
||||
#define ERF_COMPONENT_ENTITY BIT(20)
|
||||
#define ERF_RECVWIND BIT(21)
|
||||
#define ERF_COLLISION_PROXY BIT(22) // Collision proxy is a special object that is only visible in editor
|
||||
// and used for physical collisions with player and vehicles.
|
||||
#define ERF_LOD_BBOX_BASED BIT(23) // Lod changes based on bounding boxes.
|
||||
#define ERF_SPEC_BIT0 BIT(24) // Bit0 of min config specification.
|
||||
#define ERF_SPEC_BIT1 BIT(25) // Bit1 of min config specification.
|
||||
#define ERF_SPEC_BIT2 BIT(26) // Bit2 of min config specification.
|
||||
#define ERF_SPEC_BITS_MASK (ERF_SPEC_BIT0 | ERF_SPEC_BIT1 | ERF_SPEC_BIT2) // Bit mask of the min spec bits.
|
||||
#define ERF_SPEC_BITS_SHIFT (24) // Bit offset of the ERF_SPEC_BIT0.
|
||||
#define ERF_RAYCAST_PROXY BIT(27) // raycast proxy is only used for raycasting
|
||||
#define ERF_HUD BIT(28) // Hud object that can avoid some visibility tests
|
||||
#define ERF_RAIN_OCCLUDER BIT(29) // Is used for rain occlusion map
|
||||
#define ERF_HAS_CASTSHADOWMAPS BIT(30) // at one point had ERF_CASTSHADOWMAPS set
|
||||
#define ERF_ACTIVE_LAYER BIT(31) // the node is on a currently active layer
|
||||
|
||||
struct IShadowCaster
|
||||
{
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IShadowCaster(){}
|
||||
virtual bool HasOcclusionmap([[maybe_unused]] int nLod, [[maybe_unused]] IRenderNode* pLightOwner) { return false; }
|
||||
virtual CLodValue ComputeLod(int wantedLod, [[maybe_unused]] const SRenderingPassInfo& passInfo) { return CLodValue(wantedLod); }
|
||||
virtual void Render(const SRendParams& RendParams, const SRenderingPassInfo& passInfo) = 0;
|
||||
virtual const AABB GetBBoxVirtual() = 0;
|
||||
virtual void FillBBox(AABB& aabb) = 0;
|
||||
virtual EERType GetRenderNodeType() = 0;
|
||||
virtual bool IsRenderNode() { return true; }
|
||||
// </interfuscator:shuffle>
|
||||
uint8 m_cStaticShadowLod;
|
||||
};
|
||||
|
||||
// Optional filter function for octree queries to perform custom filtering of the results.
|
||||
// return true to keep the render node, false to filter it out.
|
||||
using ObjectTreeQueryFilterCallback = AZStd::function<bool(IRenderNode*, EERType)>;
|
||||
|
||||
struct IOctreeNode
|
||||
{
|
||||
public:
|
||||
virtual ~IOctreeNode() {};
|
||||
|
||||
virtual void GetObjectsByType(PodArray<IRenderNode*>& lstObjects, EERType objType, const AABB* pBBox, ObjectTreeQueryFilterCallback filterCallback = nullptr) = 0;
|
||||
|
||||
struct CVisArea* m_pVisArea;
|
||||
};
|
||||
|
||||
struct SLodDistDissolveTransitionState
|
||||
{
|
||||
float fStartDist;
|
||||
int8 nOldLod;
|
||||
int8 nNewLod;
|
||||
bool bFarside;
|
||||
};
|
||||
|
||||
struct SLightInfo
|
||||
{
|
||||
bool operator == (const SLightInfo& other) const
|
||||
{ return other.vPos.IsEquivalent(vPos, 0.1f) && fabs(other.fRadius - fRadius) < 0.1f; }
|
||||
Vec3 vPos;
|
||||
float fRadius;
|
||||
bool bAffecting;
|
||||
};
|
||||
|
||||
struct IRenderNode
|
||||
: public IShadowCaster
|
||||
{
|
||||
enum EInternalFlags
|
||||
{
|
||||
DECAL_OWNER = BIT(0), // Owns some decals.
|
||||
REQUIRES_NEAREST_CUBEMAP = BIT(1), // Pick nearest cube map
|
||||
UPDATE_DECALS = BIT(2), // The node changed geometry - decals must be updated.
|
||||
REQUIRES_FORWARD_RENDERING = BIT(3), // Special shadow processing needed.
|
||||
WAS_INVISIBLE = BIT(4), // Was invisible last frame.
|
||||
WAS_IN_VISAREA = BIT(5), // Was inside vis-ares last frame.
|
||||
WAS_FARAWAY = BIT(6), // Was considered 'far away' for the purposes of physics deactivation.
|
||||
HAS_OCCLUSION_PROXY = BIT(7) // This node has occlusion proxy.
|
||||
};
|
||||
|
||||
IRenderNode()
|
||||
{
|
||||
m_dwRndFlags = 0;
|
||||
m_fViewDistanceMultiplier = static_cast<float>(IRenderNode::VIEW_DISTANCE_MULTIPLIER_MAX); // By default object is not limited by distance.
|
||||
m_ucLodRatio = 100;
|
||||
m_pOcNode = 0;
|
||||
m_fWSMaxViewDist = 0;
|
||||
m_nInternalFlags = 0;
|
||||
m_nMaterialLayers = 0;
|
||||
m_pRNTmpData = NULL;
|
||||
m_pPrev = m_pNext = NULL;
|
||||
m_nSID = 0;
|
||||
m_cShadowLodBias = 0;
|
||||
m_cStaticShadowLod = 0;
|
||||
}
|
||||
|
||||
virtual bool CanExecuteRenderAsJob() { return false; }
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
// Debug info about object.
|
||||
virtual const char* GetName() const = 0;
|
||||
virtual const char* GetEntityClassName() const = 0;
|
||||
virtual AZStd::string GetDebugString([[maybe_unused]] char type = 0) const { return ""; }
|
||||
virtual float GetImportance() const { return 1.f; }
|
||||
|
||||
// Description:
|
||||
// Releases IRenderNode.
|
||||
virtual void ReleaseNode([[maybe_unused]] bool bImmediate = false) { delete this; }
|
||||
|
||||
|
||||
virtual IRenderNode* Clone() const { return NULL; }
|
||||
|
||||
// Description:
|
||||
// Sets render node transformation matrix.
|
||||
virtual void SetMatrix([[maybe_unused]] const Matrix34& mat) {}
|
||||
|
||||
// Description:
|
||||
// Gets local bounds of the render node.
|
||||
virtual void GetLocalBounds(AABB& bbox) { AABB WSBBox(GetBBox()); bbox = AABB(WSBBox.min - GetPos(true), WSBBox.max - GetPos(true)); }
|
||||
|
||||
virtual Vec3 GetPos(bool bWorldOnly = true) const = 0;
|
||||
virtual const AABB GetBBox() const = 0;
|
||||
virtual void FillBBox(AABB& aabb) { aabb = GetBBox(); }
|
||||
virtual void SetBBox(const AABB& WSBBox) = 0;
|
||||
|
||||
virtual void SetScale([[maybe_unused]] const Vec3& scale) {}
|
||||
|
||||
//Get the scales assuming the scale is uniform or per column as needed.
|
||||
virtual float GetUniformScale() { return 1.0f; }
|
||||
virtual float GetColumnScale([[maybe_unused]] int column) { return 1.0f; }
|
||||
|
||||
// Summary:
|
||||
// Changes the world coordinates position of this node by delta
|
||||
// Don't forget to call this base function when overriding it.
|
||||
virtual void OffsetPosition(const Vec3& delta) = 0;
|
||||
|
||||
// Return true when the node is initialized and ready to render
|
||||
virtual bool IsReady() const { return true; }
|
||||
|
||||
// Summary:
|
||||
// Renders node geometry
|
||||
virtual void Render(const struct SRendParams& EntDrawParams, const SRenderingPassInfo& passInfo) = 0;
|
||||
|
||||
// Hides/disables node in renderer.
|
||||
virtual void Hide(bool bHide) { SetRndFlags(ERF_HIDDEN, bHide); }
|
||||
bool IsHidden() const { return (GetRndFlags() & ERF_HIDDEN) != 0; }
|
||||
|
||||
// Gives access to object components.
|
||||
virtual struct IStatObj* GetEntityStatObj(unsigned int nPartId = 0, unsigned int nSubPartId = 0, Matrix34A* pMatrix = NULL, bool bReturnOnlyVisible = false);
|
||||
virtual _smart_ptr<IMaterial> GetEntitySlotMaterial([[maybe_unused]] unsigned int nPartId, [[maybe_unused]] bool bReturnOnlyVisible = false, [[maybe_unused]] bool* pbDrawNear = NULL) { return NULL; }
|
||||
virtual void SetEntityStatObj([[maybe_unused]] unsigned int nSlot, [[maybe_unused]] IStatObj* pStatObj, [[maybe_unused]] const Matrix34A* pMatrix = NULL) {};
|
||||
virtual int GetSlotCount() const { return 1; }
|
||||
|
||||
// Summary:
|
||||
// Returns IRenderMesh of the object.
|
||||
virtual struct IRenderMesh* GetRenderMesh([[maybe_unused]] int nLod) { return 0; };
|
||||
|
||||
// Description:
|
||||
// Allows to adjust default lod distance settings,
|
||||
// if fLodRatio is 100 - default lod distance is used.
|
||||
virtual void SetLodRatio(int nLodRatio) { m_ucLodRatio = static_cast<unsigned char>(min(255, max(0, nLodRatio))); }
|
||||
|
||||
// Summary:
|
||||
// Gets material layers mask.
|
||||
virtual uint8 GetMaterialLayers() const { return m_nMaterialLayers; }
|
||||
|
||||
|
||||
// Summary
|
||||
// Physicalizes if it isn't already.
|
||||
virtual void CheckPhysicalized() {};
|
||||
|
||||
// Summary:
|
||||
// Physicalizes node.
|
||||
virtual void Physicalize([[maybe_unused]] bool bInstant = false) {}
|
||||
|
||||
virtual ~IRenderNode() { assert(!m_pRNTmpData); };
|
||||
|
||||
// Summary:
|
||||
// Sets override material for this instance.
|
||||
virtual void SetMaterial(_smart_ptr<IMaterial> pMat) = 0;
|
||||
// Summary:
|
||||
// Queries override material of this instance.
|
||||
virtual _smart_ptr<IMaterial> GetMaterial(Vec3* pHitPos = NULL) = 0;
|
||||
virtual _smart_ptr<IMaterial> GetMaterialOverride() = 0;
|
||||
virtual void GetMaterials(AZStd::vector<_smart_ptr<IMaterial>>& materials)
|
||||
{
|
||||
_smart_ptr<IMaterial> currentMaterial = GetMaterialOverride();
|
||||
if (!currentMaterial)
|
||||
{
|
||||
currentMaterial = GetMaterial();
|
||||
}
|
||||
if (currentMaterial)
|
||||
{
|
||||
materials.push_back(currentMaterial);
|
||||
}
|
||||
struct IStatObj* GetEntityStatObj(unsigned int = 0, unsigned int = 0, Matrix34A* = NULL, bool = false) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Used by the editor during export
|
||||
virtual void SetCollisionClassIndex([[maybe_unused]] int tableIndex) {}
|
||||
|
||||
virtual int GetEditorObjectId() { return 0; }
|
||||
virtual void SetEditorObjectId([[maybe_unused]] int nEditorObjectId) {}
|
||||
virtual void SetStatObjGroupIndex([[maybe_unused]] int nVegetationGroupIndex) { }
|
||||
virtual int GetStatObjGroupId() const { return -1; }
|
||||
virtual void SetLayerId([[maybe_unused]] uint16 nLayerId) { }
|
||||
virtual uint16 GetLayerId() { return 0; }
|
||||
virtual float GetMaxViewDist() = 0;
|
||||
|
||||
virtual EERType GetRenderNodeType() = 0;
|
||||
virtual bool IsAllocatedOutsideOf3DEngineDLL()
|
||||
{
|
||||
return GetRenderNodeType() == eERType_RenderComponent ||
|
||||
GetRenderNodeType() == eERType_StaticMeshRenderComponent ||
|
||||
GetRenderNodeType() == eERType_DynamicMeshRenderComponent ||
|
||||
GetRenderNodeType() == eERType_SkinnedMeshRenderComponent;
|
||||
}
|
||||
virtual void Dephysicalize([[maybe_unused]] bool bKeepIfReferenced = false) {}
|
||||
virtual void Dematerialize() {}
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
|
||||
|
||||
virtual void Precache() {};
|
||||
|
||||
virtual const AABB GetBBoxVirtual() { return GetBBox(); }
|
||||
|
||||
// virtual float GetLodForDistance(float fDistance) { return 0; }
|
||||
|
||||
virtual void OnRenderNodeBecomeVisible([[maybe_unused]] const SRenderingPassInfo& passInfo) {}
|
||||
virtual void OnPhysAreaChange() {}
|
||||
|
||||
virtual bool IsMovableByGame() const { return false; }
|
||||
|
||||
virtual uint8 GetSortPriority() { return 0; }
|
||||
|
||||
// Types of voxelization for objects and lights
|
||||
enum EVoxelGIMode : int
|
||||
{
|
||||
VM_None = 0, // No voxelization
|
||||
VM_Static, // Incremental or asynchronous lazy voxelization
|
||||
VM_Dynamic, // Real-time every-frame voxelization on GPU
|
||||
};
|
||||
|
||||
virtual EVoxelGIMode GetVoxelGIMode() { return VM_None; }
|
||||
virtual void SetDesiredVoxelGIMode([[maybe_unused]] EVoxelGIMode voxelMode) {}
|
||||
|
||||
virtual void SetMinSpec(int nMinSpec) { m_dwRndFlags &= ~ERF_SPEC_BITS_MASK; m_dwRndFlags |= (nMinSpec << ERF_SPEC_BITS_SHIFT) & ERF_SPEC_BITS_MASK; };
|
||||
|
||||
// Description:
|
||||
// Allows to adjust default max view distance settings,
|
||||
// if fMaxViewDistRatio is 1.0f - default max view distance is used.
|
||||
virtual void SetViewDistanceMultiplier(float fViewDistanceMultiplier);
|
||||
// </interfuscator:shuffle>
|
||||
|
||||
void CopyIRenderNodeData(IRenderNode* pDest) const
|
||||
{
|
||||
pDest->m_fWSMaxViewDist = m_fWSMaxViewDist;
|
||||
pDest->m_dwRndFlags = m_dwRndFlags;
|
||||
//pDest->m_pOcNode = m_pOcNode; // Removed to stop the registering from earlying out.
|
||||
pDest->m_fViewDistanceMultiplier = m_fViewDistanceMultiplier;
|
||||
pDest->m_ucLodRatio = m_ucLodRatio;
|
||||
pDest->m_cShadowLodBias = m_cShadowLodBias;
|
||||
pDest->m_cStaticShadowLod = m_cStaticShadowLod;
|
||||
pDest->m_nInternalFlags = m_nInternalFlags;
|
||||
pDest->m_nMaterialLayers = m_nMaterialLayers;
|
||||
//pDestBrush->m_pRNTmpData //If this is copied from the source render node, there are two
|
||||
// pointers to the same data, and if either is deleted, there will
|
||||
// be a crash when the dangling pointer is used on the other
|
||||
}
|
||||
|
||||
// Rendering flags.
|
||||
ILINE void SetRndFlags(unsigned int dwFlags) { m_dwRndFlags = dwFlags; }
|
||||
ILINE void SetRndFlags(unsigned int dwFlags, bool bEnable)
|
||||
{
|
||||
if (bEnable)
|
||||
{
|
||||
SetRndFlags(m_dwRndFlags | dwFlags);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetRndFlags(m_dwRndFlags & (~dwFlags));
|
||||
}
|
||||
}
|
||||
ILINE unsigned int GetRndFlags() const { return m_dwRndFlags; }
|
||||
|
||||
// Object draw frames (set if was drawn).
|
||||
ILINE void SetDrawFrame(int nFrameID, int nRecursionLevel)
|
||||
{
|
||||
assert(m_pRNTmpData);
|
||||
int* pDrawFrames = (int*)m_pRNTmpData;
|
||||
pDrawFrames[nRecursionLevel] = nFrameID;
|
||||
}
|
||||
|
||||
ILINE int GetDrawFrame(int nRecursionLevel = 0) const
|
||||
{
|
||||
IF (!m_pRNTmpData, 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int* pDrawFrames = (int*)m_pRNTmpData;
|
||||
return pDrawFrames[nRecursionLevel];
|
||||
}
|
||||
|
||||
// Returns:
|
||||
// Current VisArea or null if in outdoors or entity was not registered in 3dengine.
|
||||
ILINE IVisArea* GetEntityVisArea() const { return m_pOcNode ? (IVisArea*)(m_pOcNode->m_pVisArea) : NULL; }
|
||||
|
||||
// Summary:
|
||||
// Makes object visible at any distance.
|
||||
ILINE void SetViewDistUnlimited() { SetViewDistanceMultiplier(100.0f); }
|
||||
|
||||
// Summary:
|
||||
// Retrieves the view distance settings.
|
||||
ILINE float GetViewDistanceMultiplier() const
|
||||
{
|
||||
return m_fViewDistanceMultiplier;
|
||||
}
|
||||
|
||||
// Summary:
|
||||
// Returns lod distance ratio.
|
||||
ILINE int GetLodRatio() const { return m_ucLodRatio; }
|
||||
|
||||
// Summary:
|
||||
// Returns lod distance ratio
|
||||
ILINE float GetLodRatioNormalized() const { return 0.01f * m_ucLodRatio; }
|
||||
|
||||
virtual bool GetLodDistances([[maybe_unused]] const SFrameLodInfo& frameLodInfo, [[maybe_unused]] float* distances) const { return false; }
|
||||
|
||||
// Returns distance for first lod change, not factoring in distance multiplier or lod ratio
|
||||
virtual float GetFirstLodDistance() const { return FLT_MAX; }
|
||||
|
||||
// Description:
|
||||
// Bias value to add to the regular lod
|
||||
virtual void SetShadowLodBias(int8 nShadowLodBias) { m_cShadowLodBias = nShadowLodBias; }
|
||||
|
||||
// Summary:
|
||||
// Returns lod distance ratio.
|
||||
ILINE int GetShadowLodBias() const { return m_cShadowLodBias; }
|
||||
|
||||
// Summary:
|
||||
// Sets material layers mask.
|
||||
ILINE void SetMaterialLayers(uint8 nMtlLayers) { m_nMaterialLayers = nMtlLayers; }
|
||||
|
||||
ILINE int GetMinSpec() const { return (m_dwRndFlags & ERF_SPEC_BITS_MASK) >> ERF_SPEC_BITS_SHIFT; };
|
||||
|
||||
static const ERNListType GetRenderNodeListId(const EERType eRType)
|
||||
{
|
||||
switch (eRType)
|
||||
{
|
||||
case eERType_Decal:
|
||||
return eRNListType_DecalsAndRoads;
|
||||
default:
|
||||
return eRNListType_Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
virtual AZ::EntityId GetEntityId() { return AZ::EntityId(); }
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Variables
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public:
|
||||
|
||||
// Every sector has linked list of IRenderNode objects.
|
||||
IRenderNode* m_pNext, * m_pPrev;
|
||||
|
||||
// Current objects tree cell.
|
||||
IOctreeNode* m_pOcNode;
|
||||
|
||||
// Pointer to temporary data allocated only for currently visible objects.
|
||||
struct CRNTmpData* m_pRNTmpData;
|
||||
|
||||
// Max view distance.
|
||||
float m_fWSMaxViewDist;
|
||||
|
||||
// Render flags.
|
||||
int m_dwRndFlags;
|
||||
|
||||
// Shadow LOD bias
|
||||
// Set to SHADOW_LODBIAS_DISABLE to disable any shadow lod overrides for this rendernode
|
||||
static const int8 SHADOW_LODBIAS_DISABLE = -128;
|
||||
int8 m_cShadowLodBias;
|
||||
|
||||
// Segment Id
|
||||
int m_nSID;
|
||||
int GetSlotCount() const { return 1; }
|
||||
|
||||
// Max view distance settings.
|
||||
static const int VIEW_DISTANCE_MULTIPLIER_MAX = 100;
|
||||
float m_fViewDistanceMultiplier;
|
||||
static constexpr int VIEW_DISTANCE_MULTIPLIER_MAX = 100;
|
||||
|
||||
// LOD settings.
|
||||
unsigned char m_ucLodRatio;
|
||||
|
||||
// Flags for render node internal usage, one or more bits from EInternalFlags.
|
||||
unsigned char m_nInternalFlags;
|
||||
|
||||
// Material layers bitmask -> which material layers are active.
|
||||
unsigned char m_nMaterialLayers;
|
||||
};
|
||||
|
||||
inline void IRenderNode::SetViewDistanceMultiplier(float fViewDistanceMultiplier)
|
||||
{
|
||||
fViewDistanceMultiplier = CLAMP(fViewDistanceMultiplier, 0.0f, 100.0f);
|
||||
if (fabs(m_fViewDistanceMultiplier - fViewDistanceMultiplier) > FLT_EPSILON)
|
||||
{
|
||||
m_fViewDistanceMultiplier = fViewDistanceMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline IStatObj* IRenderNode::GetEntityStatObj([[maybe_unused]] unsigned int nPartId, [[maybe_unused]] unsigned int nSubPartId, [[maybe_unused]] Matrix34A* pMatrix, [[maybe_unused]] bool bReturnOnlyVisible)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//We must use interfaces instead of unsafe type casts and unnecessary includes
|
||||
|
||||
struct ILightSource
|
||||
: public IRenderNode
|
||||
{
|
||||
// <interfuscator:shuffle>
|
||||
virtual void SetLightProperties(const CDLight& light) = 0;
|
||||
virtual CDLight& GetLightProperties() = 0;
|
||||
virtual const Matrix34& GetMatrix() = 0;
|
||||
virtual struct ShadowMapFrustum* GetShadowFrustum(int nId = 0) = 0;
|
||||
virtual bool IsLightAreasVisible() = 0;
|
||||
virtual void SetCastingException(IRenderNode* pNotCaster) = 0;
|
||||
virtual void SetName(const char* name) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
struct SCloudMovementProperties
|
||||
{
|
||||
bool m_autoMove;
|
||||
Vec3 m_speed;
|
||||
Vec3 m_spaceLoopBox;
|
||||
float m_fadeDistance;
|
||||
};
|
||||
|
||||
// Summary:
|
||||
// ICloudRenderNode is an interface to the Cloud Render Node object.
|
||||
struct ICloudRenderNode
|
||||
: public IRenderNode
|
||||
{
|
||||
// <interfuscator:shuffle>
|
||||
// Description:
|
||||
// Loads a cloud from a cloud description XML file.
|
||||
virtual bool LoadCloud(const char* sCloudFilename) = 0;
|
||||
virtual bool LoadCloudFromXml(XmlNodeRef cloudNode) = 0;
|
||||
virtual void SetMovementProperties(const SCloudMovementProperties& properties) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
// Summary:
|
||||
// IVoxelObject is an interface to the Voxel Object Render Node object.
|
||||
struct IVoxelObject
|
||||
: public IRenderNode
|
||||
{
|
||||
// <interfuscator:shuffle>
|
||||
virtual void SetCompiledData(void* pData, int nSize, uint8 ucChildId, EEndian eEndian) = 0;
|
||||
virtual void SetObjectName(const char* pName) = 0;
|
||||
virtual void SetMatrix(const Matrix34& mat) = 0;
|
||||
virtual bool ResetTransformation() = 0;
|
||||
virtual void InterpolateVoxelData() = 0;
|
||||
virtual void SetFlags(int nFlags) = 0;
|
||||
virtual void Regenerate() = 0;
|
||||
virtual void CopyHM() = 0;
|
||||
virtual bool IsEmpty() = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
// LY renderer system spec levels.
|
||||
enum class EngineSpec : AZ::u32
|
||||
{
|
||||
Low = 1,
|
||||
Medium,
|
||||
High,
|
||||
VeryHigh,
|
||||
Never = UINT_MAX,
|
||||
};
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "TypeInfo_impl.h"
|
||||
#include <IEntityRenderState.h> // <> required for Interfuscator
|
||||
|
||||
ENUM_INFO_BEGIN(EERType)
|
||||
ENUM_ELEM_INFO(, eERType_NotRenderNode)
|
||||
ENUM_ELEM_INFO(, eERType_Dummy_10)
|
||||
ENUM_ELEM_INFO(, eERType_Light)
|
||||
ENUM_ELEM_INFO(, eERType_Cloud)
|
||||
ENUM_ELEM_INFO(, eERType_TerrainSystem)
|
||||
ENUM_ELEM_INFO(, eERType_FogVolume)
|
||||
ENUM_ELEM_INFO(, eERType_Decal)
|
||||
ENUM_ELEM_INFO(, eERType_Dummy_6)
|
||||
ENUM_ELEM_INFO(, eERType_WaterVolume)
|
||||
ENUM_ELEM_INFO(, eERType_Dummy_7)
|
||||
ENUM_ELEM_INFO(, eERType_DistanceCloud)
|
||||
ENUM_ELEM_INFO(, eERType_VolumeObject)
|
||||
ENUM_ELEM_INFO(, eERType_Dummy_0)
|
||||
ENUM_ELEM_INFO(, eERType_Rope)
|
||||
ENUM_ELEM_INFO(, eERType_PrismObject)
|
||||
ENUM_ELEM_INFO(, eERType_Dummy_2)
|
||||
ENUM_ELEM_INFO(, eERType_Dummy_4)
|
||||
ENUM_ELEM_INFO(, eERType_RenderComponent)
|
||||
ENUM_ELEM_INFO(, eERType_StaticMeshRenderComponent)
|
||||
ENUM_ELEM_INFO(, eERType_DynamicMeshRenderComponent)
|
||||
ENUM_ELEM_INFO(, eERType_SkinnedMeshRenderComponent)
|
||||
ENUM_ELEM_INFO(, eERType_GameEffect)
|
||||
ENUM_ELEM_INFO(, eERType_BreakableGlass)
|
||||
ENUM_ELEM_INFO(, eERType_Dummy_3)
|
||||
ENUM_ELEM_INFO(, eERType_Dummy_9)
|
||||
ENUM_ELEM_INFO(, eERType_GeomCache)
|
||||
ENUM_ELEM_INFO(, eERType_TypesNum)
|
||||
ENUM_INFO_END(EERType)
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <smartptr.h>
|
||||
|
||||
#include <AzCore/std/smart_ptr/shared_ptr.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
|
||||
struct ISystem;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "TypeInfo_impl.h"
|
||||
#include <IIndexedMesh.h> // <> required for Interfuscator
|
||||
|
||||
STRUCT_INFO_BEGIN(SMeshTexCoord)
|
||||
STRUCT_VAR_INFO(s, TYPE_INFO(float))
|
||||
STRUCT_VAR_INFO(t, TYPE_INFO(float))
|
||||
STRUCT_INFO_END(SMeshTexCoord)
|
||||
|
||||
STRUCT_INFO_BEGIN(SMeshNormal)
|
||||
STRUCT_VAR_INFO(Normal, TYPE_INFO(Vec3))
|
||||
STRUCT_INFO_END(SMeshNormal)
|
||||
|
||||
STRUCT_INFO_BEGIN(SMeshColor)
|
||||
STRUCT_VAR_INFO(r, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(g, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(b, TYPE_INFO(uint8))
|
||||
STRUCT_VAR_INFO(a, TYPE_INFO(uint8))
|
||||
STRUCT_INFO_END(SMeshColor)
|
||||
|
||||
STRUCT_INFO_BEGIN(SMeshTangents)
|
||||
STRUCT_VAR_INFO(Tangent, TYPE_INFO(Vec4sf))
|
||||
STRUCT_VAR_INFO(Bitangent, TYPE_INFO(Vec4sf))
|
||||
STRUCT_INFO_END(SMeshTangents)
|
||||
|
||||
STRUCT_INFO_BEGIN(SMeshQTangents)
|
||||
STRUCT_VAR_INFO(TangentBitangent, TYPE_INFO(Vec4sf))
|
||||
STRUCT_INFO_END(SMeshQTangents)
|
||||
|
||||
STRUCT_INFO_BEGIN(SMeshBoneMapping_uint16)
|
||||
STRUCT_VAR_INFO(boneIds, TYPE_ARRAY(4, TYPE_INFO(SMeshBoneMapping_uint16::BoneId)))
|
||||
STRUCT_VAR_INFO(weights, TYPE_ARRAY(4, TYPE_INFO(SMeshBoneMapping_uint16::Weight)))
|
||||
STRUCT_INFO_END(SMeshBoneMapping_uint16)
|
||||
|
||||
STRUCT_INFO_BEGIN(SMeshBoneMapping_uint8)
|
||||
STRUCT_VAR_INFO(boneIds, TYPE_ARRAY(4, TYPE_INFO(SMeshBoneMapping_uint8::BoneId)))
|
||||
STRUCT_VAR_INFO(weights, TYPE_ARRAY(4, TYPE_INFO(SMeshBoneMapping_uint8::Weight)))
|
||||
STRUCT_INFO_END(SMeshBoneMapping_uint8)
|
||||
@@ -73,11 +73,11 @@ struct SLocalizedSoundInfoGame
|
||||
bool bIsIntercepted;
|
||||
|
||||
// SoundMoods.
|
||||
int nNumSoundMoods;
|
||||
size_t nNumSoundMoods;
|
||||
SLocalizedAdvancesSoundEntry* pSoundMoods;
|
||||
|
||||
// EventParameters.
|
||||
int nNumEventParameters;
|
||||
size_t nNumEventParameters;
|
||||
SLocalizedAdvancesSoundEntry* pEventParameters;
|
||||
};
|
||||
|
||||
|
||||
@@ -10,36 +10,12 @@
|
||||
// Description : IMaterial interface declaration.
|
||||
#pragma once
|
||||
|
||||
struct ISurfaceType;
|
||||
struct ISurfaceTypeManager;
|
||||
class ICrySizer;
|
||||
|
||||
enum EEfResTextures : int; // Need to specify a fixed size for the forward declare to work on clang
|
||||
|
||||
struct SShaderItem;
|
||||
struct SShaderParam;
|
||||
struct IShader;
|
||||
struct IMaterial;
|
||||
struct IMaterialManager;
|
||||
struct CMaterialCGF;
|
||||
struct IRenderMesh;
|
||||
|
||||
#include <Tarray.h>
|
||||
#include <IXml.h>
|
||||
#include <smartptr.h>
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
|
||||
#ifdef MAX_SUB_MATERIALS
|
||||
// This checks that the values are in sync in the different files.
|
||||
static_assert(MAX_SUB_MATERIALS == 128);
|
||||
#else
|
||||
#define MAX_SUB_MATERIALS 128
|
||||
#endif
|
||||
|
||||
// Special names for materials.
|
||||
#define MTL_SPECIAL_NAME_COLLISION_PROXY "collision_proxy"
|
||||
#define MTL_SPECIAL_NAME_COLLISION_PROXY_VEHICLE "nomaterial_vehicle"
|
||||
#define MTL_SPECIAL_NAME_RAYCAST_PROXY "raycast_proxy"
|
||||
struct IShader;
|
||||
struct ISurfaceType;
|
||||
struct SShaderItem;
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
@@ -59,380 +35,15 @@ namespace AZ
|
||||
using MaterialNotificationEventBus = AZ::EBus<MaterialNotificationEvents>;
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
MAX_STREAM_PREDICTION_ZONES = 2
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Description:
|
||||
// IMaterial is an interface to the material object, SShaderItem host which is a combination of IShader and SShaderInputResources.
|
||||
// Material bind together rendering algorithm (Shader) and resources needed to render this shader, textures, colors, etc...
|
||||
// All materials except for pure sub material childs have a unique name which directly represent .mtl file on disk.
|
||||
// Ex: "Materials/Fire/Burn"
|
||||
// Materials can be created by Sandbox MaterialEditor.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
enum EMaterialFlags
|
||||
{
|
||||
MTL_FLAG_WIRE = 0x0001, // Use wire frame rendering for this material.
|
||||
MTL_FLAG_2SIDED = 0x0002, // Use 2 Sided rendering for this material.
|
||||
MTL_FLAG_ADDITIVE = 0x0004, // Use Additive blending for this material.
|
||||
//MTL_FLAG_DETAIL_DECAL = 0x0008, // UNUSED RESERVED FOR LEGACY REASONS
|
||||
MTL_FLAG_LIGHTING = 0x0010, // Should lighting be applied on this material.
|
||||
MTL_FLAG_NOSHADOW = 0x0020, // Material do not cast shadows.
|
||||
MTL_FLAG_ALWAYS_USED = 0x0040, // When set forces material to be export even if not explicitly used.
|
||||
MTL_FLAG_PURE_CHILD = 0x0080, // Not shared sub material, sub material unique to his parent multi material.
|
||||
MTL_FLAG_MULTI_SUBMTL = 0x0100, // This material is a multi sub material.
|
||||
MTL_FLAG_NOPHYSICALIZE = 0x0200, // Should not physicalize this material.
|
||||
MTL_FLAG_NODRAW = 0x0400, // Do not render this material.
|
||||
MTL_FLAG_NOPREVIEW = 0x0800, // Cannot preview the material.
|
||||
MTL_FLAG_NOTINSTANCED = 0x1000, // Do not instantiate this material.
|
||||
MTL_FLAG_COLLISION_PROXY = 0x2000, // This material is the collision proxy.
|
||||
MTL_FLAG_SCATTER = 0x4000, // Use scattering for this material
|
||||
MTL_FLAG_REQUIRE_FORWARD_RENDERING = 0x8000, // This material has to be rendered in forward rendering passes (alpha/additive blended)
|
||||
MTL_FLAG_NON_REMOVABLE = 0x10000, // Material with this flag once created are never removed from material manager (Used for decal materials, this flag should not be saved).
|
||||
MTL_FLAG_HIDEONBREAK = 0x20000, // Non-physicalized subsets with such materials will be removed after the object breaks
|
||||
MTL_FLAG_UIMATERIAL = 0x40000, // Used for UI in Editor. Don't need show it DB.
|
||||
MTL_64BIT_SHADERGENMASK = 0x80000, // ShaderGen mask is remapped
|
||||
MTL_FLAG_RAYCAST_PROXY = 0x100000,
|
||||
MTL_FLAG_REQUIRE_NEAREST_CUBEMAP = 0x200000, // materials with alpha blending requires special processing for shadows
|
||||
MTL_FLAG_CONSOLE_MAT = 0x400000,
|
||||
MTL_FLAG_DELETE_PENDING = 0x800000, // Internal use only
|
||||
MTL_FLAG_BLEND_TERRAIN = 0x1000000,
|
||||
MTL_FLAG_IS_TERRAIN = 0x2000000,// indication to the loader - Terrain type
|
||||
MTL_FLAG_IS_SKY = 0x4000000,// indication to the loader - Sky type
|
||||
MTL_FLAG_FOG_VOLUME_SHADING_QUALITY_HIGH= 0x8000000 // high vertex shading quality behaves more accurately with fog volumes.
|
||||
};
|
||||
|
||||
#define MTL_FLAGS_SAVE_MASK (MTL_FLAG_WIRE | MTL_FLAG_2SIDED | MTL_FLAG_ADDITIVE | MTL_FLAG_LIGHTING | \
|
||||
MTL_FLAG_NOSHADOW | MTL_FLAG_MULTI_SUBMTL | MTL_FLAG_SCATTER | MTL_FLAG_REQUIRE_FORWARD_RENDERING | MTL_FLAG_FOG_VOLUME_SHADING_QUALITY_HIGH | MTL_FLAG_HIDEONBREAK | MTL_FLAG_UIMATERIAL | MTL_64BIT_SHADERGENMASK | MTL_FLAG_REQUIRE_NEAREST_CUBEMAP | MTL_FLAG_CONSOLE_MAT | MTL_FLAG_BLEND_TERRAIN)
|
||||
|
||||
// Post effects flags
|
||||
enum EPostEffectFlags
|
||||
{
|
||||
POST_EFFECT_GHOST = 0x1,
|
||||
POST_EFFECT_HOLOGRAM = 0x2,
|
||||
|
||||
POST_EFFECT_MASK = POST_EFFECT_GHOST | POST_EFFECT_HOLOGRAM
|
||||
};
|
||||
|
||||
// Bit offsets for shader layer flags
|
||||
enum EMaterialLayerFlags
|
||||
{
|
||||
// Active layers flags
|
||||
MTL_LAYER_FROZEN = 0x0001,
|
||||
MTL_LAYER_WET = 0x0002,
|
||||
MTL_LAYER_DYNAMICFROZEN = 0x0008,
|
||||
|
||||
// Usage flags
|
||||
MTL_LAYER_USAGE_NODRAW = 0x0001, // Layer is disabled
|
||||
MTL_LAYER_USAGE_REPLACEBASE = 0x0002, // Replace base pass rendering with layer - optimization
|
||||
MTL_LAYER_USAGE_FADEOUT = 0x0004, // Layer doesn't render but still causes parent to fade out
|
||||
|
||||
// Blend offsets
|
||||
MTL_LAYER_BLEND_FROZEN = 0xff000000,
|
||||
MTL_LAYER_BLEND_WET = 0x00fe0000,
|
||||
MTL_LAYER_BLEND_DYNAMICFROZEN = 0x000000ff,
|
||||
|
||||
MTL_LAYER_FROZEN_MASK = 0xff,
|
||||
MTL_LAYER_WET_MASK = 0xfe, // bit stolen
|
||||
MTL_LAYER_DYNAMICFROZEN_MASK = 0xff,
|
||||
|
||||
MTL_LAYER_BLEND_MASK = (MTL_LAYER_BLEND_FROZEN | MTL_LAYER_BLEND_WET | MTL_LAYER_BLEND_DYNAMICFROZEN),
|
||||
|
||||
// Slot count
|
||||
MTL_LAYER_MAX_SLOTS = 3
|
||||
};
|
||||
|
||||
// copy flags
|
||||
enum EMaterialCopyFlags
|
||||
{
|
||||
// copy flags
|
||||
MTL_COPY_DEFAULT = 0,
|
||||
MTL_COPY_NAME = BIT(0),
|
||||
MTL_COPY_TEXTURES = BIT(1),
|
||||
};
|
||||
|
||||
struct IMaterial
|
||||
{
|
||||
// TODO: Remove it!
|
||||
//! default texture mapping
|
||||
uint8 m_ucDefautMappingAxis;
|
||||
float m_fDefautMappingScale;
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IMaterial() {}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Reference counting.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void AddRef() = 0;
|
||||
virtual void Release() = 0;
|
||||
virtual int GetNumRefs() = 0;
|
||||
|
||||
virtual IMaterialManager* GetMaterialManager() = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// material name
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Set material name, (Do not use this directly
|
||||
virtual void SetName(const char* pName) = 0;
|
||||
//! Returns material name.
|
||||
virtual const char* GetName() const = 0;
|
||||
|
||||
//! Set/get shader name. The shader name may include technique name so it could be deferent than GetShaderItem()->m_pShader->GetName().
|
||||
virtual void SetShaderName(const char* pName) = 0;
|
||||
virtual const char* GetShaderName() const = 0;
|
||||
|
||||
//! Material flags.
|
||||
//! @see EMaterialFlags
|
||||
virtual void SetFlags(int flags) = 0;
|
||||
virtual int GetFlags() const = 0;
|
||||
virtual void UpdateFlags() = 0;
|
||||
|
||||
// Returns true if this is the default material.
|
||||
virtual bool IsDefault() = 0;
|
||||
|
||||
virtual int GetSurfaceTypeId() = 0;
|
||||
|
||||
// Assign a different surface type to this material.
|
||||
virtual void SetSurfaceType(const char* sSurfaceTypeName) = 0;
|
||||
|
||||
virtual ISurfaceType* GetSurfaceType() = 0;
|
||||
|
||||
// shader item
|
||||
virtual SShaderItem& GetShaderItem() = 0;
|
||||
virtual const SShaderItem& GetShaderItem() const = 0;
|
||||
|
||||
// Returns shader item for correct sub material or for single material.
|
||||
// Even if this is not sub material or nSubMtlSlot is invalid it will return valid renderable shader item.
|
||||
virtual SShaderItem& GetShaderItem(int nSubMtlSlot) = 0;
|
||||
virtual const SShaderItem& GetShaderItem(int nSubMtlSlot) const = 0;
|
||||
|
||||
// Returns true if streamed in
|
||||
virtual bool IsStreamedIn(const int nMinPrecacheRoundIds[MAX_STREAM_PREDICTION_ZONES], IRenderMesh* pRenderMesh) const = 0;
|
||||
|
||||
// Description:
|
||||
// Fill an array of integeres representing surface ids of the sub materials or the material itself.
|
||||
// Arguments:
|
||||
// pSurfaceIdsTable is a pointer to the array of int with size enough to hold MAX_SUB_MATERIALS surface type ids.
|
||||
// Return:
|
||||
// number of filled items.
|
||||
virtual int FillSurfaceTypeIds(int pSurfaceIdsTable[]) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// UserData used to link with the Editor.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void SetUserData(void* pUserData) = 0;
|
||||
virtual void* GetUserData() const = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Set or get a material parameter value.
|
||||
//! \param sParamName - Name of the parameter
|
||||
//! \param v - Input or output value depending on bGet
|
||||
//! \param bGet - If true, v is an output; if false, v is an input
|
||||
//! \param allowShaderParam - If true, and sParamName is not a built-in parameter of the Material, then custom shader parameters will be searched as well. Defaults to false to preserve legacy behavior.
|
||||
//! \param materialIndex - Index of the sub-material if this is a material group
|
||||
//! return - True if sParamName was found
|
||||
virtual bool SetGetMaterialParamFloat(const char* sParamName, float& v, bool bGet, bool allowShaderParam = false, int materialIndex = 0) = 0;
|
||||
//! Set or get a material parameter value.
|
||||
//! \param sParamName - Name of the parameter
|
||||
//! \param v - Input or output value depending on bGet
|
||||
//! \param bGet - If true, v is an output; if false, v is an input
|
||||
//! \param allowShaderParam - If true, and sParamName is not a built-in parameter of the Material, then custom shader parameters will be searched as well. Defaults to false to preserve legacy behavior.
|
||||
//! \param materialIndex - Index of the sub-material if this is a material group
|
||||
//! return - True if sParamName was found
|
||||
virtual bool SetGetMaterialParamVec3(const char* sParamName, Vec3& v, bool bGet, bool allowShaderParam = false, int materialIndex = 0) = 0;
|
||||
//! Set or get a material parameter value.
|
||||
//! \param sParamName - Name of the parameter
|
||||
//! \param v - Input or output value depending on bGet
|
||||
//! \param bGet - If true, v is an output; if false, v is an input
|
||||
//! \param allowShaderParam - If true, and sParamName is not a built-in parameter of the Material, then custom shader parameters will be searched as well. Defaults to false to preserve legacy behavior.
|
||||
//! \param materialIndex - Index of the sub-material if this is a material group
|
||||
//! return - True if sParamName was found
|
||||
virtual bool SetGetMaterialParamVec4(const char* sParamName, Vec4& v, bool bGet, bool allowShaderParam = false, int materialIndex = 0) = 0;
|
||||
|
||||
virtual void SetDirty(bool dirty = true) = 0;
|
||||
virtual bool IsDirty() const = 0;
|
||||
|
||||
//! Returns true if the material is the parent of a group of materials
|
||||
virtual bool IsMaterialGroup() const = 0;
|
||||
|
||||
//! Returns true if the material is a single material belongs to a material group
|
||||
virtual bool IsSubMaterial() const = 0;
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
|
||||
|
||||
virtual size_t GetResourceMemoryUsage(ICrySizer* pSizer) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Makes this specific material enter sketch mode.
|
||||
// Current supported sketch modes:
|
||||
// - 0, no sketch.
|
||||
// - 1, normal sketch mode.
|
||||
// - 2, fast sketch mode.
|
||||
virtual void SetSketchMode(int mode) = 0;
|
||||
|
||||
// Sets FT_DONT_STREAM flag for all textures used by the material
|
||||
// If a stream is already in process, this will stop the stream and flush the device texture
|
||||
virtual void DisableTextureStreaming() = 0;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Tells to texture streamer to start loading textures asynchronously
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
virtual void RequestTexturesLoading(const float fMipFactor) = 0;
|
||||
|
||||
virtual void PrecacheMaterial(const float fEntDistance, struct IRenderMesh* pRenderMesh, bool bFullUpdate, bool bDrawNear = false) = 0;
|
||||
|
||||
// Estimates texture memory usage for this material
|
||||
// When nMatID is not negative only caluclate for one sub-material
|
||||
virtual int GetTextureMemoryUsage(ICrySizer* pSizer, int nMatID = -1) = 0;
|
||||
|
||||
// Set & retrieve a material link name
|
||||
// This value by itself is not used by the material system per-se and hence
|
||||
// has no real effect, however it is used on a higher level to tie related materials
|
||||
// together, for example by procedural breakable glass to determine which material to
|
||||
// switch to.
|
||||
virtual void SetMaterialLinkName(const char* name) = 0;
|
||||
virtual const char* GetMaterialLinkName() const = 0;
|
||||
virtual void SetKeepLowResSysCopyForDiffTex() = 0;
|
||||
|
||||
virtual uint32 GetDccMaterialHash() const = 0;
|
||||
virtual void SetDccMaterialHash(uint32 hash) = 0;
|
||||
|
||||
virtual void UpdateShaderItems() = 0;
|
||||
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Description:
|
||||
// IMaterialManagerListener is a callback interface to listenen
|
||||
// for special events of material manager, (used by Editor).
|
||||
struct IMaterialManagerListener
|
||||
{
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IMaterialManagerListener(){}
|
||||
// Called when material manager tries to load a material.
|
||||
// nLoadingFlags - Zero or a bitwise combination of the flagas defined in ELoadingFlags.
|
||||
virtual void OnCreateMaterial(_smart_ptr<IMaterial> pMaterial) = 0;
|
||||
virtual void OnDeleteMaterial(_smart_ptr<IMaterial> pMaterial) = 0;
|
||||
virtual bool IsCurrentMaterial(_smart_ptr<IMaterial> pMaterial) const = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
using IMaterialRef = _smart_ptr<IMaterial>;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Description:
|
||||
// IMaterialManager interface provide access to the material manager
|
||||
// implemented in 3d engine.
|
||||
struct IMaterialManager
|
||||
{
|
||||
//! Loading flags
|
||||
enum ELoadingFlags
|
||||
{
|
||||
ELoadingFlagsPreviewMode = BIT(0),
|
||||
};
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IMaterialManager(){}
|
||||
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
|
||||
|
||||
// Summary:
|
||||
// Creates a new material object and register it with the material manager
|
||||
// Return Value:
|
||||
// A newly created object derived from IMaterial.
|
||||
virtual _smart_ptr<IMaterial> CreateMaterial(const char* sMtlName, int nMtlFlags = 0) = 0;
|
||||
|
||||
// Summary:
|
||||
// Renames a material object
|
||||
// Note:
|
||||
// Do not use IMaterial::SetName directly.
|
||||
// Arguments:
|
||||
// pMtl - Pointer to a material object
|
||||
// sNewName - New name to assign to the material
|
||||
virtual void RenameMaterial(_smart_ptr<IMaterial> pMtl, const char* sNewName) = 0;
|
||||
|
||||
// Description:
|
||||
// Finds named material.
|
||||
virtual _smart_ptr<IMaterial> FindMaterial(const char* sMtlName) const = 0;
|
||||
|
||||
// Description:
|
||||
// Loads material.
|
||||
// nLoadingFlags - Zero or a bitwise combination of the values defined in ELoadingFlags.
|
||||
virtual _smart_ptr<IMaterial> LoadMaterial(const char* sMtlName, bool bMakeIfNotFound = true, bool bNonremovable = false, unsigned long nLoadingFlags = 0) = 0;
|
||||
|
||||
// Description:
|
||||
// Loads material from xml.
|
||||
virtual _smart_ptr<IMaterial> LoadMaterialFromXml(const char* sMtlName, XmlNodeRef mtlNode) = 0;
|
||||
|
||||
// Description:
|
||||
// Reloads the material from disk.
|
||||
virtual void ReloadMaterial(_smart_ptr<IMaterial> pMtl) = 0;
|
||||
|
||||
// Description:
|
||||
// Saves material.
|
||||
virtual bool SaveMaterial(XmlNodeRef mtlNode, _smart_ptr<IMaterial> pMtl) = 0;
|
||||
|
||||
// Description:
|
||||
// Clone single material or multi sub material.
|
||||
// Arguments:
|
||||
// nSubMtl - when negative all sub materials of MultiSubMtl are cloned, if positive only specified slot is cloned.
|
||||
virtual _smart_ptr<IMaterial> CloneMaterial(_smart_ptr<IMaterial> pMtl, int nSubMtl = -1) = 0;
|
||||
|
||||
// Description:
|
||||
// Copy single material.
|
||||
virtual void CopyMaterial(_smart_ptr<IMaterial> pMtlSrc, _smart_ptr<IMaterial> pMtlDest, EMaterialCopyFlags flags) = 0;
|
||||
|
||||
// Description:
|
||||
// Clone MultiSubMtl material.
|
||||
// Arguments:
|
||||
// sSubMtlName - name of the sub-material to clone, if NULL all submaterial are cloned.
|
||||
virtual _smart_ptr<IMaterial> CloneMultiMaterial(_smart_ptr<IMaterial> pMtl, const char* sSubMtlName = 0) = 0;
|
||||
|
||||
// Description:
|
||||
// Associate a special listener callback with material manager inside 3d engine.
|
||||
// This listener callback is used primerly by the editor.
|
||||
virtual void SetListener(IMaterialManagerListener* pListener) = 0;
|
||||
|
||||
// Description:
|
||||
// Retrieve a default engine material.
|
||||
virtual _smart_ptr<IMaterial> GetDefaultMaterial() = 0;
|
||||
|
||||
// Description:
|
||||
// Retrieve a default engine material for terrain layer
|
||||
virtual _smart_ptr<IMaterial> GetDefaultTerrainLayerMaterial() = 0;
|
||||
|
||||
// Description:
|
||||
// Retrieve a default engine material with material layers presets.
|
||||
virtual _smart_ptr<IMaterial> GetDefaultLayersMaterial() = 0;
|
||||
|
||||
// Description:
|
||||
// Retrieve a default engine material for drawing helpers.
|
||||
virtual _smart_ptr<IMaterial> GetDefaultHelperMaterial() = 0;
|
||||
|
||||
// Description:
|
||||
// Retrieve surface type by name.
|
||||
virtual ISurfaceType* GetSurfaceTypeByName(const char* sSurfaceTypeName, const char* sWhy = NULL) = 0;
|
||||
virtual int GetSurfaceTypeIdByName(const char* sSurfaceTypeName, const char* sWhy = NULL) = 0;
|
||||
// Description:
|
||||
// Retrieve surface type by unique surface type id.
|
||||
virtual ISurfaceType* GetSurfaceType(int nSurfaceTypeId, const char* sWhy = NULL) = 0;
|
||||
// Description:
|
||||
// Retrieve interface to surface type manager.
|
||||
virtual ISurfaceTypeManager* GetSurfaceTypeManager() = 0;
|
||||
|
||||
// Get IMaterial pointer from the CGF material structure.
|
||||
// nLoadingFlags - Zero, or a bitwise combination of the enum items from ELoadingFlags.
|
||||
virtual _smart_ptr<IMaterial> LoadCGFMaterial(CMaterialCGF* pMaterialCGF, const char* sCgfFilename, unsigned long nLoadingFlags = 0) = 0;
|
||||
|
||||
// for statistics - call once to get the count (pData==0), again to get the data(pData!=0)
|
||||
virtual void GetLoadedMaterials(AZStd::vector<_smart_ptr<IMaterial>>* pData, uint32& nObjCount) const = 0;
|
||||
|
||||
// Updates material data in the renderer
|
||||
virtual void RefreshMaterialRuntime() = 0;
|
||||
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <AnimKey.h>
|
||||
#include <ISplines.h>
|
||||
#include <Cry_Camera.h>
|
||||
#include <VectorSet.h>
|
||||
|
||||
// forward declaration.
|
||||
struct IAnimTrack;
|
||||
|
||||
@@ -15,11 +15,12 @@ struct IAIPathAgent;
|
||||
|
||||
#include <INavigationSystem.h>
|
||||
#include <IMNM.h>
|
||||
#include <ISerialize.h>
|
||||
#include <SerializeFwd.h>
|
||||
#include <Cry_Geo.h>
|
||||
#include <LegacyAllocator.h>
|
||||
|
||||
#include <AzCore/std/functional.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <AzCore/std/smart_ptr/shared_ptr.h>
|
||||
#include <limits>
|
||||
|
||||
@@ -131,8 +132,7 @@ struct NavigationBlocker
|
||||
Location location;
|
||||
};
|
||||
|
||||
typedef DynArray<NavigationBlocker> NavigationBlockers;
|
||||
|
||||
using NavigationBlockers = AZStd::vector<NavigationBlocker, AZ::StdLegacyAllocator>;
|
||||
|
||||
//====================================================================
|
||||
// PathPointDescriptor
|
||||
@@ -240,8 +240,7 @@ struct PathfindingExtraConstraint
|
||||
UConstraint constraint;
|
||||
};
|
||||
|
||||
typedef DynArray<PathfindingExtraConstraint> PathfindingExtraConstraints;
|
||||
|
||||
using PathfindingExtraConstraints = AZStd::vector<PathfindingExtraConstraint, AZ::StdLegacyAllocator>;
|
||||
|
||||
struct PathfindRequest
|
||||
{
|
||||
@@ -557,26 +556,6 @@ public:
|
||||
virtual void Draw(const Vec3& drawOffset = ZERO) const = 0;
|
||||
virtual void Dump(const char* name) const = 0;
|
||||
|
||||
bool ArePathsEqual(const INavPath& otherNavPath)
|
||||
{
|
||||
const TPathPoints& path1 = this->GetPath();
|
||||
const TPathPoints& path2 = otherNavPath.GetPath();
|
||||
const TPathPoints::size_type path1Size = path1.size();
|
||||
const TPathPoints::size_type path2Size = path2.size();
|
||||
if (path1Size != path2Size)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
TPathPoints::const_iterator path1It = path1.begin();
|
||||
TPathPoints::const_iterator path1End = path1.end();
|
||||
TPathPoints::const_iterator path2It = path2.begin();
|
||||
|
||||
typedef std::pair<TPathPoints::const_iterator, TPathPoints::const_iterator> TMismatchResult;
|
||||
|
||||
TMismatchResult result = std::mismatch(path1It, path1End, path2It, PathPointDescriptor::ArePointsEquivalent);
|
||||
return result.first == path1.end();
|
||||
}
|
||||
};
|
||||
using INavPathPtr = AZStd::shared_ptr<INavPath>;
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <CrySizer.h>
|
||||
#include "Cry_Math.h"
|
||||
#include "primitives.h"
|
||||
#include <physinterface.h> // <> required for Interfuscator
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// IDs that can be used for foreign id.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
enum EPhysicsForeignIds
|
||||
{
|
||||
PHYS_FOREIGN_ID_TERRAIN = 0,
|
||||
PHYS_FOREIGN_ID_STATIC = 1,
|
||||
PHYS_FOREIGN_ID_ENTITY = 2,
|
||||
PHYS_FOREIGN_ID_FOLIAGE = 3,
|
||||
PHYS_FOREIGN_ID_ROPE = 4,
|
||||
PHYS_FOREIGN_ID_SOUND_OBSTRUCTION = 5,
|
||||
PHYS_FOREIGN_ID_SOUND_PROXY_OBSTRUCTION = 6,
|
||||
PHYS_FOREIGN_ID_SOUND_REVERB_OBSTRUCTION = 7,
|
||||
PHYS_FOREIGN_ID_WATERVOLUME = 8,
|
||||
PHYS_FOREIGN_ID_BREAKABLE_GLASS = 9,
|
||||
PHYS_FOREIGN_ID_BREAKABLE_GLASS_FRAGMENT = 10,
|
||||
PHYS_FOREIGN_ID_RIGID_PARTICLE = 11,
|
||||
PHYS_FOREIGN_ID_RESERVED1 = 12,
|
||||
PHYS_FOREIGN_ID_RAGDOLL = 13,
|
||||
PHYS_FOREIGN_ID_COMPONENT_ENTITY = 14,
|
||||
|
||||
PHYS_FOREIGN_ID_USER = 100, // All user defined foreign ids should start from this enum.
|
||||
};
|
||||
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/std/containers/variant.h>
|
||||
|
||||
typedef AZStd::variant<float, Vec4, AZStd::string> PostEffectGroupParam;
|
||||
|
||||
// A prioritized group of postprocessing effect parameters.
|
||||
// These are defined in XML files and can be enabled or disabled using flow graph or Lua scripts.
|
||||
// Effect groups can also optionally specify blend curves to smoothly transition between effects, whether to stay enabled until explicitly disabled,
|
||||
// and whether to make effect strength based on distance from the camera.
|
||||
class IPostEffectGroup
|
||||
{
|
||||
public:
|
||||
virtual ~IPostEffectGroup(){}
|
||||
|
||||
virtual const char* GetName() const = 0;
|
||||
virtual void SetEnable(bool enable) = 0;
|
||||
virtual bool GetEnable() const = 0;
|
||||
virtual unsigned int GetPriority() const = 0;
|
||||
virtual bool GetHold() const = 0;
|
||||
virtual float GetFadeDistance() const = 0;
|
||||
virtual void SetParam(const char* name, const PostEffectGroupParam& value) = 0;
|
||||
virtual PostEffectGroupParam* GetParam(const char* name) = 0;
|
||||
virtual void ClearParams() = 0;
|
||||
// Increases the strength of the effects based on distance from the camera each time it's called. The effect strength is cleared each frame.
|
||||
// Only applies to effect groups with the fadeDistance attribute set.
|
||||
virtual void ApplyAtPosition(const Vec3& position) = 0;
|
||||
};
|
||||
|
||||
typedef AZStd::list<IPostEffectGroup*> PostEffectGroupList;
|
||||
|
||||
class IPostEffectGroupManager
|
||||
{
|
||||
public:
|
||||
virtual ~IPostEffectGroupManager(){}
|
||||
|
||||
virtual IPostEffectGroup* GetGroup(const char* name) = 0;
|
||||
virtual IPostEffectGroup* GetGroup(const unsigned int index) = 0;
|
||||
virtual const unsigned int GetGroupCount() = 0;
|
||||
// Returns a list of IPostEffectGroups who had their Enabled state toggled this frame
|
||||
virtual const PostEffectGroupList& GetGroupsToggledThisFrame() = 0;
|
||||
};
|
||||
@@ -1,282 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_IRENDERMESH_H
|
||||
#define CRYINCLUDE_CRYCOMMON_IRENDERMESH_H
|
||||
#pragma once
|
||||
|
||||
#include "VertexFormats.h"
|
||||
#include <IMaterial.h>
|
||||
#include <IRenderer.h> // PublicRenderPrimitiveType
|
||||
#include <Cry_Geo.h>
|
||||
#include <CryArray.h>
|
||||
#include <ITimer.h>
|
||||
|
||||
class CMesh;
|
||||
class CRenderObject;
|
||||
struct SSkinningData;
|
||||
struct IMaterial;
|
||||
struct IIndexedMesh;
|
||||
struct SMRendTexVert;
|
||||
struct UCol;
|
||||
struct GeomInfo;
|
||||
|
||||
struct TFace;
|
||||
struct SMeshSubset;
|
||||
struct SRenderingPassInfo;
|
||||
struct SRendItemSorter;
|
||||
struct SRenderObjectModifier;
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Vertex
|
||||
{
|
||||
class Format;
|
||||
}
|
||||
}
|
||||
|
||||
enum eRenderPrimitiveType : int8;
|
||||
|
||||
// Keep this in sync with BUFFER_USAGE hints DevBuffer.h
|
||||
enum ERenderMeshType
|
||||
{
|
||||
eRMT_Immmutable = 0,
|
||||
eRMT_Static = 1,
|
||||
eRMT_Dynamic = 2,
|
||||
eRMT_Transient = 3,
|
||||
};
|
||||
|
||||
|
||||
#define FSM_VERTEX_VELOCITY 1
|
||||
#define FSM_NO_TANGENTS 2
|
||||
#define FSM_CREATE_DEVICE_MESH 4
|
||||
#define FSM_SETMESH_ASYNC 8
|
||||
#define FSM_ENABLE_NORMALSTREAM 16
|
||||
#define FSM_IGNORE_TEXELDENSITY 32
|
||||
|
||||
// Invalidate video buffer flags
|
||||
#define FMINV_STREAM 1
|
||||
#define FMINV_STREAM_MASK ((1 << VSF_NUM) - 1)
|
||||
#define FMINV_INDICES 0x100
|
||||
#define FMINV_ALL -1
|
||||
|
||||
// Stream lock flags
|
||||
#define FSL_READ 0x01
|
||||
#define FSL_WRITE 0x02
|
||||
#define FSL_DYNAMIC 0x04
|
||||
#define FSL_DISCARD 0x08
|
||||
#define FSL_VIDEO 0x10
|
||||
#define FSL_SYSTEM 0x20
|
||||
#define FSL_INSTANCED 0x40
|
||||
#define FSL_NONSTALL_MAP 0x80 // Map must not stall for VB/IB locking
|
||||
#define FSL_VBIBPUSHDOWN 0x100 // Push down from vram on demand if target architecture supports it, used internally
|
||||
#define FSL_DIRECT 0x200 // Access VRAM directly if target architecture supports it, used internally
|
||||
#define FSL_LOCKED 0x400 // Internal use
|
||||
#define FSL_SYSTEM_CREATE (FSL_WRITE | FSL_DISCARD | FSL_SYSTEM)
|
||||
#define FSL_SYSTEM_UPDATE (FSL_WRITE | FSL_SYSTEM)
|
||||
#define FSL_VIDEO_CREATE (FSL_WRITE | FSL_DISCARD | FSL_VIDEO)
|
||||
#define FSL_VIDEO_UPDATE (FSL_WRITE | FSL_VIDEO)
|
||||
|
||||
#define FSL_ASYNC_DEFER_COPY (1u << 1)
|
||||
#define FSL_FREE_AFTER_ASYNC (2u << 1)
|
||||
|
||||
struct IRenderMesh
|
||||
{
|
||||
enum EMemoryUsageArgument
|
||||
{
|
||||
MEM_USAGE_COMBINED,
|
||||
MEM_USAGE_ONLY_SYSTEM,
|
||||
MEM_USAGE_ONLY_VIDEO,
|
||||
MEM_USAGE_ONLY_STREAMS,
|
||||
};
|
||||
|
||||
// Render mesh initialization parameters, that can be used to create RenderMesh from raw pointers.
|
||||
struct SInitParamerers
|
||||
{
|
||||
AZ::Vertex::Format vertexFormat;
|
||||
ERenderMeshType eType;
|
||||
|
||||
void* pVertBuffer;
|
||||
int nVertexCount;
|
||||
SPipTangents* pTangents;
|
||||
SPipNormal* pNormals;
|
||||
vtx_idx* pIndices;
|
||||
int nIndexCount;
|
||||
PublicRenderPrimitiveType nPrimetiveType;
|
||||
int nRenderChunkCount;
|
||||
int nClientTextureBindID;
|
||||
bool bOnlyVideoBuffer;
|
||||
bool bPrecache;
|
||||
bool bLockForThreadAccess;
|
||||
|
||||
SInitParamerers()
|
||||
: vertexFormat(eVF_P3F_C4B_T2F)
|
||||
, eType(eRMT_Static)
|
||||
, pVertBuffer(0)
|
||||
, nVertexCount(0)
|
||||
, pTangents(0)
|
||||
, pNormals(0)
|
||||
, pIndices(0)
|
||||
, nIndexCount(0)
|
||||
, nPrimetiveType(PublicRenderPrimitiveType::prtTriangleList)
|
||||
, nRenderChunkCount(0)
|
||||
, nClientTextureBindID(0)
|
||||
, bOnlyVideoBuffer(false)
|
||||
, bPrecache(true)
|
||||
, bLockForThreadAccess(false) {}
|
||||
};
|
||||
|
||||
struct ThreadAccessLock
|
||||
{
|
||||
ThreadAccessLock(IRenderMesh* pRM)
|
||||
: m_pRM(pRM)
|
||||
{
|
||||
m_pRM->LockForThreadAccess();
|
||||
}
|
||||
|
||||
~ThreadAccessLock()
|
||||
{
|
||||
m_pRM->UnLockForThreadAccess();
|
||||
}
|
||||
|
||||
private:
|
||||
ThreadAccessLock(const ThreadAccessLock&);
|
||||
ThreadAccessLock& operator = (const ThreadAccessLock&);
|
||||
|
||||
private:
|
||||
IRenderMesh* m_pRM;
|
||||
};
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IRenderMesh(){}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Reference Counting.
|
||||
virtual void AddRef() = 0;
|
||||
virtual int Release() = 0;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Prevent rendering if video memory could not been allocated for it
|
||||
virtual bool CanRender() = 0;
|
||||
|
||||
// Returns type name given to the render mesh on creation time.
|
||||
virtual const char* GetTypeName() = 0;
|
||||
// Returns the name of the source given to the render mesh on creation time.
|
||||
virtual const char* GetSourceName() const = 0;
|
||||
|
||||
virtual int GetIndicesCount() = 0;
|
||||
virtual int GetVerticesCount() = 0;
|
||||
virtual AZ::Vertex::Format GetVertexFormat() = 0;
|
||||
virtual ERenderMeshType GetMeshType() = 0;
|
||||
virtual float GetGeometricMeanFaceArea() const = 0;
|
||||
|
||||
virtual bool CheckUpdate(uint32 nStreamMask) = 0;
|
||||
virtual int GetStreamStride(int nStream) const = 0;
|
||||
|
||||
virtual int GetNumVerts() const = 0;
|
||||
virtual int GetNumInds() const = 0;
|
||||
virtual const eRenderPrimitiveType GetPrimitiveType() const = 0;
|
||||
|
||||
virtual void SetSkinned(bool bSkinned = true) = 0;
|
||||
virtual uint GetSkinningWeightCount() const = 0;
|
||||
|
||||
// Create render buffers from render mesh. Returns the final size of the render mesh or ~0U on failure
|
||||
virtual size_t SetMesh(CMesh& mesh, int nSecColorsSetOffset, uint32 flags, bool requiresLock) = 0;
|
||||
virtual void CopyTo(IRenderMesh* pDst, int nAppendVtx = 0, bool bDynamic = false, bool fullCopy = true) = 0;
|
||||
virtual void SetSkinningDataVegetation(struct SMeshBoneMapping_uint8* pBoneMapping) = 0;
|
||||
virtual void SetSkinningDataCharacter(CMesh& mesh, struct SMeshBoneMapping_uint16* pBoneMapping, struct SMeshBoneMapping_uint16* pExtraBoneMapping) = 0;
|
||||
// Creates an indexed mesh from this render mesh (accepts an optional pointer to an IIndexedMesh object that should be used)
|
||||
virtual IIndexedMesh* GetIndexedMesh(IIndexedMesh* pIdxMesh = 0) = 0;
|
||||
virtual int GetRenderChunksCount(_smart_ptr<IMaterial> pMat, int& nRenderTrisCount) = 0;
|
||||
|
||||
virtual IRenderMesh* GenerateMorphWeights() = 0;
|
||||
virtual IRenderMesh* GetMorphBuddy() = 0;
|
||||
virtual void SetMorphBuddy(IRenderMesh* pMorph) = 0;
|
||||
|
||||
virtual bool UpdateVertices(const void* pVertBuffer, int nVertCount, int nOffset, int nStream, uint32 copyFlags, bool requiresLock = true) = 0;
|
||||
virtual bool UpdateIndices(const vtx_idx* pNewInds, int nInds, int nOffsInd, uint32 copyFlags, bool requiresLock = true) = 0;
|
||||
virtual void SetCustomTexID(int nCustomTID) = 0;
|
||||
|
||||
virtual void GenerateQTangents() = 0;
|
||||
virtual void CreateChunksSkinned() = 0;
|
||||
virtual void NextDrawSkinned() = 0;
|
||||
virtual IRenderMesh* GetVertexContainer() = 0;
|
||||
virtual void SetVertexContainer(IRenderMesh* pBuf) = 0;
|
||||
virtual void SetBBox(const Vec3& vBoxMin, const Vec3& vBoxMax) = 0;
|
||||
virtual void GetBBox(Vec3& vBoxMin, Vec3& vBoxMax) = 0;
|
||||
virtual void UpdateBBoxFromMesh() = 0;
|
||||
virtual uint32* GetPhysVertexMap() = 0;
|
||||
virtual bool IsEmpty() = 0;
|
||||
|
||||
virtual int8* GetPosPtrNoCache(int32& nStride, uint32 nFlags) = 0;
|
||||
virtual int8* GetPosPtr(int32& nStride, uint32 nFlags) = 0;
|
||||
virtual int8* GetColorPtr(int32& nStride, uint32 nFlags) = 0;
|
||||
virtual int8* GetNormPtr(int32& nStride, uint32 nFlags) = 0;
|
||||
//! Returns a pointer to the first uv coordinate in the interleaved vertex stream
|
||||
virtual int8* GetUVPtrNoCache(int32& nStride, uint32 nFlags, uint32 uvSetIndex = 0) = 0;
|
||||
/*! Get a pointer to the mesh's uv coordinates and the stride from the beginning of one uv coordinate to the next
|
||||
\param[out] nStride The stride in between successive uv coordinates.
|
||||
\param nFlags Stream lock flags (FSL_READ, FSL_WRITE, etc)
|
||||
\param uvSetIndex Which uv set to retrieve (defaults to 0)
|
||||
\return A pointer to cached uvs which contains all of the uv coordinates contiguous in memory, or as a fallback a pointer to the first uv coordinate in the interleaved vertex stream
|
||||
Either way, nStride is set such that the caller can use it to iterate over the data in the same way regardless of which pointer was returned
|
||||
Returns nullptr if there is no uv coordinate stream at the given index
|
||||
*/
|
||||
virtual int8* GetUVPtr(int32& nStride, uint32 nFlags, uint32 uvSetIndex = 0) = 0;
|
||||
|
||||
virtual int8* GetTangentPtr(int32& nStride, uint32 nFlags) = 0;
|
||||
virtual int8* GetQTangentPtr(int32& nStride, uint32 nFlags) = 0;
|
||||
|
||||
virtual int8* GetHWSkinPtr(int32& nStride, uint32 nFlags, bool remapped = false) = 0;
|
||||
virtual int8* GetVelocityPtr(int32& nStride, uint32 nFlags) = 0;
|
||||
|
||||
virtual void UnlockStream(int nStream) = 0;
|
||||
virtual void UnlockIndexStream() = 0;
|
||||
|
||||
virtual vtx_idx* GetIndexPtr(uint32 nFlags, int32 nOffset = 0) = 0;
|
||||
virtual const PodArray<std::pair<int, int> >* GetTrisForPosition(const Vec3& vPos, _smart_ptr<IMaterial> pMaterial) = 0;
|
||||
|
||||
virtual float GetExtent(EGeomForm eForm) = 0;
|
||||
virtual void GetRandomPos(PosNorm& ran, EGeomForm eForm, SSkinningData const* pSkinning = NULL) = 0;
|
||||
|
||||
virtual void Render(const struct SRendParams& rParams, CRenderObject* pObj, _smart_ptr<IMaterial> pMaterial, const SRenderingPassInfo& passInfo, bool bSkinned = false) = 0;
|
||||
virtual void Render(CRenderObject* pObj, const SRenderingPassInfo& passInfo, const SRendItemSorter& rendItemSorter) = 0;
|
||||
virtual void SetREUserData(float* pfCustomData, float fFogScale = 0, float fAlpha = 1) = 0;
|
||||
|
||||
// Debug draw this render mesh.
|
||||
virtual void DebugDraw(const struct SGeometryDebugDrawInfo& info, uint32 nVisibleChunksMask = ~0, float fExtrdueScale = 0.01f) = 0;
|
||||
|
||||
// Returns mesh memory usage and add it to the CrySizer (if not NULL).
|
||||
// Arguments:
|
||||
// pSizer - Sizer interface, can be NULL if caller only want to calculate size
|
||||
// nType - see EMemoryUsageArgument
|
||||
virtual size_t GetMemoryUsage(ICrySizer* pSizer, EMemoryUsageArgument nType) const = 0;
|
||||
virtual void GetMemoryUsage(ICrySizer* pSizer) const = 0;
|
||||
|
||||
// Get allocated only in video memory or only in system memory.
|
||||
virtual int GetAllocatedBytes(bool bVideoMem) const = 0;
|
||||
virtual float GetAverageTrisNumPerChunk(_smart_ptr<IMaterial> pMat) = 0;
|
||||
virtual int GetTextureMemoryUsage(const _smart_ptr<IMaterial> pMaterial, ICrySizer* pSizer = NULL, bool bStreamedIn = true) const = 0;
|
||||
virtual void KeepSysMesh(bool keep) = 0; // HACK: temp workaround for GDC-888
|
||||
virtual void UnKeepSysMesh() = 0;
|
||||
virtual void SetMeshLod(int nLod) = 0;
|
||||
|
||||
virtual void LockForThreadAccess() = 0;
|
||||
virtual void UnLockForThreadAccess() = 0;
|
||||
|
||||
// Sets the async update state - will sync before rendering to this
|
||||
virtual volatile int* SetAsyncUpdateState(void) = 0;
|
||||
virtual void CreateRemappedBoneIndicesPair(const DynArray<JointIdType>& arrRemapTable, const uint pairGuid) = 0;
|
||||
virtual void ReleaseRemappedBoneIndicesPair(const uint pairGuid) = 0;
|
||||
|
||||
virtual void OffsetPosition(const Vec3& delta) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_IRENDERMESH_H
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <Cry_Math.h>
|
||||
#include <IXml.h>
|
||||
#include "MiniQueue.h"
|
||||
#include <VectorSet.h>
|
||||
#include <VectorMap.h>
|
||||
#include <StlUtils.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
@@ -105,8 +104,6 @@ struct SNetObjectID
|
||||
}
|
||||
|
||||
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const { /*nothing*/}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
// this enumeration details what "kind" of serialization we are
|
||||
@@ -154,8 +151,6 @@ private:
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
struct SSerializeString
|
||||
{
|
||||
AUTO_STRUCT_INFO
|
||||
|
||||
SSerializeString() {};
|
||||
SSerializeString(const SSerializeString& src) { m_str.assign(src.c_str()); };
|
||||
explicit SSerializeString(const char* sbegin, const char* send)
|
||||
@@ -571,8 +566,6 @@ public:
|
||||
CONTAINER_VALUE(std::list, push_back);
|
||||
CONTAINER_VALUE(std::set, insert);
|
||||
CONTAINER_VALUE(std::deque, push_back);
|
||||
CONTAINER_VALUE(VectorSet, insert);
|
||||
CONTAINER_VALUE(DynArray, insert);
|
||||
|
||||
PAIR_CONTAINER_VALUE(std::list, push_back);
|
||||
PAIR_CONTAINER_VALUE(std::vector, push_back);
|
||||
|
||||
+2
-1202
File diff suppressed because it is too large
Load Diff
@@ -12,6 +12,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <IXml.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __ISTEREORENDERER_H__
|
||||
#define __ISTEREORENDERER_H__
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "StereoRendererBus.h"
|
||||
|
||||
enum EStereoEye
|
||||
{
|
||||
STEREO_EYE_LEFT = 0,
|
||||
STEREO_EYE_RIGHT = 1,
|
||||
STEREO_EYE_COUNT
|
||||
};
|
||||
|
||||
enum EStereoDevice
|
||||
{
|
||||
STEREO_DEVICE_NONE = 0,
|
||||
STEREO_DEVICE_FRAMECOMP = 1,
|
||||
STEREO_DEVICE_HDMI = 2,
|
||||
STEREO_DEVICE_DRIVER = 3, //!< Nvidia and AMD drivers.
|
||||
STEREO_DEVICE_DUALHEAD = 4,
|
||||
STEREO_DEVICE_COUNT,
|
||||
|
||||
STEREO_DEVICE_DEFAULT = 100 //!< Auto-detect device.
|
||||
};
|
||||
|
||||
enum EStereoMode
|
||||
{
|
||||
STEREO_MODE_NO_STEREO = 0, //!< Stereo disabled.
|
||||
STEREO_MODE_DUAL_RENDERING = 1,
|
||||
STEREO_MODE_COUNT,
|
||||
};
|
||||
|
||||
enum EStereoOutput
|
||||
{
|
||||
STEREO_OUTPUT_STANDARD = 0,
|
||||
STEREO_OUTPUT_IZ3D = 1,
|
||||
STEREO_OUTPUT_CHECKERBOARD = 2,
|
||||
STEREO_OUTPUT_ABOVE_AND_BELOW = 3,
|
||||
STEREO_OUTPUT_SIDE_BY_SIDE = 4,
|
||||
STEREO_OUTPUT_LINE_BY_LINE = 5,
|
||||
STEREO_OUTPUT_ANAGLYPH = 6,
|
||||
STEREO_OUTPUT_HMD = 7,
|
||||
STEREO_OUTPUT_COUNT,
|
||||
};
|
||||
|
||||
enum EStereoDeviceState
|
||||
{
|
||||
STEREO_DEVSTATE_OK = 0,
|
||||
STEREO_DEVSTATE_UNSUPPORTED_DEVICE,
|
||||
STEREO_DEVSTATE_REQ_1080P,
|
||||
STEREO_DEVSTATE_REQ_FRAMEPACKED,
|
||||
STEREO_DEVSTATE_BAD_DRIVER,
|
||||
STEREO_DEVSTATE_REQ_FULLSCREEN
|
||||
};
|
||||
|
||||
class IStereoRenderer
|
||||
: public AZ::StereoRendererRequestBus::Handler
|
||||
{
|
||||
public:
|
||||
enum EHmdRender
|
||||
{
|
||||
eHR_Eyes = 0,
|
||||
eHR_Latency
|
||||
};
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IStereoRenderer(){}
|
||||
|
||||
virtual EStereoDevice GetDevice() = 0;
|
||||
virtual EStereoDeviceState GetDeviceState() = 0;
|
||||
virtual void GetInfo(EStereoDevice* device, EStereoMode* mode, EStereoOutput* output, EStereoDeviceState* state) const = 0;
|
||||
|
||||
virtual bool GetStereoEnabled() = 0;
|
||||
virtual float GetStereoStrength() = 0;
|
||||
virtual float GetMaxSeparationScene(bool half = true) = 0;
|
||||
virtual float GetZeroParallaxPlaneDist() = 0;
|
||||
|
||||
virtual void OnHmdDeviceChanged() = 0;
|
||||
|
||||
virtual void OnResolutionChanged() {}
|
||||
|
||||
virtual void GetNVControlValues(bool& stereoEnabled, float& stereoStrength) = 0;
|
||||
// </interfuscator:shuffle>
|
||||
|
||||
enum class Status
|
||||
{
|
||||
kRenderingFirstEye,
|
||||
kRenderingSecondEye,
|
||||
kIdle ///< Not currently rendering to either eye.
|
||||
};
|
||||
|
||||
virtual Status GetStatus() const = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1095,57 +1095,6 @@ struct ISystem
|
||||
using CrySystemNotificationBus = AZ::EBus<CrySystemNotifications>;
|
||||
};
|
||||
|
||||
#if defined(USE_DISK_PROFILER)
|
||||
|
||||
struct DiskOperationInfo
|
||||
{
|
||||
DiskOperationInfo()
|
||||
: m_nSeeksCount(0)
|
||||
, m_nFileOpenCount(0)
|
||||
, m_nFileReadCount(0)
|
||||
, m_dOperationSize(0.)
|
||||
, m_dOperationTime(0.) {}
|
||||
int m_nSeeksCount;
|
||||
int m_nFileOpenCount;
|
||||
int m_nFileReadCount;
|
||||
double m_dOperationTime;
|
||||
double m_dOperationSize;
|
||||
|
||||
DiskOperationInfo& operator -= (const DiskOperationInfo& rv)
|
||||
{
|
||||
m_nSeeksCount -= rv.m_nSeeksCount;
|
||||
m_nFileOpenCount -= rv.m_nFileOpenCount;
|
||||
m_nFileReadCount -= rv.m_nFileReadCount;
|
||||
m_dOperationSize -= rv.m_dOperationSize;
|
||||
m_dOperationTime -= rv.m_dOperationTime;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DiskOperationInfo& operator += (const DiskOperationInfo& rv)
|
||||
{
|
||||
m_nSeeksCount += rv.m_nSeeksCount;
|
||||
m_nFileOpenCount += rv.m_nFileOpenCount;
|
||||
m_nFileReadCount += rv.m_nFileReadCount;
|
||||
m_dOperationSize += rv.m_dOperationSize;
|
||||
m_dOperationTime += rv.m_dOperationTime;
|
||||
return *this;
|
||||
}
|
||||
|
||||
DiskOperationInfo operator - (const DiskOperationInfo& rv)
|
||||
{
|
||||
DiskOperationInfo res(*this);
|
||||
return res -= rv;
|
||||
}
|
||||
|
||||
DiskOperationInfo operator + (const DiskOperationInfo& rv)
|
||||
{
|
||||
DiskOperationInfo res(*this);
|
||||
return res += rv;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// CrySystem DLL Exports.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -1365,9 +1314,6 @@ namespace Detail
|
||||
bool IsConstCVar() const { return true; }
|
||||
void SetOnChangeCallback(ConsoleVarFunc pChangeFunc) { (void)pChangeFunc; }
|
||||
uint64 AddOnChangeFunctor(const SFunctor& pChangeFunctor) { (void)pChangeFunctor; return 0; }
|
||||
uint64 GetNumberOfOnChangeFunctors() const { return 0; }
|
||||
const SFunctor& GetOnChangeFunctor([[maybe_unused]] uint64 nFunctorIndex) const { InvalidAccess(); SFunctor* pNull = nullptr; return *pNull; }
|
||||
bool RemoveOnChangeFunctor([[maybe_unused]] const uint64 nElement) { return true; }
|
||||
ConsoleVarFunc GetOnChangeCallback() const { InvalidAccess(); return NULL; }
|
||||
void GetMemoryUsage([[maybe_unused]] class ICrySizer* pSizer) const {}
|
||||
int GetRealIVal() const { return GetIVal(); }
|
||||
|
||||
@@ -5,60 +5,12 @@
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_ITEXTURE_H
|
||||
#define CRYINCLUDE_CRYCOMMON_ITEXTURE_H
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/PlatformDef.h>
|
||||
|
||||
#include "Cry_Math.h"
|
||||
#include "Cry_Color.h"
|
||||
#include "Tarray.h"
|
||||
#include <smartptr.h>
|
||||
class CTexture;
|
||||
|
||||
#ifndef COMPILER_SUPPORTS_ENUM_SPECIFICATION
|
||||
# if defined(_MSC_VER)
|
||||
# define COMPILER_SUPPORTS_ENUM_SPECIFICATION 1
|
||||
# else
|
||||
# define COMPILER_SUPPORTS_ENUM_SPECIFICATION 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if COMPILER_SUPPORTS_ENUM_SPECIFICATION
|
||||
enum ETEX_Type : uint8
|
||||
#else
|
||||
typedef uint8 ETEX_Type;
|
||||
enum eTEX_Type
|
||||
#endif
|
||||
{
|
||||
eTT_1D = 0,
|
||||
eTT_2D,
|
||||
eTT_3D,
|
||||
eTT_Cube,
|
||||
eTT_CubeArray,
|
||||
eTT_Dyn2D,
|
||||
eTT_User,
|
||||
eTT_NearestCube,
|
||||
|
||||
eTT_2DArray,
|
||||
eTT_2DMS,
|
||||
|
||||
eTT_Auto2D,
|
||||
|
||||
eTT_MaxTexType, // not used
|
||||
};
|
||||
|
||||
#include <AzCore/base.h>
|
||||
|
||||
// Texture formats
|
||||
#if COMPILER_SUPPORTS_ENUM_SPECIFICATION
|
||||
enum ETEX_Format : uint8
|
||||
#else
|
||||
typedef uint8 ETEX_Format;
|
||||
enum eTEX_Format
|
||||
#endif
|
||||
enum ETEX_Format : AZ::u8
|
||||
{
|
||||
eTF_Unknown = 0,
|
||||
eTF_R8G8B8A8S,
|
||||
@@ -147,277 +99,20 @@ enum eTEX_Format
|
||||
eTF_MaxFormat // unused, must be always the last in the list
|
||||
};
|
||||
|
||||
#if COMPILER_SUPPORTS_ENUM_SPECIFICATION
|
||||
enum ETEX_TileMode : uint8
|
||||
#else
|
||||
typedef uint8 ETEX_TileMode;
|
||||
enum eTEX_TileMode
|
||||
#endif
|
||||
{
|
||||
eTM_None = 0,
|
||||
eTM_LinearPadded,
|
||||
eTM_Optimal,
|
||||
};
|
||||
|
||||
|
||||
enum ETextureFlags
|
||||
{
|
||||
FT_NOMIPS = 0x00000001,
|
||||
FT_TEX_NORMAL_MAP = 0x00000002,
|
||||
FT_TEX_WAS_NOT_PRE_TILED = 0x00000004,
|
||||
FT_USAGE_DEPTHSTENCIL = 0x00000008,
|
||||
FT_USAGE_ALLOWREADSRGB = 0x00000010,
|
||||
FT_FILESINGLE = 0x00000020, // suppress loading of additional files like _DDNDIF (faster, RC can tag the file for that)
|
||||
FT_TEX_FONT = 0x00000040,
|
||||
FT_HAS_ATTACHED_ALPHA = 0x00000080,
|
||||
FT_USAGE_UNORDERED_ACCESS = 0x00000100,
|
||||
FT_USAGE_READBACK = 0x00000200,
|
||||
FT_USAGE_MSAA = 0x00000400,
|
||||
FT_FORCE_MIPS = 0x00000800,
|
||||
FT_USAGE_RENDERTARGET = 0x00001000,
|
||||
FT_USAGE_DYNAMIC = 0x00002000,
|
||||
FT_STAGE_READBACK = 0x00004000,
|
||||
FT_STAGE_UPLOAD = 0x00008000,
|
||||
FT_DONT_RELEASE = 0x00010000,
|
||||
FT_ASYNC_PREPARE = 0x00020000,
|
||||
FT_DONT_STREAM = 0x00040000,
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#include AZ_RESTRICTED_FILE(ITexture_h)
|
||||
#endif
|
||||
|
||||
#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
|
||||
#undef AZ_RESTRICTED_SECTION_IMPLEMENTED
|
||||
#else
|
||||
#if defined(AZ_PLATFORM_IOS)
|
||||
FT_USAGE_MEMORYLESS = 0x00080000, //reusing an unused bit for ios
|
||||
#else
|
||||
FT_USAGE_PREDICATED_TILING = 0x00080000, //unused
|
||||
#endif
|
||||
#endif
|
||||
FT_FAILED = 0x00100000,
|
||||
FT_FROMIMAGE = 0x00200000,
|
||||
FT_STATE_CLAMP = 0x00400000,
|
||||
FT_USAGE_ATLAS = 0x00800000,
|
||||
FT_ALPHA = 0x01000000,
|
||||
FT_REPLICATE_TO_ALL_SIDES = 0x02000000,
|
||||
FT_KEEP_LOWRES_SYSCOPY = 0x04000000, // keep low res copy in system memory for voxelization on CPU
|
||||
FT_SPLITTED = 0x08000000, // for split dds files
|
||||
FT_USE_HTILE = 0x10000000,
|
||||
FT_IGNORE_PRECACHE = 0x20000000,
|
||||
FT_COMPOSITE = 0x40000000,
|
||||
FT_USAGE_UAV_RWTEXTURE = 0x80000000,
|
||||
};
|
||||
|
||||
struct SDepthTexture;
|
||||
|
||||
struct STextureStreamingStats
|
||||
{
|
||||
STextureStreamingStats(bool bComputeTexturesPerFrame)
|
||||
: bComputeReuquiredTexturesPerFrame(bComputeTexturesPerFrame)
|
||||
{
|
||||
nMaxPoolSize = 0;
|
||||
nCurrentPoolSize = 0;
|
||||
nStreamedTexturesSize = 0;
|
||||
nStaticTexturesSize = 0;
|
||||
nThroughput = 0;
|
||||
nNumTexturesPerFrame = 0;
|
||||
nRequiredStreamedTexturesSize = 0;
|
||||
nRequiredStreamedTexturesCount = 0;
|
||||
bPoolOverflow = false;
|
||||
bPoolOverflowTotally = false;
|
||||
fPoolFragmentation = 0.0f;
|
||||
}
|
||||
size_t nMaxPoolSize;
|
||||
size_t nCurrentPoolSize;
|
||||
size_t nStreamedTexturesSize;
|
||||
size_t nStaticTexturesSize;
|
||||
uint32 nNumTexturesPerFrame;
|
||||
size_t nThroughput;
|
||||
size_t nRequiredStreamedTexturesSize;
|
||||
uint32 nRequiredStreamedTexturesCount;
|
||||
float fPoolFragmentation;
|
||||
uint32 bPoolOverflow : 1;
|
||||
uint32 bPoolOverflowTotally : 1;
|
||||
const bool bComputeReuquiredTexturesPerFrame;
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Texture object interface
|
||||
class CDeviceTexture;
|
||||
class ITexture
|
||||
{
|
||||
protected:
|
||||
virtual ~ITexture() {}
|
||||
public:
|
||||
|
||||
// <interfuscator:shuffle>
|
||||
virtual int AddRef() = 0;
|
||||
virtual int Release() = 0;
|
||||
virtual int ReleaseForce() = 0;
|
||||
|
||||
virtual const ColorF& GetClearColor() const = 0;
|
||||
virtual const ETEX_Format GetDstFormat() const = 0;
|
||||
virtual const ETEX_Format GetSrcFormat() const = 0;
|
||||
virtual const ETEX_Type GetTexType() const = 0;
|
||||
virtual void ApplyTexture(int nTUnit, int nState = -1) = 0;
|
||||
virtual const char* GetName() const = 0;
|
||||
virtual const int GetWidth() const = 0;
|
||||
virtual const int GetHeight() const = 0;
|
||||
virtual const int GetDepth() const = 0;
|
||||
virtual const int GetTextureID() const = 0;
|
||||
virtual const uint32 GetFlags() const = 0;
|
||||
virtual const int GetNumMips() const = 0;
|
||||
virtual const int GetRequiredMip() const = 0;
|
||||
virtual const int GetDeviceDataSize() const = 0;
|
||||
virtual const int GetDataSize() const = 0;
|
||||
virtual const ETEX_Type GetTextureType() const = 0;
|
||||
// Sets the texture type of the texture to be used before the texture is loaded.
|
||||
// Once the texture is loaded the type from the file will overwrite whatever
|
||||
// value was set here.
|
||||
virtual void SetTextureType(ETEX_Type type) = 0;
|
||||
virtual const bool IsTextureLoaded() const = 0;
|
||||
virtual void PrecacheAsynchronously(float fMipFactor, int nFlags, int nUpdateId, int nCounter = 1) = 0;
|
||||
virtual uint8* GetData32(int nSide = 0, int nLevel = 0, uint8* pDst = NULL, ETEX_Format eDstFormat = eTF_R8G8B8A8) = 0;
|
||||
virtual bool SetFilter(int nFilter) = 0; // FILTER_ flags
|
||||
virtual void SetClamp(bool bEnable) = 0; // Texture addressing set
|
||||
virtual float GetAvgBrightness() const = 0;
|
||||
|
||||
virtual int StreamCalculateMipsSigned(float fMipFactor) const = 0;
|
||||
virtual int GetStreamableMipNumber() const = 0;
|
||||
virtual int GetStreamableMemoryUsage(int nStartMip) const = 0;
|
||||
virtual int GetMinLoadedMip() const = 0;
|
||||
|
||||
using StagingHook = AZStd::function<bool(void*, uint32, uint32)>;
|
||||
virtual void Readback(AZ::u32 subresourceIndex, StagingHook callback) = 0;
|
||||
|
||||
virtual bool Reload() = 0;
|
||||
// Used for debugging/profiling.
|
||||
virtual const char* GetFormatName() const = 0;
|
||||
virtual const char* GetTypeName() const = 0;
|
||||
virtual const bool IsStreamedVirtual() const = 0;
|
||||
virtual const bool IsShared() const = 0;
|
||||
virtual const bool IsStreamable() const = 0;
|
||||
virtual bool IsStreamedIn(const int nMinPrecacheRoundIds[2]) const = 0;
|
||||
virtual const int GetAccessFrameId() const = 0;
|
||||
|
||||
virtual const ETEX_Format GetTextureDstFormat() const = 0;
|
||||
virtual const ETEX_Format GetTextureSrcFormat() const = 0;
|
||||
|
||||
virtual bool IsPostponed() const = 0;
|
||||
virtual const bool IsParticularMipStreamed(float fMipFactor) const = 0;
|
||||
|
||||
// get low res system memory (used for CPU voxelization)
|
||||
virtual const ColorB* GetLowResSystemCopy([[maybe_unused]] uint16& nWidth, [[maybe_unused]] uint16& nHeight, [[maybe_unused]] int** ppLowResSystemCopyAtlasId) { return 0; }
|
||||
|
||||
// </interfuscator:shuffle>
|
||||
|
||||
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const
|
||||
{
|
||||
static_assert(eTT_MaxTexType <= 255);
|
||||
static_assert(eTF_MaxFormat <= 255);
|
||||
/*LATER*/
|
||||
}
|
||||
|
||||
virtual void SetKeepSystemCopy(bool bKeepSystemCopy) = 0;
|
||||
virtual void UpdateTextureRegion(const uint8_t* data, int nX, int nY, int nZ, int USize, int VSize, int ZSize, ETEX_Format eTFSrc) = 0;
|
||||
virtual CDeviceTexture* GetDevTexture() const = 0;
|
||||
|
||||
};
|
||||
|
||||
struct STextureLoadData
|
||||
{
|
||||
void* m_pData;
|
||||
size_t m_DataSize;
|
||||
int m_Width;
|
||||
int m_Height;
|
||||
ETEX_Format m_Format;
|
||||
int m_NumMips;
|
||||
int m_nFlags;
|
||||
ITexture* m_pTexture;
|
||||
STextureLoadData()
|
||||
: m_pData(nullptr)
|
||||
, m_Width(0)
|
||||
, m_Height(0)
|
||||
, m_Format(eTF_Unknown)
|
||||
, m_NumMips(0)
|
||||
, m_nFlags(0)
|
||||
, m_pTexture(nullptr)
|
||||
{
|
||||
}
|
||||
~STextureLoadData()
|
||||
{
|
||||
if (m_pData)
|
||||
{
|
||||
CryModuleFree(m_pData);
|
||||
}
|
||||
}
|
||||
|
||||
static void* AllocateData(size_t dataSize)
|
||||
{
|
||||
return CryModuleMalloc(dataSize);
|
||||
}
|
||||
};
|
||||
struct ITextureLoadHandler
|
||||
{
|
||||
virtual ~ITextureLoadHandler() {}
|
||||
virtual bool LoadTextureData(const char* path, STextureLoadData& loadData) = 0;
|
||||
virtual bool SupportsExtension(const char* ext) const = 0;
|
||||
virtual void Update() = 0;
|
||||
};
|
||||
|
||||
//=========================================================================================
|
||||
|
||||
class IDynTexture
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
fNeedRegenerate = 1ul << 0,
|
||||
};
|
||||
// <interfuscator:shuffle>
|
||||
virtual ~IDynTexture(){}
|
||||
virtual void Release() = 0;
|
||||
virtual void GetSubImageRect(uint32& nX, uint32& nY, uint32& nWidth, uint32& nHeight) = 0;
|
||||
virtual void GetImageRect(uint32& nX, uint32& nY, uint32& nWidth, uint32& nHeight) = 0;
|
||||
virtual int GetTextureID() = 0;
|
||||
virtual void Lock() = 0;
|
||||
virtual void UnLock() = 0;
|
||||
virtual int GetWidth() = 0;
|
||||
virtual int GetHeight() = 0;
|
||||
virtual bool IsValid() = 0;
|
||||
virtual uint8 GetFlags() const = 0;
|
||||
virtual void SetFlags([[maybe_unused]] uint8 flags) {}
|
||||
virtual bool Update(int nNewWidth, int nNewHeight) = 0;
|
||||
virtual void Apply(int nTUnit, int nTS = -1) = 0;
|
||||
virtual bool ClearRT() = 0;
|
||||
virtual bool SetRT(int nRT, bool bPush, struct SDepthTexture* pDepthSurf, bool bScreenVP = false) = 0;
|
||||
virtual bool SetRectStates() = 0;
|
||||
virtual bool RestoreRT(int nRT, bool bPop) = 0;
|
||||
virtual ITexture* GetTexture() = 0;
|
||||
virtual void SetUpdateMask() = 0;
|
||||
virtual void ResetUpdateMask() = 0;
|
||||
virtual bool IsSecondFrame() = 0;
|
||||
virtual bool GetImageData32([[maybe_unused]] uint8* pData, [[maybe_unused]] int nDataSize) { return 0; }
|
||||
// </interfuscator:shuffle>
|
||||
};
|
||||
|
||||
// Animating Texture sequence definition
|
||||
class ITexAnim
|
||||
{
|
||||
public:
|
||||
virtual ~ITexAnim() {};
|
||||
virtual void Release() = 0;
|
||||
virtual void AddRef() = 0;
|
||||
};
|
||||
|
||||
struct AZ_DEPRECATED(STexAnim, "STexAnim has been deprecated and replaced by the abstract interface ITexAnim above and CTexAnim in RenderDLL/Common/Textures/Texture.h. This was done to keep proper ref counting between CryRenderDLL and EditorLib.") {};
|
||||
|
||||
struct STexComposition
|
||||
{
|
||||
_smart_ptr<ITexture> pTexture;
|
||||
uint16 nSrcSlice;
|
||||
uint16 nDstSlice;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_ITEXTURE_H
|
||||
|
||||
@@ -9,12 +9,8 @@
|
||||
|
||||
// Description : View System interfaces.
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYACTION_IVIEWSYSTEM_H
|
||||
#define CRYINCLUDE_CRYACTION_IVIEWSYSTEM_H
|
||||
#pragma once
|
||||
|
||||
#include <ISerialize.h>
|
||||
#include <Cry_Camera.h>
|
||||
#include <AzCore/Component/EntityId.h>
|
||||
|
||||
@@ -233,7 +229,6 @@ struct IView
|
||||
virtual CCamera& GetCamera() = 0;
|
||||
virtual const CCamera& GetCamera() const = 0;
|
||||
|
||||
virtual void Serialize(TSerialize ser) = 0;
|
||||
virtual void PostSerialize() = 0;
|
||||
virtual void SetCurrentParams(SViewParams& params) = 0;
|
||||
virtual const SViewParams* GetCurrentParams() = 0;
|
||||
@@ -281,7 +276,6 @@ struct IViewSystem
|
||||
virtual bool AddListener(IViewSystemListener* pListener) = 0;
|
||||
virtual bool RemoveListener(IViewSystemListener* pListener) = 0;
|
||||
|
||||
virtual void Serialize(TSerialize ser) = 0;
|
||||
virtual void PostSerialize() = 0;
|
||||
|
||||
// Get default distance to near clipping plane.
|
||||
@@ -299,5 +293,3 @@ struct IViewSystem
|
||||
virtual void SetControlAudioListeners(bool const bActive) = 0;
|
||||
virtual void ForceUpdate(float elapsed) = 0;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYACTION_IVIEWSYSTEM_H
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <Range.h>
|
||||
#include <AnimKey.h>
|
||||
#include <ITimer.h>
|
||||
#include <VectorSet.h>
|
||||
#include <LyShine/ILyShine.h>
|
||||
#include <AzCore/Math/Vector2.h>
|
||||
#include <AzCore/Math/Vector3.h>
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
#include <Cry_Math.h>
|
||||
#include <Cry_Color.h>
|
||||
#include <ISystem.h>
|
||||
#include <CryCommon/LegacyAllocator.h>
|
||||
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/Component/Entity.h>
|
||||
#include <AzCore/std/containers/unordered_map.h>
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
|
||||
// This is a workaround for AZCore including WinUser.h which defines DrawText to be DrawTextA
|
||||
#ifdef DrawText
|
||||
@@ -44,7 +46,7 @@ namespace LyShine
|
||||
typedef AZStd::string StringType; // not yet decided if we should use wchar_t or UTF8
|
||||
|
||||
//! Used for passing lists of entities
|
||||
typedef DynArray<AZ::Entity*> EntityArray;
|
||||
typedef AZStd::vector<AZ::Entity*, AZ::StdLegacyAllocator> EntityArray;
|
||||
|
||||
enum class BlendMode
|
||||
{
|
||||
|
||||
@@ -1,567 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Description : Misc mathematical functions
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <platform.h>
|
||||
|
||||
// Section dictionary
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#undef AZ_RESTRICTED_SECTION
|
||||
#define MEMORYACCESS_H_SECTION_TRAITS 1
|
||||
#define MEMORYACCESS_H_SECTION_CRYPREFETCH 2
|
||||
#endif
|
||||
|
||||
// Traits
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#define AZ_RESTRICTED_SECTION MEMORYACCESS_H_SECTION_TRAITS
|
||||
#include AZ_RESTRICTED_FILE(MemoryAccess_h)
|
||||
#else
|
||||
#define MEMORYACCESS_H_TRAIT_USE_LEGACY_PREFETCHLINE 1
|
||||
#endif
|
||||
|
||||
#if MEMORYACCESS_H_TRAIT_USE_LEGACY_PREFETCHLINE
|
||||
#define PrefetchLine(ptr, off) cryPrefetchT0SSE((void*)((UINT_PTR)ptr + off))
|
||||
#else
|
||||
#define PrefetchLine(ptr, off) (void)(0)
|
||||
#endif
|
||||
#define ResetLine128(ptr, off) (void)(0)
|
||||
#define FlushLine128(ptr, off) (void)(0)
|
||||
|
||||
|
||||
|
||||
//========================================================================================
|
||||
|
||||
// cryMemcpy flags
|
||||
#define MC_CPU_TO_GPU 0x10
|
||||
#define MC_GPU_TO_CPU 0x20
|
||||
#define MC_CPU_TO_CPU 0x40
|
||||
|
||||
extern int g_CpuFlags;
|
||||
|
||||
//
|
||||
#define CPUF_SSE 0x01
|
||||
#define CPUF_SSE2 0x02
|
||||
#define CPUF_3DNOW 0x04
|
||||
#define CPUF_MMX 0x08
|
||||
#define CPUF_SSE3 0x10
|
||||
#define CPUF_F16C 0x20
|
||||
#define CPUF_SSE41 0x40
|
||||
|
||||
#ifdef _CPU_SSE
|
||||
|
||||
#ifdef _CPU_X86
|
||||
#include <xmmintrin.h>
|
||||
#endif
|
||||
|
||||
#define _MM_PREFETCH(MemPtr, Hint) _mm_prefetch((MemPtr), (Hint));
|
||||
#define _MM_PREFETCH_LOOP(nCount, MemPtr, Hint) { for (int p = 0; p < nCount; p += 64) { _mm_prefetch((const char*)(MemPtr) + p, Hint); } \
|
||||
}
|
||||
#else //_CPU_SSE
|
||||
#define _MM_PREFETCH(MemPtr, Hint)
|
||||
#define _MM_PREFETCH_LOOP(nCount, MemPtr, Hint)
|
||||
#endif //_CPU_SSE
|
||||
|
||||
void cryMemcpy(void* Dst, const void* Src, int Count);
|
||||
#if defined(LINUX) || defined(APPLE)
|
||||
// Define this for Mac and Linux since it is used with the pthread sources
|
||||
#define mymemcpy16 memcpy
|
||||
#endif
|
||||
|
||||
|
||||
//==========================================================================================
|
||||
// 3DNow! optimizations
|
||||
|
||||
#if defined _CPU_X86 && !defined(LINUX) && !defined(APPLE)
|
||||
// ***************************************************************************
|
||||
inline void cryPrecacheSSE(const void* src, int nbytes)
|
||||
{
|
||||
_asm
|
||||
{
|
||||
mov esi, src
|
||||
mov ecx, nbytes
|
||||
// 64 bytes per pass
|
||||
shr ecx, 6
|
||||
jz endLabel
|
||||
|
||||
loopMemToL1:
|
||||
prefetchnta 64[ESI] // Prefetch next loop, non-temporal
|
||||
prefetchnta 96[ESI]
|
||||
|
||||
movq mm1, 0[ESI]// Read in source data
|
||||
movq mm2, 8[ESI]
|
||||
movq mm3, 16[ESI]
|
||||
movq mm4, 24[ESI]
|
||||
movq mm5, 32[ESI]
|
||||
movq mm6, 40[ESI]
|
||||
movq mm7, 48[ESI]
|
||||
movq mm0, 56[ESI]
|
||||
|
||||
add esi, 64
|
||||
dec ecx
|
||||
jnz loopMemToL1
|
||||
|
||||
emms
|
||||
|
||||
endLabel:
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
ILINE void cryPrefetchT0SSE(const void* src)
|
||||
{
|
||||
#if defined(WIN32) && !defined(WIN64)
|
||||
_asm
|
||||
{
|
||||
mov esi, src
|
||||
prefetchT0 [ESI] // Prefetch
|
||||
}
|
||||
#else
|
||||
_MM_PREFETCH((char*)src, _MM_HINT_T0);
|
||||
#endif
|
||||
}
|
||||
|
||||
//=================================================================================
|
||||
|
||||
// Very optimized memcpy() routine for AMD Athlon and Duron family.
|
||||
// This code uses any of FOUR different basic copy methods, depending
|
||||
// on the transfer size.
|
||||
// NOTE: Since this code uses MOVNTQ (also known as "Non-Temporal MOV" or
|
||||
// "Streaming Store"), and also uses the software prefetch instructions,
|
||||
// be sure you're running on Athlon/Duron or other recent CPU before calling!
|
||||
|
||||
#define TINY_BLOCK_COPY 64 // Upper limit for movsd type copy.
|
||||
// The smallest copy uses the X86 "movsd" instruction, in an optimized
|
||||
// form which is an "unrolled loop".
|
||||
|
||||
#define IN_CACHE_COPY 64 * 1024 // Upper limit for movq/movq copy w/SW prefetch.
|
||||
// Next is a copy that uses the MMX registers to copy 8 bytes at a time,
|
||||
// also using the "unrolled loop" optimization. This code uses
|
||||
// the software prefetch instruction to get the data into the cache.
|
||||
|
||||
#define UNCACHED_COPY 197 * 1024 // Upper limit for movq/movntq w/SW prefetch.
|
||||
// For larger blocks, which will spill beyond the cache, it's faster to
|
||||
// use the Streaming Store instruction MOVNTQ. This write instruction
|
||||
// bypasses the cache and writes straight to main memory. This code also
|
||||
// uses the software prefetch instruction to pre-read the data.
|
||||
// USE 64 * 1024 FOR THIS VALUE IF YOU'RE ALWAYS FILLING A "CLEAN CACHE".
|
||||
|
||||
#define BLOCK_PREFETCH_COPY infinity // No limit for movq/movntq w/block prefetch.
|
||||
#define CACHEBLOCK 80h // Number of 64-byte blocks (cache lines) for block prefetch.
|
||||
// For the largest size blocks, a special technique called Block Prefetch
|
||||
// can be used to accelerate the read operations. Block Prefetch reads
|
||||
// one address per cache line, for a series of cache lines, in a short loop.
|
||||
// This is faster than using software prefetch. The technique is great for
|
||||
// getting maximum read bandwidth, especially in DDR memory systems.
|
||||
|
||||
|
||||
#if defined _CPU_X86 && !defined(LINUX) && !defined(APPLE)
|
||||
// Inline assembly syntax for use with Visual C++
|
||||
inline void cryMemcpy(void* Dst, const void* Src, int Count)
|
||||
{
|
||||
if (g_CpuFlags & CPUF_SSE)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov ecx, [Count];
|
||||
number of bytes to copy
|
||||
mov edi, [Dst];
|
||||
destination
|
||||
mov esi, [Src];
|
||||
source
|
||||
mov ebx, ecx;
|
||||
keep a copy of count
|
||||
|
||||
cld
|
||||
cmp ecx, TINY_BLOCK_COPY
|
||||
jb $memcpy_ic_3;
|
||||
tiny ? skip mmx copy
|
||||
|
||||
cmp ecx, 32 * 1024;
|
||||
dont align between 32k - 64k because
|
||||
jbe $memcpy_do_align;
|
||||
it appears to be slower
|
||||
cmp ecx, 64*1024
|
||||
jbe $memcpy_align_done
|
||||
$memcpy_do_align :
|
||||
mov ecx, 8;
|
||||
a trick thats faster than rep movsb ...
|
||||
sub ecx, edi;
|
||||
align destination to qword
|
||||
and ecx, 111b;
|
||||
get the low bits
|
||||
sub ebx, ecx;
|
||||
update copy count
|
||||
neg ecx;
|
||||
set up to jump into the array
|
||||
add ecx, offset $memcpy_align_done
|
||||
jmp ecx;
|
||||
jump to array of movsbs
|
||||
|
||||
align 4
|
||||
movsb
|
||||
movsb
|
||||
movsb
|
||||
movsb
|
||||
movsb
|
||||
movsb
|
||||
movsb
|
||||
movsb
|
||||
|
||||
$memcpy_align_done:;
|
||||
destination is dword aligned
|
||||
mov ecx, ebx;
|
||||
number of bytes left to copy
|
||||
shr ecx, 6;
|
||||
get 64 - byte block count
|
||||
jz $memcpy_ic_2;
|
||||
finish the last few bytes
|
||||
|
||||
cmp ecx, IN_CACHE_COPY / 64;
|
||||
too big 4 cache ? use uncached copy
|
||||
jae $memcpy_uc_test
|
||||
|
||||
// This is small block copy that uses the MMX registers to copy 8 bytes
|
||||
// at a time. It uses the "unrolled loop" optimization, and also uses
|
||||
// the software prefetch instruction to get the data into the cache.
|
||||
align 16
|
||||
$memcpy_ic_1 :;
|
||||
64 - byte block copies, in - cache copy
|
||||
|
||||
prefetchnta [esi + (200 * 64 / 34 + 192)];
|
||||
start reading ahead
|
||||
|
||||
movq mm0, [esi + 0];
|
||||
read 64 bits
|
||||
movq mm1, [esi + 8]
|
||||
movq [edi + 0], mm0;
|
||||
write 64 bits
|
||||
movq [edi + 8], mm1;
|
||||
note: the normal movq writes the
|
||||
movq mm2, [esi + 16];
|
||||
data to cache;
|
||||
a cache line will be
|
||||
movq mm3, [esi + 24];
|
||||
allocated as needed, to store the data
|
||||
movq [edi + 16], mm2
|
||||
movq [edi + 24], mm3
|
||||
movq mm0, [esi + 32]
|
||||
movq mm1, [esi + 40]
|
||||
movq [edi + 32], mm0
|
||||
movq [edi + 40], mm1
|
||||
movq mm2, [esi + 48]
|
||||
movq mm3, [esi + 56]
|
||||
movq [edi + 48], mm2
|
||||
movq [edi + 56], mm3
|
||||
|
||||
add esi, 64;
|
||||
update source pointer
|
||||
add edi, 64;
|
||||
update destination pointer
|
||||
dec ecx;
|
||||
count down
|
||||
jnz $memcpy_ic_1;
|
||||
last 64 - byte block ?
|
||||
|
||||
$memcpy_ic_2 :
|
||||
mov ecx, ebx;
|
||||
has valid low 6 bits of the byte count
|
||||
$memcpy_ic_3:
|
||||
shr ecx, 2;
|
||||
dword count
|
||||
and ecx, 1111b;
|
||||
only look at the "remainder" bits
|
||||
neg ecx;
|
||||
set up to jump into the array
|
||||
add ecx, offset $memcpy_last_few
|
||||
jmp ecx;
|
||||
jump to array of movsds
|
||||
|
||||
$memcpy_uc_test:
|
||||
cmp ecx, UNCACHED_COPY / 64;
|
||||
big enough ? use block prefetch copy
|
||||
jae $memcpy_bp_1
|
||||
|
||||
$memcpy_64_test :
|
||||
or ecx, ecx;
|
||||
tail end of block prefetch will jump here
|
||||
jz $memcpy_ic_2;
|
||||
no more 64 - byte blocks left
|
||||
|
||||
// For larger blocks, which will spill beyond the cache, it's faster to
|
||||
// use the Streaming Store instruction MOVNTQ. This write instruction
|
||||
// bypasses the cache and writes straight to main memory. This code also
|
||||
// uses the software prefetch instruction to pre-read the data.
|
||||
align 16
|
||||
$memcpy_uc_1:;
|
||||
64 - byte blocks, uncached copy
|
||||
|
||||
prefetchnta [esi + (200 * 64 / 34 + 192)];
|
||||
start reading ahead
|
||||
|
||||
movq mm0, [esi + 0];
|
||||
read 64 bits
|
||||
add edi, 64;
|
||||
update destination pointer
|
||||
movq mm1, [esi + 8]
|
||||
add esi, 64;
|
||||
update source pointer
|
||||
movq mm2, [esi - 48]
|
||||
movntq [edi - 64], mm0;
|
||||
write 64 bits, bypassing the cache
|
||||
movq mm0, [esi - 40];
|
||||
note: movntq also prevents the CPU
|
||||
movntq [edi - 56], mm1;
|
||||
from READING the destination address
|
||||
movq mm1, [esi - 32];
|
||||
into the cache, only to be over - written
|
||||
movntq [edi - 48], mm2;
|
||||
so that also helps performance
|
||||
movq mm2, [esi - 24]
|
||||
movntq [edi - 40], mm0
|
||||
movq mm0, [esi - 16]
|
||||
movntq [edi - 32], mm1
|
||||
movq mm1, [esi - 8]
|
||||
movntq [edi - 24], mm2
|
||||
movntq [edi - 16], mm0
|
||||
dec ecx
|
||||
movntq [edi - 8], mm1
|
||||
jnz $memcpy_uc_1;
|
||||
last 64 - byte block ?
|
||||
|
||||
jmp $memcpy_ic_2;
|
||||
almost done
|
||||
|
||||
// For the largest size blocks, a special technique called Block Prefetch
|
||||
// can be used to accelerate the read operations. Block Prefetch reads
|
||||
// one address per cache line, for a series of cache lines, in a short loop.
|
||||
// This is faster than using software prefetch. The technique is great for
|
||||
// getting maximum read bandwidth, especially in DDR memory systems.
|
||||
$memcpy_bp_1 :;
|
||||
large blocks, block prefetch copy
|
||||
|
||||
cmp ecx, CACHEBLOCK;
|
||||
big enough to run another prefetch loop ?
|
||||
jl $memcpy_64_test;
|
||||
no, back to regular uncached copy
|
||||
|
||||
mov eax, CACHEBLOCK / 2;
|
||||
block prefetch loop, unrolled 2X
|
||||
add esi, CACHEBLOCK* 64;
|
||||
move to the top of the block
|
||||
align 16
|
||||
$memcpy_bp_2 :
|
||||
mov edx, [esi - 64];
|
||||
grab one address per cache line
|
||||
mov edx, [esi - 128];
|
||||
grab one address per cache line
|
||||
sub esi, 128;
|
||||
go reverse order to suppress HW prefetcher
|
||||
dec eax;
|
||||
count down the cache lines
|
||||
jnz $memcpy_bp_2;
|
||||
keep grabbing more lines into cache
|
||||
|
||||
mov eax, CACHEBLOCK;
|
||||
now that its in cache, do
|
||||
{
|
||||
the copy
|
||||
align 16
|
||||
$memcpy_bp_3:
|
||||
movq mm0, [esi ];
|
||||
} read 64 bits
|
||||
movq mm1, [esi + 8]
|
||||
movq mm2, [esi + 16]
|
||||
movq mm3, [esi + 24]
|
||||
movq mm4, [esi + 32]
|
||||
movq mm5, [esi + 40]
|
||||
movq mm6, [esi + 48]
|
||||
movq mm7, [esi + 56]
|
||||
add esi, 64;
|
||||
update source pointer
|
||||
movntq [edi ], mm0;
|
||||
write 64 bits, bypassing cache
|
||||
movntq [edi + 8], mm1;
|
||||
note: movntq also prevents the CPU
|
||||
movntq [edi + 16], mm2;
|
||||
from READING the destination address
|
||||
movntq [edi + 24], mm3;
|
||||
into the cache, only to be over - written,
|
||||
movntq [edi + 32], mm4;
|
||||
so that also helps performance
|
||||
movntq [edi + 40], mm5
|
||||
movntq [edi + 48], mm6
|
||||
movntq [edi + 56], mm7
|
||||
add edi, 64;
|
||||
update dest pointer
|
||||
|
||||
dec eax;
|
||||
count down
|
||||
|
||||
jnz $memcpy_bp_3;
|
||||
keep copying
|
||||
sub ecx, CACHEBLOCK;
|
||||
update the 64 - byte block count
|
||||
jmp $memcpy_bp_1;
|
||||
keep processing chunks
|
||||
|
||||
// The smallest copy uses the X86 "movsd" instruction, in an optimized
|
||||
// form which is an "unrolled loop". Then it handles the last few bytes.
|
||||
align 4
|
||||
movsd
|
||||
movsd;
|
||||
perform last 1 - 15 dword copies
|
||||
movsd
|
||||
movsd
|
||||
movsd
|
||||
movsd
|
||||
movsd
|
||||
movsd
|
||||
movsd
|
||||
movsd;
|
||||
perform last 1 - 7 dword copies
|
||||
movsd
|
||||
movsd
|
||||
movsd
|
||||
movsd
|
||||
movsd
|
||||
movsd
|
||||
|
||||
$memcpy_last_few:;
|
||||
dword aligned from before movsds
|
||||
mov ecx, ebx;
|
||||
has valid low 2 bits of the byte count
|
||||
and ecx, 11b;
|
||||
the last few cows must come home
|
||||
jz $memcpy_final;
|
||||
no more, lets leave
|
||||
rep movsb;
|
||||
the last 1, 2, or 3 bytes
|
||||
|
||||
$memcpy_final:
|
||||
emms;
|
||||
clean up the MMX state
|
||||
sfence;
|
||||
flush the write buffer
|
||||
// mov eax, [dest] ; ret value = destination pointer
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(Dst, Src, Count);
|
||||
}
|
||||
}
|
||||
|
||||
inline void cryPrefetch(const void* Src, int nCount)
|
||||
{
|
||||
nCount >>= 6;
|
||||
if (nCount > 0)
|
||||
{
|
||||
_asm
|
||||
{
|
||||
mov esi, Src;
|
||||
mov ecx, nCount;
|
||||
mPr0:
|
||||
align 16
|
||||
dec ecx;
|
||||
mov eax, [esi];
|
||||
mov eax, 0;
|
||||
lea esi, [esi + 40h];
|
||||
jne mPr0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_asm
|
||||
{
|
||||
mov esi, Src;
|
||||
mov ecx, nCount;
|
||||
mPr1:
|
||||
align 16
|
||||
inc ecx;
|
||||
mov eax, [esi];
|
||||
mov eax, 0;
|
||||
lea esi, [esi - 40h];
|
||||
jne mPr1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void cryMemcpy (void* inDst, const void* inSrc, int nCount, int nFlags)
|
||||
{
|
||||
cryMemcpy(inDst, inSrc, nCount);
|
||||
}
|
||||
|
||||
//==========================================================================================
|
||||
// SSE optimizations
|
||||
|
||||
|
||||
#else
|
||||
|
||||
const int PREFNTA_BLOCK = 0x4000;
|
||||
|
||||
ILINE void cryMemcpy(void* Dst, const void* Src, int n)
|
||||
{
|
||||
char* dst = (char*)Dst;
|
||||
char* src = (char*)Src;
|
||||
while (n > PREFNTA_BLOCK)
|
||||
{
|
||||
_MM_PREFETCH_LOOP(PREFNTA_BLOCK, src, _MM_HINT_NTA);
|
||||
|
||||
memcpy(dst, src, PREFNTA_BLOCK);
|
||||
src += PREFNTA_BLOCK;
|
||||
dst += PREFNTA_BLOCK;
|
||||
n -= PREFNTA_BLOCK;
|
||||
}
|
||||
_MM_PREFETCH_LOOP(n, src, _MM_HINT_NTA);
|
||||
memcpy(dst, src, n);
|
||||
}
|
||||
|
||||
ILINE void cryMemcpy(void* Dst, const void* Src, int n, [[maybe_unused]] int nFlags)
|
||||
{
|
||||
char* dst = (char*)Dst;
|
||||
char* src = (char*)Src;
|
||||
while (n > PREFNTA_BLOCK)
|
||||
{
|
||||
_MM_PREFETCH_LOOP(PREFNTA_BLOCK, src, _MM_HINT_NTA);
|
||||
memcpy(dst, src, PREFNTA_BLOCK);
|
||||
src += PREFNTA_BLOCK;
|
||||
dst += PREFNTA_BLOCK;
|
||||
n -= PREFNTA_BLOCK;
|
||||
}
|
||||
_MM_PREFETCH_LOOP(n, src, _MM_HINT_NTA);
|
||||
memcpy(dst, src, n);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(AZ_RESTRICTED_PLATFORM)
|
||||
#define AZ_RESTRICTED_SECTION MEMORYACCESS_H_SECTION_CRYPREFETCH
|
||||
#include AZ_RESTRICTED_FILE(MemoryAccess_h)
|
||||
#endif
|
||||
#if defined(AZ_RESTRICTED_SECTION_IMPLEMENTED)
|
||||
#undef AZ_RESTRICTED_SECTION_IMPLEMENTED
|
||||
#else
|
||||
//implement something usual to bring one memory location into L1 data cache
|
||||
ILINE void CryPrefetch(const void* const cpSrc)
|
||||
{
|
||||
cryPrefetchT0SSE(cpSrc);
|
||||
}
|
||||
#endif
|
||||
|
||||
#define CryPrefetchInl CryPrefetch
|
||||
@@ -36,9 +36,6 @@ public:
|
||||
MOCK_CONST_METHOD0(IsConstCVar, bool());
|
||||
MOCK_METHOD1(SetOnChangeCallback, void(ConsoleVarFunc));
|
||||
MOCK_METHOD1(AddOnChangeFunctor, uint64(const SFunctor& pChangeFunctor));
|
||||
MOCK_CONST_METHOD0(GetNumberOfOnChangeFunctors, uint64());
|
||||
MOCK_CONST_METHOD1(GetOnChangeFunctor, const SFunctor&(uint64));
|
||||
MOCK_METHOD1(RemoveOnChangeFunctor, bool(uint64));
|
||||
MOCK_CONST_METHOD0(GetOnChangeCallback, ConsoleVarFunc());
|
||||
MOCK_CONST_METHOD1(GetMemoryUsage, void(class ICrySizer* pSizer));
|
||||
MOCK_CONST_METHOD0(GetRealIVal, int());
|
||||
|
||||
@@ -69,13 +69,6 @@ public:
|
||||
MOCK_METHOD1(SetInputLine, void (const char* szLine));
|
||||
MOCK_METHOD1(DumpKeyBinds, void (IKeyBindDumpSink * pCallback));
|
||||
MOCK_CONST_METHOD1(FindKeyBind, const char*(const char* sCmd));
|
||||
MOCK_METHOD0(GetNumCheatVars, int ());
|
||||
MOCK_METHOD2(SetCheatVarHashRange, void (size_t firstVar, size_t lastVar));
|
||||
MOCK_METHOD0(CalcCheatVarHash, void ());
|
||||
MOCK_METHOD0(IsHashCalculated, bool ());
|
||||
MOCK_METHOD0(GetCheatVarHash, uint64 ());
|
||||
MOCK_METHOD1(PrintCheatVars, void (bool bUseLastHashRange));
|
||||
MOCK_METHOD1(GetCheatVarAt, char* (uint32 nOffset));
|
||||
MOCK_METHOD1(AddConsoleVarSink, void (IConsoleVarSink * pSink));
|
||||
MOCK_METHOD1(RemoveConsoleVarSink, void (IConsoleVarSink * pSink));
|
||||
MOCK_METHOD1(GetHistoryElement, const char*(bool bUpOrDown));
|
||||
|
||||
@@ -20,154 +20,6 @@ public:
|
||||
int());
|
||||
MOCK_METHOD0(ReleaseForce,
|
||||
int());
|
||||
MOCK_CONST_METHOD0(GetClearColor,
|
||||
const ColorF& ());
|
||||
MOCK_CONST_METHOD0(GetDstFormat,
|
||||
const ETEX_Format());
|
||||
MOCK_CONST_METHOD0(GetSrcFormat,
|
||||
const ETEX_Format());
|
||||
MOCK_CONST_METHOD0(GetTexType,
|
||||
const ETEX_Type());
|
||||
MOCK_METHOD2(ApplyTexture,
|
||||
void(int, int));
|
||||
MOCK_CONST_METHOD0(GetName,
|
||||
const char*());
|
||||
MOCK_CONST_METHOD0(GetWidth,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetHeight,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetDepth,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetTextureID,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetFlags,
|
||||
const uint32());
|
||||
MOCK_CONST_METHOD0(GetNumMips,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetRequiredMip,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetDeviceDataSize,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetDataSize,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetTextureType,
|
||||
const ETEX_Type());
|
||||
MOCK_METHOD1(SetTextureType,
|
||||
void(ETEX_Type type));
|
||||
MOCK_CONST_METHOD0(IsTextureLoaded,
|
||||
const bool());
|
||||
MOCK_METHOD4(PrecacheAsynchronously,
|
||||
void(float, int, int, int));
|
||||
MOCK_METHOD4(GetData32,
|
||||
uint8 * (int nSide, int nLevel, uint8 * pDst, ETEX_Format eDstFormat));
|
||||
MOCK_METHOD1(SetFilter,
|
||||
bool(int nFilter));
|
||||
MOCK_METHOD1(SetClamp,
|
||||
void(bool bEnable));
|
||||
MOCK_CONST_METHOD0(GetAvgBrightness,
|
||||
float());
|
||||
MOCK_CONST_METHOD1(StreamCalculateMipsSigned,
|
||||
int(float fMipFactor));
|
||||
MOCK_CONST_METHOD0(GetStreamableMipNumber,
|
||||
int());
|
||||
MOCK_CONST_METHOD1(GetStreamableMemoryUsage,
|
||||
int(int nStartMip));
|
||||
MOCK_CONST_METHOD0(GetMinLoadedMip,
|
||||
int());
|
||||
MOCK_METHOD2(Readback,
|
||||
void(AZ::u32 subresourceIndex, StagingHook callback));
|
||||
MOCK_METHOD0(Reload,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(GetFormatName,
|
||||
const char*());
|
||||
MOCK_CONST_METHOD0(GetTypeName,
|
||||
const char*());
|
||||
MOCK_CONST_METHOD0(IsStreamedVirtual,
|
||||
const bool());
|
||||
MOCK_CONST_METHOD0(IsShared,
|
||||
const bool());
|
||||
MOCK_CONST_METHOD0(IsStreamable,
|
||||
const bool());
|
||||
MOCK_CONST_METHOD1(IsStreamedIn,
|
||||
bool(const int nMinPrecacheRoundIds[2]));
|
||||
MOCK_CONST_METHOD0(GetAccessFrameId,
|
||||
const int());
|
||||
MOCK_CONST_METHOD0(GetTextureDstFormat,
|
||||
const ETEX_Format());
|
||||
MOCK_CONST_METHOD0(GetTextureSrcFormat,
|
||||
const ETEX_Format());
|
||||
MOCK_CONST_METHOD0(IsPostponed,
|
||||
bool());
|
||||
MOCK_CONST_METHOD1(IsParticularMipStreamed,
|
||||
const bool(float fMipFactor));
|
||||
MOCK_METHOD3(GetLowResSystemCopy,
|
||||
const ColorB * (uint16 & nWidth, uint16 & nHeight, int** ppLowResSystemCopyAtlasId));
|
||||
MOCK_METHOD1(SetKeepSystemCopy,
|
||||
void(bool bKeepSystemCopy));
|
||||
MOCK_METHOD8(UpdateTextureRegion,
|
||||
void(const uint8_t * data, int nX, int nY, int nZ, int USize, int VSize, int ZSize, ETEX_Format eTFSrc));
|
||||
MOCK_CONST_METHOD0(GetDevTexture,
|
||||
CDeviceTexture * ());
|
||||
};
|
||||
|
||||
class ITextureLoadHandlerMock
|
||||
: public ITextureLoadHandler
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD2(LoadTextureData,
|
||||
bool(const char* path, STextureLoadData & loadData));
|
||||
MOCK_CONST_METHOD1(SupportsExtension,
|
||||
bool(const char* ext));
|
||||
MOCK_METHOD0(Update,
|
||||
void());
|
||||
};
|
||||
|
||||
class IDynTextureMock
|
||||
: public IDynTexture
|
||||
{
|
||||
public:
|
||||
MOCK_METHOD0(Release,
|
||||
void());
|
||||
MOCK_METHOD4(GetSubImageRect,
|
||||
void(uint32 & nX, uint32 & nY, uint32 & nWidth, uint32 & nHeight));
|
||||
MOCK_METHOD4(GetImageRect,
|
||||
void(uint32 & nX, uint32 & nY, uint32 & nWidth, uint32 & nHeight));
|
||||
MOCK_METHOD0(GetTextureID,
|
||||
int());
|
||||
MOCK_METHOD0(Lock,
|
||||
void());
|
||||
MOCK_METHOD0(UnLock,
|
||||
void());
|
||||
MOCK_METHOD0(GetWidth,
|
||||
int());
|
||||
MOCK_METHOD0(GetHeight,
|
||||
int());
|
||||
MOCK_METHOD0(IsValid,
|
||||
bool());
|
||||
MOCK_CONST_METHOD0(GetFlags,
|
||||
uint8());
|
||||
MOCK_METHOD1(SetFlags,
|
||||
void(uint8 flags));
|
||||
MOCK_METHOD2(Update,
|
||||
bool(int nNewWidth, int nNewHeight));
|
||||
MOCK_METHOD2(Apply,
|
||||
void(int, int));
|
||||
MOCK_METHOD0(ClearRT,
|
||||
bool());
|
||||
MOCK_METHOD4(SetRT,
|
||||
bool(int nRT, bool bPush, struct SDepthTexture* pDepthSurf, bool bScreenVP));
|
||||
MOCK_METHOD0(SetRectStates,
|
||||
bool());
|
||||
MOCK_METHOD2(RestoreRT,
|
||||
bool(int nRT, bool bPop));
|
||||
MOCK_METHOD0(GetTexture,
|
||||
ITexture * ());
|
||||
MOCK_METHOD0(SetUpdateMask,
|
||||
void());
|
||||
MOCK_METHOD0(ResetUpdateMask,
|
||||
void());
|
||||
MOCK_METHOD0(IsSecondFrame,
|
||||
bool());
|
||||
MOCK_METHOD2(GetImageData32,
|
||||
bool(uint8 * pData, int nDataSize));
|
||||
};
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Description : Facilities for defining and combining general-purpose or specific options, for functions or structs.
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_OPTIONS_H
|
||||
#define CRYINCLUDE_CRYCOMMON_OPTIONS_H
|
||||
#pragma once
|
||||
|
||||
|
||||
// Facilities for collecting options in a struct, and quickly constructing them.
|
||||
// Used, for example, as construction argument. Safer and more informative than bool arguments.
|
||||
//
|
||||
// Example:
|
||||
// struct FObjectOpts;
|
||||
// struct CObject { CObject(FObjectOpts = ZERO); };
|
||||
// CObject object_def();
|
||||
// CObject object( FObjectOpts().Size(8).AllowGrowth(true) );
|
||||
|
||||
template<class TOpt, class T, class TContainer, int NInit = 0>
|
||||
struct TOptVar
|
||||
{
|
||||
typedef T TValue;
|
||||
|
||||
TOptVar()
|
||||
: _val(T(NInit))
|
||||
{
|
||||
offset(this);
|
||||
}
|
||||
TOptVar(T val)
|
||||
: _val(val) {}
|
||||
|
||||
operator T () const
|
||||
{
|
||||
return _val;
|
||||
}
|
||||
T operator ()() const
|
||||
{ return _val; }
|
||||
T operator +() const
|
||||
{ return _val; }
|
||||
bool operator !() const
|
||||
{ return !_val; }
|
||||
|
||||
TContainer& operator()(T val)
|
||||
{
|
||||
_val = val;
|
||||
return *(TContainer*)((char*)this - offset());
|
||||
}
|
||||
|
||||
private:
|
||||
T _val;
|
||||
|
||||
static size_t offset(void* self = 0)
|
||||
{
|
||||
static size_t _offset = TContainer::static_offset(self);
|
||||
return _offset;
|
||||
}
|
||||
};
|
||||
|
||||
#define OPT_STRUCT(TOpts) \
|
||||
typedef TOpts TThis; typedef uint TInt; \
|
||||
static size_t static_offset(void* var) { static void* _first = var; return (char*)var - (char*)_first; } \
|
||||
TOpts([[maybe_unused]] void* p = 0) {} \
|
||||
TOpts operator()() const { return TOpts(*this); } \
|
||||
|
||||
#define OPT_VAR(Type, Var) \
|
||||
enum E##Var {}; TOptVar<E##Var, Type, TThis> Var; \
|
||||
|
||||
#define OPT_VAR_INIT(Type, Var, init) \
|
||||
enum E##Var {}; TOptVar<E##Var, Type, TThis, init> Var; \
|
||||
|
||||
#define BIT_STRUCT(Struc, Int) \
|
||||
typedef Struc TThis; typedef Int TInt; \
|
||||
TInt Mask() const { return *(const TInt*)this; } \
|
||||
TInt& Mask() { return *(TInt*)this; } \
|
||||
Struc(TInt init = 0) { static_assert(sizeof(TThis) == sizeof(TInt)); Mask() = init; } \
|
||||
|
||||
#define BIT_VAR(Var) \
|
||||
TInt _##Var : 1; \
|
||||
bool Var() const { return _##Var; } \
|
||||
TThis& Var(bool val) { _##Var = val; return *this; } \
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_OPTIONS_H
|
||||
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/EBus/EBus.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
///
|
||||
/// The Stereo Renderer bus allows other systems to query various properties on the stereo renderer
|
||||
///
|
||||
class StereoRendererBus
|
||||
: public EBusTraits
|
||||
{
|
||||
public:
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// EBus Traits
|
||||
static const EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Multiple;
|
||||
static const EBusAddressPolicy AddressPolicy = EBusAddressPolicy::Single;
|
||||
using MutexType = AZStd::recursive_mutex;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual ~StereoRendererBus() {}
|
||||
|
||||
///
|
||||
/// Return whether the renderer is rendering to the HMD
|
||||
///
|
||||
/// @return True if rendering to the HMD
|
||||
///
|
||||
virtual bool IsRenderingToHMD() { return false; }
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
using StereoRendererRequestBus = EBus < StereoRendererBus >;
|
||||
}
|
||||
@@ -9,14 +9,13 @@
|
||||
|
||||
// Description : Various convenience utility functions for STL and alike
|
||||
// Used in Animation subsystem, and in some tools
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_STLUTILS_H
|
||||
#define CRYINCLUDE_CRYCOMMON_STLUTILS_H
|
||||
#pragma once
|
||||
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <AzCore/std/containers/unordered_map.h>
|
||||
#include <AzCore/std/containers/unordered_set.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
|
||||
#if (defined(LINUX) || defined(APPLE))
|
||||
#include "platform.h"
|
||||
@@ -527,58 +526,6 @@ namespace stl
|
||||
// typedef AZStd::unordered_map<string,int, stl::hash_string_insensitve<string>, stl::equality_string_insensitive<string> > StringToIntHash;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// useful when the key is already the result of an hash function
|
||||
// key needs to be convertible to size_t
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
template <class Key>
|
||||
class hash_simple
|
||||
{
|
||||
public:
|
||||
enum // parameters for hash table
|
||||
{
|
||||
bucket_size = 4, // 0 < bucket_size
|
||||
min_buckets = 8
|
||||
};// min_buckets = 2 ^^ N, 0 < N
|
||||
|
||||
size_t operator()(const Key& key) const
|
||||
{
|
||||
return size_t(key);
|
||||
};
|
||||
bool operator()(const Key& key1, const Key& key2) const
|
||||
{
|
||||
return key1 < key2;
|
||||
}
|
||||
};
|
||||
|
||||
// simple hash class that has the avalanche property (a change in one bit affects all others)
|
||||
// ... use this if you have uint32 key values!
|
||||
class hash_uint32
|
||||
{
|
||||
public:
|
||||
enum // parameters for hash table
|
||||
{
|
||||
bucket_size = 4, // 0 < bucket_size
|
||||
min_buckets = 8 // min_buckets = 2 ^^ N, 0 < N
|
||||
};
|
||||
|
||||
ILINE size_t operator()(uint32 a) const
|
||||
{
|
||||
a = (a + 0x7ed55d16) + (a << 12);
|
||||
a = (a ^ 0xc761c23c) ^ (a >> 19);
|
||||
a = (a + 0x165667b1) + (a << 5);
|
||||
a = (a + 0xd3a2646c) ^ (a << 9);
|
||||
a = (a + 0xfd7046c5) + (a << 3);
|
||||
a = (a ^ 0xb55a4f09) ^ (a >> 16);
|
||||
return a;
|
||||
};
|
||||
bool operator()(uint32 key1, uint32 key2) const
|
||||
{
|
||||
return key1 < key2;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//! Case sensitive string hash
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -655,130 +602,6 @@ namespace stl
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Support for both Microsoft and SGI kind of hash_map.
|
||||
|
||||
#if defined(_STLP_HASH_MAP) || defined(APPLE) || defined(LINUX)
|
||||
// STL Port
|
||||
template <class _Key, class _Predicate = std::less<_Key> >
|
||||
struct hash_compare
|
||||
{
|
||||
enum
|
||||
{ // parameters for hash table
|
||||
bucket_size = 4, // 0 < bucket_size
|
||||
min_buckets = 8 // min_buckets = 2 ^^ N, 0 < N
|
||||
};
|
||||
|
||||
size_t operator()(const _Key& _Keyval) const
|
||||
{
|
||||
// return hash value.
|
||||
uint32 a = _Keyval;
|
||||
a = (a + 0x7ed55d16) + (a << 12);
|
||||
a = (a ^ 0xc761c23c) ^ (a >> 19);
|
||||
a = (a + 0x165667b1) + (a << 5);
|
||||
a = (a + 0xd3a2646c) ^ (a << 9);
|
||||
a = (a + 0xfd7046c5) + (a << 3);
|
||||
a = (a ^ 0xb55a4f09) ^ (a >> 16);
|
||||
return a;
|
||||
}
|
||||
|
||||
// Less then function.
|
||||
bool operator()(const _Key& _Keyval1, const _Key& _Keyval2) const
|
||||
{ // test if _Keyval1 ordered before _Keyval2
|
||||
_Predicate comp;
|
||||
return (comp(_Keyval1, _Keyval2));
|
||||
}
|
||||
};
|
||||
|
||||
template <class Key, class HashFunc>
|
||||
struct stlport_hash_equal
|
||||
{
|
||||
// Equal function.
|
||||
bool operator()(const Key& k1, const Key& k2) const
|
||||
{
|
||||
HashFunc less;
|
||||
// !(k1 < k2) && !(k2 < k1)
|
||||
return !less(k1, k2) && !less(k2, k1);
|
||||
}
|
||||
};
|
||||
|
||||
template <class Key, class Value, class HashFunc = hash_compare<Key>, class Alloc = std::allocator< std::pair<const Key, Value> > >
|
||||
struct hash_map
|
||||
: public std__hash_map<Key, Value, HashFunc, stlport_hash_equal<Key, HashFunc>, Alloc>
|
||||
{
|
||||
hash_map()
|
||||
: std__hash_map<Key, Value, HashFunc, stlport_hash_equal<Key, HashFunc>, Alloc>(HashFunc::min_buckets) {}
|
||||
};
|
||||
|
||||
template <class Key, class Value, class HashFunc = hash_compare<Key>, class Alloc = std::allocator< std::pair<const Key, Value> > >
|
||||
struct hash_multimap
|
||||
: public std__hash_multimap<Key, Value, HashFunc, stlport_hash_equal<Key, HashFunc>, Alloc>
|
||||
{
|
||||
hash_multimap()
|
||||
: std__hash_multimap<Key, Value, HashFunc, stlport_hash_equal<Key, HashFunc>, Alloc>(HashFunc::min_buckets) {}
|
||||
};
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
template<class T>
|
||||
class intrusive_linked_list_node
|
||||
{
|
||||
public:
|
||||
intrusive_linked_list_node() { link_to_intrusive_list(static_cast<T*>(this)); }
|
||||
// Not virtual by design
|
||||
~intrusive_linked_list_node() { unlink_from_intrusive_list(static_cast<T*>(this)); }
|
||||
|
||||
static T* get_intrusive_list_root() { return m_root_intrusive; };
|
||||
|
||||
static void link_to_intrusive_list(T* pNode)
|
||||
{
|
||||
if (m_root_intrusive)
|
||||
{
|
||||
// Add to the beginning of the list.
|
||||
T* head = m_root_intrusive;
|
||||
pNode->m_prev_intrusive = 0;
|
||||
pNode->m_next_intrusive = head;
|
||||
head->m_prev_intrusive = pNode;
|
||||
m_root_intrusive = pNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_root_intrusive = pNode;
|
||||
pNode->m_prev_intrusive = 0;
|
||||
pNode->m_next_intrusive = 0;
|
||||
}
|
||||
}
|
||||
static void unlink_from_intrusive_list(T* pNode)
|
||||
{
|
||||
if (pNode == m_root_intrusive) // if head of list.
|
||||
{
|
||||
m_root_intrusive = pNode->m_next_intrusive;
|
||||
if (m_root_intrusive)
|
||||
{
|
||||
m_root_intrusive->m_prev_intrusive = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pNode->m_prev_intrusive)
|
||||
{
|
||||
pNode->m_prev_intrusive->m_next_intrusive = pNode->m_next_intrusive;
|
||||
}
|
||||
if (pNode->m_next_intrusive)
|
||||
{
|
||||
pNode->m_next_intrusive->m_prev_intrusive = pNode->m_prev_intrusive;
|
||||
}
|
||||
}
|
||||
pNode->m_next_intrusive = 0;
|
||||
pNode->m_prev_intrusive = 0;
|
||||
}
|
||||
|
||||
public:
|
||||
static T* m_root_intrusive;
|
||||
T* m_next_intrusive;
|
||||
T* m_prev_intrusive;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
inline void reconstruct(T& t)
|
||||
{
|
||||
@@ -860,30 +683,6 @@ namespace stl
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct scoped_set
|
||||
{
|
||||
scoped_set(T& ref, T val)
|
||||
: m_ref(&ref)
|
||||
, m_oldVal(ref)
|
||||
{
|
||||
ref = val;
|
||||
}
|
||||
|
||||
~scoped_set()
|
||||
{
|
||||
(*m_ref) = m_oldVal;
|
||||
}
|
||||
|
||||
private:
|
||||
scoped_set(const scoped_set<T>& other);
|
||||
scoped_set<T>& operator = (const scoped_set<T>& other);
|
||||
|
||||
private:
|
||||
T* m_ref;
|
||||
T m_oldVal;
|
||||
};
|
||||
|
||||
template <typename T, size_t Length, typename Func>
|
||||
inline void for_each_array(T (&buffer)[Length], Func func)
|
||||
{
|
||||
@@ -910,64 +709,6 @@ namespace stl
|
||||
template<> \
|
||||
Class * stl::intrusive_linked_list_node<Class>::m_root_intrusive = nullptr;
|
||||
|
||||
|
||||
// Performs a less-than compare on a serial sequence space, such that earlier values compare less-than later values.
|
||||
// Unlike a normal integral value, this accounts for overflowing the limit of the underlying type.
|
||||
// For example, assuming a 2-bit unsigned underlying type (with possible values 0, 1, 2 and 3), the following will hold: 0 < 1 && 1 < 2 && 2 < 3 && 3 < 0
|
||||
// Assuming two equal values V1 and V2, V2 can be incremented up to "(2 ^ (bits - 1) - 1)" times and V1 < V2 will continue to hold.
|
||||
// See also RFC-1982 that documents this http://tools.ietf.org/html/rfc1982
|
||||
template<typename T>
|
||||
struct SSerialCompare
|
||||
{
|
||||
static_assert(std::is_integral<T>::value && std::is_unsigned<T>::value, "T must be an unsigned integral type");
|
||||
|
||||
static const T limit = (T(1) << (sizeof(T) * 8 - 1));
|
||||
|
||||
bool operator()(T lhs, T rhs)
|
||||
{
|
||||
return ((lhs < rhs) && (rhs - lhs < limit)) || ((lhs > rhs) && (lhs - rhs > limit));
|
||||
}
|
||||
};
|
||||
|
||||
template <class Container>
|
||||
unsigned sizeOfVP(Container& arr)
|
||||
{
|
||||
int i;
|
||||
unsigned size = 0;
|
||||
for (i = 0; i < (int)arr.size(); i++)
|
||||
{
|
||||
typename Container::value_type& T = arr[i];
|
||||
size += T->Size();
|
||||
}
|
||||
size += (arr.capacity() - arr.size()) * sizeof(typename Container::value_type);
|
||||
return size;
|
||||
}
|
||||
|
||||
template <class Container>
|
||||
unsigned sizeOfV(Container& arr)
|
||||
{
|
||||
int i;
|
||||
unsigned size = 0;
|
||||
for (i = 0; i < (int)arr.size(); i++)
|
||||
{
|
||||
typename Container::value_type& T = arr[i];
|
||||
size += T.Size();
|
||||
}
|
||||
size += (arr.capacity() - arr.size()) * sizeof(typename Container::value_type);
|
||||
return size;
|
||||
}
|
||||
template <class Container>
|
||||
unsigned sizeOfA(Container& arr)
|
||||
{
|
||||
int i;
|
||||
unsigned size = 0;
|
||||
for (i = 0; i < arr.size(); i++)
|
||||
{
|
||||
typename Container::value_type& T = arr[i];
|
||||
size += T.Size();
|
||||
}
|
||||
return size;
|
||||
}
|
||||
// define the maplikestruct, used to approximate the memory requirements for a map node
|
||||
namespace stl
|
||||
{
|
||||
@@ -1027,5 +768,3 @@ unsigned sizeOfMapS(Map& map)
|
||||
size += map.size() * sizeof(stl::MapLikeStruct);
|
||||
return size;
|
||||
}
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_STLUTILS_H
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_TARRAY_H
|
||||
#define CRYINCLUDE_CRYCOMMON_TARRAY_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <ILog.h>
|
||||
#include <Cry_Math.h>
|
||||
#include <AzCore/IO/FileIO.h>
|
||||
|
||||
#ifndef CLAMP
|
||||
#define CLAMP(X, mn, mx) ((X) < (mn) ? (mn) : ((X) < (mx) ? (X) : (mx)))
|
||||
#endif
|
||||
|
||||
#ifndef SATURATE
|
||||
#define SATURATE(X) clamp_tpl(X, 0.f, 1.f)
|
||||
#endif
|
||||
|
||||
#ifndef SATURATEB
|
||||
#define SATURATEB(X) CLAMP(X, 0, 255)
|
||||
#endif
|
||||
|
||||
#ifndef LERP
|
||||
#define LERP(A, B, Alpha) ((A) + (Alpha) * ((B)-(A)))
|
||||
#endif
|
||||
|
||||
// Safe memory freeing
|
||||
#ifndef SAFE_DELETE
|
||||
#define SAFE_DELETE(p) { if (p) { delete (p); (p) = NULL; } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SAFE_DELETE_ARRAY
|
||||
#define SAFE_DELETE_ARRAY(p) { if (p) { delete[] (p); (p) = NULL; } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SAFE_RELEASE
|
||||
#define SAFE_RELEASE(p) { if (p) { (p)->Release(); (p) = NULL; } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SAFE_RELEASE_FORCE
|
||||
#define SAFE_RELEASE_FORCE(p) { if (p) { (p)->ReleaseForce(); (p) = NULL; } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_TARRAY_H
|
||||
@@ -164,8 +164,6 @@ public:
|
||||
ILINE bool operator==(const CTimeValue& inRhs) const { return m_lValue == inRhs.m_lValue; };
|
||||
ILINE bool operator!=(const CTimeValue& inRhs) const { return m_lValue != inRhs.m_lValue; };
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
|
||||
void GetMemoryStatistics(class ICrySizer*) const { /*nothing*/}
|
||||
|
||||
private: // ----------------------------------------------------------
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_TIMEVALUE_INFO_H
|
||||
#define CRYINCLUDE_CRYCOMMON_TIMEVALUE_INFO_H
|
||||
#pragma once
|
||||
|
||||
#include "TimeValue.h"
|
||||
|
||||
STRUCT_INFO_BEGIN(CTimeValue)
|
||||
STRUCT_VAR_INFO(m_lValue, TYPE_INFO(int64))
|
||||
STRUCT_INFO_END(CTimeValue)
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_TIMEVALUE_INFO_H
|
||||
@@ -1,120 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Description : Macros and other definitions needed for TypeInfo declarations.
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_TYPEINFO_DECL_H
|
||||
#define CRYINCLUDE_CRYCOMMON_TYPEINFO_DECL_H
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/Math/Uuid.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Meta-type support.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Currently enable type info for all platforms.
|
||||
#if !defined(ENABLE_TYPE_INFO)
|
||||
#define ENABLE_TYPE_INFO
|
||||
#endif
|
||||
#ifdef ENABLE_TYPE_INFO
|
||||
|
||||
struct CTypeInfo;
|
||||
|
||||
// If TypeInfo exists for T, it is accessed via TypeInfo(T*).
|
||||
// Default TypeInfo() is implemented by a struct member function.
|
||||
template<class T>
|
||||
inline const CTypeInfo& TypeInfo(const T* t)
|
||||
{
|
||||
return t->TypeInfo();
|
||||
}
|
||||
|
||||
// Declare a class's TypeInfo member
|
||||
#define STRUCT_INFO \
|
||||
const CTypeInfo&TypeInfo() const;
|
||||
|
||||
#define NULL_STRUCT_INFO \
|
||||
const CTypeInfo&TypeInfo() const { return *(CTypeInfo*)0; }
|
||||
|
||||
// Declare an override for a type without TypeInfo() member (e.g. basic type)
|
||||
#define DECLARE_TYPE_INFO(Type) \
|
||||
template<> \
|
||||
const CTypeInfo&TypeInfo(const Type*);
|
||||
|
||||
// Template version.
|
||||
#define DECLARE_TYPE_INFO_T(Type) \
|
||||
template<class T> \
|
||||
const CTypeInfo&TypeInfo(const Type<T>*);
|
||||
|
||||
// Type info declaration, with additional prototypes for string conversions.
|
||||
#define BASIC_TYPE_INFO(Type) \
|
||||
AZStd::string ToString(Type const & val); \
|
||||
bool FromString(Type & val, const char* s); \
|
||||
DECLARE_TYPE_INFO(Type)
|
||||
|
||||
#define CUSTOM_STRUCT_INFO(Struct) \
|
||||
const CTypeInfo&TypeInfo() const \
|
||||
{ static Struct Info; return Info; }
|
||||
|
||||
#else // ENABLE_TYPE_INFO
|
||||
|
||||
#define STRUCT_INFO
|
||||
#define NULL_STRUCT_INFO
|
||||
#define DECLARE_TYPE_INFO(Type)
|
||||
#define DECLARE_TYPE_INFO_T(Type)
|
||||
#define BASIC_TYPE_INFO(T)
|
||||
|
||||
#endif // ENABLE_TYPE_INFO
|
||||
|
||||
// Specify automatic tool generation of TypeInfo bodies.
|
||||
#define AUTO_STRUCT_INFO STRUCT_INFO
|
||||
#define AUTO_TYPE_INFO DECLARE_TYPE_INFO
|
||||
#define AUTO_TYPE_INFO_T DECLARE_TYPE_INFO_T
|
||||
|
||||
// Obsolete "LOCAL" versions (all infos now generated in local files).
|
||||
#define AUTO_STRUCT_INFO_LOCAL STRUCT_INFO
|
||||
#define AUTO_TYPE_INFO_LOCAL DECLARE_TYPE_INFO
|
||||
#define AUTO_TYPE_INFO_LOCAL_T DECLARE_TYPE_INFO_T
|
||||
|
||||
// Overrides for basic types.
|
||||
DECLARE_TYPE_INFO(void)
|
||||
|
||||
BASIC_TYPE_INFO(bool)
|
||||
BASIC_TYPE_INFO(char)
|
||||
BASIC_TYPE_INFO(wchar_t)
|
||||
BASIC_TYPE_INFO(signed char)
|
||||
BASIC_TYPE_INFO(unsigned char)
|
||||
BASIC_TYPE_INFO(short)
|
||||
BASIC_TYPE_INFO(unsigned short)
|
||||
BASIC_TYPE_INFO(int)
|
||||
BASIC_TYPE_INFO(unsigned int)
|
||||
BASIC_TYPE_INFO(long)
|
||||
BASIC_TYPE_INFO(unsigned long)
|
||||
BASIC_TYPE_INFO(int64)
|
||||
BASIC_TYPE_INFO(uint64)
|
||||
|
||||
BASIC_TYPE_INFO(float)
|
||||
BASIC_TYPE_INFO(double)
|
||||
|
||||
BASIC_TYPE_INFO(AZ::Uuid)
|
||||
|
||||
DECLARE_TYPE_INFO(AZStd::string)
|
||||
|
||||
// All pointers share same TypeInfo.
|
||||
const CTypeInfo&PtrTypeInfo();
|
||||
template<class T>
|
||||
inline const CTypeInfo& TypeInfo([[maybe_unused]] T** t)
|
||||
{
|
||||
return PtrTypeInfo();
|
||||
}
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_TYPEINFO_DECL_H
|
||||
@@ -1,213 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Description : Declaration of CTypeInfo, and other things to access meta-type info.
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_TYPEINFO_IMPL_H
|
||||
#define CRYINCLUDE_CRYCOMMON_TYPEINFO_IMPL_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "CryCustomTypes.h"
|
||||
|
||||
#define ENABLE_TYPE_INFO_NAMES 1
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// DECLARATION MACROS
|
||||
// Used to construct meta TypeInfo objects in AutoTypeInfo files.
|
||||
// Two possible levels of TypeInfo: default, with size and offset info only, allowing Endian conversion;
|
||||
// and full, with string, attr, and enum info, allowing UI and serialisation.
|
||||
// The full version is selected by the ENABLE_TYPE_INFO_NAMES macro.
|
||||
|
||||
#ifdef ENABLE_TYPE_INFO
|
||||
|
||||
#ifndef ENABLE_TYPE_INFO_NAMES
|
||||
// This symbol must be defined only once per module.
|
||||
#define ENABLE_TYPE_INFO_NAMES 0
|
||||
#endif
|
||||
|
||||
#if ENABLE_TYPE_INFO_NAMES
|
||||
#define TYPE_INFO_NAME(n) #n
|
||||
#else
|
||||
#define TYPE_INFO_NAME(n) ""
|
||||
#endif
|
||||
#define TYPE_INFO_NAME_T(n) #n "<>"
|
||||
|
||||
// Set of template functions for automatically returning the base element type for any scalar or array variable.
|
||||
|
||||
template<class T>
|
||||
inline T& ElemType(T* at)
|
||||
{ return *at; }
|
||||
|
||||
template<class T, size_t N>
|
||||
inline T& ElemType(T (*at)[N])
|
||||
{ return **at; }
|
||||
|
||||
template<class T, size_t N, size_t N2>
|
||||
inline T& ElemType(T (*at)[N][N2])
|
||||
{ return ***at; }
|
||||
|
||||
template<class T, size_t N, size_t N2, size_t N3>
|
||||
inline T& ElemType(T (*at)[N][N2][N3])
|
||||
{ return ****at; }
|
||||
|
||||
template<class T>
|
||||
inline T& ValType([[maybe_unused]] T t)
|
||||
{ static T _t; return _t; }
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Macros for constructing StructInfos (invoked by AutoTypeInfo.h)
|
||||
|
||||
#define DEFINE_TYPE_INFO(T, Type, Args) \
|
||||
template<> \
|
||||
const CTypeInfo&TypeInfo(const T*) \
|
||||
{ static Type Info Args; return Info; } \
|
||||
|
||||
#define STRUCT_INFO_EMPTY_BODY(T) \
|
||||
{ \
|
||||
static CStructInfo Info(#T, sizeof(T), alignof(T)); \
|
||||
return Info; \
|
||||
} \
|
||||
|
||||
#define STRUCT_INFO_EMPTY(T) \
|
||||
const CTypeInfo&T::TypeInfo() const \
|
||||
STRUCT_INFO_EMPTY_BODY(T) \
|
||||
|
||||
#define STRUCT_INFO_T_EMPTY(T, Key, Arg) \
|
||||
template<Key Arg> \
|
||||
STRUCT_INFO_EMPTY(T<Arg>)
|
||||
|
||||
#define STRUCT_INFO_TYPE_EMPTY(T) \
|
||||
DEFINE_TYPE_INFO(T, CStructInfo, (#T, sizeof(T), alignof(T)))
|
||||
|
||||
#define STRUCT_INFO_TYPE_T_EMPTY(T, TArgs, TDecl) \
|
||||
template TDecl const CTypeInfo&TypeInfo(const T TArgs*) \
|
||||
STRUCT_INFO_EMPTY_BODY(T TArgs) \
|
||||
|
||||
// Define TypeInfo for a primitive type, without string conversion.
|
||||
#define TYPE_INFO_PLAIN(T) DEFINE_TYPE_INFO(T, CTypeInfo, (#T, sizeof(T), alignof(T)))
|
||||
|
||||
// Define TypeInfo for a basic type (undecomposable as far as TypeInfo cares), with external string converters.
|
||||
#define TYPE_INFO_BASIC(T) DEFINE_TYPE_INFO(T, TTypeInfo<T>, (#T))
|
||||
|
||||
// Variant for int types, allowing conversion between sizes.
|
||||
#define TYPE_INFO_INT(T) DEFINE_TYPE_INFO(T, TIntTypeInfo<T>, (#T))
|
||||
|
||||
#define STRUCT_INFO_BEGIN(T) \
|
||||
const CTypeInfo&T::TypeInfo() const { \
|
||||
static CStructInfo::CVarInfo Vars[] = { \
|
||||
|
||||
#define STRUCT_INFO_END(T) \
|
||||
}; \
|
||||
static CStructInfo Info(#T, sizeof(T), alignof(T), ARRAY_VAR(Vars)); \
|
||||
return Info; \
|
||||
}
|
||||
|
||||
#define BASE_INFO_ATTRS(BaseType, Attrs) \
|
||||
{ ::TypeInfo((const BaseType*)this), "", Attrs, uint32((char*)static_cast<const BaseType*>(this) - (char*)this), 1, 1, 0, 0, 0 },
|
||||
|
||||
#define BASE_INFO(BaseType) BASE_INFO_ATTRS(BaseType, "")
|
||||
|
||||
#define ALIAS_INFO_ATTRS(AliasName, VarName, Attrs) \
|
||||
{ ::TypeInfo(&ElemType(&VarName)), TYPE_INFO_NAME(AliasName), Attrs, uint32((char*)&VarName - (char*)this), sizeof(VarName) / sizeof(ElemType(&VarName)), 0, 0, 0, 0 },
|
||||
|
||||
#define ALIAS_INFO_STRINGNAME_ATTR(AliasStringName, VarName, Attrs) \
|
||||
{ ::TypeInfo(&ElemType(&VarName)), AliasStringName, Attrs, uint32((char*)&VarName - (char*)this), sizeof(VarName) / sizeof(ElemType(&VarName)), 0, 0, 0, 0 },
|
||||
|
||||
#define VAR_INFO_ATTRS(VarName, Attrs) \
|
||||
ALIAS_INFO_ATTRS(VarName, VarName, Attrs)
|
||||
|
||||
#define VAR_INFO(VarName) \
|
||||
VAR_INFO_ATTRS(VarName, "")
|
||||
|
||||
#define ALIAS_INFO(AliasName, VarName) \
|
||||
ALIAS_INFO_ATTRS(AliasName, VarName, "")
|
||||
|
||||
#define ATTRS_INFO(Attrs) \
|
||||
{ ::TypeInfo((void*)0), "", Attrs, 0, 0, 0, 0, 0, 0 },
|
||||
|
||||
#define BITFIELD_INFO(VarName, Bits) \
|
||||
{ ::TypeInfo(&ValType(VarName)), TYPE_INFO_NAME(VarName), "", 0, Bits, 0, 1, 0, 0 },
|
||||
|
||||
// Conversion macros for older system.
|
||||
#define STRUCT_BASE_INFO(BaseType) BASE_INFO(BaseType)
|
||||
#define STRUCT_VAR_INFO(VarName, InfoName) VAR_INFO(VarName)
|
||||
#define STRUCT_BITFIELD_INFO(VarName, VarType, Bits) BITFIELD_INFO(VarName, Bits)
|
||||
|
||||
// Template versions
|
||||
|
||||
template<class T>
|
||||
Array<CTypeInfo const*> TypeInfoArray1(T const* pt)
|
||||
{
|
||||
static CTypeInfo const* s_info = &::TypeInfo(pt);
|
||||
return ArrayT(&s_info, 1);
|
||||
}
|
||||
|
||||
#define STRUCT_INFO_T_BEGIN(T, Key, Arg) \
|
||||
template<Key Arg> \
|
||||
STRUCT_INFO_BEGIN(T<Arg>)
|
||||
|
||||
#define STRUCT_INFO_T_END(T, Key, Arg) \
|
||||
}; \
|
||||
static CStructInfo Info(#T "<>", sizeof(T<Arg>), alignof(T<Arg>), ARRAY_VAR(Vars), TypeInfoArray1((Arg*)0)); \
|
||||
return Info; \
|
||||
}
|
||||
|
||||
#define STRUCT_INFO_T2_BEGIN(T, Key1, Arg1, Key2, Arg2) \
|
||||
template<Key1 Arg1, Key2 Arg2> \
|
||||
const CTypeInfo&T<Arg1, Arg2>::TypeInfo() const { \
|
||||
typedef T<Arg1, Arg2> TThis; \
|
||||
static CStructInfo::CVarInfo Vars[] = { \
|
||||
|
||||
#define STRUCT_INFO_T2_END(T, Key1, Arg1, Key2, Arg2) \
|
||||
}; \
|
||||
static CTypeInfo const* TemplateTypes[] = { &::TypeInfo((Arg1*)0), &::TypeInfo((Arg2*)0) }; \
|
||||
static CStructInfo Info(#T "<,>", sizeof(TThis), alignof(TThis), ARRAY_VAR(Vars), ARRAY_VAR(TemplateTypes)); \
|
||||
return Info; \
|
||||
}
|
||||
|
||||
#define STRUCT_INFO_T_INSTANTIATE(T, TArgs) \
|
||||
template const CTypeInfo& T<TArgs>::TypeInfo() const;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Enum type info
|
||||
|
||||
#if ENABLE_TYPE_INFO_NAMES
|
||||
|
||||
// Enums represented as full CEnumInfo types, with string conversion.
|
||||
#define ENUM_INFO_BEGIN(T) \
|
||||
template<> \
|
||||
const CTypeInfo&TypeInfo(const T*) { \
|
||||
static CEnumDef::SElem Elems[] = { \
|
||||
|
||||
#define ENUM_INFO_END(T) \
|
||||
}; \
|
||||
typedef TIntType<sizeof(T)>::TType TInt; \
|
||||
static CEnumInfo<TInt> Info(#T, ARRAY_VAR(Elems)); \
|
||||
return Info; \
|
||||
} \
|
||||
|
||||
#define ENUM_ELEM_INFO(Scope, Elem) \
|
||||
{ Scope Elem, #Elem },
|
||||
|
||||
#else // ENABLE_TYPE_INFO_NAMES
|
||||
|
||||
// Enums represented as simple types, with no elements or string conversion.
|
||||
#define ENUM_INFO_BEGIN(T) \
|
||||
TYPE_INFO_PLAIN(T) \
|
||||
|
||||
#define ENUM_INFO_END(T)
|
||||
#define ENUM_ELEM_INFO(Scope, Elem)
|
||||
|
||||
#endif // ENABLE_TYPE_INFO_NAMES
|
||||
|
||||
#endif // ENABLE_TYPE_INFO
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_TYPEINFO_IMPL_H
|
||||
@@ -1,492 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Description : std::set replacement implemented using sorted vector.
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_VECTORSET_H
|
||||
#define CRYINCLUDE_CRYCOMMON_VECTORSET_H
|
||||
#pragma once
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// VectorSet
|
||||
//
|
||||
// Usage Notes:
|
||||
// This class is designed to be an (almost, see below) drop-in replacement
|
||||
// for std::set. It features an almost identical interface, but it is
|
||||
// implemented using a sorted vector rather than a tree. This is in most
|
||||
// cases more efficient, as there is less dynamic memory allocation and
|
||||
// pointer dereferencing.
|
||||
//
|
||||
// *************************************************************************
|
||||
// PLEASE NOTE: There is one vital difference between std::set and VectorSet
|
||||
// that you will need to note before trying to replace std::set. Since
|
||||
// VectorSet is implemented using a vector, iterators can and will be
|
||||
// invalidated by many operations, such as insertions and deletions, and
|
||||
// due to sorting potentially even normal lookups. Please Please PLEASE make
|
||||
// sure that you are not storing any iterators to this class.
|
||||
// *************************************************************************
|
||||
//
|
||||
// The class varies from the std::set API in that two of the erase methods
|
||||
// methods are not of void return type but return an iterator - this is
|
||||
// required in practice because they invalidate iterators, as noted above.
|
||||
//
|
||||
// * iterator erase(iterator where);
|
||||
// * iterator erase(iterator first, iterator last);
|
||||
//
|
||||
// It also adds operator[] to the API.
|
||||
//
|
||||
//
|
||||
// Performance Notes:
|
||||
//
|
||||
// This class uses the empty base optimization hack to allow comparison
|
||||
// predicate objects that have no state to take up no space in the object.
|
||||
// As a result the size of the overall VectorMap instance is the same as
|
||||
// that of the std::vector it uses to store the elements.
|
||||
//
|
||||
// In addition to the normal map interface, this class provides the
|
||||
// following members that can be used to manage memory requirements:
|
||||
//
|
||||
// * void reserve(size_type count);
|
||||
// Allocate enough space for count elements (see vector::reserve()).
|
||||
//
|
||||
// * size_type capacity() const;
|
||||
// Report how many elements can be stored without reallocating (see
|
||||
// vector::capacity()).
|
||||
//
|
||||
// * void resize(size_type new_size, const_reference x=key_type());
|
||||
// see vector::resize()).
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
template <typename K, typename T = AZStd::less<K>, typename A = AZ::StdLegacyAllocator >
|
||||
class VectorSet
|
||||
: private T // Empty base optimization
|
||||
{
|
||||
public:
|
||||
typedef K key_type;
|
||||
typedef A allocator_type;
|
||||
typedef T key_compare;
|
||||
typedef T value_compare;
|
||||
typedef AZStd::vector<key_type, allocator_type> container_type;
|
||||
typedef typename container_type::iterator iterator;
|
||||
typedef typename container_type::const_iterator const_iterator;
|
||||
typedef typename container_type::reverse_iterator reverse_iterator;
|
||||
typedef typename container_type::const_reverse_iterator const_reverse_iterator;
|
||||
typedef typename container_type::size_type size_type;
|
||||
typedef typename container_type::difference_type difference_type;
|
||||
typedef key_type& reference;
|
||||
typedef const key_type& const_reference;
|
||||
typedef key_type* pointer;
|
||||
typedef const key_type* const_pointer;
|
||||
|
||||
VectorSet();
|
||||
explicit VectorSet(const key_compare& comp);
|
||||
explicit VectorSet(const key_compare& comp, const allocator_type& allocator);
|
||||
VectorSet(const VectorSet<K, T, A>& right);
|
||||
template <class InputIterator>
|
||||
VectorSet(InputIterator first, InputIterator last);
|
||||
template <class InputIterator>
|
||||
VectorSet(InputIterator first, InputIterator last, const key_compare& comp);
|
||||
template <class InputIterator>
|
||||
VectorSet(InputIterator first, InputIterator last, const key_compare& comp, const allocator_type& allocator);
|
||||
void SwapElementsWithVector(container_type& elementVector);
|
||||
const_iterator begin() const;
|
||||
iterator begin();
|
||||
size_type capacity() const;
|
||||
void resize(size_type __new_size, const_reference __x = key_type());
|
||||
void clear();
|
||||
size_type count(const_reference key) const;
|
||||
bool empty() const;
|
||||
const_iterator end() const;
|
||||
iterator end();
|
||||
std::pair<const_iterator, const_iterator> equal_range(const_reference key) const;
|
||||
std::pair<iterator, iterator> equal_range(const_reference key);
|
||||
iterator erase(iterator where); // See documentation above
|
||||
iterator erase(iterator first, iterator last); // See documentation above
|
||||
size_t erase(const_reference key);
|
||||
iterator find(const_reference key);
|
||||
const_iterator find(const_reference key) const;
|
||||
allocator_type get_allocator() const;
|
||||
std::pair<iterator, bool> insert(const_reference value);
|
||||
iterator insert(iterator _Where, const_reference value);
|
||||
template<class InputIterator>
|
||||
void insert(InputIterator first, InputIterator last);
|
||||
key_compare key_comp() const;
|
||||
const_iterator lower_bound(const_reference key) const;
|
||||
iterator lower_bound(const_reference key);
|
||||
size_type max_size() const;
|
||||
const_reverse_iterator rbegin() const;
|
||||
reverse_iterator rbegin();
|
||||
const_reverse_iterator rend() const;
|
||||
reverse_iterator rend();
|
||||
void reserve(size_type count);
|
||||
size_type size() const;
|
||||
void swap(VectorSet& right);
|
||||
const_iterator upper_bound(const_reference key) const;
|
||||
iterator upper_bound(const_reference key);
|
||||
value_compare value_comp() const;
|
||||
reference operator[](int index); // See documentation above
|
||||
const_reference operator[](int index) const; // See documentation above
|
||||
|
||||
template<typename Sizer>
|
||||
void GetMemoryUsage(Sizer* pSizer) const
|
||||
{
|
||||
pSizer->AddObject(m_entries);
|
||||
}
|
||||
private:
|
||||
container_type m_entries;
|
||||
};
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
VectorSet<K, T, A>::VectorSet()
|
||||
{
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
VectorSet<K, T, A>::VectorSet(const key_compare& comp)
|
||||
: key_compare(comp)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
VectorSet<K, T, A>::VectorSet(const key_compare& comp, const allocator_type& allocator)
|
||||
: key_compare(comp)
|
||||
, m_entries(allocator)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
VectorSet<K, T, A>::VectorSet(const VectorSet<K, T, A>& right)
|
||||
: key_compare(right)
|
||||
, m_entries(right.m_entries)
|
||||
{
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
template <class InputIterator>
|
||||
VectorSet<K, T, A>::VectorSet(InputIterator first, InputIterator last)
|
||||
{
|
||||
for (; first != last; ++first)
|
||||
{
|
||||
m_entries.push_back(*first);
|
||||
}
|
||||
std::sort(m_entries.begin(), m_entries.end(), static_cast<key_compare>(*this));
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
template <class InputIterator>
|
||||
VectorSet<K, T, A>::VectorSet(InputIterator first, InputIterator last, const key_compare& comp)
|
||||
: key_compare(comp)
|
||||
{
|
||||
for (; first != last; ++first)
|
||||
{
|
||||
m_entries.push_back(*first);
|
||||
}
|
||||
std::sort(m_entries.begin(), m_entries.end(), static_cast<key_compare>(*this));
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
template <class InputIterator>
|
||||
VectorSet<K, T, A>::VectorSet(InputIterator first, InputIterator last, const key_compare& comp, const allocator_type& allocator)
|
||||
: key_compare(comp)
|
||||
, m_entries(allocator)
|
||||
{
|
||||
for (; first != last; ++first)
|
||||
{
|
||||
m_entries.push_back(*first);
|
||||
}
|
||||
std::sort(m_entries.begin(), m_entries.end(), static_cast<key_compare>(*this));
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
void VectorSet<K, T, A>::SwapElementsWithVector(container_type& elementVector)
|
||||
{
|
||||
m_entries.swap(elementVector);
|
||||
std::sort(m_entries.begin(), m_entries.end(), static_cast<key_compare>(*this));
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::const_iterator VectorSet<K, T, A>::begin() const
|
||||
{
|
||||
return m_entries.begin();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::iterator VectorSet<K, T, A>::begin()
|
||||
{
|
||||
return m_entries.begin();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::size_type VectorSet<K, T, A>::capacity() const
|
||||
{
|
||||
return m_entries.capacity();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
void VectorSet<K, T, A>::clear()
|
||||
{
|
||||
m_entries.clear();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
void VectorSet<K, T, A>::resize(size_type __new_size, const_reference __x)
|
||||
{
|
||||
m_entries.resize(__new_size, __x);
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::size_type VectorSet<K, T, A>::count(const_reference key) const
|
||||
{
|
||||
return size_type(std::binary_search(m_entries.begin(), m_entries.end(), key, static_cast<key_compare>(*this)));
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
bool VectorSet<K, T, A>::empty() const
|
||||
{
|
||||
return m_entries.empty();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::const_iterator VectorSet<K, T, A>::end() const
|
||||
{
|
||||
return m_entries.end();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::iterator VectorSet<K, T, A>::end()
|
||||
{
|
||||
return m_entries.end();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
std::pair<typename VectorSet<K, T, A>::const_iterator, typename VectorSet<K, T, A>::const_iterator> VectorSet<K, T, A>::equal_range(const_reference key) const
|
||||
{
|
||||
const_iterator lower = lower_bound(key);
|
||||
if (lower != m_entries.end() && key_compare::operator()(key, *lower))
|
||||
{
|
||||
lower = m_entries.end();
|
||||
}
|
||||
const_iterator upper = lower;
|
||||
if (upper != m_entries.end())
|
||||
{
|
||||
++upper;
|
||||
}
|
||||
return std::make_pair(lower, upper);
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
std::pair<typename VectorSet<K, T, A>::iterator, typename VectorSet<K, T, A>::iterator> VectorSet<K, T, A>::equal_range(const_reference key)
|
||||
{
|
||||
iterator lower = lower_bound(key);
|
||||
if (lower != m_entries.end() && key_compare::operator()(key, *lower))
|
||||
{
|
||||
lower = m_entries.end();
|
||||
}
|
||||
iterator upper = lower;
|
||||
if (upper != m_entries.end())
|
||||
{
|
||||
++upper;
|
||||
}
|
||||
return std::make_pair(lower, upper);
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::iterator VectorSet<K, T, A>::erase(iterator where)
|
||||
{
|
||||
return m_entries.erase(where);
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::iterator VectorSet<K, T, A>::erase(iterator first, iterator last)
|
||||
{
|
||||
return m_entries.erase(first, last);
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
size_t VectorSet<K, T, A>::erase(const_reference key)
|
||||
{
|
||||
iterator where = find(key);
|
||||
|
||||
if (where != m_entries.end())
|
||||
{
|
||||
// Note erasing entries does not invalidate the sort - no need to trigger a re-sort.
|
||||
m_entries.erase(where);
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::iterator VectorSet<K, T, A>::find(const_reference key)
|
||||
{
|
||||
iterator it = lower_bound(key);
|
||||
if (it != m_entries.end() && key_compare::operator()(key, *it))
|
||||
{
|
||||
it = m_entries.end();
|
||||
}
|
||||
return it;
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::const_iterator VectorSet<K, T, A>::find(const_reference key) const
|
||||
{
|
||||
const_iterator it = lower_bound(key);
|
||||
if (it != m_entries.end() && key_compare::operator()(key, *it))
|
||||
{
|
||||
it = m_entries.end();
|
||||
}
|
||||
return it;
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::allocator_type VectorSet<K, T, A>::get_allocator() const
|
||||
{
|
||||
return m_entries.get_allocator();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
std::pair<typename VectorSet<K, T, A>::iterator, bool> VectorSet<K, T, A>::insert(const_reference value)
|
||||
{
|
||||
iterator it = lower_bound(value);
|
||||
bool insertionMade = false;
|
||||
if (it == m_entries.end() || key_compare::operator()(value, (*it)))
|
||||
{
|
||||
it = m_entries.insert(it, value), insertionMade = true;
|
||||
}
|
||||
return std::make_pair(it, insertionMade);
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::iterator VectorSet<K, T, A>::insert(iterator where, const_reference value)
|
||||
{
|
||||
return insert(value);
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
template<class InputIterator>
|
||||
void VectorSet<K, T, A>::insert(InputIterator first, InputIterator last)
|
||||
{
|
||||
for (; first != last; ++first)
|
||||
{
|
||||
insert(*first);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::key_compare VectorSet<K, T, A>::key_comp() const
|
||||
{
|
||||
return static_cast<key_compare>(*this);
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::const_iterator VectorSet<K, T, A>::lower_bound(const_reference key) const
|
||||
{
|
||||
return std::lower_bound(m_entries.begin(), m_entries.end(), key, static_cast<key_compare>(*this));
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::iterator VectorSet<K, T, A>::lower_bound(const_reference key)
|
||||
{
|
||||
return std::lower_bound(m_entries.begin(), m_entries.end(), key, static_cast<key_compare>(*this));
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::size_type VectorSet<K, T, A>::max_size() const
|
||||
{
|
||||
return m_entries.max_size();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::const_reverse_iterator VectorSet<K, T, A>::rbegin() const
|
||||
{
|
||||
return m_entries.rbegin();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::reverse_iterator VectorSet<K, T, A>::rbegin()
|
||||
{
|
||||
return m_entries.rbegin();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::const_reverse_iterator VectorSet<K, T, A>::rend() const
|
||||
{
|
||||
return m_entries.rend();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::reverse_iterator VectorSet<K, T, A>::rend()
|
||||
{
|
||||
return m_entries.rend();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
void VectorSet<K, T, A>::reserve(size_type count)
|
||||
{
|
||||
m_entries.reserve(count);
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::size_type VectorSet<K, T, A>::size() const
|
||||
{
|
||||
return m_entries.size();
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
void VectorSet<K, T, A>::swap(VectorSet& other)
|
||||
{
|
||||
m_entries.swap(other.m_entries);
|
||||
std::swap(static_cast<key_compare&>(*this), static_cast<key_compare&>(other));
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::const_iterator VectorSet<K, T, A>::upper_bound(const_reference key) const
|
||||
{
|
||||
const_iterator upper = lower_bound(key);
|
||||
if (upper != m_entries.end() && !key_compare::operator()(key, *upper))
|
||||
{
|
||||
++upper;
|
||||
}
|
||||
return upper;
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::iterator VectorSet<K, T, A>::upper_bound(const_reference key)
|
||||
{
|
||||
iterator upper = lower_bound(key);
|
||||
if (upper != m_entries.end() && !key_compare::operator()(key, *upper))
|
||||
{
|
||||
++upper;
|
||||
}
|
||||
return upper;
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::value_compare VectorSet<K, T, A>::value_comp() const
|
||||
{
|
||||
return static_cast<key_compare>(*this);
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::reference VectorSet<K, T, A>::operator[](int index)
|
||||
{
|
||||
return m_entries[index];
|
||||
}
|
||||
|
||||
template <typename K, typename T, typename A>
|
||||
typename VectorSet<K, T, A>::const_reference VectorSet<K, T, A>::operator[](int index) const
|
||||
{
|
||||
return m_entries[index];
|
||||
}
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_VECTORSET_H
|
||||
@@ -9,6 +9,9 @@
|
||||
#include <AzCore/std/containers/vector.h>
|
||||
#include <AzCore/std/string/string.h>
|
||||
#include <AzCore/std/containers/array.h>
|
||||
#include <CryCommon/BaseTypes.h>
|
||||
#include <CryCommon/VertexFormats.h>
|
||||
|
||||
namespace AZ
|
||||
{
|
||||
namespace Vertex
|
||||
@@ -77,7 +80,7 @@ namespace AZ
|
||||
UInt32_4,
|
||||
|
||||
NumTypes
|
||||
};
|
||||
};
|
||||
|
||||
struct AttributeTypeData
|
||||
{
|
||||
@@ -127,15 +130,15 @@ namespace AZ
|
||||
return (static_cast<uint8>(type) << kUsageBitCount) | static_cast<uint8>(usage);
|
||||
}
|
||||
static AttributeUsage GetUsage(const uint8 attribute)
|
||||
{
|
||||
{
|
||||
return static_cast<AttributeUsage>(attribute & kUsageMask);
|
||||
}
|
||||
static AttributeType GetType(const uint8 attribute)
|
||||
{
|
||||
{
|
||||
return static_cast<AttributeType>((attribute & kTypeMask) >> kUsageBitCount);
|
||||
}
|
||||
static uint8 GetByteLength(const uint8 attribute)
|
||||
{
|
||||
{
|
||||
return AttributeTypeDataTable[(uint)GetType(attribute)].byteSize;
|
||||
}
|
||||
static const AZStd::string& GetSemanticName(uint8 attribute)
|
||||
@@ -167,126 +170,22 @@ namespace AZ
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
m_enum = eVF_P3F_C4B_T2F;
|
||||
break;
|
||||
case eVF_P3F_C4B_T2F_T2F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
m_enum = eVF_P3F_C4B_T2F_T2F;
|
||||
break;
|
||||
case eVF_P3S_C4B_T2S:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float16_4));// vec3f16 is backed by a CryHalf4
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2));
|
||||
m_enum = eVF_P3S_C4B_T2S;
|
||||
break;
|
||||
case eVF_P3S_C4B_T2S_T2S:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float16_4));// vec3f16 is backed by a CryHalf4
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2));
|
||||
m_enum = eVF_P3S_C4B_T2S_T2S;
|
||||
break;
|
||||
case eVF_P3S_N4B_C4B_T2S:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float16_4));// vec3f16 is backed by a CryHalf4
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Normal, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2));
|
||||
m_enum = eVF_P3S_N4B_C4B_T2S;
|
||||
break;
|
||||
case eVF_P3F_C4B_T4B_N3F2:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Tangent, AttributeType::Float32_3));//x-axis
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::BiTangent, AttributeType::Float32_3));//y-axis
|
||||
#ifdef PARTICLE_MOTION_BLUR // Nonfunctional and disabled.
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));//prevPos
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Tangent, AttributeType::Float32_3));//prevXTan
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::BiTangent, AttributeType::Float32_3));//prevYTan
|
||||
#endif
|
||||
m_enum = eVF_P3F_C4B_T4B_N3F2;// Particles.
|
||||
break;
|
||||
case eVF_TP3F_C4B_T2F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
m_enum = eVF_TP3F_C4B_T2F;// Fonts (28 bytes).
|
||||
break;
|
||||
case eVF_TP3F_T2F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_TP3F_T2F_T3F;
|
||||
break;
|
||||
case eVF_P3F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_T3F; // Miscellaneus.
|
||||
break;
|
||||
case eVF_P3F_T2F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_T2F_T3F;
|
||||
break;
|
||||
// Additional streams
|
||||
case eVF_T2F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
m_enum = eVF_T2F; // Light maps TC (8 bytes).
|
||||
break;
|
||||
case eVF_W4B_I4S:// Skinned weights/indices stream.
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Weights, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Indices, AttributeType::UInt16_4));
|
||||
m_enum = eVF_W4B_I4S;
|
||||
break;
|
||||
case eVF_C4B_C4B:// SH coefficients.
|
||||
// We use the "Weights" usage since sh coefs use an unknown usage of 4 bytes.
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Weights, AttributeType::Byte_4)); //coef0
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Weights, AttributeType::Byte_4)); //coef1
|
||||
m_enum = eVF_C4B_C4B;
|
||||
break;
|
||||
case eVF_P3F_P3F_I4B:// Shape deformation stream.
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); //thin
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3)); //fat
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Indices, AttributeType::Byte_4));
|
||||
m_enum = eVF_P3F_P3F_I4B;
|
||||
break;
|
||||
case eVF_P3F:// Velocity stream.
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F;
|
||||
break;
|
||||
case eVF_C4B_T2S:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2));
|
||||
m_enum = eVF_C4B_T2S;// General (Position is merged with Tangent stream)
|
||||
break;
|
||||
case eVF_P2F_T4F_C4F: // Lens effects simulation
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
m_enum = eVF_P2F_T4F_C4F;
|
||||
break;
|
||||
case eVF_P2F_T4F_T4F_C4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
m_enum = eVF_P2F_T4F_T4F_C4F;
|
||||
break;
|
||||
case eVF_P2S_N4B_C4B_T1F:// terrain
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float16_2));// xy-coordinates in terrain
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Normal, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));// z-coordinate in terrain
|
||||
m_enum = eVF_P2S_N4B_C4B_T1F;
|
||||
break;
|
||||
case eVF_P3F_C4B_T2S:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float16_2));
|
||||
m_enum = eVF_P3F_C4B_T2S;
|
||||
break;
|
||||
case eVF_P2F_C4B_T2F_F4B:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
@@ -299,546 +198,6 @@ namespace AZ
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Byte_4));
|
||||
m_enum = eVF_P3F_C4B;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
m_enum = eVF_P3F_C4F_T2F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T2F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T3F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T2F_T3F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T1F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
m_enum = eVF_P3F_C4F_T2F_T1F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T1F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T2F_T1F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T1F_T3F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T2F_T1F_T3F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T3F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T3F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T1F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T1F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T1F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T1F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F;
|
||||
break;
|
||||
case eVF_P4F_T2F_C4F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P4F_T2F_C4F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T3F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T3F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T1F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T1F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T1F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T1F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T1F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F;
|
||||
break;
|
||||
case eVF_P4F_T2F_C4F_T4F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P4F_T2F_C4F_T4F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T3F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T3F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T1F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T1F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T1F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T1F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T1F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_1));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_3));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F_T4F;
|
||||
break;
|
||||
case eVF_P4F_T2F_C4F_T4F_T4F_T4F_T4F:
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Position, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_2));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::Color, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
AddAttribute(Attribute::CreateAttribute(AttributeUsage::TexCoord, AttributeType::Float32_4));
|
||||
m_enum = eVF_P4F_T2F_C4F_T4F_T4F_T4F_T4F;
|
||||
break;
|
||||
case eVF_Max:
|
||||
default:
|
||||
AZ_Error("VF", false, "Invalid vertex format");
|
||||
@@ -854,115 +213,19 @@ namespace AZ
|
||||
static const uint8 kHas16BitFloatTexCoords = 0x2;
|
||||
static const uint8 kHas32BitFloatTexCoords = 0x1;
|
||||
|
||||
|
||||
//! Helper function to check to see if the vertex format has a position attribute that uses 16 bit floats for the underlying type
|
||||
bool Has16BitFloatPosition() const
|
||||
{
|
||||
return (m_flags & kHas16BitFloatPosition) != 0x0;
|
||||
}
|
||||
|
||||
//! Helper function to check to see if the vertex format has a texture coordinate attribute that uses 16 bit floats for the underlying type
|
||||
bool Has16BitFloatTextureCoordinates() const
|
||||
{
|
||||
return (m_flags & kHas16BitFloatTexCoords) != 0x0;
|
||||
}
|
||||
|
||||
//! Helper function to check to see if the vertex format has a texture coordinate attribute that uses 32 bit floats for the underlying type
|
||||
bool Has32BitFloatTextureCoordinates() const
|
||||
{
|
||||
return (m_flags & kHas32BitFloatTexCoords) != 0x0;
|
||||
}
|
||||
|
||||
|
||||
uint32 GetAttributeUsageCount(AttributeUsage usage) const
|
||||
{
|
||||
return (uint32)m_attributeUsageCounts[(uint)usage];
|
||||
}
|
||||
|
||||
bool TryGetAttributeOffsetAndType(AttributeUsage usage, uint32 index, uint& outOffset, AttributeType& outType) const
|
||||
{
|
||||
outOffset = 0;
|
||||
outType = AttributeType::NumTypes;
|
||||
for (uint ii=0; ii < m_numAttributes; ++ii)
|
||||
{
|
||||
uint8 attribute = m_vertexAttributes[ii];
|
||||
if (Attribute::GetUsage(attribute) == usage)
|
||||
{
|
||||
if (index == 0)
|
||||
{
|
||||
outType = Attribute::GetType(attribute);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
--index;
|
||||
}
|
||||
}
|
||||
outOffset += Attribute::GetByteLength(attribute);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
uint8 GetAttributeByteLength(AttributeUsage usage) const
|
||||
{
|
||||
for (uint ii = 0; ii < m_numAttributes; ++ii)
|
||||
{
|
||||
uint8 attribute = m_vertexAttributes[ii];
|
||||
if (Attribute::GetUsage(attribute) == usage)
|
||||
{
|
||||
return Attribute::GetByteLength(attribute);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const uint8* GetAttributes( uint32 &outCount) const
|
||||
{
|
||||
outCount = m_numAttributes;
|
||||
return m_vertexAttributes;
|
||||
}
|
||||
|
||||
//! Return true if the vertex format is a superset of the input
|
||||
bool IsSupersetOf(const AZ::Vertex::Format& input) const
|
||||
{
|
||||
uint32 count = 0;
|
||||
const uint8* attributes = input.GetAttributes(count);
|
||||
for ( uint8 ii=0; ii<count; ++ii)
|
||||
{
|
||||
const uint8 attribute = attributes[ii];
|
||||
if (GetAttributeUsageCount(Attribute::GetUsage(attribute)) < input.GetAttributeUsageCount(Attribute::GetUsage(attribute)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
uint GetStride(void) const { return m_stride; }
|
||||
|
||||
//! Returns the true if an attribute with the given usage is found, false otherwise
|
||||
bool TryCalculateOffset(uint& offset, AttributeUsage usage, uint index = 0) const
|
||||
{
|
||||
offset = 0;
|
||||
for (uint ii = 0; ii < m_numAttributes; ++ii)
|
||||
{
|
||||
uint8 attribute = m_vertexAttributes[ii];
|
||||
if (Attribute::GetUsage(attribute) == usage)
|
||||
{
|
||||
if (index == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
--index;
|
||||
}
|
||||
}
|
||||
offset += Attribute::GetByteLength(attribute);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Quick comparison operators.
|
||||
bool operator==(const Format& other) const
|
||||
@@ -1039,7 +302,7 @@ namespace AZ
|
||||
|
||||
m_stride = static_cast<uint8>(stride);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PARTICLE_MOTION_BLUR
|
||||
@@ -1056,34 +319,5 @@ namespace AZ
|
||||
uint8 m_flags = 0x0;
|
||||
};
|
||||
|
||||
|
||||
// bNeedNormals=1 - float normals; bNeedNormals=2 - byte normals //waltont TODO (this was copied as is from vertexformats.h) this comment is out of date and the function does not even use all the parameters. This should be replaceable with the new vertex class, and should be replaced when refactoring CHWShader_D3D::mfVertexFormat which handles the shader parsing/serialization
|
||||
_inline Format VertFormatForComponents([[maybe_unused]] bool bNeedCol, [[maybe_unused]] bool bHasTC, bool bHasTC2, bool bHasPS, bool bHasNormal)
|
||||
{
|
||||
AZ::Vertex::Format RequestedVertFormat;
|
||||
|
||||
if (bHasPS)
|
||||
{
|
||||
RequestedVertFormat = AZ::Vertex::Format(eVF_P3F_C4B_T4B_N3F2);
|
||||
}
|
||||
else
|
||||
if (bHasNormal)
|
||||
{
|
||||
RequestedVertFormat = AZ::Vertex::Format(eVF_P3S_N4B_C4B_T2S);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!bHasTC2)
|
||||
{
|
||||
RequestedVertFormat = AZ::Vertex::Format(eVF_P3S_C4B_T2S);
|
||||
}
|
||||
else
|
||||
{
|
||||
RequestedVertFormat = AZ::Vertex::Format(eVF_P3F_C4B_T2F_T2F);
|
||||
}
|
||||
}
|
||||
|
||||
return RequestedVertFormat;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,12 +7,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_VERTEXFORMATS_H
|
||||
#define CRYINCLUDE_CRYCOMMON_VERTEXFORMATS_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <CryArray.h>
|
||||
#include <CryCommon/Cry_Math.h>
|
||||
// Stream Configuration options
|
||||
#define ENABLE_NORMALSTREAM_SUPPORT 1
|
||||
|
||||
@@ -22,94 +19,16 @@ enum EVertexFormat : uint8
|
||||
|
||||
// Base stream
|
||||
eVF_P3F_C4B_T2F,
|
||||
eVF_P3F_C4B_T2F_T2F,
|
||||
eVF_P3S_C4B_T2S,
|
||||
eVF_P3S_C4B_T2S_T2S, // For UV2 support
|
||||
eVF_P3S_N4B_C4B_T2S,
|
||||
|
||||
eVF_P3F_C4B_T4B_N3F2, // Particles.
|
||||
eVF_TP3F_C4B_T2F, // Fonts (28 bytes).
|
||||
eVF_TP3F_T2F_T3F, // Miscellaneus.
|
||||
eVF_P3F_T3F, // Miscellaneus. (AuxGeom)
|
||||
eVF_P3F_T2F_T3F, // Miscellaneus.
|
||||
|
||||
// Additional streams
|
||||
eVF_T2F, // Light maps TC (8 bytes).
|
||||
eVF_W4B_I4S, // Skinned weights/indices stream.
|
||||
eVF_C4B_C4B, // SH coefficients.
|
||||
eVF_P3F_P3F_I4B, // Shape deformation stream.
|
||||
eVF_P3F, // Velocity stream.
|
||||
|
||||
eVF_C4B_T2S, // General (Position is merged with Tangent stream)
|
||||
|
||||
// Lens effects simulation
|
||||
eVF_P2F_T4F_C4F, // primary
|
||||
eVF_P2F_T4F_T4F_C4F,
|
||||
|
||||
eVF_P2S_N4B_C4B_T1F,
|
||||
eVF_P3F_C4B_T2S,
|
||||
eVF_P2F_C4B_T2F_F4B, // UI
|
||||
eVF_P3F_C4B,// Auxiliary geometry
|
||||
|
||||
|
||||
eVF_P3F_C4F_T2F, //numbering for tracking the new vertex formats and for comparison with testing 23
|
||||
eVF_P3F_C4F_T2F_T3F,
|
||||
eVF_P3F_C4F_T2F_T3F_T3F,
|
||||
eVF_P3F_C4F_T2F_T1F,
|
||||
eVF_P3F_C4F_T2F_T1F_T3F,
|
||||
eVF_P3F_C4F_T2F_T1F_T3F_T3F,
|
||||
eVF_P3F_C4F_T4F_T2F,
|
||||
eVF_P3F_C4F_T4F_T2F_T3F, //30
|
||||
eVF_P3F_C4F_T4F_T2F_T3F_T3F,
|
||||
eVF_P3F_C4F_T4F_T2F_T1F,
|
||||
eVF_P3F_C4F_T4F_T2F_T1F_T3F,
|
||||
eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F, //35
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T3F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T1F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F, //40
|
||||
eVF_P4F_T2F_C4F_T4F_T4F,
|
||||
eVF_P3F_C4F_T2F_T4F,
|
||||
eVF_P3F_C4F_T2F_T3F_T4F,
|
||||
eVF_P3F_C4F_T2F_T3F_T3F_T4F,
|
||||
eVF_P3F_C4F_T2F_T1F_T4F, //45
|
||||
eVF_P3F_C4F_T2F_T1F_T3F_T4F,
|
||||
eVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F,
|
||||
eVF_P3F_C4F_T4F_T2F_T4F,
|
||||
eVF_P3F_C4F_T4F_T2F_T3F_T4F,
|
||||
eVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F, //50
|
||||
eVF_P3F_C4F_T4F_T2F_T1F_T4F,
|
||||
eVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F,
|
||||
eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T4F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F, //55
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F,
|
||||
eVF_P4F_T2F_C4F_T4F_T4F_T4F, //60
|
||||
eVF_P3F_C4F_T2F_T4F_T4F,
|
||||
eVF_P3F_C4F_T2F_T3F_T4F_T4F,
|
||||
eVF_P3F_C4F_T2F_T3F_T3F_T4F_T4F,
|
||||
eVF_P3F_C4F_T2F_T1F_T4F_T4F,
|
||||
eVF_P3F_C4F_T2F_T1F_T3F_T4F_T4F, //65
|
||||
eVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F_T4F,
|
||||
eVF_P3F_C4F_T4F_T2F_T4F_T4F,
|
||||
eVF_P3F_C4F_T4F_T2F_T3F_T4F_T4F,
|
||||
eVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F_T4F,
|
||||
eVF_P3F_C4F_T4F_T2F_T1F_T4F_T4F, //70
|
||||
eVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F_T4F,
|
||||
eVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F_T4F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T4F_T4F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F_T4F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F_T4F, //75
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F_T4F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F_T4F,
|
||||
eVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F_T4F,
|
||||
eVF_P4F_T2F_C4F_T4F_T4F_T4F_T4F,
|
||||
|
||||
eVF_Max,
|
||||
};
|
||||
|
||||
@@ -143,8 +62,6 @@ struct UCol
|
||||
(bcolor[2] - 128.0f) / 127.5f
|
||||
);
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct Vec3f16
|
||||
@@ -242,14 +159,6 @@ struct SVF_P3F_C4B_T2F
|
||||
Vec2 st;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4B_T2F_T2F
|
||||
{
|
||||
Vec3 xyz;
|
||||
UCol color;
|
||||
Vec2 st;
|
||||
Vec2 st2;
|
||||
};
|
||||
|
||||
struct SVF_P2F_C4B_T2F_F4B
|
||||
{
|
||||
Vec2 xy;
|
||||
@@ -261,743 +170,23 @@ struct SVF_P2F_C4B_T2F_F4B
|
||||
uint8 pad;
|
||||
};
|
||||
|
||||
struct SVF_TP3F_C4B_T2F //Fonts
|
||||
{
|
||||
Vec4 pos;
|
||||
UCol color;
|
||||
Vec2 st;
|
||||
};
|
||||
struct SVF_P3S_C4B_T2S
|
||||
{
|
||||
Vec3f16 xyz;
|
||||
UCol color;
|
||||
Vec2f16 st;
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct SVF_P3S_C4B_T2S_T2S
|
||||
{
|
||||
Vec3f16 xyz;
|
||||
UCol color;
|
||||
Vec2f16 st;
|
||||
Vec2f16 st2;
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4B_T2S
|
||||
{
|
||||
Vec3 xyz;
|
||||
UCol color;
|
||||
Vec2f16 st;
|
||||
};
|
||||
|
||||
struct SVF_P3S_N4B_C4B_T2S
|
||||
{
|
||||
Vec3f16 xyz;
|
||||
UCol normal;
|
||||
UCol color;
|
||||
Vec2f16 st;
|
||||
};
|
||||
|
||||
struct SVF_P2S_N4B_C4B_T1F
|
||||
{
|
||||
CryHalf2 xy;
|
||||
UCol normal;
|
||||
UCol color;
|
||||
float z;
|
||||
};
|
||||
|
||||
struct SVF_T2F
|
||||
{
|
||||
Vec2 st;
|
||||
};
|
||||
struct SVF_W4B_I4S
|
||||
{
|
||||
UCol weights;
|
||||
uint16 indices[4];
|
||||
};
|
||||
struct SVF_C4B_C4B
|
||||
{
|
||||
UCol coef0;
|
||||
UCol coef1;
|
||||
};
|
||||
struct SVF_P3F_P3F_I4B
|
||||
{
|
||||
Vec3 thin;
|
||||
Vec3 fat;
|
||||
UCol index;
|
||||
};
|
||||
|
||||
struct SVF_P3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
};
|
||||
struct SVF_P3F_T3F
|
||||
{
|
||||
Vec3 p;
|
||||
Vec3 st;
|
||||
};
|
||||
struct SVF_P3F_T2F_T3F
|
||||
{
|
||||
Vec3 p;
|
||||
Vec2 st0;
|
||||
Vec3 st1;
|
||||
};
|
||||
struct SVF_TP3F_T2F_T3F
|
||||
{
|
||||
Vec4 p;
|
||||
Vec2 st0;
|
||||
Vec3 st1;
|
||||
};
|
||||
struct SVF_P2F_T4F_C4F
|
||||
{
|
||||
Vec2 p;
|
||||
Vec4 st;
|
||||
Vec4 color;
|
||||
};
|
||||
|
||||
struct SVF_P2F_T4F_T4F_C4F
|
||||
{
|
||||
Vec2 p;
|
||||
Vec4 st;
|
||||
Vec4 st2;
|
||||
Vec4 color;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4B_I4B_PS4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec2 prevXaxis;
|
||||
Vec2 prevYaxis;
|
||||
UCol color;
|
||||
Vec3 prevPos;
|
||||
struct SpriteInfo
|
||||
{
|
||||
uint8 tex_x, tex_y, tex_z, backlight; // xyzw
|
||||
} info;
|
||||
Vec2 xaxis;
|
||||
Vec2 yaxis;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4B_T4B_N3F2
|
||||
{
|
||||
Vec3 xyz;
|
||||
UCol color;
|
||||
UCol st; // st is used as a color, even though st usually refers to a TexCoord
|
||||
Vec3 xaxis;
|
||||
Vec3 yaxis;
|
||||
#ifdef PARTICLE_MOTION_BLUR
|
||||
Vec3 prevPos;
|
||||
Vec3 prevXTan;
|
||||
Vec3 prevYTan;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct SVF_C4B_T2S
|
||||
{
|
||||
UCol color;
|
||||
Vec2f16 st;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec3 st1;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T3F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec3 st1;
|
||||
Vec3 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T1F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st;
|
||||
float z;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T1F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
float z;
|
||||
Vec3 st1;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T1F_T3F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
float z;
|
||||
Vec3 st1;
|
||||
Vec3 st2;
|
||||
};
|
||||
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
Vec3 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T3F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T1F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T1F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T1F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z0;
|
||||
float z1;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z0;
|
||||
float z1;
|
||||
Vec3 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z0;
|
||||
float z1;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
};
|
||||
|
||||
struct SVF_P4F_T2F_C4F_T4F_T4F
|
||||
{
|
||||
Vec4 xyzw;
|
||||
Vec2 st0;
|
||||
Vec4 color;
|
||||
Vec4 st1;
|
||||
Vec4 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec4 st1;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec3 st1;
|
||||
Vec4 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T3F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec3 st1;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T1F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
float z;
|
||||
Vec4 st1;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T1F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
float z;
|
||||
Vec3 st1;
|
||||
Vec4 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
float z;
|
||||
Vec3 st1;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
Vec4 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T1F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec4 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec4 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z0;
|
||||
float z1;
|
||||
Vec4 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z0;
|
||||
float z1;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z0;
|
||||
float z1;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
struct SVF_P4F_T2F_C4F_T4F_T4F_T4F
|
||||
{
|
||||
Vec4 xyzw;
|
||||
Vec2 st0;
|
||||
Vec4 color;
|
||||
Vec4 st1;
|
||||
Vec4 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec4 st1;
|
||||
Vec4 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec3 st1;
|
||||
Vec4 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T3F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec3 st1;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T1F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
float z;
|
||||
Vec4 st1;
|
||||
Vec4 st2;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T1F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
float z;
|
||||
Vec3 st1;
|
||||
Vec4 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T1F_T3F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
float z;
|
||||
Vec3 st1;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
Vec4 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T3F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
Vec4 st4;
|
||||
Vec4 st5;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T1F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec4 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T1F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T4F_T2F_T1F_T3F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec4 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
Vec4 st4;
|
||||
Vec4 st5;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec4 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T3F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
Vec4 st4;
|
||||
Vec4 st5;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T1F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z0;
|
||||
float z1;
|
||||
Vec4 st2;
|
||||
Vec4 st3;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z0;
|
||||
float z1;
|
||||
Vec3 st2;
|
||||
Vec4 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
struct SVF_P3F_C4F_T2F_T2F_T1F_T1F_T3F_T3F_T4F_T4F
|
||||
{
|
||||
Vec3 xyz;
|
||||
Vec4 color;
|
||||
Vec2 st0;
|
||||
Vec2 st1;
|
||||
float z0;
|
||||
float z1;
|
||||
Vec3 st2;
|
||||
Vec3 st3;
|
||||
Vec4 st4;
|
||||
Vec4 st5;
|
||||
};
|
||||
|
||||
struct SVF_P4F_T2F_C4F_T4F_T4F_T4F_T4F
|
||||
{
|
||||
Vec4 xyzw;
|
||||
Vec2 st0;
|
||||
Vec4 color;
|
||||
Vec4 st1;
|
||||
Vec4 st2;
|
||||
Vec4 st3;
|
||||
Vec4 st4;
|
||||
};
|
||||
|
||||
|
||||
//=============================================================
|
||||
// Signed norm value packing [-1,+1]
|
||||
@@ -1240,8 +429,6 @@ public:
|
||||
|
||||
*this = SPipTangents(tng3, btg3, PackingSNorm::tPackB2S(Tangent.w));
|
||||
}
|
||||
|
||||
friend struct SMeshTangents;
|
||||
};
|
||||
|
||||
struct SPipQTangents
|
||||
@@ -1290,8 +477,6 @@ public:
|
||||
const Quat q = GetQ();
|
||||
return q.GetColumn2() * (q.w < 0.0f ? -1.0f : +1.0f);
|
||||
}
|
||||
|
||||
friend struct SMeshQTangents;
|
||||
};
|
||||
|
||||
struct SPipNormal
|
||||
@@ -1328,8 +513,6 @@ struct SPipNormal
|
||||
// normalize in case "trn" wasn't length-preserving
|
||||
*this = SPipNormal(trn.TransformVector(*this).normalize());
|
||||
}
|
||||
|
||||
friend struct SMeshNormal;
|
||||
};
|
||||
|
||||
//==================================================================================================
|
||||
@@ -1364,24 +547,4 @@ enum EStreamIDs
|
||||
VSF_MORPHBUDDY_WEIGHTS = 15, // Morphing weights
|
||||
};
|
||||
|
||||
// Stream Masks (Used during updating)
|
||||
enum EStreamMasks
|
||||
{
|
||||
VSM_GENERAL = 1 << VSF_GENERAL,
|
||||
VSM_TANGENTS = ((1 << VSF_TANGENTS) | (1 << VSF_QTANGENTS)),
|
||||
VSM_HWSKIN = 1 << VSF_HWSKIN_INFO,
|
||||
VSM_VERTEX_VELOCITY = 1 << VSF_VERTEX_VELOCITY,
|
||||
# if ENABLE_NORMALSTREAM_SUPPORT
|
||||
VSM_NORMALS = 1 << VSF_NORMALS,
|
||||
#endif
|
||||
|
||||
VSM_MORPHBUDDY = 1 << VSF_MORPHBUDDY,
|
||||
VSM_INSTANCED = 1 << VSF_INSTANCED,
|
||||
|
||||
VSM_MASK = ((1 << VSF_NUM) - 1),
|
||||
};
|
||||
|
||||
//==================================================================================================================
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_VERTEXFORMATS_H
|
||||
|
||||
|
||||
@@ -7,18 +7,15 @@
|
||||
#
|
||||
|
||||
set(FILES
|
||||
CryCommon.cpp
|
||||
IAudioInterfacesCommonData.h
|
||||
IAudioSystem.h
|
||||
ICmdLine.h
|
||||
IConsole.h
|
||||
IEntityRenderState.h
|
||||
IEntityRenderState_info.cpp
|
||||
IFont.h
|
||||
IFunctorBase.h
|
||||
IGem.h
|
||||
IIndexedMesh.h
|
||||
IIndexedMesh_info.cpp
|
||||
ILevelSystem.h
|
||||
ILocalizationManager.h
|
||||
LocalizationManagerBus.h
|
||||
@@ -27,19 +24,15 @@ set(FILES
|
||||
IMaterial.h
|
||||
IMiniLog.h
|
||||
IMovieSystem.h
|
||||
IPhysics.h
|
||||
IPostEffectGroup.h
|
||||
IProcess.h
|
||||
IReadWriteXMLSink.h
|
||||
IRenderAuxGeom.h
|
||||
IRenderer.h
|
||||
IRenderMesh.h
|
||||
ISerialize.h
|
||||
IShader.h
|
||||
ISplines.h
|
||||
IStatObj.h
|
||||
StatObjBus.h
|
||||
IStereoRenderer.h
|
||||
ISurfaceType.h
|
||||
ISystem.h
|
||||
ITexture.h
|
||||
@@ -49,42 +42,31 @@ set(FILES
|
||||
IWindowMessageHandler.h
|
||||
IXml.h
|
||||
MicrophoneBus.h
|
||||
physinterface.h
|
||||
HMDBus.h
|
||||
VRCommon.h
|
||||
StereoRendererBus.h
|
||||
INavigationSystem.h
|
||||
IMNM.h
|
||||
SFunctor.h
|
||||
FunctorBaseFunction.h
|
||||
FunctorBaseMember.h
|
||||
stridedptr.h
|
||||
Options.h
|
||||
SerializationTypes.h
|
||||
CryEndian.h
|
||||
CryRandomInternal.h
|
||||
Random.h
|
||||
LCGRandom.h
|
||||
CryTypeInfo.cpp
|
||||
BaseTypes.h
|
||||
MemoryAccess.h
|
||||
AnimKey.h
|
||||
BitFiddling.h
|
||||
Common_TypeInfo.cpp
|
||||
CryArray.h
|
||||
CryAssert.h
|
||||
CryCrc32.h
|
||||
CryCustomTypes.h
|
||||
CryFile.h
|
||||
CryHeaders.h
|
||||
CryHeaders_info.cpp
|
||||
CryListenerSet.h
|
||||
CryLegacyAllocator.h
|
||||
CryPath.h
|
||||
CryPodArray.h
|
||||
CrySizer.h
|
||||
CrySystemBus.h
|
||||
CryTypeInfo.h
|
||||
CryVersion.h
|
||||
LegacyAllocator.cpp
|
||||
LegacyAllocator.h
|
||||
@@ -93,7 +75,6 @@ set(FILES
|
||||
MultiThread_Containers.h
|
||||
NullAudioSystem.h
|
||||
PNoise3.h
|
||||
primitives.h
|
||||
ProjectDefines.h
|
||||
Range.h
|
||||
ScopedVariableSetter.h
|
||||
@@ -102,14 +83,9 @@ set(FILES
|
||||
smartptr.h
|
||||
StlUtils.h
|
||||
Synchronization.h
|
||||
Tarray.h
|
||||
Timer.h
|
||||
TimeValue.h
|
||||
TimeValue_info.h
|
||||
TypeInfo_decl.h
|
||||
TypeInfo_impl.h
|
||||
VectorMap.h
|
||||
VectorSet.h
|
||||
VertexFormats.h
|
||||
XMLBinaryHeaders.h
|
||||
RenderBus.h
|
||||
@@ -123,13 +99,11 @@ set(FILES
|
||||
Cry_Geo.h
|
||||
Cry_GeoDistance.h
|
||||
Cry_GeoIntersect.h
|
||||
Cry_GeoOverlap.h
|
||||
Cry_Math.h
|
||||
Cry_Quat.h
|
||||
Cry_ValidNumber.h
|
||||
Cry_Vector2.h
|
||||
Cry_Vector3.h
|
||||
CryHalf_info.h
|
||||
CryHalf.inl
|
||||
MathConversion.h
|
||||
Cry_HWMatrix.h
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Description : declarations of all physics interfaces and structures
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <SerializeFwd.h>
|
||||
|
||||
#include "Cry_Geo.h"
|
||||
#include "stridedptr.h"
|
||||
#include "primitives.h"
|
||||
#ifdef NEED_ENDIAN_SWAP
|
||||
#include "CryEndian.h"
|
||||
#endif
|
||||
|
||||
#include <ISystem.h>
|
||||
#include <AzCore/std/parallel/spin_mutex.h>
|
||||
@@ -353,12 +353,6 @@ void SetFlags(T& dest, U flags, bool b)
|
||||
#include AZ_RESTRICTED_FILE(platform_h)
|
||||
#endif
|
||||
|
||||
// Include support for meta-type data.
|
||||
#include "TypeInfo_decl.h"
|
||||
|
||||
// Include array.
|
||||
#include <CryArray.h>
|
||||
|
||||
bool CrySetFileAttributes(const char* lpFileName, uint32 dwFileAttributes);
|
||||
threadID CryGetCurrentThreadId();
|
||||
|
||||
|
||||
@@ -1,294 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_PRIMITIVES_H
|
||||
#define CRYINCLUDE_CRYCOMMON_PRIMITIVES_H
|
||||
#pragma once
|
||||
|
||||
|
||||
|
||||
typedef int index_t;
|
||||
enum
|
||||
{
|
||||
PHYS_MAX_INDICES = 1 << 30
|
||||
};
|
||||
|
||||
#include "stridedptr.h"
|
||||
|
||||
namespace primitives {
|
||||
////////////////////////// primitives //////////////////////
|
||||
|
||||
struct primitive
|
||||
{
|
||||
};
|
||||
|
||||
struct box
|
||||
: primitive
|
||||
{
|
||||
enum entype
|
||||
{
|
||||
type = 0
|
||||
};
|
||||
Matrix33 Basis; // v_box = Basis*v_world; Basis = Rotation.T()
|
||||
int bOriented;
|
||||
Vec3 center;
|
||||
Vec3 size;
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct triangle
|
||||
: primitive
|
||||
{
|
||||
enum entype
|
||||
{
|
||||
type = 1
|
||||
};
|
||||
Vec3 pt[3];
|
||||
Vec3 n;
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct indexed_triangle
|
||||
: triangle
|
||||
{
|
||||
int idx;
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
typedef float (* getHeightCallback)(int ix, int iy);
|
||||
typedef unsigned char (* getSurfTypeCallback)(int ix, int iy);
|
||||
|
||||
struct grid
|
||||
: primitive
|
||||
{
|
||||
Matrix33 Basis;
|
||||
int bOriented;
|
||||
Vec3 origin;
|
||||
vector2df step, stepr;
|
||||
vector2di size;
|
||||
vector2di stride;
|
||||
int bCyclic;
|
||||
grid() { bCyclic = 0; }
|
||||
int inrange(int ix, int iy) { return bCyclic | -((ix - size.x & - 1 - ix & iy - size.y & - 1 - iy) >> 31); }
|
||||
int getcell_safe(int ix, int iy) { int mask = -inrange(ix, iy); return (iy & size.y - 1) * stride.y + (ix & size.x - 1) * stride.x & mask | size.x * size.y & ~mask; }
|
||||
int crop(int i, int icoord, int bAllowBorder = 1) { int brd = bAllowBorder + (1 << 30 & - bCyclic); return max(-brd, min(size[icoord] - 1 + brd, i)); }
|
||||
vector2di cropxy(const vector2di& ic, int bAllowBorder = 1) { int brd = bAllowBorder + (1 << 30 & - bCyclic); return vector2di(max(-brd, min(size.x - 1 + brd, ic.x)), max(-brd, min(size.y - 1 + brd, ic.y))); }
|
||||
int iscyclic() { return bCyclic; }
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct heightfield
|
||||
: grid
|
||||
{
|
||||
enum entype
|
||||
{
|
||||
type = 2
|
||||
};
|
||||
heightfield& operator=(const heightfield& src)
|
||||
{
|
||||
step = src.step;
|
||||
stepr = src.stepr;
|
||||
size = src.size;
|
||||
stride = src.stride;
|
||||
heightscale = src.heightscale;
|
||||
typemask = src.typemask;
|
||||
typehole = src.typehole;
|
||||
typepower = src.typepower;
|
||||
fpGetHeightCallback = src.fpGetHeightCallback;
|
||||
fpGetSurfTypeCallback = src.fpGetSurfTypeCallback;
|
||||
return *this;
|
||||
}
|
||||
|
||||
ILINE float getheight(int ix, int iy) const
|
||||
{
|
||||
float result = (*fpGetHeightCallback)(ix, iy);
|
||||
return result * heightscale;
|
||||
}
|
||||
ILINE int gettype(int ix, int iy) const
|
||||
{
|
||||
int itype = (((*fpGetSurfTypeCallback)(ix, iy)) & typemask) >> typepower, idelta = itype - typehole;
|
||||
return itype | ((idelta - 1) >> 31 ^ idelta >> 31);
|
||||
}
|
||||
|
||||
float heightscale;
|
||||
unsigned short typemask;
|
||||
int typehole;
|
||||
int typepower;
|
||||
getHeightCallback fpGetHeightCallback;
|
||||
getSurfTypeCallback fpGetSurfTypeCallback;
|
||||
};
|
||||
|
||||
struct ray
|
||||
: primitive
|
||||
{
|
||||
enum entype
|
||||
{
|
||||
type = 3
|
||||
};
|
||||
Vec3 origin;
|
||||
Vec3 dir;
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct sphere
|
||||
: primitive
|
||||
{
|
||||
enum entype
|
||||
{
|
||||
type = 4
|
||||
};
|
||||
Vec3 center;
|
||||
float r;
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct cylinder
|
||||
: primitive
|
||||
{
|
||||
enum entype
|
||||
{
|
||||
type = 5
|
||||
};
|
||||
Vec3 center;
|
||||
Vec3 axis;
|
||||
float r, hh;
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct capsule
|
||||
: cylinder
|
||||
{
|
||||
enum entype
|
||||
{
|
||||
type = 6
|
||||
};
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct grid3d
|
||||
: primitive
|
||||
{
|
||||
Matrix33 Basis;
|
||||
int bOriented;
|
||||
Vec3 origin;
|
||||
Vec3 step, stepr;
|
||||
Vec3i size;
|
||||
Vec3i stride;
|
||||
};
|
||||
|
||||
struct voxelgrid
|
||||
: grid3d
|
||||
{
|
||||
enum entype
|
||||
{
|
||||
type = 7
|
||||
};
|
||||
Matrix33 R;
|
||||
Vec3 offset;
|
||||
float scale, rscale;
|
||||
strided_pointer<Vec3> pVtx;
|
||||
index_t* pIndices;
|
||||
Vec3* pNormals;
|
||||
char* pIds;
|
||||
int* pCellTris;
|
||||
int* pTriBuf;
|
||||
};
|
||||
|
||||
struct plane
|
||||
: primitive
|
||||
{
|
||||
enum entype
|
||||
{
|
||||
type = 8
|
||||
};
|
||||
Vec3 n;
|
||||
Vec3 origin;
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
struct coord_plane
|
||||
: plane
|
||||
{
|
||||
Vec3 axes[2];
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
}
|
||||
|
||||
AUTO_TYPE_INFO(primitives::getHeightCallback)
|
||||
AUTO_TYPE_INFO(primitives::getSurfTypeCallback)
|
||||
|
||||
struct prim_inters
|
||||
{
|
||||
prim_inters() { minPtDist2 = 0.0f; ptbest.zero(); }
|
||||
Vec3 pt[2];
|
||||
Vec3 n;
|
||||
unsigned char iFeature[2][2];
|
||||
float minPtDist2;
|
||||
short id[2];
|
||||
int iNode[2];
|
||||
Vec3* ptborder;
|
||||
int nborderpt, nbordersz;
|
||||
Vec3 ptbest;
|
||||
int nBestPtVal;
|
||||
};
|
||||
|
||||
struct contact
|
||||
{
|
||||
real t, taux;
|
||||
Vec3 pt;
|
||||
Vec3 n;
|
||||
unsigned int iFeature[2];
|
||||
};
|
||||
|
||||
const int NPRIMS = 8; // since plane is currently not supported in collision checks
|
||||
|
||||
///////////////////// geometry contact structures ///////////////////
|
||||
|
||||
struct geom_contact_area
|
||||
{
|
||||
enum entype
|
||||
{
|
||||
polygon, polyline
|
||||
};
|
||||
int type;
|
||||
int npt;
|
||||
int nmaxpt;
|
||||
float minedge;
|
||||
int* piPrim[2];
|
||||
int* piFeature[2];
|
||||
Vec3* pt;
|
||||
Vec3 n1; // normal of other object surface (or edge)
|
||||
};
|
||||
|
||||
const int IFEAT_LOG2 = 23;
|
||||
const int IDXMASK = ~(0xFF << IFEAT_LOG2);
|
||||
const int TRIEND = 0x80 << IFEAT_LOG2;
|
||||
|
||||
struct geom_contact
|
||||
{
|
||||
real t;
|
||||
Vec3 pt;
|
||||
Vec3 n;
|
||||
Vec3 dir; // unprojection direction
|
||||
int iUnprojMode;
|
||||
float vel; // original velocity along this direction, <0 if least squares normal was used
|
||||
int id[2]; // external ids for colliding geometry parts
|
||||
int iPrim[2];
|
||||
int iFeature[2];
|
||||
int iNode[2]; // BV-tree nodes of contacting primitives
|
||||
Vec3* ptborder; // intersection border
|
||||
int (*idxborder)[2]; // primitive index | primitive's feature's id << IFEAT_LOG2
|
||||
int nborderpt;
|
||||
int bClosed;
|
||||
Vec3 center;
|
||||
bool bBorderConsecutive;
|
||||
geom_contact_area* parea;
|
||||
};
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_PRIMITIVES_H
|
||||
@@ -146,8 +146,6 @@ public:
|
||||
{
|
||||
std::swap(p, other.p);
|
||||
}
|
||||
|
||||
AUTO_STRUCT_INFO
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_STRIDEDPTR_H
|
||||
#define CRYINCLUDE_CRYCOMMON_STRIDEDPTR_H
|
||||
#pragma once
|
||||
|
||||
#include <CryCommon/platform.h>
|
||||
#include <CryCommon/CryEndian.h>
|
||||
|
||||
template<class dtype>
|
||||
class strided_pointer
|
||||
{
|
||||
public:
|
||||
strided_pointer()
|
||||
: data(0)
|
||||
, iStride(sizeof(dtype))
|
||||
{
|
||||
}
|
||||
|
||||
strided_pointer(dtype* pdata, int32 stride = sizeof(dtype))
|
||||
: data(pdata)
|
||||
, iStride(stride)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename dtype1>
|
||||
strided_pointer(dtype1* pdata)
|
||||
{
|
||||
set(pdata, sizeof(dtype1));
|
||||
}
|
||||
|
||||
template<typename dtype1>
|
||||
strided_pointer(const strided_pointer<dtype1>& src)
|
||||
{
|
||||
set(src.data, src.iStride);
|
||||
}
|
||||
|
||||
template<typename dtype1>
|
||||
ILINE strided_pointer& operator=(const strided_pointer<dtype1>& src)
|
||||
{
|
||||
set(src.data, src.iStride);
|
||||
return *this;
|
||||
}
|
||||
|
||||
ILINE dtype& operator[](int32 idx) { return *(dtype*)((char*)data + idx * iStride); }
|
||||
ILINE const dtype& operator[](int32 idx) const { return *(const dtype*)((const char*)data + idx * iStride); }
|
||||
ILINE strided_pointer<dtype> operator+(int32 idx) const { return strided_pointer<dtype>((dtype*)((char*)data + idx * iStride), iStride); }
|
||||
ILINE strided_pointer<dtype> operator-(int32 idx) const { return strided_pointer<dtype>((dtype*)((char*)data - idx * iStride), iStride); }
|
||||
|
||||
ILINE operator bool() const
|
||||
{
|
||||
return data != 0;
|
||||
}
|
||||
|
||||
private:
|
||||
template<typename dtype1>
|
||||
ILINE void set(dtype1* pdata, int32 stride)
|
||||
{
|
||||
# if !defined(eLittleEndian)
|
||||
# error eLittleEndian is not defined, please include CryEndian.h.
|
||||
# endif
|
||||
static_assert(metautils::is_const<dtype>::value || !metautils::is_const<dtype1>::value);
|
||||
// note: we allow xint32 -> xint16 converting
|
||||
static_assert(
|
||||
(metautils::is_same<typename metautils::remove_const<dtype1>::type, typename metautils::remove_const<dtype>::type>::value ||
|
||||
((metautils::is_same<typename metautils::remove_const<dtype1>::type, sint32>::value ||
|
||||
metautils::is_same<typename metautils::remove_const<dtype1>::type, uint32>::value ||
|
||||
metautils::is_same<typename metautils::remove_const<dtype1>::type, sint16>::value ||
|
||||
metautils::is_same<typename metautils::remove_const<dtype1>::type, uint16>::value) &&
|
||||
(metautils::is_same<typename metautils::remove_const<dtype>::type, sint16>::value ||
|
||||
metautils::is_same<typename metautils::remove_const<dtype>::type, uint16>::value))));
|
||||
data = (dtype*)pdata + (sizeof(dtype1) / sizeof(dtype) - 1) * (int)eLittleEndian;
|
||||
iStride = stride;
|
||||
}
|
||||
|
||||
private:
|
||||
// Prevents assignment of a structure member's address by mistake:
|
||||
// stridedPtrObject = &myStruct.member;
|
||||
// Use explicit constructor instead:
|
||||
// stridedPtrObject = strided_pointer<baseType>(&myStruct.member, sizeof(myStruct));
|
||||
//
|
||||
// Keep it private and non-implemented.
|
||||
strided_pointer& operator=(dtype* pdata);
|
||||
|
||||
// Prevents using the address directly by mistake:
|
||||
// memcpy(destination, stridedPtrObject, sizeof(baseType) * n);
|
||||
// Use address of the first element instead:
|
||||
// memcpy(destination, &stridedPtrObject[0], stridedPtrObject.iStride * n);
|
||||
//
|
||||
// Keep it private and non-implemented.
|
||||
operator void*() const;
|
||||
|
||||
// Prevents direct dereferencing to avoid confusing it with "normal" pointers:
|
||||
// val = *stridedPtrObject;
|
||||
// Use operator [] instead:
|
||||
// val = stridedPtrObject[0];
|
||||
//
|
||||
// Keep it private and non-implemented.
|
||||
dtype& operator*() const;
|
||||
|
||||
public:
|
||||
dtype* data;
|
||||
int32 iStride;
|
||||
};
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_STRIDEDPTR_H
|
||||
@@ -10,9 +10,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <ILocalizationManager.h>
|
||||
#include <ISystem.h>
|
||||
#include <StlUtils.h>
|
||||
#include <VectorMap.h>
|
||||
#include <AzCore/std/containers/map.h>
|
||||
#include <CryCommon/LegacyAllocator.h>
|
||||
|
||||
#include "Huffman.h"
|
||||
|
||||
@@ -153,9 +155,9 @@ private:
|
||||
CryHalf fVolume;
|
||||
CryHalf fRadioRatio;
|
||||
// SoundMoods
|
||||
DynArray<SLocalizedAdvancesSoundEntry> SoundMoods;
|
||||
AZStd::vector<SLocalizedAdvancesSoundEntry, AZ::StdLegacyAllocator> SoundMoods;
|
||||
// EventParameters
|
||||
DynArray<SLocalizedAdvancesSoundEntry> EventParameters;
|
||||
AZStd::vector<SLocalizedAdvancesSoundEntry, AZ::StdLegacyAllocator> EventParameters;
|
||||
// ~audio specific part
|
||||
|
||||
// subtitle & radio flags
|
||||
@@ -312,5 +314,3 @@ private:
|
||||
mutable AZStd::mutex m_cs;
|
||||
typedef AZStd::lock_guard<AZStd::mutex> AutoLock;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "ISystem.h"
|
||||
|
||||
#include <CryCommon/CryLegacyAllocator.h>
|
||||
#include <StlUtils.h>
|
||||
|
||||
//TODO: Pull most of this into a cpp file!
|
||||
@@ -265,23 +265,6 @@ public:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void GetMemoryUsage(ICrySizer* pSizer) const
|
||||
{
|
||||
BLOCK* pBlock = m_blocks;
|
||||
while (pBlock)
|
||||
{
|
||||
pSizer->AddObject(pBlock, offsetof(BLOCK, s) + pBlock->size * sizeof(char));
|
||||
pBlock = pBlock->next;
|
||||
}
|
||||
|
||||
pBlock = m_free_blocks;
|
||||
while (pBlock)
|
||||
{
|
||||
pSizer->AddObject(pBlock, offsetof(BLOCK, s) + pBlock->size * sizeof(char));
|
||||
pBlock = pBlock->next;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
CSimpleStringPool(const CSimpleStringPool&);
|
||||
CSimpleStringPool& operator = (const CSimpleStringPool&);
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <CryPath.h>
|
||||
#include <CrySystemBus.h>
|
||||
#include <CryCommon/IFont.h>
|
||||
#include <CryCommon/MiniQueue.h>
|
||||
#include <AzFramework/API/ApplicationAPI.h>
|
||||
#include <AzFramework/API/ApplicationAPI_Platform.h>
|
||||
#include <AzFramework/Input/Devices/Keyboard/InputDeviceKeyboard.h>
|
||||
@@ -28,6 +29,7 @@
|
||||
#include <AzCore/Debug/Trace.h>
|
||||
#include <AzCore/Debug/IEventLogger.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
#include <AzCore/std/algorithm.h>
|
||||
#include <AzFramework/Logging/MissingAssetLogger.h>
|
||||
#include <AzFramework/Entity/EntityDebugDisplayBus.h>
|
||||
#include <AzCore/Interface/Interface.h>
|
||||
@@ -641,7 +643,7 @@ void CSystem::SleepIfNeeded()
|
||||
allowStallCatchup = true;
|
||||
|
||||
float totalElapsed = (now - prevNow.Front()).GetSeconds();
|
||||
float wantSleepTime = CLAMP(minTime * (prevNow.Size() - 1) - totalElapsed, 0, (minTime - elapsed) * 0.9f);
|
||||
float wantSleepTime = AZStd::clamp(minTime * (prevNow.Size() - 1) - totalElapsed, 0.0f, (minTime - elapsed) * 0.9f);
|
||||
static float sleepTime = 0;
|
||||
sleepTime = (15 * sleepTime + wantSleepTime) / 16;
|
||||
int sleepMS = (int)(1000.0f * sleepTime + 0.5f);
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <HMDBus.h>
|
||||
#include "View.h"
|
||||
#include <AzCore/Math/MathUtils.h>
|
||||
#include <IStereoRenderer.h>
|
||||
#include <AzCore/Component/TransformBus.h>
|
||||
#include <AzCore/Component/Entity.h>
|
||||
#include <Random.h>
|
||||
@@ -541,13 +540,13 @@ void CView::GetMemoryUsage(ICrySizer* s) const
|
||||
s->AddObject(m_shakes);
|
||||
}
|
||||
|
||||
void CView::Serialize(TSerialize ser)
|
||||
{
|
||||
if (ser.IsReading())
|
||||
{
|
||||
ResetShaking();
|
||||
}
|
||||
}
|
||||
//void CView::Serialize(TSerialize ser)
|
||||
//{
|
||||
// if (ser.IsReading())
|
||||
// {
|
||||
// ResetShaking();
|
||||
// }
|
||||
//}
|
||||
|
||||
void CView::PostSerialize()
|
||||
{
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <Cry_Camera.h>
|
||||
|
||||
class CGameObject;
|
||||
struct ISystem;
|
||||
|
||||
namespace LegacyViewSystem
|
||||
{
|
||||
@@ -106,7 +107,6 @@ public:
|
||||
virtual void SetActive(const bool bActive);
|
||||
// ~IView
|
||||
|
||||
void Serialize(TSerialize ser) override;
|
||||
void PostSerialize() override;
|
||||
CCamera& GetCamera() override { return m_camera; }
|
||||
const CCamera& GetCamera() const override { return m_camera; }
|
||||
|
||||
@@ -617,16 +617,16 @@ void CViewSystem::GetMemoryUsage(ICrySizer* s) const
|
||||
s->AddContainer(m_views);
|
||||
}
|
||||
|
||||
void CViewSystem::Serialize(TSerialize ser)
|
||||
{
|
||||
TViewMap::iterator iter = m_views.begin();
|
||||
TViewMap::iterator iterEnd = m_views.end();
|
||||
while (iter != iterEnd)
|
||||
{
|
||||
iter->second->Serialize(ser);
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
//void CViewSystem::Serialize(TSerialize ser)
|
||||
//{
|
||||
// TViewMap::iterator iter = m_views.begin();
|
||||
// TViewMap::iterator iterEnd = m_views.end();
|
||||
// while (iter != iterEnd)
|
||||
// {
|
||||
// iter->second->Serialize(ser);
|
||||
// ++iter;
|
||||
// }
|
||||
//}
|
||||
|
||||
void CViewSystem::PostSerialize()
|
||||
{
|
||||
|
||||
@@ -53,7 +53,6 @@ public:
|
||||
virtual unsigned int GetViewId(IView* pView);
|
||||
virtual unsigned int GetActiveViewId();
|
||||
|
||||
virtual void Serialize(TSerialize ser);
|
||||
virtual void PostSerialize();
|
||||
|
||||
virtual IView* GetViewByEntityId(const AZ::EntityId& id, bool forceCreate);
|
||||
|
||||
@@ -1762,7 +1762,7 @@ void CXConsole::ExecuteString(const char* command, const bool bSilentMode, const
|
||||
AZ::StringFunc::TrimWhiteSpace(str, true, false);
|
||||
|
||||
// Unroll the exec command
|
||||
|
||||
|
||||
bool unroll = (0 == AZ::StringFunc::Find(str, "exec", 0, false, false));
|
||||
|
||||
if (unroll)
|
||||
@@ -2891,75 +2891,6 @@ int CXConsole::GetNumVisibleVars()
|
||||
return numVars;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CXConsole::IsHashCalculated()
|
||||
{
|
||||
return m_bCheatHashDirty == false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
int CXConsole::GetNumCheatVars()
|
||||
{
|
||||
return static_cast<int>(m_randomCheckedVariables.size());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
uint64 CXConsole::GetCheatVarHash()
|
||||
{
|
||||
return m_nCheatHash;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CXConsole::SetCheatVarHashRange(size_t firstVar, size_t lastVar)
|
||||
{
|
||||
// check inputs are sane
|
||||
#if !defined(NDEBUG)
|
||||
size_t numVars = GetNumCheatVars();
|
||||
assert(firstVar < numVars && lastVar < numVars && lastVar >= firstVar);
|
||||
#endif
|
||||
|
||||
#if defined(DEFENCE_CVAR_HASH_LOGGING)
|
||||
if (m_bCheatHashDirty)
|
||||
{
|
||||
CryLog("HASHING: WARNING - trying to set up new cvar hash range while existing hash still calculating!");
|
||||
}
|
||||
#endif
|
||||
|
||||
m_nCheatHashRangeFirst = firstVar;
|
||||
m_nCheatHashRangeLast = lastVar;
|
||||
m_bCheatHashDirty = true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
void CXConsole::CalcCheatVarHash()
|
||||
{
|
||||
if (!m_bCheatHashDirty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CCrc32 runningNameCrc32;
|
||||
CCrc32 runningNameValueCrc32;
|
||||
|
||||
AddCVarsToHash(m_randomCheckedVariables.begin() + m_nCheatHashRangeFirst, m_randomCheckedVariables.begin() + m_nCheatHashRangeLast, runningNameCrc32, runningNameValueCrc32);
|
||||
AddCVarsToHash(m_alwaysCheckedVariables.begin(), m_alwaysCheckedVariables.end() - 1, runningNameCrc32, runningNameValueCrc32);
|
||||
|
||||
// store hash
|
||||
m_nCheatHash = (((uint64)runningNameCrc32.Get()) << 32) | runningNameValueCrc32.Get();
|
||||
m_bCheatHashDirty = false;
|
||||
|
||||
#if defined(DEFENCE_CVAR_HASH_LOGGING)
|
||||
if (!gEnv->IsDedicated())
|
||||
{
|
||||
CryLog("HASHING: Range %d->%d = %llx(%x,%x), max cvars = %d", m_nCheatHashRangeFirst, m_nCheatHashRangeLast,
|
||||
m_nCheatHash, runningNameCrc32.Get(), runningNameValueCrc32.Get(),
|
||||
GetNumCheatVars());
|
||||
PrintCheatVars(true);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void CXConsole::AddCVarsToHash(ConsoleVariablesVector::const_iterator begin, ConsoleVariablesVector::const_iterator end, CCrc32& runningNameCrc32, CCrc32& runningNameValueCrc32)
|
||||
{
|
||||
for (ConsoleVariablesVector::const_iterator it = begin; it <= end; ++it)
|
||||
@@ -2974,162 +2905,6 @@ void CXConsole::AddCVarsToHash(ConsoleVariablesVector::const_iterator begin, Con
|
||||
}
|
||||
}
|
||||
|
||||
void CXConsole::CmdDumpAllAnticheatVars([[maybe_unused]] IConsoleCmdArgs* pArgs)
|
||||
{
|
||||
#if defined(DEFENCE_CVAR_HASH_LOGGING)
|
||||
CXConsole* pConsole = (CXConsole*)gEnv->pConsole;
|
||||
|
||||
if (pConsole->IsHashCalculated())
|
||||
{
|
||||
CryLog("HASHING: Displaying Full Anticheat Cvar list:");
|
||||
pConsole->PrintCheatVars(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
CryLogAlways("DumpAllAnticheatVars - cannot complete, cheat vars are in a state of flux, please retry.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void CXConsole::CmdDumpLastHashedAnticheatVars([[maybe_unused]] IConsoleCmdArgs* pArgs)
|
||||
{
|
||||
#if defined(DEFENCE_CVAR_HASH_LOGGING)
|
||||
CXConsole* pConsole = (CXConsole*)gEnv->pConsole;
|
||||
|
||||
if (pConsole->IsHashCalculated())
|
||||
{
|
||||
CryLog("HASHING: Displaying Last Hashed Anticheat Cvar list:");
|
||||
pConsole->PrintCheatVars(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
CryLogAlways("DumpLastHashedAnticheatVars - cannot complete, cheat vars are in a state of flux, please retry.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void CXConsole::PrintCheatVars([[maybe_unused]] bool bUseLastHashRange)
|
||||
{
|
||||
#if defined(DEFENCE_CVAR_HASH_LOGGING)
|
||||
if (m_bCheatHashDirty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
char floatFormatBuf[64];
|
||||
|
||||
size_t nStart = 0;
|
||||
size_t nEnd = m_mapVariables.size();
|
||||
|
||||
if (bUseLastHashRange)
|
||||
{
|
||||
nStart = m_nCheatHashRangeFirst;
|
||||
nEnd = m_nCheatHashRangeLast;
|
||||
}
|
||||
|
||||
// iterate over all const cvars in our range
|
||||
// then hash the string.
|
||||
CryLog("VF_CHEAT & ~VF_CHEAT_NOCHECK list:");
|
||||
|
||||
ConsoleVariablesMap::const_iterator it, end = m_mapVariables.end();
|
||||
for (it = m_mapVariables.begin(); it != end; ++it)
|
||||
{
|
||||
// only count cheat cvars
|
||||
if ((it->second->GetFlags() & VF_CHEAT) == 0 ||
|
||||
(it->second->GetFlags() & VF_CHEAT_NOCHECK) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// count up
|
||||
i++;
|
||||
|
||||
// if we haven't reached the first var, or have passed the last var, break out
|
||||
if (i - 1 < nStart)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (i - 1 > nEnd)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// add name & variable to string. We add both since adding only the value could cause
|
||||
// many collisions with variables all having value 0 or all 1.
|
||||
string hashStr = it->first;
|
||||
if (it->second->GetType() == CVAR_FLOAT)
|
||||
{
|
||||
sprintf(floatFormatBuf, "%.1g", it->second->GetFVal());
|
||||
hashStr += floatFormatBuf;
|
||||
}
|
||||
else
|
||||
{
|
||||
hashStr += it->second->GetString();
|
||||
}
|
||||
|
||||
CryLog("%s", hashStr.c_str());
|
||||
}
|
||||
|
||||
// iterate over any must-check variables
|
||||
CryLog("VF_CHEAT_ALWAYS_CHECK list:");
|
||||
|
||||
for (it = m_mapVariables.begin(); it != end; ++it)
|
||||
{
|
||||
// only count cheat cvars
|
||||
if ((it->second->GetFlags() & VF_CHEAT_ALWAYS_CHECK) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// add name & variable to string. We add both since adding only the value could cause
|
||||
// many collisions with variables all having value 0 or all 1.
|
||||
string hashStr = it->first;
|
||||
hashStr += it->second->GetString();
|
||||
|
||||
CryLog("%s", hashStr.c_str());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
char* CXConsole::GetCheatVarAt(uint32 nOffset)
|
||||
{
|
||||
if (m_bCheatHashDirty)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t i = 0;
|
||||
size_t nStart = nOffset;
|
||||
|
||||
// iterate over all const cvars in our range
|
||||
// then hash the string.
|
||||
ConsoleVariablesMap::const_iterator it, end = m_mapVariables.end();
|
||||
for (it = m_mapVariables.begin(); it != end; ++it)
|
||||
{
|
||||
// only count cheat cvars
|
||||
if ((it->second->GetFlags() & VF_CHEAT) == 0 ||
|
||||
(it->second->GetFlags() & VF_CHEAT_NOCHECK) != 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// count up
|
||||
i++;
|
||||
|
||||
// if we haven't reached the first var continue
|
||||
if (i - 1 < nStart)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return (char*)it->first;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
size_t CXConsole::GetSortedVars(AZStd::vector<AZStd::string_view>& pszArray, const char* szPrefix)
|
||||
{
|
||||
|
||||
@@ -182,11 +182,6 @@ public:
|
||||
virtual int GetNumVars();
|
||||
virtual int GetNumVisibleVars();
|
||||
virtual size_t GetSortedVars(AZStd::vector<AZStd::string_view>& pszArray, const char* szPrefix = 0);
|
||||
virtual int GetNumCheatVars();
|
||||
virtual void SetCheatVarHashRange(size_t firstVar, size_t lastVar);
|
||||
virtual void CalcCheatVarHash();
|
||||
virtual bool IsHashCalculated();
|
||||
virtual uint64 GetCheatVarHash();
|
||||
virtual void FindVar(const char* substr);
|
||||
virtual const char* AutoComplete(const char* substr);
|
||||
virtual const char* AutoCompletePrev(const char* substr);
|
||||
@@ -231,9 +226,6 @@ public:
|
||||
// 0 if the operation failed
|
||||
ICVar* RegisterCVarGroup(const char* sName, const char* szFileName);
|
||||
|
||||
virtual void PrintCheatVars(bool bUseLastHashRange);
|
||||
virtual char* GetCheatVarAt(uint32 nOffset);
|
||||
|
||||
void SetProcessingGroup(bool isGroup) { m_bIsProcessingGroup = isGroup; }
|
||||
bool GetIsProcessingGroup(void) const { return m_bIsProcessingGroup; }
|
||||
|
||||
@@ -286,9 +278,6 @@ protected: // ------------------------------------------------------------------
|
||||
|
||||
static const char* GetFlagsString(const uint32 dwFlags);
|
||||
|
||||
static void CmdDumpAllAnticheatVars(IConsoleCmdArgs* pArgs);
|
||||
static void CmdDumpLastHashedAnticheatVars(IConsoleCmdArgs* pArgs);
|
||||
|
||||
private: // ----------------------------------------------------------
|
||||
|
||||
typedef std::map<const char*, ICVar*, string_nocase_lt> ConsoleVariablesMap; // key points into string stored in ICVar or in .exe/.dll
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user