From 62960177fe91c7908fcd9789e6c8b06d32d39d56 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 13 Apr 2015 11:41:44 +0200 Subject: [PATCH] Rename rarch_cmd_state to event_cmd_state and move to command_event.h --- command_event.h | 36 ++++++++++++++++++++++++++++++++++++ retroarch.h | 39 +-------------------------------------- runloop.c | 10 +++++----- 3 files changed, 42 insertions(+), 43 deletions(-) diff --git a/command_event.h b/command_event.h index e5fcf0c06f..2d3b6cb2cf 100644 --- a/command_event.h +++ b/command_event.h @@ -195,6 +195,42 @@ enum event_command EVENT_CMD_DATA_RUNLOOP_FREE, }; +typedef struct event_cmd_state +{ + bool fullscreen_toggle; + bool overlay_next_pressed; + bool grab_mouse_pressed; + bool menu_pressed; + bool quit_key_pressed; + bool screenshot_pressed; + bool mute_pressed; + bool osk_pressed; + bool volume_up_pressed; + bool volume_down_pressed; + bool reset_pressed; + bool disk_prev_pressed; + bool disk_next_pressed; + bool disk_eject_pressed; + bool movie_record; + bool save_state_pressed; + bool load_state_pressed; + bool slowmotion_pressed; + bool shader_next_pressed; + bool shader_prev_pressed; + bool fastforward_pressed; + bool hold_pressed; + bool old_hold_pressed; + bool state_slot_increase; + bool state_slot_decrease; + bool pause_pressed; + bool frameadvance_pressed; + bool rewind_pressed; + bool netplay_flip_pressed; + bool cheat_index_plus_pressed; + bool cheat_index_minus_pressed; + bool cheat_toggle_pressed; +} event_cmd_state_t; + /** * event_disk_control_append_image: * @path : Path to disk image. diff --git a/retroarch.h b/retroarch.h index ec334d9959..402497f576 100644 --- a/retroarch.h +++ b/retroarch.h @@ -19,13 +19,12 @@ #include #include "core_info.h" +#include "command_event.h" #ifdef __cplusplus extern "C" { #endif -#include "command_event.h" - enum action_state { RARCH_ACTION_STATE_NONE = 0, @@ -49,42 +48,6 @@ struct rarch_main_wrap bool touched; }; -typedef struct rarch_cmd_state -{ - bool fullscreen_toggle; - bool overlay_next_pressed; - bool grab_mouse_pressed; - bool menu_pressed; - bool quit_key_pressed; - bool screenshot_pressed; - bool mute_pressed; - bool osk_pressed; - bool volume_up_pressed; - bool volume_down_pressed; - bool reset_pressed; - bool disk_prev_pressed; - bool disk_next_pressed; - bool disk_eject_pressed; - bool movie_record; - bool save_state_pressed; - bool load_state_pressed; - bool slowmotion_pressed; - bool shader_next_pressed; - bool shader_prev_pressed; - bool fastforward_pressed; - bool hold_pressed; - bool old_hold_pressed; - bool state_slot_increase; - bool state_slot_decrease; - bool pause_pressed; - bool frameadvance_pressed; - bool rewind_pressed; - bool netplay_flip_pressed; - bool cheat_index_plus_pressed; - bool cheat_index_minus_pressed; - bool cheat_toggle_pressed; -} rarch_cmd_state_t; - void rarch_main_alloc(void); void rarch_main_new(void); diff --git a/runloop.c b/runloop.c index 85a53a0790..bd67dbbfad 100644 --- a/runloop.c +++ b/runloop.c @@ -443,7 +443,7 @@ static void do_state_check_menu_toggle(void) * * Returns: 0. **/ -static int do_pre_state_checks(rarch_cmd_state_t *cmd) +static int do_pre_state_checks(event_cmd_state_t *cmd) { runloop_t *runloop = rarch_main_get_ptr(); global_t *global = global_get_ptr(); @@ -513,7 +513,7 @@ static int do_pause_state_checks( * * Returns: 1 if RetroArch is in pause mode, 0 otherwise. **/ -static int do_state_checks(rarch_cmd_state_t *cmd) +static int do_state_checks(event_cmd_state_t *cmd) { driver_t *driver = driver_get_ptr(); runloop_t *runloop = rarch_main_get_ptr(); @@ -611,7 +611,7 @@ static int do_state_checks(rarch_cmd_state_t *cmd) * * Returns: 1 if any of the above conditions are true, otherwise 0. **/ -static INLINE int time_to_exit(rarch_cmd_state_t *cmd) +static INLINE int time_to_exit(event_cmd_state_t *cmd) { runloop_t *runloop = rarch_main_get_ptr(); global_t *global = global_get_ptr(); @@ -1020,7 +1020,7 @@ bool rarch_main_is_idle(void) return runloop->is_idle; } -static void rarch_main_cmd_get_state(rarch_cmd_state_t *cmd, +static void rarch_main_cmd_get_state(event_cmd_state_t *cmd, retro_input_t input, retro_input_t old_input, retro_input_t trigger_input) { @@ -1079,7 +1079,7 @@ int rarch_main_iterate(void) { unsigned i; retro_input_t trigger_input; - rarch_cmd_state_t cmd = {0}; + event_cmd_state_t cmd = {0}; runloop_t *runloop = rarch_main_get_ptr(); int ret = 0; static retro_input_t last_input = 0;