From 3abcaee63ff285514e8b51a60949c97a7dfa5304 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 24 Feb 2016 07:46:57 +0100 Subject: Cleanups and version bump --- src/emu/ui/auditmenu.cpp | 2 +- src/emu/ui/cheatopt.cpp | 4 +- src/emu/ui/ctrlmenu.cpp | 6 +- src/emu/ui/custmenu.cpp | 11 ++- src/emu/ui/custui.cpp | 58 ++++++++-------- src/emu/ui/custui.h | 6 +- src/emu/ui/datfile.cpp | 6 +- src/emu/ui/datfile.h | 10 +-- src/emu/ui/datmenu.cpp | 7 +- src/emu/ui/datmenu.h | 4 +- src/emu/ui/dirmenu.cpp | 75 ++++++++++---------- src/emu/ui/dsplmenu.cpp | 16 ++--- src/emu/ui/inifile.cpp | 4 +- src/emu/ui/inifile.h | 4 +- src/emu/ui/mainmenu.cpp | 10 +-- src/emu/ui/menu.cpp | 58 ++++++++-------- src/emu/ui/menu.h | 10 +-- src/emu/ui/miscmenu.cpp | 4 +- src/emu/ui/moptions.cpp | 102 +++++++++++++-------------- src/emu/ui/optsmenu.cpp | 12 ++-- src/emu/ui/selector.cpp | 10 +-- src/emu/ui/selgame.cpp | 54 +++++++-------- src/emu/ui/selsoft.cpp | 57 ++++++++------- src/emu/ui/sndmenu.cpp | 4 +- src/emu/ui/ui.cpp | 16 ++--- src/emu/ui/ui.h | 176 +++++++++++++++++++++++------------------------ src/emu/ui/utils.cpp | 2 +- 27 files changed, 361 insertions(+), 367 deletions(-) (limited to 'src/emu/ui') diff --git a/src/emu/ui/auditmenu.cpp b/src/emu/ui/auditmenu.cpp index 97d84568118..9703545948e 100644 --- a/src/emu/ui/auditmenu.cpp +++ b/src/emu/ui/auditmenu.cpp @@ -1,4 +1,4 @@ -// license:BSD-3-Clause +// license:BSD-3-Clause // copyright-holders:Dankan1890 /********************************************************************* diff --git a/src/emu/ui/cheatopt.cpp b/src/emu/ui/cheatopt.cpp index 6de3cb55936..9191323d059 100644 --- a/src/emu/ui/cheatopt.cpp +++ b/src/emu/ui/cheatopt.cpp @@ -192,7 +192,7 @@ void ui_menu_autofire::handle() if (menu_event->itemref == ITEMREF_AUTOFIRE_STATUS) { // toggle autofire status - bool autofire_toggle = machine().ioport().get_autofire_toggle(); // (menu_event->iptkey == IPT_UI_LEFT); + bool autofire_toggle = machine().ioport().get_autofire_toggle(); // (menu_event->iptkey == IPT_UI_LEFT); machine().ioport().set_autofire_toggle(!autofire_toggle); changed = true; } @@ -321,5 +321,3 @@ void ui_menu_autofire::populate() last_toggle = autofire_toggle; } - - diff --git a/src/emu/ui/ctrlmenu.cpp b/src/emu/ui/ctrlmenu.cpp index f954a596f7a..9215ef19783 100644 --- a/src/emu/ui/ctrlmenu.cpp +++ b/src/emu/ui/ctrlmenu.cpp @@ -44,7 +44,7 @@ ui_menu_controller_mapping::ui_menu_controller_mapping(running_machine &machine, ui_menu_controller_mapping::~ui_menu_controller_mapping() { std::string error_string; - for (int d = 1; d < ARRAY_LENGTH(m_options); ++d) + for (int d = 1; d < ARRAY_LENGTH(m_options); ++d) { if (strcmp(machine().options().value(m_options[d].option),m_device_status[m_options[d].status])!=0) { @@ -104,7 +104,7 @@ void ui_menu_controller_mapping::custom_render(void *selectedref, float top, flo ui_manager &mui = machine().ui(); mui.draw_text_full(container, _("Device Mapping"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); @@ -124,7 +124,7 @@ void ui_menu_controller_mapping::custom_render(void *selectedref, float top, flo // draw the text within it mui.draw_text_full(container, _("Device Mapping"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } diff --git a/src/emu/ui/custmenu.cpp b/src/emu/ui/custmenu.cpp index 3a50f4bfc03..e52c9ced27d 100644 --- a/src/emu/ui/custmenu.cpp +++ b/src/emu/ui/custmenu.cpp @@ -1,4 +1,4 @@ -// license:BSD-3-Clause +// license:BSD-3-Clause // copyright-holders:Dankan1890 /********************************************************************* @@ -208,7 +208,7 @@ void ui_menu_custom_filter::custom_render(void *selectedref, float top, float bo // get the size of the text mui.draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += (2.0f * UI_BOX_LR_BORDER) + 0.01f; float maxwidth = MAX(width, origx2 - origx1); @@ -228,7 +228,7 @@ void ui_menu_custom_filter::custom_render(void *selectedref, float top, float bo // draw the text within it mui.draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } //------------------------------------------------- @@ -521,7 +521,7 @@ void ui_menu_swcustom_filter::custom_render(void *selectedref, float top, float // get the size of the text mui.draw_text_full(container, _("Select custom filters:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += (2.0f * UI_BOX_LR_BORDER) + 0.01f; float maxwidth = MAX(width, origx2 - origx1); @@ -541,7 +541,7 @@ void ui_menu_swcustom_filter::custom_render(void *selectedref, float top, float // draw the text within it mui.draw_text_full(container, _("Select custom filters:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } //------------------------------------------------- @@ -577,4 +577,3 @@ void ui_menu_swcustom_filter::save_sw_custom_filters() file.close(); } } - diff --git a/src/emu/ui/custui.cpp b/src/emu/ui/custui.cpp index 6492faebabf..55f2e40afbb 100644 --- a/src/emu/ui/custui.cpp +++ b/src/emu/ui/custui.cpp @@ -1,4 +1,4 @@ -// license:BSD-3-Clause +// license:BSD-3-Clause // copyright-holders:Dankan1890 /********************************************************************* @@ -16,10 +16,10 @@ #include "ui/utils.h" #include -const char *ui_menu_custom_ui::hide_status[] = { - __("Show All"), - __("Hide Filters"), - __("Hide Info/Image"), +const char *ui_menu_custom_ui::hide_status[] = { + __("Show All"), + __("Hide Filters"), + __("Hide Info/Image"), __("Hide Both") }; //------------------------------------------------- @@ -63,7 +63,7 @@ ui_menu_custom_ui::~ui_menu_custom_ui() ui_globals::reset = true; } -//------------------------------------------------- +//------------------------------------------------- // handle //------------------------------------------------- @@ -160,7 +160,7 @@ void ui_menu_custom_ui::custom_render(void *selectedref, float top, float bottom ui_manager &mui = machine().ui(); mui.draw_text_full(container, _("Custom UI Settings"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; float maxwidth = MAX(origx2 - origx1, width); @@ -180,7 +180,7 @@ void ui_menu_custom_ui::custom_render(void *selectedref, float top, float bottom // draw the text within it mui.draw_text_full(container, _("Custom UI Settings"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } //------------------------------------------------- @@ -406,7 +406,7 @@ void ui_menu_font_ui::custom_render(void *selectedref, float top, float bottom, std::string topbuf(_("UI Fonts Settings")); mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; float maxwidth = MAX(origx2 - origx1, width); @@ -426,14 +426,14 @@ void ui_menu_font_ui::custom_render(void *selectedref, float top, float bottom, // draw the text within it mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); if ((FPTR)selectedref == INFOS_SIZE) { topbuf = _("Sample text - Lorem ipsum dolor sit amet, consectetur adipiscing elit."); mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr, m_info_size); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr, m_info_size); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(origx2 - origx1, width); @@ -453,7 +453,7 @@ void ui_menu_font_ui::custom_render(void *selectedref, float top, float bottom, // draw the text within it mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, m_info_size); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, m_info_size); } } @@ -565,7 +565,7 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom std::string topbuf(_("UI Colors Settings")); mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); @@ -585,7 +585,7 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom // draw the text within it mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); // bottom text // get the text for 'UI Select' @@ -593,7 +593,7 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom topbuf.assign(_("Double click or press ")).append(ui_select_text.c_str()).append(_(" to change the color value")); mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); @@ -613,13 +613,13 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom // draw the text within it mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); // compute maxwidth topbuf = _("Menu Preview"); mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); maxwidth = width + 2.0f * UI_BOX_LR_BORDER; std::string sampletxt[5]; @@ -633,7 +633,7 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom for (auto & elem: sampletxt) { mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); } @@ -655,7 +655,7 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom // draw the text within it mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); // compute our bounds for menu preview x1 -= UI_BOX_LR_BORDER; @@ -673,29 +673,29 @@ void ui_menu_colors_ui::custom_render(void *selectedref, float top, float bottom // draw normal text mui.draw_text_full(container, sampletxt[0].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, m_color_table[MUI_TEXT_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr); + DRAW_NORMAL, m_color_table[MUI_TEXT_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr); y1 += line_height; // draw subitem text mui.draw_text_full(container, sampletxt[1].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, m_color_table[MUI_SUBITEM_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr); + DRAW_NORMAL, m_color_table[MUI_SUBITEM_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr); y1 += line_height; // draw selected text highlight(container, x1, y1, x2, y1 + line_height, m_color_table[MUI_SELECTED_BG_COLOR].color); mui.draw_text_full(container, sampletxt[2].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, m_color_table[MUI_SELECTED_COLOR].color, m_color_table[MUI_SELECTED_BG_COLOR].color, nullptr, nullptr); + DRAW_NORMAL, m_color_table[MUI_SELECTED_COLOR].color, m_color_table[MUI_SELECTED_BG_COLOR].color, nullptr, nullptr); y1 += line_height; // draw mouse over text highlight(container, x1, y1, x2, y1 + line_height, m_color_table[MUI_MOUSEOVER_BG_COLOR].color); mui.draw_text_full(container, sampletxt[3].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, m_color_table[MUI_MOUSEOVER_COLOR].color, m_color_table[MUI_MOUSEOVER_BG_COLOR].color, nullptr, nullptr); + DRAW_NORMAL, m_color_table[MUI_MOUSEOVER_COLOR].color, m_color_table[MUI_MOUSEOVER_BG_COLOR].color, nullptr, nullptr); y1 += line_height; // draw clone text mui.draw_text_full(container, sampletxt[4].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, m_color_table[MUI_CLONE_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr); + DRAW_NORMAL, m_color_table[MUI_CLONE_COLOR].color, m_color_table[MUI_TEXT_BG_COLOR].color, nullptr, nullptr); } @@ -912,7 +912,7 @@ void ui_menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, f // top text std::string topbuf = std::string(m_title).append(_(" - ARGB Settings")); mui.draw_text_full(container, topbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); @@ -932,12 +932,12 @@ void ui_menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, f // draw the text within it mui.draw_text_full(container, topbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); std::string sampletxt(_("Color preview =")); maxwidth = origx2 - origx1; mui.draw_text_full(container, sampletxt.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); @@ -957,7 +957,7 @@ void ui_menu_rgb_ui::custom_render(void *selectedref, float top, float bottom, f // draw the normal text mui.draw_text_full(container, sampletxt.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, ARGB_WHITE, ARGB_BLACK, nullptr, nullptr); + DRAW_NORMAL, ARGB_WHITE, ARGB_BLACK, nullptr, nullptr); float t_x2 = x1 - UI_BOX_LR_BORDER + maxwidth; x1 = x2 + 2.0f * UI_BOX_LR_BORDER; @@ -1046,7 +1046,7 @@ ui_menu_palette_sel::palcolor ui_menu_palette_sel::m_palette[] = { // ctor //------------------------------------------------- -ui_menu_palette_sel::ui_menu_palette_sel(running_machine &machine, render_container *container, rgb_t &_color) +ui_menu_palette_sel::ui_menu_palette_sel(running_machine &machine, render_container *container, rgb_t &_color) : ui_menu(machine, container), m_original(_color) { } diff --git a/src/emu/ui/custui.h b/src/emu/ui/custui.h index 0a2caf8de8c..2ff13994cb6 100644 --- a/src/emu/ui/custui.h +++ b/src/emu/ui/custui.h @@ -68,9 +68,9 @@ private: }; #ifdef UI_WINDOWS - UINT16 m_actual; - std::vector m_fonts; - bool m_bold, m_italic; + UINT16 m_actual; + std::vector m_fonts; + bool m_bold, m_italic; void list(); static int CALLBACK EnumFontFamiliesExProc(const LOGFONT *lpelfe, const TEXTMETRIC *lpntme, DWORD FontType, LPARAM lParam); diff --git a/src/emu/ui/datfile.cpp b/src/emu/ui/datfile.cpp index 9171242d072..7a5ebb57e6f 100644 --- a/src/emu/ui/datfile.cpp +++ b/src/emu/ui/datfile.cpp @@ -25,7 +25,7 @@ static std::string TAG_COMMAND("$cmd"); static std::string TAG_END("$end"); static std::string TAG_DRIVER("$drv"); static std::string TAG_STORY("$story"); -static std::string TAG_HISTORY_R("## REVISION:"); +static std::string TAG_HISTORY_R("## REVISION:"); static std::string TAG_MAMEINFO_R("# MAMEINFO.DAT"); static std::string TAG_MESSINFO_R("# MESSINFO.DAT"); static std::string TAG_SYSINFO_R("# This file was generated on"); @@ -540,7 +540,7 @@ int datfile_manager::index_datafile(dataindex &index, int &swcount) } //--------------------------------------------------------- -// parseopen - Open up file for reading +// parseopen - Open up file for reading //--------------------------------------------------------- bool datfile_manager::parseopen(const char *filename) { @@ -647,4 +647,4 @@ void datfile_manager::command_sub_menu(const game_driver *drv, std::vector m_items_list; diff --git a/src/emu/ui/dirmenu.cpp b/src/emu/ui/dirmenu.cpp index f1cc16bae0b..30a992f2363 100644 --- a/src/emu/ui/dirmenu.cpp +++ b/src/emu/ui/dirmenu.cpp @@ -1,4 +1,4 @@ -// license:BSD-3-Clause +// license:BSD-3-Clause // copyright-holders:Dankan1890 /********************************************************************* @@ -28,33 +28,33 @@ struct folders_entry static const folders_entry s_folders[] = { - { __("ROMs"), OPTION_MEDIAPATH, ADDING }, - { __("UI"), OPTION_UI_PATH, CHANGE }, - { __("Language"), OPTION_LANGUAGEPATH, CHANGE }, - { __("Samples"), OPTION_SAMPLEPATH, ADDING }, - { __("DATs"), OPTION_HISTORY_PATH, CHANGE }, - { __("INIs"), OPTION_INIPATH, ADDING }, - { __("Extra INIs"), OPTION_EXTRAINI_PATH, CHANGE }, - { __("Icons"), OPTION_ICONS_PATH, ADDING }, - { __("Cheats"), OPTION_CHEATPATH, ADDING }, - { __("Snapshots"), OPTION_SNAPSHOT_DIRECTORY, ADDING }, - { __("Cabinets"), OPTION_CABINETS_PATH, ADDING }, - { __("Flyers"), OPTION_FLYERS_PATH, ADDING }, - { __("Titles"), OPTION_TITLES_PATH, ADDING }, - { __("Ends"), OPTION_ENDS_PATH, ADDING }, - { __("PCBs"), OPTION_PCBS_PATH, ADDING }, - { __("Marquees"), OPTION_MARQUEES_PATH, ADDING }, - { __("Controls Panels"), OPTION_CPANELS_PATH, ADDING }, - { __("Crosshairs"), OPTION_CROSSHAIRPATH, ADDING }, - { __("Artworks"), OPTION_ARTPATH, ADDING }, - { __("Bosses"), OPTION_BOSSES_PATH, ADDING }, - { __("Artworks Preview"), OPTION_ARTPREV_PATH, ADDING }, - { __("Select"), OPTION_SELECT_PATH, ADDING }, - { __("GameOver"), OPTION_GAMEOVER_PATH, ADDING }, - { __("HowTo"), OPTION_HOWTO_PATH, ADDING }, - { __("Logos"), OPTION_LOGOS_PATH, ADDING }, - { __("Scores"), OPTION_SCORES_PATH, ADDING }, - { __("Versus"), OPTION_VERSUS_PATH, ADDING }, + { __("ROMs"), OPTION_MEDIAPATH, ADDING }, + { __("UI"), OPTION_UI_PATH, CHANGE }, + { __("Language"), OPTION_LANGUAGEPATH, CHANGE }, + { __("Samples"), OPTION_SAMPLEPATH, ADDING }, + { __("DATs"), OPTION_HISTORY_PATH, CHANGE }, + { __("INIs"), OPTION_INIPATH, ADDING }, + { __("Extra INIs"), OPTION_EXTRAINI_PATH, CHANGE }, + { __("Icons"), OPTION_ICONS_PATH, ADDING }, + { __("Cheats"), OPTION_CHEATPATH, ADDING }, + { __("Snapshots"), OPTION_SNAPSHOT_DIRECTORY, ADDING }, + { __("Cabinets"), OPTION_CABINETS_PATH, ADDING }, + { __("Flyers"), OPTION_FLYERS_PATH, ADDING }, + { __("Titles"), OPTION_TITLES_PATH, ADDING }, + { __("Ends"), OPTION_ENDS_PATH, ADDING }, + { __("PCBs"), OPTION_PCBS_PATH, ADDING }, + { __("Marquees"), OPTION_MARQUEES_PATH, ADDING }, + { __("Controls Panels"), OPTION_CPANELS_PATH, ADDING }, + { __("Crosshairs"), OPTION_CROSSHAIRPATH, ADDING }, + { __("Artworks"), OPTION_ARTPATH, ADDING }, + { __("Bosses"), OPTION_BOSSES_PATH, ADDING }, + { __("Artworks Preview"), OPTION_ARTPREV_PATH, ADDING }, + { __("Select"), OPTION_SELECT_PATH, ADDING }, + { __("GameOver"), OPTION_GAMEOVER_PATH, ADDING }, + { __("HowTo"), OPTION_HOWTO_PATH, ADDING }, + { __("Logos"), OPTION_LOGOS_PATH, ADDING }, + { __("Scores"), OPTION_SCORES_PATH, ADDING }, + { __("Versus"), OPTION_VERSUS_PATH, ADDING }, }; @@ -94,7 +94,6 @@ void ui_menu_directory::handle() void ui_menu_directory::populate() { - for (auto & elem : s_folders) item_append(_(elem.name), nullptr, 0, (void *)(FPTR)elem.action); @@ -143,7 +142,7 @@ void ui_menu_directory::custom_render(void *selectedref, float top, float bottom // ctor / dtor //------------------------------------------------- -ui_menu_display_actual::ui_menu_display_actual(running_machine &machine, render_container *container, int ref) +ui_menu_display_actual::ui_menu_display_actual(running_machine &machine, render_container *container, int ref) : ui_menu(machine, container), m_ref(ref) { } @@ -238,7 +237,7 @@ void ui_menu_display_actual::custom_render(void *selectedref, float top, float b y1 += UI_BOX_TB_BORDER; // draw the text within it - mui.draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, + mui.draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); // compute our bounds @@ -376,7 +375,7 @@ void ui_menu_add_change_folder::handle() { machine().ui().options().set_value(s_folders[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string); } - else + else { if (strcmp(machine().options().value(s_folders[m_ref].option), m_current_path.c_str()) != 0) { @@ -401,7 +400,7 @@ void ui_menu_add_change_folder::handle() { machine().ui().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string); } - else + else { if (strcmp(machine().options().value(s_folders[m_ref].option), tmppath.c_str()) != 0) { @@ -582,9 +581,9 @@ void ui_menu_add_change_folder::custom_render(void *selectedref, float top, floa ui_menu_remove_folder::ui_menu_remove_folder(running_machine &machine, render_container *container, int ref) : ui_menu(machine, container) { m_ref = ref; - if (machine.ui().options().exists(s_folders[m_ref].option)) + if (machine.ui().options().exists(s_folders[m_ref].option)) m_searchpath.assign(machine.ui().options().value(s_folders[m_ref].option)); - else + else m_searchpath.assign(machine.options().value(s_folders[m_ref].option)); path_iterator path(m_searchpath.c_str()); @@ -620,11 +619,11 @@ void ui_menu_remove_folder::handle() { machine().ui().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string); } - else + else { if (strcmp(machine().options().value(s_folders[m_ref].option),tmppath.c_str())!=0) { - machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string); + machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string); machine().options().mark_changed(s_folders[m_ref].option); } } @@ -679,6 +678,6 @@ void ui_menu_remove_folder::custom_render(void *selectedref, float top, float bo y1 += UI_BOX_TB_BORDER; // draw the text within it - mui.draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL, + mui.draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } diff --git a/src/emu/ui/dsplmenu.cpp b/src/emu/ui/dsplmenu.cpp index 93cf3771133..c93bdd960ca 100644 --- a/src/emu/ui/dsplmenu.cpp +++ b/src/emu/ui/dsplmenu.cpp @@ -1,4 +1,4 @@ -// license:BSD-3-Clause +// license:BSD-3-Clause // copyright-holders:Dankan1890 /********************************************************************* @@ -23,10 +23,10 @@ ui_menu_display_options::video_modes ui_menu_display_options::m_video = { - { "auto", "Auto" }, - { "opengl", "OpenGL" }, - { "bgfx", "BGFX" }, - { "d3d", "Direct3D" }, + { "auto", "Auto" }, + { "opengl", "OpenGL" }, + { "bgfx", "BGFX" }, + { "d3d", "Direct3D" }, { "gdi", "GDI" }, { "ddraw", "DirectDraw" }, { "soft", "Software" }, @@ -107,20 +107,20 @@ ui_menu_display_options::ui_menu_display_options(running_machine &machine, rende ui_menu_display_options::~ui_menu_display_options() { std::string error_string; - for (int d = 2; d < ARRAY_LENGTH(m_options); ++d) + for (int d = 2; d < ARRAY_LENGTH(m_options); ++d) { if (machine().options().int_value(m_options[d].option) != m_options[d].status) { machine().options().set_value(m_options[d].option, m_options[d].status, OPTION_PRIORITY_CMDLINE, error_string); machine().options().mark_changed(m_options[d].option); - } + } } if (machine().options().value(m_options[1].option) != m_list[m_options[1].status]) { machine().options().set_value(m_options[1].option, m_list[m_options[1].status].c_str(), OPTION_PRIORITY_CMDLINE, error_string); machine().options().mark_changed(m_options[1].option); - } + } ui_globals::reset = true; } diff --git a/src/emu/ui/inifile.cpp b/src/emu/ui/inifile.cpp index 1c92b43a4d6..0c7d7a1a01b 100644 --- a/src/emu/ui/inifile.cpp +++ b/src/emu/ui/inifile.cpp @@ -142,7 +142,7 @@ void inifile_manager::load_ini_category(std::vector &temp_filter) } //--------------------------------------------------------- -// parseopen - Open up file for reading +// parseopen - Open up file for reading //--------------------------------------------------------- bool inifile_manager::parseopen(const char *filename) @@ -303,7 +303,7 @@ bool favorite_manager::isgame_favorite() image_loaded = true; for (size_t current = 0; current < m_list.size(); current++) if (m_list[current].shortname == swinfo->shortname() && - m_list[current].listname == image->software_list_name()) + m_list[current].listname == image->software_list_name()) { m_current = current; return true; diff --git a/src/emu/ui/inifile.h b/src/emu/ui/inifile.h index 5a90b0d3d83..5c9e7ebdc65 100644 --- a/src/emu/ui/inifile.h +++ b/src/emu/ui/inifile.h @@ -70,7 +70,7 @@ private: // internal state running_machine &m_machine; // reference to our machine std::string m_fullpath; - FILE *fp = nullptr; + FILE *fp = nullptr; }; //------------------------------------------------- @@ -108,7 +108,7 @@ public: private: const char *favorite_filename = "favorites.ini"; - + // current int m_current; diff --git a/src/emu/ui/mainmenu.cpp b/src/emu/ui/mainmenu.cpp index caf531c41ef..66381a3df1f 100644 --- a/src/emu/ui/mainmenu.cpp +++ b/src/emu/ui/mainmenu.cpp @@ -138,14 +138,14 @@ void ui_menu_main::populate() item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); /* add favorite menu */ - if (!machine().favorite().isgame_favorite()) + if (!machine().favorite().isgame_favorite()) item_append(_("Add To Favorites"), nullptr, 0, (void *)ADD_FAVORITE); else item_append(_("Remove From Favorites"), nullptr, 0, (void *)REMOVE_FAVORITE); item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); -// item_append(_("Quit from Machine"), nullptr, 0, (void *)QUIT_GAME); +// item_append(_("Quit from Machine"), nullptr, 0, (void *)QUIT_GAME); /* add reset and exit menus */ item_append(_("Select New Machine"), nullptr, 0, (void *)SELECT_GAME); @@ -246,7 +246,7 @@ void ui_menu_main::handle() ui_menu::stack_push(global_alloc_clear(machine(), container, nullptr)); } else { ui_menu::stack_push(global_alloc_clear(machine(), container, nullptr)); - } + } break; case BIOS_SELECTION: @@ -262,12 +262,12 @@ void ui_menu_main::handle() break; case ADD_FAVORITE: - machine().favorite().add_favorite_game(); + machine().favorite().add_favorite_game(); reset(UI_MENU_RESET_REMEMBER_POSITION); break; case REMOVE_FAVORITE: - machine().favorite().remove_favorite_game(); + machine().favorite().remove_favorite_game(); reset(UI_MENU_RESET_REMEMBER_POSITION); break; diff --git a/src/emu/ui/menu.cpp b/src/emu/ui/menu.cpp index 3803790c359..4772b39e6fd 100644 --- a/src/emu/ui/menu.cpp +++ b/src/emu/ui/menu.cpp @@ -2,9 +2,9 @@ // copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods /********************************************************************* - ui/menu.c + ui/menu.c - Internal MAME menus for the user interface. + Internal MAME menus for the user interface. *********************************************************************/ @@ -27,7 +27,7 @@ /*************************************************************************** - CONSTANTS + CONSTANTS ***************************************************************************/ #define UI_MENU_POOL_SIZE 65536 @@ -68,7 +68,7 @@ static const char *hover_msg[] = { }; /*************************************************************************** - GLOBAL VARIABLES + GLOBAL VARIABLES ***************************************************************************/ ui_menu *ui_menu::menu_stack; @@ -93,7 +93,7 @@ bitmap_argb32 *ui_menu::toolbar_bitmap[UI_TOOLBAR_BUTTONS]; bitmap_argb32 *ui_menu::sw_toolbar_bitmap[UI_TOOLBAR_BUTTONS]; /*************************************************************************** - INLINE FUNCTIONS + INLINE FUNCTIONS ***************************************************************************/ //------------------------------------------------- @@ -126,7 +126,7 @@ inline bool ui_menu::exclusive_input_pressed(int key, int repeat) /*************************************************************************** - CORE SYSTEM MANAGEMENT + CORE SYSTEM MANAGEMENT ***************************************************************************/ //------------------------------------------------- @@ -193,7 +193,7 @@ void ui_menu::exit(running_machine &machine) /*************************************************************************** - CORE MENU MANAGEMENT + CORE MENU MANAGEMENT ***************************************************************************/ //------------------------------------------------- @@ -334,7 +334,7 @@ const ui_menu_event *ui_menu::process(UINT32 flags) menu_event.iptkey = IPT_INVALID; // first make sure our selection is valid -// if (!(flags & UI_MENU_PROCESS_NOINPUT)) +// if (!(flags & UI_MENU_PROCESS_NOINPUT)) validate_selection(1); // draw the menu @@ -451,7 +451,7 @@ void ui_menu::set_selection(void *selected_itemref) /*************************************************************************** - INTERNAL MENU PROCESSING + INTERNAL MENU PROCESSING ***************************************************************************/ //------------------------------------------------- @@ -713,7 +713,7 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput) // compute the multi-line target width/height machine().ui().draw_text_full(container, pitem.subtext, 0, 0, visible_width * 0.75f, - JUSTIFY_RIGHT, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &target_width, &target_height); + JUSTIFY_RIGHT, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &target_width, &target_height); // determine the target location target_x = visible_left + visible_width - target_width - UI_BOX_LR_BORDER; @@ -725,8 +725,8 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput) machine().ui().draw_outlined_box(container, target_x - UI_BOX_LR_BORDER, target_y - UI_BOX_TB_BORDER, target_x + target_width + UI_BOX_LR_BORDER, - target_y + target_height + UI_BOX_TB_BORDER, - subitem_invert ? UI_SELECTED_BG_COLOR : UI_BACKGROUND_COLOR); + target_y + target_height + UI_BOX_TB_BORDER, + subitem_invert ? UI_SELECTED_BG_COLOR : UI_BACKGROUND_COLOR); machine().ui().draw_text_full(container, pitem.subtext, target_x, target_y, target_width, JUSTIFY_RIGHT, WRAP_WORD, DRAW_NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, nullptr, nullptr); } @@ -736,8 +736,8 @@ void ui_menu::draw(bool customonly, bool noimage, bool noinput) // return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow visitems = visible_lines - (top_line != 0) - (top_line + visible_lines != item.size()); -// if (history_flag && (top_line + visible_lines >= item.size())) -// selected = item.size() - 1; +// if (history_flag && (top_line + visible_lines >= item.size())) +// selected = item.size() - 1; } void ui_menu::custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) @@ -762,7 +762,7 @@ void ui_menu::draw_text_box() // compute the multi-line target width/height machine().ui().draw_text_full(container, text, 0, 0, 1.0f - 2.0f * UI_BOX_LR_BORDER - 2.0f * gutter_width, - JUSTIFY_LEFT, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &target_width, &target_height); + JUSTIFY_LEFT, WRAP_WORD, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &target_width, &target_height); target_height += 2.0f * line_height; if (target_height > 1.0f - 2.0f * UI_BOX_TB_BORDER) target_height = floorf((1.0f - 2.0f * UI_BOX_TB_BORDER) / line_height) * line_height; @@ -787,20 +787,20 @@ void ui_menu::draw_text_box() // add a box around that machine().ui().draw_outlined_box(container, target_x - UI_BOX_LR_BORDER - gutter_width, - target_y - UI_BOX_TB_BORDER, - target_x + target_width + gutter_width + UI_BOX_LR_BORDER, - target_y + target_height + UI_BOX_TB_BORDER, - (item[0].flags & MENU_FLAG_REDTEXT) ? UI_RED_COLOR : UI_BACKGROUND_COLOR); + target_y - UI_BOX_TB_BORDER, + target_x + target_width + gutter_width + UI_BOX_LR_BORDER, + target_y + target_height + UI_BOX_TB_BORDER, + (item[0].flags & MENU_FLAG_REDTEXT) ? UI_RED_COLOR : UI_BACKGROUND_COLOR); machine().ui().draw_text_full(container, text, target_x, target_y, target_width, JUSTIFY_LEFT, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); // draw the "return to prior menu" text with a hilight behind it highlight(container, - target_x + 0.5f * UI_LINE_WIDTH, - target_y + target_height - line_height, - target_x + target_width - 0.5f * UI_LINE_WIDTH, - target_y + target_height, - UI_SELECTED_BG_COLOR); + target_x + 0.5f * UI_LINE_WIDTH, + target_y + target_height - line_height, + target_x + target_width - 0.5f * UI_LINE_WIDTH, + target_y + target_height, + UI_SELECTED_BG_COLOR); machine().ui().draw_text_full(container, backtext, target_x, target_y + target_height - line_height, target_width, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_SELECTED_COLOR, UI_SELECTED_BG_COLOR, nullptr, nullptr); @@ -1097,7 +1097,7 @@ void ui_menu::clear_free_list(running_machine &machine) /*************************************************************************** - MENU STACK MANAGEMENT + MENU STACK MANAGEMENT ***************************************************************************/ //------------------------------------------------- @@ -1167,7 +1167,7 @@ void ui_menu::do_handle() /*************************************************************************** - UI SYSTEM INTERACTION + UI SYSTEM INTERACTION ***************************************************************************/ //------------------------------------------------- @@ -1196,7 +1196,7 @@ UINT32 ui_menu::ui_handler(running_machine &machine, render_container *container } /*************************************************************************** - MENU HELPERS + MENU HELPERS ***************************************************************************/ //------------------------------------------------- @@ -1848,7 +1848,7 @@ void ui_menu::handle_main_keys(UINT32 flags) if (menu_event.iptkey == IPT_INVALID) for (int code = IPT_UI_FIRST + 1; code < IPT_UI_LAST; code++) { - if (ui_error || code == IPT_UI_CONFIGURE || (code == IPT_UI_LEFT && ignoreleft) || (code == IPT_UI_RIGHT && ignoreright) || (code == IPT_UI_PAUSE && ignorepause)) + if (ui_error || code == IPT_UI_CONFIGURE || (code == IPT_UI_LEFT && ignoreleft) || (code == IPT_UI_RIGHT && ignoreright) || (code == IPT_UI_PAUSE && ignorepause)) continue; if (exclusive_input_pressed(code, 0)) @@ -2768,4 +2768,4 @@ void ui_menu::draw_dats_menu() // return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow visitems = visible_lines - (top_line != 0) - (top_line + visible_lines != visible_items); -} \ No newline at end of file +} diff --git a/src/emu/ui/menu.h b/src/emu/ui/menu.h index d5f5e8a33e6..a19cb0b23dc 100644 --- a/src/emu/ui/menu.h +++ b/src/emu/ui/menu.h @@ -2,9 +2,9 @@ // copyright-holders:Nicola Salmoria, Aaron Giles, Nathan Woods /*************************************************************************** - ui/menu.h + ui/menu.h - Internal MAME menus for the user interface. + Internal MAME menus for the user interface. ***************************************************************************/ @@ -17,7 +17,7 @@ /*************************************************************************** - CONSTANTS + CONSTANTS ***************************************************************************/ // flags for menu items @@ -55,7 +55,7 @@ enum ui_menu_reset_options /*************************************************************************** - TYPE DEFINITIONS + TYPE DEFINITIONS ***************************************************************************/ // menu-related events @@ -255,7 +255,7 @@ protected: static render_texture *hilight_main_texture; private: static std::unique_ptr no_avail_bitmap, bgrnd_bitmap, star_bitmap; -// static std::unique_ptr hilight_main_bitmap; +// static std::unique_ptr hilight_main_bitmap; static render_texture *bgrnd_texture, *star_texture; static bitmap_argb32 *icons_bitmap[]; static render_texture *icons_texture[]; diff --git a/src/emu/ui/miscmenu.cpp b/src/emu/ui/miscmenu.cpp index 5d232729bd2..cd99d0b6820 100644 --- a/src/emu/ui/miscmenu.cpp +++ b/src/emu/ui/miscmenu.cpp @@ -651,7 +651,7 @@ void ui_menu_misc_options::custom_render(void *selectedref, float top, float bot ui_manager &mui = machine().ui(); mui.draw_text_full(container, _("Miscellaneous Options"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; float maxwidth = MAX(origx2 - origx1, width); @@ -671,5 +671,5 @@ void ui_menu_misc_options::custom_render(void *selectedref, float top, float bot // draw the text within it mui.draw_text_full(container, _("Miscellaneous Options"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } diff --git a/src/emu/ui/moptions.cpp b/src/emu/ui/moptions.cpp index 63c51d26438..4ab64fb38f7 100644 --- a/src/emu/ui/moptions.cpp +++ b/src/emu/ui/moptions.cpp @@ -19,61 +19,61 @@ const options_entry ui_options::s_option_entries[] = { // seach path options - { nullptr, nullptr, OPTION_HEADER, "UI SEARCH PATH OPTIONS" }, - { OPTION_HISTORY_PATH, "history;dats;.", OPTION_STRING, "path to history files" }, - { OPTION_EXTRAINI_PATH, "folders", OPTION_STRING, "path to extra ini files" }, - { OPTION_CABINETS_PATH, "cabinets;cabdevs", OPTION_STRING, "path to cabinets / devices image" }, - { OPTION_CPANELS_PATH, "cpanel", OPTION_STRING, "path to control panel image" }, - { OPTION_PCBS_PATH, "pcb", OPTION_STRING, "path to pcbs image" }, - { OPTION_FLYERS_PATH, "flyers", OPTION_STRING, "path to flyers image" }, - { OPTION_TITLES_PATH, "titles", OPTION_STRING, "path to titles image" }, - { OPTION_ENDS_PATH, "ends", OPTION_STRING, "path to ends image" }, - { OPTION_MARQUEES_PATH, "marquees", OPTION_STRING, "path to marquees image" }, - { OPTION_ARTPREV_PATH, "artwork preview", OPTION_STRING, "path to artwork preview image" }, - { OPTION_BOSSES_PATH, "bosses", OPTION_STRING, "path to bosses image" }, - { OPTION_LOGOS_PATH, "logo", OPTION_STRING, "path to logos image" }, - { OPTION_SCORES_PATH, "scores", OPTION_STRING, "path to scores image" }, - { OPTION_VERSUS_PATH, "versus", OPTION_STRING, "path to versus image" }, - { OPTION_GAMEOVER_PATH, "gameover", OPTION_STRING, "path to gameover image" }, - { OPTION_HOWTO_PATH, "howto", OPTION_STRING, "path to howto image" }, - { OPTION_SELECT_PATH, "select", OPTION_STRING, "path to select image" }, - { OPTION_ICONS_PATH, "icons", OPTION_STRING, "path to ICOns image" }, - { OPTION_UI_PATH, "ui", OPTION_STRING, "path to UI files" }, + { nullptr, nullptr, OPTION_HEADER, "UI SEARCH PATH OPTIONS" }, + { OPTION_HISTORY_PATH, "history;dats;.", OPTION_STRING, "path to history files" }, + { OPTION_EXTRAINI_PATH, "folders", OPTION_STRING, "path to extra ini files" }, + { OPTION_CABINETS_PATH, "cabinets;cabdevs", OPTION_STRING, "path to cabinets / devices image" }, + { OPTION_CPANELS_PATH, "cpanel", OPTION_STRING, "path to control panel image" }, + { OPTION_PCBS_PATH, "pcb", OPTION_STRING, "path to pcbs image" }, + { OPTION_FLYERS_PATH, "flyers", OPTION_STRING, "path to flyers image" }, + { OPTION_TITLES_PATH, "titles", OPTION_STRING, "path to titles image" }, + { OPTION_ENDS_PATH, "ends", OPTION_STRING, "path to ends image" }, + { OPTION_MARQUEES_PATH, "marquees", OPTION_STRING, "path to marquees image" }, + { OPTION_ARTPREV_PATH, "artwork preview", OPTION_STRING, "path to artwork preview image" }, + { OPTION_BOSSES_PATH, "bosses", OPTION_STRING, "path to bosses image" }, + { OPTION_LOGOS_PATH, "logo", OPTION_STRING, "path to logos image" }, + { OPTION_SCORES_PATH, "scores", OPTION_STRING, "path to scores image" }, + { OPTION_VERSUS_PATH, "versus", OPTION_STRING, "path to versus image" }, + { OPTION_GAMEOVER_PATH, "gameover", OPTION_STRING, "path to gameover image" }, + { OPTION_HOWTO_PATH, "howto", OPTION_STRING, "path to howto image" }, + { OPTION_SELECT_PATH, "select", OPTION_STRING, "path to select image" }, + { OPTION_ICONS_PATH, "icons", OPTION_STRING, "path to ICOns image" }, + { OPTION_UI_PATH, "ui", OPTION_STRING, "path to UI files" }, // misc options - { nullptr, nullptr, OPTION_HEADER, "UI MISC OPTIONS" }, - { OPTION_DATS_ENABLED, "1", OPTION_BOOLEAN, "enable DATs support" }, - { OPTION_REMEMBER_LAST, "1", OPTION_BOOLEAN, "reselect in main menu last played game" }, - { OPTION_ENLARGE_SNAPS, "1", OPTION_BOOLEAN, "enlarge arts (snapshot, title, etc...) in right panel (keeping aspect ratio)" }, - { OPTION_FORCED4X3, "1", OPTION_BOOLEAN, "force the appearance of the snapshot in the list software to 4:3" }, - { OPTION_USE_BACKGROUND, "1", OPTION_BOOLEAN, "enable background image in main view" }, - { OPTION_SKIP_BIOS_MENU, "0", OPTION_BOOLEAN, "skip bios submenu, start with configured or default" }, - { OPTION_SKIP_PARTS_MENU, "0", OPTION_BOOLEAN, "skip parts submenu, start with first part" }, - { OPTION_LAST_USED_FILTER, "", OPTION_STRING, "latest used filter" }, - { OPTION_LAST_USED_MACHINE, "", OPTION_STRING, "latest used machine" }, - { OPTION_INFO_AUTO_AUDIT, "0", OPTION_BOOLEAN, "enable auto audit in the general info panel" }, + { nullptr, nullptr, OPTION_HEADER, "UI MISC OPTIONS" }, + { OPTION_DATS_ENABLED, "1", OPTION_BOOLEAN, "enable DATs support" }, + { OPTION_REMEMBER_LAST, "1", OPTION_BOOLEAN, "reselect in main menu last played game" }, + { OPTION_ENLARGE_SNAPS, "1", OPTION_BOOLEAN, "enlarge arts (snapshot, title, etc...) in right panel (keeping aspect ratio)" }, + { OPTION_FORCED4X3, "1", OPTION_BOOLEAN, "force the appearance of the snapshot in the list software to 4:3" }, + { OPTION_USE_BACKGROUND, "1", OPTION_BOOLEAN, "enable background image in main view" }, + { OPTION_SKIP_BIOS_MENU, "0", OPTION_BOOLEAN, "skip bios submenu, start with configured or default" }, + { OPTION_SKIP_PARTS_MENU, "0", OPTION_BOOLEAN, "skip parts submenu, start with first part" }, + { OPTION_LAST_USED_FILTER, "", OPTION_STRING, "latest used filter" }, + { OPTION_LAST_USED_MACHINE, "", OPTION_STRING, "latest used machine" }, + { OPTION_INFO_AUTO_AUDIT, "0", OPTION_BOOLEAN, "enable auto audit in the general info panel" }, // UI options - { nullptr, nullptr, OPTION_HEADER, "UI OPTIONS" }, - { OPTION_INFOS_SIZE "(0.05-1.00)", "0.75", OPTION_FLOAT, "UI right panel infos text size (0.05 - 1.00)" }, - { OPTION_FONT_ROWS "(25-40)", "30", OPTION_INTEGER, "UI font text size (25 - 40)" }, - { OPTION_HIDE_PANELS "(0-3)", "0", OPTION_INTEGER, "UI hide left/right panel in main view (0 = Show all, 1 = hide left, 2 = hide right, 3 = hide both" }, - { OPTION_UI_BORDER_COLOR, "ffffffff", OPTION_STRING, "UI border color (ARGB)" }, - { OPTION_UI_BACKGROUND_COLOR, "ef101030", OPTION_STRING, "UI background color (ARGB)" }, - { OPTION_UI_CLONE_COLOR, "ff808080", OPTION_STRING, "UI clone color (ARGB)" }, - { OPTION_UI_DIPSW_COLOR, "ffffff00", OPTION_STRING, "UI dipswitch color (ARGB)" }, - { OPTION_UI_GFXVIEWER_BG_COLOR, "ef101030", OPTION_STRING, "UI gfx viewer color (ARGB)" }, - { OPTION_UI_MOUSEDOWN_BG_COLOR, "b0606000", OPTION_STRING, "UI mouse down bg color (ARGB)" }, - { OPTION_UI_MOUSEDOWN_COLOR, "ffffff80", OPTION_STRING, "UI mouse down color (ARGB)" }, - { OPTION_UI_MOUSEOVER_BG_COLOR, "70404000", OPTION_STRING, "UI mouse over bg color (ARGB)" }, - { OPTION_UI_MOUSEOVER_COLOR, "ffffff80", OPTION_STRING, "UI mouse over color (ARGB)" }, - { OPTION_UI_SELECTED_BG_COLOR, "ef808000", OPTION_STRING, "UI selected bg color (ARGB)" }, - { OPTION_UI_SELECTED_COLOR, "ffffff00", OPTION_STRING, "UI selected color (ARGB)" }, - { OPTION_UI_SLIDER_COLOR, "ffffffff", OPTION_STRING, "UI slider color (ARGB)" }, - { OPTION_UI_SUBITEM_COLOR, "ffffffff", OPTION_STRING, "UI subitem color (ARGB)" }, - { OPTION_UI_TEXT_BG_COLOR, "ef000000", OPTION_STRING, "UI text bg color (ARGB)" }, - { OPTION_UI_TEXT_COLOR, "ffffffff", OPTION_STRING, "UI text color (ARGB)" }, - { OPTION_UI_UNAVAILABLE_COLOR, "ff404040", OPTION_STRING, "UI unavailable color (ARGB)" }, + { nullptr, nullptr, OPTION_HEADER, "UI OPTIONS" }, + { OPTION_INFOS_SIZE "(0.05-1.00)", "0.75", OPTION_FLOAT, "UI right panel infos text size (0.05 - 1.00)" }, + { OPTION_FONT_ROWS "(25-40)", "30", OPTION_INTEGER, "UI font text size (25 - 40)" }, + { OPTION_HIDE_PANELS "(0-3)", "0", OPTION_INTEGER, "UI hide left/right panel in main view (0 = Show all, 1 = hide left, 2 = hide right, 3 = hide both" }, + { OPTION_UI_BORDER_COLOR, "ffffffff", OPTION_STRING, "UI border color (ARGB)" }, + { OPTION_UI_BACKGROUND_COLOR, "ef101030", OPTION_STRING, "UI background color (ARGB)" }, + { OPTION_UI_CLONE_COLOR, "ff808080", OPTION_STRING, "UI clone color (ARGB)" }, + { OPTION_UI_DIPSW_COLOR, "ffffff00", OPTION_STRING, "UI dipswitch color (ARGB)" }, + { OPTION_UI_GFXVIEWER_BG_COLOR, "ef101030", OPTION_STRING, "UI gfx viewer color (ARGB)" }, + { OPTION_UI_MOUSEDOWN_BG_COLOR, "b0606000", OPTION_STRING, "UI mouse down bg color (ARGB)" }, + { OPTION_UI_MOUSEDOWN_COLOR, "ffffff80", OPTION_STRING, "UI mouse down color (ARGB)" }, + { OPTION_UI_MOUSEOVER_BG_COLOR, "70404000", OPTION_STRING, "UI mouse over bg color (ARGB)" }, + { OPTION_UI_MOUSEOVER_COLOR, "ffffff80", OPTION_STRING, "UI mouse over color (ARGB)" }, + { OPTION_UI_SELECTED_BG_COLOR, "ef808000", OPTION_STRING, "UI selected bg color (ARGB)" }, + { OPTION_UI_SELECTED_COLOR, "ffffff00", OPTION_STRING, "UI selected color (ARGB)" }, + { OPTION_UI_SLIDER_COLOR, "ffffffff", OPTION_STRING, "UI slider color (ARGB)" }, + { OPTION_UI_SUBITEM_COLOR, "ffffffff", OPTION_STRING, "UI subitem color (ARGB)" }, + { OPTION_UI_TEXT_BG_COLOR, "ef000000", OPTION_STRING, "UI text bg color (ARGB)" }, + { OPTION_UI_TEXT_COLOR, "ffffffff", OPTION_STRING, "UI text color (ARGB)" }, + { OPTION_UI_UNAVAILABLE_COLOR, "ff404040", OPTION_STRING, "UI unavailable color (ARGB)" }, { nullptr } }; diff --git a/src/emu/ui/optsmenu.cpp b/src/emu/ui/optsmenu.cpp index 54e269bf4ed..29ada94b08e 100644 --- a/src/emu/ui/optsmenu.cpp +++ b/src/emu/ui/optsmenu.cpp @@ -52,8 +52,8 @@ void ui_menu_game_options::handle() bool changed = false; // process the menu -// ui_menu::menu_stack->parent->process(UI_MENU_PROCESS_NOINPUT); -// const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT | UI_MENU_PROCESS_NOIMAGE); +// ui_menu::menu_stack->parent->process(UI_MENU_PROCESS_NOINPUT); +// const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT | UI_MENU_PROCESS_NOIMAGE); const ui_menu_event *m_event = process(UI_MENU_PROCESS_LR_REPEAT); if (m_event != nullptr && m_event->itemref != nullptr) @@ -191,8 +191,8 @@ void ui_menu_game_options::handle() void ui_menu_game_options::populate() { - if (strcmp(machine().options().ui(),"simple")!=0) - { + if (strcmp(machine().options().ui(),"simple")!=0) + { // set filter arrow std::string fbuff; @@ -265,7 +265,7 @@ void ui_menu_game_options::custom_render(void *selectedref, float top, float bot float width; ui_manager &mui = machine().ui(); mui.draw_text_full(container, _("Settings"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; float maxwidth = MAX(origx2 - origx1, width); @@ -285,7 +285,7 @@ void ui_menu_game_options::custom_render(void *selectedref, float top, float bot // draw the text within it mui.draw_text_full(container, _("Settings"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } //------------------------------------------------- diff --git a/src/emu/ui/selector.cpp b/src/emu/ui/selector.cpp index f4c94e6bc2d..ae786dd1834 100644 --- a/src/emu/ui/selector.cpp +++ b/src/emu/ui/selector.cpp @@ -18,7 +18,7 @@ // ctor / dtor //------------------------------------------------- -ui_menu_selector::ui_menu_selector(running_machine &machine, render_container *container, std::vector s_sel, UINT16 &s_actual, int category, int _hover) +ui_menu_selector::ui_menu_selector(running_machine &machine, render_container *container, std::vector s_sel, UINT16 &s_actual, int category, int _hover) : ui_menu(machine, container), m_selector(s_actual) { m_category = category; @@ -152,7 +152,7 @@ void ui_menu_selector::custom_render(void *selectedref, float top, float bottom, std::string tempbuf = std::string(_("Selection List - Search: ")).append(m_search).append("_"); // get the size of the text - mui.draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, + mui.draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += (2.0f * UI_BOX_LR_BORDER) + 0.01f; float maxwidth = MAX(width, origx2 - origx1); @@ -172,7 +172,7 @@ void ui_menu_selector::custom_render(void *selectedref, float top, float bottom, y1 += UI_BOX_TB_BORDER; // draw the text within it - mui.draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, + mui.draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); // bottom text @@ -180,7 +180,7 @@ void ui_menu_selector::custom_render(void *selectedref, float top, float bottom, std::string ui_select_text = machine().input().seq_name(machine().ioport().type_seq(IPT_UI_SELECT, 0, SEQ_TYPE_STANDARD)); tempbuf.assign(_("Double click or press ")).append(ui_select_text).append(_(" to select")); - mui.draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, + mui.draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); @@ -200,7 +200,7 @@ void ui_menu_selector::custom_render(void *selectedref, float top, float bottom, y1 += UI_BOX_TB_BORDER; // draw the text within it - mui.draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, + mui.draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } diff --git a/src/emu/ui/selgame.cpp b/src/emu/ui/selgame.cpp index e950c96b1b9..8aebd63772b 100644 --- a/src/emu/ui/selgame.cpp +++ b/src/emu/ui/selgame.cpp @@ -131,7 +131,7 @@ void save_main_option(running_machine &machine) for (emu_options::entry *f_entry = machine.options().first(); f_entry != nullptr; f_entry = f_entry->next()) { - if (f_entry->is_changed()) + if (f_entry->is_changed()) { options.set_value(f_entry->name(), f_entry->value(), OPTION_PRIORITY_CMDLINE, error_string); } @@ -150,7 +150,7 @@ void save_main_option(running_machine &machine) else { machine.popmessage("**Error to save %s.ini**", emulator_info::get_configname()); return; - } + } } machine.ui().popup_time(3, "\n Configuration saved \n\n"); } @@ -484,7 +484,7 @@ void ui_menu_select_game::handle() // if we're in an error state, overlay an error message if (ui_error) - machine().ui().draw_text_box(container, "The selected machine is missing one or more required ROM or CHD images. " + machine().ui().draw_text_box(container, "The selected machine is missing one or more required ROM or CHD images. " "Please select a different machine.\n\nPress any key (except ESC) to continue.", JUSTIFY_CENTER, 0.5f, 0.5f, UI_RED_COLOR); // handle filters selection from key shortcuts @@ -723,7 +723,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott ui_manager &mui = machine().ui(); float tbarspace = mui.get_line_height(); - strprintf(tempbuf[0], "MAME %s ( %d / %d machines (%d BIOS) )", bare_build_version, visible_items, (driver_list::total() - 1), m_isabios); + strprintf(tempbuf[0], "MAME %s ( %d / %d machines (%d BIOS) )", bare_build_version, visible_items, (driver_list::total() - 1), m_isabios); std::string filtered; if (main_filters::actual == FILTER_CATEGORY && !machine().inifile().ini_index.empty()) @@ -749,7 +749,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott for (int line = 0; line < 2; ++line) { mui.draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(width, maxwidth); } @@ -771,7 +771,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott // draw the text within it for (int line = 0; line < 2; ++line) { - mui.draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, + mui.draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); y1 += mui.get_line_height(); } @@ -828,7 +828,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott color = UI_GREEN_COLOR; if ((driver->flags & (MACHINE_IMPERFECT_GRAPHICS | MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_COLORS - | MACHINE_NO_SOUND | MACHINE_IMPERFECT_SOUND)) != 0) + | MACHINE_NO_SOUND | MACHINE_IMPERFECT_SOUND)) != 0) color = UI_YELLOW_COLOR; if ((driver->flags & (MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION)) != 0) @@ -896,7 +896,7 @@ void ui_menu_select_game::custom_render(void *selectedref, float top, float bott for (auto & elem : tempbuf) { - mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, + mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); @@ -968,7 +968,7 @@ void ui_menu_select_game::inkey_select(const ui_menu_event *m_event) ui_menu::stack_push(global_alloc_clear(machine(), container)); // anything else is a driver else if ((FPTR)driver == 3) { - save_main_option(machine()); + save_main_option(machine()); } // anything else is a driver else @@ -1413,7 +1413,7 @@ void ui_menu_select_game::populate_search() if (cx != -1 && ((driver_list::driver(cx).flags & MACHINE_IS_BIOS_ROOT) != 0)) cloneof = false; } - item_append(m_searchlist[curitem]->description, nullptr, (!cloneof) ? flags_ui : (MENU_FLAG_INVERT | flags_ui), + item_append(m_searchlist[curitem]->description, nullptr, (!cloneof) ? flags_ui : (MENU_FLAG_INVERT | flags_ui), (void *)m_searchlist[curitem]); } } @@ -1758,11 +1758,11 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y hover = phover + filter; } -/* if (afilter == filter) - { - bgcolor = UI_SELECTED_BG_COLOR; - fgcolor = UI_SELECTED_COLOR; - } +/* if (afilter == filter) + { + bgcolor = UI_SELECTED_BG_COLOR; + fgcolor = UI_SELECTED_COLOR; + } */ if (bgcolor != UI_TEXT_BG_COLOR) container->add_rect(x1, y1, x2, y1 + line_height_max, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE)); @@ -1797,7 +1797,7 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y convert_command_glyph(str); } - mui.draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER, + mui.draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER, DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size); y1 += line_height_max; } @@ -1905,13 +1905,13 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or for (int x = UI_FIRST_LOAD; x < UI_LAST_LOAD; ++x) { - mui.draw_text_full(container, dats_info[x], origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, + mui.draw_text_full(container, dats_info[x], origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_lenght, nullptr); txt_lenght += 0.01f; title_size = MAX(txt_lenght, title_size); } - mui.draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, + mui.draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::curdats_view, UI_FIRST_LOAD, UI_LAST_LOAD, title_size); @@ -1948,7 +1948,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or if (buffer.empty()) { - mui.draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER, + mui.draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER, WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); return; } @@ -2002,7 +2002,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &item_width, nullptr, tmp_size); mui.draw_text_full(container, last_part.c_str(), effective_left + item_width, oy1, - origx2 - origx1 - 2.0f * gutter_width - item_width, JUSTIFY_RIGHT, WRAP_TRUNCATE, + origx2 - origx1 - 2.0f * gutter_width - item_width, JUSTIFY_RIGHT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size); } } @@ -2022,18 +2022,18 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or std::string first_part(tempbuf.substr(0, first_dspace)); std::string last_part(tempbuf.substr(first_dspace + 1)); strtrimspace(last_part); - mui.draw_text_full(container, first_part.c_str(), effective_left, oy1, effective_width, JUSTIFY_LEFT, + mui.draw_text_full(container, first_part.c_str(), effective_left, oy1, effective_width, JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size); - mui.draw_text_full(container, last_part.c_str(), effective_left, oy1, origx2 - origx1 - 2.0f * gutter_width, + mui.draw_text_full(container, last_part.c_str(), effective_left, oy1, origx2 - origx1 - 2.0f * gutter_width, JUSTIFY_RIGHT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size); } else - mui.draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT, + mui.draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, tmp_size); } else - mui.draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT, + mui.draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size); oy1 += (line_height * text_size); @@ -2065,13 +2065,13 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or for (auto & elem: t_text) { - mui.draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE, + mui.draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_lenght, nullptr); txt_lenght += 0.01f; title_size = MAX(txt_lenght, title_size); } - mui.draw_text_full(container, t_text[ui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1, + mui.draw_text_full(container, t_text[ui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::cur_sw_dats_view, 0, 1, title_size); @@ -2122,7 +2122,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or else if (r == r_visible_lines - 1 && itemline != totallines - 1) info_arrow(1, origx1, origx2, oy1, line_height, text_size, ud_arrow_width); else - mui.draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT, + mui.draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr, text_size); oy1 += (line_height * text_size); } diff --git a/src/emu/ui/selsoft.cpp b/src/emu/ui/selsoft.cpp index 3122f286917..ad374bb9b83 100644 --- a/src/emu/ui/selsoft.cpp +++ b/src/emu/ui/selsoft.cpp @@ -1,4 +1,4 @@ -// license:BSD-3-Clause +// license:BSD-3-Clause // copyright-holders:Dankan1890 /*************************************************************************** @@ -29,9 +29,9 @@ std::string reselect_last::software; std::string reselect_last::swlist; bool reselect_last::m_reselect = false; static const char *region_lists[] = { "arab", "arg", "asia", "aus", "aut", "bel", "blr", "bra", "can", "chi", "chn", "cze", "den", - "ecu", "esp", "euro", "fin", "fra", "gbr", "ger", "gre", "hkg", "hun", "irl", "isr", - "isv", "ita", "jpn", "kaz", "kor", "lat", "lux", "mex", "ned", "nld", "nor", "nzl", - "pol", "rus", "slo", "spa", "sui", "swe", "tha", "tpe", "tw", "uk", "ukr", "usa" }; + "ecu", "esp", "euro", "fin", "fra", "gbr", "ger", "gre", "hkg", "hun", "irl", "isr", + "isv", "ita", "jpn", "kaz", "kor", "lat", "lux", "mex", "ned", "nld", "nor", "nzl", + "pol", "rus", "slo", "spa", "sui", "swe", "tha", "tpe", "tw", "uk", "ukr", "usa" }; //------------------------------------------------- // compares two items in the software list and @@ -424,7 +424,7 @@ void ui_menu_select_software::populate() old_software = m_has_empty_start ? curitem + 1 : curitem; item_append(m_displaylist[curitem]->longname.c_str(), m_displaylist[curitem]->devicetype.c_str(), - m_displaylist[curitem]->parentname.empty() ? flags_ui : (MENU_FLAG_INVERT | flags_ui), (void *)m_displaylist[curitem]); + m_displaylist[curitem]->parentname.empty() ? flags_ui : (MENU_FLAG_INVERT | flags_ui), (void *)m_displaylist[curitem]); } } @@ -434,8 +434,8 @@ void ui_menu_select_software::populate() for (int curitem = 0; m_searchlist[curitem] != nullptr; ++curitem) item_append(m_searchlist[curitem]->longname.c_str(), m_searchlist[curitem]->devicetype.c_str(), - m_searchlist[curitem]->parentname.empty() ? flags_ui : (MENU_FLAG_INVERT | flags_ui), - (void *)m_searchlist[curitem]); + m_searchlist[curitem]->parentname.empty() ? flags_ui : (MENU_FLAG_INVERT | flags_ui), + (void *)m_searchlist[curitem]); } item_append(MENU_SEPARATOR_ITEM, nullptr, flags_ui, nullptr); @@ -636,7 +636,7 @@ void ui_menu_select_software::custom_render(void *selectedref, float top, float for (int line = 0; line < 3; ++line) { mui.draw_text_full(container, tempbuf[line].c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(width, maxwidth); } @@ -659,7 +659,7 @@ void ui_menu_select_software::custom_render(void *selectedref, float top, float for (int line = 0; line < 3; ++line) { mui.draw_text_full(container, tempbuf[line].c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); y1 += mui.get_line_height(); } @@ -781,7 +781,7 @@ void ui_menu_select_software::custom_render(void *selectedref, float top, float for (auto & elem : tempbuf) { mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; maxwidth = MAX(maxwidth, width); } @@ -808,7 +808,7 @@ void ui_menu_select_software::custom_render(void *selectedref, float top, float for (auto & elem : tempbuf) { mui.draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); y1 += machine().ui().get_line_height(); } } @@ -1088,7 +1088,6 @@ std::string c_sw_publisher::getname(std::string &str) //------------------------------------------------- void ui_menu_select_software::build_list(std::vector &s_drivers, const char *filter_text, int filter) { - if (s_drivers.empty() && filter == -1) { filter = sw_filters::actual; @@ -1319,11 +1318,11 @@ float ui_menu_select_software::draw_left_panel(float x1, float y1, float x2, flo hover = phover + filter; } -/* if (afilter == filter) - { - bgcolor = UI_SELECTED_BG_COLOR; - fgcolor = UI_SELECTED_COLOR; - } +/* if (afilter == filter) + { + bgcolor = UI_SELECTED_BG_COLOR; + fgcolor = UI_SELECTED_COLOR; + } */ if (bgcolor != UI_TEXT_BG_COLOR) container->add_rect(x1, y1, x2, y1 + line_height, bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE)); @@ -1359,7 +1358,7 @@ float ui_menu_select_software::draw_left_panel(float x1, float y1, float x2, flo } mui.draw_text_full(container, str.c_str(), x1t, y1, x2 - x1, JUSTIFY_LEFT, WRAP_NEVER, - DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size); + DRAW_NORMAL, fgcolor, bgcolor, nullptr, nullptr, text_size); y1 += line_height; } @@ -1439,7 +1438,7 @@ void ui_menu_select_software::infos_render(void *selectedref, float origx1, floa if (soft && soft->usage.empty()) { mui.draw_text_full(container, _("History"), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); ui_globals::cur_sw_dats_view = 0; } else @@ -1453,14 +1452,14 @@ void ui_menu_select_software::infos_render(void *selectedref, float origx1, floa for (auto & elem : t_text) { mui.draw_text_full(container, elem.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_lenght, nullptr); + DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_lenght, nullptr); txt_lenght += 0.01f; title_size = MAX(txt_lenght, title_size); } mui.draw_text_full(container, t_text[ui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1, - JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, - nullptr, nullptr); + JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, + nullptr, nullptr); draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::cur_sw_dats_view, 0, 1, title_size); } @@ -1484,7 +1483,7 @@ void ui_menu_select_software::infos_render(void *selectedref, float origx1, floa if (buffer.empty()) { mui.draw_text_full(container, _("No Infos Available"), origx1, (origy2 + origy1) * 0.5f, origx2 - origx1, JUSTIFY_CENTER, - WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); return; } else @@ -1512,8 +1511,8 @@ void ui_menu_select_software::infos_render(void *selectedref, float origx1, floa info_arrow(1, origx1, origx2, oy1, line_height, text_size, ud_arrow_width); else mui.draw_text_full(container, tempbuf.c_str(), origx1 + gutter_width, oy1, origx2 - origx1, - JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, - nullptr, nullptr, text_size); + JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, + nullptr, nullptr, text_size); oy1 += (line_height * text_size); } @@ -1820,7 +1819,7 @@ void ui_software_parts::custom_render(void *selectedref, float top, float bottom float width; ui_manager &mui = machine().ui(); mui.draw_text_full(container, _("Software part selection:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; float maxwidth = MAX(origx2 - origx1, width); @@ -1840,7 +1839,7 @@ void ui_software_parts::custom_render(void *selectedref, float top, float bottom // draw the text within it mui.draw_text_full(container, _("Software part selection:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } //------------------------------------------------- @@ -1958,7 +1957,7 @@ void ui_bios_selection::custom_render(void *selectedref, float top, float bottom float width; ui_manager &mui = machine().ui(); mui.draw_text_full(container, _("Bios selection:"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; float maxwidth = MAX(origx2 - origx1, width); @@ -1978,5 +1977,5 @@ void ui_bios_selection::custom_render(void *selectedref, float top, float bottom // draw the text within it mui.draw_text_full(container, _("Bios selection:"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } diff --git a/src/emu/ui/sndmenu.cpp b/src/emu/ui/sndmenu.cpp index 37134f8db25..cc5e8490406 100644 --- a/src/emu/ui/sndmenu.cpp +++ b/src/emu/ui/sndmenu.cpp @@ -150,7 +150,7 @@ void ui_menu_sound_options::custom_render(void *selectedref, float top, float bo float width; ui_manager &mui = machine().ui(); mui.draw_text_full(container, _("Sound Options"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); + DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); width += 2 * UI_BOX_LR_BORDER; float maxwidth = MAX(origx2 - origx1, width); @@ -170,5 +170,5 @@ void ui_menu_sound_options::custom_render(void *selectedref, float top, float bo // draw the text within it mui.draw_text_full(container, _("Sound Options"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, - DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); + DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); } diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp index f3ce51feea6..b474c7c61f6 100644 --- a/src/emu/ui/ui.cpp +++ b/src/emu/ui/ui.cpp @@ -1698,12 +1698,12 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co if (machine.ui_input().pressed(IPT_UI_PAUSE)) { // with a shift key, it is single step -// if (is_paused && (machine.input().code_pressed(KEYCODE_LSHIFT) || machine.input().code_pressed(KEYCODE_RSHIFT))) -// { -// machine.ui().set_single_step(true); -// machine.resume(); -// } -// else +// if (is_paused && (machine.input().code_pressed(KEYCODE_LSHIFT) || machine.input().code_pressed(KEYCODE_RSHIFT))) +// { +// machine.ui().set_single_step(true); +// machine.resume(); +// } +// else machine.toggle_pause(); } @@ -2702,8 +2702,8 @@ int ui_manager::wrap_text(render_container *container, const char *origs, float if (curwidth > maxwidth) maxwidth = curwidth; - xstart.push_back(linestart - origs); - xend.push_back(s - origs); + xstart.push_back(linestart - origs); + xend.push_back(s - origs); // loop from the line start and add the characters while (linestart < s) diff --git a/src/emu/ui/ui.h b/src/emu/ui/ui.h index ffd2fddc371..81034500733 100644 --- a/src/emu/ui/ui.h +++ b/src/emu/ui/ui.h @@ -103,9 +103,9 @@ struct slider_state INT32 defval; /* default value */ INT32 maxval; /* maximum value */ INT32 incval; /* increment value */ - bool hidden; /* hidden or not */ - INT32 id; /* unique identifier */ - char description[1]; /* textual description */ + bool hidden; /* hidden or not */ + INT32 id; /* unique identifier */ + char description[1]; /* textual description */ }; @@ -114,111 +114,111 @@ struct slider_state class ui_manager { public: - // construction/destruction - ui_manager(running_machine &machine); + // construction/destruction + ui_manager(running_machine &machine); void init(); - // getters - running_machine &machine() const { return m_machine; } - bool single_step() const { return m_single_step; } + // getters + running_machine &machine() const { return m_machine; } + bool single_step() const { return m_single_step; } ui_options &options() { return m_ui_options; } - // setters - void set_single_step(bool single_step) { m_single_step = single_step; } - - // methods - void initialize(running_machine &machine); - UINT32 set_handler(ui_callback callback, UINT32 param); - void display_startup_screens(bool first_time, bool show_disclaimer); - void set_startup_text(const char *text, bool force); - void update_and_render(render_container *container); - render_font *get_font(); - float get_line_height(); - float get_char_width(unicode_char ch); - float get_string_width(const char *s); - void draw_outlined_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t backcolor); - void draw_outlined_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t fgcolor, rgb_t bgcolor); - void draw_text(render_container *container, const char *buf, float x, float y); + // setters + void set_single_step(bool single_step) { m_single_step = single_step; } + + // methods + void initialize(running_machine &machine); + UINT32 set_handler(ui_callback callback, UINT32 param); + void display_startup_screens(bool first_time, bool show_disclaimer); + void set_startup_text(const char *text, bool force); + void update_and_render(render_container *container); + render_font *get_font(); + float get_line_height(); + float get_char_width(unicode_char ch); + float get_string_width(const char *s); + void draw_outlined_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t backcolor); + void draw_outlined_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t fgcolor, rgb_t bgcolor); + void draw_text(render_container *container, const char *buf, float x, float y); void draw_text_full(render_container *container, const char *origs, float x, float y, float origwrapwidth, int justify, int wrap, int draw, rgb_t fgcolor, rgb_t bgcolor, float *totalwidth = nullptr, float *totalheight = nullptr, float text_size = 1.0f); void draw_text_box(render_container *container, const char *text, int justify, float xpos, float ypos, rgb_t backcolor); - void draw_message_window(render_container *container, const char *text); - - void CLIB_DECL popup_time(int seconds, const char *text, ...) ATTR_PRINTF(3,4); - void show_fps_temp(double seconds); - void set_show_fps(bool show); - bool show_fps() const; - bool show_fps_counter(); - void set_show_profiler(bool show); - bool show_profiler() const; - void show_menu(); - void show_mouse(bool status); - bool is_menu_active(); - bool can_paste(); - void paste(); - bool use_natural_keyboard() const; - void set_use_natural_keyboard(bool use_natural_keyboard); - void image_handler_ingame(); - void increase_frameskip(); - void decrease_frameskip(); - void request_quit(); - - // print the game info string into a buffer - std::string &game_info_astring(std::string &str); - - // slider controls - const slider_state *get_slider_list(void); - - // other - void process_natural_keyboard(); - - void set_show_timecode_counter(bool value) { m_show_timecode_counter = value; m_show_timecode_total = true; } - bool show_timecode_counter(); - bool show_timecode_total(); + void draw_message_window(render_container *container, const char *text); + + void CLIB_DECL popup_time(int seconds, const char *text, ...) ATTR_PRINTF(3,4); + void show_fps_temp(double seconds); + void set_show_fps(bool show); + bool show_fps() const; + bool show_fps_counter(); + void set_show_profiler(bool show); + bool show_profiler() const; + void show_menu(); + void show_mouse(bool status); + bool is_menu_active(); + bool can_paste(); + void paste(); + bool use_natural_keyboard() const; + void set_use_natural_keyboard(bool use_natural_keyboard); + void image_handler_ingame(); + void increase_frameskip(); + void decrease_frameskip(); + void request_quit(); + + // print the game info string into a buffer + std::string &game_info_astring(std::string &str); + + // slider controls + const slider_state *get_slider_list(void); + + // other + void process_natural_keyboard(); + + void set_show_timecode_counter(bool value) { m_show_timecode_counter = value; m_show_timecode_total = true; } + bool show_timecode_counter(); + bool show_timecode_total(); // word wrap - int wrap_text(render_container *container, const char *origs, float x, float y, float origwrapwidth, std::vector &xstart, std::vector &xend, float text_size = 1.0f); + int wrap_text(render_container *container, const char *origs, float x, float y, float origwrapwidth, std::vector &xstart, std::vector &xend, float text_size = 1.0f); - // draw an outlined box with given line color and filled with a texture - void draw_textured_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture = nullptr, UINT32 flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); + // draw an outlined box with given line color and filled with a texture + void draw_textured_box(render_container *container, float x0, float y0, float x1, float y1, rgb_t backcolor, rgb_t linecolor, render_texture *texture = nullptr, UINT32 flags = PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); - // return text string width with given text size - float get_string_width_ex(const char *s, float text_size); + // return text string width with given text size + float get_string_width_ex(const char *s, float text_size); private: - // instance variables - running_machine & m_machine; - render_font * m_font; - ui_callback m_handler_callback; - UINT32 m_handler_param; - bool m_single_step; - bool m_showfps; - osd_ticks_t m_showfps_end; - bool m_show_profiler; - osd_ticks_t m_popup_text_end; - bool m_use_natural_keyboard; + // instance variables + running_machine & m_machine; + render_font * m_font; + ui_callback m_handler_callback; + UINT32 m_handler_param; + bool m_single_step; + bool m_showfps; + osd_ticks_t m_showfps_end; + bool m_show_profiler; + osd_ticks_t m_popup_text_end; + bool m_use_natural_keyboard; std::unique_ptr m_non_char_keys_down; - render_texture * m_mouse_arrow_texture; - bool m_mouse_show; - bool m_show_timecode_counter; + render_texture * m_mouse_arrow_texture; + bool m_mouse_show; + bool m_show_timecode_counter; bool m_show_timecode_total; bool m_load_save_hold; ui_options m_ui_options; - // text generators - std::string &disclaimer_string(std::string &buffer); - std::string &warnings_string(std::string &buffer); + // text generators + std::string &disclaimer_string(std::string &buffer); + std::string &warnings_string(std::string &buffer); - // UI handlers - static UINT32 handler_messagebox(running_machine &machine, render_container *container, UINT32 state); - static UINT32 handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state); - static UINT32 handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state); - static UINT32 handler_ingame(running_machine &machine, render_container *container, UINT32 state); - static UINT32 handler_load_save(running_machine &machine, render_container *container, UINT32 state); - static UINT32 handler_confirm_quit(running_machine &machine, render_container *container, UINT32 state); + // UI handlers + static UINT32 handler_messagebox(running_machine &machine, render_container *container, UINT32 state); + static UINT32 handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state); + static UINT32 handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state); + static UINT32 handler_ingame(running_machine &machine, render_container *container, UINT32 state); + static UINT32 handler_load_save(running_machine &machine, render_container *container, UINT32 state); + static UINT32 handler_confirm_quit(running_machine &machine, render_container *container, UINT32 state); - // private methods - void exit(); + // private methods + void exit(); }; diff --git a/src/emu/ui/utils.cpp b/src/emu/ui/utils.cpp index 7ac94d5e050..333ee95971a 100644 --- a/src/emu/ui/utils.cpp +++ b/src/emu/ui/utils.cpp @@ -25,7 +25,7 @@ std::vector c_mnfct::ui; // Main filters UINT16 main_filters::actual = 0; -const char *main_filters::text[] = { "All", "Available", "Unavailable", "Working", "Not Working", "Mechanical", "Not Mechanical", +const char *main_filters::text[] = { "All", "Available", "Unavailable", "Working", "Not Working", "Mechanical", "Not Mechanical", "Category", "Favorites", "BIOS", "Originals", "Clones", "Manufacturers", "Years", "Support Save", "Not Support Save", "CHD", "No CHD", "Vertical", "Horizontal", "Custom" }; size_t main_filters::length = ARRAY_LENGTH(main_filters::text); -- cgit v1.2.3-70-g09d2