/* -----------------------------------------------------------------------------
	GSFramework
	Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
----------------------------------------------------------------------------- */


		#include "core/material_channel.h"
		#include "nstring/nstring.h"


//------------------------------------------------------------------------------
const char			*GS::Core::MaterialChannelName(MaterialChannel channel)
{
	switch (channel)
	{
		case Channel_Diffuse:		return "Diffuse";
		case Channel_Decal:			return "Decal";
		case Channel_Opacity:		return "Opacity";
		case Channel_Specular:		return "Specular";
		case Channel_Glossiness:	return "Glossiness";
		case Channel_Normal:		return "Normal";
		case Channel_Reflection:	return "Reflection";
		case Channel_SelfIllum:		return "SelfIllum";
		case Channel_Light:			return "Light";
		case Channel_BlendRGB:		return "BlendRGB";

		default:
			break;
	}
	return "None";
}
GS::Core::MaterialChannel GS::Core::MaterialChannelFromName(const char *channel)
{
	GS::String c(channel);

			if	(c == "Diffuse")		return Channel_Diffuse;
	else	if	(c == "Decal")			return Channel_Decal;
	else	if	(c == "Opacity")		return Channel_Opacity;
	else	if	(c == "Specular")		return Channel_Specular;
	else	if	(c == "Glossiness")		return Channel_Glossiness;
	else	if	(c == "Normal")			return Channel_Normal;
	else	if	(c == "Reflection")		return Channel_Reflection;
	else	if	(c == "SelfIllum")		return Channel_SelfIllum;
	else	if	(c == "BlendRGB")		return Channel_BlendRGB;
	else	if	(c == "Light")			return Channel_Light;
#if		1
	else	if	(c == "Detail")			return Channel_Decal;
	else	if	(c == "VertexColor")	return Channel_Light;
	else	if	(c == "Color")			return Channel_Light;
#endif

	return Channel_None;
}
//------------------------------------------------------------------------------
