Commit Graph

717 Commits

Author SHA1 Message Date
c2e3971013 Improve performance of screen_get_dpi() in Javascript
Replace a bisect with a single multiplication when calling
screen_get_dpi() in Javascript

Tested the value of
window.matchMedia(`(resolution:${(window.devicePixelRatio*96).toFixed(100)}dpi)`).matches
which is true except for values that cause a lot of rounding errors
(e.g. dpr : 0.3  => resolution: 28.799999999999997dpi)

Even in these cases the value matches the result of the previous
`findDPI()` method.

See also:

6cff589b5b (r81273660)
2022-08-15 21:12:19 -07:00
45c7377556 Refactor the export checking logic to improve separation of concerns 2022-08-14 09:12:04 -07:00
103c0fa6e6 Add support for multiple virtual keyboard types 2022-08-04 10:41:33 -04:00
9f55bd971e Extract EditorResourceConversionPlugin into its own source files and clean up editor includes 2022-07-31 21:14:15 +03:00
3e5ad8213f Merge pull request #63563 from aaronfranke/export-arch 2022-07-30 11:22:25 +02:00
a0072ba39f Make some editor export methods const 2022-07-29 10:24:13 -05:00
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
130e715ab9 HTML5: Add support for Input.vibrate_handheld() 2022-07-27 22:54:41 +03:00
e53ae13178 Split up editor export code into multiple files 2022-07-26 08:28:19 -05:00
90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
d57a76c809 HTML5: Make OS.get_locale() match other platforms
Fixes #63029.
2022-07-15 22:11:39 +03:00
d2900429e8 Add static methods for creating Image and ImageTexture 2022-07-08 13:40:47 +02:00
7e43fb6ad2 Default cursor fix for html5 export 2022-07-01 20:50:04 +02:00
8d94d26caf refactoring: simplify compiler version check 2022-06-14 22:23:20 +07:00
3a2fbd6fae [HTML5] Add GDNative+Threads build. 2022-06-14 14:09:06 +02:00
e00571b194 Add readable export errors. 2022-06-08 17:55:46 +03:00
6aa7449d60 HTML5: Run npm audit fix
And re-add `node_modules` to `.gitignore` which I mistakenly removed
with an earlier cleanup.
2022-05-25 14:56:43 +02:00
3ff6d794c0 HTML5: Enable mbedTLS module for Crypto object
Increases the size of the wasm by around 3% (~300-350 KiB).

This enables using the Crypto object for hashing, signing and encryption,
and therefore reduces the gap between the features of the HTML5 platform
and other platforms.

Closes https://github.com/godotengine/godot-proposals/issues/3574.
2022-05-25 14:19:49 +02:00
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
3aa83a0235 Merge pull request #61020 from timothyqiu/wait-busy 2022-05-19 15:41:41 +02:00
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
ffd5362187 Swap the meaning of CURSOR_WAIT and CURSOR_BUSY 2022-05-14 10:13:42 +08:00
d36c5514d3 Fix ZipIO crash when reused (and possible leaks). 2022-05-11 16:08:17 +03:00
9bdb853eec [HTML5] Limit the returned OS cpu count to 2.
Temporarily workaround issues due to godot spawning too many threads.
2022-05-11 00:26:02 +02:00
39d9a5540c [HTML5] Fix JS "tools" editor plugin.
Needed update after file/dir access refactoring.
2022-05-10 23:56:32 +02:00
e8110474b6 [HTML5] Add "webgl/webgl2.h" as OpenGL include.
Requires emscripten versions > 2.0.17 .
2022-05-10 23:56:21 +02:00
5022efef02 Merge pull request #51682 from mdavisprog/os-is-process-running
OS::is_process_running function.
2022-05-04 09:02:33 +02:00
f3c1232c59 Add OS::is_process_running function.
Adds the is_process_running function to the native OS class and exposes it to script.

This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function.

Documentation is updated to reflect new API function.
2022-05-03 17:27:17 -07:00
070bd87aaa [JS] Add flag to disable weak symbols in ZSTD.
Weak symbols are currently broken in upstream emscripten.
2022-05-03 21:52:55 +02:00
a4c3e915be Added missing signature. 2022-05-03 18:44:49 +02:00
297241f368 Merge pull request #60714 from Calinou/typedef-remove-ref
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
2022-05-03 14:28:18 +02:00
180e5d3028 Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
80f61352fb Add GDNativeInterface::get_library_path to GDExtension 2022-04-29 00:51:04 +02:00
6ab672d1ef Implement text-to-speech support on Android, iOS, HTML5, Linux, macOS and Windows.
Implement TextServer word break method.
2022-04-28 14:35:41 +03:00
de4c97758a Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
4bf99f4af2 Narrow FileAccess scope to prevent deadlocks. 2022-04-12 10:54:39 +03:00
9381acb6a4 Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
93b7a85c98 HTML5: Explain why export templates are missing
Same for UWP.

This is skipped in DEV_ENABLED builds so contributors can still test
the export pipeline (and CI still compiles it on debug builds).
2022-03-26 20:27:36 +01:00
505dce7528 Bump minimist from 1.2.5 to 1.2.6 in /platform/javascript
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-23 19:50:11 +00:00
f995f47965 Merge pull request #59062 from BastiaanOlij/storagerd_texture 2022-03-17 10:08:33 +01:00
98d0af7d5c Implement GDExtension export plugin. 2022-03-16 11:16:19 +02:00
57e5a33623 Split dummy renderer classes into separate files
Split canvas_texture_storage and texture_storage from render_storage class
2022-03-16 17:43:10 +11:00
768f9422bc Convert uses of DirAccess * to DirAccessRef to prevent memleaks
`DirAccess *` needs to be deleted manually, and this is often forgotten
especially when doing early returns with `ERR_FAIL_COND`.
`DirAccessRef` is deleted automatically when it goes out of scope.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-03-11 09:13:11 +01:00
6f51eca1e3 Discern between virtual and abstract class bindings
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract".
* Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions.
* Converted a large amount of classes from "abstract" to "virtual" where it makes sense.

Most classes that make sense have been converted. Missing:

* Physics servers
* VideoStream
* Script* classes.

which will go in a separate PR due to the complexity involved.
2022-03-10 12:28:11 +01:00
21637dfc25 Remove VARIANT_ARG* macros
* Very old macros from the time Godot was created.
* Limited arguments to 5 (then later changed to 8) in many places.
* They were replaced by C++11 Variadic Templates.
* Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard.
* Also added a dereference check for Variant*. Helped catch a couple of bugs.
2022-03-09 18:39:13 +01:00
63df46c238 Revert "[HTML5] Fetch API now passes credentials." 2022-03-07 12:52:26 +01:00
b8b4580448 Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
f9629deade HTML5: Fix build after #52742
Fixes #58172.
2022-02-16 08:37:58 +01:00
11572c6e30 Editor: Cleanup some includes dependencies
Removes some unnecessary includes from `editor_node.h`, and instead add
those where they're used.

Removes unnecessary `editor_node.h` includes in various editor classes.

Renames `dynamicfont` to `dynamic_font` in a couple files.

Misc cleanup while jumping through that rabbit hole.
2022-02-15 14:54:15 +01:00