diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/android_input_handler.cpp | 28 | ||||
-rw-r--r-- | platform/android/android_input_handler.h | 6 | ||||
-rw-r--r-- | platform/android/audio_driver_opensl.cpp | 12 | ||||
-rw-r--r-- | platform/android/audio_driver_opensl.h | 27 | ||||
-rw-r--r-- | platform/android/java/editor/src/main/res/values/dimens.xml | 2 | ||||
-rw-r--r-- | platform/android/java/lib/res/values/strings.xml | 2 | ||||
-rw-r--r-- | platform/android/java/lib/src/org/godotengine/godot/Godot.java | 5 | ||||
-rw-r--r-- | platform/android/java_godot_lib_jni.cpp | 2 | ||||
-rw-r--r-- | platform/linuxbsd/detect.py | 2 | ||||
-rw-r--r-- | platform/web/audio_driver_web.cpp | 8 | ||||
-rw-r--r-- | platform/web/audio_driver_web.h | 14 | ||||
-rw-r--r-- | platform/web/godot_audio.h | 4 | ||||
-rw-r--r-- | platform/web/js/libs/library_godot_audio.js | 12 |
13 files changed, 74 insertions, 50 deletions
diff --git a/platform/android/android_input_handler.cpp b/platform/android/android_input_handler.cpp index 17903b3965..6d34e28182 100644 --- a/platform/android/android_input_handler.cpp +++ b/platform/android/android_input_handler.cpp @@ -129,13 +129,22 @@ void AndroidInputHandler::process_key_event(int p_physical_keycode, int p_unicod Input::get_singleton()->parse_input_event(ev); } -void AndroidInputHandler::_parse_all_touch(bool p_pressed, bool p_double_tap) { +void AndroidInputHandler::_cancel_all_touch() { + _parse_all_touch(false, false, true); + touch.clear(); +} + +void AndroidInputHandler::_parse_all_touch(bool p_pressed, bool p_double_tap, bool reset_index) { if (touch.size()) { //end all if exist for (int i = 0; i < touch.size(); i++) { Ref<InputEventScreenTouch> ev; ev.instantiate(); - ev->set_index(touch[i].id); + if (reset_index) { + ev->set_index(-1); + } else { + ev->set_index(touch[i].id); + } ev->set_pressed(p_pressed); ev->set_position(touch[i].pos); ev->set_double_tap(p_double_tap); @@ -196,7 +205,9 @@ void AndroidInputHandler::process_touch_event(int p_event, int p_pointer, const } } break; - case AMOTION_EVENT_ACTION_CANCEL: + case AMOTION_EVENT_ACTION_CANCEL: { + _cancel_all_touch(); + } break; case AMOTION_EVENT_ACTION_UP: { //release _release_all_touch(); } break; @@ -236,6 +247,12 @@ void AndroidInputHandler::process_touch_event(int p_event, int p_pointer, const } } +void AndroidInputHandler::_cancel_mouse_event_info(bool p_source_mouse_relative) { + buttons_state = BitField<MouseButtonMask>(); + _parse_mouse_event_info(BitField<MouseButtonMask>(), false, false, p_source_mouse_relative); + mouse_event_info.valid = false; +} + void AndroidInputHandler::_parse_mouse_event_info(BitField<MouseButtonMask> event_buttons_mask, bool p_pressed, bool p_double_click, bool p_source_mouse_relative) { if (!mouse_event_info.valid) { return; @@ -296,8 +313,11 @@ void AndroidInputHandler::process_mouse_event(int p_event_action, int p_event_an _parse_mouse_event_info(event_buttons_mask, true, p_double_click, p_source_mouse_relative); } break; + case AMOTION_EVENT_ACTION_CANCEL: { + _cancel_mouse_event_info(p_source_mouse_relative); + } break; + case AMOTION_EVENT_ACTION_UP: - case AMOTION_EVENT_ACTION_CANCEL: case AMOTION_EVENT_ACTION_BUTTON_RELEASE: { _release_mouse_event_info(p_source_mouse_relative); } break; diff --git a/platform/android/android_input_handler.h b/platform/android/android_input_handler.h index 6e53dcfc89..a56b6aa6c4 100644 --- a/platform/android/android_input_handler.h +++ b/platform/android/android_input_handler.h @@ -87,10 +87,14 @@ private: void _release_mouse_event_info(bool p_source_mouse_relative = false); - void _parse_all_touch(bool p_pressed, bool p_double_tap); + void _cancel_mouse_event_info(bool p_source_mouse_relative = false); + + void _parse_all_touch(bool p_pressed, bool p_double_tap, bool reset_index = false); void _release_all_touch(); + void _cancel_all_touch(); + public: void process_mouse_event(int p_event_action, int p_event_android_buttons_mask, Point2 p_event_pos, Vector2 p_delta, bool p_double_click, bool p_source_mouse_relative); void process_touch_event(int p_event, int p_pointer, const Vector<TouchPos> &p_points, bool p_double_tap); diff --git a/platform/android/audio_driver_opensl.cpp b/platform/android/audio_driver_opensl.cpp index 9dad0c9357..5fc32132e3 100644 --- a/platform/android/audio_driver_opensl.cpp +++ b/platform/android/audio_driver_opensl.cpp @@ -80,10 +80,6 @@ void AudioDriverOpenSL::_buffer_callbacks( ad->_buffer_callback(queueItf); } -const char *AudioDriverOpenSL::get_name() const { - return "Android"; -} - Error AudioDriverOpenSL::init() { SLresult res; SLEngineOption EngineOption[] = { @@ -204,7 +200,7 @@ void AudioDriverOpenSL::_record_buffer_callbacks(SLAndroidSimpleBufferQueueItf q ad->_record_buffer_callback(queueItf); } -Error AudioDriverOpenSL::capture_init_device() { +Error AudioDriverOpenSL::init_input_device() { SLDataLocator_IODevice loc_dev = { SL_DATALOCATOR_IODEVICE, SL_IODEVICE_AUDIOINPUT, @@ -271,15 +267,15 @@ Error AudioDriverOpenSL::capture_init_device() { return OK; } -Error AudioDriverOpenSL::capture_start() { +Error AudioDriverOpenSL::input_start() { if (OS::get_singleton()->request_permission("RECORD_AUDIO")) { - return capture_init_device(); + return init_input_device(); } return OK; } -Error AudioDriverOpenSL::capture_stop() { +Error AudioDriverOpenSL::input_stop() { SLuint32 state; SLresult res = (*recordItf)->GetRecordState(recordItf, &state); ERR_FAIL_COND_V(res != SL_RESULT_SUCCESS, ERR_CANT_OPEN); diff --git a/platform/android/audio_driver_opensl.h b/platform/android/audio_driver_opensl.h index ae8c33fec0..6ea0f77def 100644 --- a/platform/android/audio_driver_opensl.h +++ b/platform/android/audio_driver_opensl.h @@ -84,23 +84,26 @@ class AudioDriverOpenSL : public AudioDriver { SLAndroidSimpleBufferQueueItf queueItf, void *pContext); - virtual Error capture_init_device(); + Error init_input_device(); public: - virtual const char *get_name() const; + virtual const char *get_name() const override { + return "Android"; + } - virtual Error init(); - virtual void start(); - virtual int get_mix_rate() const; - virtual SpeakerMode get_speaker_mode() const; - virtual void lock(); - virtual void unlock(); - virtual void finish(); + virtual Error init() override; + virtual void start() override; + virtual int get_mix_rate() const override; + virtual SpeakerMode get_speaker_mode() const override; - virtual void set_pause(bool p_pause); + virtual void lock() override; + virtual void unlock() override; + virtual void finish() override; - virtual Error capture_start(); - virtual Error capture_stop(); + virtual Error input_start() override; + virtual Error input_stop() override; + + void set_pause(bool p_pause); AudioDriverOpenSL(); }; diff --git a/platform/android/java/editor/src/main/res/values/dimens.xml b/platform/android/java/editor/src/main/res/values/dimens.xml index 03fb6184d2..98bfe40179 100644 --- a/platform/android/java/editor/src/main/res/values/dimens.xml +++ b/platform/android/java/editor/src/main/res/values/dimens.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="editor_default_window_height">600dp</dimen> - <dimen name="editor_default_window_width">800dp</dimen> + <dimen name="editor_default_window_width">1024dp</dimen> </resources> diff --git a/platform/android/java/lib/res/values/strings.xml b/platform/android/java/lib/res/values/strings.xml index f76f597140..03752e092e 100644 --- a/platform/android/java/lib/res/values/strings.xml +++ b/platform/android/java/lib/res/values/strings.xml @@ -14,7 +14,7 @@ <string name="text_button_cancel_verify">Cancel Verification</string> <string name="text_error_title">Error!</string> <string name="error_engine_setup_message">Unable to setup the Godot Engine! Aborting…</string> - <string name="error_missing_vulkan_requirements_message">This device does not meet the requirements for Vulkan support! Aborting…</string> + <string name="error_missing_vulkan_requirements_message">Warning - this device does not meet the requirements for Vulkan support</string> <!-- APK Expansion Strings --> diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.java b/platform/android/java/lib/src/org/godotengine/godot/Godot.java index 307fa7bae1..a03da7292b 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.java @@ -83,6 +83,7 @@ import android.widget.Button; import android.widget.FrameLayout; import android.widget.ProgressBar; import android.widget.TextView; +import android.widget.Toast; import androidx.annotation.CallSuper; import androidx.annotation.Keep; @@ -277,9 +278,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC if (usesVulkan()) { if (!meetsVulkanRequirements(activity.getPackageManager())) { - Log.e(TAG, "Missing requirements for vulkan support! Aborting..."); - alert(R.string.error_missing_vulkan_requirements_message, R.string.text_error_title, this::forceQuit); - return false; + Log.w(TAG, "Missing requirements for vulkan support!"); } mRenderView = new GodotVulkanRenderView(activity, this); } else { diff --git a/platform/android/java_godot_lib_jni.cpp b/platform/android/java_godot_lib_jni.cpp index 1ee1cccb82..e7abe580f1 100644 --- a/platform/android/java_godot_lib_jni.cpp +++ b/platform/android/java_godot_lib_jni.cpp @@ -488,7 +488,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_calldeferred(JNIEnv * JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_requestPermissionResult(JNIEnv *env, jclass clazz, jstring p_permission, jboolean p_result) { String permission = jstring_to_string(p_permission, env); if (permission == "android.permission.RECORD_AUDIO" && p_result) { - AudioDriver::get_singleton()->capture_start(); + AudioDriver::get_singleton()->input_start(); } if (os_android->get_main_loop()) { diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py index 36e149f2b4..bae5a98aee 100644 --- a/platform/linuxbsd/detect.py +++ b/platform/linuxbsd/detect.py @@ -346,7 +346,7 @@ def configure(env: "Environment"): gnu_ld_version = re.search("^GNU ld [^$]*(\d+\.\d+)$", linker_version_str, re.MULTILINE) if not gnu_ld_version: print( - "Warning: Creating template binaries enabled for PCK embedding is currently only supported with GNU ld, not gold or LLD." + "Warning: Creating export template binaries enabled for PCK embedding is currently only supported with GNU ld, not gold, LLD or mold." ) else: if float(gnu_ld_version.group(1)) >= 2.30: diff --git a/platform/web/audio_driver_web.cpp b/platform/web/audio_driver_web.cpp index a5234627d1..1d7b96d707 100644 --- a/platform/web/audio_driver_web.cpp +++ b/platform/web/audio_driver_web.cpp @@ -166,18 +166,18 @@ void AudioDriverWeb::finish() { } } -Error AudioDriverWeb::capture_start() { +Error AudioDriverWeb::input_start() { lock(); input_buffer_init(buffer_length); unlock(); - if (godot_audio_capture_start()) { + if (godot_audio_input_start()) { return FAILED; } return OK; } -Error AudioDriverWeb::capture_stop() { - godot_audio_capture_stop(); +Error AudioDriverWeb::input_stop() { + godot_audio_input_stop(); lock(); input_buffer.clear(); unlock(); diff --git a/platform/web/audio_driver_web.h b/platform/web/audio_driver_web.h index f3afbdbb92..be13935bd9 100644 --- a/platform/web/audio_driver_web.h +++ b/platform/web/audio_driver_web.h @@ -77,12 +77,12 @@ public: virtual void start() final; virtual void finish() final; - virtual float get_latency() override; virtual int get_mix_rate() const override; virtual SpeakerMode get_speaker_mode() const override; + virtual float get_latency() override; - virtual Error capture_start() override; - virtual Error capture_stop() override; + virtual Error input_start() override; + virtual Error input_stop() override; static void resume(); @@ -111,10 +111,12 @@ protected: virtual void finish_driver() override; public: - virtual const char *get_name() const override { return "AudioWorklet"; } + virtual const char *get_name() const override { + return "AudioWorklet"; + } - void lock() override; - void unlock() override; + virtual void lock() override; + virtual void unlock() override; }; #endif // AUDIO_DRIVER_WEB_H diff --git a/platform/web/godot_audio.h b/platform/web/godot_audio.h index d7bff078f8..c6f92161fa 100644 --- a/platform/web/godot_audio.h +++ b/platform/web/godot_audio.h @@ -43,8 +43,8 @@ extern int godot_audio_has_script_processor(); extern int godot_audio_init(int *p_mix_rate, int p_latency, void (*_state_cb)(int), void (*_latency_cb)(float)); extern void godot_audio_resume(); -extern int godot_audio_capture_start(); -extern void godot_audio_capture_stop(); +extern int godot_audio_input_start(); +extern void godot_audio_input_stop(); // Worklet typedef int32_t GodotAudioState[4]; diff --git a/platform/web/js/libs/library_godot_audio.js b/platform/web/js/libs/library_godot_audio.js index 68348a3962..1993d66310 100644 --- a/platform/web/js/libs/library_godot_audio.js +++ b/platform/web/js/libs/library_godot_audio.js @@ -186,17 +186,17 @@ const GodotAudio = { } }, - godot_audio_capture_start__proxy: 'sync', - godot_audio_capture_start__sig: 'i', - godot_audio_capture_start: function () { + godot_audio_input_start__proxy: 'sync', + godot_audio_input_start__sig: 'i', + godot_audio_input_start: function () { return GodotAudio.create_input(function (input) { input.connect(GodotAudio.driver.get_node()); }); }, - godot_audio_capture_stop__proxy: 'sync', - godot_audio_capture_stop__sig: 'v', - godot_audio_capture_stop: function () { + godot_audio_input_stop__proxy: 'sync', + godot_audio_input_stop__sig: 'v', + godot_audio_input_stop: function () { if (GodotAudio.input) { const tracks = GodotAudio.input['mediaStream']['getTracks'](); for (let i = 0; i < tracks.length; i++) { |