raze/source/blood/src/controls.h

92 lines
2.3 KiB
C
Raw Normal View History

2019-09-19 22:42:45 +00:00
//-------------------------------------------------------------------------
/*
Copyright (C) 2010-2019 EDuke32 developers and contributors
Copyright (C) 2019 Nuke.YKT
This file is part of NBlood.
NBlood is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
#pragma once
BEGIN_BLD_NS
2019-09-19 22:42:45 +00:00
#pragma pack(push, 1)
enum
2019-09-19 22:42:45 +00:00
{
flag_buttonmask = 127,
flag_buttonmask_norun = 126
};
union SYNCFLAGS
{
uint32_t value;
2019-09-19 22:42:45 +00:00
struct
{
unsigned int run : 1;
2019-09-19 22:42:45 +00:00
unsigned int jump : 1;
unsigned int crouch : 1;
unsigned int shoot : 1;
unsigned int shoot2 : 1;
unsigned int lookUp : 1;
unsigned int lookDown : 1;
unsigned int action : 1;
unsigned int jab : 1;
unsigned int prevItem : 1;
unsigned int nextItem : 1;
unsigned int useItem : 1;
unsigned int prevWeapon : 1;
unsigned int nextWeapon : 1;
unsigned int holsterWeapon : 1;
unsigned int lookCenter : 1;
unsigned int lookLeft : 1;
unsigned int lookRight : 1;
unsigned int spin180 : 1;
unsigned int pause : 1;
unsigned int quit : 1;
unsigned int restart : 1;
unsigned int useBeastVision : 1;
unsigned int useCrystalBall : 1;
unsigned int useJumpBoots : 1;
unsigned int useMedKit : 1;
unsigned int newWeapon : 4;
2019-09-19 22:42:45 +00:00
};
};
struct GINPUT
{
SYNCFLAGS syncFlags;
int16_t fvel;
int16_t svel;
fix16_t q16avel;
fix16_t q16horz;
2019-09-19 22:42:45 +00:00
};
#pragma pack(pop)
extern GINPUT gInput, gNetInput;
2019-09-19 22:42:45 +00:00
extern bool bSilentAim;
extern fix16_t gViewLook, gViewAngle;
extern float gViewAngleAdjust;
extern float gViewLookAdjust;
extern int gViewLookRecenter;
2019-09-19 22:42:45 +00:00
void ctrlInit();
void ctrlGetInput();
END_BLD_NS