//////////////////////////////////////////////////////////////////////////////
//
// Tools_Xbox360_Texture_Writer.h
//
// Copyright (c) 2006 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

#if defined ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#if !defined __TOOLS_XBOX360_TEXTURE_WRITER_H__
#define __TOOLS_XBOX360_TEXTURE_WRITER_H__

/******************************************************************************/
/* Included Files                                                             */
/******************************************************************************/

#include <windows.h>

/******************************************************************************/
/* Classes                                                                    */
/******************************************************************************/

struct TextureConversionData;

struct Tools_Xbox360_RDF
{
	Asura_String m_xPath;
	HANDLE m_xHandle;
};

class Tools_Xbox360_Texture_Writer
{
	friend class Tools_Level_Export;

public:

	static bool AddTextureToRDF( const Tools_Xbox360_RDF& xRDF,
								 const char* const szTextureName,
								 const char* const szFilename,
								 const int iTextureIndex,
								 const TextureConversionData& xConversionData );

	static bool AddTextureToRDF( const Tools_Xbox360_RDF& xRDF,
								 const char* const szTextureName,
								 const char* const szFilename,
								 const char* const szFormat,
								 const u_int uMipLevels,
								 const u_int uWidth = 0,
								 const u_int uHeight = 0,
								 const bool bUseAlphaSource = false,
								 const bool bSharpenMipMaps = false );

	static bool AddPixelShaderToRDF( const Tools_Xbox360_RDF& xRDF,
									 const char* const szShaderName,
									 const char* const szFilename,
									 const char* const szEntryPoint,
									 const u_int uNumDefines,
									 const char* const aszDefines[] );

	static bool DeleteRDF( Tools_Xbox360_RDF& xRDF );

	static bool BeginTextureExport( Tools_Xbox360_RDF& xRDF, const char* const szExportFilename );
	static void EndTextureExport( Tools_Xbox360_RDF& xRDF );
	static bool RunBundler( const Tools_Xbox360_RDF& xRDF );
	static bool CreateBundleChunk( const Tools_Xbox360_RDF& xRDF, const HANDLE hExportHandle );

	static bool ShouldExportAsXPR( const int iTextureIndex );
};

#endif // !defined __TOOLS_XBOX360_TEXTURE_WRITER_H__
