(menu display) pointer cleanups

This commit is contained in:
twinaphex 2019-04-10 01:46:25 +02:00
parent 145e09a629
commit 002ac5a344
5 changed files with 16 additions and 24 deletions

View File

@ -64,8 +64,7 @@ static void menu_display_ctr_draw(menu_display_ctx_draw_t *draw,
{
struct ctr_texture *texture = NULL;
const float *color = NULL;
ctr_video_t *ctr = video_info ?
(ctr_video_t*)video_info->userdata : NULL;
ctr_video_t *ctr = (ctr_video_t*)video_info->userdata;
if (!ctr || !draw)
return;

View File

@ -25,8 +25,6 @@
#include "../../gfx/video_driver.h"
#import "../../gfx/common/metal_common.h"
#define GET_DRIVER(video_info) (video_info ? (__bridge MetalDriver *)video_info->userdata : NULL);
static const float *menu_display_metal_get_default_vertices(void)
{
return [MenuDisplay defaultVertices];
@ -39,7 +37,7 @@ static const float *menu_display_metal_get_default_tex_coords(void)
static void *menu_display_metal_get_default_mvp(video_frame_info_t *video_info)
{
MetalDriver *md = GET_DRIVER(video_info);
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
if (!md)
return NULL;
@ -48,7 +46,7 @@ static void *menu_display_metal_get_default_mvp(video_frame_info_t *video_info)
static void menu_display_metal_blend_begin(video_frame_info_t *video_info)
{
MetalDriver *md = GET_DRIVER(video_info);
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
if (!md)
return;
@ -57,7 +55,7 @@ static void menu_display_metal_blend_begin(video_frame_info_t *video_info)
static void menu_display_metal_blend_end(video_frame_info_t *video_info)
{
MetalDriver *md = GET_DRIVER(video_info);
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
if (!md)
return;
@ -67,7 +65,7 @@ static void menu_display_metal_blend_end(video_frame_info_t *video_info)
static void menu_display_metal_draw(menu_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
{
MetalDriver *md = GET_DRIVER(video_info);
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
if (!md || !draw)
return;
@ -76,7 +74,7 @@ static void menu_display_metal_draw(menu_display_ctx_draw_t *draw,
static void menu_display_metal_draw_pipeline(menu_display_ctx_draw_t *draw, video_frame_info_t *video_info)
{
MetalDriver *md = GET_DRIVER(video_info);
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
if (!md || !draw)
return;
@ -90,7 +88,7 @@ static void menu_display_metal_viewport(menu_display_ctx_draw_t *draw,
static void menu_display_metal_scissor_begin(video_frame_info_t *video_info, int x, int y, unsigned width, unsigned height)
{
MetalDriver *md = GET_DRIVER(video_info);
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
if (!md)
return;
@ -100,7 +98,7 @@ static void menu_display_metal_scissor_begin(video_frame_info_t *video_info, int
static void menu_display_metal_scissor_end(video_frame_info_t *video_info)
{
MetalDriver *md = GET_DRIVER(video_info);
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
if (!md)
return;
@ -109,13 +107,13 @@ static void menu_display_metal_scissor_end(video_frame_info_t *video_info)
static void menu_display_metal_restore_clear_color(void)
{
// nothing to do
/* nothing to do */
}
static void menu_display_metal_clear_color(menu_display_ctx_clearcolor_t *clearcolor,
video_frame_info_t *video_info)
{
MetalDriver *md = GET_DRIVER(video_info);
MetalDriver *md = (__bridge MetalDriver *)video_info->userdata;
if (!md)
return;

View File

@ -56,8 +56,7 @@ static const float *menu_display_vita2d_get_default_tex_coords(void)
static void *menu_display_vita2d_get_default_mvp(
video_frame_info_t *video_info)
{
vita_video_t *vita2d = video_info ?
(vita_video_t*)video_info->userdata : NULL;
vita_video_t *vita2d = (vita_video_t*)video_info->userdata;
if (!vita2d)
return NULL;
@ -113,8 +112,7 @@ static void menu_display_vita2d_draw(menu_display_ctx_draw_t *draw,
const float *vertex = NULL;
const float *tex_coord = NULL;
const float *color = NULL;
vita_video_t *vita2d = video_info ?
(vita_video_t*)video_info->userdata : NULL;
vita_video_t *vita2d = (vita_video_t*)video_info->userdata;
if (!vita2d || !draw)
return;

View File

@ -50,7 +50,7 @@ static const float vk_colors[] = {
static void *menu_display_vk_get_default_mvp(video_frame_info_t *video_info)
{
vk_t *vk = video_info ? (vk_t*)video_info->userdata : NULL;
vk_t *vk = (vk_t*)video_info->userdata;
if (!vk)
return NULL;
return &vk->mvp_no_rot;
@ -102,8 +102,7 @@ static unsigned to_menu_pipeline(
static void menu_display_vk_viewport(menu_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
{
vk_t *vk = video_info ? (vk_t*)video_info->userdata
: NULL;
vk_t *vk = (vk_t*)video_info->userdata;
if (!vk || !draw)
return;

View File

@ -63,8 +63,7 @@ static void menu_display_wiiu_viewport(menu_display_ctx_draw_t *draw,
static void menu_display_wiiu_draw(menu_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
{
wiiu_video_t *wiiu = video_info ?
(wiiu_video_t*)video_info->userdata : NULL;
wiiu_video_t *wiiu = (wiiu_video_t*)video_info->userdata;
if (!wiiu || !draw)
return;
@ -234,8 +233,7 @@ static void menu_display_wiiu_draw_pipeline(menu_display_ctx_draw_t *draw,
video_frame_info_t *video_info)
{
video_coord_array_t *ca = NULL;
wiiu_video_t *wiiu = video_info ?
(wiiu_video_t*)video_info->userdata : NULL;
wiiu_video_t *wiiu = (wiiu_video_t*)video_info->userdata;
if (!wiiu || !draw)
return;