mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 09:35:32 -07:00
Add an asset path within the macOS app bundle
This commit is contained in:
12
src/86box.c
12
src/86box.c
@@ -767,8 +767,10 @@ pc_init(int argc, char *argv[])
|
||||
p = path_get_filename(exe_path);
|
||||
*p = '\0';
|
||||
#if defined(__APPLE__)
|
||||
char contents_path[2048] = {0};
|
||||
c = strlen(exe_path);
|
||||
if ((c >= 16) && !strcmp(&exe_path[c - 16], "/Contents/MacOS/")) {
|
||||
strncpy(contents_path, exe_path, c - 7);
|
||||
exe_path[c - 16] = '\0';
|
||||
p = path_get_filename(exe_path);
|
||||
*p = '\0';
|
||||
@@ -1035,10 +1037,18 @@ usage:
|
||||
path_append_filename(temp, usr_path, "assets");
|
||||
asset_add_path(temp);
|
||||
|
||||
// Add the standard ROM path in the same directory as the executable.
|
||||
// Add the standard asset path in the same directory as the executable.
|
||||
path_append_filename(temp, exe_path, "assets");
|
||||
asset_add_path(temp);
|
||||
|
||||
#ifdef __APPLE__
|
||||
// Add the standard asset path within the app bundle.
|
||||
if (contents_path[0] != '\0') {
|
||||
path_append_filename(temp, contents_path, "Resources/assets");
|
||||
asset_add_path(temp);
|
||||
}
|
||||
#endif
|
||||
|
||||
plat_init_asset_paths();
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user