//*******************************************************************
//
// File: Tools_Carpet_Statistics.h           
//
// Created: 26 Jan 2006
//
// Description: 
//
//*******************************************************************

#ifndef _TOOLS_CARPET_STATISTICS_H_
#define _TOOLS_CARPET_STATISTICS_H_

#if defined( ASURA_USE_CARPET) && defined( ASURA_TOOLS)

// other libraries
#include "Core/Asura_Maths.h"

// internal dependencies
#include "Carpet/Asura_Direct3D_Carpet_Game_Render.h"

// forward declarations
struct Asura_Direct3D_CGR_RTreeNode;

//*******************************************************************
// Constants
//*******************************************************************
#if defined( ASURA_TOOLS)
	#define ASURA_CARPET_MESHMANAGER_PROFILE
#endif

//*******************************************************************
// Class Definitions
//*******************************************************************

class Tools_Carpet_Statistics_RTreeView
{
public:
	Asura_Bounding_Box m_xBoundingBox;
	
	float m_fViewStartX;
	float m_fViewStartY;
	float m_fViewSizeX;
	float m_fViewSizeY;
	
	Asura_Direct3D_CGR_Camera m_xCamera;
};

class Tools_Carpet_Statistics
{
public:
	static bool Reset();
	static bool Render();

private:
	static bool RenderRTree( const Tools_Carpet_Statistics_RTreeView& xView, const Asura_Direct3D_CGR_RTreeNode* pxRTreeNode, const uint32 uiTreeDepth = 0);
	
public:
	static float s_fTime;
	static float s_fTimeRTree;
	static uint32 s_uDIPCount;
	static uint32 s_uDIPIndexCount;
	static uint32 s_uDIPVertexCount;
	static uint32 s_uDIPPrimitiveCount;
	static uint32 s_uCarpetTriangleCount;
	static uint32 s_uCarpetInstanceCount;
	static bool s_bShowCulling;
};

//*******************************************************************
// Inline Function Definitions
//*******************************************************************

#define TOOLS_CARPET_STATISTICS_SET( _VARIABLE, _VALUE) Tools_Carpet_Statistics::_VARIABLE = (_VALUE)
#define TOOLS_CARPET_STATISTICS_ADD( _VARIABLE, _VALUE) Tools_Carpet_Statistics::_VARIABLE += (_VALUE)
#define TOOLS_CARPET_STATISTICS_RESET() Tools_Carpet_Statistics::Reset()

#else //defined( ASURA_TOOLS)

#define TOOLS_CARPET_STATISTICS_SET( _VARIABLE, _VALUE)
#define TOOLS_CARPET_STATISTICS_ADD( _VARIABLE, _VALUE)
#define TOOLS_CARPET_STATISTICS_RESET()

#endif //defined( ASURA_USE_CARPET) && defined( ASURA_TOOLS)

//*******************************************************************
//
// (c) 2006 Rebellion (Derby)
//
// Warning: This computer program is protected by copyright law and 
// international treaties. Unauthorized reproduction or distribution
// of this program, or any portion of it, may result in severe civil and
// criminal penalties, and will be prosecuted to the maximum extent 
// possible under the law.
//
//*******************************************************************

#endif // _TOOLS_CARPET_STATISTICS_H_
