[Plib-cvs] plib/src/ssg ssgOptimiser.cxx,1.29,1.30 ssgTween.cxx,1.11,1.12
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2002-12-04 19:12:38
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1:/tmp/cvs-serv21636/plib/src/ssg Modified Files: ssgOptimiser.cxx ssgTween.cxx Log Message: Fixed a crash in the ssgTween destructor function. Fixed a problem in ssgOptimiser that caused it to optimise several ssgBranch derived-types inappropriately. Also prevented optimisation of ssgTween nodes altogether since this tends to have disasterous consequences! Index: ssgOptimiser.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgOptimiser.cxx,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- ssgOptimiser.cxx 3 Oct 2002 03:33:30 -0000 1.29 +++ ssgOptimiser.cxx 4 Dec 2002 19:12:34 -0000 1.30 @@ -474,7 +474,8 @@ build_leaf_list ( k, leaf_list ) ; } } - else if ( ent -> isAKindOf ( ssgTypeLeaf () ) ) + else + if ( ent -> isAKindOf ( ssgTypeLeaf () ) && ! ent -> isAKindOf ( ssgTypeTween() ) ) { ssgLeaf *l = (ssgLeaf *) ent ; @@ -621,27 +622,28 @@ for ( ssgEntity *k = b_ent -> getKid ( 0 ) ; k != NULL ; [...167 lines suppressed...] @@ -1021,11 +1037,12 @@ * ent -- the entity to process * trans -- transform */ + void ssgTransTool ( ssgEntity *ent, const sgMat4 trans ) { if ( ent -> isAKindOf ( ssgTypeLeaf () ) ) { - ((ssgLeaf *) ent) -> transform ( trans ) ; + ((ssgLeaf *) ent) -> transform ( trans ) ; return ; } @@ -1066,3 +1083,5 @@ b_ent -> recalcBSphere () ; } + + Index: ssgTween.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgTween.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ssgTween.cxx 10 Nov 2002 17:12:13 -0000 1.11 +++ ssgTween.cxx 4 Dec 2002 19:12:35 -0000 1.12 @@ -210,6 +210,14 @@ ssgTween::~ssgTween () { + /* Need to ref these one more time to avoid problems when the base class destructor + deletes them */ + + vertices -> ref () ; + normals -> ref () ; + texcoords -> ref () ; + colours -> ref () ; + for ( int i = 0 ; i < getNumBanks () ; i++ ) { ssgDeRefDelete ( (ssgVertexArray *) banked_vertices -> getEntity (i)) ; |