فهرست منبع

Removed blend states

Marko Pintera 13 سال پیش
والد
کامیت
2d83f5cacc

+ 0 - 3
CamelotRenderer/CamelotRenderer.vcxproj

@@ -96,7 +96,6 @@
     <ClInclude Include="CmRenderSystemFactory.h" />
     <ClInclude Include="CmRenderSystemManager.h" />
     <ClInclude Include="CmBitwise.h" />
-    <ClInclude Include="CmBlendMode.h" />
     <ClInclude Include="CmCamera.h" />
     <ClInclude Include="CmCommon.h" />
     <ClInclude Include="CmConfigOptionMap.h" />
@@ -136,8 +135,6 @@
     <ClInclude Include="CmHardwareOcclusionQuery.h" />
     <ClInclude Include="CmHardwarePixelBuffer.h" />
     <ClInclude Include="CmHardwareVertexBuffer.h" />
-    <ClInclude Include="CmHeaderPrefix.h" />
-    <ClInclude Include="CmHeaderSuffix.h" />
     <ClInclude Include="CmHighLevelGpuProgram.h" />
     <ClInclude Include="CmHighLevelGpuProgramManager.h" />
     <ClInclude Include="CmImageResampler.h" />

+ 0 - 9
CamelotRenderer/CamelotRenderer.vcxproj.filters

@@ -344,12 +344,6 @@
     <ClInclude Include="CmConfigOptionMap.h">
       <Filter>Header Files\ForRemoval</Filter>
     </ClInclude>
-    <ClInclude Include="CmHeaderPrefix.h">
-      <Filter>Header Files\ForRemoval</Filter>
-    </ClInclude>
-    <ClInclude Include="CmHeaderSuffix.h">
-      <Filter>Header Files\ForRemoval</Filter>
-    </ClInclude>
     <ClInclude Include="CmPrerequisites.h">
       <Filter>Header Files\ForRemoval</Filter>
     </ClInclude>
@@ -359,9 +353,6 @@
     <ClInclude Include="CmSingleton.h">
       <Filter>Header Files\ForRemoval</Filter>
     </ClInclude>
-    <ClInclude Include="CmBlendMode.h">
-      <Filter>Header Files\Utility</Filter>
-    </ClInclude>
     <ClInclude Include="CmCommon.h">
       <Filter>Header Files\Utility</Filter>
     </ClInclude>

+ 0 - 266
CamelotRenderer/CmBlendMode.h

@@ -1,266 +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 __BLENDMODE_H__
-#define __BLENDMODE_H__
-
-#include "CmPrerequisites.h"
-#include "CmColor.h"
-
-namespace CamelotEngine {
-	/** \addtogroup Core
-	*  @{
-	*/
-	/** \addtogroup Materials
-	*  @{
-	*/
-
-    /** Type of texture blend mode.
-    */
-    enum LayerBlendType
-    {
-        LBT_COLOUR,
-        LBT_ALPHA
-    };
-
-    /** List of valid texture blending operations, for use with TextureUnitState::setColourOperation.
-        @remarks
-            This list is a more limited list than LayerBlendOperationEx because it only
-            includes operations that are supportable in both multipass and multitexture
-            rendering and thus provides automatic fallback if multitexture hardware
-            is lacking or insufficient.
-    */
-    enum LayerBlendOperation {
-        /// Replace all colour with texture with no adjustment
-        LBO_REPLACE,
-        /// Add colour components together.
-        LBO_ADD,
-        /// Multiply colour components together.
-        LBO_MODULATE,
-        /// Blend based on texture alpha
-        LBO_ALPHA_BLEND
-
-    };
-
-    /** Expert list of valid texture blending operations, for use with TextureUnitState::setColourOperationEx
-        and TextureUnitState::setAlphaOperation, and internally in the LayerBlendModeEx class. It's worth
-        noting that these operations are for blending <i>between texture layers</i> and not between rendered objects
-        and the existing scene. Because all of these modes are only supported in multitexture hardware it may be
-        required to set up a fallback operation where this hardware is not available.
-    */
-    enum LayerBlendOperationEx {
-        /// use source1 without modification
-        LBX_SOURCE1,
-        /// use source2 without modification
-        LBX_SOURCE2,
-        /// multiply source1 and source2 together
-        LBX_MODULATE,
-        /// as LBX_MODULATE but brighten afterwards (x2)
-        LBX_MODULATE_X2,
-        /// as LBX_MODULATE but brighten more afterwards (x4)
-        LBX_MODULATE_X4,
-        /// add source1 and source2 together
-        LBX_ADD,
-        /// as LBX_ADD, but subtract 0.5 from the result
-        LBX_ADD_SIGNED,
-        /// as LBX_ADD, but subtract product from the sum
-        LBX_ADD_SMOOTH,
-        /// subtract source2 from source1
-        LBX_SUBTRACT,
-        /// use interpolated alpha value from vertices to scale source1, then add source2 scaled by (1-alpha)
-        LBX_BLEND_DIFFUSE_ALPHA,
-        /// as LBX_BLEND_DIFFUSE_ALPHA, but use alpha from texture
-        LBX_BLEND_TEXTURE_ALPHA,
-        /// as LBX_BLEND_DIFFUSE_ALPHA, but use current alpha from previous stages
-        LBX_BLEND_CURRENT_ALPHA,
-        /// as LBX_BLEND_DIFFUSE_ALPHA but use a constant manual blend value (0.0-1.0)
-        LBX_BLEND_MANUAL,
-        /// dot product of color1 and color2 
-        LBX_DOTPRODUCT,
-        /// use interpolated color values from vertices to scale source1, then add source2 scaled by (1-color)
-        LBX_BLEND_DIFFUSE_COLOUR
-    };
-
-    /** List of valid sources of values for blending operations used
-        in TextureUnitState::setColourOperation and TextureUnitState::setAlphaOperation,
-        and internally in the LayerBlendModeEx class.
-    */
-    enum LayerBlendSource
-    {
-        /// the colour as built up from previous stages
-        LBS_CURRENT,
-        /// the colour derived from the texture assigned to this layer
-        LBS_TEXTURE,
-        /// the interpolated diffuse colour from the vertices
-        LBS_DIFFUSE,
-        /// the interpolated specular colour from the vertices
-        LBS_SPECULAR,
-        /// a colour supplied manually as a separate argument
-        LBS_MANUAL
-    };
-    /** Class which manages blending of both colour and alpha components.
-        @remarks
-            This class is a utility class used by both TextureUnitState and
-            RenderSystem to wrap up the details of a blending operation. This blending
-            operation could be used for blending colour or alpha in a texture layer.
-            This class is really only for use by OGRE, since apps can deal with
-            blending modes through the TextureUnitState class methods
-            setColourOperation and setAlphaOperation.
-        @par
-            It's worth noting that these operations are for blending <i>between texture
-            layers</i> and not between rendered objects and the existing scene. If
-            you wish to make an object blend with others in the scene, e.g. to make
-            transparent objects etc, use the Material::setSceneBlending method.
-    */
-    class CM_EXPORT LayerBlendModeEx
-    {
-    public:
-        /// The type of blending (colour or alpha)
-        LayerBlendType blendType;
-        /// The operation to be applied
-        LayerBlendOperationEx operation;
-        /// The first source of colour/alpha
-        LayerBlendSource source1;
-        /// The second source of colour/alpha
-        LayerBlendSource source2;
-
-        /// Manual colour value for manual source1
-        Color colourArg1;
-        /// Manual colour value for manual source2
-        Color colourArg2;
-        /// Manual alpha value for manual source1
-        float alphaArg1;
-        /// Manual alpha value for manual source2
-        float alphaArg2;
-        /// Manual blending factor
-        float factor;
-
-        bool operator==(const LayerBlendModeEx& rhs) const
-        {
-            if (blendType != rhs.blendType) return false;
-
-            if (blendType == LBT_COLOUR)
-            {
-
-                if (operation == rhs.operation &&
-                    source1 == rhs.source1 &&
-                    source2 == rhs.source2 &&
-                    colourArg1 == rhs.colourArg1 &&
-                    colourArg2 == rhs.colourArg2 &&
-                    factor == rhs.factor)
-                {
-                    return true;
-                }
-            }
-            else // if (blendType == LBT_ALPHA)
-            {
-                if (operation == rhs.operation &&
-                    source1 == rhs.source1 &&
-                    source2 == rhs.source2 &&
-                    alphaArg1 == rhs.alphaArg1 &&
-                    alphaArg2 == rhs.alphaArg2 &&
-                    factor == rhs.factor)
-                {
-                    return true;
-                }
-            }
-            return false;
-        }
-
-        bool operator!=(const LayerBlendModeEx& rhs) const
-        {
-            return !(*this == rhs);
-        }
-
-
-
-    };
-
-    /** Types of blending that you can specify between an object and the existing contents of the scene.
-        @remarks
-            As opposed to the LayerBlendType, which classifies blends between texture layers, these blending
-            types blend between the output of the texture units and the pixels already in the viewport,
-            allowing for object transparency, glows, etc.
-        @par
-            These types are provided to give quick and easy access to common effects. You can also use
-            the more manual method of supplying source and destination blending factors.
-            See Material::setSceneBlending for more details.
-        @see
-            Material::setSceneBlending
-    */
-    enum SceneBlendType
-    {
-        /// Make the object transparent based on the final alpha values in the texture
-        SBT_TRANSPARENT_ALPHA,
-        /// Make the object transparent based on the colour values in the texture (brighter = more opaque)
-        SBT_TRANSPARENT_COLOUR,
-        /// Add the texture values to the existing scene content
-        SBT_ADD,
-		/// Multiply the 2 colours together
-		SBT_MODULATE,
-        /// The default blend mode where source replaces destination
-        SBT_REPLACE
-        // TODO : more
-    };
-
-    /** Blending factors for manually blending objects with the scene. If there isn't a predefined
-        SceneBlendType that you like, then you can specify the blending factors directly to affect the
-        combination of object and the existing scene. See Material::setSceneBlending for more details.
-    */
-    enum SceneBlendFactor
-    {
-        SBF_ONE,
-        SBF_ZERO,
-        SBF_DEST_COLOUR,
-        SBF_SOURCE_COLOUR,
-        SBF_ONE_MINUS_DEST_COLOUR,
-        SBF_ONE_MINUS_SOURCE_COLOUR,
-        SBF_DEST_ALPHA,
-        SBF_SOURCE_ALPHA,
-        SBF_ONE_MINUS_DEST_ALPHA,
-        SBF_ONE_MINUS_SOURCE_ALPHA
-
-    };
-
-	/** Blending operations controls how objects are blended into the scene. The default operation
-		is add (+) but by changing this you can change how drawn objects are blended into the
-		existing scene.
-	*/
-	enum SceneBlendOperation
-	{
-		SBO_ADD,
-		SBO_SUBTRACT,
-		SBO_REVERSE_SUBTRACT,
-		SBO_MIN,
-		SBO_MAX
-	};
-	/** @} */
-	/** @} */
-
-}
-
-#endif

+ 32 - 9
CamelotRenderer/CmCommon.h

@@ -50,6 +50,38 @@ namespace CamelotEngine {
 	*  @{
 	*/
 
+	/** Blending factors for manually blending objects with the scene. If there isn't a predefined
+        SceneBlendType that you like, then you can specify the blending factors directly to affect the
+        combination of object and the existing scene. See Material::setSceneBlending for more details.
+    */
+    enum SceneBlendFactor
+    {
+        SBF_ONE,
+        SBF_ZERO,
+        SBF_DEST_COLOUR,
+        SBF_SOURCE_COLOUR,
+        SBF_ONE_MINUS_DEST_COLOUR,
+        SBF_ONE_MINUS_SOURCE_COLOUR,
+        SBF_DEST_ALPHA,
+        SBF_SOURCE_ALPHA,
+        SBF_ONE_MINUS_DEST_ALPHA,
+        SBF_ONE_MINUS_SOURCE_ALPHA
+
+    };
+
+	/** Blending operations controls how objects are blended into the scene. The default operation
+		is add (+) but by changing this you can change how drawn objects are blended into the
+		existing scene.
+	*/
+	enum SceneBlendOperation
+	{
+		SBO_ADD,
+		SBO_SUBTRACT,
+		SBO_REVERSE_SUBTRACT,
+		SBO_MIN,
+		SBO_MAX
+	};
+
     /** Comparison functions used for the depth/stencil buffer operations and 
 		others. */
     enum CompareFunction
@@ -154,15 +186,6 @@ namespace CamelotEngine {
         TVC_EMISSIVE    = 0x8
     };
 
-    /** Sort mode for billboard-set and particle-system */
-    enum SortMode
-    {
-        /** Sort by direction of the camera */
-        SM_DIRECTION,
-        /** Sort by distance from the camera */
-        SM_DISTANCE
-    };
-
     /** Defines the frame buffer types. */
     enum FrameBufferType {
         FBT_COLOUR  = 0x1,

+ 0 - 74
CamelotRenderer/CmD3D9Mappings.cpp

@@ -103,80 +103,6 @@ namespace CamelotEngine
 		return D3DTADDRESS_FORCE_DWORD;
 	}
 	//---------------------------------------------------------------------
-	D3DTEXTURESTAGESTATETYPE D3D9Mappings::get(LayerBlendType lbt)
-	{
-		switch( lbt )
-		{
-		case LBT_COLOUR:
-			return D3DTSS_COLOROP;
-		case LBT_ALPHA:
-			return D3DTSS_ALPHAOP;
-		}
-		return  D3DTSS_FORCE_DWORD;
-	}
-	//---------------------------------------------------------------------
-	DWORD D3D9Mappings::get(LayerBlendSource lbs, bool perStageConstants)
-	{
-		switch( lbs )
-		{
-		case LBS_CURRENT:
-			return D3DTA_CURRENT;
-		case LBS_TEXTURE:
-			return D3DTA_TEXTURE;
-		case LBS_DIFFUSE:
-			return D3DTA_DIFFUSE;
-		case LBS_SPECULAR:
-			return D3DTA_SPECULAR;
-		case LBS_MANUAL:
-			return perStageConstants ? D3DTA_CONSTANT : D3DTA_TFACTOR;
-		}
-		return 0;
-	}
-	//---------------------------------------------------------------------
-	DWORD D3D9Mappings::get(LayerBlendOperationEx lbo, const D3DCAPS9& devCaps)
-	{
-		switch( lbo )
-		{
-		case LBX_SOURCE1:
-			return D3DTOP_SELECTARG1;
-		case LBX_SOURCE2:
-			return D3DTOP_SELECTARG2;
-		case LBX_MODULATE:
-			return D3DTOP_MODULATE;
-		case LBX_MODULATE_X2:
-			return D3DTOP_MODULATE2X;
-		case LBX_MODULATE_X4:
-			return D3DTOP_MODULATE4X;
-		case LBX_ADD:
-			return D3DTOP_ADD;
-		case LBX_ADD_SIGNED:
-			return D3DTOP_ADDSIGNED;
-		case LBX_ADD_SMOOTH:
-			return D3DTOP_ADDSMOOTH;
-		case LBX_SUBTRACT:
-			return D3DTOP_SUBTRACT;
-		case LBX_BLEND_DIFFUSE_ALPHA:
-			return D3DTOP_BLENDDIFFUSEALPHA;
-		case LBX_BLEND_TEXTURE_ALPHA:
-			return D3DTOP_BLENDTEXTUREALPHA;
-		case LBX_BLEND_CURRENT_ALPHA:
-			return D3DTOP_BLENDCURRENTALPHA;
-		case LBX_BLEND_MANUAL:
-			return D3DTOP_BLENDFACTORALPHA;
-		case LBX_DOTPRODUCT:
-			if (devCaps.TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3)
-				return D3DTOP_DOTPRODUCT3;
-			else
-				return D3DTOP_MODULATE;
-		case LBX_BLEND_DIFFUSE_COLOUR:
-			if (devCaps.TextureOpCaps & D3DTEXOPCAPS_LERP)
-				return D3DTOP_LERP;
-			else
-				return D3DTOP_MODULATE;
-		}
-		return 0;
-	}
-	//---------------------------------------------------------------------
 	D3DBLEND D3D9Mappings::get(SceneBlendFactor sbf)
 	{
 		switch( sbf )

+ 0 - 6
CamelotRenderer/CmD3D9Mappings.h

@@ -69,12 +69,6 @@ namespace CamelotEngine
 		static DWORD get(TexCoordCalcMethod m, const D3DCAPS9& caps);
 		/// return a D3D9 equivalent for a Ogre TextureAddressingMode value
 		static D3DTEXTUREADDRESS get(TextureState::TextureAddressingMode tam, const D3DCAPS9& devCaps);
-		/// return a D3D9 equivalent for a Ogre LayerBlendType value
-		static D3DTEXTURESTAGESTATETYPE get(LayerBlendType lbt);
-		/// return a D3D9 equivalent for a Ogre LayerBlendOperationEx value
-		static DWORD get(LayerBlendOperationEx lbo, const D3DCAPS9& devCaps);
-		/// return a D3D9 equivalent for a Ogre LayerBlendSource value
-		static DWORD get(LayerBlendSource lbs, bool perStageConstants);
 		/// return a D3D9 equivalent for a Ogre SceneBlendFactor value
 		static D3DBLEND get(SceneBlendFactor sbf);
 		/// return a D3D9 equivlalent for a Ogre SceneBlendOperation value

+ 0 - 124
CamelotRenderer/CmD3D9RenderSystem.cpp

@@ -2031,130 +2031,6 @@ namespace CamelotEngine
 			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set texture border colour", "D3D9RenderSystem::_setTextureBorderColour" );
 	}
 	//---------------------------------------------------------------------
-	void D3D9RenderSystem::_setTextureBlendMode( size_t stage, const LayerBlendModeEx& bm )
-	{
-		HRESULT hr = S_OK;
-		D3DTEXTURESTAGESTATETYPE tss;
-		D3DCOLOR manualD3D;
-
-		// choose type of blend.
-		if( bm.blendType == LBT_COLOUR )
-			tss = D3DTSS_COLOROP;
-		else if( bm.blendType == LBT_ALPHA )
-			tss = D3DTSS_ALPHAOP;
-		else
-			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
-			"Invalid blend type", "D3D9RenderSystem::_setTextureBlendMode");
-
-		// set manual factor if required by operation
-		if (bm.operation == LBX_BLEND_MANUAL)
-		{
-			hr = __SetRenderState( D3DRS_TEXTUREFACTOR, D3DXCOLOR(0.0, 0.0, 0.0,  bm.factor) );
-			if (FAILED(hr))
-				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set manual factor", "D3D9RenderSystem::_setTextureBlendMode" );
-		}
-		// set operation
-		hr = __SetTextureStageState( static_cast<DWORD>(stage), tss, D3D9Mappings::get(bm.operation, mDeviceManager->getActiveDevice()->getD3D9DeviceCaps()) );
-		if (FAILED(hr))
-			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set operation", "D3D9RenderSystem::_setTextureBlendMode" );
-
-		// choose source 1
-		if( bm.blendType == LBT_COLOUR )
-		{
-			tss = D3DTSS_COLORARG1;
-			manualD3D = D3DXCOLOR( bm.colourArg1.r, bm.colourArg1.g, bm.colourArg1.b, bm.colourArg1.a );
-			mManualBlendColours[stage][0] = bm.colourArg1;
-		}
-		else if( bm.blendType == LBT_ALPHA )
-		{
-			tss = D3DTSS_ALPHAARG1;
-			manualD3D = D3DXCOLOR( mManualBlendColours[stage][0].r, 
-				mManualBlendColours[stage][0].g, 
-				mManualBlendColours[stage][0].b, bm.alphaArg1 );
-		}
-		else
-		{
-			OGRE_EXCEPT(Exception::ERR_INVALIDPARAMS, 
-				"Invalid blend type", "D3D9RenderSystem::_setTextureBlendMode");
-		}
-		// Set manual factor if required
-		if (bm.source1 == LBS_MANUAL)
-		{
-			if (mCurrentCapabilities->hasCapability(RSC_PERSTAGECONSTANT))
-			{
-				// Per-stage state
-				hr = __SetTextureStageState(static_cast<DWORD>(stage), D3DTSS_CONSTANT, manualD3D);
-			}
-			else
-			{
-				// Global state
-				hr = __SetRenderState( D3DRS_TEXTUREFACTOR, manualD3D );
-			}
-			if (FAILED(hr))
-				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set manual factor", "D3D9RenderSystem::_setTextureBlendMode" );
-		}
-		// set source 1
-		hr = __SetTextureStageState( static_cast<DWORD>(stage), tss, D3D9Mappings::get(bm.source1, mCurrentCapabilities->hasCapability(RSC_PERSTAGECONSTANT)) );
-		if (FAILED(hr))
-			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set source1", "D3D9RenderSystem::_setTextureBlendMode" );
-
-		// choose source 2
-		if( bm.blendType == LBT_COLOUR )
-		{
-			tss = D3DTSS_COLORARG2;
-			manualD3D = D3DXCOLOR( bm.colourArg2.r, bm.colourArg2.g, bm.colourArg2.b, bm.colourArg2.a );
-			mManualBlendColours[stage][1] = bm.colourArg2;
-		}
-		else if( bm.blendType == LBT_ALPHA )
-		{
-			tss = D3DTSS_ALPHAARG2;
-			manualD3D = D3DXCOLOR( mManualBlendColours[stage][1].r, 
-				mManualBlendColours[stage][1].g, 
-				mManualBlendColours[stage][1].b, 
-				bm.alphaArg2 );
-		}
-		// Set manual factor if required
-		if (bm.source2 == LBS_MANUAL)
-		{
-			if (mCurrentCapabilities->hasCapability(RSC_PERSTAGECONSTANT))
-			{
-				// Per-stage state
-				hr = __SetTextureStageState(static_cast<DWORD>(stage), D3DTSS_CONSTANT, manualD3D);
-			}
-			else
-			{
-				hr = __SetRenderState( D3DRS_TEXTUREFACTOR, manualD3D );
-			}
-			if (FAILED(hr))
-				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set manual factor", "D3D9RenderSystem::_setTextureBlendMode" );
-		}
-		// Now set source 2
-		hr = __SetTextureStageState( static_cast<DWORD>(stage), tss, D3D9Mappings::get(bm.source2, mCurrentCapabilities->hasCapability(RSC_PERSTAGECONSTANT)) );
-		if (FAILED(hr))
-			OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set source 2", "D3D9RenderSystem::_setTextureBlendMode" );
-
-		// Set interpolation factor if lerping
-		if (bm.operation == LBX_BLEND_DIFFUSE_COLOUR && 
-			mDeviceManager->getActiveDevice()->getD3D9DeviceCaps().TextureOpCaps & D3DTEXOPCAPS_LERP)
-		{
-			// choose source 0 (lerp factor)
-			if( bm.blendType == LBT_COLOUR )
-			{
-				tss = D3DTSS_COLORARG0;
-			}
-			else if( bm.blendType == LBT_ALPHA )
-			{
-				tss = D3DTSS_ALPHAARG0;
-			}
-			hr = __SetTextureStageState(static_cast<DWORD>(stage), tss, D3DTA_DIFFUSE);
-
-			if (FAILED(hr))
-				OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, "Failed to set lerp source 0", 
-				"D3D9RenderSystem::_setTextureBlendMode" );
-
-		}
-	}
-	//---------------------------------------------------------------------
 	void D3D9RenderSystem::_setSceneBlending( SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendOperation op )
 	{
 		HRESULT hr;

+ 0 - 1
CamelotRenderer/CmD3D9RenderSystem.h

@@ -235,7 +235,6 @@ namespace CamelotEngine
 		void _setTextureCoordSet( size_t unit, size_t index );
         void _setTextureCoordCalculation(size_t unit, TexCoordCalcMethod m, 
             const Frustum* frustum = 0);
-		void _setTextureBlendMode( size_t unit, const LayerBlendModeEx& bm );
         void _setTextureAddressingMode(size_t stage, const TextureState::UVWAddressingMode& uvw);
         void _setTextureBorderColour(size_t stage, const Color& colour);
 		void _setTextureMipmapBias(size_t unit, float bias);

+ 0 - 82
CamelotRenderer/CmHeaderPrefix.h

@@ -1,82 +0,0 @@
-/*-------------------------------------------------------------------------
-This source file is a 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 __OgreHeaderPrefix_H__
-#define __OgreHeaderPrefix_H__
-
-#include "CmPrerequisites.h"
-
-#if CM_COMPILER == CM_COMPILER_MSVC
-
-// Save warnings state
-#   pragma warning (push)
-// Turn off warnings generated by long std templates
-// This warns about truncation to 255 characters in debug/browse info
-#   pragma warning (disable : 4786)
-
-// Turn off warnings generated by long std templates
-// This warns about truncation to 255 characters in debug/browse info
-#   pragma warning (disable : 4503)
-
-// disable: "<type> needs to have dll-interface to be used by clients'
-// Happens on STL member variables which are not public therefore is ok
-#   pragma warning (disable : 4251)
-
-// disable: "non dll-interface class used as base for dll-interface class"
-// Happens when deriving from Singleton because bug in compiler ignores
-// template export
-#   pragma warning (disable : 4275)
-
-// disable: "C++ Exception Specification ignored"
-// This is because MSVC 6 did not implement all the C++ exception
-// specifications in the ANSI C++ draft.
-#   pragma warning( disable : 4290 )
-
-// disable: "no suitable definition provided for explicit template
-// instantiation request" Occurs in VC7 for no justifiable reason on all
-// #includes of Singleton
-#   pragma warning( disable: 4661)
-
-// disable: deprecation warnings when using CRT calls in VC8
-// These show up on all C runtime lib code in VC8, disable since they clutter
-// the warnings with things we may not be able to do anything about (e.g.
-// generated code from nvparse etc). I doubt very much that these calls
-// will ever be actually removed from VC anyway, it would break too much code.
-#	pragma warning( disable: 4996)
-
-// disable: "conditional expression constant", always occurs on 
-// OGRE_MUTEX_CONDITIONAL when no threading enabled
-#   pragma warning (disable : 201)
-
-// disable: "unreferenced formal parameter"
-// Many versions of VC have bugs which generate this error in cases where they shouldn't
-#   pragma warning (disable : 4100)
-
-#endif
-
-
-#endif
-
-

+ 0 - 44
CamelotRenderer/CmHeaderSuffix.h

@@ -1,44 +0,0 @@
-/*-------------------------------------------------------------------------
-This source file is a 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 __OgreHeaderPrefix_H__
-#define __OgreHeaderPrefix_H__
-
-#include "CmPrerequisites.h"
-
-#if CM_COMPILER == CM_COMPILER_MSVC
-
-// restore previous warnings settings
-#   pragma warning (pop)
-
-
-#endif
-
-
-#endif
-// allow inclusion of prefix again now (this is scoped)
-#undef __OgreHeaderPrefix_H__
-
-

+ 0 - 8
CamelotRenderer/CmRenderSystem.h

@@ -651,14 +651,6 @@ namespace CamelotEngine
 		virtual void _setTextureCoordCalculation(size_t unit, TexCoordCalcMethod m, 
 			const Frustum* frustum = 0) = 0;
 
-		/** Sets the texture blend modes from a TextureUnitState record.
-		Meant for use internally only - apps should use the Material
-		and TextureUnitState classes.
-		@param unit Texture unit as above
-		@param bm Details of the blending mode
-		*/
-		virtual void _setTextureBlendMode(size_t unit, const LayerBlendModeEx& bm) = 0;
-
 		/** Sets the filtering options for a given texture unit.
 		@param unit The texture unit to set the filtering options for
 		@param minFilter The filter used when a texture is reduced in size

+ 0 - 1
CamelotRenderer/CmTextureState.h

@@ -30,7 +30,6 @@ THE SOFTWARE.
 
 #include "CmPrerequisites.h"
 #include "CmCommon.h"
-#include "CmBlendMode.h"
 #include "CmMatrix4.h"
 #include "CmString.h"
 #include "CmPixelFormat.h"

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

@@ -266,10 +266,6 @@ namespace CamelotEngine {
          */
         void _setTextureCoordCalculation(size_t stage, TexCoordCalcMethod m, 
             const Frustum* frustum = 0);
-        /** See
-          RenderSystem
-         */
-        void _setTextureBlendMode(size_t stage, const LayerBlendModeEx& bm);
         /** See
           RenderSystem
          */

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

@@ -2291,228 +2291,6 @@ namespace CamelotEngine {
 
 		activateGLTextureUnit(0);
 	}
-	//-----------------------------------------------------------------------------
-	void GLRenderSystem::_setTextureBlendMode(size_t stage, const LayerBlendModeEx& bm)
-	{       
-		if (stage >= mFixedFunctionTextureUnits)
-		{
-			// Can't do this
-			return;
-		}
-
-		// Check to see if blending is supported
-		if(!mCurrentCapabilities->hasCapability(RSC_BLENDING))
-			return;
-
-		GLenum src1op, src2op, cmd;
-		GLfloat cv1[4], cv2[4];
-
-		if (bm.blendType == LBT_COLOUR)
-		{
-			cv1[0] = bm.colourArg1.r;
-			cv1[1] = bm.colourArg1.g;
-			cv1[2] = bm.colourArg1.b;
-			cv1[3] = bm.colourArg1.a;
-			mManualBlendColours[stage][0] = bm.colourArg1;
-
-
-			cv2[0] = bm.colourArg2.r;
-			cv2[1] = bm.colourArg2.g;
-			cv2[2] = bm.colourArg2.b;
-			cv2[3] = bm.colourArg2.a;
-			mManualBlendColours[stage][1] = bm.colourArg2;
-		}
-
-		if (bm.blendType == LBT_ALPHA)
-		{
-			cv1[0] = mManualBlendColours[stage][0].r;
-			cv1[1] = mManualBlendColours[stage][0].g;
-			cv1[2] = mManualBlendColours[stage][0].b;
-			cv1[3] = bm.alphaArg1;
-
-			cv2[0] = mManualBlendColours[stage][1].r;
-			cv2[1] = mManualBlendColours[stage][1].g;
-			cv2[2] = mManualBlendColours[stage][1].b;
-			cv2[3] = bm.alphaArg2;
-		}
-
-		switch (bm.source1)
-		{
-		case LBS_CURRENT:
-			src1op = GL_PREVIOUS;
-			break;
-		case LBS_TEXTURE:
-			src1op = GL_TEXTURE;
-			break;
-		case LBS_MANUAL:
-			src1op = GL_CONSTANT;
-			break;
-		case LBS_DIFFUSE:
-			src1op = GL_PRIMARY_COLOR;
-			break;
-			// XXX
-		case LBS_SPECULAR:
-			src1op = GL_PRIMARY_COLOR;
-			break;
-		default:
-			src1op = 0;
-		}
-
-		switch (bm.source2)
-		{
-		case LBS_CURRENT:
-			src2op = GL_PREVIOUS;
-			break;
-		case LBS_TEXTURE:
-			src2op = GL_TEXTURE;
-			break;
-		case LBS_MANUAL:
-			src2op = GL_CONSTANT;
-			break;
-		case LBS_DIFFUSE:
-			src2op = GL_PRIMARY_COLOR;
-			break;
-			// XXX
-		case LBS_SPECULAR:
-			src2op = GL_PRIMARY_COLOR;
-			break;
-		default:
-			src2op = 0;
-		}
-
-		switch (bm.operation)
-		{
-		case LBX_SOURCE1:
-			cmd = GL_REPLACE;
-			break;
-		case LBX_SOURCE2:
-			cmd = GL_REPLACE;
-			break;
-		case LBX_MODULATE:
-			cmd = GL_MODULATE;
-			break;
-		case LBX_MODULATE_X2:
-			cmd = GL_MODULATE;
-			break;
-		case LBX_MODULATE_X4:
-			cmd = GL_MODULATE;
-			break;
-		case LBX_ADD:
-			cmd = GL_ADD;
-			break;
-		case LBX_ADD_SIGNED:
-			cmd = GL_ADD_SIGNED;
-			break;
-		case LBX_ADD_SMOOTH:
-			cmd = GL_INTERPOLATE;
-			break;
-		case LBX_SUBTRACT:
-			cmd = GL_SUBTRACT;
-			break;
-		case LBX_BLEND_DIFFUSE_COLOUR:
-			cmd = GL_INTERPOLATE;
-			break; 
-		case LBX_BLEND_DIFFUSE_ALPHA:
-			cmd = GL_INTERPOLATE;
-			break;
-		case LBX_BLEND_TEXTURE_ALPHA:
-			cmd = GL_INTERPOLATE;
-			break;
-		case LBX_BLEND_CURRENT_ALPHA:
-			cmd = GL_INTERPOLATE;
-			break;
-		case LBX_BLEND_MANUAL:
-			cmd = GL_INTERPOLATE;
-			break;
-		case LBX_DOTPRODUCT:
-			cmd = mCurrentCapabilities->hasCapability(RSC_DOT3) 
-				? GL_DOT3_RGB : GL_MODULATE;
-			break;
-		default:
-			cmd = 0;
-		}
-
-		if (!activateGLTextureUnit(stage))
-			return;
-		glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE);
-
-		if (bm.blendType == LBT_COLOUR)
-		{
-			glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB, cmd);
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB, src1op);
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB, src2op);
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_CONSTANT);
-		}
-		else
-		{
-			glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, cmd);
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA, src1op);
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_ALPHA, src2op);
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, GL_CONSTANT);
-		}
-
-		float blendValue[4] = {0, 0, 0, bm.factor};
-		switch (bm.operation)
-		{
-		case LBX_BLEND_DIFFUSE_COLOUR:
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_PRIMARY_COLOR);
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, GL_PRIMARY_COLOR);
-			break;
-		case LBX_BLEND_DIFFUSE_ALPHA:
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_PRIMARY_COLOR);
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, GL_PRIMARY_COLOR);
-			break;
-		case LBX_BLEND_TEXTURE_ALPHA:
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_TEXTURE);
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, GL_TEXTURE);
-			break;
-		case LBX_BLEND_CURRENT_ALPHA:
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB, GL_PREVIOUS);
-			glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_ALPHA, GL_PREVIOUS);
-			break;
-		case LBX_BLEND_MANUAL:
-			glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, blendValue);
-			break;
-		default:
-			break;
-		};
-
-		switch (bm.operation)
-		{
-		case LBX_MODULATE_X2:
-			glTexEnvi(GL_TEXTURE_ENV, bm.blendType == LBT_COLOUR ? 
-GL_RGB_SCALE : GL_ALPHA_SCALE, 2);
-			break;
-		case LBX_MODULATE_X4:
-			glTexEnvi(GL_TEXTURE_ENV, bm.blendType == LBT_COLOUR ? 
-GL_RGB_SCALE : GL_ALPHA_SCALE, 4);
-			break;
-		default:
-			glTexEnvi(GL_TEXTURE_ENV, bm.blendType == LBT_COLOUR ? 
-GL_RGB_SCALE : GL_ALPHA_SCALE, 1);
-			break;
-		}
-
-		if (bm.blendType == LBT_COLOUR){
-			glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB, GL_SRC_COLOR);
-			glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB, GL_SRC_COLOR);
-			if (bm.operation == LBX_BLEND_DIFFUSE_COLOUR){
-				glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_COLOR);
-			} else {
-				glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB, GL_SRC_ALPHA);
-			}
-		} 
-
-		glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA, GL_SRC_ALPHA);
-		glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_ALPHA, GL_SRC_ALPHA);
-		glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_ALPHA, GL_SRC_ALPHA);
-		if(bm.source1 == LBS_MANUAL)
-			glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, cv1);
-		if (bm.source2 == LBS_MANUAL)
-			glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, cv2);
-
-		activateGLTextureUnit(0);
-	}
 	//---------------------------------------------------------------------
 	void GLRenderSystem::setVertexDeclaration(VertexDeclaration* decl)
 	{

+ 3 - 2
CamelotRenderer/TODO.txt

@@ -65,7 +65,8 @@ Other notes:
  - Rename all macros and other OGRE references to CM
  - How am I notified on device reset? (When I need to reload my resources)
  - If possible, make sure GLSL uses EntryPoint and Profile fields I have added to GpuProgram
- 
+ - Remove all fixed pipeline methods from D3D9 and OpenGL renderers
+
  At one point rebuild everything and make sure all warnings are gone
 Figure out how to ignore those warnings in NVparse
 String stuff should go to a single StringUtil file
@@ -80,7 +81,7 @@ After everything is polished:
  - I should move boost so it resides in CamelotUtility
  - Also, create all file format parsers and also make them reside in CamelotUtility
    (Actual importers will still be implemented in Editor, but parsing capabilities should be available for camelotutility)
-
+ 
  - Go to Game Engine Architecture book and make a list of Utility systems we will need (Config files, Parsers, File I/O etc)
  - Go to GEA book and read about resource managers before implementing them
    - Actually I should re-read most of the chapers in the book, or all of it