//
// Asura_Chunk_PFX.h
//
// Created by KOR - 21/06/2004 12:17:13
//
// Contains chunks for particle, source and effect templates.
//
// Copyright (C) 2004 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
	#pragma once
#endif

#ifndef __ASURA_CHUNK_PFX_H__
#define __ASURA_CHUNK_PFX_H__

// Asura headers
#include "ChunkSystem/Asura_Chunk_Loaders.h"
#include "Core/Asura_Hash.h"
#ifdef ASURA_TOOLS
#include "Core/Asura_String.h"
#endif

// Forward defines
class Asura_Chunk_Stream;
class Asura_PFX_Particle_Template;
class Asura_PFX_Source_Template;
class Asura_PFX_Effect_Template;

class Asura_Chunk_PFX_ParticleTemp : public Asura_Chunk_Header
{
	public:
		bool Process(Asura_Handle fileHandle) const;
#ifdef ASURA_TOOLS
		static void Create(const Asura_PFX_Particle_Template* pxTemplate, const Asura_String* pxName, Asura_Chunk_Stream& xStream, bool bExport);

		typedef void (OutputOverride)(Asura_PFX_Particle_Template& xTemplate, const Asura_String* pxName);
		static void SetOutputOverride(OutputOverride* const pfnOverride = NULL) { s_pfnOutputOverride = pfnOverride; };
		static OutputOverride* s_pfnOutputOverride;
#endif

	// Members
	Asura_Hash_ID	m_uNameHash;
	enum
	{
		CHUNK_VERSION = 15,
		//Version 15 - Added sound event ID. (RAR - 15/04/2009)
		//Version 14 - Replaced unused m_bUseVelocityDependentRotation with sprite rotation flag. (KOR - 07/02/2008)
		//Version 13 - Added volumetric depth scale (DMR 17/11/06)
		//Version 12 - Added texture name
		//Version 11 - Added looping animation and frames per second control (KOR - 16/06/2005)
		//Version 10 = Added far fade distances (RAR - 05/05/2005)
		//Version 9 - Random lifetime (KOR - 19/02/2005)
		//Version 8 - Integrate rotation samples on export instead of load (KOR - 11/01/2005)
		//Version 7 - Added near fade distances (KOR - 6/01/2005)
		//Version 6 - Added lighting scale (KOR - 15/12/2004)
		//Version 5 - Added fixed rotations and align with effect (KOR - 15/12/2004)
		//Version 4 - Added motion blur length (KOR - 22/09/2004)
		//Version 3 - Added multiple frames of texture coordinates
		//		(RAR 15/09/04)
	};
};

class Asura_Chunk_PFX_SourceTemp : public Asura_Chunk_Header
{
	public:
		bool Process(Asura_Handle fileHandle) const;
#ifdef ASURA_TOOLS
		static void Create(const Asura_PFX_Source_Template* pxTemplate, const Asura_String* pxName, Asura_Chunk_Stream& xStream, bool bExport);
#endif

	// Members
	Asura_Hash_ID	m_uNameHash;
	enum
	{
		CHUNK_VERSION = 5 ,
		//Version 5 - Added spawn source index (KOR - 09/06/2005)
		//Version 4 - Added range. (KOR - 05/01/2005)
		//Version 3 - Changed angle + spread to 3-vectors. Added/removed a few flags. Added timescale. Changed gravity. Added turbulence. (KOR - 18/12/2004)
		//Version 2 - m_xVolume removed
		//		(RAR 13/09/04)
	};
};

class Asura_Chunk_PFX_EffectTemp : public Asura_Chunk_Header
{
	public:
		bool Process(Asura_Handle fileHandle) const;
#ifdef ASURA_TOOLS
		static void Create(const Asura_PFX_Effect_Template* pxTemplate, const Asura_String* pxName, Asura_Chunk_Stream& xStream, bool bExport);
#endif

	// Members
	Asura_Hash_ID	m_uNameHash;
	enum
	{
		CHUNK_VERSION = 15,
		//Version 15 - Removed non sound event sounds (RAR 09/07/2008)
		//Version 14 - Add sound events (RAR 19/07/2006)
		//Version 13 - Photon per particle source index (RAR 29/06/2006)
		//Version 12 - Min/Max time delay for sounds (RAR 22/06/2006)
		//Version 11 - Inner/outer range and volume for sounds (RAR 21/10/2005)
		//Version 10 - Sound changed to use filenames (RAR 12/09/2005)
		//Version 9 - always on top flag added. Zeros rest of flags on load so we don't have to change the loader as much (KOR - 18/07/2005)
		//Version 8 - particle photons added (KOR - 22/06/2005)
		//Version 7 - platform overrides added(RAR - 31/03/2005)
		//Version 6 - sound looping added (KOR - 20/01/2005)
		//Version 5 - source orientation ID added (KOR - 12/01/2005)
		//Version 4 - Pregenerate added (KOR - 12/01/2005)
		//Version 3 - Sound added (KOR - 7/01/2005)
		//Version 2 - Source volumes added
		//		(RAR 13/09/04)
	};
};

#endif//__ASURA_CHUNK_PFX_H__
