Commit Graph

594 Commits

Author SHA1 Message Date
76a7ee88d2 Merge pull request #52604 from Faless/js/4.x_input_fix
[HTML5] Fix input not working when buffered.
2021-09-14 11:47:40 +02:00
4c6845c095 [HTML5] Fix input not working when buffered.
After input buffering was reworked, input accumulation is now handled
outside of OS, and the JavaScript plaform never implemented that.
Additionally, the JavaScript platform is quite obnoxious about calling
specific APIs outside specific user triggered events.

This commit adds event flushing during the main iteration, and forces it
during keydown/keyup/mousedown/mouseup/touchstart/touchend/touchcanel
events (effectively only accumulating only "move" events).
2021-09-12 19:07:44 +02:00
490511fcfe [HTML5] Fix build error due to missing string cast. 2021-09-12 19:07:18 +02:00
1513aa9b26 Add logo attribution for Android, HTML5 and Linux platform icons
- Tweak the Android platform logo to remove the Android wordmark,
  as it can't be used without explicit permission.
2021-09-11 19:34:10 +02:00
2daaf0fdc3 Make platform feature tag names lowercase
Feature tag names are still case-sensitive, but this makes built-in
feature tags more consistent.

- `Windows` -> `windows`
- `OSX` -> `osx`
- `LinuxBSD` -> `linuxbsd`
- `Android` -> `android`
- `iOS` -> `ios`
- `HTML5` -> `html5`
- `JavaScript` -> `javascript`
- `UWP` -> `uwp`
2021-08-31 20:34:44 +02:00
7ab78c4cad Merge pull request #49598 from Calinou/web-editor-improve-download-project-source-zip-name
Improve the generated ZIP archive name when using Download Project Source
2021-08-31 02:36:02 +02:00
16f49d4b29 HTML5: Handle GODOT_VERSION_STATUS env var in @GODOT_VERSION@
Follow-up to #51002.
2021-08-19 15:01:30 +02:00
71fb2429a0 [CI] Upgrade Emscripten to 2.0.27.
Update Godot Javascript FS library to manually depend on ERRNO_CODES.
2021-08-18 10:30:50 +01:00
719ff68fdd Improve the generated ZIP archive name when using Download Project Source
This makes for easier organization since downloading a project
several times (or several different projects) will result in more
meaningful file names.
2021-08-16 18:33:03 +02:00
9f49255bee Split javascript export template into multiple files 2021-08-12 17:18:36 +03:00
fa3a32a2d6 Use Key enum instead of plain integers 2021-08-10 16:26:55 -05:00
3564c16cb8 Fix various typos with codespell
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-25 11:21:51 +02:00
4e6efd1b07 Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
618eb27e8b Move alert function from DisplayServer to OS. 2021-07-22 21:50:35 +03:00
6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
38578a8095 Modernize Display server to use override keyword 2021-07-16 21:39:13 +02:00
7431586286 [HTML5] Make threads build the default.
Non-threads build are broken anyway.
2021-07-15 15:33:39 +02:00
3d8acc7a54 [HTML5] Fix build (with module_webxr_enabled=no).
The XR API changed a bit, and it's not just a rename, though probably an
easy update for someone who is qualified :).
2021-07-15 14:37:21 +02:00
06568bbfdf Misc cleanup of header includes
Was looking for misuse of module headers without checking that the module is
actually enabled and got carried away...
2021-07-15 00:46:43 +02:00
897c906ebf [HTML5] Raise default initial memory to 32 MiB.
The memory was resized in any case during start.

Mitigate Chromium issue:
https://bugs.chromium.org/p/v8/issues/detail?id=11863

Also fix a warning about SAFE_HEAP being a linker only flag.
2021-07-13 15:51:00 +02:00
5ad4f26659 Implement the ability to disable classes
* This PR adds the ability to disable classes when building.
* For now it's only possible to do this via command like:
  `scons disable_classes=RayCast2D,Area3D`
* Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
2021-07-13 09:25:14 -03:00
d4e302a3a4 [HTML5] Fix JavaScript string parsing with new interface.
Strings are UTF-8 encoded and should be parsed as such, while it was
being parsed as a C string before.
2021-07-07 15:44:29 +02:00
c12fca57f4 [HTML5] Add option to focus canvas on start.
Enabled by default.
2021-06-25 19:07:17 +02:00
91477cd4a9 Strip query string when parsing HTTP request line for path 2021-06-25 00:20:28 +08:00
b00c4a4360 [Net] Makes HTTPClient a custom instance class. 2021-06-23 14:10:45 +02:00
421e771012 [Net] Unify HTTPClient request and request_raw. 2021-06-23 13:53:43 +02:00
0ce49800ac Use mouse and joypad enums instead of plain integers
Also MIDIMessage
2021-06-20 11:54:24 -04:00
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
2bafcd3422 Consolidate JSON, JSONParseResults and JSONParser into JSON
Renames JSON.parse_string() to parse()
Renames JSON.decode_data() to stringify()
2021-06-19 08:01:40 +01:00
ad5bdaf5aa [HTML5] JS callback functions now returns passed value.
JavaScript callbacks created via the `JavaScript.create_callback` method
used to always return void.

With this patch they return the value returned by the Godot function as
one would expect.
2021-06-18 17:47:48 +02:00
88e671e0b7 Merge pull request #49592 from Faless/js/4.x_fix_sigs
[HTML5] Fix build without eval, library functions signatures.
2021-06-15 00:01:54 +02:00
a1cbb6daa6 [HTML5] Update eslint and jsdoc dependencies. 2021-06-14 13:42:03 +02:00
049b5159f1 [HTML5] Fix JS build without eval.
Also fix download_buffer return type.
2021-06-14 12:32:53 +02:00
9b7b0a28b9 [HTML5] Fix some JS library signature. 2021-06-14 12:32:32 +02:00
04688b92ff Rename Reference to RefCounted 2021-06-11 18:48:42 +02:00
9e328bb5b7 Core: Move DirAccess and FileAccess to core/io
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
ee2bea7a86 Fixed missed IDHandler dependency in GodotFetch 2021-06-08 00:20:24 +02:00
98aa3b669e Add MOUSE_MODE_CONFINED_HIDDEN
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2021-06-03 11:44:28 -04:00
8cdef21d6c Move remaining dummy drivers to servers. 2021-06-01 16:50:32 +02:00
8594613f94 LinuxBSD now compiles without vulkan/x11. 2021-06-01 16:27:54 +02:00
0d2e02945b Implement shader caching
* Shader compilation is now cached. Subsequent loads take less than a millisecond.
* Improved game, editor and project manager startup time.
* Editor uses .godot/shader_cache to store shaders.
* Game uses user://shader_cache
* Project manager uses $config_dir/shader_cache
* Options to tweak shader caching in project settings.
* Editor path configuration moved from EditorSettings to new class, EditorPaths, so it can be available early on (before shaders are compiled).
* Reworked ShaderCompilerRD to ensure deterministic shader code creation (else shader may change and cache will be invalidated).
* Added shader compression with SMOLV: https://github.com/aras-p/smol-v
2021-05-31 10:13:09 +02:00
da5d7db610 Rename File::get_len() get_length() 2021-05-25 11:54:28 +01:00
87f503310b Tweak dozens of editor property hints for consistency
- Update Viewport MSAA property hints to match the currently
  exposed values.
- Add some performance hints to property hints.
2021-05-25 02:50:35 +02:00
2362a59a11 Merge pull request #48928 from Faless/js/4.x_fix_build_after_rename
[HTML5] Fix build after KEY_CTRL rename.
2021-05-21 18:33:15 +02:00
923131ec28 [HTML5] Fix build after KEY_CTRL rename. 2021-05-21 15:53:23 +02:00
fdf66a21f1 [HTML5] Add easy to use download API.
New `JavaScript.download_buffer` method to create a prompt that let the
user download a file.
2021-05-21 15:31:23 +02:00
aa5552278d Merge pull request #48719 from Faless/js/4.x_interfaces
[HTML5] Implement Godot <-> JavaScript interface.
2021-05-20 17:13:02 +02:00
9811035ebf [HTML5] Implement Godot <-> JavaScript interface. 2021-05-20 14:33:18 +02:00
4219a4cb6f Fix typos with codespell
Using codespell 2.0.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
dof
doubleclick
fave
findn
GIRD
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2021-05-20 12:38:56 +02:00
14c057eab6 [HTML5] Fix GDNative compilation with emcc 2.0.19+
Add `WARN_ON_UNDEFINED_SYMBOLS=0` for the main module (which defines
`godot_js_main` as extern coming from the "side" module, i.e. the main
Godot binary).
2021-05-19 11:51:32 +02:00