summaryrefslogtreecommitdiff
path: root/platform/iphone
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-07-19 17:00:46 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-07-19 17:06:03 -0300
commit25678b1876816b9ccb14b2c92aef62f3b009f88f (patch)
tree189f082d788f78e16f620b056d21249118883fc5 /platform/iphone
parent89588d43349e496a9e05756d42ae87323d31269e (diff)
-Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
Diffstat (limited to 'platform/iphone')
-rw-r--r--platform/iphone/app_delegate.mm10
-rw-r--r--platform/iphone/export/export.cpp13
-rw-r--r--platform/iphone/gl_view.mm4
-rw-r--r--platform/iphone/globals/global_defaults.cpp4
-rw-r--r--platform/iphone/os_iphone.cpp19
-rw-r--r--platform/iphone/os_iphone.h1
6 files changed, 32 insertions, 19 deletions
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm
index b6cd43b3a2..da6dfcf53f 100644
--- a/platform/iphone/app_delegate.mm
+++ b/platform/iphone/app_delegate.mm
@@ -30,7 +30,7 @@
#import "app_delegate.h"
#include "audio_driver_iphone.h"
-#include "core/global_config.h"
+#include "core/project_settings.h"
#import "gl_view.h"
#include "main/main.h"
#include "os_iphone.h"
@@ -449,14 +449,14 @@ static int frame_count = 0;
NSString *str = (NSString *)value;
String uval = String::utf8([str UTF8String]);
- GlobalConfig::get_singleton()->set("Info.plist/" + ukey, uval);
+ ProjectSettings::get_singleton()->set("Info.plist/" + ukey, uval);
} else if ([value isKindOfClass:[NSNumber class]]) {
NSNumber *n = (NSNumber *)value;
double dval = [n doubleValue];
- GlobalConfig::get_singleton()->set("Info.plist/" + ukey, dval);
+ ProjectSettings::get_singleton()->set("Info.plist/" + ukey, dval);
};
// do stuff
}
@@ -645,10 +645,10 @@ static int frame_count = 0;
#ifdef MODULE_GAME_ANALYTICS_ENABLED
printf("********************* didFinishLaunchingWithOptions\n");
- if (!GlobalConfig::get_singleton()->has("mobileapptracker/advertiser_id")) {
+ if (!ProjectSettings::get_singleton()->has("mobileapptracker/advertiser_id")) {
return;
}
- if (!GlobalConfig::get_singleton()->has("mobileapptracker/conversion_key")) {
+ if (!ProjectSettings::get_singleton()->has("mobileapptracker/conversion_key")) {
return;
}
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index 9cd3ec64cf..a5efae8678 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -32,13 +32,13 @@
#include "editor/editor_export.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
-#include "global_config.h"
#include "io/marshalls.h"
#include "io/resource_saver.h"
#include "io/zip_io.h"
#include "os/file_access.h"
#include "os/os.h"
#include "platform/osx/logo.gen.h"
+#include "project_settings.h"
#include "string.h"
#include "version.h"
@@ -60,6 +60,7 @@ protected:
public:
virtual String get_name() const { return "iOS"; }
+ virtual String get_os_name() const { return "iOS"; }
virtual Ref<Texture> get_logo() const { return logo; }
virtual String get_binary_extension() const { return "xcodeproj"; }
@@ -67,6 +68,12 @@ public:
virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const;
+ virtual void get_platform_features(List<String> *r_features) {
+
+ r_features->push_back("mobile");
+ r_features->push_back("iOS");
+ }
+
EditorExportPlatformIOS();
~EditorExportPlatformIOS();
};
@@ -175,8 +182,8 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
String pkg_name;
if (p_preset->get("application/name") != "")
pkg_name = p_preset->get("application/name"); // app_name
- else if (String(GlobalConfig::get_singleton()->get("application/config/name")) != "")
- pkg_name = String(GlobalConfig::get_singleton()->get("application/config/name"));
+ else if (String(ProjectSettings::get_singleton()->get("application/config/name")) != "")
+ pkg_name = String(ProjectSettings::get_singleton()->get("application/config/name"));
else
pkg_name = "Unnamed";
diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm
index 6270fa85f2..4b137b7ffa 100644
--- a/platform/iphone/gl_view.mm
+++ b/platform/iphone/gl_view.mm
@@ -29,7 +29,7 @@
/*************************************************************************/
#import "gl_view.h"
-#include "core/global_config.h"
+#include "core/project_settings.h"
#include "core/os/keyboard.h"
#include "os_iphone.h"
#include "servers/audio_server.h"
@@ -77,7 +77,7 @@ void _hide_keyboard() {
};
bool _play_video(String p_path, float p_volume, String p_audio_track, String p_subtitle_track) {
- p_path = GlobalConfig::get_singleton()->globalize_path(p_path);
+ p_path = ProjectSettings::get_singleton()->globalize_path(p_path);
NSString *file_path = [[[NSString alloc] initWithUTF8String:p_path.utf8().get_data()] autorelease];
diff --git a/platform/iphone/globals/global_defaults.cpp b/platform/iphone/globals/global_defaults.cpp
index b320be2f85..aa4662302d 100644
--- a/platform/iphone/globals/global_defaults.cpp
+++ b/platform/iphone/globals/global_defaults.cpp
@@ -28,14 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "global_defaults.h"
-#include "global_config.h"
+#include "project_settings.h"
void register_iphone_global_defaults() {
/*GLOBAL_DEF("rasterizer.iOS/use_fragment_lighting",false);
GLOBAL_DEF("rasterizer.iOS/fp16_framebuffer",false);
GLOBAL_DEF("display.iOS/driver","GLES2");
- GlobalConfig::get_singleton()->set_custom_property_info("display.iOS/driver",PropertyInfo(Variant::STRING,"display.iOS/driver",PROPERTY_HINT_ENUM,"GLES1,GLES2"));
+ ProjectSettings::get_singleton()->set_custom_property_info("display.iOS/driver",PropertyInfo(Variant::STRING,"display.iOS/driver",PROPERTY_HINT_ENUM,"GLES1,GLES2"));
GLOBAL_DEF("display.iOS/use_cadisplaylink",true);
*/
}
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp
index b244edbff6..1329c94198 100644
--- a/platform/iphone/os_iphone.cpp
+++ b/platform/iphone/os_iphone.cpp
@@ -38,10 +38,10 @@
#include "audio_driver_iphone.h"
#include "main/main.h"
-#include "core/global_config.h"
#include "core/io/file_access_pack.h"
#include "core/os/dir_access.h"
#include "core/os/file_access.h"
+#include "core/project_settings.h"
#include "sem_iphone.h"
@@ -138,28 +138,28 @@ void OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_
/*
#ifdef IOS_SCORELOOP_ENABLED
scoreloop = memnew(ScoreloopIOS);
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("Scoreloop", scoreloop));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("Scoreloop", scoreloop));
scoreloop->connect();
#endif
*/
#ifdef GAME_CENTER_ENABLED
game_center = memnew(GameCenter);
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("GameCenter", game_center));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("GameCenter", game_center));
game_center->connect();
#endif
#ifdef STOREKIT_ENABLED
store_kit = memnew(InAppStore);
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("InAppStore", store_kit));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("InAppStore", store_kit));
#endif
#ifdef ICLOUD_ENABLED
icloud = memnew(ICloud);
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("ICloud", icloud));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("ICloud", icloud));
//icloud->connect();
#endif
- GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("iOS", memnew(iOS)));
+ ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("iOS", memnew(iOS)));
};
MainLoop *OSIPhone::get_main_loop() const {
@@ -517,7 +517,7 @@ Error OSIPhone::native_video_play(String p_path, float p_volume, String p_audio_
print("Unable to play %S using the native player as it resides in a .pck file\n", p_path.c_str());
return ERR_INVALID_PARAMETER;
} else {
- p_path = p_path.replace("res:/", GlobalConfig::get_singleton()->get_resource_path());
+ p_path = p_path.replace("res:/", ProjectSettings::get_singleton()->get_resource_path());
}
} else if (p_path.begins_with("user://"))
p_path = p_path.replace("user:/", get_data_dir());
@@ -552,6 +552,11 @@ void OSIPhone::native_video_stop() {
_stop_video();
}
+bool OSIPhone::_check_internal_feature_support(const String &p_feature) {
+
+ return p_feature == "mobile" || p_feature == "etc" || p_feature == "pvrtc" || p_feature == "etc2";
+}
+
OSIPhone::OSIPhone(int width, int height) {
main_loop = NULL;
diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h
index 4031b7524c..b15e9fdffb 100644
--- a/platform/iphone/os_iphone.h
+++ b/platform/iphone/os_iphone.h
@@ -200,6 +200,7 @@ public:
virtual void native_video_focus_out();
virtual void native_video_stop();
+ virtual bool _check_internal_feature_support(const String &p_feature);
OSIPhone(int width, int height);
~OSIPhone();
};