diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 13:23:58 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-14 16:54:55 +0200 |
commit | 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a (patch) | |
tree | a27e497da7104dd0a64f98a04fa3067668735e91 /platform/iphone | |
parent | 710b34b70227becdc652b4ae027fe0ac47409642 (diff) |
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.
This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.
There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).
Part of #33027.
Diffstat (limited to 'platform/iphone')
-rw-r--r-- | platform/iphone/app_delegate.mm | 4 | ||||
-rw-r--r-- | platform/iphone/export/export.cpp | 10 | ||||
-rw-r--r-- | platform/iphone/game_center.h | 1 | ||||
-rw-r--r-- | platform/iphone/game_center.mm | 13 | ||||
-rw-r--r-- | platform/iphone/gl_view.mm | 21 | ||||
-rw-r--r-- | platform/iphone/godot_iphone.cpp | 2 | ||||
-rw-r--r-- | platform/iphone/icloud.h | 1 | ||||
-rw-r--r-- | platform/iphone/icloud.mm | 2 | ||||
-rw-r--r-- | platform/iphone/in_app_store.h | 1 | ||||
-rw-r--r-- | platform/iphone/in_app_store.mm | 14 | ||||
-rw-r--r-- | platform/iphone/ios.h | 1 | ||||
-rw-r--r-- | platform/iphone/ios.mm | 1 | ||||
-rw-r--r-- | platform/iphone/os_iphone.cpp | 36 | ||||
-rw-r--r-- | platform/iphone/os_iphone.h | 2 | ||||
-rw-r--r-- | platform/iphone/view_controller.mm | 4 | ||||
-rw-r--r-- | platform/iphone/vulkan_context_iphone.h | 1 | ||||
-rw-r--r-- | platform/iphone/vulkan_context_iphone.mm | 1 |
17 files changed, 0 insertions, 115 deletions
diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index fb30441bd3..c4ef185bf1 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -426,7 +426,6 @@ OS::VideoMode _get_video_mode() { static int frame_count = 0; - (void)drawView:(UIView *)view; { - switch (frame_count) { case 0: { OS::get_singleton()->set_video_mode(_get_video_mode()); @@ -463,7 +462,6 @@ static int frame_count = 0; }; break; case 1: { - Main::setup2(); ++frame_count; @@ -490,7 +488,6 @@ static int frame_count = 0; ProjectSettings::get_singleton()->set("Info.plist/" + ukey, uval); } else if ([value isKindOfClass:[NSNumber class]]) { - NSNumber *n = (NSNumber *)value; double dval = [n doubleValue]; @@ -502,7 +499,6 @@ static int frame_count = 0; }; break; case 2: { - Main::start(); ++frame_count; diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index 3904fd6cf9..e5e9f7764b 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -48,7 +48,6 @@ #include <sys/stat.h> class EditorExportPlatformIOS : public EditorExportPlatform { - GDCLASS(EditorExportPlatformIOS, EditorExportPlatform); int version_code; @@ -73,7 +72,6 @@ class EditorExportPlatformIOS : public EditorExportPlatform { String modules_buildgrp; }; struct ExportArchitecture { - String name; bool is_default = false; @@ -105,7 +103,6 @@ class EditorExportPlatformIOS : public EditorExportPlatform { Error _export_additional_assets(const String &p_out_dir, const Vector<SharedObject> &p_libraries, Vector<IOSExportAsset> &r_exported_assets); bool is_package_name_valid(const String &p_package, String *r_error = nullptr) const { - String pname = p_package; if (pname.length() == 0) { @@ -148,7 +145,6 @@ 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"); } @@ -161,7 +157,6 @@ public: }; void EditorExportPlatformIOS::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) { - String driver = ProjectSettings::get_singleton()->get("rendering/quality/driver/driver_name"); if (driver == "GLES2") { r_features->push_back("etc"); @@ -207,7 +202,6 @@ static const LoadingScreenInfo loading_screen_infos[] = { }; void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options) { - r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/debug", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "custom_template/release", PROPERTY_HINT_GLOBAL_FILE, "*.zip"), "")); @@ -442,7 +436,6 @@ String EditorExportPlatformIOS::_get_cpp_code() { } void EditorExportPlatformIOS::_blend_and_rotate(Ref<Image> &p_dst, Ref<Image> &p_src, bool p_rot) { - ERR_FAIL_COND(p_dst.is_null()); ERR_FAIL_COND(p_src.is_null()); @@ -1311,7 +1304,6 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p } bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const { - String err; bool valid = false; @@ -1376,7 +1368,6 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset } EditorExportPlatformIOS::EditorExportPlatformIOS() { - Ref<Image> img = memnew(Image(_iphone_logo)); logo.instance(); logo->create_from_image(img); @@ -1386,7 +1377,6 @@ EditorExportPlatformIOS::~EditorExportPlatformIOS() { } void register_iphone_exporter() { - Ref<EditorExportPlatformIOS> platform; platform.instance(); diff --git a/platform/iphone/game_center.h b/platform/iphone/game_center.h index d35cc4b87c..0d3ef5b696 100644 --- a/platform/iphone/game_center.h +++ b/platform/iphone/game_center.h @@ -36,7 +36,6 @@ #include "core/object.h" class GameCenter : public Object { - GDCLASS(GameCenter, Object); static GameCenter *instance; diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm index 52f025f333..8d470da1a8 100644 --- a/platform/iphone/game_center.mm +++ b/platform/iphone/game_center.mm @@ -75,7 +75,6 @@ void GameCenter::return_connect_error(const char *p_error_description) { } void GameCenter::connect() { - //if this class isn't available, game center isn't implemented if ((NSClassFromString(@"GKLocalPlayer")) == nil) { return_connect_error("GameCenter not available"); @@ -125,7 +124,6 @@ bool GameCenter::is_authenticated() { }; Error GameCenter::post_score(Variant p_score) { - Dictionary params = p_score; ERR_FAIL_COND_V(!params.has("score") || !params.has("category"), ERR_INVALID_PARAMETER); float score = params["score"]; @@ -156,7 +154,6 @@ Error GameCenter::post_score(Variant p_score) { }; Error GameCenter::award_achievement(Variant p_params) { - Dictionary params = p_params; ERR_FAIL_COND_V(!params.has("name") || !params.has("progress"), ERR_INVALID_PARAMETER); String name = params["name"]; @@ -192,7 +189,6 @@ Error GameCenter::award_achievement(Variant p_params) { }; void GameCenter::request_achievement_descriptions() { - [GKAchievementDescription loadAchievementDescriptionsWithCompletionHandler:^(NSArray *descriptions, NSError *error) { Dictionary ret; ret["type"] = "achievement_descriptions"; @@ -207,7 +203,6 @@ void GameCenter::request_achievement_descriptions() { Array replayable; for (int i = 0; i < [descriptions count]; i++) { - GKAchievementDescription *description = [descriptions objectAtIndex:i]; const char *str = [description.identifier UTF8String]; @@ -247,7 +242,6 @@ void GameCenter::request_achievement_descriptions() { }; void GameCenter::request_achievements() { - [GKAchievement loadAchievementsWithCompletionHandler:^(NSArray *achievements, NSError *error) { Dictionary ret; ret["type"] = "achievements"; @@ -257,7 +251,6 @@ void GameCenter::request_achievements() { PackedFloat32Array percentages; for (int i = 0; i < [achievements count]; i++) { - GKAchievement *achievement = [achievements objectAtIndex:i]; const char *str = [achievement.identifier UTF8String]; names.push_back(String::utf8(str != NULL ? str : "")); @@ -278,7 +271,6 @@ void GameCenter::request_achievements() { }; void GameCenter::reset_achievements() { - [GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error) { Dictionary ret; ret["type"] = "reset_achievements"; @@ -294,7 +286,6 @@ void GameCenter::reset_achievements() { }; Error GameCenter::show_game_center(Variant p_params) { - ERR_FAIL_COND_V(!NSProtocolFromString(@"GKGameCenterControllerDelegate"), FAILED); Dictionary params = p_params; @@ -338,7 +329,6 @@ Error GameCenter::show_game_center(Variant p_params) { }; Error GameCenter::request_identity_verification_signature() { - ERR_FAIL_COND_V(!is_authenticated(), ERR_UNAUTHORIZED); GKLocalPlayer *player = [GKLocalPlayer localPlayer]; @@ -365,7 +355,6 @@ Error GameCenter::request_identity_verification_signature() { }; void GameCenter::game_center_closed() { - Dictionary ret; ret["type"] = "show_game_center"; ret["result"] = "ok"; @@ -373,12 +362,10 @@ void GameCenter::game_center_closed() { } int GameCenter::get_pending_event_count() { - return pending_events.size(); }; Variant GameCenter::pop_pending_event() { - Variant front = pending_events.front()->get(); pending_events.pop_front(); diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index ede60a502d..1169ebc6b4 100644 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -174,7 +174,6 @@ void _focus_out_video() { }; void _unpause_video() { - [_instance.avPlayer play]; video_playing = true; }; @@ -207,14 +206,12 @@ static const int max_touches = 8; static UITouch *touches[max_touches]; static void init_touches() { - for (int i = 0; i < max_touches; i++) { touches[i] = NULL; }; }; static int get_touch_id(UITouch *p_touch) { - int first = -1; for (int i = 0; i < max_touches; i++) { if (first == -1 && touches[i] == NULL) { @@ -234,10 +231,8 @@ static int get_touch_id(UITouch *p_touch) { }; static int remove_touch(UITouch *p_touch) { - int remaining = 0; for (int i = 0; i < max_touches; i++) { - if (touches[i] == NULL) continue; if (touches[i] == p_touch) @@ -249,9 +244,7 @@ static int remove_touch(UITouch *p_touch) { }; static void clear_touches() { - for (int i = 0; i < max_touches; i++) { - touches[i] = NULL; }; }; @@ -396,7 +389,6 @@ static void clear_touches() { active = TRUE; printf("start animation!\n"); if (useCADisplayLink) { - // Approximate frame rate // assumes device refreshes at 60 fps int frameInterval = (int)floor(animationInterval * 60.0f); @@ -446,7 +438,6 @@ static void clear_touches() { // Updates the OpenGL view when the timer fires - (void)drawView { - if (!active) { printf("draw view not active!\n"); return; @@ -489,9 +480,7 @@ static void clear_touches() { - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSArray *tlist = [[event allTouches] allObjects]; for (unsigned int i = 0; i < [tlist count]; i++) { - if ([touches containsObject:[tlist objectAtIndex:i]]) { - UITouch *touch = [tlist objectAtIndex:i]; if (touch.phase != UITouchPhaseBegan) continue; @@ -504,12 +493,9 @@ static void clear_touches() { } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { - NSArray *tlist = [[event allTouches] allObjects]; for (unsigned int i = 0; i < [tlist count]; i++) { - if ([touches containsObject:[tlist objectAtIndex:i]]) { - UITouch *touch = [tlist objectAtIndex:i]; if (touch.phase != UITouchPhaseMoved) continue; @@ -525,9 +511,7 @@ static void clear_touches() { - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { NSArray *tlist = [[event allTouches] allObjects]; for (unsigned int i = 0; i < [tlist count]; i++) { - if ([touches containsObject:[tlist objectAtIndex:i]]) { - UITouch *touch = [tlist objectAtIndex:i]; if (touch.phase != UITouchPhaseEnded) continue; @@ -541,7 +525,6 @@ static void clear_touches() { } - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event { - OSIPhone::get_singleton()->touches_cancelled(); clear_touches(); }; @@ -599,7 +582,6 @@ static void clear_touches() { NSInteger routeChangeReason = [[interuptionDict valueForKey:AVAudioSessionRouteChangeReasonKey] integerValue]; switch (routeChangeReason) { - case AVAudioSessionRouteChangeReasonNewDeviceAvailable: { NSLog(@"AVAudioSessionRouteChangeReasonNewDeviceAvailable"); NSLog(@"Headphone/Line plugged in"); @@ -609,7 +591,6 @@ static void clear_touches() { NSLog(@"AVAudioSessionRouteChangeReasonOldDeviceUnavailable"); NSLog(@"Headphone/Line was pulled. Resuming video play...."); if (_is_video_playing()) { - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5f * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ [_instance.avPlayer play]; // NOTE: change this line according your current player implementation NSLog(@"resumed play"); @@ -685,7 +666,6 @@ static void clear_touches() { } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { - if (object == _instance.avPlayerItem && [keyPath isEqualToString:@"status"]) { if (_instance.avPlayerItem.status == AVPlayerStatusFailed || _instance.avPlayer.status == AVPlayerStatusFailed) { _stop_video(); @@ -695,7 +675,6 @@ static void clear_touches() { if (_instance.avPlayer.status == AVPlayerStatusReadyToPlay && _instance.avPlayerItem.status == AVPlayerItemStatusReadyToPlay && CMTIME_COMPARE_INLINE(video_current_time, ==, kCMTimeZero)) { - //NSLog(@"time: %@", video_current_time); [_instance.avPlayer seekToTime:video_current_time]; diff --git a/platform/iphone/godot_iphone.cpp b/platform/iphone/godot_iphone.cpp index cea0e5c7f0..b9d217c9d2 100644 --- a/platform/iphone/godot_iphone.cpp +++ b/platform/iphone/godot_iphone.cpp @@ -46,7 +46,6 @@ int add_cmdline(int p_argc, char **p_args); int iphone_main(int, int, int, char **, String); int iphone_main(int width, int height, int argc, char **argv, String data_dir) { - size_t len = strlen(argv[0]); while (len--) { @@ -86,7 +85,6 @@ int iphone_main(int width, int height, int argc, char **argv, String data_dir) { }; void iphone_finish() { - printf("iphone_finish\n"); Main::cleanup(); delete os; diff --git a/platform/iphone/icloud.h b/platform/iphone/icloud.h index 401a6cbeb8..b11e22fec6 100644 --- a/platform/iphone/icloud.h +++ b/platform/iphone/icloud.h @@ -36,7 +36,6 @@ #include "core/object.h" class ICloud : public Object { - GDCLASS(ICloud, Object); static ICloud *instance; diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm index 1b9b354727..343af744d5 100644 --- a/platform/iphone/icloud.mm +++ b/platform/iphone/icloud.mm @@ -58,12 +58,10 @@ void ICloud::_bind_methods() { }; int ICloud::get_pending_event_count() { - return pending_events.size(); }; Variant ICloud::pop_pending_event() { - Variant front = pending_events.front()->get(); pending_events.pop_front(); diff --git a/platform/iphone/in_app_store.h b/platform/iphone/in_app_store.h index 493877a5a7..44e65e77ed 100644 --- a/platform/iphone/in_app_store.h +++ b/platform/iphone/in_app_store.h @@ -36,7 +36,6 @@ #include "core/object.h" class InAppStore : public Object { - GDCLASS(InAppStore, Object); static InAppStore *instance; diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm index c5a8ed2b2b..f3e8ff141b 100644 --- a/platform/iphone/in_app_store.mm +++ b/platform/iphone/in_app_store.mm @@ -80,7 +80,6 @@ void InAppStore::_bind_methods() { @implementation ProductsDelegate - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { - NSArray *products = response.products; Dictionary ret; ret["type"] = "product_info"; @@ -93,7 +92,6 @@ void InAppStore::_bind_methods() { PackedStringArray currency_codes; for (NSUInteger i = 0; i < [products count]; i++) { - SKProduct *product = [products objectAtIndex:i]; const char *str = [product.localizedTitle UTF8String]; @@ -116,7 +114,6 @@ void InAppStore::_bind_methods() { PackedStringArray invalid_ids; for (NSString *ipid in response.invalidProductIdentifiers) { - invalid_ids.push_back(String::utf8([ipid UTF8String])); }; ret["invalid_ids"] = invalid_ids; @@ -129,7 +126,6 @@ void InAppStore::_bind_methods() { @end Error InAppStore::request_product_info(Variant p_params) { - Dictionary params = p_params; ERR_FAIL_COND_V(!params.has("product_ids"), ERR_INVALID_PARAMETER); @@ -155,7 +151,6 @@ Error InAppStore::request_product_info(Variant p_params) { }; Error InAppStore::restore_purchases() { - printf("restoring purchases!\n"); [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; @@ -169,10 +164,8 @@ Error InAppStore::restore_purchases() { @implementation TransObserver - (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { - printf("transactions updated!\n"); for (SKPaymentTransaction *transaction in transactions) { - switch (transaction.transactionState) { case SKPaymentTransactionStatePurchased: { printf("status purchased!\n"); @@ -189,11 +182,9 @@ Error InAppStore::restore_purchases() { int sdk_version = 6; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { - NSURL *receiptFileURL = nil; NSBundle *bundle = [NSBundle mainBundle]; if ([bundle respondsToSelector:@selector(appStoreReceiptURL)]) { - // Get the transaction receipt file path location in the app bundle. receiptFileURL = [bundle appStoreReceiptURL]; @@ -263,7 +254,6 @@ Error InAppStore::restore_purchases() { @end Error InAppStore::purchase(Variant p_params) { - ERR_FAIL_COND_V(![SKPaymentQueue canMakePayments], ERR_UNAVAILABLE); if (![SKPaymentQueue canMakePayments]) return ERR_UNAVAILABLE; @@ -286,7 +276,6 @@ int InAppStore::get_pending_event_count() { }; Variant InAppStore::pop_pending_event() { - Variant front = pending_events.front()->get(); pending_events.pop_front(); @@ -294,12 +283,10 @@ Variant InAppStore::pop_pending_event() { }; void InAppStore::_post_event(Variant p_event) { - pending_events.push_back(p_event); }; void InAppStore::_record_purchase(String product_id) { - String skey = "purchased/" + product_id; NSString *key = [[[NSString alloc] initWithUTF8String:skey.utf8().get_data()] autorelease]; [[NSUserDefaults standardUserDefaults] setBool:YES forKey:key]; @@ -307,7 +294,6 @@ void InAppStore::_record_purchase(String product_id) { }; InAppStore *InAppStore::get_singleton() { - return instance; }; diff --git a/platform/iphone/ios.h b/platform/iphone/ios.h index 1378fdbbc5..2b29e6f268 100644 --- a/platform/iphone/ios.h +++ b/platform/iphone/ios.h @@ -34,7 +34,6 @@ #include "core/object.h" class iOS : public Object { - GDCLASS(iOS, Object); static void _bind_methods(); diff --git a/platform/iphone/ios.mm b/platform/iphone/ios.mm index 697c9b8a3d..5923f558a5 100644 --- a/platform/iphone/ios.mm +++ b/platform/iphone/ios.mm @@ -34,7 +34,6 @@ #import <UIKit/UIKit.h> void iOS::_bind_methods() { - ClassDB::bind_method(D_METHOD("get_rate_url", "app_id"), &iOS::get_rate_url); }; diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp index 9254e660d8..107d142757 100644 --- a/platform/iphone/os_iphone.cpp +++ b/platform/iphone/os_iphone.cpp @@ -58,12 +58,10 @@ #include <dlfcn.h> int OSIPhone::get_video_driver_count() const { - return 2; }; const char *OSIPhone::get_video_driver_name(int p_driver) const { - switch (p_driver) { case VIDEO_DRIVER_GLES2: return "GLES2"; @@ -72,14 +70,12 @@ const char *OSIPhone::get_video_driver_name(int p_driver) const { }; OSIPhone *OSIPhone::get_singleton() { - return (OSIPhone *)OS::get_singleton(); }; extern int gl_view_base_fb; // from gl_view.mm void OSIPhone::set_data_dir(String p_dir) { - DirAccess *da = DirAccess::open(p_dir); data_dir = da->get_current_dir(); @@ -88,17 +84,14 @@ void OSIPhone::set_data_dir(String p_dir) { }; void OSIPhone::set_unique_id(String p_id) { - unique_id = p_id; }; String OSIPhone::get_unique_id() const { - return unique_id; }; void OSIPhone::initialize_core() { - OS_Unix::initialize_core(); set_data_dir(data_dir); @@ -174,12 +167,10 @@ Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p }; MainLoop *OSIPhone::get_main_loop() const { - return main_loop; }; void OSIPhone::set_main_loop(MainLoop *p_main_loop) { - main_loop = p_main_loop; if (main_loop) { @@ -189,13 +180,11 @@ void OSIPhone::set_main_loop(MainLoop *p_main_loop) { }; bool OSIPhone::iterate() { - if (!main_loop) return true; if (main_loop) { for (int i = 0; i < event_count; i++) { - input->parse_input_event(event_queue[i]); }; }; @@ -205,7 +194,6 @@ bool OSIPhone::iterate() { }; void OSIPhone::key(uint32_t p_key, bool p_pressed) { - Ref<InputEventKey> ev; ev.instance(); ev->set_echo(false); @@ -217,7 +205,6 @@ void OSIPhone::key(uint32_t p_key, bool p_pressed) { }; void OSIPhone::touch_press(int p_idx, int p_x, int p_y, bool p_pressed, bool p_doubleclick) { - if (!GLOBAL_DEF("debug/disable_touch", false)) { Ref<InputEventScreenTouch> ev; ev.instance(); @@ -232,9 +219,7 @@ void OSIPhone::touch_press(int p_idx, int p_x, int p_y, bool p_pressed, bool p_d }; void OSIPhone::touch_drag(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_y) { - if (!GLOBAL_DEF("debug/disable_touch", false)) { - Ref<InputEventScreenDrag> ev; ev.instance(); ev->set_index(p_idx); @@ -245,18 +230,14 @@ void OSIPhone::touch_drag(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_ }; void OSIPhone::queue_event(const Ref<InputEvent> &p_event) { - ERR_FAIL_INDEX(event_count, MAX_EVENTS); event_queue[event_count++] = p_event; }; void OSIPhone::touches_cancelled() { - for (int i = 0; i < MAX_MOUSE_COUNT; i++) { - if (touch_list.pressed[i]) { - // send a mouse_up outside the screen touch_press(i, -1, -1, false, false); }; @@ -270,7 +251,6 @@ void OSIPhone::update_gravity(float p_x, float p_y, float p_z) { }; void OSIPhone::update_accelerometer(float p_x, float p_y, float p_z) { - // Found out the Z should not be negated! Pass as is! input->set_accelerometer(Vector3(p_x / (float)ACCEL_RANGE, p_y / (float)ACCEL_RANGE, p_z / (float)ACCEL_RANGE)); @@ -333,7 +313,6 @@ void OSIPhone::joy_axis(int p_device, int p_axis, const InputDefault::JoyAxis &p }; void OSIPhone::delete_main_loop() { - if (main_loop) { main_loop->finish(); memdelete(main_loop); @@ -343,7 +322,6 @@ void OSIPhone::delete_main_loop() { }; void OSIPhone::finalize() { - delete_main_loop(); memdelete(input); @@ -376,24 +354,20 @@ void OSIPhone::set_mouse_show(bool p_show) {} void OSIPhone::set_mouse_grab(bool p_grab) {} bool OSIPhone::is_mouse_grab_enabled() const { - return true; }; Point2 OSIPhone::get_mouse_position() const { - return Point2(); }; int OSIPhone::get_mouse_button_state() const { - return 0; }; void OSIPhone::set_window_title(const String &p_title) {} void OSIPhone::alert(const String &p_alert, const String &p_title) { - const CharString utf8_alert = p_alert.utf8(); const CharString utf8_title = p_title.utf8(); iOS::alert(utf8_alert.get_data(), utf8_title.get_data()); @@ -431,22 +405,18 @@ Error OSIPhone::get_dynamic_library_symbol_handle(void *p_library_handle, const } void OSIPhone::set_video_mode(const VideoMode &p_video_mode, int p_screen) { - video_mode = p_video_mode; }; OS::VideoMode OSIPhone::get_video_mode(int p_screen) const { - return video_mode; }; void OSIPhone::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const { - p_list->push_back(video_mode); }; bool OSIPhone::can_draw() const { - if (native_video_is_playing()) return false; return true; @@ -497,17 +467,14 @@ void OSIPhone::set_keep_screen_on(bool p_enabled) { }; String OSIPhone::get_user_data_dir() const { - return data_dir; }; String OSIPhone::get_name() const { - return "iOS"; }; String OSIPhone::get_model_name() const { - String model = ios->get_model(); if (model != "") return model; @@ -516,7 +483,6 @@ String OSIPhone::get_model_name() const { } Size2 OSIPhone::get_window_size() const { - return Vector2(video_mode.width, video_mode.height); } @@ -527,7 +493,6 @@ Rect2 OSIPhone::get_window_safe_area() const { } bool OSIPhone::has_touchscreen_ui_hint() const { - return true; } @@ -600,7 +565,6 @@ void OSIPhone::vibrate_handheld(int p_duration_ms) { } bool OSIPhone::_check_internal_feature_support(const String &p_feature) { - return p_feature == "mobile"; } diff --git a/platform/iphone/os_iphone.h b/platform/iphone/os_iphone.h index eb94e1d69b..a57b8eeb5d 100644 --- a/platform/iphone/os_iphone.h +++ b/platform/iphone/os_iphone.h @@ -50,7 +50,6 @@ #endif class OSIPhone : public OS_Unix { - private: enum { MAX_MOUSE_COUNT = 8, @@ -99,7 +98,6 @@ private: virtual void finalize(); struct MouseList { - bool pressed[MAX_MOUSE_COUNT]; MouseList() { for (int i = 0; i < MAX_MOUSE_COUNT; i++) diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm index 465e38e45e..279bcc1226 100644 --- a/platform/iphone/view_controller.mm +++ b/platform/iphone/view_controller.mm @@ -40,7 +40,6 @@ int add_path(int, char **); int add_cmdline(int, char **); int add_path(int p_argc, char **p_args) { - NSString *str = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_path"]; if (!str) return p_argc; @@ -54,13 +53,11 @@ int add_path(int p_argc, char **p_args) { }; int add_cmdline(int p_argc, char **p_args) { - NSArray *arr = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_cmdline"]; if (!arr) return p_argc; for (int i = 0; i < [arr count]; i++) { - NSString *str = [arr objectAtIndex:i]; if (!str) continue; @@ -81,7 +78,6 @@ int add_cmdline(int p_argc, char **p_args) { @implementation ViewController - (void)didReceiveMemoryWarning { - printf("*********** did receive memory warning!\n"); }; diff --git a/platform/iphone/vulkan_context_iphone.h b/platform/iphone/vulkan_context_iphone.h index 625e41f4b9..cadd701636 100644 --- a/platform/iphone/vulkan_context_iphone.h +++ b/platform/iphone/vulkan_context_iphone.h @@ -35,7 +35,6 @@ // #import <UIKit/UIKit.h> class VulkanContextIPhone : public VulkanContext { - virtual const char *_get_platform_surface_extension() const; public: diff --git a/platform/iphone/vulkan_context_iphone.mm b/platform/iphone/vulkan_context_iphone.mm index 701ac0d9bb..44c940dc3a 100644 --- a/platform/iphone/vulkan_context_iphone.mm +++ b/platform/iphone/vulkan_context_iphone.mm @@ -36,7 +36,6 @@ const char *VulkanContextIPhone::_get_platform_surface_extension() const { } int VulkanContextIPhone::window_create(void *p_window, int p_width, int p_height) { - VkIOSSurfaceCreateInfoMVK createInfo; createInfo.sType = VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK; createInfo.pNext = NULL; |