2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2010-05-29 07:25:38 +00:00
|
|
|
#ifndef GAME_CLIENT_COMPONENTS_CONTROLS_H
|
|
|
|
#define GAME_CLIENT_COMPONENTS_CONTROLS_H
|
2014-06-16 11:29:18 +00:00
|
|
|
#include <SDL_joystick.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <base/vmath.h>
|
2014-06-16 11:29:18 +00:00
|
|
|
#include <base/system.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
#include <game/client/component.h>
|
|
|
|
|
|
|
|
class CControls : public CComponent
|
2011-04-13 18:37:12 +00:00
|
|
|
{
|
2010-05-29 07:25:38 +00:00
|
|
|
public:
|
2014-05-10 12:31:00 +00:00
|
|
|
vec2 m_MousePos[2];
|
|
|
|
vec2 m_TargetPos[2];
|
2014-06-16 11:29:18 +00:00
|
|
|
float m_OldMouseX;
|
|
|
|
float m_OldMouseY;
|
|
|
|
SDL_Joystick *m_Joystick;
|
|
|
|
bool m_JoystickFirePressed;
|
|
|
|
bool m_JoystickRunPressed;
|
|
|
|
int64 m_JoystickTapTime;
|
|
|
|
|
|
|
|
SDL_Joystick *m_Gamepad;
|
|
|
|
bool m_UsingGamepad;
|
|
|
|
|
|
|
|
int m_AmmoCount[NUM_WEAPONS];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2014-10-12 15:52:53 +00:00
|
|
|
CNetObj_PlayerInput m_InputData[2];
|
|
|
|
CNetObj_PlayerInput m_LastData[2];
|
|
|
|
int m_InputDirectionLeft[2];
|
|
|
|
int m_InputDirectionRight[2];
|
|
|
|
int m_ShowHookColl[2];
|
2014-04-30 11:32:47 +00:00
|
|
|
int m_LastDummy;
|
2014-04-28 16:21:10 +00:00
|
|
|
int m_OtherFire;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
CControls();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-31 21:40:40 +00:00
|
|
|
virtual void OnReset();
|
2011-01-17 11:28:37 +00:00
|
|
|
virtual void OnRelease();
|
2010-05-29 07:25:38 +00:00
|
|
|
virtual void OnRender();
|
|
|
|
virtual void OnMessage(int MsgType, void *pRawMsg);
|
|
|
|
virtual bool OnMouseMove(float x, float y);
|
|
|
|
virtual void OnConsoleInit();
|
2010-08-10 11:54:13 +00:00
|
|
|
virtual void OnPlayerDeath();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
int SnapInput(int *pData);
|
2010-09-19 14:00:46 +00:00
|
|
|
void ClampMousePos();
|
2017-03-06 18:45:39 +00:00
|
|
|
void ResetInput(int Dummy);
|
2010-05-29 07:25:38 +00:00
|
|
|
};
|
|
|
|
#endif
|