Browse Source

game/client/portal: fix Polyhedron

dedicated-build-fix
nillerusr 2 years ago
parent
commit
7268663f24
  1. 14
      game/client/portal/portalrenderable_flatbasic.cpp
  2. 4
      game/shared/portal/StaticCollisionPolyhedronCache.cpp

14
game/client/portal/portalrenderable_flatbasic.cpp

@ -373,18 +373,22 @@ bool CPortalRenderable_FlatBasic::CalcFrustumThroughPortal( const Vector &ptCurr @@ -373,18 +373,22 @@ bool CPortalRenderable_FlatBasic::CalcFrustumThroughPortal( const Vector &ptCurr
if( i2 < i3 )
{
VPlane *v2 = &Planes[iMinSideFirstPoint];
memcpy( v2, v2 + 1, sizeof( VPlane ) * (iVertCount - iMinSideFirstPoint) );
for( int i = 0; i < (iVertCount - iMinSideFirstPoint); i++ )
v2[i] = v2[i+1];
}
if( i3 < i4 ) //not the last point in the array
{
int iElementShift = (iOldVertCount - i4);
float *l3 = &fLineLengthSqr[i3];
//eliminate p3, we merged p2+p3 and already stored the result in p2
memcpy( p3, p3 + 1, sizeof( Vector ) * iElementShift );
float *l3 = &fLineLengthSqr[i3];
memcpy( l3, l3 + 1, sizeof( float ) * iElementShift );
for( int i = 0; i < iElementShift; i++ )
{
p3[i] = p3[i+1];
l3[i] = l3[i+1];
}
}
}

4
game/shared/portal/StaticCollisionPolyhedronCache.cpp

@ -265,7 +265,7 @@ void CStaticCollisionPolyhedronCache::Update( void ) @@ -265,7 +265,7 @@ void CStaticCollisionPolyhedronCache::Update( void )
m_BrushPolyhedrons[i] = pDest;
pFinalDest += memRequired;
int memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource);
intp memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource);
memcpy( pDest, pSource, memRequired );
//move all the pointers to their new location.
@ -425,7 +425,7 @@ void CStaticCollisionPolyhedronCache::Update( void ) @@ -425,7 +425,7 @@ void CStaticCollisionPolyhedronCache::Update( void )
m_StaticPropPolyhedrons[i] = pDest;
pFinalDest += memRequired;
int memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource);
intp memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource);
memcpy( pDest, pSource, memRequired );
//move all the pointers to their new location.

Loading…
Cancel
Save