From Liang Aibin, " In lastest svn version of OSG, the .ive plugin missing osg::Light, it
does not process I/O for osg::Light. Now I have fixed it as follows:
2. In DataInputStream.cpp, I add support code in DataInputStream::readStateAttribute
for osg::Light.
3. In DataOutputStream.cpp, I add support code in DataOutputStream::writeStateAttribute
for osg::Light.
"
This commit is contained in:
@@ -53,6 +53,7 @@
|
||||
#include "PointSprite.h"
|
||||
#include "Multisample.h"
|
||||
#include "Fog.h"
|
||||
#include "Light.h"
|
||||
|
||||
|
||||
#include "Group.h"
|
||||
@@ -1193,6 +1194,10 @@ osg::StateAttribute* DataInputStream::readStateAttribute()
|
||||
else if(attributeID == IVEFOG){
|
||||
attribute = new osg::Fog();
|
||||
((ive::Fog*)(attribute))->read(this);
|
||||
}
|
||||
else if(attributeID == IVELIGHT){
|
||||
attribute = new osg::Light();
|
||||
((ive::Light*)(attribute))->read(this);
|
||||
}
|
||||
else{
|
||||
throw Exception("Unknown StateAttribute in StateSet::read()");
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include "PointSprite.h"
|
||||
#include "Multisample.h"
|
||||
#include "Fog.h"
|
||||
#include "Light.h"
|
||||
|
||||
#include "Group.h"
|
||||
#include "MatrixTransform.h"
|
||||
@@ -835,6 +836,10 @@ void DataOutputStream::writeStateAttribute(const osg::StateAttribute* attribute)
|
||||
else if(dynamic_cast<const osg::Fog*>(attribute)){
|
||||
((ive::Fog*)(attribute))->write(this);
|
||||
}
|
||||
// This is a Light
|
||||
else if(dynamic_cast<const osg::Light*>(attribute)){
|
||||
((ive::Light*)(attribute))->write(this);
|
||||
}
|
||||
|
||||
else{
|
||||
std::string className = attribute->className();
|
||||
|
||||
Reference in New Issue
Block a user