
///////////////////////////////////////////////////////////////////////////////
//
// File   : AVP_PC_Human_ControlMapper.cpp
// Author : Andy Tate
// Date   : 27-Sep-2007
//
// Copyright (C) 2007 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Include files...
////////////////////////////////////////////////////////////////////////////////

#include "Core/Asura.h"

// This file's header...
#include "Actor/Vertebrates/Human/AVP_PC_Human_ControlMapper.h"

// Asura platform header-files...
#include "Input/Asura_PlatformInput.h"
#include "Input/Asura_PC_Input_Joystick.h"

// Game independent header-files...
#include "Actor/Vertebrates/Human/AVP_Human_InputHandler.h"


////////////////////////////////////////////////////////////////////////////////
// Constant declarations...
////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////
// Static variable declarations...
////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////
// Private functions...
////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////
// Protected functions...
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Function     : AVP_PC_Human_ControlMapper::InitialiseControlsPC
// Author       : Andy Tate
// Date         : 27-Sep-2007
////////////////////////////////////////////////////////////////////////////////

void AVP_PC_Human_ControlMapper::InitialiseControlsPC(AVP_Actor_InputHandler& xInputHandler)
{
	AVP_Human_InputHandler&	xHumanInputHandler	= *(static_cast<AVP_Human_InputHandler*>(&xInputHandler));

	Asura_ControlMap&		xFirst				= xHumanInputHandler.GetMapFirstPerson();

	PARENT::InitialiseControlsPC(xInputHandler);

	// First-person mappings...
	xHumanInputHandler.MapMovementKeys(xFirst, 'w', 's', 'a', 'd', ASURA_KEYID_LEFTCTRL, ASURA_KEYID_LEFTSHIFT, 'c');
	xHumanInputHandler.MapVisionAndFlare(xFirst, 'q', 'f');
	xHumanInputHandler.MapTorch(xFirst, 't');
	xHumanInputHandler.MapZoom(xFirst, ASURA_KEYID_MOUSEWHEELUP, ASURA_KEYID_MOUSEWHEELDOWN, ASURA_KEYID_VOID);


//	xHumanInputHandler.MapADS(xFirst, ASURA_KEYID_MOUSEBUTTON3);

	// weapon and vision mode select mappings
	xHumanInputHandler.MapWeaponSelect( xFirst, '1', ASURA_KEYID_VOID, '3', '2');
	xHumanInputHandler.MapReload( xFirst, 'r' );
	xHumanInputHandler.MapHealth(xFirst, 'h');
}

/// End of function 'AVP_PC_Human_ControlMapper::InitialiseControlsPC'. ///



////////////////////////////////////////////////////////////////////////////////
// Function     : AVP_PC_Human_ControlMapper::InitialiseControlsPS2
// Author       : Andy Tate
// Date         : 27-Sep-2007
////////////////////////////////////////////////////////////////////////////////

void AVP_PC_Human_ControlMapper::InitialiseControlsPS2(AVP_Actor_InputHandler& xInputHandler)
{
	AVP_Human_InputHandler&	xHumanInputHandler	= *(static_cast<AVP_Human_InputHandler*>(&xInputHandler));

	Asura_ControlMap&		xFirst				= xHumanInputHandler.GetMapFirstPerson();

	PARENT::InitialiseControlsPS2(xInputHandler);

	// First-person mappings...
	xHumanInputHandler.MapMovementAxes(xFirst, ASURA_PC_AXISID_PS2PAD1_LSTICK_V, ASURA_PC_AXISID_PS2PAD1_LSTICK_H, ASURA_KEYID_VOID, ASURA_PC_KEYID_PS2PAD1_L3, ASURA_PC_KEYID_PS2PAD1_CIRCLE);
	xHumanInputHandler.MapVisionAndFlare(xFirst, ASURA_PC_KEYID_PS2PAD1_L2, ASURA_PC_KEYID_PS2PAD1_L2);
	xHumanInputHandler.MapTorch(xFirst, ASURA_PC_KEYID_PS2PAD1_DOWN);
	xHumanInputHandler.MapZoom(xFirst, ASURA_PC_KEYID_PS2PAD1_UP, ASURA_PC_KEYID_PS2PAD1_DOWN, ASURA_KEYID_VOID);

//	xHumanInputHandler.MapADS(xFirst, ASURA_PC_KEYID_PS2PAD1_R3);

	// weapon and vision mode select mappings
	xHumanInputHandler.MapWeaponSelect(xFirst, ASURA_PC_KEYID_PS2PAD1_UP, ASURA_KEYID_VOID, ASURA_PC_KEYID_PS2PAD1_LEFT, ASURA_PC_KEYID_PS2PAD1_RIGHT);
	xHumanInputHandler.MapInteractAndReloadToSameKey( xFirst, ASURA_PC_KEYID_PS2PAD1_SQUARE );
	xHumanInputHandler.MapHealth(xFirst, ASURA_PC_KEYID_PS2PAD1_TRIANGLE);
}

/// End of function 'AVP_PC_Human_ControlMapper::InitialiseControlsPS2'. ///



////////////////////////////////////////////////////////////////////////////////
// Function     : AVP_PC_Human_ControlMapper::InitialiseControlsPS3
// Author       : Andy Tate
// Date         : 27-Sep-2007
////////////////////////////////////////////////////////////////////////////////

void AVP_PC_Human_ControlMapper::InitialiseControlsPS3(AVP_Actor_InputHandler& xInputHandler)
{
	AVP_Human_InputHandler&	xHumanInputHandler	= *(static_cast<AVP_Human_InputHandler*>(&xInputHandler));

	Asura_ControlMap&		xFirst				= xHumanInputHandler.GetMapFirstPerson();

	PARENT::InitialiseControlsPS3(xInputHandler);

	// First-person mappings...
	xHumanInputHandler.MapMovementAxes(xFirst, ASURA_PC_AXISID_PS3PAD1_LSTICK_V, ASURA_PC_AXISID_PS3PAD1_LSTICK_H, ASURA_KEYID_VOID, ASURA_PC_KEYID_PS3PAD1_L3, ASURA_PC_KEYID_PS3PAD1_CIRCLE);
	xHumanInputHandler.MapVisionAndFlare(xFirst, ASURA_PC_KEYID_PS3PAD1_L2, ASURA_PC_KEYID_PS3PAD1_L2);
	xHumanInputHandler.MapTorch(xFirst, ASURA_PC_KEYID_PS3PAD1_DOWN);
	xHumanInputHandler.MapZoom(xFirst, ASURA_PC_KEYID_PS3PAD1_UP, ASURA_PC_KEYID_PS3PAD1_DOWN, ASURA_KEYID_VOID);

	//	xHumanInputHandler.MapADS(xFirst, ASURA_PC_KEYID_PS3PAD1_R3);

	// weapon and vision mode select mappings
	xHumanInputHandler.MapWeaponSelect(xFirst, ASURA_PC_KEYID_PS3PAD1_UP, ASURA_KEYID_VOID, ASURA_PC_KEYID_PS3PAD1_LEFT, ASURA_PC_KEYID_PS3PAD1_RIGHT);
	xHumanInputHandler.MapInteractAndReloadToSameKey( xFirst, ASURA_PC_KEYID_PS3PAD1_SQUARE );
	xHumanInputHandler.MapHealth(xFirst, ASURA_PC_KEYID_PS3PAD1_TRIANGLE);
}

/// End of function 'AVP_PC_Human_ControlMapper::InitialiseControlsPS3'. ///



////////////////////////////////////////////////////////////////////////////////
// Function     : AVP_PC_Human_ControlMapper::InitialiseControlsXBox360
// Author       : Andy Tate
// Date         : 27-Sep-2007
////////////////////////////////////////////////////////////////////////////////

void AVP_PC_Human_ControlMapper::InitialiseControlsXBox360(AVP_Actor_InputHandler& xInputHandler)
{
	AVP_Human_InputHandler&	xHumanInputHandler	= *(static_cast<AVP_Human_InputHandler*>(&xInputHandler));

	Asura_ControlMap&		xFirst				= xHumanInputHandler.GetMapFirstPerson();

	PARENT::InitialiseControlsXBox360(xInputHandler);

	// First-person mappings...
	xHumanInputHandler.MapMovementAxes(xFirst, ASURA_PC_AXISID_XBOX360PAD1_LSTICK_V, ASURA_PC_AXISID_XBOX360PAD1_LSTICK_H, ASURA_KEYID_VOID, ASURA_PC_KEYID_XBOX360PAD1_L_THUMB, ASURA_PC_KEYID_XBOX360PAD1_B);
	xHumanInputHandler.MapVisionAndFlare(xFirst, ASURA_PC_KEYID_XBOX360PAD1_L_BUMPER, ASURA_PC_KEYID_XBOX360PAD1_L_BUMPER);
	xHumanInputHandler.MapTorch(xFirst, ASURA_PC_KEYID_XBOX360PAD1_DOWN);
	xHumanInputHandler.MapZoom(xFirst, ASURA_PC_KEYID_XBOX360PAD1_UP, ASURA_PC_KEYID_XBOX360PAD1_DOWN, ASURA_KEYID_VOID);

//	xHumanInputHandler.MapADS(xFirst, ASURA_PC_KEYID_XBOX360PAD1_R_THUMB);

	// weapon and vision mode select mappings
	xHumanInputHandler.MapWeaponSelect(xFirst, ASURA_PC_KEYID_XBOX360PAD1_UP, ASURA_KEYID_VOID, ASURA_PC_KEYID_XBOX360PAD1_LEFT, ASURA_PC_KEYID_XBOX360PAD1_RIGHT);
	xHumanInputHandler.MapInteractAndReloadToSameKey( xFirst, ASURA_PC_KEYID_XBOX360PAD1_X );
	xHumanInputHandler.MapHealth(xFirst, ASURA_PC_KEYID_XBOX360PAD1_Y);
}

/// End of function 'AVP_PC_Human_ControlMapper::InitialiseControlsXBox360'. ///



////////////////////////////////////////////////////////////////////////////////
// Public functions...
////////////////////////////////////////////////////////////////////////////////


/// End of file. ///
