diff --git a/qbsp/map.c b/qbsp/map.c index 91982d17..15828549 100644 --- a/qbsp/map.c +++ b/qbsp/map.c @@ -550,8 +550,7 @@ SetKeyValue(int iEntity, char *key, char *value) for (ep = map.rgEntities[iEntity].epairs; ep; ep = ep->next) if (!strcmp(ep->key, key)) { - delete ep->value; - + free(ep->value); /* FIXME */ ep->value = copystring(value); return; } diff --git a/qbsp/solidbsp.c b/qbsp/solidbsp.c index 4bd5de9b..514b8cea 100644 --- a/qbsp/solidbsp.c +++ b/qbsp/solidbsp.c @@ -18,7 +18,8 @@ See file, 'COPYING', for details. */ -// solidbsp.c + +#include #include "qbsp.h" @@ -492,7 +493,7 @@ LinkConvexFaces(surface_t *planelist, node_t *leafnode) // write the list of faces, and free the originals leaffaces += count; - leafnode->markfaces = (face_t **)new char[sizeof(face_t *) * (count + 1)]; + leafnode->markfaces = (face_t **)malloc(sizeof(face_t *) * (count + 1)); /* FIXME */ i = 0; for (surf = planelist; surf; surf = pnext) { diff --git a/qbsp/util.c b/qbsp/util.c index 338b2eea..0ef60fb3 100644 --- a/qbsp/util.c +++ b/qbsp/util.c @@ -30,7 +30,7 @@ #endif #include -//#include +#include #include "qbsp.h" @@ -68,7 +68,7 @@ AllocMem(int Type, int cElements, bool fZero) cSize = cElements * rgcMemSize[Type]; Retry: - pTemp = (void *)new char[cSize]; + pTemp = malloc(cSize); if (pTemp == NULL) { char ch; @@ -116,13 +116,10 @@ FreeMem void FreeMem(void *pMem, int Type, int cElements) { - char *mem; - rgMemActive[Type] -= cElements; rgMemActive[GLOBAL] -= cElements * rgcMemSize[Type]; - mem = (char *)pMem; - delete [] mem; + free(pMem); }