diff options
| author | 2023-01-29 03:02:02 +1100 | |
|---|---|---|
| committer | 2023-01-29 03:16:14 +1100 | |
| commit | 68472d3d72ea4bbc545c0669348172b4e96c7b41 (patch) | |
| tree | e34fca0f55c977624148d1c806ecc6c44a5edd11 /src/osd/modules/lib/osdobj_common.cpp | |
| parent | 01fcb2e0decf670a4cdee3d37b6f7ebde9b8f02b (diff) | |
Various input and OSD refactoring:
osd: Supply OSD object to modules on initialisation. Encapsulated some
event handling in the OSD objects rather than leaving it in free
functions. Put various stuff in namespaces.
osd/modules/input: Enabled dinput, xinput and winhybrid modules for
Windows SDL builds, and enabled background input for dinput and xinput
(and by extension winhybrid) modules. Also fixed some COM and X11
resource leaks.
osd/modules/input/input_sdl.cpp: Flipped SDL mouse button order to match
Windows, and exposed vertical and horizontal scroll as Z and rZ axes.
Moved SDL UI event handling out of input devices into OSD object.
osd/modules/input_rawinput.cpp: Changed lightgun Z axis token so it's
correctly identified as a relative axis (it maps to the scroll wheel
equivalent).
osd: Added an option to choose the network provider module. Mostly
useful if you build with both TUN/TAP and pcap support included, or if
you want to disable emulated networking completely.
emu/input.cpp: Use a better strategy for assembling input code names
that uses fewer temporary strings and doesn't require use of the
non-Unicode-aware space trimming function (fixes MT08552).
osd/modules/input_dinput.cpp: Improved polling logic.
osd: Made various parts of the input code less dependent on concrete emu
objects, and reduced inappropriately passing around the machine object.
Made input modules less dependent on OSD implementation. Encapsulated
some stuff and got rid of some vestigial newui and SDL1 support code.
Cleaned up some interfaces. Moved OSD options classes to their own
files.
Prepare to remove main.h from emu.h - it's mostly used to get the
application name, which the vast majority of emulated devices don't need
to do.
Diffstat (limited to 'src/osd/modules/lib/osdobj_common.cpp')
| -rw-r--r-- | src/osd/modules/lib/osdobj_common.cpp | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp index 3cde2b3d2aa..de6c0a4f2fd 100644 --- a/src/osd/modules/lib/osdobj_common.cpp +++ b/src/osd/modules/lib/osdobj_common.cpp @@ -169,6 +169,9 @@ const options_entry osd_options::s_option_entries[] = { nullptr, nullptr, core_options::option_type::HEADER, "OSD MIDI OPTIONS" }, { OSDOPTION_MIDI_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "MIDI I/O method: " }, + { nullptr, nullptr, core_options::option_type::HEADER, "OSD EMULATED NETWORKING OPTIONS" }, + { OSDOPTION_NETWORK_PROVIDER, OSDOPTVAL_AUTO, core_options::option_type::STRING, "Emulated networking provider: " }, + { nullptr, nullptr, core_options::option_type::HEADER, "BGFX POST-PROCESSING OPTIONS" }, { OSDOPTION_BGFX_PATH, "bgfx", core_options::option_type::PATH, "path to BGFX-related files" }, { OSDOPTION_BGFX_BACKEND, "auto", core_options::option_type::STRING, "BGFX backend to use (d3d9, d3d11, d3d12, metal, opengl, gles, vulkan)" }, @@ -312,6 +315,7 @@ void osd_common_t::register_options() update_option(OSD_JOYSTICKINPUT_PROVIDER, m_mod_man.get_module_names(OSD_JOYSTICKINPUT_PROVIDER)); update_option(OSD_SOUND_PROVIDER, m_mod_man.get_module_names(OSD_SOUND_PROVIDER)); update_option(OSD_MIDI_PROVIDER, m_mod_man.get_module_names(OSD_MIDI_PROVIDER)); + update_option(OSD_NETDEV_PROVIDER, m_mod_man.get_module_names(OSD_NETDEV_PROVIDER)); update_option(OSD_DEBUG_PROVIDER, m_mod_man.get_module_names(OSD_DEBUG_PROVIDER)); update_option(OSD_OUTPUT_PROVIDER, m_mod_man.get_module_names(OSD_OUTPUT_PROVIDER)); @@ -575,7 +579,7 @@ bool osd_common_t::execute_command(const char *command) if (om->probe()) { - om->init(options()); + om->init(*this, options()); osd_list_network_adapters(); om->exit(); } @@ -589,7 +593,7 @@ bool osd_common_t::execute_command(const char *command) if (om->probe()) { - om->init(options()); + om->init(*this, options()); pm->list_midi_devices(); om->exit(); } @@ -610,7 +614,7 @@ void osd_common_t::init_subsystems() // monitors have to be initialized before video init m_monitor_module = select_module_options<monitor_module *>(options(), OSD_MONITOR_PROVIDER); assert(m_monitor_module != nullptr); - m_monitor_module->init(options()); + m_monitor_module->init(*this, options()); if (!video_init()) { @@ -641,12 +645,9 @@ void osd_common_t::init_subsystems() m_output->set_machine(&machine()); machine().output().set_global_notifier(output_notifier_callback, this); - m_mod_man.init(options()); + m_mod_man.init(*this, options()); input_init(); - // we need pause callbacks - machine().add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(&osd_common_t::input_pause, this)); - machine().add_notifier(MACHINE_NOTIFY_RESUME, machine_notify_delegate(&osd_common_t::input_resume, this)); } bool osd_common_t::video_init() @@ -677,22 +678,6 @@ bool osd_common_t::input_init() return true; } -void osd_common_t::input_pause() -{ - m_keyboard_input->pause(); - m_mouse_input->pause(); - m_lightgun_input->pause(); - m_joystick_input->pause(); -} - -void osd_common_t::input_resume() -{ - m_keyboard_input->resume(); - m_mouse_input->resume(); - m_lightgun_input->resume(); - m_joystick_input->resume(); -} - void osd_common_t::exit_subsystems() { video_exit(); |
