//////////////////////////////////////////////////////////////////////////////
//
// Asura_Platform_CommandConsole.cpp
//
// Copyright (c) 2006 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

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

#include "Core/Asura.h"

#ifdef ASURA_SUPPORT_COMMAND_CONSOLE

// This file's header.
#include "Interface/Asura_CommandConsole.h"

// Engine independent.
#include "Input/Asura_ControlMap.h"
#include "Input/Asura_PlatformInput.h"

// C L A S S   I M P L E M E N T A T I O N S /////////////////////////////////

void Asura_CommandConsole::Platform_Initialise( void )
{
	SetBorderX( 3.25f );

#ifdef ASURA_DEBUG_VARIABLE_SYSTEM
	// put DVS away from the edges.
	SetDVSBorder(0.05f);
#endif
}

#ifdef ASURA_DEBUG_VARIABLE_SYSTEM

void Asura_DebugVariableSystem::Platform_InitialiseDefaultControlMapping( void )
{
	// JAT 19/02/07 - DVS open/close on 360 with ASURA_USE_CONTROLMAP_MANAGER #define	
#ifdef ASURA_USE_NEW_INPUT
#ifdef ASURA_USE_CONTROLMAP_MANAGER
	s_xControlMap.AddKeyMapping( KEYMAP_CLOSE,					ASURA_PS3_KEYID_SELECT, Asura_ControlMapping::ON_DEBOUNCED_PRESS );
#endif // #ifdef ASURA_USE_CONTROLMAP_MANAGER
	s_xControlMap.AddKeyMapping( KEYMAP_MOVERIGHT,              ASURA_PS3_KEYID_RIGHT,   Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_MOVELEFT,               ASURA_PS3_KEYID_LEFT,    Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_MOVEUP,                 ASURA_PS3_KEYID_UP,      Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_MOVEDOWN,               ASURA_PS3_KEYID_DOWN,    Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_INCREASEVALUE,          ASURA_PS3_KEYID_TRIANGLE, Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_DECREASEVALUE,          ASURA_PS3_KEYID_CROSS, Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_INCREASEVALUEINCREMENT, ASURA_PS3_KEYID_CIRCLE, Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_DECREASEVALUEINCREMENT, ASURA_PS3_KEYID_SQUARE, Asura_ControlMapping::ON_PRESS );
#else
#ifdef ASURA_USE_CONTROLMAP_MANAGER
	s_xControlMap.AddKeyMapping( KEYMAP_CLOSE,					ASURA_PS3_KEYID_PAD1_SELECT, Asura_ControlMapping::ON_DEBOUNCED_PRESS );
#endif // #ifdef ASURA_USE_CONTROLMAP_MANAGER
	s_xControlMap.AddKeyMapping( KEYMAP_MOVERIGHT,              ASURA_PS3_KEYID_PAD1_RIGHT,   Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_MOVELEFT,               ASURA_PS3_KEYID_PAD1_LEFT,    Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_MOVEUP,                 ASURA_PS3_KEYID_PAD1_UP,      Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_MOVEDOWN,               ASURA_PS3_KEYID_PAD1_DOWN,    Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_INCREASEVALUE,          ASURA_PS3_KEYID_PAD1_TRIANGLE, Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_DECREASEVALUE,          ASURA_PS3_KEYID_PAD1_CROSS, Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_INCREASEVALUEINCREMENT, ASURA_PS3_KEYID_PAD1_CIRCLE, Asura_ControlMapping::ON_PRESS );
	s_xControlMap.AddKeyMapping( KEYMAP_DECREASEVALUEINCREMENT, ASURA_PS3_KEYID_PAD1_SQUARE, Asura_ControlMapping::ON_PRESS );
#endif // #ifdef ASURA_USE_NEW_INPUT
}

#endif

#endif // #ifdef ASURA_SUPPORT_COMMAND_CONSOLE
