1
0
Fork 0

Initialization fixes.

This commit is contained in:
david 2001-12-29 13:19:09 +00:00
parent be7715fcd1
commit a2be88ad74
2 changed files with 31 additions and 21 deletions

View file

@ -52,42 +52,41 @@ local_file_exists( const string& path ) {
}
// Constructor
FGNewMat::FGNewMat ()
: texture_path(""),
state(0),
textured(0),
nontextured(0),
alpha(false),
xsize(0),
ysize(0),
wrapu(true),
wrapv(true),
mipmap(true),
texture_loaded(false),
refcount(0)
void
FGNewMat::init ()
{
for (int i = 0; i < 4; i++)
ambient[i] = diffuse[i] = specular[i] = emission[i] = 0.0;
texture_path = "";
state = 0;
textured = 0;
nontextured = 0;
alpha = false;
xsize = 0;
ysize = 0;
wrapu = true;
wrapv = true;
mipmap = true;
texture_loaded = false;
refcount = 0;
for (int i = 0; i < 4; i++)
ambient[i] = diffuse[i] = specular[i] = emission[i] = 0.0;
}
FGNewMat::FGNewMat (const SGPropertyNode * props)
{
FGNewMat();
init();
read_properties(props);
build_ssg_state(false);
}
FGNewMat::FGNewMat (const string &texture_path)
{
FGNewMat();
init();
build_ssg_state(true);
}
FGNewMat::FGNewMat (ssgSimpleState * s)
{
FGNewMat();
init();
set_ssg_state(s);
}

View file

@ -170,6 +170,18 @@ public:
*/
virtual inline int getRef() const { return refcount; }
protected:
////////////////////////////////////////////////////////////////////
// Protected methods.
////////////////////////////////////////////////////////////////////
/**
* Initialization method, invoked by all public constructors.
*/
virtual void init();
private:
@ -217,7 +229,6 @@ private:
// Internal constructors and methods.
////////////////////////////////////////////////////////////////////
FGNewMat ();
FGNewMat (const FGNewMat &mat); // unimplemented
void read_properties (const SGPropertyNode * props);