/**
*
* \file Asura_Decal_Template.h
*
* Created by Kevin Lea - 12/12/2002 15:01:07
*
* Copyright (C) 2002 Rebellion, All Rights Reserved.
*
* \brief
*
**/
#ifdef ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif

#ifndef __ASURA_DECAL_TEMPLATE_H__
#define __ASURA_DECAL_TEMPLATE_H__

#include "Core/Asura_TextureFlags.h"

enum ASURA_DECAL_FLAGS
{
	ASURA_DECAL_NOFLAGS				= 0,
	ASURA_DECAL_CLIPTOENVIRONMENT	= 1,
	ASURA_DECAL_RANDOMROTATION		= 2,
	ASURA_DECAL_LIGHTONCREATION		= 4,
	ASURA_DECAL_DETAILMAP			= 8	
};

class Asura_Decal_Template
{
	public:

		float	m_fU;
		float	m_fV;

		float	m_fDeltaU;
		float	m_fDeltaV;

		float	m_fHeight;
		float	m_fWidth;
		float	m_fDepth;

#ifdef ASURA_TARGET_SM3
		int		m_iDecalMaterialIndex;
#else
		int		m_iTextureIndex;
#endif

		/// Kevin Lea - 12/12/2002 15:55:51 - Probably worth adding any flags as 
		/// define/enum values rather than a bitfield in this case, so if a new
		/// flag is added the declarations of decal templates don't have to change
		/// in all projects.
		u_int	m_uFlags;
};


#ifdef ASURA_TARGET_SM3

// Dave Reed - 11/12/06 - Instead of just extending the template struct, the material is now separated
// out, so all templates using the same material can be rendered as one batch.


class Asura_Decal_Material
{
public:
		Asura_Hash_ID m_uMaterialResponseHash;

		int		m_iMaxDecals;					// Max decals of this material type
		float	m_fFadeInTime;					// Length of the fade-in (secs)
		float	m_fFadeOutTime;					// Length of the fade-out (secs)
		float	m_fDecalStayTime;				// Time before the fade-out (secs), or -1 for 'stay forever'

		float	m_fUScrollSpeed;
		float	m_fVScrollSpeed;
		float	m_fUScrollRange;
		float	m_fVScrollRange;


		Asura_Decal_Material()
		{
			m_uMaterialResponseHash = ASURA_HASH_ID_UNSET;

			m_iMaxDecals            = 128;
			m_fFadeInTime			= 0.2f;
			m_fFadeOutTime			= 3.0f;
			m_fDecalStayTime		= 10.0f;
			m_fUScrollSpeed			= 0.0f;
			m_fVScrollSpeed			= 0.0f;
			m_fUScrollRange			= 0.0f;
			m_fVScrollRange			= 0.0f;
		}
};
#endif


#endif//__ASURA_DECAL_TEMPLATE_H__
