diff options
author | 2016-03-13 13:54:57 +1100 | |
---|---|---|
committer | 2016-03-14 18:55:00 +1100 | |
commit | 42fbb9c3967fcda37f2d9ae17d5796a79cf027b9 (patch) | |
tree | a43047ee00431e5e22bfc5f8f612ff775586e415 /src/emu/ui/selgame.cpp | |
parent | 5fc27747031b6ed6f6c0582502098ebfb960be67 (diff) |
Make osd_file a polymorphic class that's held with smart pointers
Make avi_file a class that's held with smart pointers, encapsulate various AVI I/O structures
Make zip_file and _7z_file classes rather than having free functions everywhere
Hide zip/7z class implementation behind an interface, no longer need to call close() to send back to the cache
Don't dump as much crap in global namespace
Add solaris PTY implementation
Improve variable expansion for SDL OSD - supports ~/$FOO/${BAR} syntax
Rearrange stuff so the same things are in file module for all OSDs
Move file stuff into its own module
7z/zip open and destruct are still not thread-safe due to lack of interlocks around cache access
Directory functions still need to be moved to file module
SDL OSD may not initialise WinSock on Windows
Diffstat (limited to 'src/emu/ui/selgame.cpp')
-rw-r--r-- | src/emu/ui/selgame.cpp | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/emu/ui/selgame.cpp b/src/emu/ui/selgame.cpp index d0beab50bcc..023ca72b470 100644 --- a/src/emu/ui/selgame.cpp +++ b/src/emu/ui/selgame.cpp @@ -34,13 +34,13 @@ extern const char UI_VERSION_TAG[]; static bool first_start = true; -static const char *dats_info[] = { - __("General Info"), - __("History"), - __("Mameinfo"), - __("Sysinfo"), - __("Messinfo"), - __("Command"), +static const char *dats_info[] = { + __("General Info"), + __("History"), + __("Mameinfo"), + __("Sysinfo"), + __("Messinfo"), + __("Command"), __("Mamescore") }; std::vector<const game_driver *> ui_menu_select_game::m_sortedlist; @@ -505,7 +505,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 @@ -839,7 +839,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); } @@ -861,7 +861,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(); } @@ -918,7 +918,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) @@ -986,7 +986,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); @@ -1549,7 +1549,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]); } } @@ -1694,7 +1694,7 @@ bool ui_menu_select_game::load_available_machines() { // try to load available drivers from file emu_file file(machine().ui().options().ui_path(), OPEN_FLAG_READ); - if (file.open(emulator_info::get_configname(), "_avail.ini") != FILERR_NONE) + if (file.open(emulator_info::get_configname(), "_avail.ini") != osd_file::error::NONE) return false; std::string readbuf; @@ -1746,7 +1746,7 @@ void ui_menu_select_game::load_custom_filters() { // attempt to open the output file emu_file file(machine().ui().options().ui_path(), OPEN_FLAG_READ); - if (file.open("custom_", emulator_info::get_configname(), "_filter.ini") == FILERR_NONE) + if (file.open("custom_", emulator_info::get_configname(), "_filter.ini") == osd_file::error::NONE) { char buffer[MAX_CHAR_INFO]; @@ -1902,7 +1902,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; } @@ -2006,14 +2006,14 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or // apply title to right panel float title_size = 0.0f; - float txt_lenght = 0.0f; + float txt_length = 0.0f; 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, - WRAP_NEVER, DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_lenght, nullptr); - txt_lenght += 0.01f; - title_size = MAX(txt_lenght, title_size); + WRAP_NEVER, DRAW_NONE, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, &txt_length, nullptr); + txt_length += 0.01f; + title_size = (std::max)(txt_length, title_size); } rgb_t fgcolor = UI_TEXT_COLOR; @@ -2072,7 +2072,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; } @@ -2126,7 +2126,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); } } @@ -2146,18 +2146,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); @@ -2182,17 +2182,17 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or else { float title_size = 0.0f; - float txt_lenght = 0.0f; + float txt_length = 0.0f; std::string t_text[2]; t_text[0] = _("History"); t_text[1] = _("Usage"); 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); - txt_lenght += 0.01f; - title_size = MAX(txt_lenght, title_size); + 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_length, nullptr); + txt_length += 0.01f; + title_size = (std::max)(txt_length, title_size); } rgb_t fgcolor = UI_TEXT_COLOR; @@ -2260,7 +2260,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); } |