Removed non-textured and flat shaded support because it really clutters up
the API and I don't believe we'd have any hope of running at any kind of reasonable frame rates on a non-hardware-3d accelerated box these days anyway.
This commit is contained in:
@@ -253,31 +253,24 @@ SGMaterial::ObjectGroup::get_object (int index) const
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
SGMaterial::SGMaterial( const string &fg_root,
|
||||
const SGPropertyNode *props,
|
||||
bool smooth_shading,
|
||||
bool use_textures )
|
||||
SGMaterial::SGMaterial( const string &fg_root, const SGPropertyNode *props )
|
||||
{
|
||||
init();
|
||||
read_properties( fg_root, props );
|
||||
build_ssg_state( false, smooth_shading, use_textures );
|
||||
build_ssg_state( false );
|
||||
}
|
||||
|
||||
SGMaterial::SGMaterial( const string &texpath,
|
||||
bool smooth_shading,
|
||||
bool use_textures )
|
||||
SGMaterial::SGMaterial( const string &texpath )
|
||||
{
|
||||
init();
|
||||
texture_path = texpath;
|
||||
build_ssg_state( true, smooth_shading, use_textures );
|
||||
build_ssg_state( true );
|
||||
}
|
||||
|
||||
SGMaterial::SGMaterial( ssgSimpleState *s,
|
||||
bool smooth_shading,
|
||||
bool use_textures )
|
||||
SGMaterial::SGMaterial( ssgSimpleState *s )
|
||||
{
|
||||
init();
|
||||
set_ssg_state( s, smooth_shading, use_textures );
|
||||
set_ssg_state( s );
|
||||
}
|
||||
|
||||
SGMaterial::~SGMaterial (void)
|
||||
@@ -354,9 +347,7 @@ void
|
||||
SGMaterial::init ()
|
||||
{
|
||||
texture_path = "";
|
||||
state = 0;
|
||||
textured = 0;
|
||||
nontextured = 0;
|
||||
state = NULL;
|
||||
xsize = 0;
|
||||
ysize = 0;
|
||||
wrapu = true;
|
||||
@@ -374,13 +365,12 @@ SGMaterial::init ()
|
||||
bool
|
||||
SGMaterial::load_texture ()
|
||||
{
|
||||
if (texture_loaded) {
|
||||
if ( texture_loaded ) {
|
||||
return false;
|
||||
} else {
|
||||
SG_LOG( SG_GENERAL, SG_INFO, "Loading deferred texture "
|
||||
<< texture_path );
|
||||
textured->setTexture( (char *)texture_path.c_str(),
|
||||
wrapu, wrapv, mipmap );
|
||||
state->setTexture( (char *)texture_path.c_str(), wrapu, wrapv, mipmap );
|
||||
texture_loaded = true;
|
||||
return true;
|
||||
}
|
||||
@@ -388,140 +378,55 @@ SGMaterial::load_texture ()
|
||||
|
||||
|
||||
void
|
||||
SGMaterial::build_ssg_state( bool defer_tex_load,
|
||||
bool smooth_shading,
|
||||
bool use_textures )
|
||||
SGMaterial::build_ssg_state( bool defer_tex_load )
|
||||
{
|
||||
GLenum shade_model = ( smooth_shading ? GL_SMOOTH : GL_FLAT);
|
||||
GLenum shade_model = GL_SMOOTH;
|
||||
|
||||
state = new ssgStateSelector(2);
|
||||
state = new ssgSimpleState();
|
||||
state->ref();
|
||||
|
||||
textured = new ssgSimpleState();
|
||||
textured->ref();
|
||||
|
||||
nontextured = new ssgSimpleState();
|
||||
nontextured->ref();
|
||||
|
||||
// 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 );
|
||||
textured->disable( GL_ALPHA_TEST );
|
||||
state->setShadeModel( shade_model );
|
||||
state->enable( GL_LIGHTING );
|
||||
state->enable ( GL_CULL_FACE ) ;
|
||||
state->enable( GL_TEXTURE_2D );
|
||||
state->disable( GL_BLEND );
|
||||
state->disable( GL_ALPHA_TEST );
|
||||
if ( !defer_tex_load ) {
|
||||
SG_LOG(SG_INPUT, SG_INFO, " " << texture_path );
|
||||
textured->setTexture( (char *)texture_path.c_str(), wrapu, wrapv );
|
||||
state->setTexture( (char *)texture_path.c_str(), wrapu, wrapv );
|
||||
texture_loaded = true;
|
||||
} else {
|
||||
texture_loaded = false;
|
||||
}
|
||||
textured->enable( GL_COLOR_MATERIAL );
|
||||
state->enable( GL_COLOR_MATERIAL );
|
||||
#if 0
|
||||
textured->setColourMaterial( GL_AMBIENT_AND_DIFFUSE );
|
||||
textured->setMaterial( GL_EMISSION, 0, 0, 0, 1 );
|
||||
textured->setMaterial( GL_SPECULAR, 0, 0, 0, 1 );
|
||||
state->setColourMaterial( GL_AMBIENT_AND_DIFFUSE );
|
||||
state->setMaterial( GL_EMISSION, 0, 0, 0, 1 );
|
||||
state->setMaterial( GL_SPECULAR, 0, 0, 0, 1 );
|
||||
#else
|
||||
textured->setMaterial ( GL_AMBIENT,
|
||||
state->setMaterial ( GL_AMBIENT,
|
||||
ambient[0], ambient[1],
|
||||
ambient[2], ambient[3] ) ;
|
||||
textured->setMaterial ( GL_DIFFUSE,
|
||||
state->setMaterial ( GL_DIFFUSE,
|
||||
diffuse[0], diffuse[1],
|
||||
diffuse[2], diffuse[3] ) ;
|
||||
textured->setMaterial ( GL_SPECULAR,
|
||||
state->setMaterial ( GL_SPECULAR,
|
||||
specular[0], specular[1],
|
||||
specular[2], specular[3] ) ;
|
||||
textured->setMaterial ( GL_EMISSION,
|
||||
state->setMaterial ( GL_EMISSION,
|
||||
emission[0], emission[1],
|
||||
emission[2], emission[3] ) ;
|
||||
textured->setShininess ( shininess );
|
||||
state->setShininess ( shininess );
|
||||
#endif
|
||||
|
||||
// Set up the coloured state
|
||||
nontextured->enable( GL_LIGHTING );
|
||||
nontextured->setShadeModel( shade_model );
|
||||
nontextured->enable ( GL_CULL_FACE ) ;
|
||||
nontextured->disable( GL_TEXTURE_2D );
|
||||
nontextured->disable( GL_BLEND );
|
||||
nontextured->disable( GL_ALPHA_TEST );
|
||||
nontextured->disable( GL_COLOR_MATERIAL );
|
||||
|
||||
nontextured->setMaterial ( GL_AMBIENT,
|
||||
ambient[0], ambient[1],
|
||||
ambient[2], ambient[3] ) ;
|
||||
nontextured->setMaterial ( GL_DIFFUSE,
|
||||
diffuse[0], diffuse[1],
|
||||
diffuse[2], diffuse[3] ) ;
|
||||
nontextured->setMaterial ( GL_SPECULAR,
|
||||
specular[0], specular[1],
|
||||
specular[2], specular[3] ) ;
|
||||
nontextured->setMaterial ( GL_EMISSION,
|
||||
emission[0], emission[1],
|
||||
emission[2], emission[3] ) ;
|
||||
nontextured->setShininess ( shininess );
|
||||
|
||||
state->setStep( 0, textured ); // textured
|
||||
state->setStep( 1, nontextured ); // untextured
|
||||
|
||||
// Choose the appropriate starting state.
|
||||
if ( use_textures ) {
|
||||
state->selectStep(0);
|
||||
} else {
|
||||
state->selectStep(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SGMaterial::set_ssg_state( ssgSimpleState *s,
|
||||
bool smooth_shading, bool use_textures )
|
||||
void SGMaterial::set_ssg_state( ssgSimpleState *s )
|
||||
{
|
||||
GLenum shade_model = ( smooth_shading ? GL_SMOOTH : GL_FLAT);
|
||||
|
||||
state = new ssgStateSelector(2);
|
||||
state = s;
|
||||
state->ref();
|
||||
|
||||
textured = s;
|
||||
texture_loaded = true;
|
||||
|
||||
nontextured = new ssgSimpleState();
|
||||
nontextured->ref();
|
||||
|
||||
// Set up the textured state
|
||||
textured->setShadeModel( shade_model );
|
||||
|
||||
// Set up the coloured state
|
||||
nontextured->enable( GL_LIGHTING );
|
||||
nontextured->setShadeModel( shade_model );
|
||||
nontextured->enable ( GL_CULL_FACE ) ;
|
||||
nontextured->disable( GL_TEXTURE_2D );
|
||||
nontextured->disable( GL_BLEND );
|
||||
nontextured->disable( GL_ALPHA_TEST );
|
||||
nontextured->disable( GL_COLOR_MATERIAL );
|
||||
|
||||
nontextured->setMaterial ( GL_AMBIENT,
|
||||
ambient[0], ambient[1],
|
||||
ambient[2], ambient[3] ) ;
|
||||
nontextured->setMaterial ( GL_DIFFUSE,
|
||||
diffuse[0], diffuse[1],
|
||||
diffuse[2], diffuse[3] ) ;
|
||||
nontextured->setMaterial ( GL_SPECULAR,
|
||||
specular[0], specular[1],
|
||||
specular[2], specular[3] ) ;
|
||||
nontextured->setMaterial ( GL_EMISSION,
|
||||
emission[0], emission[1],
|
||||
emission[2], emission[3] ) ;
|
||||
nontextured->setShininess ( shininess );
|
||||
|
||||
state->setStep( 0, textured ); // textured
|
||||
state->setStep( 1, nontextured ); // untextured
|
||||
|
||||
// Choose the appropriate starting state.
|
||||
if ( use_textures ) {
|
||||
state->selectStep(0);
|
||||
} else {
|
||||
state->selectStep(1);
|
||||
}
|
||||
}
|
||||
|
||||
// end of newmat.cxx
|
||||
|
||||
@@ -231,8 +231,7 @@ public:
|
||||
* state information for the material. This node is usually
|
||||
* loaded from the $FG_ROOT/materials.xml file.
|
||||
*/
|
||||
SGMaterial( const string &fg_root, const SGPropertyNode *props,
|
||||
bool smooth_shading, bool use_textures );
|
||||
SGMaterial( const string &fg_root, const SGPropertyNode *props );
|
||||
|
||||
|
||||
/**
|
||||
@@ -241,7 +240,7 @@ public:
|
||||
* @param texture_path A string containing an absolute path
|
||||
* to a texture file (usually RGB).
|
||||
*/
|
||||
SGMaterial( const string &texpath, bool smooth_shading, bool use_textures );
|
||||
SGMaterial( const string &texpath );
|
||||
|
||||
|
||||
/**
|
||||
@@ -253,7 +252,7 @@ public:
|
||||
*
|
||||
* @param s The SSG state for this material.
|
||||
*/
|
||||
SGMaterial( ssgSimpleState *s, bool smooth_shading, bool use_textures );
|
||||
SGMaterial( ssgSimpleState *s );
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
@@ -278,7 +277,7 @@ public:
|
||||
/**
|
||||
* Get the textured state.
|
||||
*/
|
||||
virtual inline ssgSimpleState *get_textured () { return textured; }
|
||||
virtual inline ssgSimpleState *get_state () const { return state; }
|
||||
|
||||
|
||||
/**
|
||||
@@ -317,12 +316,6 @@ public:
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the current state.
|
||||
*/
|
||||
virtual inline ssgStateSelector *get_state () const { return state; }
|
||||
|
||||
|
||||
/**
|
||||
* Increment the reference count for this material.
|
||||
*
|
||||
@@ -369,9 +362,7 @@ private:
|
||||
string texture_path;
|
||||
|
||||
// pointers to ssg states
|
||||
ssgStateSelector *state;
|
||||
ssgSimpleState *textured;
|
||||
ssgSimpleState *nontextured;
|
||||
ssgSimpleState *state;
|
||||
|
||||
// texture size
|
||||
double xsize, ysize;
|
||||
@@ -407,11 +398,8 @@ private:
|
||||
SGMaterial( const string &fg_root, const SGMaterial &mat ); // unimplemented
|
||||
|
||||
void read_properties( const string &fg_root, const SGPropertyNode *props );
|
||||
void build_ssg_state( bool defer_tex_load,
|
||||
bool smooth_shading,
|
||||
bool use_textures );
|
||||
void set_ssg_state( ssgSimpleState *s,
|
||||
bool smooth_shading, bool use_textures );
|
||||
void build_ssg_state( bool defer_tex_load );
|
||||
void set_ssg_state( ssgSimpleState *s );
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -61,7 +61,6 @@ SGMaterialLib material_lib;
|
||||
|
||||
// Constructor
|
||||
SGMaterialLib::SGMaterialLib ( void ) {
|
||||
set_step(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +243,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
for (int i = 0; i < nMaterials; i++) {
|
||||
const SGPropertyNode * node = materials.getChild(i);
|
||||
if (!strcmp(node->getName(), "material")) {
|
||||
SGMaterial *m = new SGMaterial( fg_root, node, true, true );
|
||||
SGMaterial *m = new SGMaterial( fg_root, node );
|
||||
|
||||
vector<SGPropertyNode_ptr>names = node->getChildren("name");
|
||||
for ( unsigned int j = 0; j < names.size(); j++ ) {
|
||||
@@ -273,7 +272,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
gnd_lights->enable( GL_BLEND );
|
||||
gnd_lights->disable( GL_ALPHA_TEST );
|
||||
gnd_lights->disable( GL_LIGHTING );
|
||||
matlib["GROUND_LIGHTS"] = new SGMaterial( gnd_lights, true, true );
|
||||
matlib["GROUND_LIGHTS"] = new SGMaterial( gnd_lights );
|
||||
|
||||
GLuint tex_name;
|
||||
|
||||
@@ -292,10 +291,10 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_white_lights->setMaterial ( GL_SPECULAR, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_white_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_white_lights->setTexture( tex_name );
|
||||
matlib["RWY_WHITE_LIGHTS"] = new SGMaterial( rwy_white_lights, true, true );
|
||||
matlib["RWY_WHITE_LIGHTS"] = new SGMaterial( rwy_white_lights );
|
||||
// For backwards compatibility ... remove someday
|
||||
matlib["RUNWAY_LIGHTS"] = new SGMaterial( rwy_white_lights, true, true );
|
||||
matlib["RWY_LIGHTS"] = new SGMaterial( rwy_white_lights, true, true );
|
||||
matlib["RUNWAY_LIGHTS"] = new SGMaterial( rwy_white_lights );
|
||||
matlib["RWY_LIGHTS"] = new SGMaterial( rwy_white_lights );
|
||||
// end of backwards compatitibilty
|
||||
|
||||
// hard coded runway medium intensity white light state
|
||||
@@ -314,7 +313,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_white_medium_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_white_medium_lights->setTexture( tex_name );
|
||||
matlib["RWY_WHITE_MEDIUM_LIGHTS"]
|
||||
= new SGMaterial( rwy_white_medium_lights, true, true );
|
||||
= new SGMaterial( rwy_white_medium_lights );
|
||||
|
||||
// hard coded runway low intensity white light state
|
||||
tex_name = gen_standard_dir_light_map( 235, 235, 195, 155 );
|
||||
@@ -332,7 +331,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_white_low_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_white_low_lights->setTexture( tex_name );
|
||||
matlib["RWY_WHITE_LOW_LIGHTS"]
|
||||
= new SGMaterial( rwy_white_low_lights, true, true );
|
||||
= new SGMaterial( rwy_white_low_lights );
|
||||
|
||||
// hard coded runway yellow light state
|
||||
tex_name = gen_standard_dir_light_map( 235, 215, 20, 255 );
|
||||
@@ -349,7 +348,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_yellow_lights->setMaterial ( GL_SPECULAR, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_yellow_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_yellow_lights->setTexture( tex_name );
|
||||
matlib["RWY_YELLOW_LIGHTS"] = new SGMaterial( rwy_yellow_lights, true, true );
|
||||
matlib["RWY_YELLOW_LIGHTS"] = new SGMaterial( rwy_yellow_lights );
|
||||
|
||||
// hard coded runway medium intensity yellow light state
|
||||
tex_name = gen_standard_dir_light_map( 235, 215, 20, 205 );
|
||||
@@ -367,7 +366,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_yellow_medium_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_yellow_medium_lights->setTexture( tex_name );
|
||||
matlib["RWY_YELLOW_MEDIUM_LIGHTS"]
|
||||
= new SGMaterial( rwy_yellow_medium_lights, true, true );
|
||||
= new SGMaterial( rwy_yellow_medium_lights );
|
||||
|
||||
// hard coded runway low intensity yellow light state
|
||||
tex_name = gen_standard_dir_light_map( 235, 215, 20, 155 );
|
||||
@@ -385,7 +384,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_yellow_low_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_yellow_low_lights->setTexture( tex_name );
|
||||
matlib["RWY_YELLOW_LOW_LIGHTS"]
|
||||
= new SGMaterial( rwy_yellow_low_lights, true, true );
|
||||
= new SGMaterial( rwy_yellow_low_lights );
|
||||
|
||||
// hard coded runway red light state
|
||||
tex_name = gen_standard_dir_light_map( 235, 90, 90, 255 );
|
||||
@@ -403,7 +402,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_red_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_red_lights->setTexture( tex_name );
|
||||
matlib["RWY_RED_LIGHTS"]
|
||||
= new SGMaterial( rwy_red_lights, true, true );
|
||||
= new SGMaterial( rwy_red_lights );
|
||||
|
||||
// hard coded medium intensity runway red light state
|
||||
tex_name = gen_standard_dir_light_map( 235, 90, 90, 205 );
|
||||
@@ -421,7 +420,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_red_medium_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_red_medium_lights->setTexture( tex_name );
|
||||
matlib["RWY_RED_MEDIUM_LIGHTS"]
|
||||
= new SGMaterial( rwy_red_medium_lights, true, true );
|
||||
= new SGMaterial( rwy_red_medium_lights );
|
||||
|
||||
// hard coded low intensity runway red light state
|
||||
tex_name = gen_standard_dir_light_map( 235, 90, 90, 205 );
|
||||
@@ -439,7 +438,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_red_low_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_red_low_lights->setTexture( tex_name );
|
||||
matlib["RWY_RED_LOW_LIGHTS"]
|
||||
= new SGMaterial( rwy_red_low_lights, true, true );
|
||||
= new SGMaterial( rwy_red_low_lights );
|
||||
|
||||
// hard coded runway green light state
|
||||
tex_name = gen_standard_dir_light_map( 20, 235, 20, 255 );
|
||||
@@ -457,7 +456,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_green_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_green_lights->setTexture( tex_name );
|
||||
matlib["RWY_GREEN_LIGHTS"]
|
||||
= new SGMaterial( rwy_green_lights, true, true );
|
||||
= new SGMaterial( rwy_green_lights );
|
||||
|
||||
// hard coded medium intensity runway green light state
|
||||
tex_name = gen_standard_dir_light_map( 20, 235, 20, 205 );
|
||||
@@ -475,7 +474,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_green_medium_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_green_medium_lights->setTexture( tex_name );
|
||||
matlib["RWY_GREEN_MEDIUM_LIGHTS"]
|
||||
= new SGMaterial( rwy_green_medium_lights, true, true );
|
||||
= new SGMaterial( rwy_green_medium_lights );
|
||||
|
||||
// hard coded low intensity runway green light state
|
||||
tex_name = gen_standard_dir_light_map( 20, 235, 20, 205 );
|
||||
@@ -493,7 +492,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_green_low_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_green_low_lights->setTexture( tex_name );
|
||||
matlib["RWY_GREEN_LOW_LIGHTS"]
|
||||
= new SGMaterial( rwy_green_low_lights, true, true );
|
||||
= new SGMaterial( rwy_green_low_lights );
|
||||
|
||||
// hard coded low intensity taxiway blue light state
|
||||
tex_name = gen_taxiway_dir_light_map( 90, 90, 235, 205 );
|
||||
@@ -511,7 +510,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
taxiway_blue_low_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
taxiway_blue_low_lights->setTexture( tex_name );
|
||||
matlib["RWY_BLUE_TAXIWAY_LIGHTS"]
|
||||
= new SGMaterial( taxiway_blue_low_lights, true, true );
|
||||
= new SGMaterial( taxiway_blue_low_lights );
|
||||
|
||||
// hard coded runway vasi light state
|
||||
ssgSimpleState *rwy_vasi_lights = new ssgSimpleState();
|
||||
@@ -527,7 +526,7 @@ bool SGMaterialLib::load( const string &fg_root, const string& mpath ) {
|
||||
rwy_vasi_lights->setMaterial ( GL_SPECULAR, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_vasi_lights->setMaterial ( GL_EMISSION, 0.0, 0.0, 0.0, 0.0 );
|
||||
rwy_vasi_lights->setTexture( gen_vasi_light_map() );
|
||||
matlib["RWY_VASI_LIGHTS"] = new SGMaterial( rwy_vasi_lights, true, true );
|
||||
matlib["RWY_VASI_LIGHTS"] = new SGMaterial( rwy_vasi_lights );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -554,7 +553,7 @@ bool SGMaterialLib::add_item ( const string &mat_name, const string &full_path )
|
||||
SG_LOG( SG_TERRAIN, SG_INFO, " Loading material "
|
||||
<< mat_name << " (" << full_path << ")");
|
||||
|
||||
material_lib.matlib[mat_name] = new SGMaterial( full_path, true, true );
|
||||
material_lib.matlib[mat_name] = new SGMaterial( full_path );
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -563,7 +562,7 @@ bool SGMaterialLib::add_item ( const string &mat_name, const string &full_path )
|
||||
// Load a library of material properties
|
||||
bool SGMaterialLib::add_item ( const string &mat_name, ssgSimpleState *state )
|
||||
{
|
||||
SGMaterial *m = new SGMaterial( state, true, true );
|
||||
SGMaterial *m = new SGMaterial( state );
|
||||
|
||||
SG_LOG( SG_TERRAIN, SG_INFO, " Loading material given a premade "
|
||||
<< "ssgSimpleState = " << mat_name );
|
||||
@@ -600,28 +599,6 @@ SGMaterialLib::~SGMaterialLib ( void ) {
|
||||
}
|
||||
|
||||
|
||||
// Set the step for all of the state selectors in the material slots
|
||||
void SGMaterialLib::set_step ( int step )
|
||||
{
|
||||
// container::iterator it = begin();
|
||||
for ( material_map_iterator it = begin(); it != end(); it++ ) {
|
||||
const string &key = it->first;
|
||||
SG_LOG( SG_GENERAL, SG_INFO,
|
||||
"Updating material " << key << " to step " << step );
|
||||
SGMaterial *slot = it->second;
|
||||
slot->get_state()->selectStep(step);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get the step for the state selectors
|
||||
int SGMaterialLib::get_step ()
|
||||
{
|
||||
material_map_iterator it = begin();
|
||||
return it->second->get_state()->getSelectStep();
|
||||
}
|
||||
|
||||
|
||||
// Load one pending "deferred" texture. Return true if a texture
|
||||
// loaded successfully, false if no pending, or error.
|
||||
void SGMaterialLib::load_next_deferred() {
|
||||
|
||||
@@ -74,9 +74,6 @@ public:
|
||||
// find a material record by material name
|
||||
SGMaterial *find( const string& material );
|
||||
|
||||
void set_step (int step);
|
||||
int get_step ();
|
||||
|
||||
/**
|
||||
* Load the next deferred texture, if there is any.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user