From 829e8c0b62eae16b9385487d86fb8dd5356b748c Mon Sep 17 00:00:00 2001 From: omigamedev Date: Fri, 30 Nov 2018 14:27:11 +0100 Subject: [PATCH] testing crash --- PanoPainter-OSX/main.cpp | 4 ++++ PanoPainter-OSX/main.h | 1 + PanoPainter/AppDelegate.h | 2 +- PanoPainter/AppDelegate.m | 7 ++++++- PanoPainter/GameViewController.h | 1 + PanoPainter/GameViewController.m | 5 +++++ data/layout.xml | 4 ++++ scripts/manifest-version.py | 2 +- scripts/pre-build.py | 2 +- src/app.h | 1 + src/app_events.cpp | 9 +++++++++ src/app_layout.cpp | 6 ++++++ 12 files changed, 40 insertions(+), 4 deletions(-) diff --git a/PanoPainter-OSX/main.cpp b/PanoPainter-OSX/main.cpp index ec896cf..0c5467c 100644 --- a/PanoPainter-OSX/main.cpp +++ b/PanoPainter-OSX/main.cpp @@ -24,6 +24,10 @@ std::mutex task_mutex; { NSSharingService *airdrop_service; } +- (void)hockeyapp_crash +{ + [[[BITHockeyManager sharedHockeyManager] crashManager] generateTestCrash]; +} - (void)async_lock { CGLLockContext([glctx CGLContextObj]); diff --git a/PanoPainter-OSX/main.h b/PanoPainter-OSX/main.h index d668f61..5e778a6 100644 --- a/PanoPainter-OSX/main.h +++ b/PanoPainter-OSX/main.h @@ -26,4 +26,5 @@ - (std::string)pick_file:(NSArray*)types; - (std::string)pick_dir; - (void)share_file:(NSString*)file_path; +- (void)hockeyapp_crash; @end diff --git a/PanoPainter/AppDelegate.h b/PanoPainter/AppDelegate.h index 3db453b..2ea5262 100644 --- a/PanoPainter/AppDelegate.h +++ b/PanoPainter/AppDelegate.h @@ -16,6 +16,6 @@ openURL:(NSURL *)url options:(NSDictionary *)options; - (float)sonarpen_pressure; - +- (void)hockeyapp_crash; @end diff --git a/PanoPainter/AppDelegate.m b/PanoPainter/AppDelegate.m index 47847b9..ded2494 100644 --- a/PanoPainter/AppDelegate.m +++ b/PanoPainter/AppDelegate.m @@ -27,6 +27,11 @@ return true; } +- (void)hockeyapp_crash +{ + [[[BITHockeyManager sharedHockeyManager] crashManager] generateTestCrash]; +} + - (float)sonarpen_pressure { return [sonarpen_driver isPenAttached] ? [sonarpen_driver pressure] : 1.f; @@ -56,7 +61,7 @@ [[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"c2dccca196294ecca8fd5d58af2738cf"]; // Do some additional configuration if needed here [[BITHockeyManager sharedHockeyManager] startManager]; - [[BITHockeyManager sharedHockeyManager].authenticator authenticateInstallation]; + //[[BITHockeyManager sharedHockeyManager].authenticator authenticateInstallation]; // sonarpen_driver = [[WTSonarPenDriver alloc] initWithApplication:application]; // [sonarpen_driver start]; // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(penStatusChanged) name:WTSonarPenDriverStateChangedNotification object:nil]; diff --git a/PanoPainter/GameViewController.h b/PanoPainter/GameViewController.h index 32e1b40..4a106e9 100644 --- a/PanoPainter/GameViewController.h +++ b/PanoPainter/GameViewController.h @@ -27,4 +27,5 @@ - (void)pick_photo:(std::function) callback; - (void)registerForKeyboardNotifications; - (void)unregisterForKeyboardNotifications; +- (void)crash; @end diff --git a/PanoPainter/GameViewController.m b/PanoPainter/GameViewController.m index 02d4cc8..7c54dd0 100644 --- a/PanoPainter/GameViewController.m +++ b/PanoPainter/GameViewController.m @@ -42,6 +42,11 @@ NSThread* lock_thread; std::recursive_mutex lock_mutex; @implementation GameViewController +- (void)crash +{ + AppDelegate* app = (AppDelegate*)[[UIApplication sharedApplication] delegate]; + [app hockeyapp_crash]; +} - (void)async_lock { lock_mutex.lock(); diff --git a/data/layout.xml b/data/layout.xml index b9204f5..e460ddc 100644 --- a/data/layout.xml +++ b/data/layout.xml @@ -964,6 +964,10 @@ Here's a list of what's available in this release. + + + + diff --git a/scripts/manifest-version.py b/scripts/manifest-version.py index e71335d..0408e5c 100644 --- a/scripts/manifest-version.py +++ b/scripts/manifest-version.py @@ -7,7 +7,7 @@ import re, subprocess, sys branch = check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).rstrip().decode("utf-8") shorthash = check_output(["git", "log", "--pretty=format:%h", "-n 1"]).rstrip().decode("utf-8") revcount = int(check_output(["git", "rev-list", "--count", "HEAD"])) -tag = check_output(["git", "describe", "--tags", "--abbrev=0"]).rstrip().decode("utf-8") +tag = check_output(["git", "describe", "--tags", "--abbrev=0"]).rstrip().decode("utf-8").split('-',1)[0] config = sys.argv[2].lower() version = "%s.%d (%s-%s-%s)" % (tag, revcount, shorthash, branch, config) diff --git a/scripts/pre-build.py b/scripts/pre-build.py index bf46ac4..ee05aad 100644 --- a/scripts/pre-build.py +++ b/scripts/pre-build.py @@ -7,7 +7,7 @@ import re, subprocess, sys branch = check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"]).rstrip().decode("utf-8") shorthash = check_output(["git", "log", "--pretty=format:%h", "-n 1"]).rstrip().decode("utf-8") revcount = int(check_output(["git", "rev-list", "--count", "HEAD"])) -tag = check_output(["git", "describe", "--tags", "--abbrev=0"]).rstrip().decode("utf-8") +tag = check_output(["git", "describe", "--tags", "--abbrev=0"]).rstrip().decode("utf-8").split('-',1)[0] config = sys.argv[1].lower() version = "%s.%d (%s-%s-%s)" % (tag, revcount, shorthash, branch, config) diff --git a/src/app.h b/src/app.h index 7cc4624..f55eb78 100644 --- a/src/app.h +++ b/src/app.h @@ -197,6 +197,7 @@ public: int res_from_index(int i); int res_to_index(int res); std::string res_to_string(int res); + void crash_test(); void cmd_convert(std::string pano_path, std::string out_path); }; diff --git a/src/app_events.cpp b/src/app_events.cpp index d7b5472..d464b89 100644 --- a/src/app_events.cpp +++ b/src/app_events.cpp @@ -9,6 +9,15 @@ std::string win32_open_file(const char* filter); std::string win32_open_dir(); #endif +void App::crash_test() +{ +#ifdef __IOS__ + [ios_view crash]; +#elif __OSX__ + [osx_view hockeyapp_crash]; +#elif __ANDROID__ +#endif +} void App::tick(float dt) { diff --git a/src/app_layout.cpp b/src/app_layout.cpp index 90a4869..eae794a 100644 --- a/src/app_layout.cpp +++ b/src/app_layout.cpp @@ -601,6 +601,12 @@ void App::init_menu_about() popup->destroy(); }; } + + if (auto b = popup->find("about-crash")) + b->on_click = [this](Node*) { + LOG("crashing"); + App::I.crash_test(); + }; }; } }