Commit graph

2490 commits

Author SHA1 Message Date
Rémi Verschelde
8d4046929c
Merge pull request #49511 from akien-mga/core-diraccess-fileaccess-io
Core: Move DirAccess and FileAccess to `core/io`
2021-06-11 16:51:10 +02:00
Rémi Verschelde
6b0183ec89
Merge pull request #49279 from Calinou/rename-string-is-abs-path-method
Rename `String.is_abs_path()` to `String.is_absolute_path()`
2021-06-11 15:58:16 +02:00
Rémi Verschelde
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
Rémi Verschelde
ba82626c2c
Merge pull request #49506 from akien-mga/vulkan_prefer_discrete_gpu
Prefer discrete GPU over integrated one
2021-06-11 13:34:38 +02:00
Blazej Floch
36130e5a05
Prefer discrete GPU over integrated one
This unblocks launching on Linux laptops that default to the integrated
GPU which can not handle Vulkan in many instances.
Ideally a manual device selection, or an option for the optimal selection
strategy should be provided via CLI or config, but for the time being
this will unblock the Linux devs.

Partially addresses #42348 and #43714
2021-06-11 13:02:30 +02:00
Rémi Verschelde
01d5c463be
FileAccess: Don't err in store_buffer with buffer of size 0
The error check was added for `FileAccessUnix` but it's not an error when both
`p_src` and `p_length` are zero.

Added correct error checks to all implementations to prevent the actual
erroneous case: `p_src` is nullptr but `p_length > 0` (risk of null pointer
indexing).

Fixes #33564.
2021-06-07 18:34:00 +02:00
Rémi Verschelde
c1c76850cb
Style: Cleanup uses of double spaces between words
Or after punctuation. Tried to leave third-party stuff alone, unless it has
been heavily modified for Godot.
2021-06-07 11:03:08 +02:00
Hugo Locurcio
5ea1c75d63
Rename String.is_abs_path() to String.is_absolute_path()
This is more consistent with `NodePath.is_absolute()`.
2021-06-03 16:00:06 +02:00
Rémi Verschelde
8c23236e1d
Merge pull request #48350 from RandomShaper/fix_alsamidi_crash
Fix crash when using ALSA MIDI with PulseAudio
2021-06-03 10:59:29 +02:00
Pedro J. Estébanez
958d79828b Fix crash when using ALSA MIDI with PulseAudio 2021-06-03 10:10:10 +02:00
Rémi Verschelde
9990f28d84
Merge pull request #49026 from sarchar/multiple-dns-resolves 2021-06-01 18:41:41 +02:00
Fabio Alessandrelli
8cdef21d6c Move remaining dummy drivers to servers. 2021-06-01 16:50:32 +02:00
Fabio Alessandrelli
8594613f94 LinuxBSD now compiles without vulkan/x11. 2021-06-01 16:27:54 +02:00
Fabio Alessandrelli
ae04dac2db Remove server platform 2021-06-01 16:27:54 +02:00
Fabio Alessandrelli
801aadb401 Add DisplayServerDummy for headless display.
Uses RasterizerDummy internally. This is always compiled in, maybe we
should add a switch to enable/disable it via scons?
2021-06-01 16:27:54 +02:00
Fabio Alessandrelli
9fb18e4998 Sync RasterizerDummy changes. 2021-06-01 16:20:38 +02:00
Chuck
dd8fa11ac1 Support multiple address resolution in DNS requests
Add two new functions to the IP class that returns all addresses/aliases associated with a given address.

This is a cherry-pick merge from 010a3433df which was merged in 2.1, and has been updated to build with the latest code.

This merge adds two new methods IP.resolve_hostname_addresses and IP.get_resolve_item_addresses that returns a List of all addresses returned from the DNS request.
2021-06-01 11:24:34 +07:00
bruvzg
1d7a63fb8f
Fix Directory::get_space_left() result on macOS and Linux. 2021-05-31 12:57:18 +03:00
Marcel Admiraal
da5d7db610 Rename File::get_len() get_length() 2021-05-25 11:54:28 +01:00
bruvzg
a1cb6f07a1
Add GDNative Framework loading and export support. 2021-05-24 12:49:05 +03:00
bruvzg
139a9d6370
Add symlink API to the DirAccess (on macOS and Linux). 2021-05-22 17:33:34 +03:00
Tomasz Chabora
b1859510ab Change behavior of String.right 2021-05-20 23:07:57 +02:00
Rémi Verschelde
aa5552278d
Merge pull request #48719 from Faless/js/4.x_interfaces
[HTML5] Implement Godot <-> JavaScript interface.
2021-05-20 17:13:02 +02:00
Rémi Verschelde
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
Pedro J. Estébanez
469fa47e06
Make all file access 64-bit (uint64_t)
This changes the types of a big number of variables.

General rules:
- Using `uint64_t` in general. We also considered `int64_t` but eventually
  settled on keeping it unsigned, which is also closer to what one would expect
  with `size_t`/`off_t`.
- We only keep `int64_t` for `seek_end` (takes a negative offset from the end)
  and for the `Variant` bindings, since `Variant::INT` is `int64_t`. This means
  we only need to guard against passing negative values in `core_bind.cpp`.
- Using `uint32_t` integers for concepts not needing such a huge range, like
  pages, blocks, etc.

In addition:
- Improve usage of integer types in some related places; namely, `DirAccess`,
  core binds.

Note:
- On Windows, `_ftelli64` reports invalid values when using 32-bit MinGW with
  version < 8.0. This was an upstream bug fixed in 8.0. It breaks support for
  big files on 32-bit Windows builds made with that toolchain. We might add a
  workaround.

Fixes #44363.
Fixes godotengine/godot-proposals#400.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2021-05-17 15:06:19 +02:00
Fabio Alessandrelli
eed483c481 Sync DummyRasterizer. 2021-05-14 13:36:29 +02:00
R. Alex Hofer
65a10f4db5 Handle having no sinks in the PulseAudio driver.
Also make PulseAudio errors more verbose.
2021-05-13 18:28:22 -04:00
Hugo Locurcio
064ca9adae
Remove debugging prints in the Linux DisplayServer
Some Vulkan debugging prints were also changed to be printed only
in verbose mode.
2021-05-08 19:07:50 +02:00
Fabio Alessandrelli
9a98c09bb2 Sync RasterizerDummy with latest changes. 2021-05-07 17:57:40 +02:00
Rémi Verschelde
42b07f713f
Merge pull request #37700 from Calinou/rename-ip-unix-tcp-server
Rename `IP_Unix`, `IP_Address` and `TCP_Server` to remove underscores
2021-05-06 08:36:30 +02:00
Bastiaan Olij
90ef5d73c4 Cleanup vulkan capabilities check and add multiview check 2021-05-06 12:06:07 +10:00
Hugo Locurcio
3f078c99f6
Rename IP_Unix, IP_Address and TCP_Server to remove underscores 2021-05-06 02:52:01 +02:00
Hugo Locurcio
bf7c4da804
Tweak warning messages related to leaked RIDs
- Use hardcoded pluralization for messages.
  - Since these messages are English-only, it's fine to hardcode it.
- Use double quotes for consistency with other messages.
2021-05-03 16:05:38 +02:00
Rémi Verschelde
d12e0b6ef1
Merge pull request #48336 from bruvzg/fix_mixed_url_decode
Fix `url_decode` with mixed percent-encoding/Unicode strings.
2021-04-30 23:02:51 +02:00
bruvzg
b6a21f85a7
Fix url_decode with mixed percent-encoding/Unicode strings. Treat Unix drive names as UTF-8 encoded. 2021-04-30 21:22:39 +03:00
Fabio Alessandrelli
f0e6a02108 Sync RasterizerDummy. 2021-04-29 16:46:10 +02:00
Rémi Verschelde
5b16020846
Replace remaining uses of NULL with nullptr
Follow-up to #38736 (these uses were likely added after this PR was merged).
2021-04-29 11:53:27 +02:00
Rémi Verschelde
305b2a15bf
Merge pull request #48239 from akien-mga/goodbye-copymem
Core: Drop custom `copymem`/`zeromem` defines
2021-04-28 11:04:05 +02:00
Rémi Verschelde
95cfce661b
Merge pull request #48050 from JFonS/occlusion_culling 2021-04-27 19:07:12 +02:00
Rémi Verschelde
8247667a3e
Core: Drop custom copymem/zeromem defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.
2021-04-27 16:26:27 +02:00
Rémi Verschelde
72bd64c1d5
Merge pull request #47398 from Faless/feature/network-local-port-salvaged 2021-04-27 15:04:30 +02:00
Fabio Alessandrelli
46f7b0f74b [Net] Fix socket poll timeout on Windows.
Now correctly computes the timeout value in milliseconds.
2021-04-26 07:23:39 +02:00
jfons
4d9d99bb82 Implement occlusion culling
Added an occlusion culling system with support for static occluder meshes.
It can be enabled via `Project Settings > Rendering > Occlusion Culling > Use Occlusion Culling`.

Occluders are defined via the new `Occluder3D` resource and instanced using the new
`OccluderInstance3D` node. The occluders can also be automatically baked from a
scene using the built-in editor plugin.
2021-04-23 21:45:23 +02:00
dam
da8c2310b5 Allow local port control on net_socket connections 2021-04-12 21:05:33 +02:00
Szymon Majewski
0a29322991 Validation layers on Android 2021-04-12 10:09:06 -07:00
Rémi Verschelde
9e8acb3897
Merge pull request #47640 from BastiaanOlij/fix_vulkan_format
Chose format from supported ones that we support
2021-04-05 14:55:32 +02:00
Bastiaan Olij
ceebe4b565 Chose format from supported ones that we support 2021-04-05 22:39:17 +10:00
Rémi Verschelde
9bbe51dc27
Style: Apply clang-tidy's modernize-use-nullptr 2021-04-05 14:05:07 +02:00
Szymon Majewski
1328208063 Removed debug code 2021-04-01 20:09:48 -07:00
Rémi Verschelde
8621c86f4d
Merge pull request #47283 from Panquesito7/fix_lgtm_alerts
fix: 3 LGTM alerts/warnings
2021-03-31 18:52:04 +02:00