Relocate CaseInsensitiveCompare

This commit is contained in:
Jack Andersen 2015-12-30 12:05:17 -10:00
parent 536a19725d
commit 028be337c6
9 changed files with 20 additions and 35 deletions

View File

@ -16,7 +16,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
include_directories(/usr/local/include)
endif()
if(${CMAKE_BUILD_TYPE} AND ${CMAKE_BUILD_TYPE} STREQUAL "Release" AND ${CMAKE_SYSTEM_NAME} STREQUAL Linux)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
option(USE_LD_GOLD "Link with GNU Gold and enable LTO" ON)
else()
option(USE_LD_GOLD "Link with GNU Gold and enable LTO" OFF)

View File

@ -234,30 +234,6 @@ public:
static constexpr size_t BinarySize() {return 16;}
};
/** Case-insensitive comparator for std::map sorting */
struct CaseInsensitiveCompare
{
bool operator()(const std::string& lhs, const std::string& rhs) const
{
#if _WIN32
if (_stricmp(lhs.c_str(), rhs.c_str()) < 0)
#else
if (strcasecmp(lhs.c_str(), rhs.c_str()) < 0)
#endif
return true;
return false;
}
#if _WIN32
bool operator()(const std::wstring& lhs, const std::wstring& rhs) const
{
if (_wcsicmp(lhs.c_str(), rhs.c_str()) < 0)
return true;
return false;
}
#endif
};
/** Class that automatically converts between hash and path for DNA usage */
template <class IDTYPE>
class PAKPath : public BigYAML

View File

@ -34,7 +34,7 @@ PAKBridge::PAKBridge(HECL::Database::Project& project,
m_pak.read(rs);
/* Append Level String */
std::set<HECL::SystemString, CaseInsensitiveCompare> uniq;
std::set<HECL::SystemString, HECL::CaseInsensitiveCompare> uniq;
for (PAK::Entry& entry : m_pak.m_entries)
{
if (entry.type == FOURCC('MLVL'))

View File

@ -27,7 +27,7 @@ struct SpecMP1 : SpecBase
std::vector<const NOD::Node*> m_nonPaks;
std::vector<DNAMP1::PAKBridge> m_paks;
std::map<std::string, DNAMP1::PAKBridge*, CaseInsensitiveCompare> m_orderedPaks;
std::map<std::string, DNAMP1::PAKBridge*, HECL::CaseInsensitiveCompare> m_orderedPaks;
HECL::ProjectPath m_workPath;
HECL::ProjectPath m_cookPath;

View File

@ -23,7 +23,7 @@ struct SpecMP2 : SpecBase
std::vector<const NOD::Node*> m_nonPaks;
std::vector<DNAMP2::PAKBridge> m_paks;
std::map<std::string, DNAMP2::PAKBridge*, CaseInsensitiveCompare> m_orderedPaks;
std::map<std::string, DNAMP2::PAKBridge*, HECL::CaseInsensitiveCompare> m_orderedPaks;
HECL::ProjectPath m_workPath;
HECL::ProjectPath m_cookPath;

View File

@ -26,7 +26,7 @@ struct SpecMP3 : SpecBase
bool doMP3 = false;
std::vector<const NOD::Node*> m_nonPaks;
std::vector<DNAMP3::PAKBridge> m_paks;
std::map<std::string, DNAMP3::PAKBridge*, CaseInsensitiveCompare> m_orderedPaks;
std::map<std::string, DNAMP3::PAKBridge*, HECL::CaseInsensitiveCompare> m_orderedPaks;
HECL::ProjectPath m_workPath;
HECL::ProjectPath m_cookPath;
@ -36,7 +36,7 @@ struct SpecMP3 : SpecBase
bool doMPTFE = false;
std::vector<const NOD::Node*> m_feNonPaks;
std::vector<DNAMP3::PAKBridge> m_fePaks;
std::map<std::string, DNAMP3::PAKBridge*, CaseInsensitiveCompare> m_feOrderedPaks;
std::map<std::string, DNAMP3::PAKBridge*, HECL::CaseInsensitiveCompare> m_feOrderedPaks;
HECL::ProjectPath m_feWorkPath;
HECL::ProjectPath m_feCookPath;

View File

@ -33,7 +33,10 @@ class SplashScreen : public Specter::ModalWindow
const char* help() const {return "Creates an empty project at selected path";}
void activated(const boo::SWindowCoord& coord)
{
m_splash.m_fileBrowser.m_view.reset(new Specter::FileBrowser(m_splash.rootView().viewRes(), m_splash, "New Project"));
m_splash.m_fileBrowser.m_view.reset(
new Specter::FileBrowser(m_splash.rootView().viewRes(),
m_splash, "New Project",
Specter::FileBrowser::Type::SaveFile));
m_splash.updateSize();
m_splash.m_newButt.mouseLeave(coord);
}
@ -47,7 +50,10 @@ class SplashScreen : public Specter::ModalWindow
const char* help() const {return "Opens an existing project at selected path";}
void activated(const boo::SWindowCoord& coord)
{
m_splash.m_fileBrowser.m_view.reset(new Specter::FileBrowser(m_splash.rootView().viewRes(), m_splash, "Open Project"));
m_splash.m_fileBrowser.m_view.reset(
new Specter::FileBrowser(m_splash.rootView().viewRes(),
m_splash, "Open Project",
Specter::FileBrowser::Type::OpenHECLProject));
m_splash.updateSize();
m_splash.m_openButt.mouseLeave(coord);
}
@ -61,7 +67,10 @@ class SplashScreen : public Specter::ModalWindow
const char* help() const {return "Extracts game image as project at selected path";}
void activated(const boo::SWindowCoord& coord)
{
m_splash.m_fileBrowser.m_view.reset(new Specter::FileBrowser(m_splash.rootView().viewRes(), m_splash, "Extract Game"));
m_splash.m_fileBrowser.m_view.reset(
new Specter::FileBrowser(m_splash.rootView().viewRes(),
m_splash, "Extract Game",
Specter::FileBrowser::Type::OpenFile));
m_splash.updateSize();
m_splash.m_extractButt.mouseLeave(coord);
}

2
hecl

@ -1 +1 @@
Subproject commit 28b9eadc5c525b3bb0884f71c142fd9825d50e48
Subproject commit c6c4718dc58e601ed5782d5d139362f20a42206e

@ -1 +1 @@
Subproject commit 0e357b8fa9055cf2238d498b99b663f5fced3ee0
Subproject commit 68e32072c07007f4cb2cc48384719ed802b8d4e8