]> git.mxchange.org Git - flightgear.git/commitdiff
Added some extra debugging infrastructure.
authorcurt <curt>
Wed, 3 Nov 1999 16:18:19 +0000 (16:18 +0000)
committercurt <curt>
Wed, 3 Nov 1999 16:18:19 +0000 (16:18 +0000)
src/Objects/material.cxx
src/Objects/material.hxx
src/Objects/materialmgr.cxx

index a6d9b7c97bb6fad5fd1b5049555f33a81f367a3c..c8caf2c7efe6f08b64dbbe2059b7c6ea6704791a 100644 (file)
@@ -106,6 +106,7 @@ operator >> ( istream& in, FGMaterial& m )
     return in;
 }
 
+
 void
 FGMaterial::load_texture( const string& root )
 {
@@ -245,6 +246,25 @@ FGMaterial::load_texture( const string& root )
 }
 
 
+// Destructor
+void FGMaterial::dump_info () {
+    FG_LOG( FG_TERRAIN, FG_INFO, "{" << endl << "  texture = " 
+           << texture_name );
+    FG_LOG( FG_TERRAIN, FG_INFO, "  xsize = " << xsize );
+    FG_LOG( FG_TERRAIN, FG_INFO, "  ysize = " << ysize );
+    FG_LOG( FG_TERRAIN, FG_INFO, "  ambient = " << ambient[0] << " "
+           << ambient[1] <<" "<< ambient[2] <<" "<< ambient[3] );
+    FG_LOG( FG_TERRAIN, FG_INFO, "  diffuse = " << diffuse[0] << " " 
+           << diffuse[1] << " " << diffuse[2] << " " << diffuse[3] );
+    FG_LOG( FG_TERRAIN, FG_INFO, "  specular = " << specular[0] << " " 
+           << specular[1] << " " << specular[2] << " " << specular[3]);
+    FG_LOG( FG_TERRAIN, FG_INFO, "  emission = " << emission[0] << " " 
+           << emission[1] << " " << emission[2] << " " << emission[3]);
+    FG_LOG( FG_TERRAIN, FG_INFO, "  alpha = " << alpha << endl <<"}" );
+           
+}
+
+
 // Destructor
 FGMaterial::~FGMaterial ( void ) {
 }
index 09da8f7ef9244503cc186a532ecd9766abbb1069..31784ca69c4db9ad1f6d165c59b66552793a6569 100644 (file)
@@ -95,6 +95,8 @@ public:
     inline GLfloat *get_diffuse() { return diffuse; }
     inline GLfloat *get_specular() { return specular; }
     inline GLfloat *get_emission() { return emission; }
+
+    void dump_info();
 };
 
 
index 2730fb3148a48e5dedff547e8ac0f4b923723188..d92178c71ca94797e1c4cd472ef2f71c96054135 100644 (file)
@@ -177,6 +177,13 @@ fgMATERIAL_MGR::load_lib ( void )
            tex_file.append( m.get_texture_name() );
            tex_file.concat( ".rgb" );
 
+           FG_LOG( FG_TERRAIN, FG_INFO, "  Loading material " 
+                   << material_name << " (" << tex_file.c_str() << ")");
+
+#if EXTRA_DEBUG
+           m.dump_info();
+#endif
+           
            ssgStateSelector *state = new ssgStateSelector(2);
            state->setStep(0, new ssgSimpleState); // textured
            state->setStep(1, new ssgSimpleState); // untextured