Merge branch 'main' into hasareej_LYN-2475_viewportui_switcher

This commit is contained in:
hasareej
2021-04-26 17:30:51 +01:00
7171 changed files with 112119 additions and 619305 deletions
+1 -1
View File
@@ -3,4 +3,4 @@ SDKs
#ColinB (8/26)- I know there are depot files that this will ignore... But these files should not be
#here, they should all be in 3rdParty... so we will ignore them until I can move them, it should
#be OK for now because they shouldn't change at all anyway.
#be OK for now because they shouldn't change at all anyway.
@@ -856,9 +856,6 @@ void C3DEngine::RenderWorld(const int nRenderFlags, const SRenderingPassInfo& pa
return;
}
#ifdef ENABLE_LW_PROFILERS
int64 renderStart = CryGetTicks();
#endif
FUNCTION_PROFILER_3DENGINE;
if (GetCVars()->e_ScreenShot)
@@ -3609,15 +3606,6 @@ void C3DEngine::SetupDistanceFog()
{
FUNCTION_PROFILER_3DENGINE;
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// render to texture does not support volumetric fog
if (GetRenderer()->IsRenderToTextureActive() && (GetCVars()->e_VolumetricFog != 0))
{
GetRenderer()->EnableFog(false);
return;
}
#endif // AZ_RENDER_TO_TEXTURE_GEM_ENABLED
GetRenderer()->SetFogColor(ColorF(m_vFogColor.x, m_vFogColor.y, m_vFogColor.z, 1.0f));
GetRenderer()->EnableFog(GetCVars()->e_Fog > 0);
}
+3 -4
View File
@@ -1548,8 +1548,6 @@ void C3DEngine::OnExplosion(Vec3 vPos, float fRadius, [[maybe_unused]] bool bDef
}
// reduce ground decals size depending on distance to the ground
float terrainHeight = terrain->GetHeightFromFloats(vPos.x, vPos.y);
float fExploHeight = vPos.z - terrainHeight;
// delete decals what can not be correctly updated
Vec3 vRadius(fRadius, fRadius, fRadius);
@@ -1677,9 +1675,11 @@ bool C3DEngine::IsTessellationAllowedForShadowMap(const SRenderingPassInfo& pass
default:
return false;
}
#endif //#ifdef MESH_TESSELLATION_ENGINE
#else
return false;
#endif //#ifdef MESH_TESSELLATION_ENGINE
}
void C3DEngine::SetPhysMaterialEnumerator(IPhysMaterialEnumerator* pPhysMaterialEnumerator)
@@ -2051,7 +2051,6 @@ bool C3DEngine::SetStatInstGroup(int nGroupId, const IStatInstGroup& siGroup, in
rGroup.bAllowIndoor = siGroup.bAllowIndoor;
rGroup.fAlignToTerrainCoefficient = siGroup.fAlignToTerrainCoefficient;
bool previousAutoMerged = rGroup.bAutoMerged;
rGroup.bAutoMerged = siGroup.bAutoMerged;
rGroup.minConfigSpec = siGroup.minConfigSpec;
@@ -552,7 +552,6 @@ namespace NAsyncCull
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::Renderer);
int bHWZBuffer = GetCVars()->e_CoverageBufferReproj;
int PolyLimit = GetCVars()->e_CoverageBufferRastPolyLimit;
if (bHWZBuffer > 3 && m_OCMBuffer.empty())
{
@@ -701,7 +700,6 @@ namespace NAsyncCull
const AABB PosAABB = AABB(m_Position, 0.5f);
const float Bias = GetCVars()->e_CoverageBufferAABBExpand;
rMatFinalT = m_MatScreenViewProj.GetTransposed();
bool bEnabled = m_Enabled;
// Debugging stats in green to screen here with how many octree nodes pass/fail and how many terrain nodes pass/fail
unsigned int octreeNodesCulled = 0;
+4 -3
View File
@@ -1545,8 +1545,6 @@ namespace ProcessSkinningHelpers
vmax = i2;
}
}
uint32 a = pMesh->m_subsets[m].nFirstVertId;
uint32 b = pMesh->m_subsets[m].nNumVerts;
if (pMesh->m_subsets[m].nFirstVertId != vmin ||
pMesh->m_subsets[m].nNumVerts != vmax - vmin + 1)
{
@@ -2255,7 +2253,9 @@ bool CLoaderCGF::ProcessSkinning()
//init internal morph-targets
MorphTargets* pMorphtarget = pSkinningInfo->m_arrMorphTargets[it];
uint32 numMorphVerts = pMorphtarget->m_arrIntMorph.size();
#if !defined(NDEBUG)
uint32 intVertexCount = pSkinningInfo->m_arrIntVertices.size();
#endif
for (uint32 i = 0; i < numMorphVerts; i++)
{
uint32 idx = pMorphtarget->m_arrIntMorph[i].nVertexId;
@@ -3982,7 +3982,8 @@ bool CLoaderCGF::LoadFoliageInfoChunk(IChunkFile::ChunkDesc* pChunkDesc)
SFoliageInfoCGF& fi = *m_pCGF->GetFoliageInfo();
bool isSkinned = m_pCGF->GetExportInfo()->bSkinnedCGF;
if (fi.nSpines = chunk.nSpines)
fi.nSpines = chunk.nSpines;
if (fi.nSpines)
{
fi.nSkinnedVtx = chunk.nSkinnedVtx;
@@ -362,7 +362,6 @@ void CSaverCGF::SaveNodes(
for (uint i = 0; i < numNodes; i++)
{
CNodeCGF* pNode = m_pCGF->GetNode(i);
const char* pNodeName = pNode->name;
SaveNode(pNode, bSwapEndian, bStorePositionsAsF16, bUseQtangents, bStoreIndicesAsU16);
}
}
@@ -459,7 +458,6 @@ int CSaverCGF::SaveNode(
: SaveHelperChunk(pNode, bSwapEndian);
}
int nextChunk = m_pChunkFile->NumChunks();
int positionIndex = pNode->pos_cont_id;
int rotationIndex = pNode->rot_cont_id;
int scaleIndex = pNode->scl_cont_id;
@@ -43,7 +43,6 @@ void CZBufferCuller::BeginFrame(const SRenderingPassInfo& passInfo)
m_Camera = rCam;
m_Position = rCam.GetPosition();
uint32 oldSizeX = m_SizeX;
uint32 oldSizeY = m_SizeY;
const uint32 sizeX = min(max(1, GetCVars()->e_CoverageBufferResolution), 1024);
const uint32 sizeY = sizeX;
@@ -128,10 +127,6 @@ bool CZBufferCuller::IsBoxVisible(const AABB& objBox, [[maybe_unused]] uint32* c
return Rasterize<2>(Verts, 8);
}
return Rasterize<0>(Verts, 8);
++m_ObjectsTestedAndRejected;
return false;
}
static int sh = 8;
@@ -198,4 +193,4 @@ void CZBufferCuller::GetMemoryUsage(ICrySizer* pSizer) const
{
SIZER_COMPONENT_NAME(pSizer, "CoverageBuffer");
pSizer->AddObject(m_ZBuffer, sizeof(TZBZexel) * m_SizeX * m_SizeY);
}
}
+16 -4
View File
@@ -97,7 +97,10 @@ protected:
{
return true;
}
MinX = 0;
else
{
MinX = 0;
}
}
if (MaxX > m_SizeX)
{
@@ -105,7 +108,10 @@ protected:
{
return true;
}
MaxX = m_SizeX;
else
{
MaxX = m_SizeX;
}
}
if (MinY < 0)
{
@@ -113,7 +119,10 @@ protected:
{
return true;
}
MinY = 0;
else
{
MinY = 0;
}
}
if (MaxY > m_SizeY)
{
@@ -121,7 +130,10 @@ protected:
{
return true;
}
MaxY = m_SizeY;
else
{
MaxY = m_SizeY;
}
}
if constexpr (ROTATE == 2)
{
-2
View File
@@ -253,8 +253,6 @@ void CDecal::Render(const float fCurTime, int nAfterWater, float fDistanceFading
m_arrBigDecalRMCustomData[14] = vNormal.z * (m_fSize / m_fWSSize);
m_arrBigDecalRMCustomData[15] = 0;
CStatObj* pBody = NULL;
bool bUseBending = GetCVars()->e_VegetationBending != 0;
// draw complex decal using new indices and original object vertices
pObj->m_fAlpha = fAlpha;
+6 -4
View File
@@ -191,10 +191,10 @@ bool CDecalManager::SpawnHierarchical(const CryEngineDecalInfo& rootDecalInfo, C
for (int nEntitySlotId = 0; nEntitySlotId < 16; nEntitySlotId++)
{
CStatObj* _pStatObj = NULL;
Matrix34A entSlotMatrix;
entSlotMatrix.SetIdentity();
if (_pStatObj = (CStatObj*)rootDecalInfo.ownerInfo.pRenderNode->GetEntityStatObj(nEntitySlotId, ~0, &entSlotMatrix, true))
CStatObj* _pStatObj = (CStatObj*)rootDecalInfo.ownerInfo.pRenderNode->GetEntityStatObj(nEntitySlotId, ~0, &entSlotMatrix, true);
if (_pStatObj)
{
if (_pStatObj->m_nFlags & STATIC_OBJECT_COMPOUND)
{
@@ -1014,7 +1014,9 @@ void CDecalManager::MoveToEdge(IRenderMesh* pRM, const float fRadius, Vec3& vOut
return;
}
#if !defined(NDEBUG)
int nInds = pRM->GetIndicesCount();
#endif
// if(nInds>6000)
// return; // skip insane objects
@@ -1758,8 +1760,8 @@ IStatObj* SDecalOwnerInfo::GetOwner(Matrix34A& objMat)
return NULL;
}
IStatObj* pStatObj = NULL;
if (pStatObj = pRenderNode->GetEntityStatObj(nRenderNodeSlotId, nRenderNodeSlotSubObjectId, &objMat, true))
IStatObj* pStatObj = pRenderNode->GetEntityStatObj(nRenderNodeSlotId, nRenderNodeSlotSubObjectId, &objMat, true);
if (pStatObj)
{
if (nRenderNodeSlotSubObjectId >= 0 && nRenderNodeSlotSubObjectId < pStatObj->GetSubObjectCount())
{
@@ -216,7 +216,8 @@ IDeferredPhysicsEvent* CDeferredPhysicsEventManager::GetLastCollisionEventForEnt
EventPhysCollision* pLastPhysEvent;
for (int i = m_activeDeferredEvents.size() - 1; i >= 0; i--)
{
if ((pLastPhysEvent = (EventPhysCollision*)m_activeDeferredEvents[i]->PhysicsEvent()) && pLastPhysEvent->idval == EventPhysCollision::id && pLastPhysEvent->pEntity[0] == pPhysEnt)
pLastPhysEvent = (EventPhysCollision*)m_activeDeferredEvents[i]->PhysicsEvent();
if (pLastPhysEvent && pLastPhysEvent->idval == EventPhysCollision::id && pLastPhysEvent->pEntity[0] == pPhysEnt)
{
return m_activeDeferredEvents[i];
}
@@ -444,13 +444,7 @@ void CFogVolumeRenderNode::Render(const SRendParams& rParam, const SRenderingPas
m_cachedFogColor = GetFogColor();
m_cachedSoftEdgesLerp = GetSoftEdgeLerp(viewerPosOS);
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// volumetric fog is not supported in the render scene to texture pass
bool bVolFog = (GetCVars()->e_VolumetricFog != 0) && !passInfo.IsRenderSceneToTexturePass();
#else
bool bVolFog = (GetCVars()->e_VolumetricFog != 0);
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// reset elapsed time for noise when FogVolume stayed out of viewport for 30 frames.
// this prevents the time from being too large number.
@@ -396,4 +396,4 @@ void CFogVolumeRenderNode::GetVolumetricFogColorBox(const Vec3& worldPos, const
resultColor = ColorF(m_cachedFogColor.r, m_cachedFogColor.g, m_cachedFogColor.b, min(fog, 1.0f));
}
}
}
}
-1
View File
@@ -538,7 +538,6 @@ IGeomCache::SStatistics CGeomCache::GetStatistics() const
std::set<uint16> materialIds;
CGeomCacheMeshManager& meshManager = GetGeomCacheManager()->GetMeshManager();
const uint numMeshes = m_staticMeshData.size();
for (uint i = 0; i < numMeshes; ++i)
@@ -323,7 +323,6 @@ namespace GeomCacheDecoder
const uint numSIMDIterations = numVertices / numVerticesPerIteration;
float* pPrevPositionsF = updateContext.m_prevPositions.size() > 0 ? (float*)&updateContext.m_prevPositions[0] : NULL;
float* pStaticPositionsF = staticMeshData.m_positions.size() > 0 ? (float*)&staticMeshData.m_positions[0] : NULL;
float* pVelocitiesF = (float*)&updateContext.m_pVelocities[0];
__m128i* pFloorPositions128 = (__m128i*)&pFloorPositions[0];
__m128i* pCeilPositions128 = (__m128i*)&pCeilPositions[0];
@@ -569,7 +568,6 @@ namespace GeomCacheDecoder
continue;
}
const GeomCacheFile::SMeshFrameHeader* pFrameHeader = reinterpret_cast<GeomCacheFile::SMeshFrameHeader*>(pData);
pData += sizeof(GeomCacheFile::SMeshFrameHeader);
const GeomCacheFile::EStreams streamMask = currentStaticMeshData.m_animatedStreams;
@@ -855,7 +855,6 @@ void CGeomCacheManager::LaunchDecompressJobs(SGeomCacheStreamInfo* pStreamInfo,
assert(gEnv->mMainThreadId == CryGetCurrentThreadId());
const CGeomCacheRenderNode* pRenderNode = pStreamInfo->m_pRenderNode;
const CGeomCache* pGeomCache = pStreamInfo->m_pGeomCache;
const GeomCacheFile::EBlockCompressionFormat blockCompressionFormat = pGeomCache->GetBlockCompressionFormat();
const float currentCacheStreamingTime = pStreamInfo->m_pRenderNode->GetStreamingTime();
@@ -1009,7 +1008,6 @@ void CGeomCacheManager::DecompressFrame_JobEntry(SGeomCacheStreamInfo* pStreamIn
{
FUNCTION_PROFILER_3DENGINE;
const CGeomCacheRenderNode* pRenderNode = pStreamInfo->m_pRenderNode;
const CGeomCache* pGeomCache = pStreamInfo->m_pGeomCache;
const uint frameIndex = pDecompressHandle->m_startFrame + blockIndex;
@@ -1379,7 +1377,6 @@ void CGeomCacheManager::RetireHandles(SGeomCacheStreamInfo& streamInfo)
{
FUNCTION_PROFILER_3DENGINE;
CGeomCacheRenderNode* pRenderNode = streamInfo.m_pRenderNode;
const CGeomCache* pGeomCache = streamInfo.m_pGeomCache;
const float currentCacheStreamingTime = streamInfo.m_pRenderNode->GetStreamingTime();
const uint wantedFloorFrame = pGeomCache->GetFloorFrameIndex(currentCacheStreamingTime);
@@ -1712,7 +1709,6 @@ void CGeomCacheManager::DrawDebugInfo()
const float streamInfoBoxSize = 10.0f;
uint numActiveStreams = 0;
uint numFramesMissed = 0;
const uint kNumColors = 8;
ColorF colors[kNumColors] = { Col_Red, Col_Green, Col_Yellow, Col_Blue, Col_Aquamarine, Col_Thistle, Col_Tan, Col_Salmon };
@@ -1725,7 +1721,6 @@ void CGeomCacheManager::DrawDebugInfo()
CGeomCacheRenderNode* pRenderNode = streamInfo.m_pRenderNode;
CGeomCache* pGeomCache = streamInfo.m_pGeomCache;
const char* pName = streamInfo.m_pRenderNode->GetName();
const char* pFilter = GetCVars()->e_GeomCacheDebugFilter->GetString();
const bool bDisplay = ((GetCVars()->e_GeomCacheDebug != 2) || (pRenderNode->IsStreaming() || streamInfo.m_pOldestDecompressHandle || streamInfo.m_pNewestReadRequestHandle))
&& strstr(pName, GetCVars()->e_GeomCacheDebugFilter->GetString()) != NULL;
@@ -325,4 +325,4 @@ bool CGeomCacheMeshManager::ReadMeshColors(CGeomCacheStreamReader& reader, const
return true;
}
#endif
#endif
@@ -630,7 +630,6 @@ bool CGeomCacheRenderNode::FillFrameAsync(const char* const pFloorFrameData, con
// Update meshes & clear instances
for (uint meshId = 0; meshId < numMeshes; ++meshId)
{
const SGeomCacheStaticMeshData& meshData = staticMeshData[meshId];
for (TRenderElementMap::iterator iter = m_pRenderElements.begin(); iter != m_pRenderElements.end(); ++iter)
{
SGeomCacheRenderElementData& data = iter->second;
@@ -827,8 +826,6 @@ void CGeomCacheRenderNode::FillRenderObject(const SRendParams& rendParams, [[may
{
FUNCTION_PROFILER_3DENGINE;
IRenderNode* const pRenderNode = rendParams.pRenderNode;
IRenderer* const pRenderer = GetRenderer();
pRenderObject->m_pRenderNode = rendParams.pRenderNode;
pRenderObject->m_fSort = rendParams.fCustomSortOffset;
@@ -1450,7 +1447,6 @@ void CGeomCacheRenderNode::UpdatePhysicalMaterials()
void CGeomCacheRenderNode::UpdateStreamableComponents(float fImportance, float fDistance, bool bFullUpdate, int nLod, const float fInvScale, bool bDrawNear)
{
IObjManager* pObjManager = GetObjManager();
Matrix34A matrix = GetMatrix();
const bool bAllowStandIn = GetCVars()->e_Lods != 0;
@@ -1492,4 +1488,4 @@ void CGeomCacheRenderNode::OnGeomCacheStaticDataUnloaded()
Clear(false);
}
#endif
#endif
@@ -483,7 +483,6 @@ bool CLightEntity::ProcessFrustum(int nLod, float fGSMBoxSize, float fDistanceFr
assert(pFr);
bool bDoGSM = fGSMBoxSize != 0;
bool bDoNextLod = false;
if (bDoGSM)// && (m_light.m_Flags & DLF_SUN || m_light.m_Flags & DLF_PROJECT))
{
@@ -555,8 +554,6 @@ void CLightEntity::InitShadowFrustum_SUN_Conserv(ShadowMapFrustum* pFr, [[maybe_
//Sampling parameters
//Calculate proper projection of frustum to the terrain receiving area but not based on fBoxRadius
float fGsmInitRange = Get3DEngine()->m_fGsmRange;
float fGsmStep = Get3DEngine()->m_fGsmRangeStep;
float arrWidthS[] = {1.94f, 1.0f, 0.8f, 0.5f, 0.3f, 0.3f, 0.3f, 0.3f};
+4 -1
View File
@@ -874,7 +874,10 @@ static void shGetVector4(const char* buf, float v[4])
{
return;
}
int res = azsscanf(buf, "%f,%f,%f,%f", &v[0], &v[1], &v[2], &v[3]);
#if !defined(NDEBUG)
int res =
#endif
azsscanf(buf, "%f,%f,%f,%f", &v[0], &v[1], &v[2], &v[3]);
assert(res);
}
@@ -773,8 +773,10 @@ void MaterialHelpers::SetShaderParamsFromXml(SInputShaderResources& pShaderResou
SShaderParam Param;
Param.m_Name = key;
Param.m_Value.m_Color[0] = Param.m_Value.m_Color[1] = Param.m_Value.m_Color[2] = Param.m_Value.m_Color[3] = 0;
int res = azsscanf(val, "%f,%f,%f,%f", &Param.m_Value.m_Color[0], &Param.m_Value.m_Color[1], &Param.m_Value.m_Color[2], &Param.m_Value.m_Color[3]);
#if !defined(NDEBUG)
int res =
#endif
azsscanf(val, "%f,%f,%f,%f", &Param.m_Value.m_Color[0], &Param.m_Value.m_Color[1], &Param.m_Value.m_Color[2], &Param.m_Value.m_Color[3]);
assert(res);
pShaderResources.m_ShaderParams.push_back(Param);
@@ -842,7 +844,6 @@ void MaterialHelpers::MigrateXmlLegacyData(SInputShaderResources& pShaderResourc
CryWarning(VALIDATOR_MODULE_3DENGINE, VALIDATOR_WARNING, "Material %s has had legacy GlowAmount automatically converted to Emissive Intensity. The material parameters related to Emittance should be manually adjusted for this material.", materialName.c_str());
}
// In Lumberyard version 1.9 BlendLayer2Specular became a color instead of a single float, so it needs to be updated
XmlNodeRef publicParamsNode = node->findChild("PublicParams");
if (publicParamsNode && publicParamsNode->haveAttr("BlendLayer2Specular"))
{
@@ -63,18 +63,54 @@ namespace mesh_compiler
for (uint streamIndex = 0; streamIndex < CMesh::maxStreamsPerType; ++streamIndex)
{
SMeshTexCoord* texCoords = mesh.GetStreamPtr<SMeshTexCoord>(CMesh::TEXCOORDS, streamIndex);
if (texCoords && (res = memcmp(&texCoords[a], &texCoords[b], sizeof(texCoords[a]))))
if (texCoords)
{
res = memcmp(&texCoords[a], &texCoords[b], sizeof(texCoords[a]));
if (res)
{
return res < 0;
}
}
}
if (mesh.m_pNorms)
{
res = memcmp(&mesh.m_pNorms[a], &mesh.m_pNorms[b], sizeof(mesh.m_pNorms[a]));
if (res)
{
return res < 0;
}
}
if ((mesh.m_pNorms && (res = memcmp(&mesh.m_pNorms[a], &mesh.m_pNorms[b], sizeof(mesh.m_pNorms[a])))) ||
(mesh.m_pColor0 && (res = memcmp(&mesh.m_pColor0[a], &mesh.m_pColor0[b], sizeof(mesh.m_pColor0[a])))) ||
(mesh.m_pColor1 && (res = memcmp(&mesh.m_pColor1[a], &mesh.m_pColor1[b], sizeof(mesh.m_pColor1[a])))) ||
(mesh.m_pVertMats && (res = memcmp(&mesh.m_pVertMats[a], &mesh.m_pVertMats[b], sizeof(mesh.m_pVertMats[a])))) ||
(mesh.m_pTangents && (res = memcmp(&mesh.m_pTangents[a], &mesh.m_pTangents[b], sizeof(mesh.m_pTangents[a])))))
if (mesh.m_pColor0)
{
return res < 0;
res = memcmp(&mesh.m_pColor0[a], &mesh.m_pColor0[b], sizeof(mesh.m_pColor0[a]));
if (res)
{
return res < 0;
}
}
if (mesh.m_pColor1)
{
res = memcmp(&mesh.m_pColor1[a], &mesh.m_pColor1[b], sizeof(mesh.m_pColor1[a]));
if (res)
{
return res < 0;
}
}
if (mesh.m_pVertMats)
{
res = memcmp(&mesh.m_pVertMats[a], &mesh.m_pVertMats[b], sizeof(mesh.m_pVertMats[a]));
if (res)
{
return res < 0;
}
}
if (mesh.m_pTangents)
{
res = memcmp(&mesh.m_pTangents[a], &mesh.m_pTangents[b], sizeof(mesh.m_pTangents[a]));
if (res)
{
return res < 0;
}
}
return false;
+3 -2
View File
@@ -89,7 +89,9 @@ void CObjManager::UnloadObjects(bool bDeleteAll)
m_lstLoadedObjects.clear();
}
#if !defined(_RELEASE)
int nNumLeaks = 0;
#endif
std::vector<CStatObj*> garbage;
for (CStatObj* pStatObj = CStatObj::get_intrusive_list_root(); pStatObj; pStatObj = pStatObj->m_next_intrusive)
{
@@ -1120,8 +1122,7 @@ bool CObjManager::SphereRenderMeshIntersection(IRenderMesh* pRenderMesh, const V
// get indices
vtx_idx* pInds = pRenderMesh->GetIndexPtr(FSL_READ);
int nInds = pRenderMesh->GetIndicesCount();
assert(nInds % 3 == 0);
assert(pRenderMesh->GetIndicesCount() % 3 == 0);
// test tris
TRenderChunkArray& Chunks = pRenderMesh->GetChunks();
+1 -1
View File
@@ -14,4 +14,4 @@
// Description : Draw static objects (vegetations)
#include "Cry3DEngine_precompiled.h"
#include "Cry3DEngine_precompiled.h"
@@ -34,11 +34,6 @@ void CObjManager::RenderDecalAndRoad(IRenderNode* pEnt,
{
FUNCTION_PROFILER_3DENGINE;
#ifdef _DEBUG
const char* szName = pEnt->GetName();
const char* szClassName = pEnt->GetEntityClassName();
#endif // _DEBUG
// do not draw if marked to be not drawn or already drawn in this frame
unsigned int nRndFlags = pEnt->GetRndFlags();
@@ -136,11 +131,6 @@ void CObjManager::RenderObject(IRenderNode* pEnt,
const CVars* pCVars = GetCVars();
#ifdef _DEBUG
const char* szName = pEnt->GetName();
const char* szClassName = pEnt->GetEntityClassName();
#endif // _DEBUG
// do not draw if marked to be not drawn or already drawn in this frame
unsigned int nRndFlags = pEnt->GetRndFlags();
@@ -287,8 +277,8 @@ void CObjManager::RenderObject(IRenderNode* pEnt,
if (eERType != eERType_Light && (pEnt->m_nInternalFlags & IRenderNode::REQUIRES_NEAREST_CUBEMAP))
{
uint16 nCubemapTexId = 0;
if (!(nCubemapTexId = CheckCachedNearestCubeProbe(pEnt)) || !pCVars->e_CacheNearestCubePicking)
uint16 nCubemapTexId = CheckCachedNearestCubeProbe(pEnt);
if (!nCubemapTexId || !pCVars->e_CacheNearestCubePicking)
{
nCubemapTexId = GetNearestCubeProbe(pVisArea, objBox);
}
@@ -304,7 +294,8 @@ void CObjManager::RenderObject(IRenderNode* pEnt,
if (pCVars->e_Dissolve && eERType != eERType_Light && passInfo.IsGeneralPass())
{
if (DrawParams.nDissolveRef = GetDissolveRef(fEntDistance, pEnt->m_fWSMaxViewDist))
DrawParams.nDissolveRef = GetDissolveRef(fEntDistance, pEnt->m_fWSMaxViewDist);
if (DrawParams.nDissolveRef)
{
DrawParams.dwFObjFlags |= FOB_DISSOLVE | FOB_DISSOLVE_OUT;
if (DrawParams.nDissolveRef == 255)
@@ -462,8 +453,7 @@ bool CObjManager::RayRenderMeshIntersection(IRenderMesh* pRenderMesh, const Vec3
// get indices
vtx_idx* pInds = pRenderMesh->GetIndexPtr(FSL_READ);
int nInds = pRenderMesh->GetIndicesCount();
assert(nInds % 3 == 0);
assert(pRenderMesh->GetIndicesCount() % 3 == 0);
float fClosestHitDistance = -1;
@@ -98,7 +98,7 @@ void CObjManager::UnregisterForStreaming(IStreamable* pObj)
if (m_arrStreamableObjects.size() > 0)
{
SStreamAbleObject streamAbleObject(pObj, false);
bool deleted = m_arrStreamableObjects.Delete(streamAbleObject);
[[maybe_unused]] bool deleted = m_arrStreamableObjects.Delete(streamAbleObject);
#ifdef OBJMAN_STREAM_STATS
if (deleted && m_pStreamListener)
@@ -754,7 +754,6 @@ void CObjManager::ProcessObjectsStreaming_Finish()
LOADING_TIME_PROFILE_SECTION;
int nNumStreamableObjects = m_arrStreamableObjects.Count();
m_bNeedProcessObjectsStreaming_Finish = false;
FRAME_PROFILER("ProcessObjectsStreaming_Finish", GetSystem(), PROFILE_3DENGINE);
@@ -814,7 +813,6 @@ void CObjManager::ProcessObjectsStreaming_Finish()
// the pool size in the renderer is sufficient. NOTE: This is a weak
// test. Better test would be to actually preallocate the memory here and
// only submit the streaming job if the memory could be obtained.
int size = pStatObj->GetStreamableContentMemoryUsage();
if (GetCVars()->e_StreamCgfDebug == 2)
{
@@ -1016,7 +1014,6 @@ void CObjManager::PrecacheStatObjMaterial(_smart_ptr<IMaterial> pMaterial, const
if (CMatInfo* pMatInfo = static_cast<CMatInfo*>(pMaterial.get()))
{
CStatObj* pCStatObj = static_cast<CStatObj*>(pStatObj);
pMatInfo->PrecacheMaterial(fEntDistance, (pStatObj ? pStatObj->GetRenderMesh() : NULL), bFullUpdate, bDrawNear);
}
}
@@ -250,7 +250,6 @@ void COctreeNode::CompileObjects()
m_lstCasters.reserve(numCasters);
IObjManager* pObjManager = GetObjManager();
// update node
for (int l = 0; l < eRNListType_ListsNum; l++)
@@ -786,7 +785,6 @@ void COctreeNode::GetMemoryUsage(ICrySizer* pSizer) const
{
for (IRenderNode* pObj = m_arrObjects[l].m_pFirstNode; pObj; pObj = pObj->m_pNext)
{
EERType eType = pObj->GetRenderNodeType();
pObj->GetMemoryUsage(pSizer);
}
}
@@ -1504,16 +1502,6 @@ bool COctreeNode::UpdateStreamingPriority(PodArray<COctreeNode*>& arrRecursion,
continue;
}
#ifdef _DEBUG
const char* szName = pObj->GetName();
const char* szClassName = pObj->GetEntityClassName();
if (pObj->GetRndFlags() & ERF_SELECTED)
{
int selected = 1;
}
#endif // _DEBUG
pObj->FillBBox(objBox);
// stream more in zoom mode if in frustum
@@ -580,8 +580,6 @@ void COctreeNode::UpdateObjects(IRenderNode* pObj)
AZ_PROFILE_FUNCTION(AZ::Debug::ProfileCategory::ThreeDEngineDetailed);
float fObjMaxViewDistance = 0;
size_t numCasters = 0;
IObjManager* pObjManager = GetObjManager();
bool bVegetHasAlphaTrans = false;
int nFlags = pObj->GetRndFlags();
@@ -659,7 +657,6 @@ void COctreeNode::UpdateObjects(IRenderNode* pObj)
}
bool bUpdateParentShadowFlags = false;
bool bUpdateParentOcclusionFlags = false;
// fill shadow casters list
const bool bHasPerObjectShadow = GetCVars()->e_ShadowsPerObject && p3DEngine->GetPerObjectShadow(pObj);
@@ -1138,26 +1135,11 @@ bool CObjManager::IsBoxOccluded(const AABB& objBox,
CVisAreaManager* pVisAreaManager = GetVisAreaManager();
if (GetCVars()->e_OcclusionVolumes && pVisAreaManager && pVisAreaManager->IsOccludedByOcclVolumes(objBox, passInfo))
{
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// do not set the lastOccludedMainFrameID because it is camera agnostic so the main pass might occlude
// objects that should only be occluded in the render scene to texture pass
if (!passInfo.IsRenderSceneToTexturePass())
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
{
pOcclTestVars->nLastOccludedMainFrameID = mainFrameID;
}
pOcclTestVars->nLastOccludedMainFrameID = mainFrameID;
return true;
}
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// don't use coverage buffer results if we are checking occlusion for a render to texture camera
// because the render to texture pass does not currently write to the coverage buffer and
// the frame IDs will not work correctly.
if (GetCVars()->e_CoverageBuffer && !passInfo.IsRenderSceneToTexturePass())
#else
if (GetCVars()->e_CoverageBuffer)
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
{
return pOcclTestVars->nLastOccludedMainFrameID == mainFrameID - 1;
}
@@ -522,12 +522,12 @@ void COctreeNode::LoadSingleObject(byte*& pPtr, [[maybe_unused]] std::vector<ISt
{
for (uint32 j(0); j < pChunk->m_numVertices; ++j)
{
SWaterVolumeVertex* pVertex(StepData<SWaterVolumeVertex>(pPtr, eEndian));
StepData<SWaterVolumeVertex>(pPtr, eEndian);
}
for (uint32 j(0); j < pChunk->m_numVerticesPhysAreaContour; ++j)
{
SWaterVolumeVertex* pVertex(StepData<SWaterVolumeVertex>(pPtr, eEndian));
StepData<SWaterVolumeVertex>(pPtr, eEndian);
}
return;
@@ -537,7 +537,7 @@ void COctreeNode::LoadSingleObject(byte*& pPtr, [[maybe_unused]] std::vector<ISt
int auxCntSrc = pChunk->m_volumeTypeAndMiscBits >> 24, auxCntDst;
float* pAuxDataDst = pObj->GetAuxSerializationDataPtr(auxCntDst);
const float* pAuxDataSrc = StepData<float>(pPtr, auxCntSrc, eEndian);
StepData<float>(pPtr, auxCntSrc, eEndian);
memcpy(pAuxDataDst, pAuxDataDst, min(auxCntSrc, auxCntDst) * sizeof(float));
// read common node data
-7
View File
@@ -129,7 +129,6 @@ void COcean::Update(const SRenderingPassInfo& passInfo)
}
const CCamera& rCamera = passInfo.GetCamera();
int32 nFillThreadID = passInfo.ThreadID();
uint32 nBufID = passInfo.GetFrameID() % CYCLE_BUFFERS_NUM;
Vec3 vCamPos = rCamera.GetPosition();
@@ -291,7 +290,6 @@ void COcean::Create()
//sqrt_tpl(fx*fx + fy * fy);
vv.z = fEdgeDisplace; //!((y==0 ||y == nScrGridSize-1) || (x==0 || x == nScrGridSize-1));
int32 n = m_pMeshVerts.Count();
tmp.xyz = vv;
m_pMeshVerts.Add(tmp);
}
@@ -463,7 +461,6 @@ void COcean::Render(const SRenderingPassInfo& passInfo)
C3DEngine* p3DEngine = (C3DEngine*)Get3DEngine();
IRenderer* pRenderer(GetRenderer());
int32 nBufID = (passInfo.GetFrameID() & 1);
Vec3 vCamPos = passInfo.GetCamera().GetPosition();
float fWaterLevel = OceanToggle::IsActive() ? OceanRequest::GetOceanLevel() : p3DEngine->GetWaterLevel();
@@ -482,8 +479,6 @@ void COcean::Render(const SRenderingPassInfo& passInfo)
// test for multiple lights and shadows support
SRenderObjData* pOD = pRenderer->EF_GetObjData(pObject, true, passInfo.ThreadID());
m_Camera = passInfo.GetCamera();
pObject->m_fAlpha = 1.f;
@@ -588,7 +583,6 @@ void COcean::SetMaterial(_smart_ptr<IMaterial> pMat)
void COcean::RenderBottomCap(const SRenderingPassInfo& passInfo)
{
C3DEngine* p3DEngine = (C3DEngine*)Get3DEngine();
Vec3 vCamPos = passInfo.GetCamera().GetPosition();
@@ -828,7 +822,6 @@ bool COcean::IsVisible(const SRenderingPassInfo& passInfo)
m_fLastVisibleFrameTime = 0.0f;
}
ITimer* pTimer(gEnv->pTimer);
m_fLastVisibleFrameTime += gEnv->pTimer->GetFrameTime();
if (m_fLastVisibleFrameTime > 2.0f) // at least 2 seconds
@@ -94,4 +94,4 @@ void C3DEngine::DisablePostEffects()
}
}
}
}
}
@@ -44,11 +44,6 @@ int CRenderMeshMerger::Cmp_Materials(_smart_ptr<IMaterial> pMat1, _smart_ptr<IMa
SShaderItem& shaderItem1 = pMat1->GetShaderItem();
SShaderItem& shaderItem2 = pMat2->GetShaderItem();
#ifdef _DEBUG
const char* pName1 = shaderItem1.m_pShader->GetName();
const char* pName2 = shaderItem2.m_pShader->GetName();
#endif
// vert format
AZ::Vertex::Format vertexFormat1 = shaderItem1.m_pShader->GetVertexFormat();
AZ::Vertex::Format vertexFormat2 = shaderItem2.m_pShader->GetVertexFormat();
@@ -323,7 +318,6 @@ void CRenderMeshMerger::MakeListOfAllCRenderChunks(SMergeInfo& info)
pRM->GetBBox(vMin, vMax);
// get indices
uint32 nIndCount = pRM->GetIndicesCount();
vtx_idx* pSrcInds = pRM->GetIndexPtr(FSL_READ);
Vec3 vOSPos(0, 0, 0);
@@ -346,6 +340,7 @@ void CRenderMeshMerger::MakeListOfAllCRenderChunks(SMergeInfo& info)
CRenderChunk newMatInfo = pRM->GetChunks()[pRMI->nChunkId];
#ifdef _DEBUG
uint32 nIndCount = pRM->GetIndicesCount();
CRenderChunk Ch = newMatInfo;
for (uint32 i = Ch.nFirstIndexId; i < Ch.nFirstIndexId + Ch.nNumIndices; i++)
{
@@ -971,7 +966,6 @@ void CRenderMeshMerger::TryMergingChunks(SMergeInfo& info)
else
{
_smart_ptr<IMaterial> pMat = mergChunk.pMaterial;
SShaderItem& shaderItem = pMat->GetShaderItem();
chunkVertexFormat = mergChunk.rChunk.m_vertexFormat;
}
@@ -30,15 +30,6 @@ void ShadowCache::InitShadowFrustum(ShadowMapFrustum*& pFr, int nLod, int nFirst
return;
}
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// ShadowCache not supported in render scene to texture passes yet.
// It is very common to jump large distances.
if (passInfo.IsRenderSceneToTexturePass())
{
return;
}
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
if (!pFr)
{
pFr = new ShadowMapFrustum;
+5 -2
View File
@@ -974,11 +974,14 @@ IStatObj* CStatObj::Clone(bool bCloneGeometry, bool bCloneChildren, bool bMeshes
pNewObj->m_bSharesChildren = true;
}
if (pNewObj->m_hasClothTangentsData = m_hasClothTangentsData)
pNewObj->m_hasClothTangentsData = m_hasClothTangentsData;
if (pNewObj->m_hasClothTangentsData)
{
pNewObj->m_pClothTangentsData = m_pClothTangentsData;
}
if (pNewObj->m_hasSkinInfo = m_hasSkinInfo)
pNewObj->m_hasSkinInfo = m_hasSkinInfo;
if (pNewObj->m_hasSkinInfo)
{
pNewObj->m_pSkinInfo = m_pSkinInfo;
}
+209 -104
View File
@@ -148,8 +148,17 @@ int CStatObj::SetDeformationMorphTarget(IStatObj* pDeformed)
{
((CStatObj*)pDeformed)->MakeRenderMesh();
}
if (!(pMeshA = GetRenderMesh()) || !(pMeshB = pDeformed->GetRenderMesh()) ||
!(pFaceToFace0A = m_pMapFaceToFace0) || !(pFaceToFace0B = ((CStatObj*)pDeformed)->m_pMapFaceToFace0))
if (!(pMeshA = GetRenderMesh()) || !(pMeshB = pDeformed->GetRenderMesh()))
{
return 0;
}
pFaceToFace0A = m_pMapFaceToFace0;
if (!pFaceToFace0A)
{
return 0;
}
pFaceToFace0B = ((CStatObj*)pDeformed)->m_pMapFaceToFace0;
if (!pFaceToFace0B)
{
return 0;
}
@@ -1088,11 +1097,20 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
for (i = 0; i < nObj; i++)
{
if ((pSubObj = GetSubObject(i))->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj && pSubObj->pStatObj->GetPhysGeom() &&
pSubObj->bHidden &&
(!strncmp(pSubObj->name, "childof_", 8) && (pSubObj1 = FindSubObject((const char*)pSubObj->name + 8)) ||
(pSubObj1 = GetSubObject(pSubObj->nParent)) && strstr(pSubObj1->properties, "group")))
pSubObj->bHidden && (!strncmp(pSubObj->name, "childof_", 8)))
{
pSubObj->bHidden = pSubObj1->bHidden;
pSubObj1 = FindSubObject((const char*)pSubObj->name + 8);
if (pSubObj1)
{
pSubObj1 = GetSubObject(pSubObj->nParent);
if (pSubObj1)
{
if (strstr(pSubObj1->properties, "group"))
{
pSubObj->bHidden = pSubObj1->bHidden;
}
}
}
}
}
@@ -1127,12 +1145,19 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
float mindist = 1e10f, curdist;
for (j = 0, i0 = i; j < nObj; j++)
{
if (j != i && (pSubObj1 = GetSubObject(j)) && pSubObj1->pStatObj && ((CStatObj*)pSubObj1->pStatObj)->m_nRenderTrisCount > 0 &&
(curdist = (pSubObj1->localTM * (((CStatObj*)pSubObj1->pStatObj)->m_vBoxMin +
((CStatObj*)pSubObj1->pStatObj)->m_vBoxMax) * 0.5f - center).len2()) < mindist)
if (j != i)
{
mindist = curdist;
i0 = j;
pSubObj1 = GetSubObject(j);
if (pSubObj1 && pSubObj1->pStatObj && ((CStatObj*)pSubObj1->pStatObj)->m_nRenderTrisCount > 0)
{
curdist = (pSubObj1->localTM * (((CStatObj*)pSubObj1->pStatObj)->m_vBoxMin +
((CStatObj*)pSubObj1->pStatObj)->m_vBoxMax) * 0.5f - center).len2();
if (curdist < mindist)
{
mindist = curdist;
i0 = j;
}
}
}
}
pSubObj->pStatObj->GetPhysGeom()->pGeom->SetForeignData(GetSubObject(i0)->pStatObj, 0);
@@ -1357,7 +1382,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
psj.axisx = pMtx->TransformVector(psj.axisx).normalized();
}
if ((pval = strstr(properties, "limit")) && (pval - 11 < properties - 11 || strncmp(pval - 11, "constraint_", 11)))
pval = strstr(properties, "limit");
if (pval && (pval - 11 < properties - 11 || strncmp(pval - 11, "constraint_", 11)))
{
for (pval += 5; *pval && !isdigit(*pval); pval++)
{
@@ -1373,7 +1399,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
// psj.maxForcePush = psj.maxForcePull*2.5f;
psj.bBreakable = 1;
}
if (pval = strstr(properties, "twist"))
pval = strstr(properties, "twist");
if (pval)
{
for (pval += 5; *pval && !isdigit(*pval); pval++)
{
@@ -1384,7 +1411,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
psj.maxTorqueTwist = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "bend"))
pval = strstr(properties, "bend");
if (pval)
{
for (pval += 4; *pval && !isdigit(*pval); pval++)
{
@@ -1395,7 +1423,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
psj.maxTorqueBend = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "push"))
pval = strstr(properties, "push");
if (pval)
{
for (pval += 4; *pval && !isdigit(*pval); pval++)
{
@@ -1406,7 +1435,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
psj.maxForcePush = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "pull"))
pval = strstr(properties, "pull");
if (pval)
{
for (pval += 4; *pval && !isdigit(*pval); pval++)
{
@@ -1417,7 +1447,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
psj.maxForcePull = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "shift"))
pval = strstr(properties, "shift");
if (pval)
{
for (pval += 5; *pval && !isdigit(*pval); pval++)
{
@@ -1428,7 +1459,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
psj.maxForceShift = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "damage_accum"))
pval = strstr(properties, "damage_accum");
if (pval)
{
for (pval += 5; *pval && !isdigit(*pval); pval++)
{
@@ -1439,7 +1471,8 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
psj.damageAccum = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "damage_accum_threshold"))
pval = strstr(properties, "damage_accum_threshold");
if (pval)
{
for (pval += 5; *pval && !isdigit(*pval); pval++)
{
@@ -1470,50 +1503,101 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
psj.bDirectBreaksOnly = strstr(properties, "hits_only") != 0;
psj.limitConstraint.zero();
psj.bConstraintWillIgnoreCollisions = 1;
if ((len = 16, pval = strstr(properties, "constraint_limit")) || (len = 5, pval = strstr(properties, "C_lmt")))
len = 16;
pval = strstr(properties, "constraint_limit");
if (pval)
{
for (pval += len; *pval && !isdigit(*pval); pval++)
{
;
}
for (pval += len; *pval && !isdigit(*pval); pval++);
if (pval)
{
psj.limitConstraint.z = aznumeric_caster(atof(pval));
}
}
if ((len = 17, pval = strstr(properties, "constraint_minang")) || (len = 5, pval = strstr(properties, "C_min")))
else
{
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++)
len = 5;
pval = strstr(properties, "C_lmt");
if (pval)
{
;
for (pval += len; *pval && !isdigit(*pval); pval++)
;
if (pval)
{
psj.limitConstraint.z = aznumeric_caster(atof(pval));
}
}
}
len = 17;
pval = strstr(properties, "constraint_minang");
if (pval)
{
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++);
if (pval)
{
psj.limitConstraint.x = aznumeric_caster(DEG2RAD(atof(pval)));
}
}
if ((len = 17, pval = strstr(properties, "constraint_maxang")) || (len = 5, pval = strstr(properties, "C_max")))
else
{
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++)
len = 5;
pval = strstr(properties, "C_min");
if (pval)
{
;
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++)
;
if (pval)
{
psj.limitConstraint.x = aznumeric_caster(DEG2RAD(atof(pval)));
}
}
}
len = 17;
pval = strstr(properties, "constraint_maxang");
if (pval)
{
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++);
if (pval)
{
psj.limitConstraint.y = aznumeric_caster(DEG2RAD(atof(pval)));
}
}
if ((len = 18, pval = strstr(properties, "constraint_damping")) || (len = 5, pval = strstr(properties, "C_dmp")))
else
{
for (pval += len; *pval && !isdigit(*pval); pval++)
len = 5;
pval = strstr(properties, "C_max");
if (pval)
{
;
for (pval += len; *pval && !isdigit(*pval) && *pval != '-'; pval++);
if (pval)
{
psj.limitConstraint.y = aznumeric_caster(DEG2RAD(atof(pval)));
}
}
}
len = 18;
pval = strstr(properties, "constraint_damping");
if (pval)
{
for (pval += len; *pval && !isdigit(*pval); pval++);
if (pval)
{
psj.dampingConstraint = aznumeric_caster(atof(pval));
}
}
else
{
len = 5;
pval = strstr(properties, "C_dmp");
if (pval)
{
for (pval += len; *pval && !isdigit(*pval); pval++);
if (pval)
{
psj.dampingConstraint = aznumeric_caster(atof(pval));
}
}
}
if (strstr(properties, "constraint_collides") || strstr(properties, "C_coll"))
{
psj.bConstraintWillIgnoreCollisions = 0;
@@ -1565,94 +1649,107 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
for (i = 0; i < nObj; i++)
{
if ((pSubObj = GetSubObject(i))->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj && pSubObj->pStatObj->GetPhysGeom() && !pSubObj->bHidden &&
!strncmp(pSubObj->name, "skeleton_", 9) && (pSubObj1 = FindSubObject((const char*)pSubObj->name + 9)))
!strncmp(pSubObj->name, "skeleton_", 9))
{
pe_params_skeleton ps;
properties = szPropsOverride ? szPropsOverride : (const char*)pSubObj->properties;
if (pval = strstr(properties, "stiffness"))
pSubObj1 = FindSubObject((const char*)pSubObj->name + 9);
if (pSubObj1)
{
for (pval += 9; *pval && !isdigit(*pval); pval++)
{
;
}
pe_params_skeleton ps;
properties = szPropsOverride ? szPropsOverride : (const char*)pSubObj->properties;
pval = strstr(properties, "stiffness");
if (pval)
{
ps.stiffness = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "thickness"))
{
for (pval += 9; *pval && !isdigit(*pval); pval++)
{
;
for (pval += 9; *pval && !isdigit(*pval); pval++)
{
;
}
if (pval)
{
ps.stiffness = aznumeric_caster(atof(pval));
}
}
pval = strstr(properties, "thickness");
if (pval)
{
ps.thickness = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "max_stretch"))
{
for (pval += 11; *pval && !isdigit(*pval); pval++)
{
;
for (pval += 9; *pval && !isdigit(*pval); pval++)
{
;
}
if (pval)
{
ps.thickness = aznumeric_caster(atof(pval));
}
}
pval = strstr(properties, "max_stretch");
if (pval)
{
ps.maxStretch = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "max_impulse"))
{
for (pval += 11; *pval && !isdigit(*pval); pval++)
{
;
for (pval += 11; *pval && !isdigit(*pval); pval++)
{
;
}
if (pval)
{
ps.maxStretch = aznumeric_caster(atof(pval));
}
}
pval = strstr(properties, "max_impulse");
if (pval)
{
ps.maxImpulse = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "skin_dist"))
{
for (pval += 9; *pval && !isdigit(*pval); pval++)
{
;
for (pval += 11; *pval && !isdigit(*pval); pval++)
{
;
}
if (pval)
{
ps.maxImpulse = aznumeric_caster(atof(pval));
}
}
pval = strstr(properties, "skin_dist");
if (pval)
{
pp.minContactDist = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "hardness"))
{
for (pval += 8; *pval && !isdigit(*pval); pval++)
{
;
for (pval += 9; *pval && !isdigit(*pval); pval++)
{
;
}
if (pval)
{
pp.minContactDist = aznumeric_caster(atof(pval));
}
}
pval = strstr(properties, "hardness");
if (pval)
{
ps.hardness = aznumeric_caster(atof(pval));
}
}
if (pval = strstr(properties, "explosion_scale"))
{
for (pval += 15; *pval && !isdigit(*pval); pval++)
{
;
for (pval += 8; *pval && !isdigit(*pval); pval++)
{
;
}
if (pval)
{
ps.hardness = aznumeric_caster(atof(pval));
}
}
pval = strstr(properties, "explosion_scale");
if (pval)
{
ps.explosionScale = aznumeric_caster(atof(pval));
for (pval += 15; *pval && !isdigit(*pval); pval++)
{
;
}
if (pval)
{
ps.explosionScale = aznumeric_caster(atof(pval));
}
}
}
pp.partid = ps.partid = aznumeric_cast<int>((pSubObj1 - &m_subObjects[0])) + id0;
pp.idSkeleton = i + id0;
pent->SetParams(&pp);
pent->SetParams(&ps);
((CStatObj*)pSubObj1->pStatObj)->PrepareSkinData(pSubObj1->localTM.GetInverted() * pSubObj->localTM, pSubObj->pStatObj->GetPhysGeom()->pGeom,
is_unused(pp.minContactDist) ? 0.0f : pp.minContactDist);
pp.partid = ps.partid = aznumeric_cast<int>((pSubObj1 - &m_subObjects[0])) + id0;
pp.idSkeleton = i + id0;
pent->SetParams(&pp);
pent->SetParams(&ps);
((CStatObj*)pSubObj1->pStatObj)
->PrepareSkinData(
pSubObj1->localTM.GetInverted() * pSubObj->localTM, pSubObj->pStatObj->GetPhysGeom()->pGeom,
is_unused(pp.minContactDist) ? 0.0f : pp.minContactDist);
}
}
}
}
@@ -1660,14 +1757,22 @@ int CStatObj::PhysicalizeSubobjects(IPhysicalEntity* pent, const Matrix34* pMtx,
new(&pp)pe_params_part;
for (i = 0; i < nObj; i++)
{
if ((pSubObj = GetSubObject(i))->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj && pSubObj->pStatObj->GetPhysGeom() && !pSubObj->bHidden &&
(!strncmp(pSubObj->name, "childof_", 8) && (pSubObj1 = FindSubObject((const char*)pSubObj->name + 8)) ||
(pSubObj1 = GetSubObject(pSubObj->nParent)) && strstr(pSubObj1->properties, "group")))
pSubObj = GetSubObject(i);
if (pSubObj->nType == STATIC_SUB_OBJECT_MESH && pSubObj->pStatObj && pSubObj->pStatObj->GetPhysGeom() && !pSubObj->bHidden &&
!strncmp(pSubObj->name, "childof_", 8))
{
pp.partid = i + id0;
pp.idParent = aznumeric_caster(pSubObj1 - &m_subObjects[0]);
pent->SetParams(&pp);
pSubObj->bHidden = true;
pSubObj1 = FindSubObject((const char*)pSubObj->name + 8);
if (pSubObj1)
{
pSubObj1 = GetSubObject(pSubObj->nParent);
if (pSubObj1 && strstr(pSubObj1->properties, "group"))
{
pp.partid = i + id0;
pp.idParent = aznumeric_caster(pSubObj1 - &m_subObjects[0]);
pent->SetParams(&pp);
pSubObj->bHidden = true;
}
}
}
}
@@ -155,7 +155,6 @@ void CStatObj::FillRenderObject(const SRendParams& rParams, IRenderNode* pRender
// Specify transformation
////////////////////////////////////////////////////////////////////////////////////////////////////
IRenderer* pRend = GetRenderer();
assert(pObj);
if (!pObj)
@@ -22,4 +22,4 @@ TEST(MockValidationTests, SystemMock_Compiles)
TEST(MockValidationTests, LogMock_Compiles)
{
LogMock mockLog;
}
}
+1 -3
View File
@@ -214,7 +214,7 @@ CTimeOfDay::CTimeOfDay()
// fill local var list so, sandbox can access var list without level being loaded
// Cryengine supports the notion of environment presets which are set in code that is currently not
// in lumberyard. Therefore, create a default preset here that is used as the only one.
// in Open 3D Engine. Therefore, create a default preset here that is used as the only one.
m_defaultPreset = new CEnvironmentPreset;
for (int i = 0; i < PARAM_TOTAL; ++i)
{
@@ -612,7 +612,6 @@ void CTimeOfDay::UpdateEnvLighting(bool forceUpdate)
// Calculating the energy multiplier where mid-day sun is 1.0 and night is 0
const float noonTime = 12.0f;
float dayTime = p3DEngine->m_duskEnd - p3DEngine->m_dawnStart;
if (m_fTime <= noonTime)
{
@@ -911,7 +910,6 @@ void CTimeOfDay::MigrateLegacyData(bool bSunIntensity, const XmlNodeRef& node)
varHDRPower.pInterpolator->InterpolateFloat(time, hdrPower);
const float HDRDynamicMultiplier = 2.0f;
float hdrMult = powf(HDRDynamicMultiplier, hdrPower);
float sunColorLum = sunColor[0] * 0.2126f + sunColor[1] * 0.7152f + sunColor[2] * 0.0722f;
float sunIntensity = sunMult * sunColorLum * 10000.0f * gf_PI;
@@ -27,7 +27,6 @@ bool CVisAreaManager::GetCompiledData([[maybe_unused]] byte* pData, [[maybe_unus
# else
float fStartTime = GetCurAsyncTimeSec();
bool bObjs(!pExportInfo || pExportInfo->nObjTypeMask);
// PrintMessage("Exporting indoor data (%s, %.2f MB) ...",
@@ -206,8 +205,6 @@ bool CVisAreaManager::Load_T(T& f, int& nDataSize, SVisAreaManChunkHeader* pVisA
return 0;
}
bool bObjs(!pExportInfo || pExportInfo->nObjTypeMask);
AABB* pBox = (pExportInfo && !pExportInfo->areaBox.IsReset()) ? &pExportInfo->areaBox : NULL;
EEndian eEndian = (pVisAreaManagerChunkHeader->nFlags & SERIALIZATION_FLAG_BIG_ENDIAN) ? eBigEndian : eLittleEndian;
@@ -1357,12 +1357,17 @@ int OnWaterUpdate(const EventPhysAreaChange* pEvent)
void CWaterVolumeRenderNode::SyncToPhysMesh(const QuatT& qtSurface, IGeometry* pSurface, float depth)
{
mesh_data* pmd;
if (!pSurface || pSurface->GetType() != GEOM_TRIMESH || !(pmd = (mesh_data*)pSurface->GetData()))
if (!pSurface || pSurface->GetType() != GEOM_TRIMESH)
{
return;
}
bool bResized = false;
if (bResized = m_waterSurfaceVertices.size() != pmd->nVertices)
pmd = (mesh_data*)pSurface->GetData();
if (!pmd)
{
return;
}
bool bResized = m_waterSurfaceVertices.size() != pmd->nVertices;
if (bResized)
{
m_waterSurfaceVertices.resize(pmd->nVertices);
}
+4 -2
View File
@@ -130,11 +130,13 @@ void CCoverageBuffer::ClipPolygon(PodArray<Vec3>& PolygonOut, const PodArray<Vec
}
// check result
#if !defined(NDEBUG)
for (int i = 0; i < PolygonOut.Count(); i++)
{
float d1 = -ClipPlane.DistFromPlane(PolygonOut.GetAt(i));
float d1 = -ClipPlane.DistFromPlane(PolygonOut.GetAt(i));
assert(d1 >= -0.01f);
}
#endif
assert(PolygonOut.Count() == 0 || PolygonOut.Count() >= 3);
}
@@ -209,4 +211,4 @@ void CPolygonClipContext::GetMemoryUsage(ICrySizer* pSizer) const
{
pSizer->AddObject(m_lstPolygonA);
pSizer->AddObject(m_lstPolygonB);
}
}
+2 -2
View File
@@ -205,7 +205,7 @@ void CVars::Init()
#ifndef _RELEASE
DefineConstIntCVar(e_DebugDrawListSize, 24, VF_DEV_ONLY, "num objects in the list for e_DebugDraw list infodebug");
ICVar* e_DebugDrawListFilter = REGISTER_STRING_CB_DEV_ONLY("e_DebugDrawListFilter", "", VF_NULL,
REGISTER_STRING_CB_DEV_ONLY("e_DebugDrawListFilter", "", VF_NULL,
"filter for e_DebugDraw list. Combine object type letters to create the filter\n"
"(example: e_DebugDrawListFilter BVC = shows Characters+StatObject). 'all' = no filter.\n"
" C: Character\n"
@@ -922,7 +922,7 @@ void CVars::Init()
"Will not render CGFs past the given amount of drawcalls\n"
"(<=0 off (default), >0 draw calls limit)");
REGISTER_CVAR(e_CheckOctreeObjectsBoxSize, 1, VF_NULL, "CryWarning for crazy sized COctreeNode m_objectsBoxes");
REGISTER_CVAR(e_CheckOctreeObjectsBoxSize, 1, VF_NULL, "Warning for crazy sized COctreeNode m_objectsBoxes");
REGISTER_CVAR(e_DebugGeomPrep, 0, VF_NULL, "enable logging of Geom preparation");
DefineConstIntCVar(e_GeomCaches, 1, VF_NULL, "Activates drawing of geometry caches");
REGISTER_CVAR(e_GeomCacheBufferSize, 128, VF_CHEAT, "Geometry cache stream buffer upper limit size in MB. Default: 128");
+1 -1
View File
@@ -71,4 +71,4 @@ namespace std17
}
}
#endif // CRYINCLUDE_CRYCOMMON_ALGORITHM_H
#endif // CRYINCLUDE_CRYCOMMON_ALGORITHM_H
+4
View File
@@ -71,10 +71,14 @@ COMPILE_TIME_ASSERT(sizeof(uint32) == 4);
COMPILE_TIME_ASSERT(sizeof(sint32) == 4);
typedef slonglong int64;
#ifndef O3DE_INT64_DEFINED
#define O3DE_INT64_DEFINED
typedef slonglong sint64;
typedef ulonglong uint64;
COMPILE_TIME_ASSERT(sizeof(uint64) == 8);
COMPILE_TIME_ASSERT(sizeof(sint64) == 8);
#endif
typedef float f32;
+1 -1
View File
@@ -318,4 +318,4 @@ namespace Bezier
}
}
#endif
#endif
+1 -1
View File
@@ -63,4 +63,4 @@ public:
};
#endif // #ifndef _CREFOGVOLUME_
#endif // #ifndef _CREFOGVOLUME_
+1 -1
View File
@@ -67,4 +67,4 @@ public:
_smart_ptr<IRenderMesh> m_pHullMesh;
};
#endif // #ifndef _CREVOLUMEOBJECT_
#endif // #ifndef _CREVOLUMEOBJECT_
+1 -1
View File
@@ -54,4 +54,4 @@ private:
};
#endif
#endif
+6 -2
View File
@@ -48,8 +48,12 @@
// Using AZ_Assert for all assert kinds (assert =, CRY_ASSERT, AZ_Assert).
// see Trace::Assert for implementation
#if defined(USE_AZ_ASSERT)
#undef assert
#define assert(condition) AZ_Assert(condition, "%s", #condition)
#undef assert
#if !defined(NDEBUG)
#define assert(condition) AZ_Assert(condition, "%s", #condition)
#else
#define assert(condition)
#endif
#endif //defined(USE_AZ_ASSERT)
//-----------------------------------------------------------------------------------------------------
+1 -1
View File
@@ -323,7 +323,7 @@ void CryAssertTrace(const char* _pszFormat, ...)
//-----------------------------------------------------------------------------------------------------
static const char* gs_strRegSubKey = "Software\\Amazon\\Lumberyard\\AssertWindow";
static const char* gs_strRegSubKey = "Software\\O3DE\\AssertWindow";
static const char* gs_strRegXValue = "AssertInfoX";
static const char* gs_strRegYValue = "AssertInfoY";
+4 -1
View File
@@ -511,7 +511,10 @@ public:
void UnlockModify() const
{
SetDebugLocked(false);
int counter = CryInterlockedDecrement(&m_modifyCount); // decrement write counter
#if !defined(NDEBUG)
int counter =
#endif
CryInterlockedDecrement(&m_modifyCount); // decrement write counter
assert(counter >= 0);
m_writeLock.Unlock(); // release exclusive lock
}
@@ -466,7 +466,9 @@ inline void CThreadSafeRendererContainer<T>::CoalesceMemory()
// mark state as not accessable
m_bElementAccessSafe = false;
#if !defined(NDEBUG)
size_t nOldSize = m_nSize;
#endif
// compute required memory
size_t nRequieredElements = 0;
@@ -542,7 +544,7 @@ inline CThreadSafeRendererContainer<T>::CMemoryPage::CMemoryPage()
nMemoryBlockBegin = (nMemoryBlockBegin + nObjectAlignment - 1) & ~(nObjectAlignment - 1);
// compute number of avaible elements
assert((nMemoryBlockEnd - nMemoryBlockBegin) > 0);
assert(nMemoryBlockEnd > nMemoryBlockBegin);
m_nCapacity = (LONG)((nMemoryBlockEnd - nMemoryBlockBegin) / sizeof(T));
// store pointer to store data to
+4 -2
View File
@@ -290,8 +290,10 @@ float NumToFromString(float val, int digits, bool floating, char buffer[], int b
{
sprintf_s(buffer, buf_size, "%.*f", digits, float(val));
}
int readCount = azsscanf(buffer, "%g", &val);
#if !defined(NDEBUG)
int readCount =
#endif
azsscanf(buffer, "%g", &val);
assert(readCount == 1);
return val;
}
+10 -3
View File
@@ -154,8 +154,15 @@ struct CTypeInfo
bool IsBaseClass() const { return bBaseClass; }
bool IsInline() const
{
const CVarInfo* pFirst;
return bBaseClass && Offset == 0 && (pFirst = Type.NextSubVar(0)) && pFirst->IsBaseClass();
if (bBaseClass && Offset == 0)
{
const CVarInfo* pFirst = Type.NextSubVar(0);
if (pFirst)
{
return pFirst->IsBaseClass();
}
}
return false;
}
bool GetLimit(ENumericLimit eLimit, float& fVal) const
@@ -198,7 +205,7 @@ struct CTypeInfo
inline bool HasSubVars() const
{ return NextSubVar(0) != 0; }
#define AllSubVars(pVar, Info) \
(const CTypeInfo::CVarInfo* pVar = 0; pVar = (Info).NextSubVar(pVar); )
(const CTypeInfo::CVarInfo* pVar = (Info).NextSubVar(0); pVar; pVar = (Info).NextSubVar(pVar))
// Named var search.
virtual const CVarInfo* FindSubVar([[maybe_unused]] cstr name) const
+9 -5
View File
@@ -48,23 +48,27 @@ struct SFileVersion
char* p;
char* next = nullptr;
size_t strmax = sizeof(t);
if (!(p = azstrtok(t, &strmax, ".", &next)))
[[maybe_unused]] size_t strmax = sizeof(t);
p = azstrtok(t, &strmax, ".", &next);
if (!p)
{
return;
}
v[3] = atoi(p);
if (!(p = azstrtok(nullptr, &strmax, ".", &next)))
p = azstrtok(nullptr, &strmax, ".", &next);
if (!p)
{
return;
}
v[2] = atoi(p);
if (!(p = azstrtok(nullptr, &strmax, ".", &next)))
p = azstrtok(nullptr, &strmax, ".", &next);
if (!p)
{
return;
}
v[1] = atoi(p);
if (!(p = azstrtok(nullptr, &strmax, ".", &next)))
p = azstrtok(nullptr, &strmax, ".", &next);
if (!p)
{
return;
}
+12 -43
View File
@@ -25,10 +25,6 @@
#include <Cry_XOptimise.h>
//DOC-IGNORE-END
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
#include <AzCore/Component/EntityId.h>
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
//////////////////////////////////////////////////////////////////////
#define CAMERA_MIN_NEAR 0.001f
#define DEFAULT_NEAR 0.2f
@@ -416,8 +412,6 @@ inline void CameraViewParameters::CalcTiledRegionVerts(Vec3* V, Vec2& vMin, Vec2
vTileMax.x = abs(fWR - fWL) * vMax.x;
vTileMax.y = abs(fWT - fWB) * vMax.y;
float TileWidth = abs(fWR - fWL) / nGridSizeX;
float TileHeight = abs(fWT - fWB) / nGridSizeY;
float TileL = fWL + vTileMin.x;
float TileR = fWL + vTileMax.x;
@@ -439,8 +433,6 @@ inline void CameraViewParameters::CalcTiledRegionVerts(Vec3* V, Vec2& vMin, Vec2
vTileFarMax.x = abs(fwR - fwL) * vMax.x;
vTileFarMax.y = abs(fwT - fwB) * vMax.y;
float TileFarWidth = abs(fwR - fwL) / nGridSizeX;
float TileFarHeight = abs(fwT - fwB) / nGridSizeY;
float TileFarL = fwL + vTileFarMin.x;
float TileFarR = fwL + vTileFarMax.x;
@@ -604,11 +596,6 @@ public:
ILINE const Plane* GetFrustumPlane(int numplane) const { return &m_fp[numplane]; }
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
ILINE const AZ::EntityId GetEntityId() const { return m_entityId; }
ILINE void SetEntityId( AZ::EntityId entityId ) { m_entityId = entityId; }
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
//////////////////////////////////////////////////////////////////////////
// Z-Buffer ranges.
// This values are defining near/far clipping plane, it only used to specify z-buffer range.
@@ -675,10 +662,6 @@ public:
m_nPosX = m_nPosY = m_nSizeX = m_nSizeY = 0;
m_entityPos = Vec3(0, 0, 0);
m_entityRot = Quat(0, 0, 0, 1);
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
m_frameUpdateId = 0;
m_entityId = AZ::EntityId();
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
}
~CCamera() {}
@@ -709,15 +692,6 @@ public:
CameraViewParameters m_viewParameters;
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// Get this camera's sequential frame update ID.
uint32_t GetFrameUpdateId() const { return m_frameUpdateId; }
// Increment this camera's sequential frame update ID. This should be
// called every time the camera is used to render the scene.
void IncrementFrameUpdateId() { m_frameUpdateId++; }
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
private:
bool AdditionalCheck(const AABB& aabb) const;
bool AdditionalCheck(const Vec3& wpos, const OBB& obb, f32 uscale) const;
@@ -756,17 +730,6 @@ private:
int m_nPosX, m_nPosY, m_nSizeX, m_nSizeY;
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// A sequential counter that is incremented every time this camera is used
// to render a frame. This id is not the same as the frame update ID used
// by the renderer which handles multiple cameras. Systems that rely on
// per-camera temporal buffers can use this to index temporal data.
uint32_t m_frameUpdateId;
// This camera's Entity ID, useful when multiple cameras are active.
AZ::EntityId m_entityId;
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
//------------------------------------------------------------------------
//--- OLD STUFF
//------------------------------------------------------------------------
@@ -2017,42 +1980,48 @@ inline bool CCamera::IsOBBVisible_E(const Vec3& wpos, const OBB& obb, f32 uscale
//is larger then the "radius" of the OBB, then the OBB is outside the frustum.
f32 t0, t1, t2, t3, t4, t5;
bool mt0, mt1, mt2, mt3, mt4, mt5;
if (mt0 = (t0 = m_fp[0] | p) > 0.0f)
mt0 = (t0 = m_fp[0] | p) > 0.0f;
if (mt0)
{
if (t0 > (fabsf(m_fp[0].n | ax) + fabsf(m_fp[0].n | ay) + fabsf(m_fp[0].n | az)))
{
return CULL_EXCLUSION;
}
}
if (mt1 = (t1 = m_fp[1] | p) > 0.0f)
mt1 = (t1 = m_fp[1] | p) > 0.0f;
if (mt1)
{
if (t1 > (fabsf(m_fp[1].n | ax) + fabsf(m_fp[1].n | ay) + fabsf(m_fp[1].n | az)))
{
return CULL_EXCLUSION;
}
}
if (mt2 = (t2 = m_fp[2] | p) > 0.0f)
mt2 = (t2 = m_fp[2] | p) > 0.0f;
if (mt2)
{
if (t2 > (fabsf(m_fp[2].n | ax) + fabsf(m_fp[2].n | ay) + fabsf(m_fp[2].n | az)))
{
return CULL_EXCLUSION;
}
}
if (mt3 = (t3 = m_fp[3] | p) > 0.0f)
mt3 = (t3 = m_fp[3] | p) > 0.0f;
if (mt3)
{
if (t3 > (fabsf(m_fp[3].n | ax) + fabsf(m_fp[3].n | ay) + fabsf(m_fp[3].n | az)))
{
return CULL_EXCLUSION;
}
}
if (mt4 = (t4 = m_fp[4] | p) > 0.0f)
mt4 = (t4 = m_fp[4] | p) > 0.0f;
if (mt4)
{
if (t4 > (fabsf(m_fp[4].n | ax) + fabsf(m_fp[4].n | ay) + fabsf(m_fp[4].n | az)))
{
return CULL_EXCLUSION;
}
}
if (mt5 = (t5 = m_fp[5] | p) > 0.0f)
mt5 = (t5 = m_fp[5] | p) > 0.0f;
if (mt5)
{
if (t5 > (fabsf(m_fp[5].n | ax) + fabsf(m_fp[5].n | ay) + fabsf(m_fp[5].n | az)))
{
@@ -26,7 +26,7 @@
#define REG_SOFTWARE L"Software\\"
#define REG_COMPANY_NAME L"Amazon\\"
#define REG_PRODUCT_NAME L"Lumberyard\\"
#define REG_PRODUCT_NAME L"Open 3D Engine\\"
#define REG_SETTING L"Settings\\"
#define REG_BASE_SETTING_KEY REG_SOFTWARE REG_COMPANY_NAME REG_PRODUCT_NAME REG_SETTING
@@ -77,7 +77,6 @@ CEngineSettingsBackendWin32::CEngineSettingsBackendWin32(CEngineSettingsManager*
std::wstring CEngineSettingsBackendWin32::GetModuleFilePath() const
{
HMODULE hInstance = GetModuleHandleW(moduleName().c_str());
wchar_t szFilename[_MAX_PATH];
GetModuleFileNameW((HINSTANCE)&__ImageBase, szFilename, _MAX_PATH);
wchar_t drive[_MAX_DRIVE];
@@ -182,7 +181,7 @@ bool CEngineSettingsBackendWin32::SetModuleSpecificBoolEntry(const char* key, co
bool CEngineSettingsBackendWin32::GetInstalledBuildRootPathUtf16(const int index, CWCharBuffer name, CWCharBuffer path)
{
RegKey key(REG_BASE_SETTING_KEY L"LumberyardExport\\ProjectBuilds", false);
RegKey key(REG_BASE_SETTING_KEY L"O3DEExport\\ProjectBuilds", false);
if (key.pKey)
{
DWORD type;
+1 -1
View File
@@ -61,7 +61,7 @@ namespace AZ
///
/// 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 Lumberyard system.
/// HMDDeviceRequestBus in order to be used as an HMD from the main Open 3D Engine system.
///
/// @return If true, initialization fully succeeded.
///
@@ -35,4 +35,4 @@ namespace AZ
};
typedef AZ::EBus<HeightmapUpdateNotification> HeightmapUpdateNotificationBus;
}
}
-14
View File
@@ -2417,9 +2417,6 @@ struct SRenderingPassInfo
CUBEMAP_GEN = BIT(16),
GEOM_CACHES = BIT(17),
DISABLE_RENDER_CHUNK_MERGE = BIT(18),
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
RENDER_SCENE_TO_TEXTURE = BIT(20),
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// below are precombined flags
STATIC_OBJECTS = ENTITIES,
@@ -2445,9 +2442,6 @@ struct SRenderingPassInfo
bool IsCachedShadowPass() const;
EShadowMapType GetShadowMapType() const;
bool IsDisableRenderChunkMerge() const;
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
bool IsRenderSceneToTexturePass() const;
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
bool IsAuxWindow() const;
@@ -2562,14 +2556,6 @@ inline bool SRenderingPassInfo::IsShadowPass() const
return static_cast<EShadowMapType>(m_eShadowMapRendering) != SHADOW_MAP_NONE;
}
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
///////////////////////////////////////////////////////////////////////////////
inline bool SRenderingPassInfo::IsRenderSceneToTexturePass() const
{
return (m_nRenderingFlags & RENDER_SCENE_TO_TEXTURE) != 0;
}
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
///////////////////////////////////////////////////////////////////////////////
inline bool SRenderingPassInfo::IsCachedShadowPass() const
{
-1
View File
@@ -1983,7 +1983,6 @@ public:
for (size_t i = 0, count = m_subsets.size(); i < count; ++i)
{
const SMeshSubset& subset = m_subsets[i];
float posArea;
float texArea;
+32 -4
View File
@@ -19,6 +19,7 @@
#include <AzCore/Component/EntityId.h>
#include <AzCore/Math/Crc.h>
#include <AzCore/Math/Quaternion.h>
#include <AzCore/Serialization/SerializeContext.h>
#include <Range.h>
#include <AnimKey.h>
@@ -326,7 +327,16 @@ struct IMovieCallback
*/
struct IAnimTrack
{
AZ_RTTI(IAnimTrack, "{AA0D5170-FB28-426F-BA13-7EFF6BB3AC67}")
AZ_RTTI(IAnimTrack, "{AA0D5170-FB28-426F-BA13-7EFF6BB3AC67}");
AZ_CLASS_ALLOCATOR(IAnimTrack, AZ::SystemAllocator, 0);
static void Reflect(AZ::ReflectContext* context)
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<IAnimTrack>();
}
}
//! Flags that can be set on animation track.
enum EAnimTrackFlags
@@ -593,7 +603,16 @@ struct IAnimNodeOwner
struct IAnimNode
{
public:
AZ_RTTI(IAnimNode, "{0A096354-7F26-4B18-B8C0-8F10A3E0440A}")
AZ_RTTI(IAnimNode, "{0A096354-7F26-4B18-B8C0-8F10A3E0440A}");
AZ_CLASS_ALLOCATOR(IAnimNode, AZ::SystemAllocator, 0);
static void Reflect(AZ::ReflectContext* context)
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<IAnimNode>();
}
}
//////////////////////////////////////////////////////////////////////////
// Supported params.
@@ -914,9 +933,18 @@ struct IAnimStringTable
*/
struct IAnimSequence
{
AZ_RTTI(IAnimSequence, "{A60F95F5-5A4A-47DB-B3BB-525BBC0BC8DB}")
AZ_RTTI(IAnimSequence, "{A60F95F5-5A4A-47DB-B3BB-525BBC0BC8DB}");
AZ_CLASS_ALLOCATOR(IAnimSequence, AZ::SystemAllocator, 0);
static const int kSequenceVersion = 4;
static const int kSequenceVersion = 5;
static void Reflect(AZ::ReflectContext* context)
{
if (auto serializeContext = azrtti_cast<AZ::SerializeContext*>(context))
{
serializeContext->Class<IAnimSequence>();
}
}
//! Flags used for SetFlags(),GetFlags(),SetParentFlags(),GetParentFlags() methods.
enum EAnimSequenceFlags
-9
View File
@@ -1673,15 +1673,6 @@ struct IRenderer
//Pass false to get a frameID that increments by one each frame. For this case the increment happens in the game thread at the beginning of the frame.
virtual int GetFrameID(bool bIncludeRecursiveCalls = true) = 0;
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// Returns a frame ID that is sequential for the active camera. This is
// useful for camera-specific temporal data like motion vectors.
virtual int GetCameraFrameID() const = 0;
// Returns true when rendering the scene to a texture
virtual bool IsRenderToTextureActive() const { return false; };
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
virtual void MakeMatrix(const Vec3& pos, const Vec3& angles, const Vec3& scale, Matrix34* mat) = 0;
// Description:
@@ -196,7 +196,6 @@ void IResourceCompilerHelper::GetOutputFilename(const char* szFilePath, char* bu
IResourceCompilerHelper::ERcCallResult IResourceCompilerHelper::InvokeResourceCompiler(const char* szSrcFilePath, const char* szDstFilePath, const bool bUserDialog)
{
ERcExitCode eRet = eRcExitCode_Pending;
const char* szDstFileName = RCPathUtil::GetFile(szDstFilePath);
std::string pathOnly = RCPathUtil::GetPath(szDstFilePath);
-14
View File
@@ -1521,11 +1521,6 @@ struct STexSamplerRT
bool m_bGlobal;
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
// CRC of texture name if this is an engine texture
uint32_t m_nCrc;
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
STexSamplerRT()
{
m_nTexState = -1;
@@ -1537,9 +1532,6 @@ struct STexSamplerRT
m_nSamplerSlot = -1;
m_nTextureSlot = -1;
m_bGlobal = false;
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
m_nCrc = 0;
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
}
~STexSamplerRT()
{
@@ -1590,9 +1582,6 @@ struct STexSamplerRT
m_nSamplerSlot = src.m_nSamplerSlot;
m_nTextureSlot = src.m_nTextureSlot;
m_bGlobal = src.m_bGlobal;
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
m_nCrc = src.m_nCrc;
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
}
NO_INLINE STexSamplerRT& operator = (const STexSamplerRT& src)
{
@@ -1615,9 +1604,6 @@ struct STexSamplerRT
m_nSamplerSlot = -1;
m_nTextureSlot = -1;
m_bGlobal = (src.m_nTexFlags & FT_FROMIMAGE) != 0;
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
m_nCrc = 0;
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
}
inline bool operator != (const STexSamplerRT& m) const
{
+1 -1
View File
@@ -1470,7 +1470,7 @@ struct ISystem
virtual int GetApplicationInstance() = 0;
// Summary:
// Get log index of the currently running lumberyard application. (0 = first instance, 1 = second instance, etc)
// Get log index of the currently running Open 3D Engine application. (0 = first instance, 1 = second instance, etc)
virtual int GetApplicationLogInstance(const char* logFilePath) = 0;
// Summary:
@@ -83,4 +83,4 @@ void LocalizationManagerRequests::LocalizeAndSubstitute(const AZStd::string& loc
outLocalizedString = locString;
LocalizationManagerRequestBus::Broadcast(&LocalizationManagerRequestBus::Events::LocalizeAndSubstituteInternal, outLocalizedString, keys, values);
}
}
@@ -96,4 +96,4 @@ public: // member functions
virtual void OnCheckboxStateChange([[maybe_unused]] bool checked) {}
};
typedef AZ::EBus<UiCheckboxNotifications> UiCheckboxNotificationBus;
typedef AZ::EBus<UiCheckboxNotifications> UiCheckboxNotificationBus;
@@ -124,4 +124,4 @@ public: // member functions
virtual void OnDropdownValueChanged([[maybe_unused]] AZ::EntityId option) {}
};
typedef AZ::EBus<UiDropdownNotifications> UiDropdownNotificationBus;
typedef AZ::EBus<UiDropdownNotifications> UiDropdownNotificationBus;
@@ -63,4 +63,4 @@ public: // member functions
virtual void OnDropdownOptionSelected() {}
};
typedef AZ::EBus<UiDropdownOptionNotifications> UiDropdownOptionNotificationBus;
typedef AZ::EBus<UiDropdownOptionNotifications> UiDropdownOptionNotificationBus;
@@ -83,4 +83,4 @@ public: // member functions
virtual void OnRadioButtonStateChange([[maybe_unused]] bool checked) {}
};
typedef AZ::EBus<UiRadioButtonNotifications> UiRadioButtonNotificationBus;
typedef AZ::EBus<UiRadioButtonNotifications> UiRadioButtonNotificationBus;
@@ -38,4 +38,4 @@ public: // static member data
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
};
typedef AZ::EBus<UiRadioButtonCommunicationInterface> UiRadioButtonCommunicationBus;
typedef AZ::EBus<UiRadioButtonCommunicationInterface> UiRadioButtonCommunicationBus;
@@ -75,4 +75,4 @@ public: // member functions
virtual void OnRadioButtonGroupStateChange([[maybe_unused]] AZ::EntityId checkedRadioButton) {}
};
typedef AZ::EBus<UiRadioButtonGroupNotifications> UiRadioButtonGroupNotificationBus;
typedef AZ::EBus<UiRadioButtonGroupNotifications> UiRadioButtonGroupNotificationBus;
@@ -44,4 +44,4 @@ public: // static member data
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
};
typedef AZ::EBus<UiRadioButtonGroupCommunicationInterface> UiRadioButtonGroupCommunicationBus;
typedef AZ::EBus<UiRadioButtonGroupCommunicationInterface> UiRadioButtonGroupCommunicationBus;
@@ -107,4 +107,4 @@ public: // member functions
virtual void OnSliderValueChanged([[maybe_unused]] float value) {}
};
typedef AZ::EBus<UiSliderNotifications> UiSliderNotificationBus;
typedef AZ::EBus<UiSliderNotifications> UiSliderNotificationBus;
+1 -352
View File
@@ -11,7 +11,7 @@
*/
#pragma once
#include <LyShine/ILyShine.h>
#include <IRenderer.h>
#include <AzCore/Math/Vector2.h>
#include <AzCore/Math/Vector3.h>
#include <AzCore/Math/Color.h>
@@ -115,355 +115,4 @@ public: // member functions
//! Implement virtual destructor just for safety.
virtual ~IDraw2d() {}
//! Start a section of 2D drawing function calls. This will set appropriate render state.
//
//! \param deferCalls If true then actual render calls are deferred until the end of the frame
virtual void BeginDraw2d(bool deferCalls = false) = 0;
//! Start a section of 2D drawing function calls. This will set appropriate render state.
//! This variant allows the viewport size to be specified
//
//! \param viewportSize The size of the viewport being rendered to
//! \param deferCalls If true then actual render calls are deferred until the end of the frame
virtual void BeginDraw2d(AZ::Vector2 viewportSize, bool deferCalls = false) = 0;
//! End a section of 2D drawing function calls. This will reset some render state.
virtual void EndDraw2d() = 0;
//! Draw a textured quad with the top left corner at the given position.
//
//! The image is drawn with the color specified by SetShapeColor and the opacity
//! passed as an argument.
//! If rotation is non-zero then the quad is rotated. If the pivot point is
//! provided then the points of the quad are rotated about that point, otherwise
//! they are rotated about the top left corner of the quad.
//! \param texId The texture ID returned by ITexture::GetTextureID()
//! \param position Position of the top left corner of the quad (before rotation) in pixels
//! \param size The width and height of the quad. Use texture width and height to avoid minification,
//! magnification or stretching (assuming the minMaxTexCoords are left to the default)
//! \param opacity The alpha value used when blending
//! \param rotation Angle of rotation in degrees counter-clockwise
//! \param pivotPoint The point about which the quad is rotated
//! \param minMaxTexCoords An optional two component array. The first component is the UV coord for the top left
//! point of the quad and the second is the UV coord of the bottom right point of the quad
//! \param imageOptions Optional struct specifying options that tend to be the same from call to call
virtual void DrawImage(int texId, AZ::Vector2 position, AZ::Vector2 size, float opacity = 1.0f,
float rotation = 0.0f, const AZ::Vector2* pivotPoint = nullptr, const AZ::Vector2* minMaxTexCoords = nullptr,
ImageOptions* imageOptions = nullptr) = 0;
//! Draw a textured quad where the position specifies the point specified by the alignment.
//
//! Rotation is always around the position.
//! \param texId The texture ID returned by ITexture::GetTextureID()
//! \param position Position align point of the quad (before rotation) in pixels
//! \param size The width and height of the quad. Use texture width and height to avoid minification,
//! magnification or stretching (assuming the minMaxTexCoords are left to the default)
//! \param horizontalAlignment Specifies how the quad is horizontally aligned to the given position
//! \param verticalAlignment Specifies how the quad is vertically aligned to the given position
//! \param opacity The alpha value used when blending
//! \param rotation Angle of rotation in degrees counter-clockwise
//! \param minMaxTexCoords An optional two component array. The first component is the UV coord for the top left
//! point of the quad and the second is the UV coord of the bottom right point of the quad
//! \param imageOptions Optional struct specifying options that tend to be the same from call to call
virtual void DrawImageAligned(int texId, AZ::Vector2 position, AZ::Vector2 size,
HAlign horizontalAlignment, VAlign verticalAlignment,
float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* minMaxTexCoords = nullptr,
ImageOptions* imageOptions = nullptr) = 0;
//! Draw a textured quad where the position, color and uv of each point is specified explicitly
//
//! \param texId The texture ID returned by ITexture::GetTextureID()
//! \param verts An array of 4 vertices, in clockwise order (e.g. top left, top right, bottom right, bottom left)
//! \param blendMode UseDefault means default blend mode (currently GS_BLSRC_SRCALPHA | GS_BLDST_ONEMINUSSRCALPHA)
//! \param pixelRounding Whether and how to round pixel coordinates
//! \param baseState Additional render state to pass to or into value passed to renderer SetState
virtual void DrawQuad(int texId, VertexPosColUV* verts,
int blendMode = UseDefault,
Rounding pixelRounding = Rounding::Nearest,
int baseState = UseDefault) = 0;
//! Draw a line
//
//! \param start The start position
//! \param end The end position
//! \param color The color of the line
//! \param blendMode UseDefault means default blend mode (currently GS_BLSRC_SRCALPHA | GS_BLDST_ONEMINUSSRCALPHA)
//! \param pixelRounding Whether and how to round pixel coordinates
//! \param baseState Additional render state to pass to or into value passed to renderer SetState
virtual void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color,
int blendMode = UseDefault,
IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest,
int baseState = UseDefault) = 0;
//! Draw a line with a texture so it can be dotted or dashed
//
//! \param texId The texture ID returned by ITexture::GetTextureID()
//! \param verts An array of 2 vertices for the start and end points of the line
//! \param blendMode UseDefault means default blend mode (currently GS_BLSRC_SRCALPHA | GS_BLDST_ONEMINUSSRCALPHA)
//! \param pixelRounding Whether and how to round pixel coordinates
//! \param baseState Additional render state to pass to or into value passed to renderer SetState
virtual void DrawLineTextured(int texId, VertexPosColUV* verts,
int blendMode = UseDefault,
IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest,
int baseState = UseDefault) = 0;
//! Draw a text string. Only supports ASCII text.
//
//! The font and effect used to render the text are specified in the textOptions structure
//! \param textString A null terminated ASCII text string. May contain \n characters
//! \param position Position of the text in pixels. Alignment values in textOptions affect actual position
//! \param pointSize The size of the font to use
//! \param opacity The opacity (alpha value) to use to draw the text
//! \param textOptions Pointer to an options struct. If null the default options are used
virtual void DrawText(const char* textString, AZ::Vector2 position, float pointSize,
float opacity = 1.0f, TextOptions* textOptions = nullptr) = 0;
//! Get the width and height (in pixels) that would be used to draw the given text string.
//
//! Pass the same parameter values that would be used to draw the string
virtual AZ::Vector2 GetTextSize(const char* textString, float pointSize, TextOptions* textOptions = nullptr) = 0;
//! Get the width of the rendering viewport (in pixels).
//
//! If rendering full screen this is the native width from IRenderer
virtual float GetViewportWidth() const = 0;
//! Get the height of the rendering viewport (in pixels).
//
//! If rendering full screen this is the native width from IRenderer
virtual float GetViewportHeight() const = 0;
//! Get the default values that would be used if no image options were passed in
//
//! This is a convenient way to initialize the imageOptions struct
virtual const ImageOptions& GetDefaultImageOptions() const = 0;
//! Get the default values that would be used if no text options were passed in
//
//! This is a convenient way to initialize the textOptions struct
virtual const TextOptions& GetDefaultTextOptions() const = 0;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
//! Helper class for using the IDraw2d interface
//!
//! The Draw2dHelper class is an inline wrapper that provides two convenience features:
//! 1. It automatically calls BeginDraw2d/EndDraw2d in its construction/destruction.
//! 2. It automatically sets member options structures to their defaults and provides set functions
//! to set them.
class Draw2dHelper
{
public: // member functions
//! Start a section of 2D drawing function calls. This will set appropriate render state.
Draw2dHelper(bool deferCalls = false)
: m_draw2d(GetDraw2d())
{
if (m_draw2d)
{
m_draw2d->BeginDraw2d(deferCalls);
m_imageOptions = m_draw2d->GetDefaultImageOptions();
m_textOptions = m_draw2d->GetDefaultTextOptions();
}
}
//! End a section of 2D drawing function calls. This will reset some render state.
~Draw2dHelper()
{
if (m_draw2d)
{
m_draw2d->EndDraw2d();
}
}
//! Draw a textured quad, optional rotation is counter-clockwise in degrees.
//
//! See IDraw2d:DrawImage for parameter descriptions
void DrawImage(int texId, AZ::Vector2 position, AZ::Vector2 size, float opacity = 1.0f,
float rotation = 0.0f, const AZ::Vector2* pivotPoint = nullptr, const AZ::Vector2* minMaxTexCoords = nullptr)
{
if (m_draw2d)
{
m_draw2d->DrawImage(texId, position, size, opacity, rotation, pivotPoint, minMaxTexCoords, &m_imageOptions);
}
}
//! Draw a textured quad where the position specifies the point specified by the alignment.
//
//! See IDraw2d:DrawImageAligned for parameter descriptions
void DrawImageAligned(int texId, AZ::Vector2 position, AZ::Vector2 size,
IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment,
float opacity = 1.0f, float rotation = 0.0f, const AZ::Vector2* minMaxTexCoords = nullptr)
{
if (m_draw2d)
{
m_draw2d->DrawImageAligned(texId, position, size, horizontalAlignment, verticalAlignment,
opacity, rotation, minMaxTexCoords, &m_imageOptions);
}
}
//! Draw a textured quad where the position, color and uv of each point is specified explicitly
//
//! See IDraw2d:DrawQuad for parameter descriptions
void DrawQuad(int texId, IDraw2d::VertexPosColUV* verts, int blendMode = IDraw2d::UseDefault,
IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest,
int baseState = IDraw2d::UseDefault)
{
if (m_draw2d)
{
m_draw2d->DrawQuad(texId, verts, blendMode, pixelRounding, baseState);
}
}
//! Draw a line
//
//! See IDraw2d:DrawLine for parameter descriptions
void DrawLine(AZ::Vector2 start, AZ::Vector2 end, AZ::Color color, int blendMode = IDraw2d::UseDefault,
IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest,
int baseState = IDraw2d::UseDefault)
{
if (m_draw2d)
{
m_draw2d->DrawLine(start, end, color, blendMode, pixelRounding, baseState);
}
}
//! Draw a line with a texture so it can be dotted or dashed
//
//! See IDraw2d:DrawLineTextured for parameter descriptions
void DrawLineTextured(int texId, IDraw2d::VertexPosColUV* verts, int blendMode = IDraw2d::UseDefault,
IDraw2d::Rounding pixelRounding = IDraw2d::Rounding::Nearest,
int baseState = IDraw2d::UseDefault)
{
if (m_draw2d)
{
m_draw2d->DrawLineTextured(texId, verts, blendMode, pixelRounding, baseState);
}
}
//! Draw a text string. Only supports ASCII text.
//
//! See IDraw2d:DrawText for parameter descriptions
void DrawText(const char* textString, AZ::Vector2 position, float pointSize, float opacity = 1.0f)
{
if (m_draw2d)
{
m_draw2d->DrawText(textString, position, pointSize, opacity, &m_textOptions);
}
}
//! Get the width and height (in pixels) that would be used to draw the given text string.
//
//! See IDraw2d:GetTextSize for parameter descriptions
AZ::Vector2 GetTextSize(const char* textString, float pointSize)
{
if (m_draw2d)
{
return m_draw2d->GetTextSize(textString, pointSize, &m_textOptions);
}
else
{
return AZ::Vector2(0, 0);
}
}
// State management
//! Set the blend mode used for images, default is GS_BLSRC_SRCALPHA|GS_BLDST_ONEMINUSSRCALPHA.
void SetImageBlendMode(int mode) { m_imageOptions.blendMode = mode; }
//! Set the color used for DrawImage and other image drawing.
void SetImageColor(AZ::Vector3 color) { m_imageOptions.color = color; }
//! Set whether images are rounded to have the points on exact pixel boundaries.
void SetImagePixelRounding(IDraw2d::Rounding round) { m_imageOptions.pixelRounding = round; }
//! Set the base state (that blend mode etc is combined with) used for images, default is GS_NODEPTHTEST.
void SetImageBaseState(int state) { m_imageOptions.baseState = state; }
//! Set the text font.
void SetTextFont(IFFont* font) { m_textOptions.font = font; }
//! Set the text font effect index.
void SetTextEffectIndex(unsigned int effectIndex) { m_textOptions.effectIndex = effectIndex; }
//! Set the text color.
void SetTextColor(AZ::Vector3 color) { m_textOptions.color = color; }
//! Set the text alignment.
void SetTextAlignment(IDraw2d::HAlign horizontalAlignment, IDraw2d::VAlign verticalAlignment)
{
m_textOptions.horizontalAlignment = horizontalAlignment;
m_textOptions.verticalAlignment = verticalAlignment;
}
//! Set a drop shadow for text drawing. An alpha of zero disables drop shadow.
void SetTextDropShadow(AZ::Vector2 offset, AZ::Color color)
{
m_textOptions.dropShadowOffset = offset;
m_textOptions.dropShadowColor = color;
}
//! Set a rotation for the text. The text rotates around its position (taking into account alignment).
void SetTextRotation(float rotation)
{
m_textOptions.rotation = rotation;
}
//! Set the base state (that blend mode etc is combined with) used for text, default is GS_NODEPTHTEST.
void SetTextBaseState(int state) { m_textOptions.baseState = state; }
public: // static member functions
//! Helper to get the IDraw2d interface
static IDraw2d* GetDraw2d() { return (gEnv && gEnv->pLyShine) ? gEnv->pLyShine->GetDraw2d() : nullptr; }
//! Get the width of the rendering viewport (in pixels).
static float GetViewportWidth()
{
IDraw2d* draw2d = GetDraw2d();
return (draw2d) ? draw2d->GetViewportWidth() : 0.0f;
}
//! Get the height of the rendering viewport (in pixels).
static float GetViewportHeight()
{
IDraw2d* draw2d = GetDraw2d();
return (draw2d) ? draw2d->GetViewportHeight() : 0.0f;
}
//! Round the X and Y coordinates of a point using the given rounding policy
template<typename T>
static T RoundXY(T value, IDraw2d::Rounding roundingType)
{
T result = value;
switch (roundingType)
{
case IDraw2d::Rounding::None:
// nothing to do
break;
case IDraw2d::Rounding::Nearest:
result.SetX(floor(value.GetX() + 0.5f));
result.SetY(floor(value.GetY() + 0.5f));
break;
case IDraw2d::Rounding::Down:
result.SetX(floor(value.GetX()));
result.SetY(floor(value.GetY()));
break;
case IDraw2d::Rounding::Up:
result.SetX(ceil(value.GetX()));
result.SetY(ceil(value.GetY()));
break;
}
return result;
}
protected: // attributes
IDraw2d::ImageOptions m_imageOptions; //!< image options are stored locally and updated by member functions
IDraw2d::TextOptions m_textOptions; //!< text options are stored locally and updated by member functions
IDraw2d* m_draw2d;
};
@@ -1,79 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
#include <LyShine/IDraw2d.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
//! Interface used by UI components to render to the canvas
//
//! The IUiRenderer provides helper functions for UI rendering and also manages state that
//! persists between UI elements when rendering a UI canvas.
//! For example one UI component can turn on stencil test and that affects all UI rendering
//! until it is turned off.
//!
//! This is a singleton class that is accessed via IUiRenderer::Get() which is a shortcut for
//! gEnv->pLyShine()->GetUiRenderer();
class IUiRenderer
{
public: // types
public: // member functions
//! Implement virtual destructor for safety.
virtual ~IUiRenderer() {}
//! Start the rendering of a UI canvas
virtual void BeginCanvasRender(AZ::Vector2 viewportSize) = 0;
//! End the rendering of a UI canvas
virtual void EndCanvasRender() = 0;
//! Get the current base state
virtual int GetBaseState() = 0;
//! Set the base state
virtual void SetBaseState(int state) = 0;
//! Get the current stencil test reference value
virtual uint32 GetStencilRef() = 0;
//! Set the stencil test reference value
virtual void SetStencilRef(uint32) = 0;
//! Increment the current stencil reference value
virtual void IncrementStencilRef() = 0;
//! Decrement the current stencil reference value
virtual void DecrementStencilRef() = 0;
//! Get flag that indicates we are rendering into a mask. Used to avoid masks on child mask elements.
virtual bool IsRenderingToMask() = 0;
//! Set flag that we are rendering into a mask. Used to avoid masks on child mask elements.
virtual void SetIsRenderingToMask(bool isRenderingToMask) = 0;
//! Push an alpha fade, this is multiplied with any existing alpha fade from parents
virtual void PushAlphaFade(float alphaFadeValue) = 0;
//! Pop an alpha fade off the stack
virtual void PopAlphaFade() = 0;
//! Get the current alpha fade value
virtual float GetAlphaFade() const = 0;
public: // static member functions
//! Helper function to get the singleton UiRenderer
static IUiRenderer* Get() { return gEnv->pLyShine->GetUiRenderer(); }
};
@@ -20,6 +20,7 @@
#include <AzCore/Component/Entity.h>
#include <LyShine/UiAssetTypes.h>
#include <LyShine/UiBase.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -57,4 +57,4 @@ namespace Maestro
// defined in the bus header so we can refer to it in the Editor code
#define EditorSequenceComponentTypeId "{C02DC0E2-D0F3-488B-B9EE-98E28077EC56}"
} // namespace Maestro
} // namespace Maestro
@@ -97,4 +97,4 @@ namespace AZStd
return retVal;
}
};
}
}
@@ -52,4 +52,4 @@ enum class AnimNodeType
Num
};
#endif // CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMNODETYPE_H
#endif // CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMNODETYPE_H
@@ -42,4 +42,4 @@ enum class AnimValue
};
#endif CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMVALUE_H
#endif CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMVALUE_H
@@ -45,4 +45,4 @@ enum class AnimValueType
};
#endif // CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMVALUETYPE_H
#endif // CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_ANIMVALUETYPE_H
@@ -35,4 +35,4 @@ struct IAssetBlendKey
};
AZ_TYPE_INFO_SPECIALIZE(IAssetBlendKey, "{15B82C3A-6DB8-466F-AF7F-18298FCD25FD}");
}
}
@@ -77,4 +77,4 @@ namespace Maestro
}
};
} // namespace Maestro
} // namespace Maestro
@@ -25,4 +25,4 @@ enum class SequenceType
SequenceComponent = 1 // Sequence Component on an AZ::Entity
};
#endif // CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_SEQUENCETYPE_H
#endif // CRYINCLUDE_CRYCOMMON_MAESTRO_TYPES_SEQUENCETYPE_H
+1 -1
View File
@@ -110,4 +110,4 @@ private:
CTimeValue m_frameStartTime;
float m_frameTime;
float m_frameRate;
};
};
-1
View File
@@ -198,7 +198,6 @@ Spin:
}
# else
// NOTE: The code below will fail on 64bit architectures!
uint loops = 0;
while (_InterlockedCompareExchange((volatile LONG*)pLock, setVal, checkVal) != checkVal)
{
_mm_pause();
@@ -34,7 +34,7 @@ namespace PakLoadDataUtils
{
while (nDataSize & 3)
{
size_t nRes = GetISystem()->GetIPak()->FSeek(fileHandle, 1, SEEK_CUR);
[[maybe_unused]] size_t nRes = GetISystem()->GetIPak()->FSeek(fileHandle, 1, SEEK_CUR);
AZ_Assert(nRes == 0, "FSeek failed for 1 byte");
AZ_Assert(nDataSize, "nDataSize reached zero" );
nDataSize--;
@@ -12,4 +12,4 @@
set(FILES
../../EngineSettingsBackendApple.cpp
../../EngineSettingsBackendApple.h
)
)
@@ -12,4 +12,4 @@
set(FILES
../../EngineSettingsBackendWin32.cpp
../../EngineSettingsBackendWin32.h
)
)
@@ -10,4 +10,4 @@
#
set(FILES
)
)
-90
View File
@@ -1,90 +0,0 @@
/*
* All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
* its licensors.
*
* For complete copyright and license terms please see the LICENSE at the root of this
* distribution (the "License"). All use of this software is governed by the License,
* or, if provided, by the license below or the license accompanying this file. Do not
* remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*
*/
#pragma once
// AZ_RENDER_TO_TEXTURE_GEM_ENABLED is defined by the RenderToTexture Gem
#if !defined(AZ_RENDER_TO_TEXTURE_GEM_ENABLED)
#define AZ_RENDER_TO_TEXTURE_GEM_ENABLED (0)
#endif
#if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
#include <RenderContextConfig.h>
#include <AzCore/EBus/EBus.h>
class CCamera;
namespace AzRTT
{
class RTTBus
: public AZ::EBusTraits
{
public:
static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single;
static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::Single;
virtual ~RTTBus() = default;
/**
* Creates an instance of an RenderContext.
* @return Shared pointer to the created IRenderContext.
* @param config The RenderContextConfig settings to apply.
*/
virtual RenderContextId CreateContext(const RenderContextConfig& config) = 0;
/**
* Returns true if the IRenderContext exists and is valid.
* @return True if context exists and is valid.
* @param contextId the RenderContextId to check for validity
*/
virtual bool ContextIsValid(RenderContextId contextId) const = 0;
/**
* Destroys an RenderContext instance.
* @param contextId The RenderContextId for an existing context to destroy
*/
virtual void DestroyContext(RenderContextId contextId) = 0;
/**
* Gets the configuration for a context instance.
* @param contextId the RenderContextId for an existing context.
*/
virtual RenderContextConfig GetContextConfig(RenderContextId contextId) const = 0;
/**
* Sets the active IRenderContext. This will deactivate any existing context.
* @return True if context was activated, false if not activated.
* @param contextId the RenderContextId for an existing context to activate
*/
virtual bool SetActiveContext(RenderContextId contextId) = 0;
/**
* Sets the configuration for a context instance.
* @param contextId the RenderContextId for an existing context.
* @param config the RenderContextConfig settings to apply.
*/
virtual void SetContextConfig(RenderContextId contextId, const RenderContextConfig& config) = 0;
/**
* Render the world from the provided camera to a render target using the provided render context.
* @param renderTargetTextureHandle Texture handle of target to render to.
* @param camera The camera to use for rendering.
* @param contextId The RenderContextId to use.
*/
virtual void RenderWorld(int renderTargetTextureHandle, const CCamera& camera, RenderContextId contextId) = 0;
};
using RTTRequestBus = AZ::EBus<RTTBus>;
}
#endif // if AZ_RENDER_TO_TEXTURE_GEM_ENABLED
+1 -1
View File
@@ -120,4 +120,4 @@ namespace AZ
};
using RenderScreenshotNotificationBus = AZ::EBus<RenderScreenshotNotifications>;
}
}
@@ -83,4 +83,4 @@ namespace AzRTT
//! confirm if user wants to use texture size larger than MaxRecommendedRenderTargetSize
bool ValidateTextureSize(void* newValue, const AZ::Uuid& valueType);
};
}
}
@@ -64,4 +64,4 @@ namespace Serialization
using Serialization::ForceFeedbackIdName;
}
}
#endif // CRYINCLUDE_CRYCOMMON_SERIALIZATION_DECORATORS_RESOURCES_H
#endif // CRYINCLUDE_CRYCOMMON_SERIALIZATION_DECORATORS_RESOURCES_H
@@ -24,4 +24,4 @@ namespace Serialization
};
}
#endif
#endif
+1 -1
View File
@@ -44,4 +44,4 @@ namespace AZ
};
using StereoRendererRequestBus = EBus < StereoRendererBus >;
}
}
+1 -1
View File
@@ -85,4 +85,4 @@ public:
PodArray<T*> m_lstUsed;
T* m_pPool;
int m_nPoolSize;
};
};
+1 -1
View File
@@ -112,7 +112,7 @@ public:
void Free()
{
m_nCount = 0;
if (m_nAllocatedCount)
if (m_nAllocatedCount && AZ::AllocatorInstance<CryLegacySTLAllocator>::IsReady())
{
AZ::AllocatorInstance<CryLegacySTLAllocator>::Get().DeAllocate(m_pElements);
}

Some files were not shown because too many files have changed in this diff Show More