Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/frontend/mame/ui/audio_effect_compressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ u32 menu_audio_effect_compressor::flag_mode() const
{
u32 flag = 0;
if(!m_effect->isset_mode())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(m_effect->mode())
flag |= FLAG_LEFT_ARROW;
else
Expand All @@ -450,7 +450,7 @@ u32 menu_audio_effect_compressor::flag_lim(float value, float min, float max, bo
{
u32 flag = 0;
if(!isset)
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(value > min)
flag |= FLAG_LEFT_ARROW;
if(value < max)
Expand All @@ -462,7 +462,7 @@ u32 menu_audio_effect_compressor::flag_lim_special(float value, float min, bool
{
u32 flag = 0;
if(!isset)
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(value != min)
flag |= FLAG_LEFT_ARROW;
if(value >= min)
Expand Down
12 changes: 6 additions & 6 deletions src/frontend/mame/ui/audio_effect_eq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ u32 menu_audio_effect_eq::flag_mode() const
{
u32 flag = 0;
if(!m_effect->isset_mode())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(m_effect->mode() == 1)
flag |= FLAG_LEFT_ARROW;
if(m_effect->mode() == 0)
Expand All @@ -379,7 +379,7 @@ u32 menu_audio_effect_eq::flag_low_shelf() const
{
u32 flag = 0;
if(!m_effect->isset_low_shelf())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(m_effect->low_shelf())
flag |= FLAG_RIGHT_ARROW;
else
Expand All @@ -391,7 +391,7 @@ u32 menu_audio_effect_eq::flag_high_shelf() const
{
u32 flag = 0;
if(!m_effect->isset_high_shelf())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(m_effect->high_shelf())
flag |= FLAG_RIGHT_ARROW;
else
Expand All @@ -403,7 +403,7 @@ u32 menu_audio_effect_eq::flag_f(u32 band) const
{
u32 flag = 0;
if(!m_effect->isset_f(band))
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
u32 f = m_effect->f(band);
if(f > FREQ_LIMITS[band][0])
flag |= FLAG_LEFT_ARROW;
Expand All @@ -416,7 +416,7 @@ u32 menu_audio_effect_eq::flag_q(u32 band) const
{
u32 flag = 0;
if(!m_effect->isset_q(band))
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
u32 q = roundf(m_effect->q(band) * 100.0f);
if(q > 10)
flag |= FLAG_LEFT_ARROW;
Expand All @@ -429,7 +429,7 @@ u32 menu_audio_effect_eq::flag_db(u32 band) const
{
u32 flag = 0;
if(!m_effect->isset_db(band))
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
s32 db = roundf(m_effect->db(band) * 10.0f);
if(db > -120)
flag |= FLAG_LEFT_ARROW;
Expand Down
12 changes: 6 additions & 6 deletions src/frontend/mame/ui/audio_effect_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ u32 menu_audio_effect_filter::flag_highpass_active() const
{
u32 flag = 0;
if(!m_effect->isset_highpass_active())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(m_effect->highpass_active())
flag |= FLAG_LEFT_ARROW;
else
Expand All @@ -384,7 +384,7 @@ u32 menu_audio_effect_filter::flag_fh() const
{
u32 flag = 0;
if(!m_effect->isset_fh())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
u32 f = m_effect->fh();
if(f > FH_MIN)
flag |= FLAG_LEFT_ARROW;
Expand All @@ -397,7 +397,7 @@ u32 menu_audio_effect_filter::flag_qh() const
{
u32 flag = 0;
if(!m_effect->isset_qh())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
u32 q = roundf(m_effect->qh() * 100.0f);
if(q > 10)
flag |= FLAG_LEFT_ARROW;
Expand All @@ -410,7 +410,7 @@ u32 menu_audio_effect_filter::flag_lowpass_active() const
{
u32 flag = 0;
if(!m_effect->isset_lowpass_active())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(m_effect->lowpass_active())
flag |= FLAG_LEFT_ARROW;
else
Expand All @@ -422,7 +422,7 @@ u32 menu_audio_effect_filter::flag_fl() const
{
u32 flag = 0;
if(!m_effect->isset_fl())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
u32 f = m_effect->fl();
if(f > FL_MIN)
flag |= FLAG_LEFT_ARROW;
Expand All @@ -435,7 +435,7 @@ u32 menu_audio_effect_filter::flag_ql() const
{
u32 flag = 0;
if(!m_effect->isset_ql())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
u32 q = roundf(m_effect->ql() * 100.0f);
if(q > 10)
flag |= FLAG_LEFT_ARROW;
Expand Down
14 changes: 7 additions & 7 deletions src/frontend/mame/ui/audio_effect_reverb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ u32 menu_audio_effect_reverb::flag_mode() const
{
u32 flag = 0;
if(!m_effect->isset_mode())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(m_effect->mode())
flag |= FLAG_LEFT_ARROW;
else
Expand All @@ -549,7 +549,7 @@ u32 menu_audio_effect_reverb::flag_tap_setup() const
{
u32 flag = 0;
if(!m_effect->isset_early_tap_setup())
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(m_effect->early_tap_setup() != 0)
flag |= FLAG_LEFT_ARROW;
if(m_effect->early_tap_setup() != audio_effect_reverb::early_tap_setup_count() - 1)
Expand All @@ -571,7 +571,7 @@ u32 menu_audio_effect_reverb::flag_percent(double val, bool isset)
{
u32 flag = 0;
if(!isset)
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(val > 0.0)
flag |= FLAG_LEFT_ARROW;
if(val < 100.0)
Expand All @@ -583,7 +583,7 @@ u32 menu_audio_effect_reverb::flag_freq(double val, bool isset)
{
u32 flag = 0;
if(!isset)
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(val > 100.0)
flag |= FLAG_LEFT_ARROW;
if(val < 16000.0)
Expand All @@ -595,7 +595,7 @@ u32 menu_audio_effect_reverb::flag_ms(float val, bool isset)
{
u32 flag = 0;
if(!isset)
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(val > 0.0f)
flag |= FLAG_LEFT_ARROW;
if(val < 200.0f)
Expand All @@ -607,7 +607,7 @@ u32 menu_audio_effect_reverb::flag_decay(float val, bool isset)
{
u32 flag = 0;
if(!isset)
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(val > 0.1f)
flag |= FLAG_LEFT_ARROW;
if(val < 30.0f)
Expand All @@ -619,7 +619,7 @@ u32 menu_audio_effect_reverb::flag_spin(double val, bool isset)
{
u32 flag = 0;
if(!isset)
flag |= FLAG_INVERT;
flag |= FLAG_DE_EMPHASIZE;
if(val > 0.0)
flag |= FLAG_LEFT_ARROW;
if(val < 5.0)
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/mame/ui/audioeffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ u32 menu_audio_effects::flag_latency() const
if(latency < 0.05f)
flag |= FLAG_RIGHT_ARROW;
if(machine().sound().resampler_type() != sound_manager::RESAMPLER_HQ)
flag |= FLAG_INVERT | FLAG_DISABLE;
flag |= FLAG_DISABLE;
return flag;
}

Expand All @@ -224,7 +224,7 @@ u32 menu_audio_effects::flag_length() const
if(length < 500)
flag |= FLAG_RIGHT_ARROW;
if(machine().sound().resampler_type() != sound_manager::RESAMPLER_HQ)
flag |= FLAG_INVERT | FLAG_DISABLE;
flag |= FLAG_DISABLE;
return flag;
}

Expand All @@ -237,7 +237,7 @@ u32 menu_audio_effects::flag_phases() const
if(phases < 1000)
flag |= FLAG_RIGHT_ARROW;
if(machine().sound().resampler_type() != sound_manager::RESAMPLER_HQ)
flag |= FLAG_INVERT | FLAG_DISABLE;
flag |= FLAG_DISABLE;
return flag;
}

Expand Down
3 changes: 3 additions & 0 deletions src/frontend/mame/ui/confswitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ void menu_confswitch::populate()
if (field.has_next_setting())
flags |= FLAG_RIGHT_ARROW;

if (field.live().value == field.defvalue())
flags |= FLAG_DE_EMPHASIZE;

// add the menu item
item_append(field.name(), field.setting_name(), flags, &field);
}
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/mame/ui/inputmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,9 @@ void menu_input::populate_sorted()
}
else
{
// otherwise, generate the sequence name and invert it if different from the default
// otherwise, generate the sequence name and invert it if same as the default
subtext = machine().input().seq_name(item.seq);
flags |= (item.seq != *item.defseq) ? FLAG_INVERT : 0;
flags |= (item.seq == *item.defseq) ? FLAG_DE_EMPHASIZE : 0;
}

// add the item
Expand Down
13 changes: 10 additions & 3 deletions src/frontend/mame/ui/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,9 +838,13 @@ void menu::draw(uint32_t flags)
else
{
// otherwise, draw the item on the left and the subitem text on the right
bool const subitem_invert(pitem.flags() & FLAG_INVERT);
bool const item_disabled(pitem.flags() & FLAG_DISABLE); // item disabled: both item and subitem at 70% brightness
bool const subitem_de_emphasized((pitem.flags() & FLAG_DE_EMPHASIZE) && !is_selected(itemnum)); // subitem default: subitem at 70% brightness
float item_width, subitem_width;

if (item_disabled)
fgcolor = fgcolor.scale8(0.7f * 256); // 70%

// draw the left-side text
ui().draw_text_full(
container(),
Expand Down Expand Up @@ -889,13 +893,16 @@ void menu::draw(uint32_t flags)
if (!core_stricmp(pitem.subtext(), _("Auto")))
fgcolor2 = rgb_t(0xff,0xff,0x00);

if (item_disabled || subitem_de_emphasized)
fgcolor2 = fgcolor2.scale8(0.7F * 256); // 70%

// draw the subitem right-justified
ui().draw_text_full(
container(),
subitem_text,
effective_left + item_width, line_y0, effective_width - item_width,
text_layout::text_justify::RIGHT, text_layout::word_wrapping::TRUNCATE,
mame_ui_manager::NORMAL, subitem_invert ? fgcolor3 : fgcolor2, bgcolor,
mame_ui_manager::NORMAL, fgcolor2, bgcolor,
&subitem_width, nullptr,
line_height());
}
Expand Down Expand Up @@ -926,7 +933,7 @@ void menu::draw(uint32_t flags)
if (selected_subitem_too_big)
{
menu_item const &pitem = selected_item();
bool const subitem_invert(pitem.flags() & FLAG_INVERT);
bool const subitem_invert(pitem.flags() & FLAG_DE_EMPHASIZE);
auto const linenum = m_selected - top_line;
float const line_y = m_items_top + float(linenum) * line_height();

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class menu
{
FLAG_LEFT_ARROW = 1U << 0,
FLAG_RIGHT_ARROW = 1U << 1,
FLAG_INVERT = 1U << 2,
FLAG_DE_EMPHASIZE = 1U << 2,
FLAG_DISABLE = 1U << 4,
FLAG_UI_HEADING = 1U << 5,
FLAG_COLOR_BOX = 1U << 6
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/mame/ui/pluginopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ void menu_plugin_opt::populate()
item_flags_or |= FLAG_RIGHT_ARROW;
else if (flag == "lr")
item_flags_or |= FLAG_RIGHT_ARROW | FLAG_LEFT_ARROW;
else if (flag == "invert")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need directions here

item_flags_or |= FLAG_INVERT;
else if (flag == "invert") // FIXME: do we need to change this?
item_flags_or |= FLAG_DE_EMPHASIZE;
else if (flag == "heading")
item_flags_or |= FLAG_DISABLE | FLAG_UI_HEADING;
else
Expand Down
6 changes: 3 additions & 3 deletions src/frontend/mame/ui/selgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void menu_select_game::populate()
if ((old_item_selected == -1) && (elem.driver->name == reselect_last::driver()))
old_item_selected = curitem;

item_append(elem.description, elem.is_clone ? FLAG_INVERT : 0, (void *)&elem);
item_append(elem.description, elem.is_clone ? FLAG_DE_EMPHASIZE : 0, (void *)&elem);
curitem++;
}
}
Expand Down Expand Up @@ -385,13 +385,13 @@ void menu_select_game::populate()
}

ui_system_info const &sysinfo = m_persistent_data.systems()[driver_list::find(info.driver->name)];
item_append(sysinfo.description, cloneof ? FLAG_INVERT : 0, (void *)&info);
item_append(sysinfo.description, cloneof ? FLAG_DE_EMPHASIZE : 0, (void *)&info);
}
else
{
if (old_item_selected == -1 && info.shortname == reselect_last::driver())
old_item_selected = curitem;
item_append(info.longname, info.devicetype, info.parentname.empty() ? 0 : FLAG_INVERT, (void *)&info);
item_append(info.longname, info.devicetype, info.parentname.empty() ? 0 : FLAG_DE_EMPHASIZE, (void *)&info);
}
curitem++;
});
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/selmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3324,7 +3324,7 @@ void menu_select_launch::draw(u32 flags)
}
else
{
bool const item_invert(pitem.flags() & FLAG_INVERT);
bool const item_invert(pitem.flags() & FLAG_DE_EMPHASIZE);
if (m_has_icons)
draw_icon(linenum, pitem.ref(), item_text_left, linetop);
if (pitem.subtext().empty())
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/selsoft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ void menu_select_software::populate()

item_append(
m_displaylist[curitem].get().longname, m_displaylist[curitem].get().devicetype,
m_displaylist[curitem].get().parentname.empty() ? 0 : FLAG_INVERT, (void *)&m_displaylist[curitem].get());
m_displaylist[curitem].get().parentname.empty() ? 0 : FLAG_DE_EMPHASIZE, (void *)&m_displaylist[curitem].get());
}

m_skip_main_items = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/mame/ui/simpleselgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ void simple_menu_select_game::populate()
item_append(
m_drivlist->driver(curmatch).type.fullname(),
m_drivlist->driver(curmatch).name,
(cloneof == -1) ? 0 : FLAG_INVERT,
(cloneof == -1) ? 0 : FLAG_DE_EMPHASIZE,
(void *)&m_drivlist->driver(curmatch));
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/frontend/mame/ui/sliders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ void menu_sliders::populate()
flags |= FLAG_LEFT_ARROW;
if (curval < slider->maxval)
flags |= FLAG_RIGHT_ARROW;
if (curval == slider->defval)
flags |= FLAG_DE_EMPHASIZE;
item_append(slider->description, tempstring, flags, (void *)slider, menu_item_type::SLIDER);
}
}
Expand All @@ -225,6 +227,8 @@ void menu_sliders::populate()
flags |= FLAG_LEFT_ARROW;
if (curval < slider->maxval)
flags |= FLAG_RIGHT_ARROW;
if (curval == slider->defval)
flags |= FLAG_DE_EMPHASIZE;
item_append(slider->description, tempstring, flags, (void *)slider, menu_item_type::SLIDER);
}
else
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/mame/ui/videoopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void menu_video_options::populate()
bool eclipsed(false);
for (auto it = toggles.begin(); !eclipsed && (toggle != it); ++it)
eclipsed = ((current_mask & it->mask()) != it->mask()) && ((toggle_mask & it->mask()) == it->mask());
item_append_on_off(toggle->name(), enabled, eclipsed ? (FLAG_INVERT | FLAG_DISABLE) : 0U, reinterpret_cast<void *>(ITEM_TOGGLE_FIRST + ref));
item_append_on_off(toggle->name(), enabled, eclipsed ? (FLAG_DE_EMPHASIZE | FLAG_DISABLE) : 0U, reinterpret_cast<void *>(ITEM_TOGGLE_FIRST + ref));
}
item_append(menu_item_type::SEPARATOR);
}
Expand All @@ -163,7 +163,7 @@ void menu_video_options::populate()

// cropping
bool const canzoom(curview.has_art() && !curview.visible_screens().empty());
item_append_on_off(_("Zoom to Screen Area"), m_target.zoom_to_screen(), canzoom ? 0U : (FLAG_INVERT | FLAG_DISABLE), reinterpret_cast<void *>(ITEM_ZOOM));
item_append_on_off(_("Zoom to Screen Area"), m_target.zoom_to_screen(), canzoom ? 0U : (FLAG_DE_EMPHASIZE | FLAG_DISABLE), reinterpret_cast<void *>(ITEM_ZOOM));

if (!m_snapshot)
{
Expand Down
Loading