Commit graph

3708 commits

Author SHA1 Message Date
Rémi Verschelde 7da392bcc5
Don't return reference on copy assignment operators
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this
can lead to confusing code and subtle bugs.

According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++
allows any arbitrary return type, so this is standard compliant.

This could be re-assessed if/when we have an actual need for a behavior more
akin to that of the C++ STL, for now this PR simply changes a handful of
cases which were inconsistent with the rest of the codebase (`void` return
type was already the most common case prior to this commit).
2021-11-30 16:26:29 +01:00
Fabio Alessandrelli 470496d8d4 [HTML5] Fix multi-touch input handling.
The code to populate the input data for WebAssembly was incorrectly
overriding values when multiple touches were present due to wrong
indexing.
2021-11-30 11:10:21 +01:00
Rémi Verschelde 8f0c6ce726
Merge pull request #55347 from Faless/js/4.x_scons_emcc_abspath 2021-11-26 13:41:16 +01:00
Fabio Alessandrelli eaedc92c61 [HTML5] Use absolute path for JS lib/pre/externs.
Ensure better compatibility when emcc which may run some tools from
different paths (e.g. closure compiler).

This fixes externs include issues with modern emcc using the closure
compiler.
2021-11-26 12:44:51 +01:00
Yuri Roubinsky ab6e370a9e
Merge pull request #55344 from Chaosus/repair_error_func 2021-11-26 14:06:00 +03:00
Yuri Roubinsky a4b7de6b23 Fix console colors on Windows 2021-11-26 13:10:55 +03:00
Fabio Alessandrelli 63e2db2499 [HTML5] Fix focus (again) in Firefox's iframes.
This actually makes sense(?), when running inside an iframe the active
element might be our canvas, while the iframe itself is not active in
the parent window. Since we consume the event, the iframe does not get
focused in Firefox (but does in Chromium-based browsers), so we must
always call focus to handle such occasions.
2021-11-26 09:44:00 +01:00
Yuri Roubinsky 675111e480 Restore console window output for editor app on Windows 2021-11-25 22:06:45 +03:00
Lightning_A e078f970db Rename remove() to remove_at() when removing by index 2021-11-23 18:58:57 -07:00
Rémi Verschelde c038768379
Merge pull request #55159 from m4gr3d/add_oculus_openxr_config_master 2021-11-22 10:28:06 +01:00
Marcel Admiraal 2fa4c6498a Fix Android get_screen_orientation() not returning valid values 2021-11-21 12:05:25 +00:00
Fredia Huya-Kouadio 882ec0d611 Add support for OpenXR export configurations. 2021-11-20 06:10:44 -08:00
Fabio Alessandrelli 46fdba5f8b [HTML5] Add WebGL2 (GLES3) support using the OpenGL renderer.
Note, the editor build requires the mbedtls module to be manually
enabled, as it is currently needed as a ResourceUID dependency.

This will need to be addressed in a separate PR.
2021-11-19 16:59:27 +01:00
Rémi Verschelde fc9de5ba7f
Merge pull request #54499 from Faless/threads/4.x_work_pool_default 2021-11-19 09:39:21 +01:00
Fabio Alessandrelli 91dbc288cc [HTML5] Add checks to Gamepad API events.
In some conditions the events might be generated even when the `gamepad`
object is not accessible due to Security Context requirements.
This commit adds a check to avoid firing the handler in those cases.
2021-11-19 04:07:01 +01:00
Fabio Alessandrelli f13c7fc83e [HTML5] Fix input not focusing canvas.
mousedown and touchstart should focus the canvas to ensure correct
application lifecycle.
2021-11-19 04:06:55 +01:00
Rémi Verschelde e7216d4085
Merge pull request #55072 from KoBeWi/untitled_goose_project 2021-11-18 13:47:32 +01:00
kobewi f6d16d55c6 Fix data directory of unnamed projects 2021-11-18 12:31:29 +01:00
Rémi Verschelde 64d7df1e5f
Windows: Use /bigobj only for debug builds, breaks GCC LTO
Building `target=release` and `target=release_debug` builds with MinGW-GCC
errors when linking with LTO.

Since it's only needed for `target=debug` builds anyway (bigger objects), which
we don't build with LTO, this works around the issue.
2021-11-18 10:38:35 +01:00
Will Jordan 283e31a3e2 Fix crash on macOS (AS) when dualshock4 is removed 2021-11-17 15:13:53 +01:00
bruvzg c8037ef2e5 [macOS] Fix crash handler not printing function names on M1 Macs. 2021-11-16 08:45:34 +02:00
Rémi Verschelde 6715bc7754
Merge pull request #54992 from RandomShaper/drop_android_db_setting 2021-11-15 17:54:23 +01:00
Pedro J. Estébanez cab870e9d3 Drop pointless Android depth buffer setting 2021-11-15 11:02:01 +01:00
Aaron Franke 35b9263e5b
Fix typo in architecture name for x86_64 macOS 2021-11-12 20:46:08 -06:00
Aaron Franke 3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
Rémi Verschelde 88c4380737
Modules: Make sure to include modules_enabled.gen.h where needed 2021-11-12 13:42:58 +01:00
Rémi Verschelde 7d2900e1bd
Merge pull request #54876 from bruvzg/no_captured_move 2021-11-11 14:47:13 +01:00
bruvzg f6e449a194 Make window unmovable by dragging title bar, when mouse in captured or confined mode. 2021-11-11 14:02:08 +02:00
Rémi Verschelde 2beaae4b6f
String: Remove erase method, bindings can't mutate String 2021-11-11 11:23:32 +01:00
Rémi Verschelde 9b6897307c
Merge pull request #54837 from akien-mga/windows-bigobj 2021-11-10 17:48:35 +01:00
Rémi Verschelde 11d1319afd
Windows: Enable /bigobj to increase max size for obj files
Equivalent `-Wa,-mbig-obj` for GCC/Clang.

This started being needed to compile harfbuzz in `target=debug` with MinGW/GCC,
but there doesn't seem to be any drawback to enabling `/bigobj` (aside from
losing support for pre-VS 2005 linkers, which we don't support).
2021-11-10 16:06:39 +01:00
Rémi Verschelde b727061ce0
Windows: Fix compilation warnings with GCC 11.2.1 2021-11-10 15:13:05 +01:00
Rémi Verschelde 8a15e404b2
Merge pull request #54463 from RandomShaper/fix_gl3_32bits 2021-11-09 11:55:26 +01:00
Rémi Verschelde 43ff899fa7
Merge pull request #54315 from nekomatata/x11-key-events-log 2021-11-09 00:03:12 +01:00
bruvzg 73a774d8d1 [macOS] Use pre-wait observer to keep main run loop running and redraw window during the window resize and displaying modal popups. 2021-11-08 12:35:13 +02:00
bruvzg d0490d140b [iOS export] Capture and display xcodebuild output. 2021-11-07 11:05:05 +02:00
bruvzg c8f3dd776b [Export] Read and ZIP project files in 16K chunks instead of reading the whole file at once. 2021-11-06 18:58:03 +02:00
Rémi Verschelde bf10956b7f
Merge pull request #54601 from nekomatata/x11-struts-fix-bad-window-error 2021-11-05 10:20:09 +01:00
PouleyKetchoupp 4215d694f8 Fix BadWindow X11 errors when a window is closed while processing struts
A window can be closed on the server side while processing results from
_NET_CLIENT_LIST, which causes BadWindow fatal errors by default in
XGetWindowProperty.

The only way to safely catch this case is to set an error handler to
ignore BadWindow errors while these commands are processed.
2021-11-04 09:47:18 -07:00
Rémi Verschelde 197169b92a
Merge pull request #54591 from WoLfulus/master 2021-11-04 17:45:52 +01:00
WoLfulus 3c9d7203ea
Fix dwFlags on CreateProcessW calls 2021-11-04 09:50:45 -03:00
Fredia Huya-Kouadio bd3d99ca8a Add default minSdkVersion and targetSdkVersion in the AndroidManifest.xml file 2021-11-03 21:54:19 -07:00
bruvzg 1ad14eb14b [macOS] Add support for OpenGLES3 video driver. 2021-11-02 13:11:55 +02:00
Fabio Alessandrelli 4ed1d977fc [OS] Add ThreadWorkPool default size to OS.
Some platforms (*cough* web *cough*) have hard limits on the number of
threads that can be spawned.

Currently, ThreadPoolWork (mostly used in rendering/physics servers)
will spawn as many threads as CPUs available causing exception on
machines with high CPU count.

This commit adds a new overridable method to OS that returns the default
thread pool size (still the CPU count by default), and overrides it for
the JavaScript platform so it always allocate only one thread.

We can likely improve the whole ThreadPoolWork in the future to always
allocate X amount of threads, and assign jobs to them on the fly, but
that will require some more architectural changes.
2021-11-02 04:16:00 +01:00
Rémi Verschelde 7b83039885
Merge pull request #54490 from q66/ppc 2021-11-01 23:27:21 +01:00
Daniel Kolesa 3a84a64d2f Add support for PowerPC family 2021-11-01 22:25:53 +01:00
Hugo Locurcio 665d29c16d
Fix new projects always being created with OpenGL
Only Vulkan is fully implemented for now, so OpenGL isn't available
in the project manager yet.

This also makes the rendering driver checks use lowercase names
everywhere for consistency.
2021-11-01 22:04:36 +01:00
Rémi Verschelde a000186de4
Merge pull request #41565 from nekomatata/x11-usable-screen-size 2021-11-01 18:11:57 +01:00
Pedro J. Estébanez 07adf1193d Drop broken Android 32-bit framebuffer setting for a reliable one for depth buffer 2021-11-01 14:04:24 +01:00
bruvzg 0b6b8427c8 [macOS] Add create_instance function to spawn editor copies.
[macOS] Modify `create_project` function to detect and run app bundles using NSWorkspace to ensure app window is registered and activated correctly.
2021-11-01 11:48:23 +02:00