# include <simgear_config.h>
#endif
-#if defined ( __CYGWIN__ )
-#include <ieeefp.h>
-#endif
-
#include <simgear/compiler.h>
#include <simgear/constants.h>
#include <simgear/structure/exception.hxx>
#include <string.h>
#include <string>
-#include <osgDB/ReaderWriter>
+#include <osgDB/Registry>
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/sg_path.hxx>
// cerr << "Material " << name << endl;
matlib[name] = m;
m->add_name(name);
- SG_LOG( SG_TERRAIN, SG_INFO, " Loading material "
+ SG_LOG( SG_TERRAIN, SG_DEBUG, " Loading material "
<< names[j]->getStringValue() );
}
} else {
}
const SGMaterial*
-SGMaterialLib::findMaterial(const simgear::Effect* effect)
+SGMaterialLib::findMaterial(const osg::Geode* geode)
{
- if (!effect)
- return 0;
-
- const SGMaterialUserData* matUserData
- = dynamic_cast<const SGMaterialUserData*>(effect->getUserData());
- if (!matUserData)
- return 0;
- else
- return matUserData->getMaterial();
+ if (!geode)
+ return 0;
+ const simgear::EffectGeode* effectGeode;
+ effectGeode = dynamic_cast<const simgear::EffectGeode*>(geode);
+ if (!effectGeode)
+ return 0;
+ const simgear::Effect* effect = effectGeode->getEffect();
+ if (!effect)
+ return 0;
+ const SGMaterialUserData* userData;
+ userData = dynamic_cast<const SGMaterialUserData*>(effect->getUserData());
+ if (!userData)
+ return 0;
+ return userData->getMaterial();
}