mirror of
https://github.com/nillerusr/source-engine.git
synced 2025-01-12 08:08:06 +00:00
game/client/portal: fix Polyhedron
This commit is contained in:
parent
9c2c7e3529
commit
7268663f24
@ -373,18 +373,22 @@ bool CPortalRenderable_FlatBasic::CalcFrustumThroughPortal( const Vector &ptCurr
|
|||||||
if( i2 < i3 )
|
if( i2 < i3 )
|
||||||
{
|
{
|
||||||
VPlane *v2 = &Planes[iMinSideFirstPoint];
|
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
|
if( i3 < i4 ) //not the last point in the array
|
||||||
{
|
{
|
||||||
int iElementShift = (iOldVertCount - i4);
|
int iElementShift = (iOldVertCount - i4);
|
||||||
|
float *l3 = &fLineLengthSqr[i3];
|
||||||
|
|
||||||
//eliminate p3, we merged p2+p3 and already stored the result in p2
|
//eliminate p3, we merged p2+p3 and already stored the result in p2
|
||||||
memcpy( p3, p3 + 1, sizeof( Vector ) * iElementShift );
|
for( int i = 0; i < iElementShift; i++ )
|
||||||
|
{
|
||||||
float *l3 = &fLineLengthSqr[i3];
|
p3[i] = p3[i+1];
|
||||||
memcpy( l3, l3 + 1, sizeof( float ) * iElementShift );
|
l3[i] = l3[i+1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ void CStaticCollisionPolyhedronCache::Update( void )
|
|||||||
m_BrushPolyhedrons[i] = pDest;
|
m_BrushPolyhedrons[i] = pDest;
|
||||||
pFinalDest += memRequired;
|
pFinalDest += memRequired;
|
||||||
|
|
||||||
int memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource);
|
intp memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource);
|
||||||
|
|
||||||
memcpy( pDest, pSource, memRequired );
|
memcpy( pDest, pSource, memRequired );
|
||||||
//move all the pointers to their new location.
|
//move all the pointers to their new location.
|
||||||
@ -425,7 +425,7 @@ void CStaticCollisionPolyhedronCache::Update( void )
|
|||||||
m_StaticPropPolyhedrons[i] = pDest;
|
m_StaticPropPolyhedrons[i] = pDest;
|
||||||
pFinalDest += memRequired;
|
pFinalDest += memRequired;
|
||||||
|
|
||||||
int memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource);
|
intp memoryOffset = ((uint8 *)pDest) - ((uint8 *)pSource);
|
||||||
|
|
||||||
memcpy( pDest, pSource, memRequired );
|
memcpy( pDest, pSource, memRequired );
|
||||||
//move all the pointers to their new location.
|
//move all the pointers to their new location.
|
||||||
|
Loading…
Reference in New Issue
Block a user