diff options
author | 2019-01-14 04:55:29 +1100 | |
---|---|---|
committer | 2019-01-15 03:56:30 +1100 | |
commit | ae727d2cc640fef650d6c76694b83b159d3065ba (patch) | |
tree | c1c5b58eb3a9d51a43737dca62a59b482f7245f2 /src/frontend/mame/clifront.cpp | |
parent | 8f330896e2f8b1fc8ec54023fb5d134dc8a5c3d3 (diff) |
UI cleanup continues:
* Fix crash on builds with fewer than 16 drivers
* Fix "available" filter in internal UI
* Get rid of some UI globals that shouldn't be global
* Better encapsulation in UI
* Clean up favourites manager - in particular kill hidden state and O(n) walks
* This breaks adding systems/software to favourites from the main tab menu
Diffstat (limited to 'src/frontend/mame/clifront.cpp')
-rw-r--r-- | src/frontend/mame/clifront.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp index 276c73f0e63..28249e7bd3e 100644 --- a/src/frontend/mame/clifront.cpp +++ b/src/frontend/mame/clifront.cpp @@ -300,16 +300,19 @@ int cli_frontend::execute(std::vector<std::string> &args) // work out how wide the titles need to be int titlelen(0); for (int match : matches) - titlelen = std::max(titlelen, int(strlen(drivlist.driver(match).type.fullname()))); + if (0 <= match) + titlelen = (std::max)(titlelen, int(strlen(drivlist.driver(match).type.fullname()))); // print them out osd_printf_error("\n\"%s\" approximately matches the following\n" "supported machines (best match first):\n\n", m_options.attempted_system_name().c_str()); for (int match : matches) { - game_driver const &drv(drivlist.driver(match)); - if (match != -1) + if (0 <= match) + { + game_driver const &drv(drivlist.driver(match)); osd_printf_error("%s", util::string_format("%-18s%-*s(%s, %s)\n", drv.name, titlelen + 2, drv.type.fullname(), drv.manufacturer, drv.year).c_str()); + } } } } |