Simplify has_windowed

This commit is contained in:
twinaphex 2017-01-19 02:50:56 +01:00
parent 3761b5bdf6
commit 7fbd3fcfb6
15 changed files with 25 additions and 89 deletions

View File

@ -421,12 +421,6 @@ static bool android_gfx_ctx_suppress_screensaver(void *data, bool enable)
return false;
}
static bool android_gfx_ctx_has_windowed(void *data)
{
(void)data;
return false;
}
static void dpi_get_density(char *s, size_t len)
{
system_property_get("getprop", "ro.sf.lcd_density", s);
@ -608,7 +602,7 @@ const gfx_ctx_driver_t gfx_ctx_android = {
android_gfx_ctx_set_resize,
android_gfx_ctx_has_focus,
android_gfx_ctx_suppress_screensaver,
android_gfx_ctx_has_windowed,
NULL, /* has_windowed */
android_gfx_ctx_swap_buffers,
android_gfx_ctx_input_driver,
android_gfx_ctx_get_proc_address,

View File

@ -179,12 +179,6 @@ static bool gfx_ctx_cgl_suppress_screensaver(void *data, bool enable)
return false;
}
static bool gfx_ctx_cgl_has_windowed(void *data)
{
(void)data;
return false;
}
static bool gfx_ctx_cgl_bind_api(void *data, enum gfx_ctx_api api,
unsigned major, unsigned minor)
{
@ -353,7 +347,7 @@ const gfx_ctx_driver_t gfx_ctx_cgl = {
gfx_ctx_cgl_set_resize,
gfx_ctx_cgl_has_focus,
gfx_ctx_cgl_suppress_screensaver,
gfx_ctx_cgl_has_windowed,
NULL, /* has_windowed */
gfx_ctx_cgl_swap_buffers,
gfx_ctx_cgl_input_driver,
gfx_ctx_cgl_get_proc_address,

View File

@ -516,16 +516,12 @@ static bool cocoagl_gfx_ctx_suppress_screensaver(void *data, bool enable)
return false;
}
#if !defined(HAVE_COCOATOUCH)
static bool cocoagl_gfx_ctx_has_windowed(void *data)
{
(void)data;
#if defined(HAVE_COCOATOUCH)
return false;
#else
return true;
#endif
}
#endif
static void cocoagl_gfx_ctx_swap_buffers(void *data, video_frame_info_t *video_info)
{
@ -629,7 +625,11 @@ const gfx_ctx_driver_t gfx_ctx_cocoagl = {
cocoagl_gfx_ctx_set_resize,
cocoagl_gfx_ctx_has_focus,
cocoagl_gfx_ctx_suppress_screensaver,
#if defined(HAVE_COCOATOUCH)
NULL,
#else
cocoagl_gfx_ctx_has_windowed,
#endif
cocoagl_gfx_ctx_swap_buffers,
cocoagl_gfx_ctx_input_driver,
cocoagl_gfx_ctx_get_proc_address,

View File

@ -131,16 +131,14 @@ static bool gfx_ctx_d3d_suppress_screensaver(void *data, bool enable)
return win32_suppress_screensaver(data, enable);
}
#ifndef _XBOX
static bool gfx_ctx_d3d_has_windowed(void *data)
{
(void)data;
#ifdef _XBOX
return false;
#else
return true;
#endif
}
#endif
static bool gfx_ctx_d3d_bind_api(void *data,
enum gfx_ctx_api api, unsigned major, unsigned minor)
@ -337,7 +335,11 @@ const gfx_ctx_driver_t gfx_ctx_d3d = {
gfx_ctx_d3d_set_resize,
gfx_ctx_d3d_has_focus,
gfx_ctx_d3d_suppress_screensaver,
#ifdef _XBOX
NULL,
#else
gfx_ctx_d3d_has_windowed,
#endif
gfx_ctx_d3d_swap_buffers,
gfx_ctx_d3d_input_driver,
NULL,

View File

@ -749,12 +749,6 @@ static bool gfx_ctx_drm_suppress_screensaver(void *data, bool enable)
return false;
}
static bool gfx_ctx_drm_has_windowed(void *data)
{
(void)data;
return false;
}
static bool gfx_ctx_drm_bind_api(void *video_driver,
enum gfx_ctx_api api, unsigned major, unsigned minor)
{
@ -878,7 +872,7 @@ const gfx_ctx_driver_t gfx_ctx_drm = {
gfx_ctx_drm_set_resize,
gfx_ctx_drm_has_focus,
gfx_ctx_drm_suppress_screensaver,
gfx_ctx_drm_has_windowed,
NULL, /* has_windowed */
gfx_ctx_drm_swap_buffers,
gfx_ctx_drm_input_driver,
gfx_ctx_drm_get_proc_address,

View File

@ -94,12 +94,6 @@ static bool gfx_ctx_null_suppress_screensaver(void *data, bool enable)
return false;
}
static bool gfx_ctx_null_has_windowed(void *data)
{
(void)data;
return true;
}
static bool gfx_ctx_null_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor)
{
(void)data;
@ -159,7 +153,7 @@ const gfx_ctx_driver_t gfx_ctx_null = {
gfx_ctx_null_set_resize,
gfx_ctx_null_has_focus,
gfx_ctx_null_suppress_screensaver,
gfx_ctx_null_has_windowed,
NULL, /* has_windowed */
gfx_ctx_null_swap_buffers,
gfx_ctx_null_input_driver,
NULL,

View File

@ -170,12 +170,6 @@ static bool gfx_ctx_khr_display_suppress_screensaver(void *data, bool enable)
return false;
}
static bool gfx_ctx_khr_display_has_windowed(void *data)
{
(void)data;
return false;
}
static void gfx_ctx_khr_display_set_swap_interval(void *data, unsigned swap_interval)
{
khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)data;
@ -234,7 +228,7 @@ const gfx_ctx_driver_t gfx_ctx_khr_display = {
gfx_ctx_khr_display_set_resize,
gfx_ctx_khr_display_has_focus,
gfx_ctx_khr_display_suppress_screensaver,
gfx_ctx_khr_display_has_windowed,
NULL, /* has_windowed */
gfx_ctx_khr_display_swap_buffers,
gfx_ctx_khr_display_input_driver,
gfx_ctx_khr_display_get_proc_address,

View File

@ -239,12 +239,6 @@ static bool gfx_ctx_mali_fbdev_suppress_screensaver(void *data, bool enable)
return false;
}
static bool gfx_ctx_mali_fbdev_has_windowed(void *data)
{
(void)data;
return false;
}
static void gfx_ctx_mali_fbdev_set_swap_interval(void *data, unsigned swap_interval)
{
mali_ctx_data_t *mali = (mali_ctx_data_t*)data;
@ -309,7 +303,7 @@ const gfx_ctx_driver_t gfx_ctx_mali_fbdev = {
gfx_ctx_mali_fbdev_set_resize,
gfx_ctx_mali_fbdev_has_focus,
gfx_ctx_mali_fbdev_suppress_screensaver,
gfx_ctx_mali_fbdev_has_windowed,
NULL, /* has_windowed */
gfx_ctx_mali_fbdev_swap_buffers,
gfx_ctx_mali_fbdev_input_driver,
gfx_ctx_mali_fbdev_get_proc_address,

View File

@ -212,12 +212,6 @@ static bool gfx_ctx_opendingux_suppress_screensaver(void *data, bool enable)
return false;
}
static bool gfx_ctx_opendingux_has_windowed(void *data)
{
(void)data;
return false;
}
static void gfx_ctx_opendingux_swap_buffers(void *data, video_frame_info_t *video_info)
{
opendingux_ctx_data_t *viv = (opendingux_ctx_data_t*)data;
@ -283,7 +277,7 @@ const gfx_ctx_driver_t gfx_ctx_opendingux_fbdev = {
gfx_ctx_opendingux_set_resize,
gfx_ctx_opendingux_has_focus,
gfx_ctx_opendingux_suppress_screensaver,
gfx_ctx_opendingux_has_windowed,
NULL, /* has_windowed */
gfx_ctx_opendingux_swap_buffers,
gfx_ctx_opendingux_input_driver,
gfx_ctx_opendingux_get_proc_address,

View File

@ -172,12 +172,6 @@ static bool gfx_ctx_ps3_suppress_screensaver(void *data, bool enable)
return false;
}
static bool gfx_ctx_ps3_has_windowed(void *data)
{
(void)data;
return false;
}
static void gfx_ctx_ps3_swap_buffers(void *data, video_frame_info_t *video_info)
{
(void)data;
@ -422,7 +416,7 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = {
gfx_ctx_ps3_set_resize,
gfx_ctx_ps3_has_focus,
gfx_ctx_ps3_suppress_screensaver,
gfx_ctx_ps3_has_windowed,
NULL, /* has_windowed */
gfx_ctx_ps3_swap_buffers,
gfx_ctx_ps3_input_driver,
NULL,

View File

@ -359,12 +359,6 @@ static bool gfx_ctx_qnx_suppress_screensaver(void *data, bool enable)
return false;
}
static bool gfx_ctx_qnx_has_windowed(void *data)
{
(void)data;
return false;
}
static int dpi_get_density(qnx_ctx_data_t *qnx)
{
int screen_dpi[2];
@ -482,7 +476,7 @@ const gfx_ctx_driver_t gfx_ctx_qnx = {
gfx_ctx_qnx_set_resize,
gfx_ctx_qnx_has_focus,
gfx_ctx_qnx_suppress_screensaver,
gfx_ctx_qnx_has_windowed,
NULL, /* has_windowed */
gfx_ctx_qnx_swap_buffers,
gfx_ctx_qnx_input_driver,
gfx_ctx_qnx_get_proc_address,

View File

@ -457,12 +457,6 @@ static bool gfx_ctx_vc_suppress_screensaver(void *data, bool enable)
return false;
}
static bool gfx_ctx_vc_has_windowed(void *data)
{
(void)data;
return false;
}
static float gfx_ctx_vc_translate_aspect(void *data,
unsigned width, unsigned height)
{
@ -650,7 +644,7 @@ const gfx_ctx_driver_t gfx_ctx_videocore = {
gfx_ctx_vc_set_resize,
gfx_ctx_vc_has_focus,
gfx_ctx_vc_suppress_screensaver,
gfx_ctx_vc_has_windowed,
NULL, /* has_windowed */
gfx_ctx_vc_swap_buffers,
gfx_ctx_vc_input_driver,
gfx_ctx_vc_get_proc_address,

View File

@ -217,12 +217,6 @@ static bool gfx_ctx_vivante_suppress_screensaver(void *data, bool enable)
return false;
}
static bool gfx_ctx_vivante_has_windowed(void *data)
{
(void)data;
return false;
}
static void gfx_ctx_vivante_set_swap_interval(void *data, unsigned swap_interval)
{
vivante_ctx_data_t *viv = (vivante_ctx_data_t*)data;
@ -288,7 +282,7 @@ const gfx_ctx_driver_t gfx_ctx_vivante_fbdev = {
gfx_ctx_vivante_set_resize,
gfx_ctx_vivante_has_focus,
gfx_ctx_vivante_suppress_screensaver,
gfx_ctx_vivante_has_windowed,
NULL, /* has_windowed */
gfx_ctx_vivante_swap_buffers,
gfx_ctx_vivante_input_driver,
gfx_ctx_vivante_get_proc_address,

View File

@ -334,7 +334,7 @@ bool video_context_driver_translate_aspect(gfx_ctx_aspect_t *aspect);
bool video_context_driver_input_driver(gfx_ctx_input_t *inp);
#define video_context_driver_has_windowed() ((video_context_data && current_video_context->has_windowed(video_context_data)) ? true : false)
#define video_context_driver_has_windowed() ((video_context_data && current_video_context->has_windowed && current_video_context->has_windowed(video_context_data)) ? true : false)
void video_context_driver_free(void);

View File

@ -249,7 +249,7 @@ extern struct aspect_ratio_elem aspectratio_lut[ASPECT_RATIO_END];
#if defined(RARCH_CONSOLE) || defined(RARCH_MOBILE)
#define video_driver_has_windowed() (false)
#else
#define video_driver_has_windowed() (current_video->has_windowed(video_driver_data))
#define video_driver_has_windowed() (current_video->has_windowed && current_video->has_windowed(video_driver_data))
#endif
#define video_driver_cached_frame_has_valid_framebuffer() (frame_cache_data ? (frame_cache_data == RETRO_HW_FRAME_BUFFER_VALID) : false)