diff options
author | Michael Lutz <michi@icosahedron.de> | 2020-12-06 21:11:43 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2020-12-27 13:19:25 +0100 |
commit | 0c6e8a8123c9f74db757272f73adcbd8621e012d (patch) | |
tree | 626d723efa78c770f26b442efe7b36d584afe826 /src/video/cocoa | |
parent | dd138fc460dcbab37452e90ff070a31516994aa2 (diff) | |
download | openttd-0c6e8a8123c9f74db757272f73adcbd8621e012d.tar.xz |
Codechange: Store file search paths as std::string.
Diffstat (limited to 'src/video/cocoa')
-rw-r--r-- | src/video/cocoa/cocoa_v.mm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm index 10f30027b..f02599799 100644 --- a/src/video/cocoa/cocoa_v.mm +++ b/src/video/cocoa/cocoa_v.mm @@ -34,6 +34,7 @@ #include "../../window_func.h" #include "../../window_gui.h" +#include <array> #import <sys/param.h> /* for MAXPATHLEN */ /** @@ -545,13 +546,15 @@ void CocoaDialog(const char *title, const char *message, const char *buttonLabel */ void cocoaSetApplicationBundleDir() { + extern std::array<std::string, NUM_SEARCHPATHS> _searchpaths; + char tmp[MAXPATHLEN]; CFAutoRelease<CFURLRef> url(CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle())); if (CFURLGetFileSystemRepresentation(url.get(), true, (unsigned char*)tmp, MAXPATHLEN)) { AppendPathSeparator(tmp, lastof(tmp)); - _searchpaths[SP_APPLICATION_BUNDLE_DIR] = stredup(tmp); + _searchpaths[SP_APPLICATION_BUNDLE_DIR] = tmp; } else { - _searchpaths[SP_APPLICATION_BUNDLE_DIR] = NULL; + _searchpaths[SP_APPLICATION_BUNDLE_DIR].clear(); } } |