Browse Source

Removed some more useless stuff

Marko Pintera 13 years ago
parent
commit
9a5afbda41

+ 0 - 2
CamelotRenderer/CamelotRenderer.vcxproj

@@ -98,7 +98,6 @@
     <ClInclude Include="CmBitwise.h" />
     <ClInclude Include="CmBitwise.h" />
     <ClInclude Include="CmBlendMode.h" />
     <ClInclude Include="CmBlendMode.h" />
     <ClInclude Include="CmCamera.h" />
     <ClInclude Include="CmCamera.h" />
-    <ClInclude Include="CmColourValue.h" />
     <ClInclude Include="CmCommon.h" />
     <ClInclude Include="CmCommon.h" />
     <ClInclude Include="CmConfigOptionMap.h" />
     <ClInclude Include="CmConfigOptionMap.h" />
     <ClInclude Include="CmD3D9Device.h" />
     <ClInclude Include="CmD3D9Device.h" />
@@ -205,7 +204,6 @@
     <ClCompile Include="CmD3D9RenderSystemFactory.cpp" />
     <ClCompile Include="CmD3D9RenderSystemFactory.cpp" />
     <ClCompile Include="CmRenderSystemManager.cpp" />
     <ClCompile Include="CmRenderSystemManager.cpp" />
     <ClCompile Include="CmCamera.cpp" />
     <ClCompile Include="CmCamera.cpp" />
-    <ClCompile Include="CmColourValue.cpp" />
     <ClCompile Include="CmD3D9Device.cpp" />
     <ClCompile Include="CmD3D9Device.cpp" />
     <ClCompile Include="CmD3D9DeviceManager.cpp" />
     <ClCompile Include="CmD3D9DeviceManager.cpp" />
     <ClCompile Include="CmD3D9Driver.cpp" />
     <ClCompile Include="CmD3D9Driver.cpp" />

+ 0 - 6
CamelotRenderer/CamelotRenderer.vcxproj.filters

@@ -362,9 +362,6 @@
     <ClInclude Include="CmBlendMode.h">
     <ClInclude Include="CmBlendMode.h">
       <Filter>Header Files\Utility</Filter>
       <Filter>Header Files\Utility</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="CmColourValue.h">
-      <Filter>Header Files\Utility</Filter>
-    </ClInclude>
     <ClInclude Include="CmCommon.h">
     <ClInclude Include="CmCommon.h">
       <Filter>Header Files\Utility</Filter>
       <Filter>Header Files\Utility</Filter>
     </ClInclude>
     </ClInclude>
@@ -643,9 +640,6 @@
     <ClCompile Include="RenderSystemGL\Source\CmWin32Window.cpp">
     <ClCompile Include="RenderSystemGL\Source\CmWin32Window.cpp">
       <Filter>RenderSystemGL\Source Files</Filter>
       <Filter>RenderSystemGL\Source Files</Filter>
     </ClCompile>
     </ClCompile>
-    <ClCompile Include="CmColourValue.cpp">
-      <Filter>Source Files\Utility</Filter>
-    </ClCompile>
     <ClCompile Include="CmPixelFormat.cpp">
     <ClCompile Include="CmPixelFormat.cpp">
       <Filter>Source Files\Utility</Filter>
       <Filter>Source Files\Utility</Filter>
     </ClCompile>
     </ClCompile>

+ 2 - 2
CamelotRenderer/CmBitwise.h

@@ -176,7 +176,7 @@ namespace CamelotEngine {
                     ((UINT16*)dest)[0] = (UINT16)value;
                     ((UINT16*)dest)[0] = (UINT16)value;
                     break;
                     break;
                 case 3:
                 case 3:
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG      
+#if CM_ENDIAN == CM_ENDIAN_BIG      
                     ((UINT8*)dest)[0] = (UINT8)((value >> 16) & 0xFF);
                     ((UINT8*)dest)[0] = (UINT8)((value >> 16) & 0xFF);
                     ((UINT8*)dest)[1] = (UINT8)((value >> 8) & 0xFF);
                     ((UINT8*)dest)[1] = (UINT8)((value >> 8) & 0xFF);
                     ((UINT8*)dest)[2] = (UINT8)(value & 0xFF);
                     ((UINT8*)dest)[2] = (UINT8)(value & 0xFF);
@@ -201,7 +201,7 @@ namespace CamelotEngine {
                 case 2:
                 case 2:
                     return ((UINT16*)src)[0];
                     return ((UINT16*)src)[0];
                 case 3:
                 case 3:
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG      
+#if CM_ENDIAN == CM_ENDIAN_BIG      
                     return ((UINT32)((UINT8*)src)[0]<<16)|
                     return ((UINT32)((UINT8*)src)[0]<<16)|
                             ((UINT32)((UINT8*)src)[1]<<8)|
                             ((UINT32)((UINT8*)src)[1]<<8)|
                             ((UINT32)((UINT8*)src)[2]);
                             ((UINT32)((UINT8*)src)[2]);

+ 62 - 640
CamelotRenderer/CmCommon.h

@@ -50,16 +50,6 @@ namespace CamelotEngine {
 	*  @{
 	*  @{
 	*/
 	*/
 
 
-	/// Fast general hashing algorithm
-	UINT32 CM_EXPORT FastHash (const char * data, int len, UINT32 hashSoFar = 0);
-	/// Combine hashes with same style as boost::hash_combine
-	template <typename T>
-	UINT32 HashCombine (UINT32 hashSoFar, const T& data)
-	{
-		return FastHash((const char*)&data, sizeof(T), hashSoFar);
-	}
-
-
     /** Comparison functions used for the depth/stencil buffer operations and 
     /** Comparison functions used for the depth/stencil buffer operations and 
 		others. */
 		others. */
     enum CompareFunction
     enum CompareFunction
@@ -143,39 +133,6 @@ namespace CamelotEngine {
         CULL_ANTICLOCKWISE = 3
         CULL_ANTICLOCKWISE = 3
     };
     };
 
 
-    /** Manual culling modes based on vertex normals.
-        This setting applies to how the software culls triangles before sending them to the 
-		hardware API. This culling mode is used by scene managers which choose to implement it -
-		normally those which deal with large amounts of fixed world geometry which is often 
-		planar (software culling movable variable geometry is expensive). */
-    enum ManualCullingMode
-    {
-        /// No culling so everything is sent to the hardware.
-        MANUAL_CULL_NONE = 1,
-        /// Cull triangles whose normal is pointing away from the camera (default).
-        MANUAL_CULL_BACK = 2,
-        /// Cull triangles whose normal is pointing towards the camera.
-        MANUAL_CULL_FRONT = 3
-    };
-
-    /** Enumerates the wave types usable with the Ogre engine. */
-    enum WaveformType
-    {
-        /// Standard sine wave which smoothly changes from low to high and back again.
-        WFT_SINE,
-        /// An angular wave with a constant increase / decrease speed with pointed peaks.
-        WFT_TRIANGLE,
-        /// Half of the time is spent at the min, half at the max with instant transition between.
-        WFT_SQUARE,
-        /// Gradual steady increase from min to max over the period with an instant return to min at the end.
-        WFT_SAWTOOTH,
-        /// Gradual steady decrease from max to min over the period, with an instant return to max at the end.
-        WFT_INVERSE_SAWTOOTH,
-		/// Pulse Width Modulation. Works like WFT_SQUARE, except the high to low transition is controlled by duty cycle. 
-		/// With a duty cycle of 50% (0.5) will give the same output as WFT_SQUARE.
-		WFT_PWM
-    };
-
     /** The polygon mode to use when rasterising. */
     /** The polygon mode to use when rasterising. */
     enum PolygonMode
     enum PolygonMode
     {
     {
@@ -187,92 +144,6 @@ namespace CamelotEngine {
         PM_SOLID = 3
         PM_SOLID = 3
     };
     };
 
 
-    /** An enumeration of broad shadow techniques */
-    enum ShadowTechnique
-    {
-        /** No shadows */
-        SHADOWTYPE_NONE = 0x00,
-		/** Mask for additive shadows (not for direct use, use  SHADOWTYPE_ enum instead)
-		*/
-		SHADOWDETAILTYPE_ADDITIVE = 0x01,
-		/** Mask for modulative shadows (not for direct use, use  SHADOWTYPE_ enum instead)
-		*/
-		SHADOWDETAILTYPE_MODULATIVE = 0x02,
-		/** Mask for integrated shadows (not for direct use, use SHADOWTYPE_ enum instead)
-		*/
-		SHADOWDETAILTYPE_INTEGRATED = 0x04,
-		/** Mask for stencil shadows (not for direct use, use  SHADOWTYPE_ enum instead)
-		*/
-		SHADOWDETAILTYPE_STENCIL = 0x10,
-		/** Mask for texture shadows (not for direct use, use  SHADOWTYPE_ enum instead)
-		*/
-		SHADOWDETAILTYPE_TEXTURE = 0x20,
-		
-        /** Stencil shadow technique which renders all shadow volumes as
-            a modulation after all the non-transparent areas have been 
-            rendered. This technique is considerably less fillrate intensive 
-            than the additive stencil shadow approach when there are multiple
-            lights, but is not an accurate model. 
-        */
-        SHADOWTYPE_STENCIL_MODULATIVE = 0x12,
-        /** Stencil shadow technique which renders each light as a separate
-            additive pass to the scene. This technique can be very fillrate
-            intensive because it requires at least 2 passes of the entire
-            scene, more if there are multiple lights. However, it is a more
-            accurate model than the modulative stencil approach and this is
-            especially apparent when using coloured lights or bump mapping.
-        */
-        SHADOWTYPE_STENCIL_ADDITIVE = 0x11,
-        /** Texture-based shadow technique which involves a monochrome render-to-texture
-            of the shadow caster and a projection of that texture onto the 
-            shadow receivers as a modulative pass. 
-        */
-        SHADOWTYPE_TEXTURE_MODULATIVE = 0x22,
-		
-        /** Texture-based shadow technique which involves a render-to-texture
-            of the shadow caster and a projection of that texture onto the 
-            shadow receivers, built up per light as additive passes. 
-			This technique can be very fillrate intensive because it requires numLights + 2 
-			passes of the entire scene. However, it is a more accurate model than the 
-			modulative approach and this is especially apparent when using coloured lights 
-			or bump mapping.
-        */
-        SHADOWTYPE_TEXTURE_ADDITIVE = 0x21,
-
-		/** Texture-based shadow technique which involves a render-to-texture
-		of the shadow caster and a projection of that texture on to the shadow
-		receivers, with the usage of those shadow textures completely controlled
-		by the materials of the receivers.
-		This technique is easily the most flexible of all techniques because 
-		the material author is in complete control over how the shadows are
-		combined with regular rendering. It can perform shadows as accurately
-		as SHADOWTYPE_TEXTURE_ADDITIVE but more efficiently because it requires
-		less passes. However it also requires more expertise to use, and 
-		in almost all cases, shader capable hardware to really use to the full.
-		@note The 'additive' part of this mode means that the colour of
-		the rendered shadow texture is by default plain black. It does
-		not mean it does the adding on your receivers automatically though, how you
-		use that result is up to you.
-		*/
-		SHADOWTYPE_TEXTURE_ADDITIVE_INTEGRATED = 0x25,
-		/** Texture-based shadow technique which involves a render-to-texture
-			of the shadow caster and a projection of that texture on to the shadow
-			receivers, with the usage of those shadow textures completely controlled
-			by the materials of the receivers.
-			This technique is easily the most flexible of all techniques because 
-			the material author is in complete control over how the shadows are
-			combined with regular rendering. It can perform shadows as accurately
-			as SHADOWTYPE_TEXTURE_ADDITIVE but more efficiently because it requires
-			less passes. However it also requires more expertise to use, and 
-			in almost all cases, shader capable hardware to really use to the full.
-			@note The 'modulative' part of this mode means that the colour of
-			the rendered shadow texture is by default the 'shadow colour'. It does
-			not mean it modulates on your receivers automatically though, how you
-			use that result is up to you.
-		*/
-		SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED = 0x26
-    };
-
     /** An enumeration describing which material properties should track the vertex colours */
     /** An enumeration describing which material properties should track the vertex colours */
     typedef int TrackVertexColourType;
     typedef int TrackVertexColourType;
     enum TrackVertexColourEnum {
     enum TrackVertexColourEnum {
@@ -299,427 +170,77 @@ namespace CamelotEngine {
         FBT_STENCIL = 0x4
         FBT_STENCIL = 0x4
     };
     };
     
     
-	
-	/** A hashed vector.
-	*/
-	template <typename T>
-	class HashedVector
-	{
-	public:
-		typedef std::vector<T> VectorImpl;
-	protected:
-		VectorImpl mList;
-		mutable UINT32 mListHash;
-		mutable bool mListHashDirty;
-
-		void addToHash(const T& newPtr) const
-		{
-			mListHash = FastHash((const char*)&newPtr, sizeof(T), mListHash);
-		}
-		void recalcHash() const
-		{
-			mListHash = 0;
-			for (const_iterator i = mList.begin(); i != mList.end(); ++i)
-				addToHash(*i);
-			mListHashDirty = false;
-			
-		}
-
-	public:
-		typedef typename VectorImpl::value_type value_type;
-		typedef typename VectorImpl::pointer pointer;
-		typedef typename VectorImpl::reference reference;
-		typedef typename VectorImpl::const_reference const_reference;
-		typedef typename VectorImpl::size_type size_type;
-		typedef typename VectorImpl::difference_type difference_type;
-		typedef typename VectorImpl::iterator iterator;
-		typedef typename VectorImpl::const_iterator const_iterator;
-		typedef typename VectorImpl::reverse_iterator reverse_iterator;
-		typedef typename VectorImpl::const_reverse_iterator const_reverse_iterator;
-
-		void dirtyHash()
-		{
-			mListHashDirty = true;
-		}
-		bool isHashDirty() const
-		{
-			return mListHashDirty;
-		}
-
-		iterator begin() 
-		{ 
-			// we have to assume that hash needs recalculating on non-const
-			dirtyHash();
-			return mList.begin(); 
-		}
-		iterator end() { return mList.end(); }
-		const_iterator begin() const { return mList.begin(); }
-		const_iterator end() const { return mList.end(); }
-		reverse_iterator rbegin() 
-		{ 
-			// we have to assume that hash needs recalculating on non-const
-			dirtyHash();
-			return mList.rbegin(); 
-		}
-		reverse_iterator rend() { return mList.rend(); }
-		const_reverse_iterator rbegin() const { return mList.rbegin(); }
-		const_reverse_iterator rend() const { return mList.rend(); }
-		size_type size() const { return mList.size(); }
-		size_type max_size() const { return mList.max_size(); }
-		size_type capacity() const { return mList.capacity(); }
-		bool empty() const { return mList.empty(); }
-		reference operator[](size_type n) 
-		{ 
-			// we have to assume that hash needs recalculating on non-const
-			dirtyHash();
-			return mList[n]; 
-		}
-		const_reference operator[](size_type n) const { return mList[n]; }
-		reference at(size_type n) 
-		{ 
-			// we have to assume that hash needs recalculating on non-const
-			dirtyHash();
-			return mList.const_iterator(n); 
-		}
-		const_reference at(size_type n) const { return mList.at(n); }
-		HashedVector() : mListHash(0), mListHashDirty(false) {}
-		HashedVector(size_type n) : mList(n), mListHash(0), mListHashDirty(n > 0) {}
-		HashedVector(size_type n, const T& t) : mList(n, t), mListHash(0), mListHashDirty(n > 0) {}
-		HashedVector(const HashedVector<T>& rhs) 
-			: mList(rhs.mList), mListHash(rhs.mListHash), mListHashDirty(rhs.mListHashDirty) {}
-
-		template <class InputIterator>
-		HashedVector(InputIterator a, InputIterator b)
-			: mList(a, b), mListHashDirty(false)
-		{
-			dirtyHash();
-		}
-
-		~HashedVector() {}
-		HashedVector<T>& operator=(const HashedVector<T>& rhs)
-		{
-			mList = rhs.mList;
-			mListHash = rhs.mListHash;
-			mListHashDirty = rhs.mListHashDirty;
-			return *this;
-		}
-
-		void reserve(size_t t) { mList.reserve(t); }
-		reference front() 
-		{ 
-			// we have to assume that hash needs recalculating on non-const
-			dirtyHash();
-			return mList.front(); 
-		}
-		const_reference front() const { return mList.front(); }
-		reference back()  
-		{ 
-			// we have to assume that hash needs recalculating on non-const
-			dirtyHash();
-			return mList.back(); 
-		}
-		const_reference back() const { return mList.back(); }
-		void push_back(const T& t)
-		{ 
-			mList.push_back(t);
-			// Quick progressive hash add
-			if (!isHashDirty())
-				addToHash(t);
-		}
-		void pop_back()
-		{
-			mList.pop_back();
-			dirtyHash();
-		}
-		void swap(HashedVector<T>& rhs)
-		{
-			mList.swap(rhs.mList);
-			dirtyHash();
-		}
-		iterator insert(iterator pos, const T& t)
-		{
-			bool recalc = (pos != end());
-			iterator ret = mList.insert(pos, t);
-			if (recalc)
-				dirtyHash();
-			else
-				addToHash(t);
-			return ret;
-		}
-
-		template <class InputIterator>
-		void insert(iterator pos,
-			InputIterator f, InputIterator l)
-		{
-			mList.insert(pos, f, l);
-			dirtyHash();
-		}
-
-		void insert(iterator pos, size_type n, const T& x)
-		{
-			mList.insert(pos, n, x);
-			dirtyHash();
-		}
-
-		iterator erase(iterator pos)
-		{
-			iterator ret = mList.erase(pos);
-			dirtyHash();
-			return ret;
-		}
-		iterator erase(iterator first, iterator last)
-		{
-			iterator ret = mList.erase(first, last);
-			dirtyHash();
-			return ret;
-		}
-		void clear()
-		{
-			mList.clear();
-			mListHash = 0;
-			mListHashDirty = false;
-		}
-
-		void resize(size_type n, const T& t = T())
-		{
-			bool recalc = false;
-			if (n != size())
-				recalc = true;
-
-			mList.resize(n, t);
-			if (recalc)
-				dirtyHash();
-		}
-
-		bool operator==(const HashedVector<T>& b)
-		{ return mListHash == b.mListHash; }
-
-		bool operator<(const HashedVector<T>& b)
-		{ return mListHash < b.mListHash; }
-
-
-		/// Get the hash value
-		UINT32 getHash() const 
-		{ 
-			if (isHashDirty())
-				recalcHash();
-
-			return mListHash; 
-		}
-	public:
-
-
-
-	};
-
-	class Light;
-	typedef HashedVector<Light*> LightList;
-
-
-
-    typedef map<String, bool>::type UnaryOptionList;
-    typedef map<String, String>::type BinaryOptionList;
-
 	/// Name / value parameter pair (first = name, second = value)
 	/// Name / value parameter pair (first = name, second = value)
 	typedef map<String, String>::type NameValuePairList;
 	typedef map<String, String>::type NameValuePairList;
 
 
-    /// Alias / Texture name pair (first = alias, second = texture name)
-    typedef map<String, String>::type AliasTextureNamePairList;
-
-        template< typename T > struct TRect
+    /** Structure used to define a box in a 3-D integer space.
+        Note that the left, top, and front edges are included but the right, 
+        bottom and back ones are not.
+        */
+    struct Box
+    {
+        size_t left, top, right, bottom, front, back;
+		/// Parameterless constructor for setting the members manually
+        Box()
+			: left(0), top(0), right(1), bottom(1), front(0), back(1)
         {
         {
-          T left, top, right, bottom;
-          TRect() : left(0), top(0), right(0), bottom(0) {}
-          TRect( T const & l, T const & t, T const & r, T const & b )
-            : left( l ), top( t ), right( r ), bottom( b )
-          {
-          }
-          TRect( TRect const & o )
-            : left( o.left ), top( o.top ), right( o.right ), bottom( o.bottom )
-          {
-          }
-          TRect & operator=( TRect const & o )
-          {
-            left = o.left;
-            top = o.top;
-            right = o.right;
-            bottom = o.bottom;
-            return *this;
-          }
-          T width() const
-          {
-            return right - left;
-          }
-          T height() const
-          {
-            return bottom - top;
-          }
-		  bool isNull() const
-		  {
-			  return width() == 0 || height() == 0;
-		  }
-		  void setNull()
-		  {
-			  left = right = top = bottom = 0;
-		  }
-		  TRect & merge(const TRect& rhs)
-		  {
-			  if (isNull())
-			  {
-				  *this = rhs;
-			  }
-			  else if (!rhs.isNull())
-			  {
-				  left = std::min(left, rhs.left);
-				  right = std::max(right, rhs.right);
-				  top = std::min(top, rhs.top);
-				  bottom = std::max(bottom, rhs.bottom);
-			  }
-
-			  return *this;
-
-		  }
-		  TRect intersect(const TRect& rhs) const
-		  {
-			  TRect ret;
-			  if (isNull() || rhs.isNull())
-			  {
-				  // empty
-				  return ret;
-			  }
-			  else
-			  {
-				  ret.left = std::max(left, rhs.left);
-				  ret.right = std::min(right, rhs.right);
-				  ret.top = std::max(top, rhs.top);
-				  ret.bottom = std::min(bottom, rhs.bottom);
-			  }
-
-			  if (ret.left > ret.right || ret.top > ret.bottom)
-			  {
-				  // no intersection, return empty
-				  ret.left = ret.top = ret.right = ret.bottom = 0;
-			  }
-
-			  return ret;
-
-		  }
-
-        };
-		template<typename T>
-		std::ostream& operator<<(std::ostream& o, const TRect<T>& r)
-		{
-			o << "TRect<>(l:" << r.left << ", t:" << r.top << ", r:" << r.right << ", b:" << r.bottom << ")";
-			return o;
-		}
-
-        /** Structure used to define a rectangle in a 2-D floating point space.
+        }
+        /** Define a box from left, top, right and bottom coordinates
+            This box will have depth one (front=0 and back=1).
+            @param	l	x value of left edge
+            @param	t	y value of top edge
+            @param	r	x value of right edge
+            @param	b	y value of bottom edge
+            @note Note that the left, top, and front edges are included 
+ 		        but the right, bottom and back ones are not.
         */
         */
-        typedef TRect<float> FloatRect;
-
-		/** Structure used to define a rectangle in a 2-D floating point space, 
-			subject to double / single floating point settings.
-		*/
-		typedef TRect<float> RealRect;
-
-        /** Structure used to define a rectangle in a 2-D integer space.
+        Box( size_t l, size_t t, size_t r, size_t b ):
+            left(l),
+            top(t),   
+            right(r),
+            bottom(b),
+            front(0),
+            back(1)
+        {
+          	assert(right >= left && bottom >= top && back >= front);
+        }
+        /** Define a box from left, top, front, right, bottom and back
+            coordinates.
+            @param	l	x value of left edge
+            @param	t	y value of top edge
+            @param  ff  z value of front edge
+            @param	r	x value of right edge
+            @param	b	y value of bottom edge
+            @param  bb  z value of back edge
+            @note Note that the left, top, and front edges are included 
+ 		        but the right, bottom and back ones are not.
         */
         */
-        typedef TRect< long > Rect;
-
-        /** Structure used to define a box in a 3-D integer space.
-         	Note that the left, top, and front edges are included but the right, 
-         	bottom and back ones are not.
-         */
-        struct Box
+        Box( size_t l, size_t t, size_t ff, size_t r, size_t b, size_t bb ):
+            left(l),
+            top(t),   
+            right(r),
+            bottom(b),
+            front(ff),
+            back(bb)
         {
         {
-            size_t left, top, right, bottom, front, back;
-			/// Parameterless constructor for setting the members manually
-            Box()
-				: left(0), top(0), right(1), bottom(1), front(0), back(1)
-            {
-            }
-            /** Define a box from left, top, right and bottom coordinates
-            	This box will have depth one (front=0 and back=1).
-            	@param	l	x value of left edge
-            	@param	t	y value of top edge
-            	@param	r	x value of right edge
-            	@param	b	y value of bottom edge
-            	@note Note that the left, top, and front edges are included 
- 		           	but the right, bottom and back ones are not.
-            */
-            Box( size_t l, size_t t, size_t r, size_t b ):
-                left(l),
-                top(t),   
-                right(r),
-                bottom(b),
-                front(0),
-                back(1)
-            {
-          		assert(right >= left && bottom >= top && back >= front);
-            }
-            /** Define a box from left, top, front, right, bottom and back
-            	coordinates.
-            	@param	l	x value of left edge
-            	@param	t	y value of top edge
-            	@param  ff  z value of front edge
-            	@param	r	x value of right edge
-            	@param	b	y value of bottom edge
-            	@param  bb  z value of back edge
-            	@note Note that the left, top, and front edges are included 
- 		           	but the right, bottom and back ones are not.
-            */
-            Box( size_t l, size_t t, size_t ff, size_t r, size_t b, size_t bb ):
-                left(l),
-                top(t),   
-                right(r),
-                bottom(b),
-                front(ff),
-                back(bb)
-            {
-          		assert(right >= left && bottom >= top && back >= front);
-            }
+          	assert(right >= left && bottom >= top && back >= front);
+        }
             
             
-            /// Return true if the other box is a part of this one
-            bool contains(const Box &def) const
-            {
-            	return (def.left >= left && def.top >= top && def.front >= front &&
-					def.right <= right && def.bottom <= bottom && def.back <= back);
-            }
+        /// Return true if the other box is a part of this one
+        bool contains(const Box &def) const
+        {
+            return (def.left >= left && def.top >= top && def.front >= front &&
+				def.right <= right && def.bottom <= bottom && def.back <= back);
+        }
             
             
-            /// Get the width of this box
-            size_t getWidth() const { return right-left; }
-            /// Get the height of this box
-            size_t getHeight() const { return bottom-top; }
-            /// Get the depth of this box
-            size_t getDepth() const { return back-front; }
-        };
-
-    
-	
-	/** Locate command-line options of the unary form '-blah' and of the
-        binary form '-blah foo', passing back the index of the next non-option.
-    @param numargs, argv The standard parameters passed to the main method
-    @param unaryOptList Map of unary options (i.e. those that do not require a parameter).
-        Should be pre-populated with, for example '-e' in the key and false in the 
-        value. Options which are found will be set to true on return.
-    @param binOptList Map of binary options (i.e. those that require a parameter
-        e.g. '-e afile.txt').
-        Should be pre-populated with, for example '-e' and the default setting. 
-        Options which are found will have the value updated.
-    */
-    int CM_EXPORT findCommandLineOpts(int numargs, char** argv, UnaryOptionList& unaryOptList, 
-        BinaryOptionList& binOptList);
+        /// Get the width of this box
+        size_t getWidth() const { return right-left; }
+        /// Get the height of this box
+        size_t getHeight() const { return bottom-top; }
+        /// Get the depth of this box
+        size_t getDepth() const { return back-front; }
+    };
 
 
-	/// Generic result of clipping
-	enum ClipResult
-	{
-		/// Nothing was clipped
-		CLIPPED_NONE = 0,
-		/// Partially clipped
-		CLIPPED_SOME = 1, 
-		/// Everything was clipped away
-		CLIPPED_ALL = 2
-	};
 
 
 	/// Render window creation parameters.
 	/// Render window creation parameters.
 	struct RenderWindowDescription
 	struct RenderWindowDescription
@@ -737,106 +258,7 @@ namespace CamelotEngine {
 	/// Render window container.
 	/// Render window container.
 	typedef vector<RenderWindow*>::type RenderWindowList;
 	typedef vector<RenderWindow*>::type RenderWindowList;
 
 
-	/// Utility class to generate a sequentially numbered series of names
-	class CM_EXPORT NameGenerator
-	{
-	protected:
-		String mPrefix;
-		unsigned long long int mNext;
-		CM_AUTO_MUTEX
-	public:
-		NameGenerator(const NameGenerator& rhs)
-			: mPrefix(rhs.mPrefix), mNext(rhs.mNext) {}
-		
-		NameGenerator(const String& prefix) : mPrefix(prefix), mNext(1) {}
-
-		/// Generate a new name
-		String generate()
-		{
-			CM_LOCK_AUTO_MUTEX
-			std::ostringstream s;
-			s << mPrefix << mNext++;
-			return s.str();
-		}
-
-		/// Reset the internal counter
-		void reset()
-		{
-			CM_LOCK_AUTO_MUTEX
-			mNext = 1ULL;
-		}
-
-		/// Manually set the internal counter (use caution)
-		void setNext(unsigned long long int val)
-		{
-			CM_LOCK_AUTO_MUTEX
-			mNext = val;
-		}
-
-		/// Get the internal counter
-		unsigned long long int getNext() const
-		{
-			// lock even on get because 64-bit may not be atomic read
-			CM_LOCK_AUTO_MUTEX
-			return mNext;
-		}
-
-
-
-
-	};
-
-	/** Template class describing a simple pool of items.
-	*/
-	template <typename T>
-	class Pool
-	{
-	protected:
-		typedef typename list<T>::type ItemList;
-		ItemList mItems;
-		CM_AUTO_MUTEX
-	public:
-		Pool() {} 
-		virtual ~Pool() {}
-
-		/** Get the next item from the pool.
-		@returns pair indicating whether there was a free item, and the item if so
-		*/
-		virtual std::pair<bool, T> removeItem()
-		{
-			CM_LOCK_AUTO_MUTEX
-			std::pair<bool, T> ret;
-			if (mItems.empty())
-			{
-				ret.first = false;
-			}
-			else
-			{
-				ret.first = true;
-				ret.second = mItems.front();
-				mItems.pop_front();
-			}
-			return ret;
-		}
-
-		/** Add a new item to the pool. 
-		*/
-		virtual void addItem(const T& i)
-		{
-			CM_LOCK_AUTO_MUTEX
-			mItems.push_front(i);
-		}
-		/// Clear the pool
-		virtual void clear()
-		{
-			CM_LOCK_AUTO_MUTEX
-			mItems.clear();
-		}
-
-
-
-	};
-	/** @} */
+	
 	/** @} */
 	/** @} */
 }
 }
 
 

+ 0 - 31
CamelotRenderer/CmD3D9RenderSystem.cpp

@@ -78,10 +78,6 @@ namespace CamelotEngine
 		// Create the resource manager.
 		// Create the resource manager.
 		mResourceManager = new D3D9ResourceManager();
 		mResourceManager = new D3D9ResourceManager();
 
 
-		// init lights
-		for(int i = 0; i < MAX_LIGHTS; i++ )
-			mLights[i] = 0;
-
 		// Create our Direct3D object
 		// Create our Direct3D object
 		if( NULL == (mpD3D = Direct3DCreate9(D3D_SDK_VERSION)) )
 		if( NULL == (mpD3D = Direct3DCreate9(D3D_SDK_VERSION)) )
 			OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Failed to create Direct3D9 object", "D3D9RenderSystem::D3D9RenderSystem" );
 			OGRE_EXCEPT( Exception::ERR_INTERNAL_ERROR, "Failed to create Direct3D9 object", "D3D9RenderSystem::D3D9RenderSystem" );
@@ -1521,25 +1517,6 @@ namespace CamelotEngine
 			"Failed to set render stat D3DRS_AMBIENT", "D3D9RenderSystem::setAmbientLight" );
 			"Failed to set render stat D3DRS_AMBIENT", "D3D9RenderSystem::setAmbientLight" );
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::_useLights(const LightList& lights, unsigned short limit)
-	{
-		IDirect3DDevice9* activeDevice = getActiveD3D9Device();
-		LightList::const_iterator i, iend;
-		iend = lights.end();
-		unsigned short num = 0;
-		for (i = lights.begin(); i != iend && num < limit; ++i, ++num)
-		{
-			setD3D9Light(num, *i);
-		}
-		// Disable extra lights
-		for (; num < mCurrentLights[activeDevice]; ++num)
-		{
-			setD3D9Light(num, NULL);
-		}
-		mCurrentLights[activeDevice] = std::min(limit, static_cast<unsigned short>(lights.size()));
-
-	}
-	//---------------------------------------------------------------------
 	void D3D9RenderSystem::setShadingType( ShadeOptions so )
 	void D3D9RenderSystem::setShadingType( ShadeOptions so )
 	{
 	{
 		HRESULT hr = __SetRenderState( D3DRS_SHADEMODE, D3D9Mappings::get(so) );
 		HRESULT hr = __SetRenderState( D3DRS_SHADEMODE, D3D9Mappings::get(so) );
@@ -1554,14 +1531,6 @@ namespace CamelotEngine
 		if( FAILED( hr = __SetRenderState( D3DRS_LIGHTING, enabled ) ) )
 		if( FAILED( hr = __SetRenderState( D3DRS_LIGHTING, enabled ) ) )
 			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
 			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, 
 			"Failed to set render state D3DRS_LIGHTING", "D3D9RenderSystem::setLightingEnabled" );
 			"Failed to set render state D3DRS_LIGHTING", "D3D9RenderSystem::setLightingEnabled" );
-	}
-	//---------------------------------------------------------------------
-	void D3D9RenderSystem::setD3D9Light( size_t index, Light* lt )
-	{
-		// TODO PORT - D3D9 lights not supported
-		assert(false);
-
-
 	}
 	}
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
 	void D3D9RenderSystem::_setViewMatrix( const Matrix4 &m )
 	void D3D9RenderSystem::_setViewMatrix( const Matrix4 &m )

+ 1 - 9
CamelotRenderer/CmD3D9RenderSystem.h

@@ -37,8 +37,6 @@ THE SOFTWARE.
 
 
 namespace CamelotEngine 
 namespace CamelotEngine 
 {
 {
-#define MAX_LIGHTS 8
-
 	class D3D9DriverList;
 	class D3D9DriverList;
 	class D3D9Driver;
 	class D3D9Driver;
 	class D3D9Device;
 	class D3D9Device;
@@ -89,15 +87,10 @@ namespace CamelotEngine
 			IDirect3DBaseTexture9 *pVertexTex;
 			IDirect3DBaseTexture9 *pVertexTex;
 		} mTexStageDesc[CM_MAX_TEXTURE_LAYERS];
 		} mTexStageDesc[CM_MAX_TEXTURE_LAYERS];
 
 
-		// Array of up to 8 lights, indexed as per API
-		// Note that a null value indicates a free slot
-		Light* mLights[MAX_LIGHTS];		
 		D3D9DriverList* getDirect3DDrivers();
 		D3D9DriverList* getDirect3DDrivers();
 		void refreshD3DSettings();
 		void refreshD3DSettings();
         void refreshFSAAOptions();
         void refreshFSAAOptions();
-		
-		void setD3D9Light( size_t index, Light* light );
-		
+				
 		// state management methods, very primitive !!!
 		// state management methods, very primitive !!!
 		HRESULT __SetRenderState(D3DRENDERSTATETYPE state, DWORD value);
 		HRESULT __SetRenderState(D3DRENDERSTATETYPE state, DWORD value);
 		HRESULT __SetSamplerState(DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value);
 		HRESULT __SetSamplerState(DWORD sampler, D3DSAMPLERSTATETYPE type, DWORD value);
@@ -229,7 +222,6 @@ namespace CamelotEngine
         void setNormaliseNormals(bool normalise);
         void setNormaliseNormals(bool normalise);
 
 
 		// Low-level overridden members, mainly for internal use
 		// Low-level overridden members, mainly for internal use
-        void _useLights(const LightList& lights, unsigned short limit);
 		void _setWorldMatrix( const Matrix4 &m );
 		void _setWorldMatrix( const Matrix4 &m );
 		void _setViewMatrix( const Matrix4 &m );
 		void _setViewMatrix( const Matrix4 &m );
 		void _setProjectionMatrix( const Matrix4 &m );
 		void _setProjectionMatrix( const Matrix4 &m );

+ 1 - 1
CamelotRenderer/CmPixelFormat.h

@@ -84,7 +84,7 @@ namespace CamelotEngine {
         /// 32-bit pixel format, 8 bits for blue, 8 bits for green, 8 bits for red
         /// 32-bit pixel format, 8 bits for blue, 8 bits for green, 8 bits for red
         /// like PF_A8B8G8R8, but alpha will get discarded
         /// like PF_A8B8G8R8, but alpha will get discarded
         PF_X8B8G8R8 = 27,
         PF_X8B8G8R8 = 27,
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
 		/// 3 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue
 		/// 3 byte pixel format, 1 byte for red, 1 byte for green, 1 byte for blue
 		PF_BYTE_RGB = PF_R8G8B8,
 		PF_BYTE_RGB = PF_R8G8B8,
 		/// 3 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red
 		/// 3 byte pixel format, 1 byte for blue, 1 byte for green, 1 byte for red

+ 0 - 5
CamelotRenderer/CmRenderSystem.h

@@ -524,11 +524,6 @@ namespace CamelotEngine
 		// They can be called by library user if required
 		// They can be called by library user if required
 		// ------------------------------------------------------------------------
 		// ------------------------------------------------------------------------
 
 
-
-		/** Tells the rendersystem to use the attached set of lights (and no others) 
-		up to the number specified (this allows the same list to be used with different
-		count limits) */
-		virtual void _useLights(const LightList& lights, unsigned short limit) = 0;
 		/** Are fixed-function lights provided in view space? Affects optimisation. 
 		/** Are fixed-function lights provided in view space? Affects optimisation. 
 		*/
 		*/
 		virtual bool areFixedFunctionLightsInViewSpace() const { return false; }
 		virtual bool areFixedFunctionLightsInViewSpace() const { return false; }

+ 0 - 2
CamelotRenderer/CmSingleton.h

@@ -39,7 +39,6 @@ THE SOFTWARE.
 
 
 // Added by Steve Streeting for Ogre
 // Added by Steve Streeting for Ogre
 #include "CmPrerequisites.h"
 #include "CmPrerequisites.h"
-#include "CmHeaderPrefix.h"
 
 
 #if CM_COMPILER == CM_COMPILER_MSVC
 #if CM_COMPILER == CM_COMPILER_MSVC
 // Turn off warnings generated by this singleton implementation
 // Turn off warnings generated by this singleton implementation
@@ -100,5 +99,4 @@ namespace CamelotEngine {
 #   pragma GCC visibility pop
 #   pragma GCC visibility pop
 #endif
 #endif
 
 
-#include "CmHeaderSuffix.h"
 #endif
 #endif

+ 0 - 10
CamelotRenderer/RenderSystemGL/Include/CmGLRenderSystem.h

@@ -46,12 +46,6 @@ namespace CamelotEngine {
         /// Rendering loop control
         /// Rendering loop control
         bool mStopRendering;
         bool mStopRendering;
 
 
-        /** Array of up to 8 lights, indexed as per API
-            Note that a null value indicates a free slot
-          */ 
-        #define MAX_LIGHTS 8
-        Light* mLights[MAX_LIGHTS];
-
         /// View matrix to set world against
         /// View matrix to set world against
         Matrix4 mViewMatrix;
         Matrix4 mViewMatrix;
         Matrix4 mWorldMatrix;
         Matrix4 mWorldMatrix;
@@ -227,10 +221,6 @@ namespace CamelotEngine {
         // -----------------------------
         // -----------------------------
         // Low-level overridden members
         // Low-level overridden members
         // -----------------------------
         // -----------------------------
-        /** See
-          RenderSystem
-         */
-        void _useLights(const LightList& lights, unsigned short limit);
         /** See
         /** See
           RenderSystem
           RenderSystem
          */
          */

+ 2 - 2
CamelotRenderer/RenderSystemGL/Source/CmGLPixelFormat.cpp

@@ -55,7 +55,7 @@ namespace CamelotEngine  {
 				return GL_BGR;
 				return GL_BGR;
 			case PF_A4R4G4B4:
 			case PF_A4R4G4B4:
 				return GL_BGRA;
 				return GL_BGRA;
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
             // Formats are in native endian, so R8G8B8 on little endian is
             // Formats are in native endian, so R8G8B8 on little endian is
             // BGR, on big endian it is RGB.
             // BGR, on big endian it is RGB.
             case PF_R8G8B8:
             case PF_R8G8B8:
@@ -136,7 +136,7 @@ namespace CamelotEngine  {
 				return GL_UNSIGNED_SHORT_4_4_4_4_REV;
 				return GL_UNSIGNED_SHORT_4_4_4_4_REV;
             case PF_L16:
             case PF_L16:
                 return GL_UNSIGNED_SHORT;
                 return GL_UNSIGNED_SHORT;
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
 			case PF_X8B8G8R8:
 			case PF_X8B8G8R8:
 			case PF_A8B8G8R8:
 			case PF_A8B8G8R8:
                 return GL_UNSIGNED_INT_8_8_8_8_REV;
                 return GL_UNSIGNED_INT_8_8_8_8_REV;

+ 0 - 45
CamelotRenderer/RenderSystemGL/Source/CmGLRenderSystem.cpp

@@ -84,9 +84,6 @@ namespace CamelotEngine {
 		// Get our GLSupport
 		// Get our GLSupport
 		mGLSupport = getGLSupport();
 		mGLSupport = getGLSupport();
 
 
-		for( i=0; i<MAX_LIGHTS; i++ )
-			mLights[i] = NULL;
-
 		mWorldMatrix = Matrix4::IDENTITY;
 		mWorldMatrix = Matrix4::IDENTITY;
 		mViewMatrix = Matrix4::IDENTITY;
 		mViewMatrix = Matrix4::IDENTITY;
 
 
@@ -1035,44 +1032,6 @@ namespace CamelotEngine {
 			}
 			}
 		}
 		}
 	}
 	}
-
-	//---------------------------------------------------------------------
-	void GLRenderSystem::_useLights(const LightList& lights, unsigned short limit)
-	{
-		// TODO PORT - I don't use fixed pipleline lights. Remove this
-		assert(false);
-
-		//// Save previous modelview
-		//glMatrixMode(GL_MODELVIEW);
-		//glPushMatrix();
-		//// just load view matrix (identity world)
-		//GLfloat mat[16];
-		//makeGLMatrix(mat, mViewMatrix);
-		//glLoadMatrixf(mat);
-
-		//LightList::const_iterator i, iend;
-		//iend = lights.end();
-		//unsigned short num = 0;
-		//for (i = lights.begin(); i != iend && num < limit; ++i, ++num)
-		//{
-		//	setGLLight(num, *i);
-		//	mLights[num] = *i;
-		//}
-		//// Disable extra lights
-		//for (; num < mCurrentLights; ++num)
-		//{
-		//	setGLLight(num, NULL);
-		//	mLights[num] = NULL;
-		//}
-		//mCurrentLights = std::min(limit, static_cast<unsigned short>(lights.size()));
-
-		//setLights();
-
-		//// restore previous
-		//glPopMatrix();
-
-	}
-
 	//-----------------------------------------------------------------------------
 	//-----------------------------------------------------------------------------
 	void GLRenderSystem::makeGLMatrix(GLfloat gl_matrix[16], const Matrix4& m)
 	void GLRenderSystem::makeGLMatrix(GLfloat gl_matrix[16], const Matrix4& m)
 	{
 	{
@@ -3257,10 +3216,6 @@ GL_RGB_SCALE : GL_ALPHA_SCALE, 1);
 			mCurrentFragmentProgram->unbindProgram();
 			mCurrentFragmentProgram->unbindProgram();
 
 
 		// Disable lights
 		// Disable lights
-		for (unsigned short i = 0; i < mCurrentLights; ++i)
-		{
-			mLights[i] = NULL;
-		}
 		mCurrentLights = 0;
 		mCurrentLights = 0;
 
 
 		// Disable textures
 		// Disable textures

+ 2 - 2
CamelotUtility/CamelotUtility.vcxproj

@@ -71,7 +71,7 @@
     </Link>
     </Link>
   </ItemDefinitionGroup>
   </ItemDefinitionGroup>
   <ItemGroup>
   <ItemGroup>
-    <ClInclude Include="Include\CmColourValue.h" />
+    <ClInclude Include="Include\CmColor.h" />
     <ClInclude Include="Include\CmException.h" />
     <ClInclude Include="Include\CmException.h" />
     <ClInclude Include="Include\CmMathAsm.h" />
     <ClInclude Include="Include\CmMathAsm.h" />
     <ClInclude Include="Include\CmString.h" />
     <ClInclude Include="Include\CmString.h" />
@@ -96,7 +96,7 @@
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ClCompile Include="Include\CmAxisAlignedBox.cpp" />
     <ClCompile Include="Include\CmAxisAlignedBox.cpp" />
-    <ClCompile Include="Source\CmColourValue.cpp" />
+    <ClCompile Include="Source\CmColor.cpp" />
     <ClCompile Include="Source\CmException.cpp" />
     <ClCompile Include="Source\CmException.cpp" />
     <ClCompile Include="Source\CmMath.cpp" />
     <ClCompile Include="Source\CmMath.cpp" />
     <ClCompile Include="Source\CmMatrix3.cpp" />
     <ClCompile Include="Source\CmMatrix3.cpp" />

+ 2 - 2
CamelotUtility/CamelotUtility.vcxproj.filters

@@ -90,7 +90,7 @@
     <ClInclude Include="Include\CmString.h">
     <ClInclude Include="Include\CmString.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\CmColourValue.h">
+    <ClInclude Include="Include\CmColor.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
   </ItemGroup>
   </ItemGroup>
@@ -131,7 +131,7 @@
     <ClCompile Include="Source\CmString.cpp">
     <ClCompile Include="Source\CmString.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
-    <ClCompile Include="Source\CmColourValue.cpp">
+    <ClCompile Include="Source\CmColor.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
   </ItemGroup>
   </ItemGroup>

+ 1 - 1
CamelotRenderer/CmColourValue.h → CamelotUtility/Include/CmColor.h

@@ -28,7 +28,7 @@ THE SOFTWARE.
 #ifndef _COLOURVALUE_H__
 #ifndef _COLOURVALUE_H__
 #define _COLOURVALUE_H__
 #define _COLOURVALUE_H__
 
 
-#include "CmPrerequisites.h"
+#include "CmPrerequisitesUtil.h"
 
 
 namespace CamelotEngine {
 namespace CamelotEngine {
 	/** \addtogroup Core
 	/** \addtogroup Core

+ 0 - 334
CamelotUtility/Include/CmColourValue.h

@@ -1,334 +0,0 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#ifndef _COLOURVALUE_H__
-#define _COLOURVALUE_H__
-
-#include "CmPrerequisitesUtil.h"
-
-namespace CamelotEngine {
-	/** \addtogroup Core
-	*  @{
-	*/
-	/** \addtogroup General
-	*  @{
-	*/
-
-    typedef UINT32 RGBA;
-    typedef UINT32 ARGB;
-    typedef UINT32 ABGR;
-	typedef UINT32 BGRA;
-
-    /** Class representing colour.
-	    @remarks
-		    Colour is represented as 4 components, each of which is a
-		    floating-point value from 0.0 to 1.0.
-	    @par
-		    The 3 'normal' colour components are red, green and blue, a higher
-		    number indicating greater amounts of that component in the colour.
-		    The forth component is the 'alpha' value, which represents
-		    transparency. In this case, 0.0 is completely transparent and 1.0 is
-		    fully opaque.
-    */
-    class CM_EXPORT ColourValue
-    {
-    public:
-        static const ColourValue ZERO;
-        static const ColourValue Black;
-        static const ColourValue White;
-        static const ColourValue Red;
-        static const ColourValue Green;
-        static const ColourValue Blue;
-
-	    explicit ColourValue( float red = 1.0f,
-				    float green = 1.0f,
-				    float blue = 1.0f,
-				    float alpha = 1.0f ) : r(red), g(green), b(blue), a(alpha)
-        { }
-
-	    bool operator==(const ColourValue& rhs) const;
-	    bool operator!=(const ColourValue& rhs) const;
-
-        float r,g,b,a;
-
-	    /** Retrieves colour as RGBA.
-	    */
-	    RGBA getAsRGBA(void) const;
-
-	    /** Retrieves colour as ARGB.
-	    */
-	    ARGB getAsARGB(void) const;
-
-		/** Retrieves colour as BGRA.
-		*/
-		BGRA getAsBGRA(void) const;
-
-		/** Retrieves colours as ABGR */
-	    ABGR getAsABGR(void) const;
-
-	    /** Sets colour as RGBA.
-	    */
-        void setAsRGBA(const RGBA val);
-
-	    /** Sets colour as ARGB.
-	    */
-        void setAsARGB(const ARGB val);
-
-		/** Sets colour as BGRA.
-		*/
-		void setAsBGRA(const BGRA val);
-
-	    /** Sets colour as ABGR.
-	    */
-        void setAsABGR(const ABGR val);
-
-        /** Clamps colour value to the range [0, 1].
-        */
-        void saturate(void)
-        {
-            if (r < 0)
-                r = 0;
-            else if (r > 1)
-                r = 1;
-
-            if (g < 0)
-                g = 0;
-            else if (g > 1)
-                g = 1;
-
-            if (b < 0)
-                b = 0;
-            else if (b > 1)
-                b = 1;
-
-            if (a < 0)
-                a = 0;
-            else if (a > 1)
-                a = 1;
-        }
-
-        /** As saturate, except that this colour value is unaffected and
-            the saturated colour value is returned as a copy. */
-        ColourValue saturateCopy(void) const
-        {
-            ColourValue ret = *this;
-            ret.saturate();
-            return ret;
-        }
-
-		/// Array accessor operator
-		inline float operator [] ( const size_t i ) const
-		{
-			assert( i < 4 );
-
-			return *(&r+i);
-		}
-
-		/// Array accessor operator
-		inline float& operator [] ( const size_t i )
-		{
-			assert( i < 4 );
-
-			return *(&r+i);
-		}
-
-		/// Pointer accessor for direct copying
-		inline float* ptr()
-		{
-			return &r;
-		}
-		/// Pointer accessor for direct copying
-		inline const float* ptr() const
-		{
-			return &r;
-		}
-
-		
-		// arithmetic operations
-        inline ColourValue operator + ( const ColourValue& rkVector ) const
-        {
-            ColourValue kSum;
-
-            kSum.r = r + rkVector.r;
-            kSum.g = g + rkVector.g;
-            kSum.b = b + rkVector.b;
-            kSum.a = a + rkVector.a;
-
-            return kSum;
-        }
-
-        inline ColourValue operator - ( const ColourValue& rkVector ) const
-        {
-            ColourValue kDiff;
-
-            kDiff.r = r - rkVector.r;
-            kDiff.g = g - rkVector.g;
-            kDiff.b = b - rkVector.b;
-            kDiff.a = a - rkVector.a;
-
-            return kDiff;
-        }
-
-        inline ColourValue operator * (const float fScalar ) const
-        {
-            ColourValue kProd;
-
-            kProd.r = fScalar*r;
-            kProd.g = fScalar*g;
-            kProd.b = fScalar*b;
-            kProd.a = fScalar*a;
-
-            return kProd;
-        }
-
-        inline ColourValue operator * ( const ColourValue& rhs) const
-        {
-            ColourValue kProd;
-
-            kProd.r = rhs.r * r;
-            kProd.g = rhs.g * g;
-            kProd.b = rhs.b * b;
-            kProd.a = rhs.a * a;
-
-            return kProd;
-        }
-
-        inline ColourValue operator / ( const ColourValue& rhs) const
-        {
-            ColourValue kProd;
-
-            kProd.r = rhs.r / r;
-            kProd.g = rhs.g / g;
-            kProd.b = rhs.b / b;
-            kProd.a = rhs.a / a;
-
-            return kProd;
-        }
-
-        inline ColourValue operator / (const float fScalar ) const
-        {
-            assert( fScalar != 0.0 );
-
-            ColourValue kDiv;
-
-            float fInv = 1.0f / fScalar;
-            kDiv.r = r * fInv;
-            kDiv.g = g * fInv;
-            kDiv.b = b * fInv;
-            kDiv.a = a * fInv;
-
-            return kDiv;
-        }
-
-        inline friend ColourValue operator * (const float fScalar, const ColourValue& rkVector )
-        {
-            ColourValue kProd;
-
-            kProd.r = fScalar * rkVector.r;
-            kProd.g = fScalar * rkVector.g;
-            kProd.b = fScalar * rkVector.b;
-            kProd.a = fScalar * rkVector.a;
-
-            return kProd;
-        }
-
-        // arithmetic updates
-        inline ColourValue& operator += ( const ColourValue& rkVector )
-        {
-            r += rkVector.r;
-            g += rkVector.g;
-            b += rkVector.b;
-            a += rkVector.a;
-
-            return *this;
-        }
-
-        inline ColourValue& operator -= ( const ColourValue& rkVector )
-        {
-            r -= rkVector.r;
-            g -= rkVector.g;
-            b -= rkVector.b;
-            a -= rkVector.a;
-
-            return *this;
-        }
-
-        inline ColourValue& operator *= (const float fScalar )
-        {
-            r *= fScalar;
-            g *= fScalar;
-            b *= fScalar;
-            a *= fScalar;
-            return *this;
-        }
-
-        inline ColourValue& operator /= (const float fScalar )
-        {
-            assert( fScalar != 0.0 );
-
-            float fInv = 1.0f / fScalar;
-
-            r *= fInv;
-            g *= fInv;
-            b *= fInv;
-            a *= fInv;
-
-            return *this;
-        }
-
-		/** Set a colour value from Hue, Saturation and Brightness.
-		@param hue Hue value, scaled to the [0,1] range as opposed to the 0-360
-		@param saturation Saturation level, [0,1]
-		@param brightness Brightness level, [0,1]
-		*/
-		void setHSB(float hue, float saturation, float brightness);
-
-		/** Convert the current colour to Hue, Saturation and Brightness values. 
-		@param hue Output hue value, scaled to the [0,1] range as opposed to the 0-360
-		@param saturation Output saturation level, [0,1]
-		@param brightness Output brightness level, [0,1]
-		*/
-		void getHSB(float* hue, float* saturation, float* brightness) const;
-
-
-
-		/** Function for writing to a stream.
-		*/
-		inline CM_EXPORT friend std::ostream& operator <<
-			( std::ostream& o, const ColourValue& c )
-		{
-			o << "ColourValue(" << c.r << ", " << c.g << ", " << c.b << ", " << c.a << ")";
-			return o;
-		}
-
-    };
-	/** @} */
-	/** @} */
-
-} // namespace
-
-#endif

+ 1 - 1
CamelotUtility/Include/CmFwdDeclUtil.h

@@ -18,5 +18,5 @@ namespace CamelotEngine {
 	class Vector2;
 	class Vector2;
 	class Vector3;
 	class Vector3;
 	class Vector4;
 	class Vector4;
-	class ColourValue;
+	class Color;
 }
 }

+ 5 - 0
CamelotUtility/Include/CmPlatform.h

@@ -43,6 +43,11 @@ namespace CamelotEngine {
 #define CM_ARCHITECTURE_32 1
 #define CM_ARCHITECTURE_32 1
 #define CM_ARCHITECTURE_64 2
 #define CM_ARCHITECTURE_64 2
 
 
+#define CM_ENDIAN_LITTLE 1
+#define CM_ENDIAN_BIG 2
+
+#define CM_ENDIAN CM_ENDIAN_LITTLE
+
 /* Finds the compiler type and version.
 /* Finds the compiler type and version.
 */
 */
 #if defined( __GCCE__ )
 #if defined( __GCCE__ )

+ 1 - 1
CamelotUtility/Include/CmString.h

@@ -302,7 +302,7 @@ namespace CamelotEngine {
     @remarks
     @remarks
         Format is "r g b a" (i.e. 4x float values, space delimited). 
         Format is "r g b a" (i.e. 4x float values, space delimited). 
     */
     */
-    CM_EXPORT String toString(const ColourValue& val);
+    CM_EXPORT String toString(const Color& val);
     /** Converts a StringVector to a string.
     /** Converts a StringVector to a string.
     @remarks
     @remarks
         Strings must not contain spaces since space is used as a delimiter in
         Strings must not contain spaces since space is used as a delimiter in

+ 8 - 8
CamelotRenderer/CmColourValue.cpp → CamelotUtility/Source/CmColor.cpp

@@ -39,7 +39,7 @@ namespace CamelotEngine {
     const Color Color::Blue = Color(0.0,0.0,1.0);
     const Color Color::Blue = Color(0.0,0.0,1.0);
 
 
     //---------------------------------------------------------------------
     //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
     ABGR Color::getAsABGR(void) const
     ABGR Color::getAsABGR(void) const
 #else
 #else
     RGBA Color::getAsRGBA(void) const
     RGBA Color::getAsRGBA(void) const
@@ -70,7 +70,7 @@ namespace CamelotEngine {
         return val32;
         return val32;
     }
     }
     //---------------------------------------------------------------------
     //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
     BGRA Color::getAsBGRA(void) const
     BGRA Color::getAsBGRA(void) const
 #else
 #else
     ARGB Color::getAsARGB(void) const
     ARGB Color::getAsARGB(void) const
@@ -102,7 +102,7 @@ namespace CamelotEngine {
         return val32;
         return val32;
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
 	ARGB Color::getAsARGB(void) const
 	ARGB Color::getAsARGB(void) const
 #else
 #else
 	BGRA Color::getAsBGRA(void) const
 	BGRA Color::getAsBGRA(void) const
@@ -134,7 +134,7 @@ namespace CamelotEngine {
 		return val32;
 		return val32;
 	}
 	}
     //---------------------------------------------------------------------
     //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
     RGBA Color::getAsRGBA(void) const
     RGBA Color::getAsRGBA(void) const
 #else
 #else
     ABGR Color::getAsABGR(void) const
     ABGR Color::getAsABGR(void) const
@@ -166,7 +166,7 @@ namespace CamelotEngine {
         return val32;
         return val32;
     }
     }
     //---------------------------------------------------------------------
     //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
     void Color::setAsABGR(const ABGR val)
     void Color::setAsABGR(const ABGR val)
 #else
 #else
     void Color::setAsRGBA(const RGBA val)
     void Color::setAsRGBA(const RGBA val)
@@ -190,7 +190,7 @@ namespace CamelotEngine {
         a = (val32 & 0xFF) / 255.0f;
         a = (val32 & 0xFF) / 255.0f;
     }
     }
     //---------------------------------------------------------------------
     //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
     void Color::setAsBGRA(const BGRA val)
     void Color::setAsBGRA(const BGRA val)
 #else
 #else
     void Color::setAsARGB(const ARGB val)
     void Color::setAsARGB(const ARGB val)
@@ -214,7 +214,7 @@ namespace CamelotEngine {
         b = (val32 & 0xFF) / 255.0f;
         b = (val32 & 0xFF) / 255.0f;
     }
     }
 	//---------------------------------------------------------------------
 	//---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
 	void Color::setAsARGB(const ARGB val)
 	void Color::setAsARGB(const ARGB val)
 #else
 #else
 	void Color::setAsBGRA(const BGRA val)
 	void Color::setAsBGRA(const BGRA val)
@@ -238,7 +238,7 @@ namespace CamelotEngine {
 		a = (val32 & 0xFF) / 255.0f;
 		a = (val32 & 0xFF) / 255.0f;
 	}
 	}
     //---------------------------------------------------------------------
     //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
+#if CM_ENDIAN == CM_ENDIAN_BIG
     void Color::setAsRGBA(const RGBA val)
     void Color::setAsRGBA(const RGBA val)
 #else
 #else
     void Color::setAsABGR(const ABGR val)
     void Color::setAsABGR(const ABGR val)

+ 0 - 406
CamelotUtility/Source/CmColourValue.cpp

@@ -1,406 +0,0 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-    (Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
-#include "CmColourValue.h"
-#include "CmMath.h"
-
-namespace CamelotEngine {
-
-    const ColourValue ColourValue::ZERO = ColourValue(0.0,0.0,0.0,0.0);
-    const ColourValue ColourValue::Black = ColourValue(0.0,0.0,0.0);
-    const ColourValue ColourValue::White = ColourValue(1.0,1.0,1.0);
-    const ColourValue ColourValue::Red = ColourValue(1.0,0.0,0.0);
-    const ColourValue ColourValue::Green = ColourValue(0.0,1.0,0.0);
-    const ColourValue ColourValue::Blue = ColourValue(0.0,0.0,1.0);
-
-    //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
-    ABGR ColourValue::getAsABGR(void) const
-#else
-    RGBA ColourValue::getAsRGBA(void) const
-#endif
-    {
-        UINT8 val8;
-        UINT32 val32 = 0;
-
-        // Convert to 32bit pattern
-        // (RGBA = 8888)
-
-        // Red
-        val8 = static_cast<UINT8>(r * 255);
-        val32 = val8 << 24;
-
-        // Green
-        val8 = static_cast<UINT8>(g * 255);
-        val32 += val8 << 16;
-
-        // Blue
-        val8 = static_cast<UINT8>(b * 255);
-        val32 += val8 << 8;
-
-        // Alpha
-        val8 = static_cast<UINT8>(a * 255);
-        val32 += val8;
-
-        return val32;
-    }
-    //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
-    BGRA ColourValue::getAsBGRA(void) const
-#else
-    ARGB ColourValue::getAsARGB(void) const
-#endif
-    {
-        UINT8 val8;
-        UINT32 val32 = 0;
-
-        // Convert to 32bit pattern
-        // (ARGB = 8888)
-
-        // Alpha
-        val8 = static_cast<UINT8>(a * 255);
-        val32 = val8 << 24;
-
-        // Red
-        val8 = static_cast<UINT8>(r * 255);
-        val32 += val8 << 16;
-
-        // Green
-        val8 = static_cast<UINT8>(g * 255);
-        val32 += val8 << 8;
-
-        // Blue
-        val8 = static_cast<UINT8>(b * 255);
-        val32 += val8;
-
-
-        return val32;
-    }
-	//---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
-	ARGB ColourValue::getAsARGB(void) const
-#else
-	BGRA ColourValue::getAsBGRA(void) const
-#endif
-	{
-		UINT8 val8;
-		UINT32 val32 = 0;
-
-		// Convert to 32bit pattern
-		// (ARGB = 8888)
-
-		// Blue
-		val8 = static_cast<UINT8>(b * 255);
-		val32 = val8 << 24;
-
-		// Green
-		val8 = static_cast<UINT8>(g * 255);
-		val32 += val8 << 16;
-
-		// Red
-		val8 = static_cast<UINT8>(r * 255);
-		val32 += val8 << 8;
-
-		// Alpha
-		val8 = static_cast<UINT8>(a * 255);
-		val32 += val8;
-
-
-		return val32;
-	}
-    //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
-    RGBA ColourValue::getAsRGBA(void) const
-#else
-    ABGR ColourValue::getAsABGR(void) const
-#endif
-    {
-        UINT8 val8;
-        UINT32 val32 = 0;
-
-        // Convert to 32bit pattern
-        // (ABRG = 8888)
-
-        // Alpha
-        val8 = static_cast<UINT8>(a * 255);
-        val32 = val8 << 24;
-
-        // Blue
-        val8 = static_cast<UINT8>(b * 255);
-        val32 += val8 << 16;
-
-        // Green
-        val8 = static_cast<UINT8>(g * 255);
-        val32 += val8 << 8;
-
-        // Red
-        val8 = static_cast<UINT8>(r * 255);
-        val32 += val8;
-
-
-        return val32;
-    }
-    //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
-    void ColourValue::setAsABGR(const ABGR val)
-#else
-    void ColourValue::setAsRGBA(const RGBA val)
-#endif
-    {
-        UINT32 val32 = val;
-
-        // Convert from 32bit pattern
-        // (RGBA = 8888)
-
-        // Red
-        r = ((val32 >> 24) & 0xFF) / 255.0f;
-
-        // Green
-        g = ((val32 >> 16) & 0xFF) / 255.0f;
-
-        // Blue
-        b = ((val32 >> 8) & 0xFF) / 255.0f;
-
-        // Alpha
-        a = (val32 & 0xFF) / 255.0f;
-    }
-    //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
-    void ColourValue::setAsBGRA(const BGRA val)
-#else
-    void ColourValue::setAsARGB(const ARGB val)
-#endif
-    {
-        UINT32 val32 = val;
-
-        // Convert from 32bit pattern
-        // (ARGB = 8888)
-
-        // Alpha
-        a = ((val32 >> 24) & 0xFF) / 255.0f;
-
-        // Red
-        r = ((val32 >> 16) & 0xFF) / 255.0f;
-
-        // Green
-        g = ((val32 >> 8) & 0xFF) / 255.0f;
-
-        // Blue
-        b = (val32 & 0xFF) / 255.0f;
-    }
-	//---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
-	void ColourValue::setAsARGB(const ARGB val)
-#else
-	void ColourValue::setAsBGRA(const BGRA val)
-#endif
-	{
-		UINT32 val32 = val;
-
-		// Convert from 32bit pattern
-		// (ARGB = 8888)
-
-		// Blue
-		b = ((val32 >> 24) & 0xFF) / 255.0f;
-
-		// Green
-		g = ((val32 >> 16) & 0xFF) / 255.0f;
-
-		// Red
-		r = ((val32 >> 8) & 0xFF) / 255.0f;
-
-		// Alpha
-		a = (val32 & 0xFF) / 255.0f;
-	}
-    //---------------------------------------------------------------------
-#if OGRE_ENDIAN == OGRE_ENDIAN_BIG
-    void ColourValue::setAsRGBA(const RGBA val)
-#else
-    void ColourValue::setAsABGR(const ABGR val)
-#endif
-    {
-        UINT32 val32 = val;
-
-        // Convert from 32bit pattern
-        // (ABGR = 8888)
-
-        // Alpha
-        a = ((val32 >> 24) & 0xFF) / 255.0f;
-
-        // Blue
-        b = ((val32 >> 16) & 0xFF) / 255.0f;
-
-        // Green
-        g = ((val32 >> 8) & 0xFF) / 255.0f;
-
-        // Red
-        r = (val32 & 0xFF) / 255.0f;
-    }
-    //---------------------------------------------------------------------
-    bool ColourValue::operator==(const ColourValue& rhs) const
-    {
-        return (r == rhs.r &&
-            g == rhs.g &&
-            b == rhs.b &&
-            a == rhs.a);
-    }
-    //---------------------------------------------------------------------
-    bool ColourValue::operator!=(const ColourValue& rhs) const
-    {
-        return !(*this == rhs);
-    }
-	//---------------------------------------------------------------------
-	void ColourValue::setHSB(float hue, float saturation, float brightness)
-	{
-		// wrap hue
-		if (hue > 1.0f)
-		{
-			hue -= (int)hue;
-		}
-		else if (hue < 0.0f)
-		{
-			hue += (int)hue + 1;
-		}
-		// clamp saturation / brightness
-		saturation = std::min(saturation, (float)1.0);
-		saturation = std::max(saturation, (float)0.0);
-		brightness = std::min(brightness, (float)1.0);
-		brightness = std::max(brightness, (float)0.0);
-
-		if (brightness == 0.0f)
-		{   
-			// early exit, this has to be black
-			r = g = b = 0.0f;
-			return;
-		}
-
-		if (saturation == 0.0f)
-		{   
-			// early exit, this has to be grey
-
-			r = g = b = brightness;
-			return;
-		}
-
-
-		float hueDomain  = hue * 6.0f;
-		if (hueDomain >= 6.0f)
-		{
-			// wrap around, and allow mathematical errors
-			hueDomain = 0.0f;
-		}
-		unsigned short domain = (unsigned short)hueDomain;
-		float f1 = brightness * (1 - saturation);
-		float f2 = brightness * (1 - saturation * (hueDomain - domain));
-		float f3 = brightness * (1 - saturation * (1 - (hueDomain - domain)));
-
-		switch (domain)
-		{
-		case 0:
-			// red domain; green ascends
-			r = brightness;
-			g = f3;
-			b = f1;
-			break;
-		case 1:
-			// yellow domain; red descends
-			r = f2;
-			g = brightness;
-			b = f1;
-			break;
-		case 2:
-			// green domain; blue ascends
-			r = f1;
-			g = brightness;
-			b = f3;
-			break;
-		case 3:
-			// cyan domain; green descends
-			r = f1;
-			g = f2;
-			b = brightness;
-			break;
-		case 4:
-			// blue domain; red ascends
-			r = f3;
-			g = f1;
-			b = brightness;
-			break;
-		case 5:
-			// magenta domain; blue descends
-			r = brightness;
-			g = f1;
-			b = f2;
-			break;
-		}
-
-
-	}
-	//---------------------------------------------------------------------
-	void ColourValue::getHSB(float* hue, float* saturation, float* brightness) const
-	{
-
-		float vMin = std::min(r, std::min(g, b));
-		float vMax = std::max(r, std::max(g, b));
-		float delta = vMax - vMin;
-
-		*brightness = vMax;
-
-		if (Math::RealEqual(delta, 0.0f, 1e-6f))
-		{
-			// grey
-			*hue = 0;
-			*saturation = 0;
-		}
-		else                                    
-		{
-			// a colour
-			*saturation = delta / vMax;
-
-			float deltaR = (((vMax - r) / 6.0f) + (delta / 2.0f)) / delta;
-			float deltaG = (((vMax - g) / 6.0f) + (delta / 2.0f)) / delta;
-			float deltaB = (((vMax - b) / 6.0f) + (delta / 2.0f)) / delta;
-
-			if (Math::RealEqual(r, vMax))
-				*hue = deltaB - deltaG;
-			else if (Math::RealEqual(g, vMax))
-				*hue = 0.3333333f + deltaR - deltaB;
-			else if (Math::RealEqual(b, vMax)) 
-				*hue = 0.6666667f + deltaG - deltaR;
-
-			if (*hue < 0.0f) 
-				*hue += 1.0f;
-			if (*hue > 1.0f)
-				*hue -= 1.0f;
-		}
-
-		
-	}
-
-}
-

+ 2 - 2
CamelotUtility/Source/CmString.cpp

@@ -27,7 +27,7 @@ THE SOFTWARE.
 */
 */
 
 
 #include "CmString.h"
 #include "CmString.h"
-#include "CmColourValue.h"
+#include "CmColor.h"
 #include "CmMath.h"
 #include "CmMath.h"
 #include "CmMatrix3.h"
 #include "CmMatrix3.h"
 #include "CmMatrix4.h"
 #include "CmMatrix4.h"
@@ -575,7 +575,7 @@ namespace CamelotEngine {
 		return stream.str();
 		return stream.str();
 	}
 	}
 	//-----------------------------------------------------------------------
 	//-----------------------------------------------------------------------
-	String toString(const ColourValue& val)
+	String toString(const Color& val)
 	{
 	{
 		stringstream stream;
 		stringstream stream;
 		stream << val.r << " " << val.g << " " << val.b << " " << val.a;
 		stream << val.r << " " << val.g << " " << val.b << " " << val.a;