mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
(OSX) Move code over to platform_apple.c
This commit is contained in:
parent
f704097573
commit
0132581ebc
@ -133,13 +133,6 @@ static char** waiting_argv;
|
||||
{
|
||||
apple_platform = self;
|
||||
|
||||
char support_path_buf[PATH_MAX + 1];
|
||||
CFSearchPathForDirectoriesInDomains(CFApplicationSupportDirectory, CFUserDomainMask, YES, support_path_buf, sizeof(support_path_buf));
|
||||
|
||||
fill_pathname_join(g_defaults.core_dir, NSBundle.mainBundle.bundlePath.UTF8String, "Contents/Resources/modules", sizeof(g_defaults.core_dir));
|
||||
fill_pathname_join(g_defaults.menu_config_dir, support_path_buf, "RetroArch", sizeof(g_defaults.menu_config_dir));
|
||||
fill_pathname_join(g_defaults.config_path, g_defaults.menu_config_dir, "retroarch.cfg", sizeof(g_defaults.config_path));
|
||||
|
||||
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
|
||||
[self.window setCollectionBehavior:[self.window collectionBehavior] | NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
|
@ -60,6 +60,6 @@ typedef enum
|
||||
} CFDomainMask;
|
||||
|
||||
void CFSearchPathForDirectoriesInDomains(unsigned flags,
|
||||
unsigned domain_mask, BOOL expand_tilde, char *buf, size_t sizeof_buf);
|
||||
unsigned domain_mask, unsigned expand_tilde, char *buf, size_t sizeof_buf);
|
||||
|
||||
#endif
|
||||
|
@ -19,11 +19,11 @@
|
||||
#include "CFExtensions.h"
|
||||
|
||||
void CFSearchPathForDirectoriesInDomains(unsigned flags,
|
||||
unsigned domain_mask, BOOL expand_tilde,
|
||||
unsigned domain_mask, unsigned expand_tilde,
|
||||
char *buf, size_t sizeof_buf)
|
||||
{
|
||||
CFArrayRef array = CFBridgingRetain(NSSearchPathForDirectoriesInDomains(
|
||||
flags, domain_mask, expand_tilde));
|
||||
flags, domain_mask, (BOOL)expand_tilde));
|
||||
CFStringRef path = CFBridgingRetain(CFArrayGetValueAtIndex(array, 0));
|
||||
CFStringGetCString(path, buf, sizeof_buf, kCFStringEncodingUTF8);
|
||||
CFRelease(path);
|
||||
|
@ -14,6 +14,7 @@
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../../apple/common/CFExtensions.h"
|
||||
#include "../menu/menu_common.h"
|
||||
#include "../../settings_data.h"
|
||||
|
||||
@ -169,6 +170,13 @@ static void frontend_apple_get_environment_settings(int *argc, char *argv[],
|
||||
}
|
||||
|
||||
CFRelease(home_dir);
|
||||
#elif defined(OSX)
|
||||
char support_path_buf[PATH_MAX + 1];
|
||||
CFSearchPathForDirectoriesInDomains(CFApplicationSupportDirectory, CFUserDomainMask, 1, support_path_buf, sizeof(support_path_buf));
|
||||
|
||||
fill_pathname_join(g_defaults.core_dir, bundle_path_buf, "Contents/Resources/modules", sizeof(g_defaults.core_dir));
|
||||
fill_pathname_join(g_defaults.menu_config_dir, support_path_buf, "RetroArch", sizeof(g_defaults.menu_config_dir));
|
||||
fill_pathname_join(g_defaults.config_path, g_defaults.menu_config_dir, "retroarch.cfg", sizeof(g_defaults.config_path));
|
||||
#endif
|
||||
|
||||
CFRelease(bundle_path);
|
||||
|
Loading…
x
Reference in New Issue
Block a user