mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
(Input) reorder structs, alignment
This commit is contained in:
parent
13604b047f
commit
e6b9420a15
@ -141,29 +141,27 @@ typedef struct state_device
|
||||
{
|
||||
int id;
|
||||
int port;
|
||||
char name[256];
|
||||
uint16_t rumble_last_strength_strong;
|
||||
uint16_t rumble_last_strength_weak;
|
||||
uint16_t rumble_last_strength;
|
||||
char name[256];
|
||||
} state_device_t;
|
||||
|
||||
typedef struct android_input
|
||||
{
|
||||
int64_t quick_tap_time;
|
||||
const input_device_driver_t *joypad;
|
||||
|
||||
state_device_t pad_states[MAX_USERS];
|
||||
state_device_t pad_states[MAX_USERS]; /* int alignment */
|
||||
int mouse_x_delta, mouse_y_delta;
|
||||
int mouse_l, mouse_r, mouse_m, mouse_wu, mouse_wd;
|
||||
unsigned pads_connected;
|
||||
unsigned pointer_count;
|
||||
sensor_t accelerometer_state; /* float alignment */
|
||||
float mouse_x_prev, mouse_y_prev;
|
||||
struct input_pointer pointer[MAX_TOUCH]; /* int16_t alignment */
|
||||
int16_t analog_state[MAX_USERS][MAX_AXIS];
|
||||
int8_t hat_state[MAX_USERS][2];
|
||||
char device_model[256];
|
||||
|
||||
unsigned pads_connected;
|
||||
sensor_t accelerometer_state;
|
||||
struct input_pointer pointer[MAX_TOUCH];
|
||||
unsigned pointer_count;
|
||||
int mouse_x_delta, mouse_y_delta;
|
||||
float mouse_x_prev, mouse_y_prev;
|
||||
int mouse_l, mouse_r, mouse_m, mouse_wu, mouse_wd;
|
||||
int64_t quick_tap_time;
|
||||
} android_input_t;
|
||||
|
||||
static void frontend_android_get_version_sdk(int32_t *sdk);
|
||||
|
@ -51,13 +51,13 @@ typedef struct
|
||||
|
||||
typedef struct ps3_input
|
||||
{
|
||||
const input_device_driver_t *joypad;
|
||||
int connected[MAX_KB_PORT_NUM];
|
||||
#ifdef HAVE_MOUSE
|
||||
unsigned mice_connected;
|
||||
#endif
|
||||
const input_device_driver_t *joypad;
|
||||
KbInfo kbinfo;
|
||||
KbData kbdata[MAX_KB_PORT_NUM];
|
||||
int connected[MAX_KB_PORT_NUM];
|
||||
} ps3_input_t;
|
||||
|
||||
static int mod_table[] = {
|
||||
|
@ -76,18 +76,16 @@ typedef struct psp_input
|
||||
const input_device_driver_t *joypad;
|
||||
#ifdef VITA
|
||||
int keyboard_hid_handle;
|
||||
uint8_t prev_keys[6];
|
||||
bool keyboard_state[VITA_MAX_SCANCODE + 1];
|
||||
|
||||
int mouse_hid_handle;
|
||||
int32_t mouse_x;
|
||||
int32_t mouse_y;
|
||||
int32_t mouse_x_delta;
|
||||
int32_t mouse_y_delta;
|
||||
uint8_t prev_keys[6];
|
||||
bool keyboard_state[VITA_MAX_SCANCODE + 1];
|
||||
bool mouse_button_left;
|
||||
bool mouse_button_right;
|
||||
bool mouse_button_middle;
|
||||
|
||||
bool sensors_enabled;
|
||||
#endif
|
||||
} psp_input_t;
|
||||
|
@ -49,26 +49,24 @@ typedef struct
|
||||
int type;
|
||||
int analogCount;
|
||||
int buttonCount;
|
||||
char id[64];
|
||||
char vid[64];
|
||||
char pid[64];
|
||||
|
||||
int device;
|
||||
int port;
|
||||
int index;
|
||||
|
||||
/* Current state. */
|
||||
int buttons;
|
||||
int analog0[3];
|
||||
int analog1[3];
|
||||
char id[64];
|
||||
char vid[64];
|
||||
char pid[64];
|
||||
} qnx_input_device_t;
|
||||
|
||||
struct input_pointer
|
||||
{
|
||||
int16_t x, y;
|
||||
int16_t full_x, full_y;
|
||||
int contact_id;
|
||||
int map;
|
||||
int16_t x, y;
|
||||
int16_t full_x, full_y;
|
||||
};
|
||||
|
||||
#define QNX_MAX_KEYS (65535 + 7) / 8
|
||||
@ -77,25 +75,24 @@ struct input_pointer
|
||||
|
||||
typedef struct qnx_input
|
||||
{
|
||||
unsigned pads_connected;
|
||||
uint64_t pad_state[DEFAULT_MAX_PADS];
|
||||
|
||||
const input_device_driver_t *joypad;
|
||||
|
||||
/*
|
||||
* The first pointer_count indices of touch_map will be a valid,
|
||||
* active index in pointer array.
|
||||
* Saves us from searching through pointer array when polling state.
|
||||
*/
|
||||
struct input_pointer pointer[MAX_TOUCH];
|
||||
unsigned pointer_count;
|
||||
struct input_pointer pointer[MAX_TOUCH]; /* int alignment */
|
||||
int touch_map[MAX_TOUCH];
|
||||
int trackpad_acc[2];
|
||||
unsigned pointer_count;
|
||||
unsigned pads_connected;
|
||||
|
||||
qnx_input_device_t devices[DEFAULT_MAX_PADS];
|
||||
const input_device_driver_t *joypad;
|
||||
|
||||
uint8_t keyboard_state[QNX_MAX_KEYS];
|
||||
|
||||
uint64_t pad_state[DEFAULT_MAX_PADS];
|
||||
|
||||
int trackpad_acc[2];
|
||||
} qnx_input_t;
|
||||
|
||||
extern screen_context_t screen_ctx;
|
||||
|
@ -54,13 +54,17 @@ typedef struct rwebinput_keyboard_event
|
||||
|
||||
typedef struct rwebinput_keyboard_event_queue
|
||||
{
|
||||
rwebinput_keyboard_event_t *events;
|
||||
size_t count;
|
||||
size_t max_size;
|
||||
rwebinput_keyboard_event_t *events;
|
||||
} rwebinput_keyboard_event_queue_t;
|
||||
|
||||
typedef struct rwebinput_mouse_states
|
||||
{
|
||||
double pending_scroll_x;
|
||||
double pending_scroll_y;
|
||||
double scroll_x;
|
||||
double scroll_y;
|
||||
signed x;
|
||||
signed y;
|
||||
signed pending_delta_x;
|
||||
@ -68,18 +72,14 @@ typedef struct rwebinput_mouse_states
|
||||
signed delta_x;
|
||||
signed delta_y;
|
||||
uint8_t buttons;
|
||||
double pending_scroll_x;
|
||||
double pending_scroll_y;
|
||||
double scroll_x;
|
||||
double scroll_y;
|
||||
} rwebinput_mouse_state_t;
|
||||
|
||||
typedef struct rwebinput_input
|
||||
{
|
||||
bool keys[RETROK_LAST];
|
||||
rwebinput_mouse_state_t mouse;
|
||||
rwebinput_keyboard_event_queue_t keyboard;
|
||||
rwebinput_mouse_state_t mouse; /* double alignment */
|
||||
const input_device_driver_t *joypad;
|
||||
rwebinput_keyboard_event_queue_t keyboard; /* ptr alignment */
|
||||
bool keys[RETROK_LAST];
|
||||
} rwebinput_input_t;
|
||||
|
||||
/* KeyboardEvent.keyCode has been deprecated for a while and doesn't have
|
||||
|
@ -37,7 +37,6 @@
|
||||
typedef struct sdl_input
|
||||
{
|
||||
const input_device_driver_t *joypad;
|
||||
|
||||
int mouse_x, mouse_y;
|
||||
int mouse_abs_x, mouse_abs_y;
|
||||
int mouse_l, mouse_r, mouse_m, mouse_b4, mouse_b5, mouse_wu, mouse_wd, mouse_wl, mouse_wr;
|
||||
|
@ -114,14 +114,13 @@ typedef struct
|
||||
|
||||
struct udev_input_device
|
||||
{
|
||||
int fd;
|
||||
dev_t dev;
|
||||
void (*handle_cb)(void *data,
|
||||
const struct input_event *event, udev_input_device_t *dev);
|
||||
char devnode[PATH_MAX_LENGTH];
|
||||
enum udev_input_dev_type type;
|
||||
|
||||
int fd;
|
||||
dev_t dev;
|
||||
udev_input_mouse_t mouse;
|
||||
enum udev_input_dev_type type;
|
||||
char devnode[PATH_MAX_LENGTH];
|
||||
};
|
||||
|
||||
typedef void (*device_handle_cb)(void *data,
|
||||
|
@ -35,6 +35,7 @@
|
||||
|
||||
#include "wiiu_dbg.h"
|
||||
|
||||
/* TODO/FIXME - static global variables */
|
||||
static uint8_t keyboard_channel = 0x00;
|
||||
static bool keyboard_state[RETROK_LAST] = { 0 };
|
||||
|
||||
|
@ -39,11 +39,10 @@ typedef struct x11_input
|
||||
Display *display;
|
||||
Window win;
|
||||
|
||||
char state[32];
|
||||
bool mouse_l, mouse_r, mouse_m;
|
||||
int mouse_x, mouse_y;
|
||||
int mouse_last_x, mouse_last_y;
|
||||
|
||||
char state[32];
|
||||
bool mouse_l, mouse_r, mouse_m;
|
||||
bool grab_mouse;
|
||||
} x11_input_t;
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
/* TODO/FIXME -
|
||||
* fix game focus toggle */
|
||||
|
||||
/* TODO/FIXME - static global variable */
|
||||
static uint64_t state[DEFAULT_MAX_PADS];
|
||||
|
||||
static void xenon360_input_poll(void *data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user