diff --git a/obj/NiDitherProperty.cpp b/obj/NiDitherProperty.cpp index 6e3048b421c6d296c74ae37ab53b21005f94dd83..0a0d876530a7094ec61cbfc033ec8a4b26d773f5 100644 --- a/obj/NiDitherProperty.cpp +++ b/obj/NiDitherProperty.cpp @@ -34,3 +34,11 @@ const Type & NiDitherProperty::GetType() const { return TYPE; }; +ushort NiDitherProperty::GetFlags() const { + return flags; +} + +void NiDitherProperty::SetFlags( ushort n ) { + flags = n; +} + diff --git a/obj/NiDitherProperty.h b/obj/NiDitherProperty.h index 9825108705dca0200c14d3d06b650c51b8796e81..72fcba7ef4e9451c7a23bb31dc012a400505a246 100644 --- a/obj/NiDitherProperty.h +++ b/obj/NiDitherProperty.h @@ -27,6 +27,10 @@ public: virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> & link_stack, unsigned int version, unsigned int user_version ); virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + + ushort GetFlags() const; + void SetFlags( ushort n ); + protected: NI_DITHER_PROPERTY_MEMBERS }; diff --git a/obj/NiFogProperty.cpp b/obj/NiFogProperty.cpp index 5bfd82dbd995162b709833d5992610b2b4074e18..ebfc2fd96235129b3bca9efe220320737a654150 100644 --- a/obj/NiFogProperty.cpp +++ b/obj/NiFogProperty.cpp @@ -34,3 +34,27 @@ const Type & NiFogProperty::GetType() const { return TYPE; }; + +ushort NiFogProperty::GetFlags() const { + return flags; +} + +void NiFogProperty::SetFlags( ushort n ) { + flags = n; +} + +float NiFogProperty::GetFogDepth() const { + return fogDepth; +} + +void NiFogProperty::SetFogDepth(float value) { + fogDepth = value; +} + +Color3 NiFogProperty::GetFogColor() const { + return fogColor; +} + +void NiFogProperty::SetFogColor(Color3 value) { + fogColor = value; +} diff --git a/obj/NiFogProperty.h b/obj/NiFogProperty.h index c8739742477ec912181c1fb8581e228e286e03c4..a3d2160bf1ac4846574ad6781fb4f405805f73aa 100644 --- a/obj/NiFogProperty.h +++ b/obj/NiFogProperty.h @@ -27,6 +27,16 @@ public: virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> & link_stack, unsigned int version, unsigned int user_version ); virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + + ushort GetFlags() const; + void SetFlags( ushort n ); + + float GetFogDepth() const; + void SetFogDepth(float value); + + Color3 GetFogColor() const; + void SetFogColor(Color3 value); + protected: NI_FOG_PROPERTY_MEMBERS }; diff --git a/obj/NiObject.h b/obj/NiObject.h index 65599444f7bb50c293f36f75c4bd2ffc3fd4ce5f..fdcaf84b8825a0aa2d26ce5ade9ee5d19f9d0f93 100644 --- a/obj/NiObject.h +++ b/obj/NiObject.h @@ -171,4 +171,36 @@ template <class T> Ref<const T> DynamicCast( const NiObject * object ) { } } +#ifdef USE_NIFLIB_TEMPLATE_HELPERS +/*! + * Dynamically cast from a collection of objects to another collection + * \param objs A collection of object references to be dynamically casted to the specified type. + * \return A collection of objects that support the requested type. + */ +template <typename U, typename T> +inline vector<Ref<U> > DynamicCast( vector<Ref<T> > const & objs ) { + vector<Ref<U> > retval; + for (vector<Ref<T> >::const_iterator itr = objs.begin(), end = objs.end(); itr != end; ++itr) { + Ref<U> obj = DynamicCast<U>(*itr); + if (obj) retval.insert(retval.end(), obj); + } + return retval; +} + +/*! +* Dynamically cast from a collection of objects to another collection +* \param objs A collection of object references to be dynamically casted to the specified type. +* \return A collection of objects that support the requested type. +*/ +template <typename U, typename T> +inline list<Ref<U> > DynamicCast( list<Ref<T> > const & objs ) { + list<Ref<U> > retval; + for (list<Ref<T> >::const_iterator itr = objs.begin(), end = objs.end(); itr != end; ++itr) { + Ref<U> obj = DynamicCast<U>(*itr); + if (obj) retval.insert(retval.end(), obj); + } + return retval; +} +#endif + #endif diff --git a/obj/NiShadeProperty.cpp b/obj/NiShadeProperty.cpp index f956e0135cec096756f9f5f16c291bc9e1220e42..c9dcb8bcb1cf77d415934e0cd50f5b875a1439f1 100644 --- a/obj/NiShadeProperty.cpp +++ b/obj/NiShadeProperty.cpp @@ -34,3 +34,10 @@ const Type & NiShadeProperty::GetType() const { return TYPE; }; +ushort NiShadeProperty::GetFlags() const { + return flags; +} + +void NiShadeProperty::SetFlags( ushort n ) { + flags = n; +} diff --git a/obj/NiShadeProperty.h b/obj/NiShadeProperty.h index e7b974b53ee59682bb341ba4f68af34c4daccd49..84eb7add266618a111402192dcb4a370950a0076 100644 --- a/obj/NiShadeProperty.h +++ b/obj/NiShadeProperty.h @@ -28,6 +28,10 @@ public: virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> & link_stack, unsigned int version, unsigned int user_version ); virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + + ushort GetFlags() const; + void SetFlags( ushort n ); + protected: NI_SHADE_PROPERTY_MEMBERS }; diff --git a/obj/NiSpecularProperty.cpp b/obj/NiSpecularProperty.cpp index ff7c2a44c90aa742169efe6d42b9e2addff412d0..7eb32fbf5e5250fa78a7154c9df79a504827dbb1 100644 --- a/obj/NiSpecularProperty.cpp +++ b/obj/NiSpecularProperty.cpp @@ -34,3 +34,10 @@ const Type & NiSpecularProperty::GetType() const { return TYPE; }; +ushort NiSpecularProperty::GetFlags() const { + return flags; +} + +void NiSpecularProperty::SetFlags( ushort n ) { + flags = n; +} diff --git a/obj/NiSpecularProperty.h b/obj/NiSpecularProperty.h index fbb87b29dd0888979406dac15a0171b11677783d..d87ca8c542e3a1f5f38156480fe4543b1832c33b 100644 --- a/obj/NiSpecularProperty.h +++ b/obj/NiSpecularProperty.h @@ -27,6 +27,10 @@ public: virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> & link_stack, unsigned int version, unsigned int user_version ); virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + + ushort GetFlags() const; + void SetFlags( ushort n ); + protected: NI_SPECULAR_PROPERTY_MEMBERS }; diff --git a/obj/NiStencilProperty.cpp b/obj/NiStencilProperty.cpp index 935945789485c31bbe77d4e1b2ef8c3c5608a46e..af97d28867e58394b3445ab4ca5e2cffb84ecac3 100644 --- a/obj/NiStencilProperty.cpp +++ b/obj/NiStencilProperty.cpp @@ -34,3 +34,74 @@ const Type & NiStencilProperty::GetType() const { return TYPE; }; +ushort NiStencilProperty::GetFlags() const { + return flags; +} + +void NiStencilProperty::SetFlags(ushort value) { + flags = value; +} + +bool NiStencilProperty::GetStencilEnabled() const { + return stencilEnabled; +} + +void NiStencilProperty::SetStencilEnabled(bool value) { + stencilEnabled = value; +} + +uint NiStencilProperty::GetStencilFunction() const { + return stencilFunction; +} + +void NiStencilProperty::SetStencilFunction(uint value) { + stencilFunction = value; +} + +uint NiStencilProperty::GetStencilRef() const { + return stencilRef; +} + +void NiStencilProperty::SetStencilRef(uint value) { + stencilRef = value; +} + +uint NiStencilProperty::GetStencilMask() const { + return stencilMask; +} + +void NiStencilProperty::SetStencilMask(uint value) { + stencilMask = value; +} + +uint NiStencilProperty::GetFailAction() const { + return failAction; +} + +void NiStencilProperty::SetFailAction(uint value) { + failAction = value; +} + +uint NiStencilProperty::GetZFailAction() const { + return zFailAction; +} + +void NiStencilProperty::SetZFailAction(uint value) { + zFailAction = value; +} + +uint NiStencilProperty::GetPassAction() const { + return passAction; +} + +void NiStencilProperty::SetPassAction(uint value) { + passAction = value; +} + +uint NiStencilProperty::GetDrawMode() const { + return drawMode; +} + +void NiStencilProperty::SetDrawMode(uint value) { + drawMode = value; +} diff --git a/obj/NiStencilProperty.h b/obj/NiStencilProperty.h index be57453c02b839f31d0a8436e626263943e8ff04..ccaace85cff0381dd758a0b348c50ae917617c57 100644 --- a/obj/NiStencilProperty.h +++ b/obj/NiStencilProperty.h @@ -27,6 +27,35 @@ public: virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> & link_stack, unsigned int version, unsigned int user_version ); virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + + ushort GetFlags() const; + void SetFlags(ushort value); + + bool GetStencilEnabled() const; + void SetStencilEnabled(bool value); + + uint GetStencilFunction() const; + void SetStencilFunction(uint value); + + uint GetStencilRef() const; + void SetStencilRef(uint value); + + uint GetStencilMask() const; + void SetStencilMask(uint value); + + uint GetFailAction() const; + void SetFailAction(uint value); + + uint GetZFailAction() const; + void SetZFailAction(uint value); + + uint GetPassAction() const; + void SetPassAction(uint value); + + uint GetDrawMode() const; + void SetDrawMode(uint value); + + protected: NI_STENCIL_PROPERTY_MEMBERS }; diff --git a/obj/NiVertexColorProperty.cpp b/obj/NiVertexColorProperty.cpp index 62fda8d266e8f36dc16fb5ecc65bd33601791379..2d89b5288c9078dff67ccf3783152967d64ed129 100644 --- a/obj/NiVertexColorProperty.cpp +++ b/obj/NiVertexColorProperty.cpp @@ -34,3 +34,26 @@ const Type & NiVertexColorProperty::GetType() const { return TYPE; }; +ushort NiVertexColorProperty::GetFlags() const { + return flags; +} + +void NiVertexColorProperty::SetFlags(ushort value) { + flags = value; +} + +VertMode NiVertexColorProperty::GetVertexMode() const { + return vertexMode; +} + +void NiVertexColorProperty::SetVertexMode(VertMode value) { + vertexMode = value; +} + +LightMode NiVertexColorProperty::GetLightingMode() const { + return lightingMode; +} + +void NiVertexColorProperty::SetLightingMode(LightMode value) { + lightingMode = value; +} diff --git a/obj/NiVertexColorProperty.h b/obj/NiVertexColorProperty.h index 8292930952ab549d919052974f9562cee2fef023..09c8d785b1d1a0c3d49ded0e53a09fa0127846bc 100644 --- a/obj/NiVertexColorProperty.h +++ b/obj/NiVertexColorProperty.h @@ -30,6 +30,16 @@ public: virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> & link_stack, unsigned int version, unsigned int user_version ); virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + + ushort GetFlags() const; + void SetFlags(ushort value); + + VertMode GetVertexMode() const; + void SetVertexMode(VertMode value); + + LightMode GetLightingMode() const; + void SetLightingMode(LightMode value); + protected: NI_VERTEX_COLOR_PROPERTY_MEMBERS }; diff --git a/obj/NiWireframeProperty.cpp b/obj/NiWireframeProperty.cpp index c87a1044493e5c3c7ac34d316b9f93cf6d373bca..ab865618549860b6123ff98b5b5d521d3f85d06d 100644 --- a/obj/NiWireframeProperty.cpp +++ b/obj/NiWireframeProperty.cpp @@ -34,3 +34,11 @@ const Type & NiWireframeProperty::GetType() const { return TYPE; }; +ushort NiWireframeProperty::GetFlags() const { + return flags; +} + +void NiWireframeProperty::SetFlags(ushort value) { + flags = value; +} + diff --git a/obj/NiWireframeProperty.h b/obj/NiWireframeProperty.h index 24cddd96ebef19c2104b819457d921201af04ae3..b9eb0db1ac18d2f929e2282e6ad868d58e750908 100644 --- a/obj/NiWireframeProperty.h +++ b/obj/NiWireframeProperty.h @@ -27,6 +27,10 @@ public: virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> & link_stack, unsigned int version, unsigned int user_version ); virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + + ushort GetFlags() const; + void SetFlags( ushort n ); + protected: NI_WIREFRAME_PROPERTY_MEMBERS }; diff --git a/obj/NiZBufferProperty.cpp b/obj/NiZBufferProperty.cpp index 30d68868adc5d20a28d135e2db7e05d076fe76fb..23324ef5f4ea95136533f52ea1d59d359429751f 100644 --- a/obj/NiZBufferProperty.cpp +++ b/obj/NiZBufferProperty.cpp @@ -34,3 +34,18 @@ const Type & NiZBufferProperty::GetType() const { return TYPE; }; +ushort NiZBufferProperty::GetFlags() const { + return flags; +} + +void NiZBufferProperty::SetFlags(ushort value) { + flags = value; +} + +uint NiZBufferProperty::GetFunction() const { + return function; +} + +void NiZBufferProperty::SetFunction(uint value) { + function = value; +} diff --git a/obj/NiZBufferProperty.h b/obj/NiZBufferProperty.h index 801f6382c1a96a66a27ac6cdc1bb9d962a8928b6..5b8c67643ccfc302f1f7c3f48de60d7352fb93ee 100644 --- a/obj/NiZBufferProperty.h +++ b/obj/NiZBufferProperty.h @@ -28,6 +28,13 @@ public: virtual void FixLinks( const vector<NiObjectRef> & objects, list<uint> & link_stack, unsigned int version, unsigned int user_version ); virtual list<NiObjectRef> GetRefs() const; virtual const Type & GetType() const; + + ushort GetFlags() const; + void SetFlags(ushort value); + + uint GetFunction() const; + void SetFunction(uint value); + protected: NI_Z_BUFFER_PROPERTY_MEMBERS };