Fixed an options overhaul regression (#2530)

This crash (discovered by Wizz) had the following symptoms:
1.  Start MAME
2.  Choose "Configure Machine"
3.  Choose "Video Options"
CRASH

This was the result of the options editor not having a fully formed list of options where it was expecting one.  The fix is to change the declaration of emu_options to one that have full OSD options (it is possible that SDLMAME needs something slightly different)

I created a osd_setup_osd_specific_emu_options(emu_options &) function that given an emu_options, will slap on system specific options.  I see this as only marginally less gross, and I have zero opinion on whether this should be changed to return an emu_options (rather than have a reference parameter), be a static method on emu_options, or what have you.
This commit is contained in:
npwoods 2017-10-06 13:54:10 -04:00 committed by ajrhacker
parent 6e30c05c88
commit 3f144b2861
7 changed files with 25 additions and 3 deletions

View File

@ -523,4 +523,7 @@ private:
std::string m_software_name;
};
// takes an existing emu_options and adds system specific options
void osd_setup_osd_specific_emu_options(emu_options &opts);
#endif // MAME_EMU_EMUOPTS_H

View File

@ -672,6 +672,7 @@ menu_machine_configure::menu_machine_configure(mame_ui_manager &mui, render_cont
{
// parse the INI file
std::ostringstream error;
osd_setup_osd_specific_emu_options(m_opts);
mame_options::parse_standard_inis(m_opts, error, m_drv);
setup_bios();
}

View File

@ -19,7 +19,6 @@
#include <utility>
#include <vector>
namespace ui {
class menu_keyboard_mode : public menu
{

View File

@ -169,7 +169,6 @@ public:
const char *pa_device() const { return value(OSDOPTION_PA_DEVICE); }
const float pa_latency() const { return float_value(OSDOPTION_PA_LATENCY); }
private:
static const options_entry s_option_entries[];
};

View File

@ -392,6 +392,16 @@ void sdl_osd_interface::output_oslog(const char *buffer)
}
//============================================================
// osd_setup_osd_specific_emu_options
//============================================================
void osd_setup_osd_specific_emu_options(emu_options &opts)
{
opts.add_entries(osd_options::s_option_entries);
}
//============================================================
// init
//============================================================

View File

@ -619,6 +619,17 @@ void windows_osd_interface::osd_exit()
}
//============================================================
// osd_setup_osd_specific_emu_options
//============================================================
void osd_setup_osd_specific_emu_options(emu_options &opts)
{
opts.add_entries(osd_options::s_option_entries);
opts.add_entries(windows_options::s_option_entries);
}
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
//============================================================

View File

@ -210,7 +210,6 @@ public:
bool global_inputs() const { return bool_value(WINOPTION_GLOBAL_INPUTS); }
bool dual_lightgun() const { return bool_value(WINOPTION_DUAL_LIGHTGUN); }
private:
static const options_entry s_option_entries[];
};