[Plib-cvs] plib/src/ssg ssgLoadMD2.cxx,1.13,1.14 ssgLoadTGA.cxx,1.7,1.8
Brought to you by:
sjbaker
From: Dave M. <mc...@us...> - 2002-07-01 02:51:20
|
Update of /cvsroot/plib/plib/src/ssg In directory usw-pr-cvs1:/tmp/cvs-serv4648/ssg Modified Files: ssgLoadMD2.cxx ssgLoadTGA.cxx Log Message: removed malloc/free Index: ssgLoadMD2.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadMD2.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ssgLoadMD2.cxx 10 Jun 2002 16:34:32 -0000 1.13 +++ ssgLoadMD2.cxx 1 Jul 2002 02:51:15 -0000 1.14 @@ -207,7 +207,7 @@ fseek(loader_fd, offset, SEEK_SET); frames = new t_frame[header.numFrames]; - vertices = (t_vertex **)malloc(header.numFrames * sizeof(t_vertex *)); + vertices = new t_vertex* [header.numFrames]; for(int i=0; i<header.numFrames; i++){ vertices[i] = new t_vertex[header.numVertices]; Index: ssgLoadTGA.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadTGA.cxx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ssgLoadTGA.cxx 7 Nov 2001 23:51:10 -0000 1.7 +++ ssgLoadTGA.cxx 1 Jul 2002 02:51:16 -0000 1.8 @@ -53,14 +53,14 @@ } maxLen = fileinfo.st_size; - pData = (char *) malloc(maxLen); + pData = new char [maxLen]; fread (pData, maxLen, 1, tfile); fclose (tfile); pData[0] = 0x00; if( memcmp( pData, DEF_targaHeaderContent, DEF_targaHeaderLength ) != 0 ) { ulSetError ( UL_WARNING, "ssgLoadTexture: Failed to load '%s'. Not a targa (apparently).", fname); - free (pData); + delete[] pData; return false ; } @@ -79,7 +79,7 @@ if( ( width <= 0 ) || ( height <= 0 ) ) { ulSetError ( UL_WARNING, "ssgLoadTexture: Failed to load '%s'. Width and height < 0.", fname); - free (pData); + delete[] pData; return false ; } @@ -90,7 +90,7 @@ if( !( is24Bit || is32Bit ) ) { ulSetError ( UL_WARNING, "ssgLoadTexture: Failed to load '%s'. Not 24 or 32 bit.", fname); - free (pData); + delete[] pData; return false ; } @@ -122,7 +122,7 @@ texels[ loop + 2 ] = tempC; } - free(pData); + delete[] pData; if ( info != NULL ) { |