game(client): fix touch drawing problems

This commit is contained in:
nillerusr
2022-09-18 18:47:19 +03:00
parent a7611c481e
commit 9c4ace30c3
3 changed files with 67 additions and 21 deletions
+5 -6
View File
@@ -15,7 +15,6 @@
#include <new>
#endif
struct GeneratePolyhedronFromPlanes_Point;
struct GeneratePolyhedronFromPlanes_PointLL;
struct GeneratePolyhedronFromPlanes_Line;
@@ -73,18 +72,18 @@ void CreateDumpDirectory( const char *szDirectoryName )
void CPolyhedron_AllocByNew::Release( void )
{
free(this);
delete this;
}
CPolyhedron_AllocByNew *CPolyhedron_AllocByNew::Allocate( unsigned short iVertices, unsigned short iLines, unsigned short iIndices, unsigned short iPolygons ) //creates the polyhedron along with enough memory to hold all it's data in a single allocation
{
void *pMemory = malloc(sizeof( CPolyhedron_AllocByNew ) +
void *pMemory = new unsigned char [ sizeof( CPolyhedron_AllocByNew ) +
(iVertices * sizeof(Vector)) +
(iLines * sizeof(Polyhedron_IndexedLine_t)) +
(iIndices * sizeof( Polyhedron_IndexedLineReference_t )) +
(iPolygons * sizeof( Polyhedron_IndexedPolygon_t )));
(iPolygons * sizeof( Polyhedron_IndexedPolygon_t ))];
#include "tier0/memdbgoff.h"
#include "tier0/memdbgoff.h" //the following placement new doesn't compile with memory debugging
CPolyhedron_AllocByNew *pAllocated = new ( pMemory ) CPolyhedron_AllocByNew;
#include "tier0/memdbgon.h"
@@ -108,7 +107,7 @@ public:
int iReferenceCount;
#endif
void Release( void ) override
virtual void Release( void )
{
#ifdef DBGFLAG_ASSERT
--iReferenceCount;