summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/input/input_sdlcommon.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-03-31 09:43:53 -0400
committer AJR <ajrhacker@users.noreply.github.com>2016-03-31 09:43:53 -0400
commita7e393b36b57cead61978f332135a509b2ddc82a (patch)
tree4d0d9a4b83d394e8706bd0475f379b5f468c43b1 /src/osd/modules/input/input_sdlcommon.cpp
parent677cfa86fd8675dd15cc6cde0e26fd216823c61b (diff)
Iterate over core classes C++11 style
C++11 range-based for loops can now iterate over simple_list, tagged_list, core_options, device_t::subdevice_list, device_t::interface_list, render_primitive_list and all subclasses of the above, and much code has been refactored to use them. Most core classes that have these lists as members now have methods that return the lists themselves, replacing most of the methods that returned the object at an owned list's head. (A few have been retained due to their use in drivers or OSD.) device_t now manages subdevice and interface lists through subclasses, but has given up the work of adding and removing subdevices to machine_config. memory_manager has its tagged lists exposed, though the old rooted tag lookup methods have been removed (they were privatized already).
Diffstat (limited to 'src/osd/modules/input/input_sdlcommon.cpp')
-rw-r--r--src/osd/modules/input/input_sdlcommon.cpp49
1 files changed, 24 insertions, 25 deletions
diff --git a/src/osd/modules/input/input_sdlcommon.cpp b/src/osd/modules/input/input_sdlcommon.cpp
index 03e924b5a71..0f6116fa048 100644
--- a/src/osd/modules/input/input_sdlcommon.cpp
+++ b/src/osd/modules/input/input_sdlcommon.cpp
@@ -139,14 +139,13 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
{
input_item_id mameid_code;
input_code ui_code;
- input_type_entry *entry;
const char* uimode;
char fullmode[64];
// loop over the defaults
- for (entry = typelist.first(); entry != NULL; entry = entry->next())
+ for (input_type_entry &entry : typelist)
{
- switch (entry->type())
+ switch (entry.type())
{
// configurable UI mode switch
case IPT_UI_TOGGLE_UI:
@@ -165,23 +164,23 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
mameid_code = keyboard_trans_table::instance().lookup_mame_code(fullmode);
}
ui_code = input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, input_item_id(mameid_code));
- entry->defseq(SEQ_TYPE_STANDARD).set(ui_code);
+ entry.defseq(SEQ_TYPE_STANDARD).set(ui_code);
break;
// alt-enter for fullscreen
case IPT_OSD_1:
- entry->configure_osd("TOGGLE_FULLSCREEN", "Toggle Fullscreen");
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ENTER, KEYCODE_LALT);
+ entry.configure_osd("TOGGLE_FULLSCREEN", "Toggle Fullscreen");
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ENTER, KEYCODE_LALT);
break;
// disable UI_SELECT when LALT is down, this stops selecting
// things in the menu when toggling fullscreen with LALT+ENTER
/* case IPT_UI_SELECT:
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ENTER, input_seq::not_code, KEYCODE_LALT);
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_ENTER, input_seq::not_code, KEYCODE_LALT);
break;*/
// page down for fastforward (must be OSD_3 as per src/emu/ui.c)
case IPT_UI_FAST_FORWARD:
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_PGDN);
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_PGDN);
break;
// OSD hotkeys use LCTRL and start at F3, they start at
@@ -191,63 +190,63 @@ void sdl_osd_interface::customize_input_type_list(simple_list<input_type_entry>
// LCTRL-F3 to toggle fullstretch
case IPT_OSD_2:
- entry->configure_osd("TOGGLE_FULLSTRETCH", "Toggle Uneven stretch");
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F3, KEYCODE_LCONTROL);
+ entry.configure_osd("TOGGLE_FULLSTRETCH", "Toggle Uneven stretch");
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F3, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the reset key
case IPT_UI_SOFT_RESET:
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F3, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F3, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
break;
// LCTRL-F4 to toggle keep aspect
case IPT_OSD_4:
- entry->configure_osd("TOGGLE_KEEP_ASPECT", "Toggle Keepaspect");
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F4, KEYCODE_LCONTROL);
+ entry.configure_osd("TOGGLE_KEEP_ASPECT", "Toggle Keepaspect");
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F4, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the show gfx key
case IPT_UI_SHOW_GFX:
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F4, input_seq::not_code, KEYCODE_LCONTROL);
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F4, input_seq::not_code, KEYCODE_LCONTROL);
break;
// LCTRL-F5 to toggle OpenGL filtering
case IPT_OSD_5:
- entry->configure_osd("TOGGLE_FILTER", "Toggle Filter");
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, KEYCODE_LCONTROL);
+ entry.configure_osd("TOGGLE_FILTER", "Toggle Filter");
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the toggle debug key
case IPT_UI_TOGGLE_DEBUG:
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, input_seq::not_code, KEYCODE_LCONTROL);
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F5, input_seq::not_code, KEYCODE_LCONTROL);
break;
// LCTRL-F6 to decrease OpenGL prescaling
case IPT_OSD_6:
- entry->configure_osd("DECREASE_PRESCALE", "Decrease Prescaling");
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F6, KEYCODE_LCONTROL);
+ entry.configure_osd("DECREASE_PRESCALE", "Decrease Prescaling");
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F6, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the toggle cheat key
case IPT_UI_TOGGLE_CHEAT:
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F6, input_seq::not_code, KEYCODE_LCONTROL);
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F6, input_seq::not_code, KEYCODE_LCONTROL);
break;
// LCTRL-F7 to increase OpenGL prescaling
case IPT_OSD_7:
- entry->configure_osd("INCREASE_PRESCALE", "Increase Prescaling");
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F7, KEYCODE_LCONTROL);
+ entry.configure_osd("INCREASE_PRESCALE", "Increase Prescaling");
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F7, KEYCODE_LCONTROL);
break;
// add a Not lcrtl condition to the load state key
case IPT_UI_LOAD_STATE:
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F7, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F7, input_seq::not_code, KEYCODE_LCONTROL, input_seq::not_code, KEYCODE_LSHIFT);
break;
// add a Not lcrtl condition to the throttle key
case IPT_UI_THROTTLE:
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F10, input_seq::not_code, KEYCODE_LCONTROL);
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_F10, input_seq::not_code, KEYCODE_LCONTROL);
break;
// disable the config menu if the ALT key is down
// (allows ALT-TAB to switch between apps)
case IPT_UI_CONFIGURE:
- entry->defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
+ entry.defseq(SEQ_TYPE_STANDARD).set(KEYCODE_TAB, input_seq::not_code, KEYCODE_LALT, input_seq::not_code, KEYCODE_RALT);
break;
// leave everything else alone