Get rid of HAVE_MENU ifdefs for video_driver_poke interface

This commit is contained in:
twinaphex 2018-01-30 22:14:47 +01:00
parent 7f38ee79f7
commit 7dcd46a20f
8 changed files with 25 additions and 50 deletions

View File

@ -324,9 +324,7 @@ static const video_poke_interface_t caca_poke_interface = {
NULL,
NULL,
#ifdef HAVE_MENU
NULL,
#endif
};
static void caca_gfx_get_poke_interface(void *data,

View File

@ -552,9 +552,7 @@ static const video_poke_interface_t gdi_poke_interface = {
NULL,
NULL,
#ifdef HAVE_MENU
NULL,
#endif
};
static void gdi_gfx_get_poke_interface(void *data,

View File

@ -2561,16 +2561,9 @@ static const video_poke_interface_t gl_poke_interface = {
gl_set_texture_frame,
gl_set_texture_enable,
gl_set_osd_msg,
#if defined(HAVE_MENU)
gl_show_mouse,
#else
NULL,
#endif
NULL,
#ifdef HAVE_MENU
gl_get_current_shader,
#endif
};
static void gl_get_poke_interface(void *data,

View File

@ -706,7 +706,6 @@ static void sdl2_poke_set_osd_msg(void *data,
RARCH_LOG("[SDL2]: OSD MSG: %s\n", msg);
}
#ifdef HAVE_MENU
static void sdl2_show_mouse(void *data, bool state)
{
(void)data;
@ -718,7 +717,6 @@ static void sdl2_grab_mouse_toggle(void *data)
sdl2_video_t *vid = (sdl2_video_t*)data;
SDL_SetWindowGrab(vid->window, SDL_GetWindowGrab(vid->window));
}
#endif
static video_poke_interface_t sdl2_video_poke_interface = {
NULL, /* set_coords */
@ -737,13 +735,8 @@ static video_poke_interface_t sdl2_video_poke_interface = {
sdl2_poke_set_texture_frame,
sdl2_poke_texture_enable,
sdl2_poke_set_osd_msg,
#ifdef HAVE_MENU
sdl2_show_mouse,
sdl2_grab_mouse_toggle,
#else
NULL,
NULL,
#endif
NULL,
};

View File

@ -499,14 +499,12 @@ static void sdl_set_texture_enable(void *data, bool state, bool full_screen)
}
#ifdef HAVE_MENU
static void sdl_show_mouse(void *data, bool state)
{
(void)data;
SDL_ShowCursor(state);
}
#endif
static void sdl_grab_mouse_toggle(void *data)
{
@ -534,11 +532,7 @@ static const video_poke_interface_t sdl_poke_interface = {
sdl_set_texture_frame,
sdl_set_texture_enable,
NULL,
#ifdef HAVE_MENU
sdl_show_mouse,
#else
NULL,
#endif
sdl_grab_mouse_toggle,
NULL
};

View File

@ -69,7 +69,7 @@ static void *switch_init(const video_info_t *video,
RARCH_LOG("loading switch gfx driver, width: %d, height: %d\n", video->width, video->height);
if(has_initialized)
if (has_initialized)
RARCH_LOG("global graphics were already initialized; skipping...\n");
else
{
@ -192,17 +192,23 @@ static bool switch_frame(void *data, const void *frame,
}
#if defined(HAVE_MENU)
if(sw->menu_texture.enable)
if (sw->menu_texture.enable)
{
menu_driver_frame(video_info);
if(sw->menu_texture.pixels != NULL)
if (sw->menu_texture.pixels)
{
//if(sw->menu_texture.fullscreen) {
#if 0
if (sw->menu_texture.fullscreen)
{
#endif
scaler_ctx_scale(&sw->menu_texture.scaler, image, sw->menu_texture.pixels);
//} else {
//}
#if 0
}
else
{
}
#endif
}
}
#endif
@ -217,11 +223,11 @@ static bool switch_frame(void *data, const void *frame,
}
#endif
if (msg != NULL && strlen(msg) > 0)
if (msg && strlen(msg) > 0)
RARCH_LOG("message: %s\n", msg);
do {
if (sw->vsync) // vsync seems to sometimes return before the buffer has actually been dequeued?
if (sw->vsync) /* vsync seems to sometimes return before the buffer has actually been dequeued? */
switch_wait_vsync(sw);
post_vsync = svcGetSystemTick();
@ -323,15 +329,15 @@ static void switch_set_texture_frame(
{
switch_video_t *sw = data;
if ( sw->menu_texture.pixels == NULL ||
sw->menu_texture.width != width ||
if ( !sw->menu_texture.pixels ||
sw->menu_texture.width != width ||
sw->menu_texture.height != height)
{
if(sw->menu_texture.pixels != NULL)
if (sw->menu_texture.pixels)
free(sw->menu_texture.pixels);
sw->menu_texture.pixels = malloc(width * height * 4);
if(sw->menu_texture.pixels == NULL)
if (!sw->menu_texture.pixels)
{
RARCH_ERR("failed to allocate buffer for menu texture\n");
return;
@ -355,14 +361,14 @@ static void switch_set_texture_frame(
sctx->scaler_type = SCALER_TYPE_POINT;
if(!scaler_ctx_gen_filter(sctx))
if (!scaler_ctx_gen_filter(sctx))
{
RARCH_ERR("failed to generate scaler for menu texture\n");
return;
}
}
if(rgb32)
if (rgb32)
memcpy(sw->menu_texture.pixels, frame, width * height * 4);
else
conv_rgb565_argb8888(sw->menu_texture.pixels, frame,

View File

@ -411,9 +411,7 @@ static const video_poke_interface_t vga_poke_interface = {
NULL,
NULL,
#ifdef HAVE_MENU
NULL,
#endif
};
static void vga_gfx_get_poke_interface(void *data,

View File

@ -173,14 +173,15 @@ static void xshm_poke_apply_state_changes(void *data)
}
#ifdef HAVE_MENU
static void xshm_poke_set_texture_frame(void *data, const void *frame, bool rgb32,
static void xshm_poke_set_texture_frame(void *data,
const void *frame, bool rgb32,
unsigned width, unsigned height, float alpha)
{
}
static void xshm_poke_texture_enable(void *data, bool enable, bool full_screen)
static void xshm_poke_texture_enable(void *data,
bool enable, bool full_screen)
{
}
@ -201,7 +202,6 @@ static void xshm_grab_mouse_toggle(void *data)
{
}
#endif
static video_poke_interface_t xshm_video_poke_interface = {
NULL, /* set_coords */
@ -220,13 +220,8 @@ static video_poke_interface_t xshm_video_poke_interface = {
xshm_poke_set_texture_frame,
xshm_poke_texture_enable,
xshm_poke_set_osd_msg,
#ifdef HAVE_MENU
xshm_show_mouse,
xshm_grab_mouse_toggle,
#else
NULL,
NULL,
#endif
NULL,
};