diff options
author | 2019-01-19 17:34:43 +1100 | |
---|---|---|
committer | 2019-01-19 17:34:43 +1100 | |
commit | 9198c2bd58d31310a324ad0180c57e503c630d0f (patch) | |
tree | 71e3431c9be2088bf50d5d397f00d7de08bc633e /src/lib | |
parent | 3174c630780e1e2302f19e308ccdd73b1d3d4b01 (diff) |
More UI stuff:
* Split up the different parts of ICO loading in the menus (locating files, scaling, drawing, etc.)
* Added icon support to software selection menu
* Added support for more ICO file variants, including PNG-in-ICO (new DIB parser is overkill for ICO but I can factor it out for BMP loading at some point)
* Added favourites filter for software menus - includes software that's favourited on any system, so GBC includes DMG favourties and vice versa
* Eliminated unnecessary member variables and O(n) walks in software selection menu
* Made the menus' cached texture structures a bit more efficient
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/util/corefile.cpp | 22 | ||||
-rw-r--r-- | src/lib/util/corefile.h | 21 |
2 files changed, 22 insertions, 21 deletions
diff --git a/src/lib/util/corefile.cpp b/src/lib/util/corefile.cpp index 264d80f4113..78a484c5511 100644 --- a/src/lib/util/corefile.cpp +++ b/src/lib/util/corefile.cpp @@ -23,9 +23,10 @@ #include <ctype.h> - namespace util { + namespace { + /*************************************************************************** VALIDATION ***************************************************************************/ @@ -336,23 +337,6 @@ private: /*************************************************************************** - INLINE FUNCTIONS -***************************************************************************/ - -/*------------------------------------------------- - is_directory_separator - is a given character - a directory separator? The following logic - works for most platforms --------------------------------------------------*/ - -inline int is_directory_separator(char c) -{ - return (c == '\\' || c == '/' || c == ':'); -} - - - -/*************************************************************************** core_text_file ***************************************************************************/ @@ -1275,7 +1259,7 @@ core_file::core_file() std::string core_filename_extract_base(const std::string &name, bool strip_extension) { // find the start of the basename - auto const start = std::find_if(name.rbegin(), name.rend(), [](char c) { return util::is_directory_separator(c); }); + auto const start = std::find_if(name.rbegin(), name.rend(), &util::is_directory_separator); // find the end of the basename auto const chop_position = strip_extension diff --git a/src/lib/util/corefile.h b/src/lib/util/corefile.h index 2c4a5da8217..d286cb866ac 100644 --- a/src/lib/util/corefile.h +++ b/src/lib/util/corefile.h @@ -7,11 +7,11 @@ Core file I/O interface functions and definitions. ***************************************************************************/ +#ifndef MAME_LIB_UTIL_COREFILE_H +#define MAME_LIB_UTIL_COREFILE_H #pragma once -#ifndef MAME_LIB_UTIL_COREFILE_H -#define MAME_LIB_UTIL_COREFILE_H #include "corestr.h" #include "coretmpl.h" @@ -23,6 +23,7 @@ namespace util { + /*************************************************************************** ADDITIONAL OPEN FLAGS ***************************************************************************/ @@ -130,6 +131,22 @@ protected: core_file(); }; + +/*************************************************************************** + INLINE FUNCTIONS +***************************************************************************/ + +// is a given character a directory separator? + +constexpr bool is_directory_separator(char c) +{ +#if defined(WIN32) + return ('\\' == c) || ('/' == c) || (':' == c); +#else + return '/' == c; +#endif +} + } // namespace util |