fix placement new

This commit is contained in:
HappyDOGE 2022-07-28 17:48:29 +03:00
parent 786efaa9e8
commit e2f577b5e2

View File

@ -11,7 +11,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include "tier1/utlvector.h" #include "tier1/utlvector.h"
#ifdef COMPILER_MSVC
#include <new>
#endif
struct GeneratePolyhedronFromPlanes_Point; struct GeneratePolyhedronFromPlanes_Point;
@ -82,7 +84,7 @@ CPolyhedron_AllocByNew *CPolyhedron_AllocByNew::Allocate( unsigned short iVertic
(iIndices * sizeof( Polyhedron_IndexedLineReference_t )) + (iIndices * sizeof( Polyhedron_IndexedLineReference_t )) +
(iPolygons * sizeof( Polyhedron_IndexedPolygon_t ))); (iPolygons * sizeof( Polyhedron_IndexedPolygon_t )));
CPolyhedron_AllocByNew *pAllocated = (CPolyhedron_AllocByNew*)pMemory; CPolyhedron_AllocByNew *pAllocated = new ( pMemory ) CPolyhedron_AllocByNew;
pAllocated->iVertexCount = iVertices; pAllocated->iVertexCount = iVertices;
pAllocated->iLineCount = iLines; pAllocated->iLineCount = iLines;