[Plib-cvs] plib/src/ssg ssgBranch.cxx,1.25,1.26
Brought to you by:
sjbaker
From: M?rten Str?m. <str...@us...> - 2004-02-16 20:59:33
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31192 Modified Files: ssgBranch.cxx Log Message: Fixed memory leak and some compiler warnings. Index: ssgBranch.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgBranch.cxx,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- ssgBranch.cxx 17 Jan 2004 21:50:25 -0000 1.25 +++ ssgBranch.cxx 16 Feb 2004 20:51:12 -0000 1.26 @@ -411,7 +411,7 @@ { float * pfDest = pDest->getVertex(iDest); #define MYABS(x) ((x>0)?(x):(-(x))) if (MYABS(pfSrc[0]-pfDest[0])+MYABS(pfSrc[1]-pfDest[1])+ - MYABS(pfSrc[2]-pfDest[2]) < 0.0001 /* kludge * /) + MYABS(pfSrc[2]-pfDest[2]) < 0.0001) { bFound = TRUE; aiOld2NewIndex[iSrc] = iDest; } @@ -424,17 +424,14 @@ pDest->normals->add(f); else { - float *f = new sgVec3(); - f[0] = 0; f[1] = 0; f[2]=0; - pDest->normals->add(f); + pDest->normals->add(_ssgNormalUp); } f = pSrc->getTexCoord(iSrc); if (f) pDest->texcoords->add(f); else - { float *f = new sgVec2(); - f[0] = 0; f[1] = 0; - pDest->texcoords->add(f); + { + pDest->texcoords->add(_ssgTexCoord00); } // assert(pSrc->colours->getNum()==0); } @@ -622,7 +619,7 @@ 10 ,1 ,2 ,1 ,2 ,11 ,1 ,12 ,1 ,2 ,13 ,1 ,2 ,14 ,2 ,1 ,1 ,15 ,1 ,16 ,1 ,17 ,2 ,1 ,18 ,1 ,22 ,2 ,25 , 2 ,1 ,30 ,2 ,1 ,2 ,1 ,13 ,2 ,1 ,2 ,1 }; noOfMergedNodes = 0; - for(int i=0; i < sizeof(deltas)/sizeof(int); i++) + for(unsigned i=0; i < sizeof(deltas)/sizeof(int); i++) { recursiveMergeHNodes ( this, deltas[i] ); #ifdef VERBOSE |