From eae88166e24a6e27422c255183368a1e95d25470 Mon Sep 17 00:00:00 2001
From: Shon Ferguson <shonferg@users.sourceforge.net>
Date: Fri, 4 May 2007 22:46:45 +0000
Subject: [PATCH] More documentation. Some function and enum name changes in
 NiAlphaProperty and NiStencilProperty to be more consistent with OpenGL and
 the rest of Niflib. Removed access to unknown parameters in NiSourceTexture
 and merged file name access functions.

---
 include/obj/NiAlphaProperty.h       | 137 +++++++++++++++++++++-------
 include/obj/NiDitherProperty.h      |  15 ++-
 include/obj/NiFogProperty.h         |  43 +++++++--
 include/obj/NiMaterialProperty.h    |  70 +++++++++++++-
 include/obj/NiShadeProperty.h       |   9 ++
 include/obj/NiSourceTexture.h       |  77 ++++++++++++----
 include/obj/NiSpecularProperty.h    |   9 ++
 include/obj/NiStencilProperty.h     |  80 +++++++++++++---
 include/obj/NiTexturingProperty.h   |  54 +++++++----
 include/obj/NiVertexColorProperty.h |  39 ++++++--
 include/obj/NiWireframeProperty.h   |  10 ++
 include/obj/NiZBufferProperty.h     |  24 ++++-
 src/obj/NiAlphaProperty.cpp         |  34 +++----
 src/obj/NiSourceTexture.cpp         |  40 +++-----
 src/obj/NiStencilProperty.cpp       |   8 +-
 src/obj/NiZBufferProperty.cpp       |   4 +-
 16 files changed, 493 insertions(+), 160 deletions(-)

diff --git a/include/obj/NiAlphaProperty.h b/include/obj/NiAlphaProperty.h
index 758154e1..874e453e 100644
--- a/include/obj/NiAlphaProperty.h
+++ b/include/obj/NiAlphaProperty.h
@@ -32,48 +32,117 @@ public:
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
-	enum BlendMode {
-		BM_ONE = 0x00,
-		BM_ZERO = 0x01,
-		BM_SRC_COLOR = 0x02,
-		BM_ONE_MINUS_SRC_COLOR = 0x03,
-		BM_DST_COLOR = 0x04,
-		BM_ONE_MINUS_DST_COLOR = 0x05,
-		BM_SRC_ALPHA = 0x06,
-		BM_ONE_MINUS_SRC_ALPHA = 0x07,
-		BM_DST_ALPHA = 0x08,
-		BM_ONE_MINUS_DST_ALPHA = 0x08,
-		BM_SRC_ALPHA_SATURATE = 0x09,
+	/*! Used to specify the source and destination blending functions.  The function of each value is equivalent to the OpenGL blending function of similar name. */
+	enum BlendFunc {
+		BF_ONE = 0x00, 
+		BF_ZERO = 0x01,
+		BF_SRC_COLOR = 0x02,
+		BF_ONE_MINUS_SRC_COLOR = 0x03,
+		BF_DST_COLOR = 0x04,
+		BF_ONE_MINUS_DST_COLOR = 0x05,
+		BF_SRC_ALPHA = 0x06,
+		BF_ONE_MINUS_SRC_ALPHA = 0x07,
+		BF_DST_ALPHA = 0x08,
+		BF_ONE_MINUS_DST_ALPHA = 0x08,
+		BF_SRC_ALPHA_SATURATE = 0x09,
 	};
 
-	enum TestMode {
-		TM_ALWAYS = 0x00,
-		TM_LESS = 0x01,
-		TM_EQUAL = 0x02,
-		TM_LEQUAL = 0x03,
-		TM_GREATER = 0x04,
-		TM_NOTEQUAL = 0x05,
-		TM_GEQUAL = 0x06,
-		TM_NEVER = 0x07,
+	/*! Used to set the alpha test function.  The function of each value is equivalent to the OpenGL test function of similar name. */
+	enum TestFunc {
+		TF_ALWAYS = 0x00,
+		TF_LESS = 0x01,
+		TF_EQUAL = 0x02,
+		TF_LEQUAL = 0x03,
+		TF_GREATER = 0x04,
+		TF_NOTEQUAL = 0x05,
+		TF_GEQUAL = 0x06,
+		TF_NEVER = 0x07,
 	};
 
-	NIFLIB_API BlendMode GetSourceBlendMode() const;
-	NIFLIB_API void SetSourceBlendMode(BlendMode value);
+	/*!
+	 * Used to get the current alpha blending state.  If alpha blending is turned on, the blending functions will be used to mix the values based on the alpha component of each pixel in the texture.
+	 * \return True if alpha blending is enabled, false otherwise.
+	 */
+	NIFLIB_API bool GetBlendState() const;
 
-	NIFLIB_API BlendMode GetDestBlendMode() const;
-	NIFLIB_API void SetDestBlendMode(BlendMode value);
+	/*!
+	 * Used to set the alpha blending state.  If alpha blending is turned on, the blending functions will be used to mix the values based on the alpha component of each pixel in the texture.
+	 * \param[in] value True to enable alpha blending, false to disable it.
+	 */
+	NIFLIB_API void SetBlendState(bool value);
 
-	NIFLIB_API TestMode GetTestMode() const;
-	NIFLIB_API void SetTestMode(TestMode value);
 
-	NIFLIB_API bool GetAlphaBlend() const;
-	NIFLIB_API void SetAlphaBlend(bool value);
+	/*!
+	 * Used to get the current source blend function which determines how alpha blending occurs if it is enabled.
+	 * \return The current soucre blend function.
+	 */
+	NIFLIB_API BlendFunc GetSourceBlendFunc() const;
 
-	NIFLIB_API bool GetAlphaTest() const;
-	NIFLIB_API void SetAlphaTest(bool value);
+	/*!
+	 * Used to set the source blend function which determines how alpha blending occurs if it is enabled.
+	 * \param[in] value The new soucre blend function.
+	 */
+	NIFLIB_API void SetSourceBlendFunc(BlendFunc value);
 
-	NIFLIB_API bool GetAlphaSort() const;
-	NIFLIB_API void SetAlphaSort(bool value);
+	/*!
+	 * Used to get the current destination blend function which determines how alpha blending occurs if it is enabled.
+	 * \return The current destination blend function.
+	 */
+	NIFLIB_API BlendFunc GetDestBlendFunc() const;
+
+	/*!
+	 * Used to set the destination blend function which determines how alpha blending occurs if it is enabled.
+	 * \param[in] value The new destination blend function.
+	 */
+	NIFLIB_API void SetDestBlendFunc(BlendFunc value);
+
+	/*!
+	 * Used to get the current alpha testing state.  If alpha testing is turned on, the alpha test function will be used to compare each pixel's alpha value to the threshold.  If the function is true, the pixel will be drawn, otherwise it will not.
+	 * \return True if alpha testing is enabled, false otherwise.
+	 */
+	NIFLIB_API bool GetTestState() const;
+
+	/*!
+	 * Used to set the alpha testing state.  If alpha testing is turned on, the alpha test function will be used to compare each pixel's alpha value to the threshold.  If the function is true, the pixel will be drawn, otherwise it will not.
+	 * \param[in] value True to enable alpha testing, false to disable it.
+	 */
+	NIFLIB_API void SetTestState(bool value);
+
+	/*!
+	 * Used to get the current alpha test function which determines the cut-off alpha value between fully transparent and fully opaque parts of a texture.
+	 * \return The current alpha test function.
+	 */
+	NIFLIB_API TestFunc GetTestFunc() const;
+
+	/*!
+	 * Used to set the alpha test function which determines the cut-off alpha value between fully transparent and fully opaque parts of a texture.
+	 * \param[in] value The new alpha test function.
+	 */
+	NIFLIB_API void SetTestFunc(TestFunc value);
+
+	/*!
+	 * Used to get the current threshold value that will be used with the alpha test function to determine whether a particular pixel will be drawn.
+	 * \return The current alpha test threshold.
+	 */
+	NIFLIB_API byte GetTestThreshold() const;
+
+	/*!
+	 * Used to set the threshold value that will be used with the alpha test function to determine whether a particular pixel will be drawn.
+	 * \param[in] n The new alpha test threshold.
+	 */
+	NIFLIB_API void SetTestThreshold( byte n );
+
+	/*!
+	 * Used to get the current triangle sort mode.  If triangle sorting is enabled, the triangles that make up an object will be sorted based on distance, and drawn from farthest away to closest.  This reduces errors when using alpha blending.
+	 * \return True if triangles will be sorted, false otherwise.
+	 */
+	NIFLIB_API bool GetTriangleSortMode() const;
+
+	/*!
+	 * Used to set the triangle sort mode.  If triangle sorting is enabled, the triangles that make up an object will be sorted based on distance, and drawn from farthest away to closest.  This reduces errors when using alpha blending.
+	 * \param[in] value True to enable triangle sorting, false to disable it.
+	 */
+	NIFLIB_API void SetTriangleSortMode(bool value);
 
 	/*!
 	 * Can be used to get the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
@@ -87,8 +156,6 @@ public:
 	 */
 	NIFLIB_API void SetFlags( unsigned short n );
 
-	NIFLIB_API byte GetAlphaTestThreshold() const;
-	NIFLIB_API void SetAlphaTestThreshold( byte n );
 protected:
 	NI_ALPHA_PROPERTY_MEMBERS
 private:
diff --git a/include/obj/NiDitherProperty.h b/include/obj/NiDitherProperty.h
index d680c665..9697cba3 100644
--- a/include/obj/NiDitherProperty.h
+++ b/include/obj/NiDitherProperty.h
@@ -32,9 +32,18 @@ public:
 	NIFLIB_API virtual string asString( bool verbose = false ) const;
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
-
-   NIFLIB_API unsigned short GetFlags() const;
-   NIFLIB_API void SetFlags( unsigned short n );
+	
+	/*!
+	 * Can be used to get the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \return The flag data.
+	 */
+	NIFLIB_API unsigned short GetFlags() const;
+
+	/*!
+	 * Can be used to set the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \param[in] n The new flag data.  Will overwrite any existing flag data.
+	 */
+	NIFLIB_API void SetFlags( unsigned short n );
 
 protected:
 	NI_DITHER_PROPERTY_MEMBERS
diff --git a/include/obj/NiFogProperty.h b/include/obj/NiFogProperty.h
index 1fe751c9..3a73703f 100644
--- a/include/obj/NiFogProperty.h
+++ b/include/obj/NiFogProperty.h
@@ -33,14 +33,41 @@ public:
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
-   NIFLIB_API unsigned short GetFlags() const;
-   NIFLIB_API void SetFlags( unsigned short n );
-   
-   NIFLIB_API float GetFogDepth() const;
-   NIFLIB_API void SetFogDepth(float value);
-
-   NIFLIB_API Color3 GetFogColor() const;
-   NIFLIB_API void SetFogColor(Color3 value);
+	/*!
+	 * Can be used to get the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \return The flag data.
+	 */
+	NIFLIB_API unsigned short GetFlags() const;
+
+	/*!
+	 * Can be used to set the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \param[in] n The new flag data.  Will overwrite any existing flag data.
+	 */
+	NIFLIB_API void SetFlags( unsigned short n );
+
+	/*!
+	 * Used to get the current distance when fog begins to appear, also known as fog density.
+	 * \return The current fog depth.
+	 */
+	NIFLIB_API float GetFogDepth() const;
+
+	/*!
+	 * Used to set the distance when fog begins to appear, also known as fog density.
+	 * \param[in] value The new fog depth.
+	 */
+	NIFLIB_API void SetFogDepth(float value);
+
+	/*!
+	 * Used to get the current color of the fog.
+	 * \return The current fog color.
+	 */
+	NIFLIB_API Color3 GetFogColor() const;
+
+	/*!
+	 * Used to set the color of the fog.
+	 * \param[in] value The new fog color.
+	 */
+	NIFLIB_API void SetFogColor(Color3 value);
 
 protected:
 	NI_FOG_PROPERTY_MEMBERS
diff --git a/include/obj/NiMaterialProperty.h b/include/obj/NiMaterialProperty.h
index 867e2c29..8dc2c93c 100644
--- a/include/obj/NiMaterialProperty.h
+++ b/include/obj/NiMaterialProperty.h
@@ -33,27 +33,89 @@ public:
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
+	/*!
+	 * Can be used to get the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \return The flag data.
+	 */
 	NIFLIB_API unsigned short GetFlags() const;
+
+	/*!
+	 * Can be used to set the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \param[in] n The new flag data.  Will overwrite any existing flag data.
+	 */
 	NIFLIB_API void SetFlags( unsigned short n );
 
+	/*!
+	 * Gets the current transparency of this material.
+	 * \return The current transparency.
+	 */
 	NIFLIB_API float GetTransparency() const;
-	NIFLIB_API void SetTransparency( float n );
 
-	NIFLIB_API float GetGlossiness() const;
-	NIFLIB_API void SetGlossiness( float n );
+	/*!
+	 * Sets the current transparency of this material.
+	 * \param[in] n The new transparency.
+	 */
+	NIFLIB_API void SetTransparency( float n );
 
+	/*!
+	 * Gets the current ambient color of this material.  This determines how the material reacts to the ambient color of any lights shining on it.  Should ususally be (1,1,1).
+	 * \return The current ambient color.
+	 */
 	NIFLIB_API Color3 GetAmbientColor() const;
+
+	/*!
+	 * Sets the ambient color of this material.  This determines how the material reacts to the ambient color of any lights shining on it.  Should ususally be (1,1,1).
+	 * \param[in] n The new ambient color.
+	 */
 	NIFLIB_API void SetAmbientColor( const Color3 & n );
 
+	/*!
+	 * Gets the diffuse color of this material.  This is the main color of the material.  Should be (1,1,1) if a texture is present.
+	 * \return The current diffuse color.
+	 */
 	NIFLIB_API Color3 GetDiffuseColor() const;
+
+	/*!
+	 * Sets the diffuse color of this material.  This is the main color of the material.  Should be (1,1,1) if a texture is present.
+	 * \param[in] n The new diffuse color.
+	 */
 	NIFLIB_API void SetDiffuseColor( const Color3 & n );
 
+	/*!
+	 * Gets the current emissive color of this material.  This is an extra color component use for objects that glow.  It makes affected objects look brighter than they would normally if set to something other than black.
+	 * \return The current emissive color.
+	 */
 	NIFLIB_API Color3 GetEmissiveColor() const;
+
+	/*!
+	 * Sets the emissive color of this material.  This is an extra color component use for objects that glow.  It makes affected objects look brighter than they would normally if set to something other than black.
+	 * \param[in] n The new emissive color.
+	 */
 	NIFLIB_API void SetEmissiveColor( const Color3 & n );
 
+	/*!
+	 * Gets the current specular color of this material.  This is the color of bright highlights that appear if specular lighting is enabled.  The exact look of the hilights depends on the glossiness setting of the material.
+	 * \return The current specular color.
+	 */
 	NIFLIB_API Color3 GetSpecularColor() const;
+
+	/*!
+	 * Sets the specular color of this material.  This is the color of bright highlights that appear if specular lighting is enabled.  The exact look of the hilights depends on the glossiness setting of the material.
+	 * \param[in] n The new specular color.
+	 */
 	NIFLIB_API void SetSpecularColor( const Color3 & n );
-	
+
+	/*!
+	 * Gets the current glossiness of this material.  This determines how it reflects specular light.  Also known as shininess.
+	 * \return The current glossiness.
+	 */
+	NIFLIB_API float GetGlossiness() const;
+
+	/*!
+	 * Sets the glossiness of this material.  This determines how it reflects specular light.  Also known as shininess.
+	 * \param[in] n The new glossiness.
+	 */
+	NIFLIB_API void SetGlossiness( float n );
 
 protected:
 	NI_MATERIAL_PROPERTY_MEMBERS
diff --git a/include/obj/NiShadeProperty.h b/include/obj/NiShadeProperty.h
index c097ac25..4c2e83c3 100644
--- a/include/obj/NiShadeProperty.h
+++ b/include/obj/NiShadeProperty.h
@@ -34,7 +34,16 @@ public:
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
+	/*!
+	 * Can be used to get the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \return The flag data.
+	 */
 	NIFLIB_API unsigned short GetFlags() const;
+
+	/*!
+	 * Can be used to set the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \param[in] n The new flag data.  Will overwrite any existing flag data.
+	 */
 	NIFLIB_API void SetFlags( unsigned short n );
 
 protected:
diff --git a/include/obj/NiSourceTexture.h b/include/obj/NiSourceTexture.h
index 9f48213e..d0feb007 100644
--- a/include/obj/NiSourceTexture.h
+++ b/include/obj/NiSourceTexture.h
@@ -39,34 +39,73 @@ public:
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
-	NIFLIB_API bool IsTextureExternal ();
-
-	NIFLIB_API void SetExternalTexture( string file_name, const Ref<NiObject> & unk_link );
-
-	NIFLIB_API void SetInternalTexture( byte unk_byte, string original_file_name, const Ref<NiPixelData> & pixel_data );
-
-	NIFLIB_API string GetExternalFileName() const;
-	NIFLIB_API Ref<NiObject> GetExternalUnknownLink() const;
-
-	NIFLIB_API byte GetInternalUnknownByte() const;
-	NIFLIB_API string GetInternalOriginalFileName() const;
-	NIFLIB_API Ref<NiPixelData> GetInternalPixelData() const;
-
+	/*!
+	 * Used to check whether the texture referenced by this object is an external file.
+	 * \return True if the texture is stored in an external file, false if it is stored within this NIF file.
+	 */
+	NIFLIB_API bool IsTextureExternal() const;
+
+	/*!
+	 * Sets a new external file texture.  Removes any existing texture references, whether internal or external.
+	 * \param[in] file_name The file name of the external texture.  Often needs to follow game guidlines to be found.
+	 */
+	NIFLIB_API void SetExternalTexture( string file_name );
+
+	/*!
+	 * Sets a new internal file texture.  Removes any existing texture references, whether internal or external.
+	 * \param[in] original_file_name The original file name of the texture.  This may be optional.
+	 * \param[in] pixel_data The NiPixelData object that contains the texture image data.
+	 */
+	NIFLIB_API void SetInternalTexture( string original_file_name, NiPixelData * pixel_data );
+
+	/*!
+	 * Returns either the file name of the external texture, or the original file name of the internal one.
+	 * \return The name of the texture file.
+	 */
+	NIFLIB_API string GetTextureFileName() const;
+
+	/*!
+	 * Returns a reference to the texture image data object used by this texture, if any.
+	 * \return The iamge data object referenced by this texture, or NULL if one is not being used.
+	 */
+	NIFLIB_API Ref<NiPixelData> GetPixelData() const;
+
+	/*!
+	 * Gets the current pixel layout of this texture.  This is the image format, usually the color depth.
+	 * \return The pixel layout of this texture.
+	 */
 	NIFLIB_API PixelLayout GetPixelLayout() const;
+
+	/*!
+	 * Sets the pixel layout of this texture.  This is the image format, usually the color depth.
+	 * \param[in] n The new pixel layout of this texture.
+	 */
 	NIFLIB_API void SetPixelLayout( PixelLayout n );
 
+	/*!
+	 * Gets the current mip map format of this texture.  Specifies whether or not the texture contains mipmaps which are smaller versions of the texture that will be displayed on far away objects that use it.
+	 * \return The current mip map format of this texture.
+	 */
 	NIFLIB_API MipMapFormat GetMipMapFormat() const;
+
+	/*!
+	 * Sets the mip map format of this texture.  Specifies whether or not the texture contains mipmaps which are smaller versions of the texture that will be displayed on far away objects that use it.
+	 * \param[in] n The new mip map format of this texture.
+	 */
 	NIFLIB_API void SetMipMapFormat( MipMapFormat n );
 
+	/*!
+	 * Gets the current alpha format of this texture.  Specifies whether and how the texture uses alpha transparency.
+	 * \return The current alpha format of this texture.
+	 */
 	NIFLIB_API AlphaFormat GetAlphaFormat() const;
-	NIFLIB_API void SetAlphaFormat( AlphaFormat n );
 
-	//TODO: Fix name problem with Unknown Byte in XML
-	//byte GetUnknownByte2() const;
-	//SetUnknownByte2( byte n );
+	/*!
+	 * Sets the alpha format of this texture.  Specifies whether and how the texture uses alpha transparency.
+	 * \param[in] n The new alpha format of this texture.
+	 */
+	NIFLIB_API void SetAlphaFormat( AlphaFormat n );
 
-	//byte GetUnknownByte3() const;
-	//SetUnknownByte3( byte n );
 protected:
 	NI_SOURCE_TEXTURE_MEMBERS
 private:
diff --git a/include/obj/NiSpecularProperty.h b/include/obj/NiSpecularProperty.h
index 39d1dcf6..2cea539a 100644
--- a/include/obj/NiSpecularProperty.h
+++ b/include/obj/NiSpecularProperty.h
@@ -33,7 +33,16 @@ public:
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
+	/*!
+	 * Can be used to get the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \return The flag data.
+	 */
 	NIFLIB_API unsigned short GetFlags() const;
+
+	/*!
+	 * Can be used to set the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \param[in] n The new flag data.  Will overwrite any existing flag data.
+	 */
 	NIFLIB_API void SetFlags( unsigned short n );
 
 protected:
diff --git a/include/obj/NiStencilProperty.h b/include/obj/NiStencilProperty.h
index abee4c4d..28a159a0 100644
--- a/include/obj/NiStencilProperty.h
+++ b/include/obj/NiStencilProperty.h
@@ -34,58 +34,112 @@ public:
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
 	/*!
-	 * Property flags.
+	 * Can be used to get the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \return The flag data.
 	 */
 	NIFLIB_API unsigned short GetFlags() const;
+
+	/*!
+	 * Can be used to set the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \param[in] value The new flag data.  Will overwrite any existing flag data.
+	 */
 	NIFLIB_API void SetFlags(unsigned short value);
 
 	/*!
-	 * Enables or disables the stencil test.
+	 * Used to get the current stencil state buffer state.  This determines whether or not the stencil buffer is being used.
+	 * \return True if the stencil buffer is enabled, false otherwise.
 	 */
-	NIFLIB_API bool GetStencilEnabled() const;
-	NIFLIB_API void SetStencilEnabled(bool value);
+	NIFLIB_API bool GetStencilState() const;
 
 	/*!
-	 * Selects the compare mode function.
+	 * Used to set the stencil state buffer state.  This determines whether or not the stencil buffer is being used.
+	 * \param[in] value True to enable the stencil, false to disable it.
+	 */
+	NIFLIB_API void SetStencilState(bool value);
+
+	/*!
+	 * Used to get the current stencil buffer comparison function.  This function determines whether a particular pixel will be drawn based on the contents of the stencil buffer at that location.
+	 * \return The current stencil buffer comparison function.
 	 */
 	NIFLIB_API CompareMode GetStencilFunction() const;
+
+	/*!
+	 * Used to set the current stencil buffer comparison function.  This function determines whether a particular pixel will be drawn based on the contents of the stencil buffer at that location.
+	 * \param[in] value The new stencil buffer comparison function.
+	 */
 	NIFLIB_API void SetStencilFunction( CompareMode value );
 
 	/*!
-	 * Unknown.  Default is 0.
+	 * Used to get the current reference value used in the stencil test.  This is the value that the stencil function compares against to determine whether a pixel is drawn.
+	 * \return The current stencil reference value.
 	 */
 	NIFLIB_API unsigned int GetStencilRef() const;
+
+	/*!
+	 * Used to set the current reference value used in the stencil test.  This is the value that the stencil function compares against to determine whether a pixel is drawn.
+	 * \param[in] value The new stencil reference value.
+	 */
 	NIFLIB_API void SetStencilRef(unsigned int value);
 
 	/*!
-	 * A bit mask. The default is 0xffffffff.
+	 * Used to get the current bit mask used in the stencil test.  The reference value and the stored stencil value are both bitwise ANDed with this mask before being compared.  The default is 0xFFFFFFFF.
+	 * \return The current stencil test bit mask.
 	 */
 	NIFLIB_API unsigned int GetStencilMask() const;
+
+	/*!
+	 * Used to set the bit mask used in the stencil test.  The reference value and the stored stencil value are both bitwise ANDed with this mask before being compared.  The default is 0xFFFFFFFF.
+	 * \param[in] value The new stencil test bit mask.
+	 */
 	NIFLIB_API void SetStencilMask(unsigned int value);
 
 	/*!
-	 * Unknown.
+	 * Used to get the current action that occurs if the stencil test fails (evaluates to false).  This involves whether the stencil buffer will be altered and how.
+	 * \return The current action that occurs if the stencil test fails.
 	 */
 	NIFLIB_API StencilAction GetFailAction() const;
+
+	/*!
+	 * Used to set the action that will occur if the stencil test fails (evaluates to false).  This involves whether the stencil buffer will be altered and how.
+	 * \param[in] value The new action that occur if the stencil test fails.
+	 */
 	NIFLIB_API void SetFailAction( StencilAction value );
 
 	/*!
-	 * Unknown.
+	 * Used to get the current action that occurs if the depth buffer test fails (evaluates to false).  This involves whether the stencil buffer will be altered and how.
+	 * \return The current action that occurs if the depth buffer test fails.
 	 */
 	NIFLIB_API StencilAction GetZFailAction() const;
+
+	/*!
+	 * Used to set the action that will occur if the depth buffer (Z-buffer) fails (evaluates to false).  This involves whether the stencil buffer will be altered and how.
+	 * \param[in] value The new action that occur if the depth buffer fails.
+	 */
 	NIFLIB_API void SetZFailAction( StencilAction  value );
 
 	/*!
-	 * Unknown.
+	 * Used to get the current action that occurs if the depth buffer (Z-buffer) test passes (evaluate to true).  This involves whether the stencil buffer will be altered and how.
+	 * \return The current action that occurs if the depth buffer test passes.
 	 */
 	NIFLIB_API StencilAction GetPassAction() const;
+
+	/*!
+	 * Used to set the action that will occur if the depth buffer (Z-buffer) test passes (evaluate to true).  This involves whether the stencil buffer will be altered and how.
+	 * \param[in] value The new action that occur if the depth buffer test passes.
+	 */
 	NIFLIB_API void SetPassAction( StencilAction value );
 
 	/*!
-	 * Used to enabled double sided faces.
+	 * Used to determine whether the front, back, or both sides of triangles will be drawn.   This isn't related to the stencil buffer, but happens to be included in this propery, probably for conveniance.
+	 * \return The current face drawing mode.
+	 */
+	NIFLIB_API FaceDrawMode GetFaceDrawMode() const;
+
+	/*!
+	 * Sets whether the front, back, or both sides of triangles will be drawn.   This isn't related to the stencil buffer, but happens to be included in this propery, probably for conveniance.
+	 * \param[in] value The new face drawing mode.
 	 */
-	NIFLIB_API FaceDrawMode GetDrawMode() const;
-	NIFLIB_API void SetDrawMode( FaceDrawMode value );
+	NIFLIB_API void SetFaceDrawMode( FaceDrawMode value );
 
 protected:
 	NI_STENCIL_PROPERTY_MEMBERS
diff --git a/include/obj/NiTexturingProperty.h b/include/obj/NiTexturingProperty.h
index 787c8f53..64f99b4f 100644
--- a/include/obj/NiTexturingProperty.h
+++ b/include/obj/NiTexturingProperty.h
@@ -35,110 +35,128 @@ public:
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
-	/*! Retrieves the number of texture slots defined by this texturing propery.  Texture slots may or may not actually contain textures, but each slot has a different meaning so the way a texture is used is dependant upon which slot it is in.
+	/*! 
+	 * Retrieves the number of texture slots defined by this texturing propery.  Texture slots may or may not actually contain textures, but each slot has a different meaning so the way a texture is used is dependant upon which slot it is in.
 	 * \return The number of texture slots defined by this texturing property.
 	 * \sa NiTexturingProperty::SetTextureCount
 	 */
 	NIFLIB_API int GetTextureCount() const;
 
-	/*! Sets the number of texture slots defined by this texturing propery.  Known valid values are 7 and 8.
+	/*!
+	 * Sets the number of texture slots defined by this texturing propery.  Known valid values are 7 and 8.
 	 * \param new_count The new size of the texture slot array.
 	 * \sa NiTexturingProperty::GetTextureCount
 	 */
 	NIFLIB_API void SetTextureCount( int new_count );
 
-	/*! Retrieves the number of extra texture slots defined by this texturing propery.  These only exist in later Nif versions and their function is unknown.
+	/*! 
+	 * Retrieves the number of extra texture slots defined by this texturing propery.  These only exist in later Nif versions and their function is unknown.
 	 * \return The number of extra texture slots defined by this texturing property.
 	 * \sa NiTexturingProperty::SetExtraTextureCount
 	 */
 	NIFLIB_API int GetShaderTextureCount() const;
 
-	/*! Sets the number of extra texture slots defined by this texturing propery.  Often zero.
+	/*! 
+	 * Sets the number of extra texture slots defined by this texturing propery.  Often zero.
 	 * \param new_count The new size of the extra texture slot array.
 	 * \sa NiTexturingProperty::GetExtraTextureCount
 	 */
 	NIFLIB_API void SetShaderTextureCount( int new_count );
 
-	/*! Retrieves the current apply mode for this texturing propery.  This enum value affects the way the textures will be drawn.
+	/*! 
+	 * Retrieves the current apply mode for this texturing propery.  This enum value affects the way the textures will be drawn.
 	 * \return The current apply mode for this texturing property.
 	 * \sa NiTexturingProperty::SetApplyMode
 	 */
 	NIFLIB_API ApplyMode GetApplyMode() const;
 
-	/*! Sets the current apply mode for this texturing propery.  This enum value affects the way the textures will be drawn.
+	/*! 
+	 * Sets the current apply mode for this texturing propery.  This enum value affects the way the textures will be drawn.
 	 * \param new_val The new apply mode for this texturing property.
 	 * \sa NiTexturingProperty::GetApplyMode
 	 */
 	NIFLIB_API void SetApplyMode( ApplyMode new_val );
 
-	/*! Retrieves the texture desription structure that describes a texture by slot number.  The TexType enum is provided to make it easy to select the texture slot with the specific qualities that you want.
+	/*! 
+	 * Retrieves the texture desription structure that describes a texture by slot number.  The TexType enum is provided to make it easy to select the texture slot with the specific qualities that you want.
 	 * \param n The slot number of the texture to get the texture description of.  This is a positive zero based index that must be less than the value returned by NiTexturingProperty::GetTextureCount.
 	 * \sa NiTexturingProperty::SetTexture, TexType
 	 */
 	NIFLIB_API TexDesc GetTexture( int n ) const;
 
-	/*! Checks whether a particular texture type is being used
+	/*! 
+	 * Checks whether a particular texture type is being used
 	 * \param n The slot number of the texture to check.  This is a positive zero based index that must be less than the value returned by NiTexturingProperty::GetTextureCount.
 	 * \return true if the texture in this slot is used, false otherwise.
 	 */
 	NIFLIB_API bool HasTexture( int n ) const;
 
-	/*! Clears a specific texture slot.
+	/*! 
+	 * Clears a specific texture slot.
 	 * \param n The slot number of the texture to clear.  This is a positive zero based index that must be less than the value returned by NiTexturingProperty::GetTextureCount.
 	 */
 	NIFLIB_API void ClearTexture( int n );
 
-	/*! Sets a new description for the texture in the given slot number.  The TexType enum is provided to make it easy to select the texture slot with the specific qualities that you want.
+	/*! 
+	 * Sets a new description for the texture in the given slot number.  The TexType enum is provided to make it easy to select the texture slot with the specific qualities that you want.
 	 * \param n The slot number of the texture to set the texture description of.  This is a positive zero based index that must be less than the value returned by NiTexturingProperty::GetTextureCount.
 	 * \param new_val Thew new texture descriptoin for the texture at the given slot number.
 	 * \sa NiTexturingProperty::GetTexture, TexType
 	 */
 	NIFLIB_API void SetTexture( int n, TexDesc & new_val );
 
-	/*! Retrieves the texture desription structure that describes an extra texture by slot number.  These only exist in the later Nif versions and their function is unknown.
+	/*! 
+	 * Retrieves the texture desription structure that describes an extra texture by slot number.  These only exist in the later Nif versions and their function is unknown.
 	 * \param n The slot number of the extra texture to get the texture description of.  This is a positive zero based index that must be less than the value returned by NiTexturingProperty::GetExtraTextureCount.
 	 * \sa NiTexturingProperty::SetExtraTexture
 	 */
 	NIFLIB_API TexDesc GetShaderTexture( int n ) const;
 
-	/*! Sets a new description for the texture in the given slot number.  These only exist in the later Nif versions and their function is unknown.
+	/*! 
+	 * Sets a new description for the texture in the given slot number.  These only exist in the later Nif versions and their function is unknown.
 	 * \param n The slot number of the extra texture to set the texture description of.  This is a positive zero based index that must be less than the value returned by NiTexturingProperty::GetTextureCount.
 	 * \param new_val Thew new texture descriptoin for the extra texture at the given slot number.
 	 * \sa NiTexturingProperty::GetTexture, TexType
 	 */
 	NIFLIB_API void SetShaderTexture( int n, TexDesc & new_val );
 
-	/*! Retrieves the bump map luma offset.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
+	/*! 
+	 * Retrieves the bump map luma offset.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
 	 * \return The bump map luma offset.
 	 * \sa NiTexturingProperty::SetLumaOffset
 	 */
 	NIFLIB_API float GetLumaOffset() const;
 
-	/*! Sets the bump map luma offset.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
+	/*! 
+	 * Sets the bump map luma offset.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
 	 * \param new_val The new bump map luma offset.
 	 * \sa NiTexturingProperty::GetLumaOffset
 	 */
 	NIFLIB_API void SetLumaOffset( float new_val );
 
-	/*! Retrieves the bump map luma scale.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
+	/*! 
+	 * Retrieves the bump map luma scale.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
 	 * \return The bump map luma scale.
 	 * \sa NiTexturingProperty::SetLumaScale
 	 */
 	NIFLIB_API float GetLumaScale() const;
 
-	/*! Sets the bump map luma scale.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
+	/*! 
+	 * Sets the bump map luma scale.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
 	 * \param new_val The new bump map luma scale.
 	 * \sa NiTexturingProperty::GetLumaScale
 	 */
 	NIFLIB_API void SetLumaScale( float new_val );
 
-	/*! Retrieves the bump map matrix.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
+	/*! 
+	 * Retrieves the bump map matrix.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
 	 * \return the bump map matrix.
 	 * \sa NiTexturingProperty::SetBumpMapMatrix
 	 */
 	NIFLIB_API Matrix22 GetBumpMapMatrix() const;
 
-	/*! Sets the bump map matrix.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
+	/*! 
+	 * Sets the bump map matrix.  This is only relevant if a texture is defined in the BUMP_MAP texture slot.  The function of this is unknown.
 	 * \param new_val The new bump map matrix.
 	 * \sa NiTexturingProperty::GetBumpMapMatrix
 	 */
diff --git a/include/obj/NiVertexColorProperty.h b/include/obj/NiVertexColorProperty.h
index fb0ee1dd..7470f4b5 100644
--- a/include/obj/NiVertexColorProperty.h
+++ b/include/obj/NiVertexColorProperty.h
@@ -36,14 +36,41 @@ public:
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
-   NIFLIB_API unsigned short GetFlags() const;
-   NIFLIB_API void SetFlags(unsigned short value);
+	/*!
+	 * Can be used to get the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \return The flag data.
+	 */
+	NIFLIB_API unsigned short GetFlags() const;
 
-   NIFLIB_API VertMode GetVertexMode() const;
-   NIFLIB_API void SetVertexMode(VertMode value);
+	/*!
+	 * Can be used to set the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \param[in] value The new flag data.  Will overwrite any existing flag data.
+	 */
+	NIFLIB_API void SetFlags(unsigned short value);
 
-   NIFLIB_API LightMode GetLightingMode() const;
-   NIFLIB_API void SetLightingMode(LightMode value);
+	/*!
+	 * Gets the current vertex mode.  This seems to specify how to apply vertex colors.
+	 * \return The current vertex mode.
+	 */
+	NIFLIB_API VertMode GetVertexMode() const;
+
+	/*!
+	 * Sets the vertex mode.  This seems to specify how to apply vertex colors.
+	 * \param[in] value The new vertex mode.
+	 */
+	NIFLIB_API void SetVertexMode(VertMode value);
+
+	/*!
+	 * Gets the current lighting mode.  This seems to specify how vertex colors influence lighting.
+	 * \return The current lighting mode.
+	 */
+	NIFLIB_API LightMode GetLightingMode() const;
+
+	/*!
+	 * Sets the lighting mode.  This seems to specify how vertex colors influence lighting.
+	 * \param[in] value The new lighting mode.
+	 */
+	NIFLIB_API void SetLightingMode(LightMode value);
 
 protected:
 	NI_VERTEX_COLOR_PROPERTY_MEMBERS
diff --git a/include/obj/NiWireframeProperty.h b/include/obj/NiWireframeProperty.h
index dcd70620..20c2d0f2 100644
--- a/include/obj/NiWireframeProperty.h
+++ b/include/obj/NiWireframeProperty.h
@@ -33,9 +33,19 @@ public:
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
+	/*!
+	 * Can be used to get the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \return The flag data.
+	 */
 	NIFLIB_API unsigned short GetFlags() const;
+
+	/*!
+	 * Can be used to set the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \param[in] n The new flag data.  Will overwrite any existing flag data.
+	 */
 	NIFLIB_API void SetFlags( unsigned short n );
 
+
 protected:
 	NI_WIREFRAME_PROPERTY_MEMBERS
 private:
diff --git a/include/obj/NiZBufferProperty.h b/include/obj/NiZBufferProperty.h
index 38619733..f72db174 100644
--- a/include/obj/NiZBufferProperty.h
+++ b/include/obj/NiZBufferProperty.h
@@ -34,11 +34,29 @@ public:
 	NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, const NifInfo & info );
 	NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
 
+	/*!
+	 * Can be used to get the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \return The flag data.
+	 */
 	NIFLIB_API unsigned short GetFlags() const;
-	NIFLIB_API void SetFlags(unsigned short value);
 
-	NIFLIB_API CompareMode GetFunction() const;
-	NIFLIB_API void SetFunction(CompareMode value);
+	/*!
+	 * Can be used to set the data stored in the flags field for this object.  It is usually better to call more specific flag-toggle functions if they are availiable.
+	 * \param[in] value The new flag data.  Will overwrite any existing flag data.
+	 */
+	NIFLIB_API void SetFlags( unsigned short value );
+
+	/*!
+	 * Used to get the current depth buffer (Z-Buffer) test function, which determine whether a pixel is drawn based on the value of the depth buffer at the same location.
+	 * \return The current depth buffer test function.
+	 */
+	NIFLIB_API CompareMode GetDepthFunction() const;
+
+	/*!
+	 * Used to set the depth buffer (Z-Buffer) test function, which determine whether a pixel is drawn based on the value of the depth buffer at the same location.
+	 * \param[in] value The new depth buffer test function.
+	 */
+	NIFLIB_API void SetDepthFunction(CompareMode value);
 
 protected:
 	NI_Z_BUFFER_PROPERTY_MEMBERS
diff --git a/src/obj/NiAlphaProperty.cpp b/src/obj/NiAlphaProperty.cpp
index d7c35ec0..5d7bc1a8 100644
--- a/src/obj/NiAlphaProperty.cpp
+++ b/src/obj/NiAlphaProperty.cpp
@@ -43,11 +43,11 @@ void NiAlphaProperty::SetFlags( unsigned short n ) {
 	flags = n;
 }
 
-byte NiAlphaProperty::GetAlphaTestThreshold() const {
+byte NiAlphaProperty::GetTestThreshold() const {
 	return threshold;
 }
 
-void NiAlphaProperty::SetAlphaTestThreshold( byte n ) {
+void NiAlphaProperty::SetTestThreshold( byte n ) {
 	threshold = n;
 }
 
@@ -57,50 +57,50 @@ void NiAlphaProperty::SetAlphaTestThreshold( byte n ) {
 #define NIFLIB_MASK_FLAG(flag, value, shift, mask) \
    ((flag & ~(mask << shift)) | ((value & mask) << shift))
 
-NiAlphaProperty::BlendMode NiAlphaProperty::GetSourceBlendMode() const {
-   return (NiAlphaProperty::BlendMode)NIFLIB_GET_FLAG(flags, 1, 0x0f);
+NiAlphaProperty::BlendFunc NiAlphaProperty::GetSourceBlendFunc() const {
+   return (NiAlphaProperty::BlendFunc)NIFLIB_GET_FLAG(flags, 1, 0x0f);
 }
 
-void NiAlphaProperty::SetSourceBlendMode(BlendMode value) {
+void NiAlphaProperty::SetSourceBlendFunc(BlendFunc value) {
    flags = NIFLIB_MASK_FLAG(flags, value, 1, 0x0f);
 }
 
-NiAlphaProperty::BlendMode NiAlphaProperty::GetDestBlendMode() const {
-   return (NiAlphaProperty::BlendMode)(( flags >> 5 ) & 0x0f);
+NiAlphaProperty::BlendFunc NiAlphaProperty::GetDestBlendFunc() const {
+   return (NiAlphaProperty::BlendFunc)(( flags >> 5 ) & 0x0f);
 }
 
-void NiAlphaProperty::SetDestBlendMode(BlendMode value) {
+void NiAlphaProperty::SetDestBlendFunc(BlendFunc value) {
    flags = NIFLIB_MASK_FLAG(flags, value, 5, 0x0f);
 }
 
-NiAlphaProperty::TestMode NiAlphaProperty::GetTestMode() const {
-   return (NiAlphaProperty::TestMode)NIFLIB_GET_FLAG(flags, 10, 0x7);
+NiAlphaProperty::TestFunc NiAlphaProperty::GetTestFunc() const {
+   return (NiAlphaProperty::TestFunc)NIFLIB_GET_FLAG(flags, 10, 0x7);
 }
 
-void NiAlphaProperty::SetTestMode(TestMode value) {
+void NiAlphaProperty::SetTestFunc(TestFunc value) {
    flags = NIFLIB_MASK_FLAG(flags, value, 10, 0x7);
 }
 
-bool NiAlphaProperty::GetAlphaBlend() const {
+bool NiAlphaProperty::GetBlendState() const {
    return NIFLIB_GET_FLAG(flags, 0, 0x1) ? true : false;
 }
 
-void NiAlphaProperty::SetAlphaBlend(bool value) {
+void NiAlphaProperty::SetBlendState(bool value) {
    flags = NIFLIB_MASK_FLAG(flags, value?1:0, 0, 0x1);
 }
 
-bool NiAlphaProperty::GetAlphaTest() const {
+bool NiAlphaProperty::GetTestState() const {
    return NIFLIB_GET_FLAG(flags, 9, 0x1) ? true : false;
 }
 
-void NiAlphaProperty::SetAlphaTest(bool value) {
+void NiAlphaProperty::SetTestState(bool value) {
    flags = NIFLIB_MASK_FLAG(flags, value?1:0, 9, 0x1);
 }
 
-bool NiAlphaProperty::GetAlphaSort() const {
+bool NiAlphaProperty::GetTriangleSortMode() const {
    return NIFLIB_GET_FLAG(flags, 13, 0x1) ? false : true;
 }
-void NiAlphaProperty::SetAlphaSort(bool value) {
+void NiAlphaProperty::SetTriangleSortMode(bool value) {
    flags = NIFLIB_MASK_FLAG(flags, value?0:1, 13, 0x1);
 }
 
diff --git a/src/obj/NiSourceTexture.cpp b/src/obj/NiSourceTexture.cpp
index ddf2773d..2f0cd858 100644
--- a/src/obj/NiSourceTexture.cpp
+++ b/src/obj/NiSourceTexture.cpp
@@ -37,47 +37,38 @@ const Type & NiSourceTexture::GetType() const {
 	return TYPE;
 };
 
-bool NiSourceTexture::IsTextureExternal () {
+bool NiSourceTexture::IsTextureExternal() const {
 	return ( useExternal != 0 );
 }
 
-void NiSourceTexture::SetExternalTexture( string file_name, const Ref<NiObject> & unk_link ) {
+void NiSourceTexture::SetExternalTexture( string file_name ) {
 	useExternal = 1;
 	pixelData = NULL;
 	this->originalFileName_.clear();
 
 	fileName = file_name;
-	unknownLink = unk_link;
+	unknownLink = NULL;
 }
 
-
-void NiSourceTexture::SetInternalTexture( byte unk_byte, string original_file_name, const Ref<NiPixelData> & pixel_data ) {
+void NiSourceTexture::SetInternalTexture( string original_file_name, NiPixelData * pixel_data ) {
 	useExternal = 0;
 	fileName.clear();
 	
 	//TODO: Fix name problem with Unknown Byte in XML
-	unknownByte = unk_byte;
+	unknownByte = 0;
 	originalFileName_ = original_file_name;
 	pixelData = pixel_data;
 }
 
-string NiSourceTexture::GetExternalFileName() const {
-	return fileName;
-}
-
-Ref<NiObject> NiSourceTexture::GetExternalUnknownLink() const {
-	return unknownLink;
-}
-
-byte NiSourceTexture::GetInternalUnknownByte() const {
-	return unknownByte;
-}
-
-string NiSourceTexture::GetInternalOriginalFileName() const {
-	return originalFileName_;
+string NiSourceTexture::GetTextureFileName() const {
+	if ( IsTextureExternal() ) {
+		return fileName;
+	} else {
+		return originalFileName_;
+	}
 }
 
-Ref<NiPixelData> NiSourceTexture::GetInternalPixelData() const {
+Ref<NiPixelData> NiSourceTexture::GetPixelData() const {
 	return pixelData;
 }
 
@@ -105,13 +96,6 @@ void NiSourceTexture::SetAlphaFormat( AlphaFormat n ) {
 	alphaFormat = n;
 }
 
-//TODO: Fix name problem with Unknown Byte in XML
-//byte NiSourceTexture::GetUnknownByte2() const;
-//SNiSourceTexture::etUnknownByte2( byte n );
-//
-//byte NiSourceTexture::GetUnknownByte3() const;
-//NiSourceTexture::SetUnknownByte3( byte n );
-
 const Type & NiSourceTexture::TypeConst() {
 	return TYPE;
 }
diff --git a/src/obj/NiStencilProperty.cpp b/src/obj/NiStencilProperty.cpp
index 08b968cf..86c53e46 100644
--- a/src/obj/NiStencilProperty.cpp
+++ b/src/obj/NiStencilProperty.cpp
@@ -43,11 +43,11 @@ void NiStencilProperty::SetFlags(unsigned short value) {
    flags = value;
 }
 
-bool NiStencilProperty::GetStencilEnabled() const {
+bool NiStencilProperty::GetStencilState() const {
    return (stencilEnabled != 0);
 }
 
-void NiStencilProperty::SetStencilEnabled(bool value) {
+void NiStencilProperty::SetStencilState(bool value) {
    stencilEnabled = value;
 }
 
@@ -99,11 +99,11 @@ void NiStencilProperty::SetPassAction(StencilAction value) {
    passAction = value;
 }
 
-FaceDrawMode NiStencilProperty::GetDrawMode() const {
+FaceDrawMode NiStencilProperty::GetFaceDrawMode() const {
    return drawMode;
 }
 
-void NiStencilProperty::SetDrawMode(FaceDrawMode value) {
+void NiStencilProperty::SetFaceDrawMode(FaceDrawMode value) {
    drawMode = value;
 }
 
diff --git a/src/obj/NiZBufferProperty.cpp b/src/obj/NiZBufferProperty.cpp
index ee4fe422..700e294d 100644
--- a/src/obj/NiZBufferProperty.cpp
+++ b/src/obj/NiZBufferProperty.cpp
@@ -43,11 +43,11 @@ void NiZBufferProperty::SetFlags(unsigned short value) {
    flags = value;
 }
 
-CompareMode NiZBufferProperty::GetFunction() const {
+CompareMode NiZBufferProperty::GetDepthFunction() const {
    return function;
 }
 
-void NiZBufferProperty::SetFunction(CompareMode value) {
+void NiZBufferProperty::SetDepthFunction(CompareMode value) {
    function = value;
 }
 
-- 
GitLab