1 // SONIC ROBO BLAST 2 2 //----------------------------------------------------------------------------- 3 // Copyright (C) 1993-1996 by id Software, Inc. 4 // Copyright (C) 1998-2000 by DooM Legacy Team. 5 // Copyright (C) 1999-2020 by Sonic Team Junior. 6 // 7 // This program is free software distributed under the 8 // terms of the GNU General Public License, version 2. 9 // See the 'LICENSE' file for more details. 10 //----------------------------------------------------------------------------- 11 /// \file d_ticcmd.h 12 /// \brief Button/action code definitions, ticcmd_t 13 14 #ifndef __D_TICCMD__ 15 #define __D_TICCMD__ 16 17 #include "m_fixed.h" 18 #include "doomtype.h" 19 20 #ifdef __GNUG__ 21 #pragma interface 22 #endif 23 24 // Button/action code definitions. 25 typedef enum 26 { 27 // First 4 bits are weapon change info, DO NOT USE! 28 BT_WEAPONMASK = 0x0F, //our first four bits. 29 30 BT_WEAPONNEXT = 1<<4, 31 BT_WEAPONPREV = 1<<5, 32 33 BT_ATTACK = 1<<6, // shoot rings 34 BT_SPIN = 1<<7, 35 BT_CAMLEFT = 1<<8, // turn camera left 36 BT_CAMRIGHT = 1<<9, // turn camera right 37 BT_TOSSFLAG = 1<<10, 38 BT_JUMP = 1<<11, 39 BT_FIRENORMAL = 1<<12, // Fire a normal ring no matter what 40 41 BT_CUSTOM1 = 1<<13, 42 BT_CUSTOM2 = 1<<14, 43 BT_CUSTOM3 = 1<<15, 44 } buttoncode_t; 45 46 // The data sampled per tick (single player) 47 // and transmitted to other peers (multiplayer). 48 // Mainly movements/button commands per game tick, 49 // plus a checksum for internal state consistency. 50 51 // bits in angleturn 52 #define TICCMD_RECEIVED 1 53 #define TICCMD_XY 2 54 55 #if defined(_MSC_VER) 56 #pragma pack(1) 57 #endif 58 59 typedef struct 60 { 61 SINT8 forwardmove; // -MAXPLMOVE to MAXPLMOVE (50) 62 SINT8 sidemove; // -MAXPLMOVE to MAXPLMOVE (50) 63 INT16 angleturn; // <<16 for angle delta - saved as 1 byte into demos 64 INT16 aiming; // vertical aiming, see G_BuildTicCmd 65 UINT16 buttons; 66 } ATTRPACK ticcmd_t; 67 68 #if defined(_MSC_VER) 69 #pragma pack() 70 #endif 71 72 #endif 73