//////////////////////////////////////////////////////////////////////////////
//
// PS2Strip_Exporter.h
//
// By: Morgan Parry.
//
// Copyright (c) 2001 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef ___PS2STRIP_EXPORTER_H___
#define ___PS2STRIP_EXPORTER_H___ 1

// I N C L U D E S ///////////////////////////////////////////////////////////

#include <windows.h>

// M A C R O S ///////////////////////////////////////////////////////////////

// (MP - 20.11.2002) NB: Need to add PS2Strip_EnvWriter.* and DMADebug/* back
// into project when turning this on.
#define PS2STRIP_EXPORT_REGIONS (1)

#define ASURA_PS2_DEFAULT_WELD_THRESHOLD 0.0025f

// F O R W A R D   D E C L A R A T I O N S ///////////////////////////////////

class Asura_Bounding_Box;
class Asura_Hierarchy_Skin;
class Asura_Mesh;

// C L A S S E S /////////////////////////////////////////////////////////////

class PS2Strip_Exporter
{

    public:

        // T Y P E S /////////////////////////////////////////////////////////

        enum UPDATERESULT
        {
            UPDATERESULT_COMPLETE,
            UPDATERESULT_ERROR,
            UPDATERESULT_PENDING,
        };

        // C L A S S   M E T H O D S /////////////////////////////////////////

        static void BeginEnvExport( void );
        static void BeginHierSkinExport( const Asura_Hierarchy_Skin* pxSkin, float fStartProgressPercentage, float fEndProgressPercentage );
        static void BeginObjectExport( Asura_Mesh* pxMesh );

        static void Abort( void );
        static UPDATERESULT Update( void );

        static const char* GetNameOfCurMesh( void );
        static const char* GetNameOfLastMesh( void );

		#ifdef ASURA_TOOLS
		static void SetSubdivideFlag(bool bSubdivide);
		#endif
		static void SetWeldTolerance(float fTolerance);

		static void SetUVScale(float fUScale,float fVScale);
		
		static void OutputSkinLODThresholdChunk( HANDLE hOut, const Asura_Hierarchy_Skin* pxSkin );

		#if defined( ASURA_USE_CARPET )
		static bool OutputCarpetMeshChunk( HANDLE pOutput );
		#endif //#if defined( ASURA_USE_CARPET )

		#if defined( ASURA_USE_BOTANICALS )
        static void BeginBotanicalObjectExport( Asura_Mesh* pxMesh, enum Asura_PS2_Botanicals_Mesh_Type eType );
		static bool OutputBotanicalsChunk( HANDLE pOutput, const int* const piMaterialConversionList  );
		static bool OutputBotanicalObjectBillboards();
		#endif //#if defined( ASURA_USE_BOTANICALS )

        static float Timing_GetTotalElapsedTime( void );
        static void Timing_PrintReport( void );

        static bool Project_SetupPlayerBB( Asura_Bounding_Box* pxBB );

        static void SetBotanicalBillboardLightingContrastFactor(const float fFactor)
		{
			s_fBotanicalBillboardLightingContrastFactor	= fFactor;
		}
        static float GetBotanicalBillboardLightingContrastFactor()
		{
			return s_fBotanicalBillboardLightingContrastFactor;
		}

	private:
		static float s_fBotanicalBillboardLightingContrastFactor;
};

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

#endif // #ifndef ___PS2STRIP_EXPORTER_H___
