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
|
2022-05-29 16:33:38 +00:00
|
|
|
|
2020-09-26 19:41:58 +00:00
|
|
|
#include <base/vmath.h>
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-05-29 16:33:38 +00:00
|
|
|
#include <engine/client.h>
|
|
|
|
|
|
|
|
#include <game/client/component.h>
|
2021-07-12 09:29:59 +00:00
|
|
|
#include <game/generated/protocol.h>
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
class CControls : public CComponent
|
2011-04-13 18:37:12 +00:00
|
|
|
{
|
2022-06-06 20:03:24 +00:00
|
|
|
float GetMaxMouseDistance() const;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
public:
|
2022-06-30 22:36:32 +00:00
|
|
|
vec2 m_aMousePos[NUM_DUMMIES];
|
|
|
|
vec2 m_aTargetPos[NUM_DUMMIES];
|
2014-06-16 11:29:18 +00:00
|
|
|
float m_OldMouseX;
|
|
|
|
float m_OldMouseY;
|
|
|
|
|
2022-06-30 22:36:32 +00:00
|
|
|
int m_aAmmoCount[NUM_WEAPONS];
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2022-06-30 22:36:32 +00:00
|
|
|
CNetObj_PlayerInput m_aInputData[NUM_DUMMIES];
|
|
|
|
CNetObj_PlayerInput m_aLastData[NUM_DUMMIES];
|
|
|
|
int m_aInputDirectionLeft[NUM_DUMMIES];
|
|
|
|
int m_aInputDirectionRight[NUM_DUMMIES];
|
|
|
|
int m_aShowHookColl[NUM_DUMMIES];
|
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();
|
2022-01-31 02:11:47 +00:00
|
|
|
virtual int Sizeof() const override { return sizeof(*this); }
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2022-01-30 23:43:56 +00:00
|
|
|
virtual void OnReset() override;
|
|
|
|
virtual void OnRelease() override;
|
|
|
|
virtual void OnRender() override;
|
|
|
|
virtual void OnMessage(int MsgType, void *pRawMsg) override;
|
2022-06-06 20:03:24 +00:00
|
|
|
virtual bool OnCursorMove(float x, float y, IInput::ECursorType CursorType) override;
|
2022-01-30 23:43:56 +00:00
|
|
|
virtual void OnConsoleInit() override;
|
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
|