From dc35c1ccda242b5472b96c5fbee2c3a524cd6b5f Mon Sep 17 00:00:00 2001
From: Alecu100 <lui_alecu@yahoo.co.uk>
Date: Thu, 12 Jan 2012 13:19:50 +0200
Subject: [PATCH] Fixed some small issues and now niflib compiles again

---
 include/obj/NiBSplineData.h                  | 24 +++++++++++++
 include/obj/NiBSplineTransformInterpolator.h | 36 ++++++++++++++++++++
 src/obj/NiBSplineData.cpp                    |  2 +-
 3 files changed, 61 insertions(+), 1 deletion(-)

diff --git a/include/obj/NiBSplineData.h b/include/obj/NiBSplineData.h
index 906f2e2a..3372eeba 100644
--- a/include/obj/NiBSplineData.h
+++ b/include/obj/NiBSplineData.h
@@ -60,6 +60,18 @@ public:
 	 */
 	NIFLIB_API vector<float> GetFloatControlPoints() const;
 
+	/*!
+	* Sets the float control points representing the spline data
+	* \param[in] The new float control points to replace the current ones
+	*/
+	NIFLIB_API void SetFloatControlPoints(vector<float> value);
+
+	/*!
+	* Adds float control points at the end of the float control points collection 
+	* \param[in] The float points to add at the end of the collection
+	*/
+	NIFLIB_API void AppendFloatControlPoints(vector<float> value);
+
 	/*!
 	 * Get Range of signed shorts representing the data scaled by SHRT_MAX.
 	 * \param[in] offset The start of the range.
@@ -74,6 +86,18 @@ public:
 	 */
 	NIFLIB_API vector<short> GetShortControlPoints() const;
 
+	/*!
+	* Sets the short control points representing the spline data
+	* \param[in] The new short control points to replace the current ones
+	*/
+	NIFLIB_API void SetShortControlPoints(vector<short> value);
+
+	/*!
+	* Adds short control points at the end of the short control points collection 
+	* \param[in] The short points to add at the end of the collection
+	*/
+	NIFLIB_API void AppendShortControlPoints(vector<short> value);
+
 	/*!
 	 * Get Range of signed shorts representing the data scaled by SHRT_MAX.
 	 * \param[in] offset The start of the range.
diff --git a/include/obj/NiBSplineTransformInterpolator.h b/include/obj/NiBSplineTransformInterpolator.h
index 4c1a3f13..b255e9d5 100644
--- a/include/obj/NiBSplineTransformInterpolator.h
+++ b/include/obj/NiBSplineTransformInterpolator.h
@@ -66,6 +66,18 @@ public:
 	*/
 	NIFLIB_API void SetTranslation( Vector3 value );
 
+	/*!
+	* Gets the translation offset for the control points in the NiSplineData
+	* \return The translation offset
+	*/
+	NIFLIB_API int GetTranslationOffset();
+
+	/*!
+	* Sets the translation offset for the control points in the NiSplineData
+	* \param[in] The new translation offset
+	*/
+	NIFLIB_API void SetTranslationOffset( int value );
+
 	/*!
 	* Gets the base rotation when a translate curve is not defined.
 	* \return The base rotation.
@@ -78,6 +90,18 @@ public:
 	*/
 	NIFLIB_API void SetRotation( Quaternion value );
 
+	/*!
+	* Gets the rotation offset for the control points in the NiSplineData
+	* \return The rotation offset
+	*/
+	NIFLIB_API int GetRotationOffset();
+
+	/*!
+	* Sets the rotation offset for the control points in the NiSplineData
+	* \param[in] The new rotation offset
+	*/
+	NIFLIB_API void SetRotationOffset( int value );
+
 	/*!
 	* Gets the base scale when a translate curve is not defined.
 	* \return The base scale.
@@ -90,6 +114,18 @@ public:
 	*/
 	NIFLIB_API void SetScale( float value );
 
+	/*!
+	* Gets the scale offset for the control points in the NiSplineData
+	* \return The scale offset
+	*/
+	NIFLIB_API int GetScaleOffset();
+
+	/*!
+	* Sets the scale offset for the control points in the NiSplineData
+	* \param[in] The new scale offset
+	*/
+	NIFLIB_API void SetScaleOffset( int value );
+
 
 	/*!
 	* Retrieves the control quaternion rotation data.
diff --git a/src/obj/NiBSplineData.cpp b/src/obj/NiBSplineData.cpp
index 21aa5e55..bd114438 100644
--- a/src/obj/NiBSplineData.cpp
+++ b/src/obj/NiBSplineData.cpp
@@ -190,7 +190,7 @@ void NiBSplineData::SetShortControlPoints( vector<short> value )
 	this->numShortControlPoints = value.size();
 
 	for(int i = 0; i < value.size(); i++) {
-		this->shortControlPoints.push_back(value);
+		this->shortControlPoints.push_back(value[i]);
 	}
 }
 
-- 
GitLab