(input_overlay.c) Remove more hacks

This commit is contained in:
twinaphex 2016-11-27 15:21:53 +01:00
parent 267fdbe21e
commit 4e8bb52038
4 changed files with 9 additions and 10 deletions

View File

@ -2034,7 +2034,8 @@ bool command_event(enum event_command cmd, void *data)
break;
case CMD_EVENT_OVERLAY_DEINIT:
#ifdef HAVE_OVERLAY
input_overlay_free();
input_overlay_free(overlay_ptr);
overlay_ptr = NULL;
#endif
break;
case CMD_EVENT_OVERLAY_INIT:

View File

@ -480,7 +480,8 @@ int16_t input_state(unsigned port, unsigned device,
current_input_data, libretro_input_binds, port, device, idx, id);
#ifdef HAVE_OVERLAY
input_state_overlay(&res, port, device, idx, id);
if (overlay_ptr)
input_state_overlay(overlay_ptr, &res, port, device, idx, id);
#endif
#ifdef HAVE_NETWORKGAMEPAD

View File

@ -488,12 +488,10 @@ static bool input_overlay_full_screen(input_overlay_t *ol)
*
* Frees overlay handle.
**/
void input_overlay_free(void)
void input_overlay_free(input_overlay_t *ol)
{
input_overlay_t *ol = overlay_ptr;
if (!ol)
return;
overlay_ptr = NULL;
input_overlay_free_overlays(ol);
@ -734,10 +732,9 @@ void input_poll_overlay(input_overlay_t *ol, float opacity)
input_overlay_poll_clear(ol, opacity);
}
void input_state_overlay(int16_t *ret, unsigned port, unsigned device, unsigned idx,
void input_state_overlay(input_overlay_t *ol, int16_t *ret, unsigned port, unsigned device, unsigned idx,
unsigned id)
{
input_overlay_t *ol = overlay_ptr;
input_overlay_state_t *ol_state = ol ? &ol->overlay_state : NULL;
if (!ol || port != 0)

View File

@ -191,7 +191,7 @@ typedef struct
*
* Frees overlay handle.
**/
void input_overlay_free(void);
void input_overlay_free(input_overlay_t *ol);
void input_overlay_free_overlay(struct overlay *overlay);
@ -234,8 +234,8 @@ void input_overlay_next(input_overlay_t *ol, float opacity);
**/
void input_poll_overlay(input_overlay_t *ol, float opacity);
void input_state_overlay(int16_t *ret,
unsigned port, unsigned device, unsigned idx,
void input_state_overlay(input_overlay_t *ol,
int16_t *ret, unsigned port, unsigned device, unsigned idx,
unsigned id);
bool input_overlay_key_pressed(input_overlay_t *ol, int key);