Use applicationDirectory to locate assets.

`programPath()` returns the directory of the executable, but that isn't
always the asset root. (Notably, in the case of Mac apps.)
This commit is contained in:
Joseph Cloutier
2023-01-13 21:19:52 -05:00
parent 43fb0f15c5
commit c44e292a06

View File

@@ -59,10 +59,8 @@ import sys.FileSystem;
rootPath = "assets/";
#elseif android
rootPath = "";
#elseif console
#elseif (console || sys)
rootPath = lime.system.System.applicationDirectory;
#elseif sys
rootPath = Path.directory(Sys.programPath()) + "/";
#else
rootPath = "./";
#end