mirror of
https://github.com/holub/mame
synced 2025-06-23 12:58:37 +03:00
Merge pull request #1119 from GiuseppeGorgoglione/master
BGFX: fix crash when bgfx effect folder is not present or incomplete
This commit is contained in:
commit
1c363eeff0
@ -235,6 +235,12 @@ int renderer_bgfx::create()
|
|||||||
m_screen_effect[2] = m_effects->effect("screen_multiply");
|
m_screen_effect[2] = m_effects->effect("screen_multiply");
|
||||||
m_screen_effect[3] = m_effects->effect("screen_add");
|
m_screen_effect[3] = m_effects->effect("screen_add");
|
||||||
|
|
||||||
|
if ( m_gui_effect[0] == nullptr || m_gui_effect[1] == nullptr || m_gui_effect[2] == nullptr || m_gui_effect[3] == nullptr ||
|
||||||
|
m_screen_effect[0] == nullptr || m_screen_effect[1] == nullptr || m_screen_effect[2] == nullptr || m_screen_effect[3] == nullptr)
|
||||||
|
{
|
||||||
|
fatalerror("BGFX: Unable to load required shaders. Please check and reinstall the %s folder\n", m_options.bgfx_path());
|
||||||
|
}
|
||||||
|
|
||||||
m_chains = new chain_manager(win->machine(), m_options, *m_textures, *m_targets, *m_effects, win->m_index, *this);
|
m_chains = new chain_manager(win->machine(), m_options, *m_textures, *m_targets, *m_effects, win->m_index, *this);
|
||||||
m_sliders_dirty = true;
|
m_sliders_dirty = true;
|
||||||
|
|
||||||
@ -283,6 +289,20 @@ void renderer_bgfx::record()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool renderer_bgfx::init(running_machine &machine)
|
||||||
|
{
|
||||||
|
const char *bgfx_path = downcast<osd_options &>(machine.options()).bgfx_path();
|
||||||
|
|
||||||
|
osd::directory::ptr directory = osd::directory::open(bgfx_path);
|
||||||
|
if (directory == nullptr)
|
||||||
|
{
|
||||||
|
osd_printf_verbose("Unable to find the %s folder. Please reinstall it to use the BGFX renderer\n", bgfx_path);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void renderer_bgfx::exit()
|
void renderer_bgfx::exit()
|
||||||
{
|
{
|
||||||
imguiDestroy();
|
imguiDestroy();
|
||||||
|
@ -36,7 +36,7 @@ public:
|
|||||||
renderer_bgfx(std::shared_ptr<osd_window> w);
|
renderer_bgfx(std::shared_ptr<osd_window> w);
|
||||||
virtual ~renderer_bgfx();
|
virtual ~renderer_bgfx();
|
||||||
|
|
||||||
static void init(running_machine &machine) { }
|
static bool init(running_machine &machine);
|
||||||
static void exit();
|
static void exit();
|
||||||
|
|
||||||
virtual int create() override;
|
virtual int create() override;
|
||||||
|
@ -172,7 +172,7 @@ bool windows_osd_interface::window_init()
|
|||||||
error = renderer_gdi::init(machine());
|
error = renderer_gdi::init(machine());
|
||||||
break;
|
break;
|
||||||
case VIDEO_MODE_BGFX:
|
case VIDEO_MODE_BGFX:
|
||||||
renderer_bgfx::init(machine());
|
error = renderer_bgfx::init(machine());
|
||||||
break;
|
break;
|
||||||
#if (USE_OPENGL)
|
#if (USE_OPENGL)
|
||||||
case VIDEO_MODE_OPENGL:
|
case VIDEO_MODE_OPENGL:
|
||||||
|
Loading…
Reference in New Issue
Block a user