+FGNewMat::~FGNewMat (void)
+{
+}
+
+
+\f
+////////////////////////////////////////////////////////////////////////
+// Public methods.
+////////////////////////////////////////////////////////////////////////
+
+void
+FGNewMat::read_properties (const SGPropertyNode * props)
+{
+ // Get the path to the texture
+ string tname = props->getStringValue("texture", "unknown.rgb");
+ SGPath tpath(globals->get_fg_root());
+ tpath.append("Textures.high");
+ tpath.append(tname);
+ if (!local_file_exists(tpath.str())) {
+ tpath = SGPath(globals->get_fg_root());
+ tpath.append("Textures");
+ tpath.append(tname);
+ }
+ texture_path = tpath.str();
+
+ xsize = props->getDoubleValue("xsize", 0.0);
+ ysize = props->getDoubleValue("ysize", 0.0);
+ wrapu = props->getBoolValue("wrapu", true);
+ wrapv = props->getBoolValue("wrapv", true);
+ mipmap = props->getBoolValue("mipmap", true);
+ light_coverage = props->getDoubleValue("light-coverage");
+
+ ambient[0] = props->getDoubleValue("ambient/r", 0.0);
+ ambient[1] = props->getDoubleValue("ambient/g", 0.0);
+ ambient[2] = props->getDoubleValue("ambient/b", 0.0);
+ ambient[3] = props->getDoubleValue("ambient/a", 0.0);
+
+ diffuse[0] = props->getDoubleValue("diffuse/r", 0.0);
+ diffuse[1] = props->getDoubleValue("diffuse/g", 0.0);
+ diffuse[2] = props->getDoubleValue("diffuse/b", 0.0);
+ diffuse[3] = props->getDoubleValue("diffuse/a", 0.0);
+
+ specular[0] = props->getDoubleValue("specular/r", 0.0);
+ specular[1] = props->getDoubleValue("specular/g", 0.0);
+ specular[2] = props->getDoubleValue("specular/b", 0.0);
+ specular[3] = props->getDoubleValue("specular/a", 0.0);
+
+ emission[0] = props->getDoubleValue("emissive/r", 0.0);
+ emission[1] = props->getDoubleValue("emissive/g", 0.0);
+ emission[2] = props->getDoubleValue("emissive/b", 0.0);
+ emission[3] = props->getDoubleValue("emissive/a", 0.0);
+}
+
+
+\f
+////////////////////////////////////////////////////////////////////////
+// Private methods.
+////////////////////////////////////////////////////////////////////////
+
+void
+FGNewMat::init ()
+{
+ texture_path = "";
+ state = 0;
+ textured = 0;
+ nontextured = 0;
+ 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;
+}