diff options
author | Steph Enders <smenders@gmail.com> | 2022-06-26 21:57:43 -0400 |
---|---|---|
committer | Steph Enders <smenders@gmail.com> | 2022-06-26 21:57:43 -0400 |
commit | 734ee0f6352fdb6077c142d90f191c11c32f98d2 (patch) | |
tree | 4d4d40b7c9fcd4b900f45dfcdaf9d7c99e0d3ca8 /src/resources/Resources.h | |
parent | 49f22d6f41d46635502d9e2e492ee36a1197a4de (diff) |
Alias filesystem library to allow for xp usage
MacOS 10.14 still uses experimental/filesystem which is what we're
currently targetting.
If I can get my hands on a 10.15+ we can test that out
Diffstat (limited to 'src/resources/Resources.h')
-rw-r--r-- | src/resources/Resources.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/resources/Resources.h b/src/resources/Resources.h index 21bf8a7..2e0e7c0 100644 --- a/src/resources/Resources.h +++ b/src/resources/Resources.h @@ -30,9 +30,10 @@ #ifdef __APPLE__ #include <experimental/filesystem> -namespace std::filesystem = std::experimental::filesystem; +namespace fs = std::experimental::filesystem; #else #include <filesystem> +namespace fs = std::filesystem; #endif #include <optional> #include <vector> @@ -53,7 +54,7 @@ static const char *DEFAULT_FONT = "PressStart2P-vaV7.ttf"; class Resources { protected: - shared_ptr<std::filesystem::path> font; // chosen font + shared_ptr<fs::path> font; // chosen font shared_ptr<filesystem::path> defaultsLua; // defaults lua file vector<filesystem::path> fonts; // all found maps vector<filesystem::path> levels; // all found maps @@ -68,11 +69,11 @@ public: void loadDefaultLuaFile(); vector<filesystem::path> getFontFiles(); vector<filesystem::path> getLevels(); - shared_ptr<std::filesystem::path> updateFont(int idx); - shared_ptr<std::filesystem::path> getFontFile(); - shared_ptr<std::filesystem::path> getDefaultsLuaFile(); - shared_ptr<std::filesystem::path> getLevelMap(int idx); - optional<shared_ptr<std::filesystem::path>> getLevelProcLua(int idx); + shared_ptr<fs::path> updateFont(int idx); + shared_ptr<fs::path> getFontFile(); + shared_ptr<fs::path> getDefaultsLuaFile(); + shared_ptr<fs::path> getLevelMap(int idx); + optional<shared_ptr<fs::path>> getLevelProcLua(int idx); /* Helper method to convert any path to a const char * * Windows uses wchar_t so this can help provide a common way to * interact with files |