mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-21 00:05:30 +00:00
Cleanups
This commit is contained in:
parent
ac6362cae4
commit
5c0f4f4ac8
@ -280,24 +280,32 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
|
||||
}
|
||||
break;
|
||||
case GFX_CTL_FIND_PREV_DRIVER:
|
||||
return gfx_ctl_find_prev_driver();
|
||||
if (!gfx_ctl_find_prev_driver())
|
||||
return false;
|
||||
break;
|
||||
case GFX_CTL_FIND_NEXT_DRIVER:
|
||||
return gfx_ctl_find_next_driver();
|
||||
if (!gfx_ctl_find_next_driver())
|
||||
return false;
|
||||
break;
|
||||
case GFX_CTL_IMAGE_BUFFER_INIT:
|
||||
if (!current_video_context || !current_video_context->image_buffer_init)
|
||||
return false;
|
||||
return current_video_context->image_buffer_init(video_context_data,
|
||||
(const video_info_t*)data);
|
||||
if (!current_video_context->image_buffer_init(video_context_data,
|
||||
(const video_info_t*)data))
|
||||
return false;
|
||||
break;
|
||||
case GFX_CTL_IMAGE_BUFFER_WRITE:
|
||||
{
|
||||
gfx_ctx_image_t *img = (gfx_ctx_image_t*)data;
|
||||
|
||||
if (!current_video_context || !current_video_context->image_buffer_write)
|
||||
return false;
|
||||
return current_video_context->image_buffer_write(video_context_data,
|
||||
if (!current_video_context->image_buffer_write(video_context_data,
|
||||
img->frame, img->width, img->height, img->pitch,
|
||||
img->rgb32, img->index, img->handle);
|
||||
img->rgb32, img->index, img->handle))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case GFX_CTL_GET_VIDEO_OUTPUT_PREV:
|
||||
if (!current_video_context
|
||||
|| !current_video_context->get_video_output_prev)
|
||||
@ -339,11 +347,15 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
|
||||
case GFX_CTL_FOCUS:
|
||||
if (!video_context_data || !current_video_context->has_focus)
|
||||
return false;
|
||||
return current_video_context->has_focus(video_context_data);
|
||||
if (!current_video_context->has_focus(video_context_data))
|
||||
return false;
|
||||
break;
|
||||
case GFX_CTL_HAS_WINDOWED:
|
||||
if (!video_context_data)
|
||||
return false;
|
||||
return current_video_context->has_windowed(video_context_data);
|
||||
if (!current_video_context->has_windowed(video_context_data))
|
||||
return false;
|
||||
break;
|
||||
case GFX_CTL_FREE:
|
||||
if (current_video_context->destroy)
|
||||
current_video_context->destroy(video_context_data);
|
||||
@ -383,10 +395,12 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
|
||||
gfx_ctx_metrics_t *metrics = (gfx_ctx_metrics_t*)data;
|
||||
if (!current_video_context || !current_video_context->get_metrics)
|
||||
return false;
|
||||
return current_video_context->get_metrics(video_context_data,
|
||||
if (!current_video_context->get_metrics(video_context_data,
|
||||
metrics->type,
|
||||
metrics->value);
|
||||
metrics->value))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case GFX_CTL_INPUT_DRIVER:
|
||||
{
|
||||
gfx_ctx_input_t *inp = (gfx_ctx_input_t*)data;
|
||||
@ -401,9 +415,11 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
|
||||
bool *bool_data = (bool*)data;
|
||||
if (!video_context_data || !current_video_context)
|
||||
return false;
|
||||
return current_video_context->suppress_screensaver(
|
||||
video_context_data, *bool_data);
|
||||
if (!current_video_context->suppress_screensaver(
|
||||
video_context_data, *bool_data))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case GFX_CTL_IDENT_GET:
|
||||
{
|
||||
gfx_ctx_ident_t *ident = (gfx_ctx_ident_t*)data;
|
||||
@ -417,18 +433,22 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
|
||||
gfx_ctx_mode_t *mode_info = (gfx_ctx_mode_t*)data;
|
||||
if (!current_video_context || !current_video_context->set_video_mode)
|
||||
return false;
|
||||
return current_video_context->set_video_mode(
|
||||
if (!current_video_context->set_video_mode(
|
||||
video_context_data, mode_info->width,
|
||||
mode_info->height, mode_info->fullscreen);
|
||||
mode_info->height, mode_info->fullscreen))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case GFX_CTL_SET_RESIZE:
|
||||
{
|
||||
gfx_ctx_mode_t *mode_info = (gfx_ctx_mode_t*)data;
|
||||
if (!current_video_context)
|
||||
return false;
|
||||
return current_video_context->set_resize(
|
||||
video_context_data, mode_info->width, mode_info->height);
|
||||
if (!current_video_context->set_resize(
|
||||
video_context_data, mode_info->width, mode_info->height))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case GFX_CTL_GET_VIDEO_SIZE:
|
||||
{
|
||||
gfx_ctx_mode_t *mode_info = (gfx_ctx_mode_t*)data;
|
||||
|
@ -1548,8 +1548,10 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
|
||||
case RARCH_DISPLAY_CTL_READ_VIEWPORT:
|
||||
if (!current_video->read_viewport)
|
||||
return false;
|
||||
return current_video->read_viewport(video_driver_data,
|
||||
(uint8_t*)data);
|
||||
if (!current_video->read_viewport(video_driver_data,
|
||||
(uint8_t*)data))
|
||||
return false;
|
||||
break;
|
||||
case RARCH_DISPLAY_CTL_CACHED_FRAME_HAS_VALID_FB:
|
||||
if (!video_driver_state.frame_cache.data)
|
||||
return false;
|
||||
@ -1735,8 +1737,10 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data)
|
||||
!video_driver_poke ||
|
||||
!video_driver_poke->get_hw_render_interface)
|
||||
return false;
|
||||
return video_driver_poke->get_hw_render_interface(video_driver_data,
|
||||
(const struct retro_hw_render_interface**)data);
|
||||
if (!video_driver_poke->get_hw_render_interface(video_driver_data,
|
||||
(const struct retro_hw_render_interface**)data))
|
||||
return false;
|
||||
break;
|
||||
case RARCH_DISPLAY_CTL_VIEWPORT_INFO:
|
||||
if (!current_video || !current_video->viewport_info)
|
||||
return false;
|
||||
|
@ -151,24 +151,30 @@ bool video_shader_driver_ctl(enum video_shader_driver_ctl_state state, void *dat
|
||||
case SHADER_CTL_GET_FEEDBACK_PASS:
|
||||
if (!current_shader || !current_shader->get_feedback_pass)
|
||||
return false;
|
||||
return current_shader->get_feedback_pass(shader_data,
|
||||
(unsigned*)data);
|
||||
if (!current_shader->get_feedback_pass(shader_data,
|
||||
(unsigned*)data))
|
||||
return false;
|
||||
break;
|
||||
case SHADER_CTL_MIPMAP_INPUT:
|
||||
if (!current_shader)
|
||||
return false;
|
||||
{
|
||||
unsigned *index = (unsigned*)data;
|
||||
return current_shader->mipmap_input(shader_data, *index);
|
||||
if (!current_shader->mipmap_input(shader_data, *index))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SHADER_CTL_SET_COORDS:
|
||||
{
|
||||
video_shader_ctx_coords_t *coords = (video_shader_ctx_coords_t*)
|
||||
data;
|
||||
if (!current_shader || !current_shader->set_coords)
|
||||
return false;
|
||||
return current_shader->set_coords(coords->handle_data,
|
||||
shader_data, coords->data);
|
||||
if (!current_shader->set_coords(coords->handle_data,
|
||||
shader_data, coords->data))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SHADER_CTL_SCALE:
|
||||
{
|
||||
video_shader_ctx_scale_t *scaler = (video_shader_ctx_scale_t*)data;
|
||||
@ -202,17 +208,21 @@ bool video_shader_driver_ctl(enum video_shader_driver_ctl_state state, void *dat
|
||||
return false;
|
||||
if (!mvp || !mvp->matrix)
|
||||
return false;
|
||||
return current_shader->set_mvp(mvp->data, shader_data, mvp->matrix);
|
||||
if (!current_shader->set_mvp(mvp->data, shader_data, mvp->matrix))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SHADER_CTL_FILTER_TYPE:
|
||||
{
|
||||
video_shader_ctx_filter_t *filter =
|
||||
(video_shader_ctx_filter_t*)data;
|
||||
if (!current_shader || !current_shader->filter_type || !filter)
|
||||
return false;
|
||||
return current_shader->filter_type(shader_data,
|
||||
filter->index, filter->smooth);
|
||||
if (!current_shader->filter_type(shader_data,
|
||||
filter->index, filter->smooth))
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SHADER_CTL_USE:
|
||||
{
|
||||
video_shader_ctx_info_t *shader_info = (video_shader_ctx_info_t*)data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user