Added a bunch of files synched with 0.8.42

This commit is contained in:
Don BURNS
2001-09-19 21:08:56 +00:00
parent fed86f3f03
commit e8f256a59d
446 changed files with 58397 additions and 10552 deletions

View File

@@ -0,0 +1,50 @@
#include "osg/LightSource"
#include "osgDB/Registry"
#include "osgDB/Input"
#include "osgDB/Output"
using namespace osg;
using namespace osgDB;
// forward declare functions to use later.
bool LightSource_readLocalData(Object& obj, Input& fr);
bool LightSource_writeLocalData(const Object& obj, Output& fw);
// register the read and write functions with the osgDB::Registry.
RegisterDotOsgWrapperProxy g_LightSourceProxy
(
new osg::LightSource,
"LightSource",
"Object Node LightSource",
&LightSource_readLocalData,
&LightSource_writeLocalData
);
bool LightSource_readLocalData(Object& obj, Input& fr)
{
bool iteratorAdvanced = false;
LightSource& lightsource = static_cast<LightSource&>(obj);
static ref_ptr<Light> s_light = new osg::Light;
Light* light = static_cast<Light*>(fr.readObjectOfType(*s_light));
if (light)
{
lightsource.setLight(light);
iteratorAdvanced = true;
}
return iteratorAdvanced;
}
bool LightSource_writeLocalData(const Object& obj, Output& fw)
{
const LightSource& lightsource = static_cast<const LightSource&>(obj);
if (lightsource.getLight()) fw.writeObject(*lightsource.getLight());
return true;
}