misaligment fixes

This commit is contained in:
nillerusr
2022-05-15 21:09:59 +03:00
parent 1218fa659c
commit 3a73624b7e
39 changed files with 7592 additions and 6056 deletions

View File

@@ -1268,7 +1268,9 @@ void CEdgeList::CullSmallOccluders()
// Sort the surfaces by screen area, in descending order
int nSurfCount = m_Surfaces.Count();
s_pSortSurfaces = m_Surfaces.Base();
qsort( m_SurfaceSort.Base(), nSurfCount, sizeof(int), SurfCompare );
if( m_SurfaceSort.Base() )
qsort( m_SurfaceSort.Base(), nSurfCount, sizeof(int), SurfCompare );
// We're going to keep the greater of r_occludermin + All surfaces with a screen area >= r_occluderarea
int nMinSurfaces = r_occludermincount.GetInt();
@@ -1282,7 +1284,7 @@ void CEdgeList::CullSmallOccluders()
bool *bUseSurface = (bool*)stackalloc( nSurfCount * sizeof(bool) );
memset( bUseSurface, 0, nSurfCount * sizeof(bool) );
int i;
for ( i = 0; i < nSurfCount; ++i )
{

View File

@@ -4099,7 +4099,9 @@ CBrushBatchRender::brushrender_t *CBrushBatchRender::FindOrCreateRenderBatch( mo
surfaceList.Sort( SurfaceCmp );
renderT.pPlanes = new cplane_t *[planeList.Count()];
renderT.planeCount = planeList.Count();
memcpy( renderT.pPlanes, planeList.Base(), sizeof(cplane_t *)*planeList.Count() );
if( planeList.Base() )
memcpy( renderT.pPlanes, planeList.Base(), sizeof(cplane_t *)*planeList.Count() );
renderT.pSurfaces = new brushrendersurface_t[surfaceList.Count()];
renderT.surfaceCount = surfaceList.Count();