Get rid of some superfluous wrapper functions

This commit is contained in:
twinaphex 2015-07-12 11:14:41 +02:00
parent 7fb1265227
commit 117fd48f15
6 changed files with 12 additions and 30 deletions

View File

@ -1158,6 +1158,8 @@ bool event_command(enum event_command cmd)
{
const struct retro_hw_render_callback *hw_render =
(const struct retro_hw_render_callback*)video_driver_callback();
const input_driver_t *input = driver ?
(const input_driver_t*)driver->input : NULL;
driver->video_cache_context = hw_render->cache_context;
driver->video_cache_context_ack = false;
@ -1165,7 +1167,7 @@ bool event_command(enum event_command cmd)
driver->video_cache_context = false;
/* Poll input to avoid possibly stale data to corrupt things. */
input_driver_poll();
input->poll(driver->input_data);
#ifdef HAVE_MENU
menu_display_fb_set_dirty();

View File

@ -858,18 +858,6 @@ void video_driver_get_video_output_prev(void)
poke->get_video_output_prev(driver->video_data);
}
bool video_driver_frame(const void *frame, unsigned width,
unsigned height, unsigned pitch, const char *msg)
{
driver_t *driver = driver_get_ptr();
const video_driver_t *video = video_driver_ctx_get_ptr();
if (video->frame(driver->video_data, frame,
width, height, pitch, msg))
return true;
return false;
}
/**
* video_driver_cached_frame:
*

View File

@ -330,9 +330,6 @@ void video_driver_get_video_output_next(void);
void video_driver_get_video_output_prev(void);
bool video_driver_frame(const void *frame, unsigned width,
unsigned height, unsigned pitch, const char *msg);
bool video_driver_suppress_screensaver(bool enable);
const char *video_driver_get_ident(void);

View File

@ -249,15 +249,6 @@ int16_t input_driver_state(const struct retro_keybind **retro_keybinds,
port, device, index, id);
}
void input_driver_poll(void)
{
driver_t *driver = driver_get_ptr();
const input_driver_t *input = input_get_ptr(driver);
input->poll(driver->input_data);
}
const input_device_driver_t *input_driver_get_joypad_driver(void)
{
driver_t *driver = driver_get_ptr();

View File

@ -144,8 +144,6 @@ retro_input_t input_driver_keys_pressed(void);
int16_t input_driver_state(const struct retro_keybind **retro_keybinds,
unsigned port, unsigned device, unsigned index, unsigned id);
void input_driver_poll(void);
bool input_driver_key_pressed(int key);
uint64_t input_driver_get_capabilities(void);

View File

@ -63,6 +63,8 @@ static void video_frame(const void *data, unsigned width,
driver_t *driver = driver_get_ptr();
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
const video_driver_t *video =
driver ? (const video_driver_t*)driver->video : NULL;
if (!driver->video_active)
return;
@ -103,7 +105,7 @@ static void video_frame(const void *data, unsigned width,
pitch = output_pitch;
}
if (!video_driver_frame(data, width, height, pitch, driver->current_msg))
if (!video->frame(driver->video_data, data, width, height, pitch, driver->current_msg))
driver->video_active = false;
}
@ -161,6 +163,8 @@ static int16_t input_state(unsigned port, unsigned device,
settings_t *settings = config_get_ptr();
driver_t *driver = driver_get_ptr();
global_t *global = global_get_ptr();
const input_driver_t *input = driver ?
(const input_driver_t*)driver->input : NULL;
for (i = 0; i < MAX_USERS; i++)
libretro_input_binds[i] = settings->input.binds[i];
@ -182,7 +186,7 @@ static int16_t input_state(unsigned port, unsigned device,
if (!driver->block_libretro_input)
{
if (((id < RARCH_FIRST_META_KEY) || (device == RETRO_DEVICE_KEYBOARD)))
res = input_driver_state(libretro_input_binds, port, device, idx, id);
res = input->input_state(driver->input_data, libretro_input_binds, port, device, idx, id);
#ifdef HAVE_OVERLAY
input_state_overlay(&res, port, device, idx, id);
@ -213,8 +217,10 @@ static void input_poll(void)
{
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
const input_driver_t *input = driver ?
(const input_driver_t*)driver->input : NULL;
input_driver_poll();
input->poll(driver->input_data);
(void)driver;