From eeaf652ddb3be8e763b94f3847214d515fb416b5 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 3 Nov 1999 16:18:19 +0000 Subject: [PATCH] Added some extra debugging infrastructure. --- src/Objects/material.cxx | 20 ++++++++++++++++++++ src/Objects/material.hxx | 2 ++ src/Objects/materialmgr.cxx | 7 +++++++ 3 files changed, 29 insertions(+) diff --git a/src/Objects/material.cxx b/src/Objects/material.cxx index a6d9b7c97..c8caf2c7e 100644 --- a/src/Objects/material.cxx +++ b/src/Objects/material.cxx @@ -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 ) { } diff --git a/src/Objects/material.hxx b/src/Objects/material.hxx index 09da8f7ef..31784ca69 100644 --- a/src/Objects/material.hxx +++ b/src/Objects/material.hxx @@ -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(); }; diff --git a/src/Objects/materialmgr.cxx b/src/Objects/materialmgr.cxx index 2730fb314..d92178c71 100644 --- a/src/Objects/materialmgr.cxx +++ b/src/Objects/materialmgr.cxx @@ -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 -- 2.39.5