]> git.mxchange.org Git - flightgear.git/blobdiff - src/Objects/newmat.cxx
Tweaks to PLIB version detection.
[flightgear.git] / src / Objects / newmat.cxx
index f6d3ec53ab6ee4089548e619a017036879c3695e..3f11930726725c5979cc4eabdb507e2e6c0eb9be 100644 (file)
@@ -42,6 +42,7 @@
 FGNewMat::FGNewMat ( void ) {
     wrapu = wrapv = 1;
     mipmap = 1;
+    light_coverage = -1.0;
 }
 
 
@@ -65,6 +66,7 @@ FGNewMat::FGNewMat ( const string &mat_name, const string &tex_name )
     diffuse[0]  = diffuse[1]  = diffuse[2]  = diffuse[3]  = 1.0;
     specular[0] = specular[1] = specular[2] = specular[3] = 1.0;
     emission[0] = emission[1] = emission[2] = emission[3] = 1.0;
+    light_coverage = -1.0;
 }
 
 
@@ -75,6 +77,7 @@ void FGNewMat::build_ssg_state( const string& path,
     tex_file.append( texture_name );
 
     state = new ssgStateSelector(2);
+    state->ref();
 
     textured = new ssgSimpleState();
     textured->ref();
@@ -84,6 +87,7 @@ void FGNewMat::build_ssg_state( const string& path,
 
     // Set up the textured state
     textured->setShadeModel( shade_model );
+    textured->enable( GL_LIGHTING );
     textured->enable ( GL_CULL_FACE ) ;
     textured->enable( GL_TEXTURE_2D );
     textured->disable( GL_BLEND );
@@ -133,6 +137,8 @@ void FGNewMat::build_ssg_state( const string& path,
 
 void FGNewMat::set_ssg_state( ssgSimpleState *s ) {
     state = new ssgStateSelector(2);
+    state->ref();
+
     textured = s;
 
     nontextured = new ssgSimpleState();
@@ -233,6 +239,8 @@ operator >> ( istream& in, FGNewMat& m )
            } else {
                FG_LOG( FG_TERRAIN, FG_INFO, "Bad alpha value " << token );
            }
+       } else if ( token == "light-coverage" ) {
+           in >> token >> m.light_coverage;
        } else if ( token[0] == '}' ) {
            break;
        }