mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Events have a player ID instead of adding billions of keys for separate gamepads. Axis movement (mouse movement, analog sticks) now are counted as keys, so axes don't need to be separately implemented for all controls. Game controls emulate a Saturn controller (some of the external functions like screenshot / gif should be readded, but I got lazy) This will allow later us to save a config for a controller that can be reused for any player slot, which is one of the main goals for profiles. Only just enough was made to use the new input system to make it compile. Menus in this branch should aim to move to using PlayerInputDown entirely, instead of using hardcoded keys & simply remapping to those
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
// SONIC ROBO BLAST 2
|
|
//-----------------------------------------------------------------------------
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
|
// Copyright (C) 1999-2020 by Sonic Team Junior.
|
|
//
|
|
// 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_event.h
|
|
/// \brief Event handling
|
|
|
|
#ifndef __D_EVENT__
|
|
#define __D_EVENT__
|
|
|
|
#include "doomtype.h"
|
|
#include "g_state.h"
|
|
|
|
// Input event types.
|
|
typedef enum
|
|
{
|
|
ev_keydown,
|
|
ev_keyup,
|
|
ev_console,
|
|
ev_mouse,
|
|
ev_joystick,
|
|
} evtype_t;
|
|
|
|
// Event structure.
|
|
typedef struct
|
|
{
|
|
evtype_t type;
|
|
INT32 data1; // keys / mouse/joystick buttons
|
|
INT32 data2; // mouse/joystick x move
|
|
INT32 data3; // mouse/joystick y move
|
|
INT32 device; // which player's device it belongs to
|
|
} event_t;
|
|
|
|
//
|
|
// GLOBAL VARIABLES
|
|
//
|
|
#define MAXEVENTS 128
|
|
|
|
extern event_t events[MAXEVENTS];
|
|
extern INT32 eventhead, eventtail;
|
|
|
|
#endif
|