Added ref() count increment calls to all ssgSimpleState creation to prevent
them from being delete by ssg once nothing in the scene graph points to them.
This commit is contained in:
parent
d4194eea12
commit
806511bd99
2 changed files with 9 additions and 0 deletions
|
@ -199,6 +199,7 @@ ssgSimpleState *menus;
|
|||
|
||||
void fgBuildRenderStates( void ) {
|
||||
default_state = new ssgSimpleState;
|
||||
default_state->ref();
|
||||
default_state->disable( GL_TEXTURE_2D );
|
||||
default_state->enable( GL_CULL_FACE );
|
||||
default_state->enable( GL_COLOR_MATERIAL );
|
||||
|
@ -210,12 +211,14 @@ void fgBuildRenderStates( void ) {
|
|||
default_state->disable( GL_LIGHTING );
|
||||
|
||||
hud_and_panel = new ssgSimpleState;
|
||||
hud_and_panel->ref();
|
||||
hud_and_panel->disable( GL_CULL_FACE );
|
||||
hud_and_panel->disable( GL_TEXTURE_2D );
|
||||
hud_and_panel->disable( GL_LIGHTING );
|
||||
hud_and_panel->enable( GL_BLEND );
|
||||
|
||||
menus = new ssgSimpleState;
|
||||
menus->ref();
|
||||
menus->disable( GL_CULL_FACE );
|
||||
menus->disable( GL_TEXTURE_2D );
|
||||
menus->enable( GL_BLEND );
|
||||
|
|
|
@ -75,8 +75,12 @@ void FGNewMat::build_ssg_state( const string& path,
|
|||
tex_file.append( texture_name );
|
||||
|
||||
state = new ssgStateSelector(2);
|
||||
|
||||
textured = new ssgSimpleState();
|
||||
textured->ref();
|
||||
|
||||
nontextured = new ssgSimpleState();
|
||||
nontextured->ref();
|
||||
|
||||
// Set up the textured state
|
||||
textured->setShadeModel( shade_model );
|
||||
|
@ -130,7 +134,9 @@ void FGNewMat::build_ssg_state( const string& path,
|
|||
void FGNewMat::set_ssg_state( ssgSimpleState *s ) {
|
||||
state = new ssgStateSelector(2);
|
||||
textured = s;
|
||||
|
||||
nontextured = new ssgSimpleState();
|
||||
nontextured->ref();
|
||||
|
||||
// Set up the coloured state
|
||||
nontextured->enable( GL_LIGHTING );
|
||||
|
|
Loading…
Reference in a new issue