(Menu common) Add more runtime checks for checking if video is initialized

This commit is contained in:
twinaphex 2014-02-23 05:02:48 +01:00
parent b12274f704
commit cf71da660e
2 changed files with 10 additions and 6 deletions

View File

@ -731,7 +731,9 @@ static int menu_viewport_iterate(void *data, unsigned action)
if (!g_settings.video.scale_integer)
{
rarch_viewport_t vp;
driver.video->viewport_info(driver.video_data, &vp);
if (driver.video && driver.video->viewport_info)
driver.video->viewport_info(driver.video_data, &vp);
if (menu_type == RGUI_SETTINGS_CUSTOM_VIEWPORT)
{
@ -894,7 +896,9 @@ static int menu_settings_iterate(void *data, unsigned action)
// Start with something sane.
rarch_viewport_t *custom = &g_extern.console.screen.viewports.custom_vp;
driver.video->viewport_info(driver.video_data, custom);
if (driver.video && driver.video->viewport_info)
driver.video->viewport_info(driver.video_data, custom);
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
(float)custom->width / custom->height;

View File

@ -1217,7 +1217,7 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
}
if (driver.video->restart)
if (driver.video && driver.video->restart)
driver.video->restart();
if (menu_ctx && menu_ctx->free_assets)
menu_ctx->free_assets(rgui);
@ -1238,7 +1238,7 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
else
g_extern.lifecycle_state |= (1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
if (driver.video->restart)
if (driver.video && driver.video->restart)
driver.video->restart();
if (menu_ctx && menu_ctx->free_assets)
menu_ctx->free_assets(rgui);
@ -1251,7 +1251,7 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
{
g_extern.lifecycle_state &= ~(1ULL << MODE_VIDEO_PAL_TEMPORAL_ENABLE);
if (driver.video->restart)
if (driver.video && driver.video->restart)
driver.video->restart();
if (menu_ctx && menu_ctx->free_assets)
menu_ctx->free_assets(rgui);
@ -1518,7 +1518,7 @@ int menu_set_settings(void *data, unsigned setting, unsigned action)
break;
case RGUI_SETTINGS_SHADER_APPLY:
{
if (!driver.video->set_shader || action != RGUI_ACTION_OK)
if (!driver.video || !driver.video->set_shader || action != RGUI_ACTION_OK)
return 0;
RARCH_LOG("Applying shader ...\n");