diff options
Diffstat (limited to 'platform')
| -rw-r--r-- | platform/android/export/export.cpp | 11 | ||||
| -rw-r--r-- | platform/iphone/app_delegate.mm | 133 | ||||
| -rw-r--r-- | platform/iphone/in_app_store.mm | 8 | ||||
| -rw-r--r-- | platform/x11/os_x11.cpp | 33 |
4 files changed, 27 insertions, 158 deletions
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 67e00f4952..255413bf2c 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1557,12 +1557,15 @@ public: encode_uint32(cl.size(), &clf[0]); for (int i = 0; i < cl.size(); i++) { + print_line(itos(i) + " param: " + cl[i]); CharString txt = cl[i].utf8(); int base = clf.size(); - clf.resize(base + 4 + txt.length()); - encode_uint32(txt.length(), &clf[base]); - copymem(&clf[base + 4], txt.ptr(), txt.length()); - print_line(itos(i) + " param: " + cl[i]); + int length = txt.length(); + if (!length) + continue; + clf.resize(base + 4 + length); + encode_uint32(length, &clf[base]); + copymem(&clf[base + 4], txt.ptr(), length); } zip_fileinfo zipfi = get_zip_fileinfo(); diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index b591f80aa7..111cdce2de 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -35,21 +35,6 @@ #include "main/main.h" #include "os_iphone.h" -#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED -#include "modules/FacebookScorer_ios/FacebookScorer.h" -#endif - -#ifdef MODULE_GAME_ANALYTICS_ENABLED -#import "modules/game_analytics/ios/MobileAppTracker.framework/Headers/MobileAppTracker.h" -//#import "modules/game_analytics/ios/MobileAppTracker.h" -#import <AdSupport/AdSupport.h> -#endif - -#ifdef MODULE_PARSE_ENABLED -#import "FBSDKCoreKit/FBSDKCoreKit.h" -#import <Parse/Parse.h> -#endif - #import "GameController/GameController.h" #define kFilteringFactor 0.1 @@ -418,11 +403,7 @@ static int frame_count = 0; OSIPhone::get_singleton()->set_unique_id(String::utf8([uuid UTF8String])); }; break; - /* - case 1: { - ++frame_count; - }; break; -*/ + case 1: { Main::setup2(); @@ -453,11 +434,7 @@ static int frame_count = 0; } }; break; - /* - case 3: { - ++frame_count; - }; break; -*/ + case 2: { Main::start(); @@ -558,15 +535,11 @@ static int frame_count = 0; }; - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { - - printf("****************** did receive memory warning!\n"); OS::get_singleton()->get_main_loop()->notification( MainLoop::NOTIFICATION_OS_MEMORY_WARNING); }; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - - printf("**************** app delegate init\n"); CGRect rect = [[UIScreen mainScreen] bounds]; [application setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone]; @@ -603,7 +576,7 @@ static int frame_count = 0; if (err != 0) { // bail, things did not go very well for us, should probably output a message on screen with our error code... exit(0); - return; + return FALSE; }; view_controller = [[ViewController alloc] init]; @@ -641,43 +614,10 @@ static int frame_count = 0; // prevent to stop music in another background app [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil]; -#ifdef MODULE_GAME_ANALYTICS_ENABLED - printf("********************* didFinishLaunchingWithOptions\n"); - if (!ProjectSettings::get_singleton()->has("mobileapptracker/advertiser_id")) { - return; - } - if (!ProjectSettings::get_singleton()->has("mobileapptracker/conversion_key")) { - return; - } - - String adid = GLOBAL_DEF("mobileapptracker/advertiser_id", ""); - String convkey = GLOBAL_DEF("mobileapptracker/conversion_key", ""); - - NSString *advertiser_id = - [NSString stringWithUTF8String:adid.utf8().get_data()]; - NSString *conversion_key = - [NSString stringWithUTF8String:convkey.utf8().get_data()]; - - // Account Configuration info - must be set - [MobileAppTracker initializeWithMATAdvertiserId:advertiser_id - MATConversionKey:conversion_key]; - - // Used to pass us the IFA, enables highly accurate 1-to-1 attribution. - // Required for many advertising networks. - [MobileAppTracker - setAppleAdvertisingIdentifier:[[ASIdentifierManager sharedManager] - advertisingIdentifier] - advertisingTrackingEnabled:[[ASIdentifierManager sharedManager] - isAdvertisingTrackingEnabled]]; - -#endif return TRUE; }; - (void)applicationWillTerminate:(UIApplication *)application { - - printf("********************* will terminate\n"); - [self deinitGameControllers]; if (motionInitialised) { @@ -692,7 +632,6 @@ static int frame_count = 0; }; - (void)applicationDidEnterBackground:(UIApplication *)application { - printf("********************* did enter background\n"); ///@TODO maybe add pause motionManager? and where would we unpause it? if (OS::get_singleton()->get_main_loop()) @@ -706,24 +645,17 @@ static int frame_count = 0; } - (void)applicationWillEnterForeground:(UIApplication *)application { - printf("********************* did enter foreground\n"); // OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_IN); [view_controller.view startAnimation]; } - (void)applicationWillResignActive:(UIApplication *)application { - printf("********************* will resign active\n"); // OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_WM_FOCUS_OUT); [view_controller.view stopAnimation]; // FIXME: pause seems to be recommended elsewhere } - (void)applicationDidBecomeActive:(UIApplication *)application { - printf("********************* did become active\n"); -#ifdef MODULE_GAME_ANALYTICS_ENABLED - printf("********************* mobile app tracker found\n"); - [MobileAppTracker measureSession]; -#endif if (OS::get_singleton()->get_main_loop()) OS::get_singleton()->get_main_loop()->notification( MainLoop::NOTIFICATION_WM_FOCUS_IN); @@ -739,65 +671,6 @@ static int frame_count = 0; AudioDriverCoreAudio::get_singleton()->start(); } -- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { -#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED - return [[[FacebookScorer sharedInstance] facebook] handleOpenURL:url]; -#else - return false; -#endif -} - -// For 4.2+ support -- (BOOL)application:(UIApplication *)application - openURL:(NSURL *)url - sourceApplication:(NSString *)sourceApplication - annotation:(id)annotation { -#ifdef MODULE_PARSE_ENABLED - NSLog(@"Handling application openURL"); - return - [[FBSDKApplicationDelegate sharedInstance] application:application - openURL:url - sourceApplication:sourceApplication - annotation:annotation]; -#endif - -#ifdef MODULE_FACEBOOKSCORER_IOS_ENABLED - return [[[FacebookScorer sharedInstance] facebook] handleOpenURL:url]; -#else - return false; -#endif -} - -- (void)application:(UIApplication *)application - didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { -#ifdef MODULE_PARSE_ENABLED - // Store the deviceToken in the current installation and save it to Parse. - PFInstallation *currentInstallation = [PFInstallation currentInstallation]; - // NSString* token = [[NSString alloc] initWithData:deviceToken - // encoding:NSUTF8StringEncoding]; - NSLog(@"Device Token : %@ ", deviceToken); - [currentInstallation setDeviceTokenFromData:deviceToken]; - [currentInstallation saveInBackground]; -#endif -} - -- (void)application:(UIApplication *)application - didReceiveRemoteNotification:(NSDictionary *)userInfo { -#ifdef MODULE_PARSE_ENABLED - [PFPush handlePush:userInfo]; - NSDictionary *aps = - [userInfo objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - - NSLog(@"Push Notification Payload (app active) %@", aps); - [defaults setObject:aps forKey:@"notificationInfo"]; - [defaults synchronize]; - if (application.applicationState == UIApplicationStateInactive) { - [PFAnalytics trackAppOpenedWithRemoteNotificationPayload:userInfo]; - } -#endif -} - - (void)dealloc { [window release]; [super dealloc]; diff --git a/platform/iphone/in_app_store.mm b/platform/iphone/in_app_store.mm index 25f4e1e166..31d3659802 100644 --- a/platform/iphone/in_app_store.mm +++ b/platform/iphone/in_app_store.mm @@ -31,10 +31,6 @@ #include "in_app_store.h" -#ifdef MODULE_FUSEBOXX_ENABLED -#import "modules/fuseboxx/ios/FuseSDK.h" -#endif - extern "C" { #import <Foundation/Foundation.h> #import <StoreKit/StoreKit.h> @@ -224,10 +220,6 @@ Error InAppStore::request_product_info(Variant p_params) { [pending_transactions setObject:transaction forKey:transaction.payment.productIdentifier]; } -#ifdef MODULE_FUSEBOXX_ENABLED - printf("Registering transaction on Fuseboxx!\n"); - [FuseSDK registerInAppPurchase:transaction]; -#endif }; break; case SKPaymentTransactionStateFailed: { printf("status transaction failed!\n"); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 49a2f14bef..b59fab7088 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -195,14 +195,13 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au XIDeviceInfo *dev = &info[i]; if (!dev->enabled) continue; - /*if (dev->use != XIMasterPointer) - continue;*/ + if (!(dev->use == XIMasterPointer || dev->use == XIFloatingSlave)) + continue; bool direct_touch = false; for (int j = 0; j < dev->num_classes; j++) { if (dev->classes[j]->type == XITouchClass && ((XITouchClassInfo *)dev->classes[j])->mode == XIDirectTouch) { direct_touch = true; - printf("%d) %d %s\n", i, dev->attachment, dev->name); break; } } @@ -215,7 +214,7 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au XIFreeDeviceInfo(info); if (!touch.devices.size()) { - fprintf(stderr, "No suitable touch device found\n"); + fprintf(stderr, "No touch devices found\n"); } } } @@ -359,7 +358,7 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au // Must be alive after this block static unsigned char mask_data[XIMaskLen(XI_LASTEVENT)] = {}; - touch.event_mask.deviceid = XIAllMasterDevices; + touch.event_mask.deviceid = XIAllDevices; touch.event_mask.mask_len = sizeof(mask_data); touch.event_mask.mask = mask_data; @@ -370,12 +369,14 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au XISelectEvents(x11_display, x11_window, &touch.event_mask, 1); - XIClearMask(touch.event_mask.mask, XI_TouchOwnership); + // Disabled by now since grabbing also blocks mouse events + // (they are received as extended events instead of standard events) + /*XIClearMask(touch.event_mask.mask, XI_TouchOwnership); // Grab touch devices to avoid OS gesture interference for (int i = 0; i < touch.devices.size(); ++i) { XIGrabDevice(x11_display, touch.devices[i], x11_window, CurrentTime, None, XIGrabModeAsync, XIGrabModeAsync, False, &touch.event_mask); - } + }*/ } #endif @@ -1512,7 +1513,7 @@ void OS_X11::process_xevents() { #ifdef TOUCH_ENABLED if (XGetEventData(x11_display, &event.xcookie)) { - if (event.xcookie.extension == touch.opcode) { + if (event.xcookie.type == GenericEvent && event.xcookie.extension == touch.opcode) { XIDeviceEvent *event_data = (XIDeviceEvent *)event.xcookie.data; int index = event_data->detail; @@ -1521,7 +1522,8 @@ void OS_X11::process_xevents() { switch (event_data->evtype) { case XI_TouchBegin: // Fall-through - XIAllowTouchEvents(x11_display, event_data->deviceid, event_data->detail, x11_window, XIAcceptTouch); + // Disabled hand-in-hand with the grabbing + //XIAllowTouchEvents(x11_display, event_data->deviceid, event_data->detail, x11_window, XIAcceptTouch); case XI_TouchEnd: { @@ -1567,9 +1569,8 @@ void OS_X11::process_xevents() { } break; } } - - XFreeEventData(x11_display, &event.xcookie); } + XFreeEventData(x11_display, &event.xcookie); #endif switch (event.type) { @@ -1615,10 +1616,10 @@ void OS_X11::process_xevents() { GrabModeAsync, GrabModeAsync, x11_window, None, CurrentTime); } #ifdef TOUCH_ENABLED - // Grab touch devices to avoid OS gesture interference - for (int i = 0; i < touch.devices.size(); ++i) { + // Grab touch devices to avoid OS gesture interference + /*for (int i = 0; i < touch.devices.size(); ++i) { XIGrabDevice(x11_display, touch.devices[i], x11_window, CurrentTime, None, XIGrabModeAsync, XIGrabModeAsync, False, &touch.event_mask); - } + }*/ #endif if (xic) { XSetICFocus(xic); @@ -1638,9 +1639,9 @@ void OS_X11::process_xevents() { } #ifdef TOUCH_ENABLED // Ungrab touch devices so input works as usual while we are unfocused - for (int i = 0; i < touch.devices.size(); ++i) { + /*for (int i = 0; i < touch.devices.size(); ++i) { XIUngrabDevice(x11_display, touch.devices[i], CurrentTime); - } + }*/ // Release every pointer to avoid sticky points for (Map<int, Vector2>::Element *E = touch.state.front(); E; E = E->next()) { |