Remove some HAVE_MENU ifdefs

This commit is contained in:
twinaphex 2017-12-31 17:42:07 +01:00
parent 99f696abd2
commit cf3a010ead
22 changed files with 82 additions and 131 deletions

View File

@ -318,17 +318,14 @@ static const video_poke_interface_t caca_poke_interface = {
NULL,
NULL,
NULL,
#if defined(HAVE_MENU)
caca_set_texture_frame,
NULL,
#if defined(HAVE_MENU)
caca_set_osd_msg,
NULL,
#else
NULL,
NULL,
NULL,
NULL,
#endif
NULL,
NULL,
#ifdef HAVE_MENU

View File

@ -1133,9 +1133,9 @@ static const video_poke_interface_t ctr_poke_interface = {
NULL,
ctr_set_aspect_ratio,
ctr_apply_state_changes,
#ifdef HAVE_MENU
ctr_set_texture_frame,
ctr_set_texture_enable,
#ifdef HAVE_MENU
ctr_set_osd_msg,
#endif
NULL,

View File

@ -1745,13 +1745,8 @@ static const video_poke_interface_t d3d_poke_interface = {
NULL, /* get_proc_address */
d3d_set_aspect_ratio,
d3d_apply_state_changes,
#ifdef HAVE_MENU
d3d_set_menu_texture_frame,
d3d_set_menu_texture_enable,
#else
NULL,
NULL,
#endif
d3d_set_osd_msg,
d3d_show_mouse,

View File

@ -644,10 +644,8 @@ static const video_poke_interface_t dispmanx_poke_interface = {
NULL, /* get_proc_address */
dispmanx_set_aspect_ratio,
NULL, /* dispmanx_apply_state_changes */
#ifdef HAVE_MENU
dispmanx_set_texture_frame,
dispmanx_set_texture_enable,
#endif
NULL, /* dispmanx_set_osd_msg */
NULL /* dispmanx_show_mouse */
};

View File

@ -972,10 +972,8 @@ static const video_poke_interface_t drm_poke_interface = {
NULL, /* get_proc_address */
drm_set_aspect_ratio,
NULL, /* drm_apply_state_changes */
#ifdef HAVE_MENU
drm_set_texture_frame,
drm_set_texture_enable,
#endif
NULL, /* drm_set_osd_msg */
NULL /* drm_show_mouse */
};

View File

@ -1491,10 +1491,8 @@ static const video_poke_interface_t exynos_poke_interface = {
NULL, /* get_proc_address */
exynos_set_aspect_ratio,
exynos_apply_state_changes,
#ifdef HAVE_MENU
exynos_set_texture_frame,
exynos_set_texture_enable,
#endif
exynos_set_osd_msg,
exynos_show_mouse
};

View File

@ -546,17 +546,14 @@ static const video_poke_interface_t gdi_poke_interface = {
NULL,
NULL,
NULL,
#if defined(HAVE_MENU)
gdi_set_texture_frame,
NULL,
#if defined(HAVE_MENU)
gdi_set_osd_msg,
NULL,
#else
NULL,
NULL,
NULL,
NULL,
#endif
NULL,
NULL,
#ifdef HAVE_MENU

View File

@ -688,8 +688,6 @@ void gl_load_texture_data(
glGenerateMipmap(GL_TEXTURE_2D);
}
#if defined(HAVE_MENU)
static void gl_set_texture_frame(void *data,
const void *frame, bool rgb32, unsigned width, unsigned height,
float alpha)
@ -732,6 +730,7 @@ static void gl_set_texture_enable(void *data, bool state, bool full_screen)
gl->menu_texture_full_screen = full_screen;
}
#if defined(HAVE_MENU)
static void gl_render_osd_background(
gl_t *gl, video_frame_info_t *video_info,
const char *msg)
@ -2554,16 +2553,14 @@ static const video_poke_interface_t gl_poke_interface = {
gl_get_proc_address,
gl_set_aspect_ratio,
gl_apply_state_changes,
#if defined(HAVE_MENU)
gl_set_texture_frame,
gl_set_texture_enable,
#if defined(HAVE_MENU)
gl_set_osd_msg,
gl_show_mouse,
#else
NULL,
NULL,
NULL,
NULL,
#endif
NULL,

View File

@ -1143,10 +1143,8 @@ static const video_poke_interface_t omap_gfx_poke_interface = {
NULL, /* get_proc_address */
NULL, /* set_aspect_ratio */
NULL, /* apply_state_changes */
#ifdef HAVE_MENU
omap_gfx_set_texture_frame,
omap_gfx_set_texture_enable,
#endif
NULL,
NULL, /* show_mouse */
NULL, /* grab_mouse_toggle */

View File

@ -844,10 +844,8 @@ static const video_poke_interface_t psp_poke_interface = {
NULL, /* get_proc_address */
psp_set_aspect_ratio,
psp_apply_state_changes,
#ifdef HAVE_MENU
psp_set_texture_frame,
psp_set_texture_enable,
#endif
NULL,
NULL,
NULL

View File

@ -672,8 +672,8 @@ static void sdl2_poke_apply_state_changes(void *data)
vid->should_resize = true;
}
#ifdef HAVE_MENU
static void sdl2_poke_set_texture_frame(void *data, const void *frame, bool rgb32,
static void sdl2_poke_set_texture_frame(void *data,
const void *frame, bool rgb32,
unsigned width, unsigned height, float alpha)
{
if (frame)
@ -687,13 +687,17 @@ static void sdl2_poke_set_texture_frame(void *data, const void *frame, bool rgb3
}
}
static void sdl2_poke_texture_enable(void *data, bool enable, bool full_screen)
static void sdl2_poke_texture_enable(void *data,
bool enable, bool full_screen)
{
sdl2_video_t *vid = (sdl2_video_t*)data;
sdl2_video_t *vid = (sdl2_video_t*)data;
vid->menu.active = enable;
if (vid)
vid->menu.active = enable;
}
#ifdef HAVE_MENU
static void sdl2_poke_set_osd_msg(void *data,
video_frame_info_t *video_info,
const char *msg,
@ -731,9 +735,9 @@ static video_poke_interface_t sdl2_video_poke_interface = {
NULL, /* get_proc_address */
sdl2_poke_set_aspect_ratio,
sdl2_poke_apply_state_changes,
#ifdef HAVE_MENU
sdl2_poke_set_texture_frame,
sdl2_poke_texture_enable,
#ifdef HAVE_MENU
sdl2_poke_set_osd_msg,
sdl2_show_mouse,
sdl2_grab_mouse_toggle,
@ -741,8 +745,6 @@ static video_poke_interface_t sdl2_video_poke_interface = {
NULL,
NULL,
NULL,
NULL,
NULL,
#endif
NULL,
};

View File

@ -466,7 +466,6 @@ static void sdl_apply_state_changes(void *data)
(void)data;
}
#ifdef HAVE_MENU
static void sdl_set_texture_frame(void *data, const void *frame, bool rgb32,
unsigned width, unsigned height, float alpha)
{
@ -499,6 +498,8 @@ static void sdl_set_texture_enable(void *data, bool state, bool full_screen)
vid->menu.active = state;
}
#ifdef HAVE_MENU
static void sdl_show_mouse(void *data, bool state)
{
(void)data;
@ -530,17 +531,13 @@ static const video_poke_interface_t sdl_poke_interface = {
NULL, /* get_proc_address */
sdl_set_aspect_ratio,
sdl_apply_state_changes,
#ifdef HAVE_MENU
sdl_set_texture_frame,
#endif
#ifdef HAVE_MENU
sdl_set_texture_enable,
NULL,
#ifdef HAVE_MENU
sdl_show_mouse,
#else
NULL,
NULL,
NULL,
#endif
sdl_grab_mouse_toggle,
NULL

View File

@ -945,10 +945,8 @@ static const video_poke_interface_t sunxi_poke_interface = {
NULL, /* get_proc_address */
sunxi_set_aspect_ratio,
NULL, /* sunxi_apply_state_changes */
#ifdef HAVE_MENU
sunxi_set_texture_frame,
sunxi_set_texture_enable,
#endif
NULL, /* sunxi_set_osd_msg */
NULL /* sunxi_show_mouse */
};

View File

@ -311,56 +311,58 @@ static bool switch_read_viewport(void *data, uint8_t *buffer, bool is_idle)
return true;
}
#if defined(HAVE_MENU)
static void switch_set_texture_frame(void *data, const void *frame, bool rgb32,
unsigned width, unsigned height, float alpha)
static void switch_set_texture_frame(
void *data, const void *frame, bool rgb32,
unsigned width, unsigned height, float alpha)
{
switch_video_t *sw = data;
switch_video_t *sw = data;
if(sw->menu_texture.pixels == NULL || sw->menu_texture.width != width || sw->menu_texture.height != height) {
if(sw->menu_texture.pixels != NULL) {
free(sw->menu_texture.pixels);
}
if ( sw->menu_texture.pixels == NULL ||
sw->menu_texture.width != width ||
sw->menu_texture.height != height)
{
if(sw->menu_texture.pixels != NULL)
free(sw->menu_texture.pixels);
sw->menu_texture.pixels = malloc(width * height * 4);
if(sw->menu_texture.pixels == NULL) {
RARCH_ERR("failed to allocate buffer for menu texture\n");
return;
}
sw->menu_texture.pixels = malloc(width * height * 4);
if(sw->menu_texture.pixels == NULL)
{
RARCH_ERR("failed to allocate buffer for menu texture\n");
return;
}
sw->menu_texture.width = width;
sw->menu_texture.height = height;
struct scaler_ctx *sctx = &sw->menu_texture.scaler;
scaler_ctx_gen_reset(sctx);
sctx->in_width = width;
sctx->in_height = height;
sctx->in_stride = width * 4;
sctx->in_fmt = SCALER_FMT_ARGB8888;
sctx->out_width = 1280;
sctx->out_height = 720;
sctx->out_stride = 1280 * 4;
sctx->out_fmt = SCALER_FMT_ARGB8888;
sctx->scaler_type = SCALER_TYPE_POINT;
if(!scaler_ctx_gen_filter(sctx)) {
RARCH_ERR("failed to generate scaler for menu texture\n");
return;
}
}
if(rgb32) {
memcpy(sw->menu_texture.pixels, frame, width * height * 4);
} else {
conv_rgb565_argb8888(sw->menu_texture.pixels, frame,
width, height,
width * sizeof(uint32_t), width * sizeof(uint16_t));
}
sw->menu_texture.width = width;
sw->menu_texture.height = height;
struct scaler_ctx *sctx = &sw->menu_texture.scaler;
scaler_ctx_gen_reset(sctx);
sctx->in_width = width;
sctx->in_height = height;
sctx->in_stride = width * 4;
sctx->in_fmt = SCALER_FMT_ARGB8888;
sctx->out_width = 1280;
sctx->out_height = 720;
sctx->out_stride = 1280 * 4;
sctx->out_fmt = SCALER_FMT_ARGB8888;
sctx->scaler_type = SCALER_TYPE_POINT;
if(!scaler_ctx_gen_filter(sctx))
{
RARCH_ERR("failed to generate scaler for menu texture\n");
return;
}
}
if(rgb32)
memcpy(sw->menu_texture.pixels, frame, width * height * 4);
else
conv_rgb565_argb8888(sw->menu_texture.pixels, frame,
width, height,
width * sizeof(uint32_t), width * sizeof(uint16_t));
}
#endif
static void switch_set_texture_enable(void *data, bool enable, bool full_screen)
{
@ -383,10 +385,8 @@ static const video_poke_interface_t switch_poke_interface = {
NULL, /* get_proc_address */
NULL, /* set_aspect_ratio */
NULL, /* apply_state_changes */
#if defined(HAVE_MENU)
switch_set_texture_frame, /* set_texture_frame */
#endif
switch_set_texture_enable, /* set_texture_enable */
switch_set_texture_frame,
switch_set_texture_enable,
NULL, /* set_osd_msg */
NULL, /* show_mouse */
NULL, /* grab_mouse_toggle */

View File

@ -405,17 +405,14 @@ static const video_poke_interface_t vga_poke_interface = {
NULL,
NULL,
NULL,
#if defined(HAVE_MENU)
vga_set_texture_frame,
NULL,
#if defined(HAVE_MENU)
vga_set_osd_msg,
NULL,
#else
NULL,
NULL,
NULL,
NULL,
#endif
NULL,
NULL,
#ifdef HAVE_MENU

View File

@ -792,21 +792,16 @@ static const video_poke_interface_t vita_poke_interface = {
NULL, /* get_proc_address */
vita_set_aspect_ratio,
vita_apply_state_changes,
#ifdef HAVE_MENU
vita_set_texture_frame,
vita_set_texture_enable,
#else
NULL,
NULL,
#endif
#ifdef HAVE_MENU
vita_set_osd_msg,
#endif
NULL,
NULL,
NULL,
vita_get_current_sw_framebuffer,
NULL,
#ifdef HAVE_MENU
vita_set_osd_msg,
#endif
NULL,
NULL,
NULL,
vita_get_current_sw_framebuffer,
NULL,
};
static void vita2d_gfx_get_poke_interface(void *data,

View File

@ -2115,7 +2115,6 @@ static bool vulkan_get_hw_render_interface(void *data,
return vk->hw.enable;
}
#if defined(HAVE_MENU)
static void vulkan_set_texture_frame(void *data,
const void *frame, bool rgb32, unsigned width, unsigned height,
float alpha)
@ -2190,6 +2189,7 @@ static void vulkan_set_texture_enable(void *data, bool state, bool full_screen)
vk->menu.full_screen = full_screen;
}
#if defined(HAVE_MENU)
static void vulkan_set_osd_msg(void *data,
video_frame_info_t *video_info,
const char *msg,
@ -2274,13 +2274,8 @@ static const video_poke_interface_t vulkan_poke_interface = {
NULL,
vulkan_set_aspect_ratio,
vulkan_apply_state_changes,
#if defined(HAVE_MENU)
vulkan_set_texture_frame,
vulkan_set_texture_enable,
#else
NULL,
NULL,
#endif
#ifdef HAVE_MENU
vulkan_set_osd_msg,
#endif

View File

@ -1054,9 +1054,7 @@ static const video_poke_interface_t wiiu_poke_interface =
NULL, /* get_proc_address */
wiiu_gfx_set_aspect_ratio,
wiiu_gfx_apply_state_changes,
#ifdef HAVE_MENU
wiiu_gfx_set_texture_frame,
#endif
wiiu_gfx_set_texture_enable,
wiiu_gfx_set_osd_msg,
NULL, /* show_mouse */

View File

@ -218,9 +218,9 @@ static video_poke_interface_t xshm_video_poke_interface = {
NULL, /* get_proc_address */
xshm_poke_set_aspect_ratio,
xshm_poke_apply_state_changes,
#ifdef HAVE_MENU
xshm_poke_set_texture_frame,
xshm_poke_texture_enable,
#ifdef HAVE_MENU
xshm_poke_set_osd_msg,
xshm_show_mouse,
xshm_grab_mouse_toggle,
@ -228,8 +228,6 @@ static video_poke_interface_t xshm_video_poke_interface = {
NULL,
NULL,
NULL,
NULL,
NULL,
#endif
NULL,
};

View File

@ -1168,11 +1168,9 @@ void video_driver_set_texture_enable(bool enable, bool fullscreen)
void video_driver_set_texture_frame(const void *frame, bool rgb32,
unsigned width, unsigned height, float alpha)
{
#ifdef HAVE_MENU
if (video_driver_poke && video_driver_poke->set_texture_frame)
video_driver_poke->set_texture_frame(video_driver_data,
frame, rgb32, width, height, alpha);
#endif
}
#ifdef HAVE_OVERLAY

View File

@ -698,11 +698,9 @@ typedef struct video_poke_interface
void (*set_aspect_ratio)(void *data, unsigned aspectratio_index);
void (*apply_state_changes)(void *data);
#ifdef HAVE_MENU
/* Update texture. */
void (*set_texture_frame)(void *data, const void *frame, bool rgb32,
unsigned width, unsigned height, float alpha);
#endif
/* Enable or disable rendering. */
void (*set_texture_enable)(void *data, bool enable, bool full_screen);
void (*set_osd_msg)(void *data, video_frame_info_t *video_info,

View File

@ -1270,13 +1270,12 @@ static const video_poke_interface_t thread_poke = {
NULL, /* get_proc_address */
thread_set_aspect_ratio,
thread_apply_state_changes,
#if defined(HAVE_MENU)
thread_set_texture_frame,
thread_set_texture_enable,
#if defined(HAVE_MENU)
thread_set_osd_msg,
#else
NULL,
NULL,
#endif
NULL,