summaryrefslogtreecommitdiff
path: root/platform/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'platform/javascript')
-rw-r--r--platform/javascript/http_request.h2
-rw-r--r--platform/javascript/os_javascript.cpp12
2 files changed, 8 insertions, 6 deletions
diff --git a/platform/javascript/http_request.h b/platform/javascript/http_request.h
index 80ff3f0ba8..06d9239004 100644
--- a/platform/javascript/http_request.h
+++ b/platform/javascript/http_request.h
@@ -34,6 +34,8 @@
extern "C" {
#endif
+#include "stddef.h"
+
typedef enum {
XHR_READY_STATE_UNSENT = 0,
XHR_READY_STATE_OPENED = 1,
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index e5bdcec30d..77d81aec5d 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -29,8 +29,8 @@
/*************************************************************************/
#include "os_javascript.h"
+#include "core/engine.h"
#include "core/io/file_access_buffered_fa.h"
-#include "core/project_settings.h"
#include "dom_keys.h"
#include "drivers/gles3/rasterizer_gles3.h"
#include "drivers/unix/dir_access_unix.h"
@@ -166,14 +166,15 @@ static EM_BOOL _mousebutton_callback(int event_type, const EmscriptenMouseEvent
}
int mask = _input->get_mouse_button_mask();
+ int button_flag = 1 << (ev->get_button_index() - 1);
if (ev->is_pressed()) {
// since the event is consumed, focus manually
if (!is_canvas_focused()) {
focus_canvas();
}
- mask |= ev->get_button_index();
- } else if (mask & ev->get_button_index()) {
- mask &= ~ev->get_button_index();
+ mask |= button_flag;
+ } else if (mask & button_flag) {
+ mask &= ~button_flag;
} else {
// release event, but press was outside the canvas, so ignore
return false;
@@ -513,7 +514,7 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i
#ifdef JAVASCRIPT_EVAL_ENABLED
javascript_eval = memnew(JavaScript);
- ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaScript", javascript_eval));
+ Engine::get_singleton()->add_singleton(Engine::Singleton("JavaScript", javascript_eval));
#endif
visual_server->init();
@@ -895,7 +896,6 @@ String OS_JavaScript::get_data_dir() const {
return get_data_dir_func();
*/
return "/userfs";
- //return ProjectSettings::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir");
};
String OS_JavaScript::get_executable_path() const {