summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/detect.py19
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java2
-rw-r--r--platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java15
-rw-r--r--platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java14
-rw-r--r--platform/android/java_glue.cpp2
-rw-r--r--platform/javascript/detect.py4
-rw-r--r--platform/osx/os_osx.h1
-rw-r--r--platform/osx/os_osx.mm6
-rw-r--r--platform/server/detect.py3
-rw-r--r--platform/windows/os_windows.cpp6
-rw-r--r--platform/windows/os_windows.h1
-rw-r--r--platform/x11/detect.py6
-rw-r--r--platform/x11/os_x11.cpp20
-rw-r--r--platform/x11/os_x11.h3
14 files changed, 84 insertions, 18 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 892b1b6a85..971368db17 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -14,10 +14,13 @@ def get_name():
def can_build():
-
return ("ANDROID_NDK_ROOT" in os.environ)
+def get_platform(platform):
+ return int(platform.split("-")[1])
+
+
def get_opts():
from SCons.Variables import BoolVariable, EnumVariable
@@ -124,6 +127,9 @@ def configure(env):
else:
env.extra_suffix = ".armv7" + env.extra_suffix
elif env["android_arch"] == "arm64v8":
+ if get_platform(env["ndk_platform"]) < 21:
+ print("WARNING: android_arch=arm64v8 is not supported by ndk_platform lower than andorid-21; setting ndk_platform=android-21")
+ env["ndk_platform"] = "android-21"
env['ARCH'] = 'arch-arm64'
target_subpath = "aarch64-linux-android-4.9"
abi_subpath = "aarch64-linux-android"
@@ -160,12 +166,13 @@ def configure(env):
elif (sys.platform.startswith('win')):
if (platform.machine().endswith('64')):
host_subpath = "windows-x86_64"
- if env["android_arch"] == "arm64v8":
- mt_link = False
else:
mt_link = False
host_subpath = "windows"
+ if env["android_arch"] == "arm64v8":
+ mt_link = False
+
compiler_path = env["ANDROID_NDK_ROOT"] + "/toolchains/llvm/prebuilt/" + host_subpath + "/bin"
gcc_toolchain_path = env["ANDROID_NDK_ROOT"] + "/toolchains/" + target_subpath + "/prebuilt/" + host_subpath
tools_path = gcc_toolchain_path + "/" + abi_subpath + "/bin"
@@ -199,7 +206,7 @@ def configure(env):
env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include"])
env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include/" + abi_subpath])
# For unified headers this define has to be set manually
- env.Append(CPPFLAGS=["-D__ANDROID_API__=" + str(int(env['ndk_platform'].split("-")[1]))])
+ env.Append(CPPFLAGS=["-D__ANDROID_API__=" + str(get_platform(env['ndk_platform']))])
else:
print("Using NDK deprecated headers")
env.Append(CPPFLAGS=["-isystem", lib_sysroot + "/usr/include"])
@@ -254,10 +261,10 @@ def configure(env):
env.Append(LINKFLAGS=target_opts)
env.Append(LINKFLAGS=common_opts)
- env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + '/toolchains/arm-linux-androideabi-4.9/prebuilt/' +
+ env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] + '/toolchains/' + target_subpath + '/prebuilt/' +
host_subpath + '/lib/gcc/' + abi_subpath + '/4.9.x'])
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] +
- '/toolchains/arm-linux-androideabi-4.9/prebuilt/' + host_subpath + '/' + abi_subpath + '/lib'])
+ '/toolchains/' + target_subpath + '/prebuilt/' + host_subpath + '/' + abi_subpath + '/lib'])
env.Append(CPPPATH=['#platform/android'])
env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL', '-DMPC_FIXED_POINT'])
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java
index b5b0afb9e0..0d14211bd0 100644
--- a/platform/android/java/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/src/org/godotengine/godot/Godot.java
@@ -404,7 +404,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
new_cmdline = new String[2];
}
- new_cmdline[cll] = "--main_pack";
+ new_cmdline[cll] = "--main-pack";
new_cmdline[cll + 1] = expansion_pack_path;
command_line = new_cmdline;
}
diff --git a/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java b/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java
index 6b7f7a283e..d72c590378 100644
--- a/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java
+++ b/platform/android/java/src/org/godotengine/godot/GodotPaymentV3.java
@@ -67,7 +67,7 @@ public class GodotPaymentV3 extends Godot.SingletonBase {
public GodotPaymentV3(Activity p_activity) {
- registerClass("GodotPayments", new String[] { "purchase", "setPurchaseCallbackId", "setPurchaseValidationUrlPrefix", "setTransactionId", "getSignature", "consumeUnconsumedPurchases", "requestPurchased", "setAutoConsume", "consume", "querySkuDetails" });
+ registerClass("GodotPayments", new String[] { "purchase", "setPurchaseCallbackId", "setPurchaseValidationUrlPrefix", "setTransactionId", "getSignature", "consumeUnconsumedPurchases", "requestPurchased", "setAutoConsume", "consume", "querySkuDetails", "isConnected" });
activity = (Godot)p_activity;
mPaymentManager = activity.getPaymentsManager();
mPaymentManager.setBaseSingleton(this);
@@ -164,6 +164,19 @@ public class GodotPaymentV3 extends Godot.SingletonBase {
GodotLib.calldeferred(purchaseCallbackId, "has_purchased", new Object[] { receipt, signature, sku });
}
+ public void callbackDisconnected() {
+ GodotLib.calldeferred(purchaseCallbackId, "iap_disconnected", new Object[]{});
+ }
+
+ public void callbackConnected() {
+ GodotLib.calldeferred(purchaseCallbackId, "iap_connected", new Object[]{});
+ }
+
+ // true if connected, false otherwise
+ public boolean isConnected() {
+ return mPaymentManager.isConnected();
+ }
+
// consume item automatically after purchase. default is true.
public void setAutoConsume(boolean autoConsume) {
mPaymentManager.setAutoConsume(autoConsume);
diff --git a/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java
index da6d66ae88..441a311358 100644
--- a/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java
+++ b/platform/android/java/src/org/godotengine/godot/payments/PaymentsManager.java
@@ -93,11 +93,21 @@ public class PaymentsManager {
@Override
public void onServiceDisconnected(ComponentName name) {
mService = null;
+
+ // At this stage, godotPaymentV3 might not have been initialized yet.
+ if (godotPaymentV3 != null) {
+ godotPaymentV3.callbackDisconnected();
+ }
}
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
mService = IInAppBillingService.Stub.asInterface(service);
+
+ // At this stage, godotPaymentV3 might not have been initialized yet.
+ if (godotPaymentV3 != null) {
+ godotPaymentV3.callbackConnected();
+ }
}
};
@@ -123,6 +133,10 @@ public class PaymentsManager {
.purchase(sku, transactionId);
}
+ public boolean isConnected() {
+ return mService != null;
+ }
+
public void consumeUnconsumedPurchases() {
new ReleaseAllConsumablesTask(mService, activity) {
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index 4e9e4f6260..2d81d79bf1 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -926,7 +926,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_setup(JNIEnv *env, jo
} else {
//__android_log_print(ANDROID_LOG_INFO,"godot","cmdline arg %i is: %s\n",i,rawString);
- if (strcmp(rawString, "-main_pack") == 0)
+ if (strcmp(rawString, "--main-pack") == 0)
use_apk_expansion = true;
}
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index 74d6536343..7e6a1518ed 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -28,11 +28,11 @@ def get_flags():
return [
('tools', False),
('module_theora_enabled', False),
- # Disabling the OpenSSL module noticeably reduces file size.
+ # Disabling the mbedtls module reduces file size.
# The module has little use due to the limited networking functionality
# in this platform. For the available networking methods, the browser
# manages TLS.
- ('module_openssl_enabled', False),
+ ('module_mbedtls_enabled', False),
]
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h
index 41e0585af6..e5f43f9433 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -167,6 +167,7 @@ public:
virtual void set_window_title(const String &p_title);
virtual Size2 get_window_size() const;
+ virtual Size2 get_real_window_size() const;
virtual void set_icon(const Ref<Image> &p_icon);
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 56ba80031b..65a168285d 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1869,6 +1869,12 @@ Size2 OS_OSX::get_window_size() const {
return window_size;
};
+Size2 OS_OSX::get_real_window_size() const {
+
+ NSRect frame = [window_object frame];
+ return Size2(frame.size.width, frame.size.height);
+}
+
void OS_OSX::set_window_size(const Size2 p_size) {
Size2 size = p_size;
diff --git a/platform/server/detect.py b/platform/server/detect.py
index 61b56ddefa..bc615d3d04 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -67,9 +67,6 @@ def configure(env):
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
- if not env['builtin_openssl']:
- env.ParseConfig('pkg-config openssl --cflags --libs')
-
if not env['builtin_libwebp']:
env.ParseConfig('pkg-config libwebp --cflags --libs')
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index de51c811b8..5d27fae148 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -1487,6 +1487,12 @@ Size2 OS_Windows::get_window_size() const {
GetClientRect(hWnd, &r);
return Vector2(r.right - r.left, r.bottom - r.top);
}
+Size2 OS_Windows::get_real_window_size() const {
+
+ RECT r;
+ GetWindowRect(hWnd, &r);
+ return Vector2(r.right - r.left, r.bottom - r.top);
+}
void OS_Windows::set_window_size(const Size2 p_size) {
video_mode.width = p_size.width;
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index bcbcf21926..3437b8547b 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -201,6 +201,7 @@ public:
virtual Point2 get_window_position() const;
virtual void set_window_position(const Point2 &p_position);
virtual Size2 get_window_size() const;
+ virtual Size2 get_real_window_size() const;
virtual void set_window_size(const Size2 p_size);
virtual void set_window_fullscreen(bool p_enabled);
virtual bool is_window_fullscreen() const;
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 02bd7232c2..c5ef82150b 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -65,7 +65,6 @@ def get_flags():
return [
('builtin_freetype', False),
('builtin_libpng', False),
- ('builtin_openssl', False),
('builtin_zlib', False),
]
@@ -153,8 +152,9 @@ def configure(env):
# FIXME: Check for existence of the libs before parsing their flags with pkg-config
- if not env['builtin_openssl']:
- env.ParseConfig('pkg-config openssl --cflags --libs')
+ if not env['builtin_mbedtls']:
+ # mbedTLS does not provide a pkgconfig config yet. See https://github.com/ARMmbed/mbedtls/issues/228
+ env.Append(LIBS=['mbedtls', 'mbedcrypto', 'mbedx509'])
if not env['builtin_libwebp']:
env.ParseConfig('pkg-config libwebp --cflags --libs')
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 43a7b41f8a..8f2c1812b4 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -939,6 +939,26 @@ Size2 OS_X11::get_window_size() const {
return Size2i(current_videomode.width, current_videomode.height);
}
+Size2 OS_X11::get_real_window_size() const {
+ XWindowAttributes xwa;
+ XSync(x11_display, False);
+ XGetWindowAttributes(x11_display, x11_window, &xwa);
+ int w = xwa.width;
+ int h = xwa.height;
+ Atom prop = XInternAtom(x11_display, "_NET_FRAME_EXTENTS", True);
+ Atom type;
+ int format;
+ unsigned long len;
+ unsigned long remaining;
+ unsigned char *data = NULL;
+ if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
+ long *extents = (long *)data;
+ w += extents[0] + extents[1]; // left, right
+ h += extents[2] + extents[3]; // top, bottom
+ }
+ return Size2(w, h);
+}
+
void OS_X11::set_window_size(const Size2 p_size) {
// If window resizable is disabled we need to update the attributes first
if (is_window_resizable() == false) {
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index c80a292002..b5ceea6eaf 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -199,7 +199,7 @@ protected:
virtual void set_main_loop(MainLoop *p_main_loop);
- void _window_changed(XEvent *xevent);
+ void _window_changed(XEvent *event);
bool is_window_maximize_allowed();
@@ -251,6 +251,7 @@ public:
virtual Point2 get_window_position() const;
virtual void set_window_position(const Point2 &p_position);
virtual Size2 get_window_size() const;
+ virtual Size2 get_real_window_size() const;
virtual void set_window_size(const Size2 p_size);
virtual void set_window_fullscreen(bool p_enabled);
virtual bool is_window_fullscreen() const;