godot/platform/javascript
Jamie Pate 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
..
api Fix ZipIO crash when reused (and possible leaks). 2022-05-11 16:08:17 +03:00
export Refactor the export checking logic to improve separation of concerns 2022-08-14 09:12:04 -07:00
js Improve performance of screen_get_dpi() in Javascript 2022-08-15 21:12:19 -07:00
.eslintrc.engine.js [HTML5] Document Engine and EngineConfig (jsdoc). 2021-02-26 11:33:59 +01:00
.eslintrc.js HTML5: Fix minification error with Emscripten 1.39.9 2021-09-29 09:11:11 +02:00
.eslintrc.libs.js [HTML5] Refactor JS library listeners to OS. 2021-10-05 14:15:07 +02:00
audio_driver_javascript.cpp Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
audio_driver_javascript.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
detect.py refactoring: simplify compiler version check 2022-06-14 22:23:20 +07:00
display_server_javascript.cpp Add support for multiple virtual keyboard types 2022-08-04 10:41:33 -04:00
display_server_javascript.h Add support for multiple virtual keyboard types 2022-08-04 10:41:33 -04:00
dom_keys.inc Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
emscripten_helpers.py [HTML5] Add GDNative+Threads build. 2022-06-14 14:09:06 +02:00
godot_audio.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
godot_js.h Add support for multiple virtual keyboard types 2022-08-04 10:41:33 -04:00
godot_webgl2.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
http_client_javascript.cpp Remove RES and REF typedefs in favor of spelled out Ref<> 2022-05-03 01:43:50 +02:00
http_client_javascript.h Code quality: Fix header guards consistency 2022-07-25 11:17:40 +02:00
javascript_main.cpp HTML5: Fix build after #52742 2022-02-16 08:37:58 +01:00
javascript_runtime.cpp Update copyright statements to 2022 2022-01-03 21:27:34 +01:00
javascript_singleton.cpp Remove Signal connect binds 2022-07-29 16:26:13 +02:00
logo.png Optimize images losslessly using oxipng -o6 --strip all --zopfli 2019-10-12 23:23:33 +02:00
os_javascript.cpp HTML5: Add support for Input.vibrate_handheld() 2022-07-27 22:54:41 +03:00
os_javascript.h HTML5: Add support for Input.vibrate_handheld() 2022-07-27 22:54:41 +03:00
package-lock.json HTML5: Run npm audit fix 2022-05-25 14:56:43 +02:00
package.json HTML5: Run npm audit fix 2022-05-25 14:56:43 +02:00
platform_config.h [HTML5] Add "webgl/webgl2.h" as OpenGL include. 2022-05-10 23:56:21 +02:00
README.md Add logo attribution for Android, HTML5 and Linux platform icons 2021-09-11 19:34:10 +02:00
run_icon.png Optimize images losslessly using oxipng -o6 --strip all --zopfli 2018-06-28 19:17:41 +02:00
SCsub [HTML5] Add GDNative+Threads build. 2022-06-14 14:09:06 +02:00
serve.json Add local web server configuration designed for web editor development 2022-01-20 16:42:00 +01:00

HTML5 platform port

This folder contains the C++ and JavaScript code for the HTML5/WebAssembly platform port, compiled using Emscripten.

It also contains a ESLint linting setup (see package.json).

See also misc/dist/html folder for files used by this platform such as the HTML5 shell.

Artwork license

logo.png and run_icon.png are licensed under Creative Commons Attribution 3.0 Unported per the HTML5 logo usage guidelines.