From 9198c2bd58d31310a324ad0180c57e503c630d0f Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 19 Jan 2019 17:34:43 +1100 Subject: 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 --- src/lib/util/corefile.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'src/lib/util/corefile.cpp') 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 - namespace util { + namespace { + /*************************************************************************** VALIDATION ***************************************************************************/ @@ -335,23 +336,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 -- cgit v1.2.3-70-g09d2