//////////////////////////////////////////////////////////////////////////////
//
// Asura_PS2_DebugInfo.h
//
// Copyright (c) 2002 Rebellion. All rights reserved.
//
// Description:
//
//     code to draw debugging info to the screen
//
//////////////////////////////////////////////////////////////////////////////

// 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 ___ASURA_PS2_DEBUGINFO_H___
#define ___ASURA_PS2_DEBUGINFO_H___ 1

#ifndef ASURA_PS2_SONY_SUBMISSION

// 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_Matrix_3x3;
class Asura_Vector_3;
struct Asura_DebugTextBlock;

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

class Asura_PS2_DebugInfo
{

    public:

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

        enum DISPLAYTOGGLE
        {
            DISPLAYTOGGLE_CAM_POS,
            DISPLAYTOGGLE_CAM_DIR_FWD,
            DISPLAYTOGGLE_CAM_DIR_OTHER,
            DISPLAYTOGGLE_CAM_MODULE,
            DISPLAYTOGGLE_GRAPH_FPS_INDICATOR,
            DISPLAYTOGGLE_GRAPH_MEM,
            DISPLAYTOGGLE_GRAPH_RENDER,
            DISPLAYTOGGLE_MEM_STATS,
            DISPLAYTOGGLE_NETWORK,
            DISPLAYTOGGLE_RENDER_FPS,
            DISPLAYTOGGLE_RENDER_TRIS_AND_TEX,
            DISPLAYTOGGLE_RENDER_TRI_PASS_BREAKDOWN,
            DISPLAYTOGGLE_RENDER_MODULE_NOCLIP,

            DISPLAYTOGGLE_NUM_TOGGLES,
        };

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

        // development console for quick and easy debug text output only
	    static void Initialise( void );
	    static void Shutdown( void );
	    static void Render( void );

        static int GetConsoleID( void );

        static void EnableDisplay( bool bEnable );
        static bool IsDisplayEnabled( void );

        static bool GetDisplayToggle( DISPLAYTOGGLE eToggle );
        static void SetDisplayToggle( DISPLAYTOGGLE eToggle, bool bOn );

        static void RenderBBForSphere( const Asura_Vector_3& xCentre, float fRadius );
		
		// replacement for using Asura_Overlay_Quad to render debug info after EndFrame.
		// Adapted from profiler rendering code.
		static void RenderDebugQuad( float fX, float fY, float fW, float fH, u_int uARGB );
		
		// Draw debug text to screen, replacing existing debugging text - used for prompts 
		// in hi-res screen shots. This function must only be called under the same conditions
		// as Render(), i.e. deferred rendering finished etc.
		static void ShowMessage( const char* szText );

#if defined(ASURA_USE_DEBUG_TEXT) && defined(ASURA_PS2_USE_DEBUGTEXT_OVERRIDE)
		static void RenderDebugText(const Asura_DebugTextBlock* pxBlock);
#endif

    private:

        static void DrawMemoryBar(int iUsedMem, int iMaxUsedMem, int iTotalMem);
        static void DrawFrameRateBar( void );
};

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

#endif // #ifndef ASURA_PS2_SONY_SUBMISSION

#endif // #ifndef ___ASURA_PS2_DEBUGINFO_H___
