mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-26 21:36:26 +00:00
(Menu common) Add more runtime checks for checking if video is initialized
This commit is contained in:
parent
b12274f704
commit
cf71da660e
@ -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;
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user