From 1940cd62540cab151e44799d194a9cb1fb0a4981 Mon Sep 17 00:00:00 2001
From: Amorilia <amorilia@users.sourceforge.net>
Date: Tue, 14 Sep 2010 15:00:39 +0100
Subject: [PATCH] GetTexture() now returns a TexDesc reference (requested by
 DragoonWraith).

---
 change_log.txt                    | 5 ++++-
 include/obj/NiTexturingProperty.h | 2 +-
 src/obj/NiTexturingProperty.cpp   | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/change_log.txt b/change_log.txt
index ceae0eea..dbb13388 100644
--- a/change_log.txt
+++ b/change_log.txt
@@ -636,4 +636,7 @@
 
  * AsQuaternion is now a const member function (contributed by Dragongeo2).
  * Some math operators for TexCoord and Color4 (contributed by Dragongeo2).
-
+ * Make base_type field public (requested by DragoonWraith).
+ * Store block number in NiObject when reading a nif file (requested by DragoonWraith).
+ * Added cmake build script.
+ * GetTexture() now returns a TexDesc reference (requested by DragoonWraith).
diff --git a/include/obj/NiTexturingProperty.h b/include/obj/NiTexturingProperty.h
index b3466bd9..cff20038 100644
--- a/include/obj/NiTexturingProperty.h
+++ b/include/obj/NiTexturingProperty.h
@@ -105,7 +105,7 @@ public:
 	 * \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;
+	NIFLIB_API TexDesc & GetTexture( int n );
 
 	/*! 
 	 * Checks whether a particular texture type is being used
diff --git a/src/obj/NiTexturingProperty.cpp b/src/obj/NiTexturingProperty.cpp
index 3b4c8606..f3528550 100644
--- a/src/obj/NiTexturingProperty.cpp
+++ b/src/obj/NiTexturingProperty.cpp
@@ -1517,7 +1517,7 @@ int NiTexturingProperty::GetShaderTextureCount() const {
 	return int(shaderTextures.size());
 }
 
-TexDesc NiTexturingProperty::GetTexture( int n ) const {
+TexDesc & NiTexturingProperty::GetTexture( int n ) {
 	//TODO:  Create a built in type for this array of textures so it can be a real array again?
 	//Copy the values to the right texture
 	switch (n) {
-- 
GitLab