diff options
Diffstat (limited to 'platform/javascript')
| -rw-r--r-- | platform/javascript/audio_server_javascript.cpp | 30 | ||||
| -rw-r--r-- | platform/javascript/audio_server_javascript.h | 30 | ||||
| -rw-r--r-- | platform/javascript/detect.py | 3 | ||||
| -rw-r--r-- | platform/javascript/dom_keys.h | 30 | ||||
| -rw-r--r-- | platform/javascript/export/export.cpp | 2 | ||||
| -rw-r--r-- | platform/javascript/logo.png | bin | 4807 -> 2316 bytes | |||
| -rw-r--r-- | platform/javascript/os_javascript.cpp | 3 |
7 files changed, 80 insertions, 18 deletions
diff --git a/platform/javascript/audio_server_javascript.cpp b/platform/javascript/audio_server_javascript.cpp index fbd5d2e1c0..71a7e77266 100644 --- a/platform/javascript/audio_server_javascript.cpp +++ b/platform/javascript/audio_server_javascript.cpp @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_server_javascript.cpp */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #include "audio_server_javascript.h" #include "emscripten.h" @@ -88,7 +116,7 @@ void AudioServerJavascript::sample_set_data(RID p_sample, const DVector<uint8_t> } -const DVector<uint8_t> AudioServerJavascript::sample_get_data(RID p_sample) const{ +DVector<uint8_t> AudioServerJavascript::sample_get_data(RID p_sample) const{ return DVector<uint8_t>(); diff --git a/platform/javascript/audio_server_javascript.h b/platform/javascript/audio_server_javascript.h index 1dc90c48ee..e27192cd93 100644 --- a/platform/javascript/audio_server_javascript.h +++ b/platform/javascript/audio_server_javascript.h @@ -1,3 +1,31 @@ +/*************************************************************************/ +/* audio_server_javascript.h */ +/*************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* http://www.godotengine.org */ +/*************************************************************************/ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*************************************************************************/ #ifndef AUDIO_SERVER_JAVASCRIPT_H #define AUDIO_SERVER_JAVASCRIPT_H @@ -104,7 +132,7 @@ public: virtual void sample_set_data(RID p_sample, const DVector<uint8_t>& p_buffer); - virtual const DVector<uint8_t> sample_get_data(RID p_sample) const; + virtual DVector<uint8_t> sample_get_data(RID p_sample) const; virtual void sample_set_mix_rate(RID p_sample,int p_rate); virtual int sample_get_mix_rate(RID p_sample) const; diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index a9103b4c15..aeff5a1a34 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -45,6 +45,9 @@ def get_flags(): def configure(env): + env['ENV'] = os.environ; + env.use_windows_spawn_fix('javascript') + env.Append(CPPPATH=['#platform/javascript']) em_path=os.environ["EMSCRIPTEN_ROOT"] diff --git a/platform/javascript/dom_keys.h b/platform/javascript/dom_keys.h index 555c90a529..282b632e93 100644 --- a/platform/javascript/dom_keys.h +++ b/platform/javascript/dom_keys.h @@ -220,17 +220,17 @@ #define DOM_VK_WIN_OEM_CLEAR 0xFE int dom2godot_scancode(int dom_keycode) { - + if (DOM_VK_0 <= dom_keycode && dom_keycode <= DOM_VK_Z) { // ASCII intersection return dom_keycode; } - + if (DOM_VK_NUMPAD0 <= dom_keycode && dom_keycode <= DOM_VK_NUMPAD9) { // Numpad numbers return KEY_KP_0 + (dom_keycode - DOM_VK_NUMPAD0); } - + if (DOM_VK_F1 <= dom_keycode && dom_keycode <= DOM_VK_F16) { // F1-F16 return KEY_F1 + (dom_keycode - DOM_VK_F1); @@ -259,7 +259,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_PAUSE: return KEY_PAUSE; case DOM_VK_CAPS_LOCK: return KEY_CAPSLOCK; - + /* case DOM_VK_KANA: return KEY_UNKNOWN; case DOM_VK_HANGUL: return KEY_UNKNOWN; @@ -269,7 +269,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_HANJA: return KEY_UNKNOWN; case DOM_VK_KANJI: return KEY_UNKNOWN; */ - + case DOM_VK_ESCAPE: return KEY_ESCAPE; /* case DOM_VK_CONVERT: return KEY_UNKNOWN; @@ -277,8 +277,8 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_ACCEPT: return KEY_UNKNOWN; case DOM_VK_MODECHANGE: return KEY_UNKNOWN; */ - - case DOM_VK_SPACE: return KEY_SPACE; + + case DOM_VK_SPACE: return KEY_SPACE; case DOM_VK_PAGE_UP: return KEY_PAGEUP; case DOM_VK_PAGE_DOWN: return KEY_PAGEDOWN; case DOM_VK_END: return KEY_END; @@ -287,7 +287,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_UP: return KEY_UP; case DOM_VK_RIGHT: return KEY_RIGHT; case DOM_VK_DOWN: return KEY_DOWN; - + //case DOM_VK_SELECT: return KEY_UNKNOWN; case DOM_VK_PRINTSCREEN: // this is the usual printScreen key @@ -297,7 +297,7 @@ int dom2godot_scancode(int dom_keycode) { //case DOM_VK_EXECUTE: return KEY_UNKNOWN; case DOM_VK_INSERT: return KEY_INSERT; case DOM_VK_DELETE: return KEY_DELETE; - + case DOM_VK_META: case DOM_VK_WIN: return KEY_META; @@ -312,7 +312,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_SUBTRACT: return KEY_KP_SUBTRACT; case DOM_VK_DECIMAL: return KEY_KP_PERIOD; case DOM_VK_DIVIDE: return KEY_KP_DIVIDE; - + /* case DOM_VK_F17: return KEY_UNKNOWN; case DOM_VK_F18: return KEY_UNKNOWN; @@ -323,7 +323,7 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_F23: return KEY_UNKNOWN; case DOM_VK_F24: return KEY_UNKNOWN; */ - + case DOM_VK_NUM_LOCK: return KEY_NUMLOCK; case DOM_VK_SCROLL_LOCK: return KEY_SCROLLLOCK; @@ -352,11 +352,11 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_OPEN_CURLY_BRACKET: return KEY_BRACELEFT; case DOM_VK_CLOSE_CURLY_BRACKET: return KEY_BRACERIGHT; case DOM_VK_TILDE: return KEY_ASCIITILDE; - + case DOM_VK_VOLUME_MUTE: return KEY_VOLUMEMUTE; case DOM_VK_VOLUME_DOWN: return KEY_VOLUMEDOWN; case DOM_VK_VOLUME_UP: return KEY_VOLUMEUP; - + case DOM_VK_COMMA: return KEY_COMMA; case DOM_VK_PERIOD: return KEY_PERIOD; case DOM_VK_SLASH: return KEY_SLASH; @@ -365,9 +365,9 @@ int dom2godot_scancode(int dom_keycode) { case DOM_VK_BACK_SLASH: return KEY_BACKSLASH; case DOM_VK_CLOSE_BRACKET: return KEY_BRACKETRIGHT; case DOM_VK_QUOTE: return KEY_APOSTROPHE; - + // rest is OEM/unusual - + default: return KEY_UNKNOWN; }; } diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp index e055aeea56..de57d770c4 100644 --- a/platform/javascript/export/export.cpp +++ b/platform/javascript/export/export.cpp @@ -86,7 +86,7 @@ public: virtual String get_device_info(int p_device) const { return "Run exported HTML in the system's default browser."; } virtual Error run(int p_device,int p_flags=0); - virtual bool requieres_password(bool p_debug) const { return false; } + virtual bool requires_password(bool p_debug) const { return false; } virtual String get_binary_extension() const { return "html"; } virtual Error export_project(const String& p_path,bool p_debug,int p_flags=0); diff --git a/platform/javascript/logo.png b/platform/javascript/logo.png Binary files differindex 07e0a41292..ce911180ac 100644 --- a/platform/javascript/logo.png +++ b/platform/javascript/logo.png diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp index fa6642557c..e802a7e9cb 100644 --- a/platform/javascript/os_javascript.cpp +++ b/platform/javascript/os_javascript.cpp @@ -420,6 +420,9 @@ void OS_JavaScript::push_input(const InputEvent& p_ev) { InputEvent ev = p_ev; ev.ID=last_id++; + if (ev.type==InputEvent::MOUSE_MOTION) { + input->set_mouse_pos(Point2(ev.mouse_motion.x, ev.mouse_motion.y)); + } input->parse_input_event(p_ev); } |