2002-04-16 17:31:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: GameInput
|
|
|
|
|
|
|
|
|
|
Desc: An input event specific to a Game definied by an instrument and a button space.
|
|
|
|
|
|
2002-05-19 01:59:48 +00:00
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
2002-04-16 17:31:00 +00:00
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
2002-07-27 19:29:51 +00:00
|
|
|
enum GameController
|
2002-04-16 17:31:00 +00:00
|
|
|
{
|
2002-07-31 19:40:40 +00:00
|
|
|
GAME_CONTROLLER_1 = 0, // left controller
|
|
|
|
|
GAME_CONTROLLER_2, // right controller
|
2002-07-27 19:29:51 +00:00
|
|
|
MAX_GAME_CONTROLLERS, // leave this at the end
|
2002-07-31 19:40:40 +00:00
|
|
|
GAME_CONTROLLER_INVALID,
|
2002-04-16 17:31:00 +00:00
|
|
|
};
|
|
|
|
|
|
2002-07-31 19:40:40 +00:00
|
|
|
typedef int GameButton;
|
|
|
|
|
|
|
|
|
|
enum // DanceButtons
|
2002-04-16 17:31:00 +00:00
|
|
|
{
|
2002-07-31 19:40:40 +00:00
|
|
|
DANCE_BUTTON_LEFT,
|
|
|
|
|
DANCE_BUTTON_RIGHT,
|
|
|
|
|
DANCE_BUTTON_UP,
|
|
|
|
|
DANCE_BUTTON_DOWN,
|
|
|
|
|
DANCE_BUTTON_UPLEFT,
|
|
|
|
|
DANCE_BUTTON_UPRIGHT,
|
|
|
|
|
DANCE_BUTTON_START,
|
|
|
|
|
DANCE_BUTTON_BACK,
|
|
|
|
|
DANCE_BUTTON_MENULEFT,
|
|
|
|
|
DANCE_BUTTON_MENURIGHT,
|
|
|
|
|
DANCE_BUTTON_MENUUP,
|
|
|
|
|
DANCE_BUTTON_MENUDOWN,
|
|
|
|
|
NUM_DANCE_BUTTONS, // leave this at the end
|
2002-04-16 17:31:00 +00:00
|
|
|
};
|
|
|
|
|
|
2002-07-31 19:40:40 +00:00
|
|
|
enum // PumpButtons
|
|
|
|
|
{
|
|
|
|
|
PUMP_BUTTON_UPLEFT,
|
|
|
|
|
PUMP_BUTTON_UPRIGHT,
|
|
|
|
|
PUMP_BUTTON_CENTER,
|
|
|
|
|
PUMP_BUTTON_DOWNLEFT,
|
|
|
|
|
PUMP_BUTTON_DOWNRIGHT,
|
|
|
|
|
PUMP_BUTTON_START,
|
|
|
|
|
PUMP_BUTTON_BACK,
|
|
|
|
|
PUMP_BUTTON_MENULEFT,
|
|
|
|
|
PUMP_BUTTON_MENURIGHT,
|
|
|
|
|
PUMP_BUTTON_MENUUP,
|
|
|
|
|
PUMP_BUTTON_MENUDOWN,
|
|
|
|
|
NUM_PUMP_BUTTONS, // leave this at the end
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum // EZ2Buttons
|
|
|
|
|
{
|
|
|
|
|
EZ2_BUTTON_FOOTUPLEFT,
|
|
|
|
|
EZ2_BUTTON_FOOTUPRIGHT,
|
|
|
|
|
EZ2_BUTTON_FOOTDOWN,
|
|
|
|
|
EZ2_BUTTON_HANDUPLEFT,
|
|
|
|
|
EZ2_BUTTON_HANDUPRIGHT,
|
|
|
|
|
EZ2_BUTTON_HANDLRLEFT,
|
|
|
|
|
EZ2_BUTTON_HANDLRRIGHT,
|
|
|
|
|
EZ2_BUTTON_START,
|
|
|
|
|
EZ2_BUTTON_BACK,
|
|
|
|
|
EZ2_BUTTON_MENULEFT,
|
|
|
|
|
EZ2_BUTTON_MENURIGHT,
|
|
|
|
|
EZ2_BUTTON_MENUUP,
|
|
|
|
|
EZ2_BUTTON_MENUDOWN,
|
|
|
|
|
NUM_EZ2_BUTTONS, // leave this at the end
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const GameButton MAX_GAME_BUTTONS = 14;
|
|
|
|
|
const GameButton GAME_BUTTON_INVALID = MAX_GAME_BUTTONS+1;
|
|
|
|
|
|
|
|
|
|
|
2002-04-16 17:31:00 +00:00
|
|
|
|
|
|
|
|
struct GameInput
|
|
|
|
|
{
|
2002-08-26 06:39:51 +00:00
|
|
|
GameInput(): controller(GAME_CONTROLLER_INVALID), button(GAME_BUTTON_INVALID) { }
|
|
|
|
|
|
|
|
|
|
GameInput( GameController c, GameButton b ): controller(c), button(b) { }
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2002-07-31 19:40:40 +00:00
|
|
|
GameController controller;
|
|
|
|
|
GameButton button;
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
bool operator==( const GameInput &other ) { return controller == other.controller && button == other.button; };
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2002-07-31 19:40:40 +00:00
|
|
|
inline bool IsValid() const { return controller != GAME_CONTROLLER_INVALID; };
|
|
|
|
|
inline void MakeInvalid() { controller = GAME_CONTROLLER_INVALID; button = GAME_BUTTON_INVALID; };
|
2002-04-16 17:31:00 +00:00
|
|
|
|
2002-07-27 19:29:51 +00:00
|
|
|
CString toString();
|
|
|
|
|
bool fromString( CString s );
|
2002-04-16 17:31:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|