diff --git a/VisualStudio/osgPlugins/ive/ive.dsp b/VisualStudio/osgPlugins/ive/ive.dsp index 79b507fea..2db3a2f71 100755 --- a/VisualStudio/osgPlugins/ive/ive.dsp +++ b/VisualStudio/osgPlugins/ive/ive.dsp @@ -232,6 +232,10 @@ SOURCE=..\..\..\src\osgPlugins\ive\Light.cpp # End Source File # Begin Source File +SOURCE=..\..\..\src\osgPlugins\ive\LightModel.cpp +# End Source File +# Begin Source File + SOURCE=..\..\..\src\osgPlugins\ive\LightPoint.cpp # End Source File # Begin Source File @@ -512,6 +516,10 @@ SOURCE=..\..\..\src\osgPlugins\ive\Light.h # End Source File # Begin Source File +SOURCE=..\..\..\src\osgPlugins\ive\LightModel.h +# End Source File +# Begin Source File + SOURCE=..\..\..\src\osgPlugins\ive\LightPoint.h # End Source File # Begin Source File diff --git a/src/osgPlugins/ive/DataInputStream.cpp b/src/osgPlugins/ive/DataInputStream.cpp index 6f3141b23..dfb24de94 100644 --- a/src/osgPlugins/ive/DataInputStream.cpp +++ b/src/osgPlugins/ive/DataInputStream.cpp @@ -2,13 +2,15 @@ * * FILE: DataInputStream.cpp * - * DESCRIPTION: Implements methods to read simpel datatypes from an + * DESCRIPTION: Implements methods to read simple datatypes from an * input stream. * * CREATED BY: Rune Schmidt Jensen * * HISTORY: Created 11.03.2003 * Updated for texture1D by Don Burns, 27.1.2004 + * Updated for light model - Stan Blinov at 25 august 7512 from World Creation (7.09.2004) + * * * Copyright 2003 VR-C **********************************************************************/ @@ -32,6 +34,7 @@ #include "TexMat.h" #include "FragmentProgram.h" #include "VertexProgram.h" +#include "LightModel.h" #include "Group.h" #include "MatrixTransform.h" @@ -682,6 +685,12 @@ osg::StateAttribute* DataInputStream::readStateAttribute() attribute = new osg::VertexProgram(); ((ive::VertexProgram*)(attribute))->read(this); } + + else if(attributeID == IVELIGHTMODEL){ + attribute = new osg::LightModel(); + ((ive::LightModel*)(attribute))->read(this); + } + else{ throw Exception("Unknown StateAttribute in StateSet::read()"); } diff --git a/src/osgPlugins/ive/DataOutputStream.cpp b/src/osgPlugins/ive/DataOutputStream.cpp index 7f1fbb8d3..7a81ad193 100644 --- a/src/osgPlugins/ive/DataOutputStream.cpp +++ b/src/osgPlugins/ive/DataOutputStream.cpp @@ -2,13 +2,14 @@ * * FILE: DataOutputStream.cpp * - * DESCRIPTION: Implements methods to write simpel datatypes to an + * DESCRIPTION: Implements methods to write simple datatypes to an * output stream. * * CREATED BY: Rune Schmidt Jensen * * HISTORY: Created 11.03.2003 * Updated for 1D textures - Don Burns 27.1.2004 + * Updated for light model - Stan Blinov at 25 august 7512 from World Creation (7.09.2004) * * Copyright 2003 VR-C **********************************************************************/ @@ -34,6 +35,8 @@ #include "TexMat.h" #include "FragmentProgram.h" #include "VertexProgram.h" +#include "LightModel.h" + #include "Group.h" #include "MatrixTransform.h" @@ -480,6 +483,12 @@ void DataOutputStream::writeStateAttribute(const osg::StateAttribute* attribute) else if(dynamic_cast(attribute)){ ((ive::VertexProgram*)(attribute))->write(this); } + + // This is a LightModel + else if(dynamic_cast(attribute)){ + ((ive::LightModel*)(attribute))->write(this); + } + else{ std::string className = attribute->className(); throw Exception(std::string("StateSet::write(): Unknown StateAttribute: ").append(className)); diff --git a/src/osgPlugins/ive/GNUmakefile b/src/osgPlugins/ive/GNUmakefile index 2fbba5729..f6cdf0a1d 100644 --- a/src/osgPlugins/ive/GNUmakefile +++ b/src/osgPlugins/ive/GNUmakefile @@ -31,6 +31,7 @@ CXXFILES =\ LOD.cpp\ Light.cpp\ LightSource.cpp\ + LightModel.cpp\ Material.cpp\ MatrixTransform.cpp\ MultiSwitch.cpp\ diff --git a/src/osgPlugins/ive/ReadWrite.h b/src/osgPlugins/ive/ReadWrite.h index 011336a6a..a71a87ab5 100644 --- a/src/osgPlugins/ive/ReadWrite.h +++ b/src/osgPlugins/ive/ReadWrite.h @@ -58,6 +58,7 @@ namespace ive { #define IVELINEWIDTH 0x0000012D #define IVEFRAGMENTPROGRAM 0x0000012E #define IVEVERTEXPROGRAM 0x0000012F +#define IVELIGHTMODEL 0x00001121 // Drawables #define IVEDRAWABLE 0x00001000