Skip to content

Commit

Permalink
FIX - AssetSelector: try parent directory of parent directory
Browse files Browse the repository at this point in the history
  • Loading branch information
deadbaed committed Jun 14, 2020
1 parent b19d948 commit 200ebea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions AssetSelector/AssetSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ fs::path AssetSelector(const std::string &asset) {
AssetPath = "/usr/share/IndieStudio/assets";
#endif

#if defined(ASSET_SELECTOR_RELEASE) && defined(_WIN32)
/* win32 implementation will go here */
#endif

if (AssetPath.empty()) {
/* look for the assets folder in current directory */
AssetPath = fs::current_path() /= "assets";

if (!fs::exists(AssetPath)) {
/* try the parent directory */
AssetPath = fs::current_path().parent_path() /= "assets";

if (!fs::exists(AssetPath)) {
/* try the parent directory of the parent directory */
AssetPath = fs::current_path().parent_path().parent_path() /= "assets";
}
}
}

Expand Down

0 comments on commit 200ebea

Please sign in to comment.