summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/os_android.cpp34
-rw-r--r--platform/iphone/gl_view.mm13
-rw-r--r--platform/uwp/export/export.cpp10
-rwxr-xr-x[-rw-r--r--]platform/windows/os_windows.cpp12
-rw-r--r--platform/x11/os_x11.cpp1
5 files changed, 28 insertions, 42 deletions
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index 9156181bbe..defee8f1f1 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -49,9 +49,6 @@
#include "java_godot_io_wrapper.h"
#include "java_godot_wrapper.h"
-#define PAN_GESTURE_MIN_DELTA 5 // only advertise PanGesture event with dx and dy greater than this
-#define MAGNIFY_GESTURE_MIN_FACTOR 0.1 // only advertise MagnifyGesture event with a factor difference from 1.0 greater than this
-
class AndroidLogger : public Logger {
public:
virtual void logv(const char *p_format, va_list p_list, bool p_err) {
@@ -409,35 +406,6 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ERR_FAIL_COND(touch.size() != p_points.size());
- if (touch.size() == 1) {
- Point2 d = (p_points[0].pos - touch.write[0].pos);
- if (fabs(d.x) > PAN_GESTURE_MIN_DELTA || fabs(d.y) > PAN_GESTURE_MIN_DELTA) {
- Ref<InputEventPanGesture> ev;
- ev.instance();
- ev->set_position(p_points[0].pos);
- ev->set_delta(d);
- input->parse_input_event(ev);
- touch.write[0].pos = p_points[0].pos;
- }
- } else if (touch.size() == 2) {
- Point2 v0 = touch[1].pos - touch[0].pos;
- float l0 = (v0.x * v0.x) + (v0.y * v0.y);
- if (l0 != 0.0) {
- Point2 v1 = p_points[1].pos - p_points[0].pos;
- float l1 = (v1.x * v1.x) + (v1.y * v1.y);
- float f = (l1 / l0);
- if (fabs(f - 1.0) > MAGNIFY_GESTURE_MIN_FACTOR) {
- Ref<InputEventMagnifyGesture> ev;
- ev.instance();
- ev->set_position(p_points[0].pos + v1 / 2);
- ev->set_factor(sqrt(f));
- input->parse_input_event(ev);
- touch.write[0].pos = p_points[0].pos;
- touch.write[1].pos = p_points[1].pos;
- }
- }
- }
-
for (int i = 0; i < touch.size(); i++) {
int idx = -1;
@@ -452,7 +420,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ERR_CONTINUE(idx == -1);
if (touch[i].pos == p_points[idx].pos)
- continue; //no unnecessary move
+ continue; //no move unncesearily
Ref<InputEventScreenDrag> ev;
ev.instance();
diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm
index 2ac158e6d3..4e6b8e1ada 100644
--- a/platform/iphone/gl_view.mm
+++ b/platform/iphone/gl_view.mm
@@ -340,6 +340,7 @@ static void clear_touches() {
[EAGLContext setCurrentContext:context];
[self destroyFramebuffer];
[self createFramebuffer];
+ [self drawView];
}
- (BOOL)createFramebuffer {
@@ -455,23 +456,23 @@ static void clear_touches() {
// Updates the OpenGL view when the timer fires
- (void)drawView {
+
+ if (!active) {
+ printf("draw view not active!\n");
+ return;
+ };
if (useCADisplayLink) {
// Pause the CADisplayLink to avoid recursion
[displayLink setPaused:YES];
// Process all input events
- while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, TRUE) == kCFRunLoopRunHandledSource)
+ while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, TRUE) == kCFRunLoopRunHandledSource)
;
// We are good to go, resume the CADisplayLink
[displayLink setPaused:NO];
}
- if (!active) {
- printf("draw view not active!\n");
- return;
- };
-
// Make sure that you are drawing to the current context
[EAGLContext setCurrentContext:context];
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp
index fefad3584b..557699cf37 100644
--- a/platform/uwp/export/export.cpp
+++ b/platform/uwp/export/export.cpp
@@ -1144,11 +1144,21 @@ public:
return valid;
}
+ if (!_valid_resource_name(p_preset->get("package/short_name"))) {
+ valid = false;
+ err += TTR("Invalid package short name.") + "\n";
+ }
+
if (!_valid_resource_name(p_preset->get("package/unique_name"))) {
valid = false;
err += TTR("Invalid package unique name.") + "\n";
}
+ if (!_valid_resource_name(p_preset->get("package/publisher_display_name"))) {
+ valid = false;
+ err += TTR("Invalid package publisher display name.") + "\n";
+ }
+
if (!_valid_guid(p_preset->get("identity/product_guid"))) {
valid = false;
err += TTR("Invalid product GUID.") + "\n";
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index c4cd8e068c..429657f332 100644..100755
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -556,8 +556,14 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
mm->set_button_mask(last_button_state);
- mm->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
- mm->set_global_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
+ POINT coords; //client coords
+ coords.x = GET_X_LPARAM(lParam);
+ coords.y = GET_Y_LPARAM(lParam);
+
+ ScreenToClient(hWnd, &coords);
+
+ mm->set_position(Vector2(coords.x, coords.y));
+ mm->set_global_position(Vector2(coords.x, coords.y));
if (mouse_mode == MOUSE_MODE_CAPTURED) {
@@ -2982,7 +2988,7 @@ void OS_Windows::move_window_to_foreground() {
Error OS_Windows::shell_open(String p_uri) {
- ShellExecuteW(NULL, L"open", p_uri.c_str(), NULL, NULL, SW_SHOWNORMAL);
+ ShellExecuteW(NULL, NULL, p_uri.c_str(), NULL, NULL, SW_SHOWNORMAL);
return OK;
}
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index c695d657e7..54d3759cc5 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1866,6 +1866,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
input->accumulate_input_event(k);
}
+ memfree(utf8string);
return;
}
memfree(utf8string);