[Plib-cvs] plib/src/ssg ssg.h,1.175,1.176 ssgDList.cxx,1.11,1.12 ssgLocal.h,1.25,1.26 ssgTween.cxx,1
Brought to you by:
sjbaker
From: Steve B. <sj...@us...> - 2004-12-29 07:19:56
|
Update of /cvsroot/plib/plib/src/ssg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10737/plib/src/ssg Modified Files: ssg.h ssgDList.cxx ssgLocal.h ssgTween.cxx ssgTweenController.cxx Log Message: Fixed some bugs in tweening. Added functions to dump Z buffer into ssgaScreenDump. Index: ssg.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssg.h,v retrieving revision 1.175 retrieving revision 1.176 diff -u -d -r1.175 -r1.176 --- ssg.h 1 Dec 2004 08:28:05 -0000 1.175 +++ ssg.h 29 Dec 2004 07:19:40 -0000 1.176 @@ -2206,8 +2206,8 @@ void setID ( int i ) { id = i ; } int isOn () { return is_turned_on ; } - void on () { is_turned_on = TRUE ; } - void off () { is_turned_on = FALSE ; } + void on () { is_turned_on = TRUE ; } + void off () { is_turned_on = FALSE ; } void setPosition ( const sgVec3 pos ) { sgCopyVec3 ( position, pos ) ; } void getPosition ( sgVec3 pos ) { sgCopyVec3 ( pos, position ) ; } @@ -2222,7 +2222,6 @@ case GL_SPECULAR : sgCopyVec4 ( specular, col ) ; break ; default : break ; } - setup () ; } void getColour ( GLenum which, sgVec4 col ) @@ -2428,7 +2427,7 @@ ssgSimpleState *getState () { return currentState ; } void cull ( ssgBranch *r ) ; - void getCameraPosition ( sgVec3 pos ) ; + void getCameraPosition ( sgVec3 pos ) ; void setCamera ( sgMat4 mat ) ; void setCamera ( const sgCoord *coord ) ; void setCameraLookAt ( const sgVec3 eye, const sgVec3 center, const sgVec3 up ) ; Index: ssgDList.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgDList.cxx,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ssgDList.cxx 2 Sep 2002 06:05:48 -0000 1.11 +++ ssgDList.cxx 29 Dec 2004 07:19:40 -0000 1.12 @@ -28,6 +28,7 @@ enum _ssgDListType { SSG_DLIST_LEAF, + SSG_DLIST_SET_TWEEN_STATE, SSG_DLIST_LOAD_MATRIX, SSG_DLIST_PUSH_MATRIX, SSG_DLIST_POP_MATRIX, @@ -42,9 +43,18 @@ _ssgDListType type ; sgMat4 mat ; ssgLeaf *leaf ; + float tween_state ; + int tween_mode ; _ssgDList () { setEmpty () ; } + void setTweenState ( float _state, int _mode ) + { + type = SSG_DLIST_SET_TWEEN_STATE ; + tween_state = _state ; + tween_mode = _mode ; + } + void setPopMatrix () { type = SSG_DLIST_POP_MATRIX ; @@ -92,6 +102,10 @@ leaf -> draw () ; break ; + case SSG_DLIST_SET_TWEEN_STATE : + _ssgSetRealCurrentTweenSettings ( tween_state, tween_mode ) ; + break ; + case SSG_DLIST_POP_MATRIX : glPopMatrix () ; break ; @@ -161,6 +175,15 @@ } +void _ssgSetTweenState ( float state, int mode ) +{ + if ( next_dlist >= MAX_DLIST ) + ulSetError ( UL_WARNING, "DList stack overflow!" ) ; + else + dlist [ next_dlist++ ] . setTweenState ( state, mode ) ; +} + + void _ssgPopMatrix () { /* @@ -247,3 +270,4 @@ else dlist [ next_dlist++ ] . setDrawLeaf ( l ) ; } + Index: ssgLocal.h =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgLocal.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- ssgLocal.h 13 Sep 2004 10:48:10 -0000 1.25 +++ ssgLocal.h 29 Dec 2004 07:19:40 -0000 1.26 @@ -41,6 +41,7 @@ void _ssgForceLineState () ; void _ssgDrawDList () ; +void _ssgSetTweenState ( float state, int mode ) ; void _ssgPushMatrix ( sgMat4 m ) ; void _ssgPopMatrix () ; void _ssgLoadMatrix ( sgMat4 m ) ; @@ -116,9 +117,9 @@ int _ssgWriteError ( void ) ; float _ssgGetCurrentTweenState () ; -void _ssgSetCurrentTweenState ( float tweenstate ) ; int _ssgGetCurrentTweenMode () ; -void _ssgSetCurrentTweenMode ( int tweenmode ) ; +void _ssgSetCurrentTweenSettings ( float tweenstate, int tweenmode ) ; +void _ssgSetRealCurrentTweenSettings ( float tweenstate, int tweenmode ) ; /* Routines for storing arbitrary ssgBase derived objects within SSG files. Index: ssgTween.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgTween.cxx,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- ssgTween.cxx 13 Sep 2004 12:02:36 -0000 1.13 +++ ssgTween.cxx 29 Dec 2004 07:19:40 -0000 1.14 @@ -34,8 +34,20 @@ int _ssgGetCurrentTweenMode () { return current_tween_mode ; } float _ssgGetCurrentTweenState () { return current_tween_state ; } -void _ssgSetCurrentTweenMode ( int mode ) { current_tween_mode = mode ; } -void _ssgSetCurrentTweenState ( float tstate ) { current_tween_state= tstate ;} + +void _ssgSetCurrentTweenSettings ( float state, int mode ) +{ + _ssgSetRealCurrentTweenSettings ( state, mode ) ; + _ssgSetTweenState ( state, mode ) ; /* Add it into the Dlist for later */ +} + + +void _ssgSetRealCurrentTweenSettings ( float state, int mode ) +{ + current_tween_mode = mode ; + current_tween_state = state ; +} + void ssgTween::copy_from ( ssgTween *src, int clone_flags ) { Index: ssgTweenController.cxx =================================================================== RCS file: /cvsroot/plib/plib/src/ssg/ssgTweenController.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ssgTweenController.cxx 4 Nov 2002 05:11:22 -0000 1.6 +++ ssgTweenController.cxx 29 Dec 2004 07:19:40 -0000 1.7 @@ -57,16 +57,14 @@ void ssgTweenController::cull ( sgFrustum *f, sgMat4 m, int test_needed ) { - float tmp = _ssgGetCurrentTweenState () ; - int mm = _ssgGetCurrentTweenMode () ; + float old_state = _ssgGetCurrentTweenState () ; + int old_mode = _ssgGetCurrentTweenMode () ; - _ssgSetCurrentTweenState ( curr_bank ) ; - _ssgSetCurrentTweenMode ( mode ) ; + _ssgSetCurrentTweenSettings ( curr_bank, mode ) ; ssgBranch::cull ( f, m, test_needed ) ; - _ssgSetCurrentTweenState ( tmp ) ; - _ssgSetCurrentTweenMode ( mm ) ; + _ssgSetCurrentTweenSettings ( old_state, old_mode ) ; } |