diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/java/src/org/godotengine/godot/Godot.java | 10 | ||||
-rw-r--r-- | platform/android/java/src/org/godotengine/godot/GodotView.java | 8 | ||||
-rw-r--r-- | platform/iphone/export/export.cpp | 24 | ||||
-rw-r--r-- | platform/iphone/game_center.mm | 2 | ||||
-rw-r--r-- | platform/osx/export/export.cpp | 4 | ||||
-rw-r--r-- | platform/server/detect.py | 3 | ||||
-rw-r--r-- | platform/windows/key_mapping_win.cpp | 2 | ||||
-rw-r--r-- | platform/x11/detect.py | 3 | ||||
-rw-r--r-- | platform/x11/os_x11.cpp | 16 |
9 files changed, 43 insertions, 29 deletions
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index 053dfa631a..59fefc498f 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -191,6 +191,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC protected void onMainPause() {} protected void onMainResume() {} protected void onMainDestroy() {} + protected boolean onMainBackPressed() { return false; } protected void onGLDrawFrame(GL10 gl) {} protected void onGLSurfaceChanged(GL10 gl, int width, int height) {} // singletons will always miss first onGLSurfaceChanged call @@ -767,9 +768,16 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC */ @Override public void onBackPressed() { + boolean shouldQuit = true; + + for(int i=0;i<singleton_count;i++) { + if (singletons[i].onMainBackPressed()) { + shouldQuit = false; + } + } System.out.printf("** BACK REQUEST!\n"); - if (mView != null) { + if (shouldQuit && mView != null) { mView.queueEvent(new Runnable() { @Override public void run() { diff --git a/platform/android/java/src/org/godotengine/godot/GodotView.java b/platform/android/java/src/org/godotengine/godot/GodotView.java index 3c2ad7cc59..b807b952d4 100644 --- a/platform/android/java/src/org/godotengine/godot/GodotView.java +++ b/platform/android/java/src/org/godotengine/godot/GodotView.java @@ -285,13 +285,7 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener { @Override public boolean onKeyDown(final int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { - queueEvent(new Runnable() { - @Override - public void run() { - GodotLib.back(); - } - }); - + activity.onBackPressed(); // press 'back' button should not terminate program //normal handle 'back' event in game logic return true; diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp index c91781ce1d..0507ef19d6 100644 --- a/platform/iphone/export/export.cpp +++ b/platform/iphone/export/export.cpp @@ -397,7 +397,7 @@ Error EditorExportPlatformIOS::_codesign(String p_file, void *p_userdata) { codesign_args.push_back("-s"); codesign_args.push_back(data->preset->get(data->debug ? "application/code_sign_identity_debug" : "application/code_sign_identity_release")); codesign_args.push_back(p_file); - return OS::get_singleton()->execute("/usr/bin/codesign", codesign_args, true); + return OS::get_singleton()->execute("codesign", codesign_args, true); } return OK; } @@ -592,7 +592,15 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p return err; #ifdef OSX_ENABLED - ep.step("Making .xcarchive", 2); + ep.step("Code-signing dylibs", 2); + DirAccess *dylibs_dir = DirAccess::open(dest_dir + "dylibs"); + ERR_FAIL_COND_V(!dylibs_dir, ERR_CANT_OPEN); + CodesignData codesign_data(p_preset, p_debug); + err = _walk_dir_recursive(dylibs_dir, _codesign, &codesign_data); + memdelete(dylibs_dir); + ERR_FAIL_COND_V(err, err); + + ep.step("Making .xcarchive", 3); String archive_path = p_path.get_basename() + ".xcarchive"; List<String> archive_args; archive_args.push_back("-project"); @@ -608,15 +616,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p archive_args.push_back("archive"); archive_args.push_back("-archivePath"); archive_args.push_back(archive_path); - err = OS::get_singleton()->execute("/usr/bin/xcodebuild", archive_args, true); - ERR_FAIL_COND_V(err, err); - - ep.step("Code-signing dylibs", 3); - DirAccess *dylibs_dir = DirAccess::open(archive_path + "/Products/Applications/" + binary_name + ".app/dylibs"); - ERR_FAIL_COND_V(!dylibs_dir, ERR_CANT_OPEN); - CodesignData codesign_data(p_preset, p_debug); - err = _walk_dir_recursive(dylibs_dir, _codesign, &codesign_data); - memdelete(dylibs_dir); + err = OS::get_singleton()->execute("xcodebuild", archive_args, true); ERR_FAIL_COND_V(err, err); ep.step("Making .ipa", 4); @@ -628,7 +628,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p export_args.push_back(dest_dir + "export_options.plist"); export_args.push_back("-exportPath"); export_args.push_back(dest_dir); - err = OS::get_singleton()->execute("/usr/bin/xcodebuild", export_args, true); + err = OS::get_singleton()->execute("xcodebuild", export_args, true); ERR_FAIL_COND_V(err, err); #else print_line(".ipa can only be built on macOS. Leaving XCode project without building the package."); diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm index 3955b9f0aa..768b55d078 100644 --- a/platform/iphone/game_center.mm +++ b/platform/iphone/game_center.mm @@ -117,7 +117,7 @@ Error GameCenter::post_score(Variant p_score) { String category = params["category"]; NSString *cat_str = [[[NSString alloc] initWithUTF8String:category.utf8().get_data()] autorelease]; - GKScore *reporter = [[[GKScore alloc] initWithCategory:cat_str] autorelease]; + GKScore *reporter = [[[GKScore alloc] initWithLeaderboardIdentifier:cat_str] autorelease]; reporter.value = score; ERR_FAIL_COND_V([GKScore respondsToSelector:@selector(reportScores)], ERR_UNAVAILABLE); diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp index 0ba0ddec7d..8a6f1dc04c 100644 --- a/platform/osx/export/export.cpp +++ b/platform/osx/export/export.cpp @@ -244,7 +244,7 @@ Error EditorExportPlatformOSX::_code_sign(const Ref<EditorExportPreset> &p_prese args.push_back(p_path); String str; - Error err = OS::get_singleton()->execute("/usr/bin/codesign", args, true, NULL, &str, NULL, true); + Error err = OS::get_singleton()->execute("codesign", args, true, NULL, &str, NULL, true); ERR_FAIL_COND_V(err != OK, err); print_line("codesign: " + str); @@ -271,7 +271,7 @@ Error EditorExportPlatformOSX::_create_dmg(const String &p_dmg_path, const Strin args.push_back(p_app_path_name); String str; - Error err = OS::get_singleton()->execute("/usr/bin/hdiutil", args, true, NULL, &str, NULL, true); + Error err = OS::get_singleton()->execute("hdiutil", args, true, NULL, &str, NULL, true); ERR_FAIL_COND_V(err != OK, err); print_line("hdiutil returned: " + str); diff --git a/platform/server/detect.py b/platform/server/detect.py index 04b38f280d..ffec2af933 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -12,6 +12,9 @@ def get_name(): def can_build(): + # Doesn't build against Godot 3.0 for now, disable to avoid confusing users + return False + if (os.name != "posix" or sys.platform == "darwin"): return False diff --git a/platform/windows/key_mapping_win.cpp b/platform/windows/key_mapping_win.cpp index 57f8e965de..76bb5d5723 100644 --- a/platform/windows/key_mapping_win.cpp +++ b/platform/windows/key_mapping_win.cpp @@ -50,7 +50,7 @@ static _WinTranslatePair _vk_to_keycode[] = { { KEY_CONTROL, VK_CONTROL }, //(0x11) - { KEY_MENU, VK_MENU }, //(0x12) + { KEY_ALT, VK_MENU }, //(0x12) { KEY_PAUSE, VK_PAUSE }, //(0x13) diff --git a/platform/x11/detect.py b/platform/x11/detect.py index 1f7f67fe10..8c68c9ffd1 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -239,6 +239,9 @@ def configure(env): if (platform.system() == "Linux"): env.Append(LIBS=['dl']) + if (platform.system().find("BSD") >= 0): + env.Append(LIBS=['execinfo']) + ## Cross-compilation if (is64 and env["bits"] == "32"): diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index e389c6932e..48e2d8f81e 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -35,7 +35,11 @@ #include "servers/physics/physics_server_sw.h" #include "servers/visual/visual_server_raster.h" #include "servers/visual/visual_server_wrap_mt.h" + +#ifdef HAVE_MNTENT #include <mntent.h> +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -1939,7 +1943,7 @@ Error OS_X11::shell_open(String p_uri) { Error ok; List<String> args; args.push_back(p_uri); - ok = execute("/usr/bin/xdg-open", args, false); + ok = execute("xdg-open", args, false); if (ok == OK) return OK; ok = execute("gnome-open", args, false); @@ -2003,7 +2007,7 @@ String OS_X11::get_system_dir(SystemDir p_dir) const { String pipe; List<String> arg; arg.push_back(xdgparam); - Error err = const_cast<OS_X11 *>(this)->execute("/usr/bin/xdg-user-dir", arg, true, NULL, &pipe); + Error err = const_cast<OS_X11 *>(this)->execute("xdg-user-dir", arg, true, NULL, &pipe); if (err != OK) return "."; return pipe.strip_edges(); @@ -2053,7 +2057,7 @@ void OS_X11::alert(const String &p_alert, const String &p_title) { args.push_back(p_title); args.push_back(p_alert); - execute("/usr/bin/xmessage", args, true); + execute("xmessage", args, true); } void OS_X11::set_icon(const Ref<Image> &p_icon) { @@ -2182,6 +2186,7 @@ static String get_mountpoint(const String &p_path) { return ""; } +#ifdef HAVE_MNTENT dev_t dev = s.st_dev; FILE *fd = setmntent("/proc/mounts", "r"); if (!fd) { @@ -2199,6 +2204,7 @@ static String get_mountpoint(const String &p_path) { } endmntent(fd); +#endif return ""; } @@ -2236,12 +2242,12 @@ Error OS_X11::move_to_trash(const String &p_path) { List<String> args; args.push_back("-p"); args.push_back(trashcan); - Error err = execute("/bin/mkdir", args, true); + Error err = execute("mkdir", args, true); if (err == OK) { List<String> args2; args2.push_back(p_path); args2.push_back(trashcan); - err = execute("/bin/mv", args2, true); + err = execute("mv", args2, true); } return err; |