From 2dcf79bb4e2bc513397b2579cd8c056780216034 Mon Sep 17 00:00:00 2001 From: twinaphex <libretro@gmail.com> Date: Sun, 20 Nov 2016 15:14:00 +0100 Subject: [PATCH] Cleanups --- gfx/video_context_driver.c | 66 +++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index b7b7af77d7..c6bfa11dc5 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -268,40 +268,40 @@ const gfx_ctx_driver_t *video_context_driver_init_first(void *data, bool video_context_driver_check_window(gfx_ctx_size_t *size_data) { - uint64_t *frame_count = NULL; - frame_count = video_driver_get_frame_count_ptr(); + if ( video_context_data + && size_data + && current_video_context + && current_video_context->check_window) + { + current_video_context->check_window(video_context_data, + size_data->quit, + size_data->resize, + size_data->width, + size_data->height, ((unsigned int)*video_driver_get_frame_count_ptr())); + return true; + } - if (!video_context_data || !size_data) - return false; - if (!current_video_context || !current_video_context->check_window) - return false; - - current_video_context->check_window(video_context_data, - size_data->quit, - size_data->resize, - size_data->width, - size_data->height, (unsigned int)*frame_count); - return true; + return false; } bool video_context_driver_init_image_buffer(const video_info_t *data) { - if (!current_video_context || !current_video_context->image_buffer_init) - return false; - if (!current_video_context->image_buffer_init(video_context_data, data)) - return false; - return true; + if ( current_video_context + && current_video_context->image_buffer_init + && current_video_context->image_buffer_init(video_context_data, data)) + return true; + return false; } bool video_context_driver_write_to_image_buffer(gfx_ctx_image_t *img) { - if (!current_video_context || !current_video_context->image_buffer_write) - return false; - if (!current_video_context->image_buffer_write(video_context_data, + if ( current_video_context + && current_video_context->image_buffer_write + && current_video_context->image_buffer_write(video_context_data, img->frame, img->width, img->height, img->pitch, img->rgb32, img->index, img->handle)) - return false; - return true; + return true; + return false; } bool video_context_driver_get_video_output_prev(void) @@ -399,13 +399,13 @@ bool video_context_driver_get_proc_address(gfx_ctx_proc_address_t *proc) bool video_context_driver_get_metrics(gfx_ctx_metrics_t *metrics) { - if (!current_video_context || !current_video_context->get_metrics) - return false; - if (!current_video_context->get_metrics(video_context_data, + if ( current_video_context + && current_video_context->get_metrics + && current_video_context->get_metrics(video_context_data, metrics->type, metrics->value)) - return false; - return true; + return true; + return false; } bool video_context_driver_input_driver(gfx_ctx_input_t *inp) @@ -419,12 +419,12 @@ bool video_context_driver_input_driver(gfx_ctx_input_t *inp) bool video_context_driver_suppress_screensaver(bool *bool_data) { - if (!video_context_data || !current_video_context) - return false; - if (!current_video_context->suppress_screensaver( + if ( video_context_data + && current_video_context + && current_video_context->suppress_screensaver( video_context_data, *bool_data)) - return false; - return true; + return true; + return false; } bool video_context_driver_get_ident(gfx_ctx_ident_t *ident)