init_video - cleanups

This commit is contained in:
twinaphex 2015-11-20 18:55:01 +01:00
parent ddde58caf4
commit 0184a73de8
2 changed files with 12 additions and 6 deletions

View File

@ -418,7 +418,7 @@ void uninit_video_input(void)
video_monitor_compute_fps_statistics(); video_monitor_compute_fps_statistics();
} }
void init_video(void) bool init_video(void)
{ {
unsigned max_dim, scale, width, height; unsigned max_dim, scale, width, height;
video_viewport_t *custom_vp = NULL; video_viewport_t *custom_vp = NULL;
@ -441,7 +441,7 @@ void init_video(void)
if (!geom) if (!geom)
{ {
RARCH_ERR("AV geometry not initialized, cannot initialize video driver.\n"); RARCH_ERR("AV geometry not initialized, cannot initialize video driver.\n");
retro_fail(1, "init_video()"); goto error;
} }
max_dim = max(geom->max_width, geom->max_height); max_dim = max(geom->max_width, geom->max_height);
@ -501,7 +501,7 @@ void init_video(void)
if (!init_video_pixel_converter(RARCH_SCALE_BASE * scale)) if (!init_video_pixel_converter(RARCH_SCALE_BASE * scale))
{ {
RARCH_ERR("Failed to initialize pixel converter.\n"); RARCH_ERR("Failed to initialize pixel converter.\n");
retro_fail(1, "init_video()"); goto error;
} }
video.width = width; video.width = width;
@ -534,7 +534,7 @@ void init_video(void)
driver->video, &video)) driver->video, &video))
{ {
RARCH_ERR("Cannot open threaded video driver ... Exiting ...\n"); RARCH_ERR("Cannot open threaded video driver ... Exiting ...\n");
retro_fail(1, "init_video()"); goto error;
} }
} }
else else
@ -545,7 +545,7 @@ void init_video(void)
if (!driver->video_data) if (!driver->video_data)
{ {
RARCH_ERR("Cannot open video driver ... Exiting ...\n"); RARCH_ERR("Cannot open video driver ... Exiting ...\n");
retro_fail(1, "init_video()"); goto error;
} }
driver->video_poke = NULL; driver->video_poke = NULL;
@ -577,6 +577,12 @@ void init_video(void)
#if defined(PSP) #if defined(PSP)
video_driver_set_texture_frame(&dummy_pixels, false, 1, 1, 1.0f); video_driver_set_texture_frame(&dummy_pixels, false, 1, 1, 1.0f);
#endif #endif
return true;
error:
retro_fail(1, "init_video()");
return false;
} }
bool video_driver_suppress_screensaver(bool enable) bool video_driver_suppress_screensaver(bool enable)

View File

@ -293,7 +293,7 @@ bool video_driver_set_shader(enum rarch_shader_type type,
void uninit_video_input(void); void uninit_video_input(void);
void init_video(void); bool init_video(void);
bool video_driver_set_rotation(unsigned rotation); bool video_driver_set_rotation(unsigned rotation);