menu_bind_state struct definitions need to be moved over to menu_input.h

This commit is contained in:
twinaphex 2021-09-03 06:48:06 +02:00
parent 93dbd746db
commit a0e4d64c3b
2 changed files with 42 additions and 43 deletions

View File

@ -61,11 +61,6 @@ RETRO_BEGIN_DECLS
#define POWERSTATE_CHECK_INTERVAL (30 * 1000000)
#define DATETIME_CHECK_INTERVAL 1000000
#define MENU_MAX_BUTTONS 219
#define MENU_MAX_AXES 32
#define MENU_MAX_HATS 4
#define MENU_MAX_MBUTTONS 32 /* Enough to cover largest libretro constant*/
#define MENU_LIST_GET(list, idx) ((list) ? ((list)->menu_stack[(idx)]) : NULL)
#define MENU_LIST_GET_SELECTION(list, idx) ((list) ? ((list)->selection_buf[(idx)]) : NULL)
@ -341,44 +336,6 @@ typedef struct menu_ctx_load_image
enum menu_image_type type;
} menu_ctx_load_image_t;
struct menu_bind_state_port
{
int16_t axes[MENU_MAX_AXES];
uint16_t hats[MENU_MAX_HATS];
bool mouse_buttons[MENU_MAX_MBUTTONS];
bool buttons[MENU_MAX_BUTTONS];
};
struct menu_bind_axis_state
{
/* Default axis state. */
int16_t rested_axes[MENU_MAX_AXES];
/* Locked axis state. If we configured an axis,
* avoid having the same axis state trigger something again right away. */
int16_t locked_axes[MENU_MAX_AXES];
};
struct menu_bind_state
{
rarch_timer_t timer_timeout;
rarch_timer_t timer_hold;
struct retro_keybind *output;
struct retro_keybind buffer;
struct menu_bind_state_port state[MAX_USERS];
struct menu_bind_axis_state axis_state[MAX_USERS];
unsigned begin;
unsigned last;
unsigned user;
unsigned port;
bool skip;
};
typedef struct menu_ctx_driver
{
/* Set a framebuffer texture. This is used for instance by RGUI. */

View File

@ -27,6 +27,7 @@
#include "menu_defines.h"
#include "../input/input_types.h"
#include "../input/input_driver.h"
#include "../performance_counters.h"
RETRO_BEGIN_DECLS
@ -97,6 +98,11 @@ RETRO_BEGIN_DECLS
#define MENU_INPUT_DPI_THRESHOLD_SWIPE 0.55f
#define MENU_INPUT_DPI_THRESHOLD_SWIPE_TANGENT 0.45f
#define MENU_MAX_BUTTONS 219
#define MENU_MAX_AXES 32
#define MENU_MAX_HATS 4
#define MENU_MAX_MBUTTONS 32 /* Enough to cover largest libretro constant*/
enum menu_pointer_type
{
MENU_POINTER_DISABLED = 0,
@ -137,6 +143,42 @@ enum menu_input_pointer_gesture
MENU_INPUT_GESTURE_SWIPE_RIGHT
};
struct menu_bind_state_port
{
int16_t axes[MENU_MAX_AXES];
uint16_t hats[MENU_MAX_HATS];
bool mouse_buttons[MENU_MAX_MBUTTONS];
bool buttons[MENU_MAX_BUTTONS];
};
struct menu_bind_axis_state
{
/* Default axis state. */
int16_t rested_axes[MENU_MAX_AXES];
/* Locked axis state. If we configured an axis,
* avoid having the same axis state trigger something again right away. */
int16_t locked_axes[MENU_MAX_AXES];
};
struct menu_bind_state
{
rarch_timer_t timer_timeout;
rarch_timer_t timer_hold;
struct retro_keybind *output;
struct retro_keybind buffer;
struct menu_bind_state_port state[MAX_USERS];
struct menu_bind_axis_state axis_state[MAX_USERS];
unsigned begin;
unsigned last;
unsigned user;
unsigned port;
bool skip;
};
/* Defines set of (abstracted) inputs/states
* common to mouse + touchscreen hardware */
typedef struct menu_input_pointer_hw_state