Commit graph

439 commits

Author SHA1 Message Date
Leon Krause
db6be7b59f Refactor OS_JavaScript header 2019-01-20 00:13:20 +01:00
Leon Krause
0d47dccda9 Fix HTML5 gamepad logic for Emscripten 1.38.22 compat breakage 2019-01-20 00:07:31 +01:00
Guilherme Felipe
86d626e9cb Implements OS_JavaScript::set_custom_mouse_cursor 2019-01-03 13:51:16 -02:00
Rémi Verschelde
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Rémi Verschelde
5f32fc8208
Merge pull request #20385 from moiman100/unify-double-clicking
Added double clicking to all buttons on Linux and Javascript
2018-12-14 23:47:03 +01:00
Rémi Verschelde
57c3f6a94b
Merge pull request #20063 from moiman100/fix-button-mask
Unified button mask behavior across platforms
2018-12-14 23:31:52 +01:00
Marcelo Fernandez
3a702b3ed8 Implemented audio input support for JavaScript audio driver 2018-11-26 19:14:52 -03:00
Rémi Verschelde
5beaea9891
Merge pull request #23389 from marcelofg55/multiple_ext
Export for OS X on OS X now lets you select .dmg or .zip
2018-11-02 11:07:18 +01:00
Marcelo Fernandez
d51999f11d Export for OS X on OS X now lets you select .dmg or .zip 2018-11-01 10:08:26 -03:00
Rémi Verschelde
39a5678c38
Merge pull request #23387 from eska014/memgrowth-preload
Enable --no-heap-copy flag for HTML5 builds
2018-10-29 23:43:11 +01:00
Leon Krause
5c2c47a174 Add proper stubs for OS_JavaScript::execute(), get_process_id(), kill()
Avoids linker warnings and errors about undefined references.
2018-10-29 21:41:59 +01:00
Leon Krause
44e5d446c4 Enable --no-heap-copy flag for HTML5 builds 2018-10-29 21:08:51 +01:00
Zaven Muradyan
61d5513525 Add comments to javascript wrapper parts.
The code in pre.js and engine.js is a bit confusing to see in isolation,
since the files aren't valid JS files by themselves. This just adds some
explanatory text to both files.

Fixes #22937.
2018-10-15 08:56:44 -07:00
Leon Krause
d93050d8a2 Fix compiler warnings in HTML5 platform 2018-10-02 02:49:32 +02:00
muiroc
d6711701f6 Fix build for Javascript platform 2018-10-01 21:46:37 +02:00
Leon Krause
42c6a67dca Implement OS::set_icon in HTML5 platform 2018-09-16 20:46:21 +02:00
Rémi Verschelde
1a16dabfb5
Merge pull request #21982 from luzpaz/misc-typos
Misc. typos
2018-09-13 10:59:00 +02:00
luz.paz
08bde5b2de Misc. typos
Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
2018-09-12 21:39:17 -04:00
Rémi Verschelde
277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Leon Krause
cd7c0f67b9 Fix HTML5 gamepad input 2018-08-30 03:42:02 +02:00
Rémi Verschelde
57ba7caa6d
Merge pull request #21511 from eska014/webm-nomt
Fix WebM and Theora video in HTML5 export
2018-08-28 07:56:52 +02:00
Leon Krause
b4b816c122 Enable Theora module for HTML5 platform 2018-08-28 01:56:47 +02:00
Hein-Pieter van Braam
08f452d1a9 Fall back to GLES2 if GLES3 is not working
This adds a static is_viable() method to all rasterizers which has to be
called before initializing the rasterizer. This allows us to check what
rasterizer to use in OS::initialize together with the GL context
initialization.

This commit also adds a new project setting
"rendering/quality/driver/driver_fallback" which allows the creator of a
project to specify whether or not fallback to GLES2 is allowed. This
setting is ignored for the editor so the editor will always open even if
the project itself cannot run. This will hopefully reduce confusion for
users downloading projects from the internet.

We also no longer crash when GLES3 is not functioning on a platform.

This fixes #15324
2018-08-26 16:40:46 +02:00
Rémi Verschelde
cef310e0ea
Merge pull request #21336 from eska014/html5-new-presentation
Add responsive HTML5 export page with full-size canvas as new default
2018-08-24 00:10:46 +02:00
Rémi Verschelde
8ebe5f45a7
Merge pull request #21332 from dragmz/apk-hint-fix
Fix file hints
2018-08-23 23:35:58 +02:00
Marcin Zawiejski
3c4c8c40db Fix file hints
Fixes file hints so the file dialog actually displays the files with given extension (e.g. *.apk).
2018-08-23 22:18:59 +02:00
Rémi Verschelde
b90dff787c
Merge pull request #21330 from eska014/html5-canvas-resize
Facilitate external modification of HTML5 canvas size
2018-08-23 21:48:27 +02:00
Leon Krause
86d9e67d7a Add responsive HTML5 export page with full-size canvas as new default 2018-08-23 21:28:09 +02:00
Leon Krause
6e8b6be136 Facilitate external modification of HTML5 canvas size 2018-08-23 04:54:36 +02:00
elasota
35f6ba5c5d BPTC support 2018-08-21 22:56:04 -04:00
Leon Krause
e9cb03f33e
Merge pull request #20922 from kripken/err
HTML5: use console.warn instead of Module.printErr
2018-08-21 03:34:21 +02:00
Alessandro
9c1fd91732 fix Android/HTML5 custom templates option does not work 2018-08-20 17:38:23 +02:00
Mikko Mustonen
51fa23a52a Added double clicking to all buttons 2018-08-12 12:41:31 +03:00
Alon Zakai (kripken)
71c03883b5 use console.warn instead of Module.printErr: emscripten no longer exports printErr by default, and instead err() should be used in code seen by the optimizer; however, as Godot only runs on the Web (and not in node.js or elsewhere), using console.warn directly is good enough, and will work in all versions if emscripten 2018-08-11 09:49:19 -07:00
Hein-Pieter van Braam
0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Juan Linietsky
c69de2ba46 -Project/Editor settings now use new inspector
-Project/Editor settings now show tooltips properly
-Settings thar require restart now will show a restart warning
-Video driver is now visible all the time, can be changed easily
-Added function to request current video driver
2018-07-19 19:02:04 -03:00
mm
bd9c592c52 Fixed button mask behavior 2018-07-11 01:15:03 +03:00
Leon Krause
b6ae2d8037 Refactor OS_JavaScript 2018-07-10 16:57:56 +02:00
unknown
9cc41a59ac Added support for extra mouse buttons. 2018-07-09 14:34:19 +03:00
Hugo Locurcio
53e94a1ce1
Optimize images losslessly using oxipng -o6 --strip all --zopfli 2018-06-28 19:17:41 +02:00
Leon Krause
8d3ca2c137 Detect channel count, mix rate, and buffer length in HTML5 audio driver
Refactor WebAudio driver.
2018-06-08 02:50:58 +02:00
Max Hilbrunner
0c56e011ad
Javascript: Remove weird log 2018-05-24 20:18:21 +02:00
Leon Krause
975c0516a4 Build HTML5 release_debug with -Os, like release.
The increased build time is negligible in comparison to the decreased
file size.
2018-05-14 15:31:16 +02:00
Leon Krause
504ffda8d7 Small refactoring in HTML5 build scripts
Drop logic for non-existent 'profile' target
2018-05-14 15:30:27 +02:00
Rémi Verschelde
a415efa4b7
Merge pull request #18765 from eska014/enginejs-extalt
Facilitate using non-default filename extensions in HTML5 platform
2018-05-10 21:57:07 +02:00
Max Hilbrunner
486ec499f3
Merge pull request #18766 from eska014/html5-localcustomshell
Use local path for custom HTML5 shell export
2018-05-10 16:51:13 +02:00
Leon Krause
d1970888d3 Use local path for custom HTML5 shell export 2018-05-10 15:31:44 +02:00
Leon Krause
96f907c023 Accept non-default main packs in engine.js startGame()
Allows using startGame() with main packs exported as .zip, but also any
other custom extension, for example if a web game host does not allow
the .pck filename extension.
2018-05-10 15:08:19 +02:00
Max Hilbrunner
f20af4b632
Merge pull request #18753 from eska014/html5-iframefocus
Fix keyboard focus lock-out with HTML5 canvas in iframe
2018-05-10 15:01:24 +02:00
Leon Krause
32eb3e1b7d Add Engine.setWebAssemblyFilenameExtension()
Some web game hosts only allow certain filename extensions. If .wasm is
not allowed, this function allows overriding the WebAssembly filename
extension to work around that restriction.
2018-05-10 14:50:34 +02:00
Leon Krause
9080e96bc8 Fix keyboard focus lock-out with HTML5 canvas in iframe 2018-05-10 02:42:47 +02:00
Leon Krause
d78b10313b Fix relative mouse motion when captured in HTML5 platform 2018-05-10 01:02:48 +02:00
Pedro J. Estébanez
de9d40a953 Implement universal translation of touch to mouse
Now generating mouse events from touch is optional (on by default) and it's performed by `InputDefault` instead of having each OS abstraction doing it. (*)

The translation algorithm waits for a touch index to be pressed and tracks it translating its events to mouse events until it is raised, while ignoring other pointers.

Furthermore, to avoid an stuck "touch mouse", since not all platforms may report touches raised when the window is unfocused, it checks if touches are still down by the time it's focused again and if so it resets the state of the emulated mouse.

*: In the case of Windows, since it already provides touch-to-mouse translation by itself, "echo" mouse events are filtered out to have it working like the rest.

On X11 a little hack has been needed to avoid a case of a spurious mouse motion event that is generated during touch interaction.

Plus: Improve/fix tracking of current mouse position.

** Summary of changes to settings: **

- `display/window/handheld/emulate_touchscreen` becomes `input/pointing_devices/emulate_touch_from_mouse`
- New setting: `input/pointing_devices/emulate_mouse_from_touch`
2018-04-30 19:03:38 +02:00
Rémi Verschelde
919209907d
Merge pull request #17792 from eska014/enginejs-preloadpaths
Handle directories in engine.js preloadFile()
2018-04-04 22:26:14 +02:00
Rémi Verschelde
3ef85ddb8d
Merge pull request #17836 from eska014/detect-emconfig
Detect and configure JavaScript build per Emscripten configuration file
2018-04-03 10:33:33 +02:00
Fabio Alessandrelli
b8c73b195f Fix bug in HTML5 HTTPClient.
The URL parameter already has a slash, adding an extra one results in
an invalid resource path
2018-03-30 14:31:18 +02:00
Leon Krause
5be7c3dcee Detect and configure JavaScript build per Emscripten configuration file 2018-03-29 04:07:23 +02:00
Leon Krause
3014e48ec5 Fix engine.js startGame() when loading from directory 2018-03-27 11:26:34 +02:00
Leon Krause
d373029382 Allow custom path when using engine.js preloadFile() with URL 2018-03-27 11:26:29 +02:00
Leon Krause
6f1bddf4b5 Fix engine.js preloadFile() with directories 2018-03-27 11:26:25 +02:00
Leon Krause
63c7fc6358 Expose Emscripten libs to engine.js discreetly 2018-03-27 09:12:08 +02:00
Leon Krause
d8d9eea722 Refactor JavaScript platform build script 2018-03-26 19:46:56 +02:00
Leon Krause
25800ffb0e Add RWLockDummy for NO_THREADS builds 2018-03-20 05:37:42 +01:00
Leon Krause
d6c9d8d778 Disable Emscripten assertions in release_debug builds
The messages generated by some assertions can be confusing to users.
2018-03-18 21:33:54 +01:00
Leon Krause
e06a56eac8 Fix typo in engine.js 2018-03-16 15:40:00 +01:00
Leon Krause
61026e62bf Check only for WebGL 1.0, move test to HTML file
Whether to use WebGL 1.0 or 2.0 can only be determined at runtime after
reading project settings, so check for the lower version.

The test is now in the HTML file, so if desired WebGL 2.0 can be
checked early by changing the behaviour there.
2018-03-15 04:04:24 +01:00
Leon Krause
802b6d3669 Reinstate WebGL 1.0 driver in HTML5 platform 2018-03-07 20:38:14 +01:00
Marcelo Fernandez
d780d774aa Clean and expose get_audio/video_driver_* funcs on OS class 2018-03-04 14:18:05 -03:00
Rémi Verschelde
df522cf4e1
Merge pull request #16781 from eska014/html5-httpc
HTML5 HTTPClient fixes
2018-02-17 19:00:55 +01:00
Leon Krause
98039909f2 Flush HTTPClient response data only on request/close in HTML5 platform 2018-02-17 18:13:05 +01:00
Leon Krause
ca9fa9cca8 Warn when polling HTTPClient synchronously in HTML5 platform 2018-02-17 18:12:50 +01:00
Leon Krause
2cd7bc04ea Disable insecure HTTP methods CONNECT and TRACE in HTML5 platform 2018-02-17 16:56:40 +01:00
Leon Krause
8a21f27f54 Fix HTML5 HTTPClient response header retrieval 2018-02-16 05:38:36 +01:00
Leon Krause
9ea4452d21 Fix HTML5 HTTPClient failure detection 2018-02-16 05:11:25 +01:00
Fabio Alessandrelli
9e2b1b3b00 Disabled mbedtls module in javascript platform 2018-02-14 01:26:34 +01:00
Fabio Alessandrelli
6fcc8b7e1f Deleting OpenSSL module and library 2018-02-14 01:26:34 +01:00
Rémi Verschelde
8afe5b4d9f
Merge pull request #16059 from eska014/html5-notls
Disable OpenSSL module in HTML5 platform by default
2018-01-25 09:14:50 +01:00
Leon Krause
4a3aaaf276 Disable OpenSSL module in HTML5 platform by default 2018-01-25 09:07:07 +01:00
Leon Krause
dcc55bad20 Fix HTML5 JS API setResizeCanvasOnStart 2018-01-24 05:08:35 +01:00
x1212
eec2218e7c HTML export: Make s3tc the standard Texture Format 2018-01-20 15:20:26 +01:00
Leon Krause
bd1750c076 Wrap Emscripten module into JS Engine singleton per SCons
Emscripten's meta DCE changes in 1.37.27(/28?) make it impossible to
keep using --pre-js for this
2018-01-13 19:40:59 +01:00
Leon Krause
5a1156347d Fix HTML5 feature tags
'HTML5' is the platform tag, the 'JavaScript' tag indicates availability of
the JavaScript.eval singleton.

Also report texture compression support.
2018-01-12 00:32:17 +01:00
Rémi Verschelde
4ab4001ab2
Merge pull request #15447 from eska014/html5-optmode
Build WebAssembly release module with -Os to decrease file size
2018-01-07 17:47:15 +01:00
Leon Krause
4211e4453e Build WebAssembly module with -Os to decrease file size 2018-01-07 17:43:06 +01:00
Leon Krause
2dbf8251bc Initialize WebGL context in OS 2018-01-07 15:49:48 +01:00
Rémi Verschelde
b33bf23c6a
Merge pull request #15422 from eska014/html5-logger
Print without color control sequences in HTML5 platform
2018-01-07 00:30:58 +01:00
Leon Krause
efdca59a03 HTML5: Print without color control sequences 2018-01-07 00:04:09 +01:00
Leon Krause
cf5b074a95 Fix internal Emscripten JS API calls
Emscripten 1.37.24 no longer exports these by default
2018-01-06 15:53:04 +01:00
Guilherme Silva
ea02c62345 Add missing method for javascript 2018-01-05 13:37:31 -02:00
Rémi Verschelde
e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Duy-Nguyen TA
322cb08dd9 Fix macOS and other builds after #15299
Commit ammended by @akien-mga to fix more platforms.
2018-01-04 19:48:05 +01:00
Artem Varaksa
76b5f8b0df
Fixed missing parenthesis 2018-01-04 19:31:35 +03:00
Rémi Verschelde
d78335d87f Add missing translation in Javascript export dialog
Also remove newlines from translated strings.
2018-01-04 16:08:24 +01:00
Emmanuel Leblond
e315c94900 Change OS::initialize signature to return Error (fix segfault on x11) 2018-01-04 15:15:55 +01:00
Rémi Verschelde
b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Rémi Verschelde
a68d15d509
Merge pull request #14597 from NathanWarden/linux_extensions
Updated Linux template extensions to match architecture.
2017-12-16 13:05:18 +01:00
Fabio Alessandrelli
206275f3e7 Fix javascript build error and improve #14604 2017-12-15 15:35:18 +01:00
mhilbrunner
966c054fc9 HTTP cleanup & better defaults 2017-12-14 10:59:42 +01:00
Nathan Warden
f89d78a7a4 Updated Linux template extensions to match architecture. 2017-12-12 16:09:48 -05:00
Rémi Verschelde
13c2ff9320 Style: Apply new clang-format 5.0 style to all files 2017-12-07 08:02:00 +01:00
Rémi Verschelde
76725b6c1f
Merge pull request #13387 from rraallvv/refactor
Add target helper functions and refactor (master)
2017-11-29 08:54:59 +01:00
Rhody Lugo
a65c0939fd disable caching for targets using helper functions 2017-11-28 23:24:12 -04:00
Leon Krause
640d8cc5d2 Fix inverted relative mouse motion in HTML5 export 2017-11-29 00:56:47 +01:00
Rémi Verschelde
e1cf789593
Merge pull request #13278 from eska014/jseval-returntypes
Remove contrived JavaScript.eval() return types
2017-11-25 15:59:43 +01:00
Leon Krause
8de25d6e62 Remove contrived JavaScript.eval return types 2017-11-25 15:38:02 +01:00
Juan Linietsky
bc2e8d99e5 Made Vector::ptrw explicit for writing, compiler was sometimes using the wrong function,
leading to unnecesary copy on writes and reduced performance.
2017-11-25 00:09:40 -03:00
Ruslan Mustakov
d42c5646a5 Return and repair file logging
And make it configurable, too.
2017-11-21 16:43:44 +07:00
Ruslan Mustakov
8f0f327f02 Allow configuring iOS export
- EditorExportPlugin's _export_begin accepts all the arguments related
   to the current export (is_debug, path, flags).

 - EditorExportPlugin API is extended with methods allowing to configure
   iOS export: add_ios_framework, add_ios_plist_content,
   add_ios_linker_flags, add_ios_bundle_file.

 - iOS export template now contains Godot as a static library so that
   it can be linked with third-party Frameworks and GDNative static
   libraries.

 - Adds method to DirAccess for recursive copying of a directory.

 - Fixes iOS export to work with Xcode 9 (released recently).
2017-11-21 01:16:49 +07:00
Rémi Verschelde
fa8bc8ef13
Merge pull request #13061 from eska014/html5-export
Export boot splash image and add option for custom HTML shell file in HTML5 export
2017-11-20 08:59:23 +01:00
Rémi Verschelde
ecf80fbbba
Merge pull request #12988 from akien-mga/xdg-home-paths
Add support for XDG Base Directory spec
2017-11-20 00:42:51 +01:00
Leon Krause
ae859fb81e Export boot splash and add custom HTML file option in HTML5 export 2017-11-20 00:06:11 +01:00
Rémi Verschelde
6e3f2f44af Use new XDG folders to dehardcode paths 2017-11-19 20:54:26 +01:00
Rémi Verschelde
f0795ae2fe
Merge pull request #13044 from eska014/enginejs
Change HTML5 start-up API
2017-11-19 20:18:00 +01:00
Rémi Verschelde
992a40a50d
Merge pull request #12961 from eska014/platform-doc
Facilitate documenting platform-exclusive classes
2017-11-19 16:19:47 +01:00
Leon Krause
35adf718cf Change HTML5 start-up API
Rename engine.start() to startGame(), new start() takes string arguments
handed directly to main(). Rename Engine.loadEngine() to load().

Add setLocale(), setResizeCanvasOnStart(), setExecutableName() and
preloadFile().
2017-11-19 15:39:57 +01:00
Leon Krause
ddf21ca016 Remove asm.js support from HTML5 platform
Since WebGL 2.0 is required, requiring WebAssembly support as well has
little impact on compatibility.
2017-11-18 05:52:14 +01:00
Leon Krause
63b1a096eb Facilitate exposing platform-exclusive interfaces to all platforms
This makes the interfaces available, without implementation, in other
platforms and the editor, which facilitates documenting platform-exclusive
classes.

Platform-exclusive APIs must be set up in platform/<platform>/api/api.cpp.
Provide noop method-implementations where necessary.

Also setup and document the HTML5 platform's JavaScript singleton.
2017-11-18 03:54:21 +01:00
Rémi Verschelde
ad199c3964 EditorSettings: Rename settings_path to settings_dir
Also to prepare for upcoming refactoring for XDG support.
2017-11-17 20:55:09 +01:00
Rémi Verschelde
73049d115e Rename OS::get_data_dir to OS::get_user_data_dir
Will be needed to avoid confusion with system data path (XDG_DATA_HOME)
and editor data dir in upcoming refactoring.
2017-11-17 20:55:09 +01:00
Leon Krause
6b34f10ab1 Fix HTML5 HTTPClient includes 2017-11-15 23:02:36 +01:00
Leon Krause
9b7b46143d Move singleton management from ProjectSettings to Engine 2017-11-14 15:15:13 +01:00
Leon Krause
159c2ec69c Fix HTML5 mouse button release events 2017-11-13 16:14:08 +01:00
Rémi Verschelde
0dd96bccd3
Merge pull request #12867 from eska014/html5-http
Implement HTTPClient in HTML5 platform
2017-11-13 08:32:32 +01:00
Leon Krause
2970061a73 Implement HTTPClient in HTML5 platform
Limitations:

 - Subject to same-origin policy
 - No persistent connection (but simulated for compatibility)
 - No blocking mode
 - No StreamPeer access
 - No chunked responses
 - Cannot disable host verification
2017-11-13 00:58:29 +01:00
Juan Linietsky
d09160a8b6 Make video mode initialization more intuitive, fixes #12022 2017-11-09 13:02:26 -03:00
Rémi Verschelde
e20241c02c
Merge pull request #12691 from eska014/webaudio
Fix WebAudio and HTML5 build
2017-11-06 09:36:13 +01:00
Leon Krause
1a5d3c26db Fix WebAudio and HTML5 build 2017-11-06 00:25:57 +01:00
Juan Linietsky
7715a261d5
Merge pull request #12262 from AndreaCatania/pplug
Physics server plug
2017-11-03 23:39:44 -03:00
AndreaCatania
7a9ca08f16 Implemented physics plug
Moved init_physics

Implemented physics 2D plug

Fix clang

Fix clang

Fix static check

Fix clang

Fix static check

Moved physics server initialization

Moved physics server settings initialization
2017-11-04 03:25:51 +01:00
Marcelo Fernandez
33daf4d8bc Detect javascript platform using EMSCRIPTEN env as well 2017-10-28 16:24:44 -03:00
Juan Linietsky
b8ac700046 Sound support for Javascript (untested). 2017-10-26 22:35:40 -03:00
Rémi Verschelde
3e681227ab Merge pull request #12010 from eska014/jseval
Improve JavaScript calls, allow passing byte arrays to GDScript
2017-10-11 22:36:52 +02:00
Leon Krause
5e06d3d814 Improve JavaScript calls
- Allow returning ArrayBuffer and views as PoolByteArray
 - Return real_t for integral numbers
 - Read all color channels as 0.0 - 1.0 floating point numbers
2017-10-11 01:14:07 +02:00
Hein-Pieter van Braam
2bece6bbd3 Merge pull request #11782 from eska014/persistent-userfs-test
Add OS::is_userfs_persistent, allow starting HTML5 platform in private mode
2017-10-03 12:24:11 +02:00
Andreas Haas
132ba0ed97 Merge pull request #11568 from endragor/loggers
Extract logging logic
2017-10-02 23:51:26 +02:00
Leon Krause
7b23665e72 Add OS::is_userfs_persistent to check user:// persistence
Allows starting HTML5 export when IndexedDB is not available.
2017-10-02 21:07:05 +02:00
Leon Krause
11ab7b6efc Use primary WebAssembly.instantiate overload
Previously WebAssembly.compile was used along with the secondary
WebAssembly.instantiate overload. Using only the primary overload is
recommended to get best performance.
2017-10-02 13:09:59 +02:00
Elliott Sales de Andrade
3e69d19116 Use BoolVariable in platform-specific options. 2017-09-25 14:36:30 -04:00
Elliott Sales de Andrade
5be675eb03 Use BoolVariable for module options. 2017-09-25 14:36:30 -04:00
Elliott Sales de Andrade
ffab67b8da Use BoolVariable in target/component/advanced options. 2017-09-25 14:36:02 -04:00
Ruslan Mustakov
1a2311e350 Extract logging logic
Previously logging logic was scattered over OS class implementations
with plenty of duplication. Major changes in this commit:

 - Extracted logging logic into a separate Logger hierarchy. It allows
   easy configuration of logging mechanism depending on compile-time or
   run-time configuration.

 - Implemented RotatedFileLogger which is usually used with StdLogger,
   providing persistency of logs. It is often important to be able to
   obtain logs of the game even in production to be able to understand
   what happened prior to some problem. On mobile there previously was
   no way to obtain the logs aside from having the device connected to
   your machine.

 - flush() is not performed in release mode for every logged line. It
   is only performed for errors.
2017-09-25 16:19:21 +07:00
Leon Krause
d1ecc25db4 Fix mouse button state in HTML5 platform
Regression from 844c5e12e6
2017-09-19 19:27:52 +02:00
Rémi Verschelde
53bbc046ee Merge pull request #11252 from marcelofg55/fix_noaudio_crash
Fix crash when no audio driver is available
2017-09-17 22:48:22 +02:00
Marcelo Fernandez
7a4c0ff35e Fix crash when no audio driver is available 2017-09-13 20:54:55 -03:00
Maxim Sheronov
0fffa45158 Fix enums bindings
Add missed bindings for enums
Move some enums to class to have correct output of api.json
2017-09-13 20:57:07 +03:00
Poommetee Ketson
8bf8cf1316 Merge pull request #11154 from eska014/html5-startup-revamp
HTML5 start-up overhaul with download progress display
2017-09-12 04:35:30 +07:00
Leon Krause
4db801aaea HTML5 start-up overhaul
- Implement promise-based JS interface for custom HTML page
   integration
 - Add download progress callback
 - Add progress bar and indeterminate spinner to default HTML page
 - Try downloading files multiple times when failing
 - Get rid of godotfs.js
 - Separate steps for engine initialization, game initialization and game
   start
 - Allow multiple games on one HTML page
 - Substitution placeholders only used in .html file
 - Placeholders renamed: $GODOT_BASE => $GODOT_BASENAME,
   $GODOT_TMEM -> $GODOT_TOTAL_MEMORY
 - Emscripten Module is now Engine.RuntimeEnvironment (no longer a global)
2017-09-11 20:56:29 +02:00
Rémi Verschelde
6a08f8288e Merge pull request #10914 from eska014/html5-main-notif
Prevent sending MainLoop notifications before initialized
2017-09-03 11:28:03 +02:00
Leon Krause
8c4fb4cec8 HTML5: Prevent sending MainLoop notifications before initialized 2017-09-03 04:13:24 +02:00
Matthias Hoelzl
b6e1e47e3a Make build scripts Python3 compatible
- The Windows, UWP, Android (on Windows) and Linux builds are
  tested with Scons 3.0 alpha using Python 3.
- OSX and iOS should hopefully work but are not tested since
  I don't have a Mac.
- Builds using SCons 2.5 and Python 2 should not be impacted.
2017-08-27 23:05:39 +02:00
Rémi Verschelde
7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02:00
Rémi Verschelde
bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Marcelo Fernandez
63f847b306 p_screen param from get_screen_* funcs now default to the current screen 2017-08-21 18:28:29 -03:00
toger5
2286037bc3 removed calls to cursor_set_visible on all platforms fixes #10167 2017-08-08 14:04:22 +02:00
Rémi Verschelde
6d213909cb Merge pull request #10105 from eska014/html5-touch-hint
Implement OS.has_touchscreen_ui_hint() in HTML5 platform
2017-08-07 14:49:33 +02:00
Rémi Verschelde
4775d07977 Merge pull request #10104 from eska014/canvas-mgmt
Improve HTML5 canvas management
2017-08-07 14:49:16 +02:00
Bojidar Marinov
7b7c7c8dc0
Rename KEY_RETURN to KEY_ENTER and KEY_ENTER to KEY_KP_ENTER
Closes #7695
2017-08-06 16:26:07 +03:00
L. Krause
bd48f210a1 Improve HTML5 canvas management
- set_window_maximized hides page content
 - Fix sporadic full-screen render-size bug in Chromium
 - Smoother resizing for maximized canvas
2017-08-05 05:27:58 +02:00
L. Krause
0c693595d6 Implement touch-screen check in HTML5 platform 2017-07-28 05:39:25 +02:00
Rémi Verschelde
401f1098f6 Merge pull request #9770 from eska014/html5-focus
Implement input focus behavior in HTML5
2017-07-23 13:13:09 +02:00
L. Krause
ca28c068c0 Implement input focus behavior in HTML5
- Key and mouse events are only consumed if canvas is focused
 - NOTIFICATION_WM_MOUSE_ENTER, _MOUSE_EXIT, _FOCUS_IN and _FOCUS_OUT are
   emitted
2017-07-22 17:25:15 +02:00
Juan Linietsky
25678b1876 -Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
2017-07-19 17:06:03 -03:00
L. Krause
69e0dee983 Fix zipping HTML5 templates when using implicit cache 2017-07-17 03:53:31 +02:00
Rémi Verschelde
e91a267a7c Buildsystem: Improve detect.py readability and fix issues
Tried to organize the configure(env) calls in sections, using the same order
for all platforms whenever possible.

Apart from cosmetic changes, the following issues were fixed:
- Android: cleanup linkage, remove GLESv1_CM and GLESv2
- iPhone: Remove obsolete "ios_gles22_override" option
- OSX:
  * Fix bits detection (default to 64) and remove obsolete "force_64_bits" option
    (closes #9449)
  * Make "fat" bits argument explicit
- Server: sync with X11
- Windows: clean up old DirectX 9 stuff
- X11:
  * Do not require system OpenSSL for building (closes #9443)
  * Fix typo'ed use_leak_sanitizer option
  * Fix .llvm suffix overriding custom extra_suffix
2017-07-01 08:20:51 +02:00
L. Krause
a2fd89bbe2 Hide HTML5 native-run icon without runnable preset 2017-06-27 21:06:43 +02:00
L. Krause
92367968e7 Use custom native-run icons for Android and HTML5 2017-06-27 21:06:26 +02:00
Poommetee Ketson
e3998528e0 BuildSystem: generated files have .gen.extension 2017-06-25 07:55:01 +07:00
L. Krause
6f17d41bcf Update HTML5 platform for new InputEvents 2017-06-19 15:43:46 +02:00
Juan Linietsky
5b3709d309 Removal of InputEvent as built-in Variant type..
this might cause bugs I haven't found yet..
2017-05-20 17:05:38 -03:00
Juan Linietsky
98a3296702 Removal of Image from Variant, converted to a Resource. 2017-05-17 07:37:45 -03:00
Rémi Verschelde
120ce92e32 Merge pull request #8625 from eska014/html5-cursorshape
HTML5: Cursor style control
2017-05-05 22:52:48 +02:00
L. Krause
0811335fd5 Implement cursor style control in HTML5 platform 2017-05-02 13:31:27 +02:00
Rémi Verschelde
9bdc498f90 Merge pull request #8574 from eska014/html5-noglut
Remove GLUT usage in HTML5 platform
2017-05-02 11:30:01 +02:00
L. Krause
101c542b77 Implement mouse capture and hiding in HTML5 export
MOUSE_MODE_CONFINED cannot be implemented.
2017-05-02 04:01:34 +02:00
L. Krause
abe09919bf Fix HTML5 key events
Regression from 86f5ac3
2017-04-29 04:42:50 +02:00
L. Krause
847bd33fdf Remove GLUT usage in HTML5 platform 2017-04-28 21:54:44 +02:00
L. Krause
86f5ac3d74 Implement HTML5 touch events 2017-04-26 16:30:22 +02:00
L. Krause
a99b6b2063 Reimplement HTML5 mouse input without GLUT
Fixes inverted scrolling on Chromium
2017-04-25 14:48:46 +02:00
Sergey Pusnei
8589ca3903 Rename [gs]et_pos to [gs]et_position for Controls
Control set_pos -> set_position
Control set_global_pos -> set_global_position
[gs]et_mouse_pos -> [gs]et_mouse_position
[gs]et_global_mouse_pos -> [gs]et_global_mouse_position
fixes #8005
2017-04-10 08:27:34 +02:00
Rémi Verschelde
df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Juan Linietsky
000e873008 Merge pull request #8191 from eska014/webgl2-export
WebGL 2 export per WebAssembly or asm.js
2017-03-29 15:21:52 +02:00
eska
7df7e9cc8b WebGL 2 export per WebAssembly or asm.js 2017-03-29 13:27:43 +02:00
Rémi Verschelde
9d28a5e7d9 Merge pull request #8159 from Hinsbart/last_id
Input: Remove usage of platform dependent event IDs.
2017-03-27 08:52:58 +02:00
Rémi Verschelde
d8f32637be SCons: Add option to toggle warnings (on by default)
All the warnings are factored out of the platform-specific files and moved to
SConstruct. Will have to check that it does not introduce regressions on some
platforms/compilers.

(cherry picked from commit 31107daa1a)
2017-03-26 21:58:37 +02:00
Andreas Haas
c0b6756875
Input: Remove usage of platform dependent event IDs.
The ID property for InputEvents is set by `SceneTree` when sending the event down the tree.
So there's no need for the platform specific code to set this value when it will later be overriden anyway...
2017-03-26 15:59:32 +02:00
eska
12dd86bba0 Some WebGL 2 and build fixes/clean-up 2017-03-17 15:56:48 +01:00
Juan Linietsky
af020160c6 more html5 fixes 2017-03-14 10:53:46 -03:00
eska
1abf478eb9 Fix web export build 2017-03-10 05:09:54 +01:00
Rémi Verschelde
5dbf1809c6 A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?

I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon

A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format

A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
2017-03-05 16:44:50 +01:00
Rémi Verschelde
e1c1d7d1d7 Add a bunch of missing Godot headers in own files 2017-03-05 15:47:28 +01:00
Rémi Verschelde
49c065d29c Refactoring: rename tools/editor/ to editor/
The other subfolders of tools/ had already been moved to either
editor/, misc/ or thirdparty/, so the hiding the editor code that
deep was no longer meaningful.
2017-03-05 14:21:25 +01:00
Julian Murgia
94103c0c02 Add API to access battery power state
Done:
- X11, server (tested)
- Windows (developed, would be nice to retest)
- OSX (not tested)
Prepared (not developed):
- Android (code is here, but may not compile)
- iphone
- winrt
- bb10
- haiku
- javascript
2017-03-04 18:04:29 +01:00
Juan Linietsky
ffcd954211 Fixes to webgl/opengl es 3.0 for compatibility with webgl2.0, still does not work though 2017-02-22 19:14:21 -03:00
eska
6e1828c958 Fix WebAssembly builds on Windows 2017-02-21 23:21:28 +01:00
Juan Linietsky
de0045cf1b -renamed globals.h to global_config.cpp (this seems to have caused a few modified files)
-.pck and .zip exporting redone, seems to be working..
2017-02-21 00:06:30 -03:00
eska
6e2bf31e5a Automatically zip web export templates
Also fix web builds on Windows and clean up
2017-02-20 06:59:19 +01:00
eska
335fdea581 Fix parallel asm.js/WebAssembly builds 2017-02-20 03:44:37 +01:00
Juan Linietsky
f6950956bd Editor Export Settings Dialog is completed!! Now on to make some exporters.. 2017-02-19 23:21:35 -03:00
Hein-Pieter van Braam
411ee71b4d Rename the _MD macro to D_METHOD
This new name also makes its purpose a little clearer

This is a step towards fixing #56
2017-02-13 12:50:02 +01:00
Rémi Verschelde
40e4c1f6ab Merge pull request #7689 from eska014/webgl2
Enable WebGL2 in web export, start fixing build
2017-02-02 08:18:42 +01:00