//-----------------------------------------------------------------------------------------------
// BasicTypes.cpp
//
#include "GypsyPrecompiledHeader.hpp"

//-----------------------------------------------------------------------------------------------
#include "Engine/Core/BasicTypes.hpp"
#include "Engine/Core/ErrorWarningAssert.hpp"


//-----------------------------------------------------------------------------------------------
void GetBlendFactorsForBlendModeString( const std::string& blendModeString, BlendFactor& srcBlendFactor_out, BlendFactor& dstBlendFactor_out )
{
	if( blendModeString == "add" )
	{
		srcBlendFactor_out = BLENDFACTOR_SRC_ALPHA;
		dstBlendFactor_out = BLENDFACTOR_ONE;
	}
	else if( blendModeString == "multiply" )
	{
		srcBlendFactor_out = BLENDFACTOR_ZERO;
		dstBlendFactor_out = BLENDFACTOR_SRC_COLOR;
	}
	else if( blendModeString == "alpha" )
	{
		srcBlendFactor_out = BLENDFACTOR_SRC_ALPHA;
		dstBlendFactor_out = BLENDFACTOR_ONE_MINUS_SRC_ALPHA;
	}
	else
	{
		RECOVERABLE_ERROR( "Some text" );
//		RECOVERABLE_ERROR( Stringf( "Unknown blend mode name \"%s\"", blendModeString.c_str() ).c_str() );
		srcBlendFactor_out = BLENDFACTOR_SRC_ALPHA;
		dstBlendFactor_out = BLENDFACTOR_ONE_MINUS_SRC_ALPHA;
	}
}


