Skip to content

Commit 58679d7

Browse files
committed
review comments
1 parent 4ceba67 commit 58679d7

16 files changed

Lines changed: 48 additions & 47 deletions

src/frontend/mame/ui/audio_effect_compressor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ u32 menu_audio_effect_compressor::flag_mode() const
438438
{
439439
u32 flag = 0;
440440
if(!m_effect->isset_mode())
441-
flag |= FLAG_INVERT;
441+
flag |= FLAG_DE_EMPHASIZE;
442442
if(m_effect->mode())
443443
flag |= FLAG_LEFT_ARROW;
444444
else
@@ -450,7 +450,7 @@ u32 menu_audio_effect_compressor::flag_lim(float value, float min, float max, bo
450450
{
451451
u32 flag = 0;
452452
if(!isset)
453-
flag |= FLAG_INVERT;
453+
flag |= FLAG_DE_EMPHASIZE;
454454
if(value > min)
455455
flag |= FLAG_LEFT_ARROW;
456456
if(value < max)
@@ -462,7 +462,7 @@ u32 menu_audio_effect_compressor::flag_lim_special(float value, float min, bool
462462
{
463463
u32 flag = 0;
464464
if(!isset)
465-
flag |= FLAG_INVERT;
465+
flag |= FLAG_DE_EMPHASIZE;
466466
if(value != min)
467467
flag |= FLAG_LEFT_ARROW;
468468
if(value >= min)

src/frontend/mame/ui/audio_effect_eq.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ u32 menu_audio_effect_eq::flag_mode() const
367367
{
368368
u32 flag = 0;
369369
if(!m_effect->isset_mode())
370-
flag |= FLAG_INVERT;
370+
flag |= FLAG_DE_EMPHASIZE;
371371
if(m_effect->mode() == 1)
372372
flag |= FLAG_LEFT_ARROW;
373373
if(m_effect->mode() == 0)
@@ -379,7 +379,7 @@ u32 menu_audio_effect_eq::flag_low_shelf() const
379379
{
380380
u32 flag = 0;
381381
if(!m_effect->isset_low_shelf())
382-
flag |= FLAG_INVERT;
382+
flag |= FLAG_DE_EMPHASIZE;
383383
if(m_effect->low_shelf())
384384
flag |= FLAG_RIGHT_ARROW;
385385
else
@@ -391,7 +391,7 @@ u32 menu_audio_effect_eq::flag_high_shelf() const
391391
{
392392
u32 flag = 0;
393393
if(!m_effect->isset_high_shelf())
394-
flag |= FLAG_INVERT;
394+
flag |= FLAG_DE_EMPHASIZE;
395395
if(m_effect->high_shelf())
396396
flag |= FLAG_RIGHT_ARROW;
397397
else
@@ -403,7 +403,7 @@ u32 menu_audio_effect_eq::flag_f(u32 band) const
403403
{
404404
u32 flag = 0;
405405
if(!m_effect->isset_f(band))
406-
flag |= FLAG_INVERT;
406+
flag |= FLAG_DE_EMPHASIZE;
407407
u32 f = m_effect->f(band);
408408
if(f > FREQ_LIMITS[band][0])
409409
flag |= FLAG_LEFT_ARROW;
@@ -416,7 +416,7 @@ u32 menu_audio_effect_eq::flag_q(u32 band) const
416416
{
417417
u32 flag = 0;
418418
if(!m_effect->isset_q(band))
419-
flag |= FLAG_INVERT;
419+
flag |= FLAG_DE_EMPHASIZE;
420420
u32 q = roundf(m_effect->q(band) * 100.0f);
421421
if(q > 10)
422422
flag |= FLAG_LEFT_ARROW;
@@ -429,7 +429,7 @@ u32 menu_audio_effect_eq::flag_db(u32 band) const
429429
{
430430
u32 flag = 0;
431431
if(!m_effect->isset_db(band))
432-
flag |= FLAG_INVERT;
432+
flag |= FLAG_DE_EMPHASIZE;
433433
s32 db = roundf(m_effect->db(band) * 10.0f);
434434
if(db > -120)
435435
flag |= FLAG_LEFT_ARROW;

src/frontend/mame/ui/audio_effect_filter.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ u32 menu_audio_effect_filter::flag_highpass_active() const
372372
{
373373
u32 flag = 0;
374374
if(!m_effect->isset_highpass_active())
375-
flag |= FLAG_INVERT;
375+
flag |= FLAG_DE_EMPHASIZE;
376376
if(m_effect->highpass_active())
377377
flag |= FLAG_LEFT_ARROW;
378378
else
@@ -384,7 +384,7 @@ u32 menu_audio_effect_filter::flag_fh() const
384384
{
385385
u32 flag = 0;
386386
if(!m_effect->isset_fh())
387-
flag |= FLAG_INVERT;
387+
flag |= FLAG_DE_EMPHASIZE;
388388
u32 f = m_effect->fh();
389389
if(f > FH_MIN)
390390
flag |= FLAG_LEFT_ARROW;
@@ -397,7 +397,7 @@ u32 menu_audio_effect_filter::flag_qh() const
397397
{
398398
u32 flag = 0;
399399
if(!m_effect->isset_qh())
400-
flag |= FLAG_INVERT;
400+
flag |= FLAG_DE_EMPHASIZE;
401401
u32 q = roundf(m_effect->qh() * 100.0f);
402402
if(q > 10)
403403
flag |= FLAG_LEFT_ARROW;
@@ -410,7 +410,7 @@ u32 menu_audio_effect_filter::flag_lowpass_active() const
410410
{
411411
u32 flag = 0;
412412
if(!m_effect->isset_lowpass_active())
413-
flag |= FLAG_INVERT;
413+
flag |= FLAG_DE_EMPHASIZE;
414414
if(m_effect->lowpass_active())
415415
flag |= FLAG_LEFT_ARROW;
416416
else
@@ -422,7 +422,7 @@ u32 menu_audio_effect_filter::flag_fl() const
422422
{
423423
u32 flag = 0;
424424
if(!m_effect->isset_fl())
425-
flag |= FLAG_INVERT;
425+
flag |= FLAG_DE_EMPHASIZE;
426426
u32 f = m_effect->fl();
427427
if(f > FL_MIN)
428428
flag |= FLAG_LEFT_ARROW;
@@ -435,7 +435,7 @@ u32 menu_audio_effect_filter::flag_ql() const
435435
{
436436
u32 flag = 0;
437437
if(!m_effect->isset_ql())
438-
flag |= FLAG_INVERT;
438+
flag |= FLAG_DE_EMPHASIZE;
439439
u32 q = roundf(m_effect->ql() * 100.0f);
440440
if(q > 10)
441441
flag |= FLAG_LEFT_ARROW;

src/frontend/mame/ui/audio_effect_reverb.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ u32 menu_audio_effect_reverb::flag_mode() const
537537
{
538538
u32 flag = 0;
539539
if(!m_effect->isset_mode())
540-
flag |= FLAG_INVERT;
540+
flag |= FLAG_DE_EMPHASIZE;
541541
if(m_effect->mode())
542542
flag |= FLAG_LEFT_ARROW;
543543
else
@@ -549,7 +549,7 @@ u32 menu_audio_effect_reverb::flag_tap_setup() const
549549
{
550550
u32 flag = 0;
551551
if(!m_effect->isset_early_tap_setup())
552-
flag |= FLAG_INVERT;
552+
flag |= FLAG_DE_EMPHASIZE;
553553
if(m_effect->early_tap_setup() != 0)
554554
flag |= FLAG_LEFT_ARROW;
555555
if(m_effect->early_tap_setup() != audio_effect_reverb::early_tap_setup_count() - 1)
@@ -571,7 +571,7 @@ u32 menu_audio_effect_reverb::flag_percent(double val, bool isset)
571571
{
572572
u32 flag = 0;
573573
if(!isset)
574-
flag |= FLAG_INVERT;
574+
flag |= FLAG_DE_EMPHASIZE;
575575
if(val > 0.0)
576576
flag |= FLAG_LEFT_ARROW;
577577
if(val < 100.0)
@@ -583,7 +583,7 @@ u32 menu_audio_effect_reverb::flag_freq(double val, bool isset)
583583
{
584584
u32 flag = 0;
585585
if(!isset)
586-
flag |= FLAG_INVERT;
586+
flag |= FLAG_DE_EMPHASIZE;
587587
if(val > 100.0)
588588
flag |= FLAG_LEFT_ARROW;
589589
if(val < 16000.0)
@@ -595,7 +595,7 @@ u32 menu_audio_effect_reverb::flag_ms(float val, bool isset)
595595
{
596596
u32 flag = 0;
597597
if(!isset)
598-
flag |= FLAG_INVERT;
598+
flag |= FLAG_DE_EMPHASIZE;
599599
if(val > 0.0f)
600600
flag |= FLAG_LEFT_ARROW;
601601
if(val < 200.0f)
@@ -607,7 +607,7 @@ u32 menu_audio_effect_reverb::flag_decay(float val, bool isset)
607607
{
608608
u32 flag = 0;
609609
if(!isset)
610-
flag |= FLAG_INVERT;
610+
flag |= FLAG_DE_EMPHASIZE;
611611
if(val > 0.1f)
612612
flag |= FLAG_LEFT_ARROW;
613613
if(val < 30.0f)
@@ -619,7 +619,7 @@ u32 menu_audio_effect_reverb::flag_spin(double val, bool isset)
619619
{
620620
u32 flag = 0;
621621
if(!isset)
622-
flag |= FLAG_INVERT;
622+
flag |= FLAG_DE_EMPHASIZE;
623623
if(val > 0.0)
624624
flag |= FLAG_LEFT_ARROW;
625625
if(val < 5.0)

src/frontend/mame/ui/audioeffects.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ u32 menu_audio_effects::flag_latency() const
211211
if(latency < 0.05f)
212212
flag |= FLAG_RIGHT_ARROW;
213213
if(machine().sound().resampler_type() != sound_manager::RESAMPLER_HQ)
214-
flag |= FLAG_INVERT | FLAG_DISABLE;
214+
flag |= FLAG_DISABLE;
215215
return flag;
216216
}
217217

@@ -224,7 +224,7 @@ u32 menu_audio_effects::flag_length() const
224224
if(length < 500)
225225
flag |= FLAG_RIGHT_ARROW;
226226
if(machine().sound().resampler_type() != sound_manager::RESAMPLER_HQ)
227-
flag |= FLAG_INVERT | FLAG_DISABLE;
227+
flag |= FLAG_DISABLE;
228228
return flag;
229229
}
230230

@@ -237,7 +237,7 @@ u32 menu_audio_effects::flag_phases() const
237237
if(phases < 1000)
238238
flag |= FLAG_RIGHT_ARROW;
239239
if(machine().sound().resampler_type() != sound_manager::RESAMPLER_HQ)
240-
flag |= FLAG_INVERT | FLAG_DISABLE;
240+
flag |= FLAG_DISABLE;
241241
return flag;
242242
}
243243

src/frontend/mame/ui/confswitch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void menu_confswitch::populate()
130130
flags |= FLAG_RIGHT_ARROW;
131131

132132
if (field.live().value == field.defvalue())
133-
flags |= FLAG_AT_DEFAULT;
133+
flags |= FLAG_DE_EMPHASIZE;
134134

135135
// add the menu item
136136
item_append(field.name(), field.setting_name(), flags, &field);

src/frontend/mame/ui/inputmap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ void menu_input::populate_sorted()
611611
{
612612
// otherwise, generate the sequence name and invert it if same as the default
613613
subtext = machine().input().seq_name(item.seq);
614-
flags |= (item.seq == *item.defseq) ? FLAG_AT_DEFAULT : 0;
614+
flags |= (item.seq == *item.defseq) ? FLAG_DE_EMPHASIZE : 0;
615615
}
616616

617617
// add the item

src/frontend/mame/ui/menu.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -838,9 +838,13 @@ void menu::draw(uint32_t flags)
838838
else
839839
{
840840
// otherwise, draw the item on the left and the subitem text on the right
841-
bool const subitem_invert(pitem.flags() & FLAG_INVERT);
841+
bool const item_disabled(pitem.flags() & FLAG_DISABLE); // item disabled: both item and subitem at 70% brightness
842+
bool const subitem_de_emphasized((pitem.flags() & FLAG_DE_EMPHASIZE) && !is_selected(itemnum)); // subitem default: subitem at 70% brightness
842843
float item_width, subitem_width;
843844

845+
if (item_disabled)
846+
fgcolor = fgcolor.scale8(0.7f * 256); // 70%
847+
844848
// draw the left-side text
845849
ui().draw_text_full(
846850
container(),
@@ -889,9 +893,7 @@ void menu::draw(uint32_t flags)
889893
if (!core_stricmp(pitem.subtext(), _("Auto")))
890894
fgcolor2 = rgb_t(0xff,0xff,0x00);
891895

892-
if (subitem_invert) // disabled items are drawn with a dimmer color
893-
fgcolor2 = fgcolor2.scale8(0.4f * 256); // 40%
894-
else if ((pitem.flags() & FLAG_AT_DEFAULT) && !is_selected(itemnum)) // if at default value and not selected, draw with a dimmer color
896+
if (item_disabled || subitem_de_emphasized)
895897
fgcolor2 = fgcolor2.scale8(0.7F * 256); // 70%
896898

897899
// draw the subitem right-justified
@@ -931,7 +933,7 @@ void menu::draw(uint32_t flags)
931933
if (selected_subitem_too_big)
932934
{
933935
menu_item const &pitem = selected_item();
934-
bool const subitem_invert(pitem.flags() & FLAG_INVERT);
936+
bool const subitem_invert(pitem.flags() & FLAG_DE_EMPHASIZE);
935937
auto const linenum = m_selected - top_line;
936938
float const line_y = m_items_top + float(linenum) * line_height();
937939

src/frontend/mame/ui/menu.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ class menu
5656
{
5757
FLAG_LEFT_ARROW = 1U << 0,
5858
FLAG_RIGHT_ARROW = 1U << 1,
59-
FLAG_INVERT = 1U << 2,
59+
FLAG_DE_EMPHASIZE = 1U << 2,
6060
FLAG_DISABLE = 1U << 4,
6161
FLAG_UI_HEADING = 1U << 5,
62-
FLAG_COLOR_BOX = 1U << 6,
63-
FLAG_AT_DEFAULT = 1U << 7
62+
FLAG_COLOR_BOX = 1U << 6
6463
};
6564

6665
virtual ~menu();

src/frontend/mame/ui/pluginopt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ void menu_plugin_opt::populate()
172172
item_flags_or |= FLAG_RIGHT_ARROW;
173173
else if (flag == "lr")
174174
item_flags_or |= FLAG_RIGHT_ARROW | FLAG_LEFT_ARROW;
175-
else if (flag == "invert")
176-
item_flags_or |= FLAG_INVERT;
175+
else if (flag == "invert") // FIXME: do we need to change this?
176+
item_flags_or |= FLAG_DE_EMPHASIZE;
177177
else if (flag == "heading")
178178
item_flags_or |= FLAG_DISABLE | FLAG_UI_HEADING;
179179
else

0 commit comments

Comments
 (0)