d_ticcmd.h 1.83 KB
Newer Older
Alam Ed Arias committed
1 2 3 4
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
James R. committed
5
// Copyright (C) 1999-2020 by Sonic Team Junior.
Alam Ed Arias committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
/// \file  d_ticcmd.h
/// \brief Button/action code definitions, ticcmd_t

#ifndef __D_TICCMD__
#define __D_TICCMD__

#include "m_fixed.h"
#include "doomtype.h"

#ifdef __GNUG__
#pragma interface
#endif

// Button/action code definitions.
typedef enum
{
	// First 4 bits are weapon change info, DO NOT USE!
	BT_WEAPONMASK = 0x0F, //our first four bits.

	BT_WEAPONNEXT = 1<<4,
	BT_WEAPONPREV = 1<<5,

	BT_ATTACK     = 1<<6, // shoot rings
GoldenTails committed
34
	BT_SPIN       = 1<<7,
Alam Ed Arias committed
35 36 37 38
	BT_CAMLEFT    = 1<<8, // turn camera left
	BT_CAMRIGHT   = 1<<9, // turn camera right
	BT_TOSSFLAG   = 1<<10,
	BT_JUMP       = 1<<11,
Alam Ed Arias committed
39 40 41 42 43
	BT_FIRENORMAL = 1<<12, // Fire a normal ring no matter what

	BT_CUSTOM1    = 1<<13,
	BT_CUSTOM2    = 1<<14,
	BT_CUSTOM3    = 1<<15,
Alam Ed Arias committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
} buttoncode_t;

// The data sampled per tick (single player)
// and transmitted to other peers (multiplayer).
// Mainly movements/button commands per game tick,
// plus a checksum for internal state consistency.

// bits in angleturn
#define TICCMD_RECEIVED 1
#define TICCMD_XY 2

#if defined(_MSC_VER)
#pragma pack(1)
#endif

typedef struct
{
	SINT8 forwardmove; // -MAXPLMOVE to MAXPLMOVE (50)
	SINT8 sidemove; // -MAXPLMOVE to MAXPLMOVE (50)
	INT16 angleturn; // <<16 for angle delta - saved as 1 byte into demos
	INT16 aiming; // vertical aiming, see G_BuildTicCmd
	UINT16 buttons;
} ATTRPACK ticcmd_t;

#if defined(_MSC_VER)
#pragma pack()
#endif

#endif