summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mame/ui/ui.cpp')
-rw-r--r--src/frontend/mame/ui/ui.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index f13d8ea846b..f5e04284cd7 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -210,7 +210,7 @@ void mame_ui_manager::init()
draw_text_box(container, messagebox_text, ui::text_layout::LEFT, 0.5f, 0.5f, colors().background_color());
return 0;
});
- m_non_char_keys_down = std::make_unique<uint8_t[]>((ARRAY_LENGTH(non_char_keys) + 7) / 8);
+ m_non_char_keys_down = std::make_unique<uint8_t[]>((std::size(non_char_keys) + 7) / 8);
m_mouse_show = machine().system().flags & machine_flags::CLICKABLE_ARTWORK ? true : false;
// request notification callbacks
@@ -981,11 +981,6 @@ bool mame_ui_manager::is_menu_active(void)
void mame_ui_manager::process_natural_keyboard()
{
ui_event event;
- int i, pressed;
- input_item_id itemid;
- input_code code;
- uint8_t *key_down_ptr;
- uint8_t key_down_mask;
// loop while we have interesting events
while (machine().ui_input().pop_event(&event))
@@ -996,18 +991,18 @@ void mame_ui_manager::process_natural_keyboard()
}
// process natural keyboard keys that don't get UI_EVENT_CHARs
- for (i = 0; i < ARRAY_LENGTH(non_char_keys); i++)
+ for (int i = 0; i < std::size(non_char_keys); i++)
{
// identify this keycode
- itemid = non_char_keys[i];
- code = machine().input().code_from_itemid(itemid);
+ input_item_id itemid = non_char_keys[i];
+ input_code code = machine().input().code_from_itemid(itemid);
// ...and determine if it is pressed
- pressed = machine().input().code_pressed(code);
+ bool pressed = machine().input().code_pressed(code);
// figure out whey we are in the key_down map
- key_down_ptr = &m_non_char_keys_down[i / 8];
- key_down_mask = 1 << (i % 8);
+ uint8_t *key_down_ptr = &m_non_char_keys_down[i / 8];
+ uint8_t key_down_mask = 1 << (i % 8);
if (pressed && !(*key_down_ptr & key_down_mask))
{