You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-31 18:41:20 +00:00
[iOS] Fix use of godot_path.
This commit is contained in:
@@ -52,19 +52,6 @@ void change_to_launch_dir(char **p_args) {
|
||||
}
|
||||
}
|
||||
|
||||
int add_path(int p_argc, char **p_args) {
|
||||
NSString *str = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_path"];
|
||||
if (!str) {
|
||||
return p_argc;
|
||||
}
|
||||
|
||||
p_args[p_argc++] = (char *)"--path";
|
||||
p_args[p_argc++] = (char *)[str cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
p_args[p_argc] = nullptr;
|
||||
|
||||
return p_argc;
|
||||
}
|
||||
|
||||
int add_cmdline(int p_argc, char **p_args) {
|
||||
NSArray *arr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_cmdline"];
|
||||
if (!arr) {
|
||||
@@ -89,7 +76,6 @@ int process_args(int p_argc, char **p_args, char **r_args) {
|
||||
r_args[i] = p_args[i];
|
||||
}
|
||||
r_args[p_argc] = nullptr;
|
||||
p_argc = add_path(p_argc, r_args);
|
||||
p_argc = add_cmdline(p_argc, r_args);
|
||||
return p_argc;
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ public:
|
||||
virtual String get_cache_path() const override;
|
||||
virtual String get_temp_path() const override;
|
||||
virtual String get_resource_dir() const override;
|
||||
virtual String get_bundle_resource_dir() const override;
|
||||
|
||||
virtual String get_locale() const override;
|
||||
|
||||
|
||||
@@ -412,6 +412,15 @@ String OS_AppleEmbedded::get_resource_dir() const {
|
||||
#endif
|
||||
}
|
||||
|
||||
String OS_AppleEmbedded::get_bundle_resource_dir() const {
|
||||
NSString *str = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_path"];
|
||||
if (!str) {
|
||||
return OS_Unix::get_bundle_resource_dir();
|
||||
} else {
|
||||
return String::utf8([str cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
}
|
||||
}
|
||||
|
||||
String OS_AppleEmbedded::get_locale() const {
|
||||
NSString *preferredLanguage = [NSLocale preferredLanguages].firstObject;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user