1
0
Fork 0

Added some extra debugging infrastructure.

This commit is contained in:
curt 1999-11-03 16:18:19 +00:00
parent 308e9d1ac5
commit eeaf652ddb
3 changed files with 29 additions and 0 deletions

View 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 ) {
}

View 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();
};

View 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