From 808511468b5eb0e56d5f7d001da8b9667ab387dd Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 6 Oct 2005 15:43:29 +0000 Subject: [PATCH] From Brede Johansen, added support for PolygonMode into .ive format. --- VisualStudio/osgPlugins/ive/ive.dsp | 8 ++++++++ src/osgPlugins/ive/DataInputStream.cpp | 8 +++++--- src/osgPlugins/ive/DataOutputStream.cpp | 6 +++--- src/osgPlugins/ive/GNUmakefile | 1 + src/osgPlugins/ive/ReadWrite.h | 1 + 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/VisualStudio/osgPlugins/ive/ive.dsp b/VisualStudio/osgPlugins/ive/ive.dsp index 5e5c7dc0b..1cca5dfea 100755 --- a/VisualStudio/osgPlugins/ive/ive.dsp +++ b/VisualStudio/osgPlugins/ive/ive.dsp @@ -304,6 +304,10 @@ SOURCE=..\..\..\src\osgPlugins\ive\Point.cpp # End Source File # Begin Source File +SOURCE=..\..\..\src\osgPlugins\ive\PolygonMode.cpp +# End Source File +# Begin Source File + SOURCE=..\..\..\src\osgPlugins\ive\PolygonOffset.cpp # End Source File # Begin Source File @@ -640,6 +644,10 @@ SOURCE=..\..\..\src\osgPlugins\ive\Point.h # End Source File # Begin Source File +SOURCE=..\..\..\src\osgPlugins\ive\PolygonMode.h +# End Source File +# Begin Source File + SOURCE=..\..\..\src\osgPlugins\ive\PolygonOffset.h # End Source File # Begin Source File diff --git a/src/osgPlugins/ive/DataInputStream.cpp b/src/osgPlugins/ive/DataInputStream.cpp index a6e2e6dd0..63037ab5a 100644 --- a/src/osgPlugins/ive/DataInputStream.cpp +++ b/src/osgPlugins/ive/DataInputStream.cpp @@ -23,7 +23,7 @@ #include "CullFace.h" #include "ClipPlane.h" #include "PolygonOffset.h" -//#include "PolygonMode.h" +#include "PolygonMode.h" #include "ShadeModel.h" #include "Point.h" #include "LineWidth.h" @@ -840,10 +840,10 @@ osg::StateAttribute* DataInputStream::readStateAttribute() attribute = new osg::PolygonOffset(); ((ive::PolygonOffset*)(attribute))->read(this); } -/* else if(attributeID == IVEPOLYGONMODE){ + else if(attributeID == IVEPOLYGONMODE){ attribute = new osg::PolygonMode(); ((ive::PolygonMode*)(attribute))->read(this); - }*/ + } else if(attributeID == IVESHADEMODEL){ attribute = new osg::ShadeModel(); ((ive::ShadeModel*)(attribute))->read(this); @@ -1180,3 +1180,5 @@ osg::Node* DataInputStream::readNode() return node; } + + diff --git a/src/osgPlugins/ive/DataOutputStream.cpp b/src/osgPlugins/ive/DataOutputStream.cpp index 43ca0661a..79b818e03 100644 --- a/src/osgPlugins/ive/DataOutputStream.cpp +++ b/src/osgPlugins/ive/DataOutputStream.cpp @@ -24,7 +24,7 @@ #include "CullFace.h" #include "ClipPlane.h" #include "PolygonOffset.h" -//#include "PolygonMode.h" +#include "PolygonMode.h" #include "ShadeModel.h" #include "Point.h" #include "LineWidth.h" @@ -662,10 +662,10 @@ void DataOutputStream::writeStateAttribute(const osg::StateAttribute* attribute) else if(dynamic_cast(attribute)){ ((ive::PolygonOffset*)(attribute))->write(this); } -/* // This is a PolygonMode + // This is a PolygonMode else if(dynamic_cast(attribute)){ ((ive::PolygonMode*)(attribute))->write(this); - }*/ + } else if(dynamic_cast(attribute)){ ((ive::ShadeModel*)(attribute))->write(this); } diff --git a/src/osgPlugins/ive/GNUmakefile b/src/osgPlugins/ive/GNUmakefile index 677dda141..a9e7195c3 100644 --- a/src/osgPlugins/ive/GNUmakefile +++ b/src/osgPlugins/ive/GNUmakefile @@ -54,6 +54,7 @@ CXXFILES =\ OccluderNode.cpp\ PagedLOD.cpp\ Point.cpp\ + PolygonMode.cpp\ PolygonOffset.cpp\ PositionAttitudeTransform.cpp\ PrimitiveSet.cpp\ diff --git a/src/osgPlugins/ive/ReadWrite.h b/src/osgPlugins/ive/ReadWrite.h index a36ef7505..75853c246 100644 --- a/src/osgPlugins/ive/ReadWrite.h +++ b/src/osgPlugins/ive/ReadWrite.h @@ -69,6 +69,7 @@ namespace ive { #define IVEUNIFORM 0x00001126 #define IVEVIEWPORT 0x00001127 #define IVESCISSOR 0x00001128 +#define IVEPOLYGONMODE 0x00001129 // Drawables #define IVEDRAWABLE 0x00001000