Commit Graph

3195 Commits

Author SHA1 Message Date
b99b212855 Merge pull request #38307 from Calinou/shell-open-res-user-warning
Warn when trying to open `res://` or `user://` with `OS.shell_open()`
2020-04-29 16:07:34 +02:00
540156b387 [Core] Rename linear_interpolate to lerp 2020-04-29 04:02:49 -04:00
10273e9de6 Merge pull request #38034 from punto-/punto-/vibration_info_protected
makes VibrationInfo protected
2020-04-29 09:57:17 +02:00
5cae0f3402 Merge pull request #37580 from aaronfranke/xform
Print errors when passing an invalid type to xform
2020-04-29 09:32:51 +02:00
41a7d07095 Input: make VibrationInfo protected to allow implementors to use it 2020-04-29 09:11:14 +02:00
e445be6944 Merge pull request #38064 from aaronfranke/rotated
Improve the Vector2 rotated code
2020-04-28 20:49:22 +02:00
72ecd36cb3 Print errors when passing an invalid type to xform 2020-04-28 14:24:16 -04:00
d46e411b44 Warn when trying to open res:// or user:// with OS.shell_open()
`OS.shell_open()` will pass on the path directly to the OS' shell
handler (which can handle file paths or URLs). It can't handle
Godot-specific paths, so these need to be converted with
`ProjectSettings.globalize_path()` first.
2020-04-28 19:37:09 +02:00
d44c5cfcf7 Merge pull request #38295 from akien-mga/input-is-back
Rename InputFilter back to Input
2020-04-28 16:20:20 +02:00
fdf58a5858 Rename InputFilter back to Input
It changed name as part of the DisplayServer and input refactoring
in #37317, with the rationale that input no longer goes through the
main loop, so the previous Input singleton now only does filtering.

But the gains in consistency are quite limited in the renaming, and
it breaks compatibility for all scripts and tutorials that access
the Input singleton via the scripting language. A temporary option
was suggested to keep the scripting singleton named `Input` even if
its type is `InputFilter`, but that adds inconsistency and breaks C#.

Fixes godotengine/godot-proposals#639.
Fixes #37319.
Fixes #37690.
2020-04-28 15:19:49 +02:00
510e83498e Input: Drop obsolete versions of SDL gamecontrollerdb
The 204 and 205 are the older, SDL 2.0.4 and 2.0.5 compatible mappings,
but since all new mappings have only been added to the main
gamecontrollerdb.txt which overrides the older entries, it doesn't make
much sense for us to keep the old databases.

We do not support the SDL2 half axes and inverted axes features from
gamecontrollerdb.txt, but this only impacts the specific controllers
which can use those features, the rest are parsed and used properly.

As for godotcontrollerdb.txt, it doesn't make sense for us to maintain
our own custom mappings instead of submitting them upstream. The only
exception is the Javascript and UWP platforms for which no bindings are
available upstream, so we keep those entries.
2020-04-28 14:51:44 +02:00
982efb1864 Add const to InputEventMouseButton::get_factor 2020-04-25 13:25:00 +02:00
23a349c427 Improve the Vector2 rotated code 2020-04-21 14:06:41 -04:00
f8ef38efed Add proper type to most public API uses of Array 2020-04-21 12:16:45 -03:00
5d4dc2d45c Add ability to bind typed arrays to script API
Note: Only replaced 2 instances to test, Node.get_children and TileMap.get_used_cells
Note: Will do a mass replace on later PRs of whathever I can find, but probably need
a tool to grep through doc.
Warning: Mono will break, needs to be fixed (and so do TypeScript and NativeScript, need to ask respective maintainers)
2020-04-21 10:15:40 +02:00
ae09b55a19 Exposed RenderingDevice to script API
Also added an easier way to load native GLSL shaders.

Extras:

Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload.

Note:

The precommit hooks are broken because they don't seem to support enums from one class being used in another.
Feel free to fix this after merging this PR.
2020-04-20 21:21:58 -03:00
114ffb19e6 Merge pull request #37982 from DrMoriarty/fix_square_resize
Fix square image resize
2020-04-20 23:56:23 +02:00
2cd952bd84 Fix handling of PROPERTY_USAGE_SUBGROUP in DocData and editor
Subgroups were added in #37678 but not properly handled everywhere
where PROPERTY_USAGE_GROUP is.
2020-04-20 17:13:06 +02:00
9cf48b3e99 Merge pull request #38039 from akien-mga/docdata-skip-unexposed
DocData: Skip unexposed classes
2020-04-20 15:21:49 +02:00
0ef8bcac4d DocData: Skip unexposed classes
Properly expose classes that we actually want accessible.
2020-04-20 12:51:10 +02:00
515fe0f29b Revert "Made possible to specify where to dump the contents when loading a ".pck" file"
This reverts commit 3c261e0dfa.

This was not so useful as is due to the way dependency paths are stored
in scenes and resources.
2020-04-20 10:57:05 +02:00
d45e8734d1 Fix square image resize
Fixes #37980
2020-04-18 13:29:01 +03:00
3c261e0dfa Made possible to specify where to dump the contents when loading a ".pck" file 2020-04-16 22:52:26 -03:00
943ec79859 Fixes leaks in ResourceCache, Vulkan and X11 2020-04-15 10:27:57 +02:00
8e6e91f2cd Remove unnecessary check for zero determinant in Basis::orthonormalize(). 2020-04-14 17:20:45 +01:00
5944eb6e7f Implement decals
Also implemented decal atlas, so projectors and other stuff can be added.
Sidenote: Had to make RID hashable, so some unrelated includes changed
in order to include it in hashfuncs.h
2020-04-14 11:13:34 -03:00
0826b63c7e Merge pull request #37450 from SkyLucilfer/profilerBug
Fix profiler frame number stops updating when window is minimized
2020-04-10 17:56:28 +02:00
d41444b0d8 Merge pull request #37693 from lupoDharkael/remove-hint
Remove obsolete enums
2020-04-10 11:47:44 +02:00
95db658672 Merge pull request #37699 from lupoDharkael/committing-typo
Replace is_commiting_action with is_committing_action
2020-04-10 11:47:19 +02:00
0b9e95cac5 Fix Engine get_target_fps() returning float instead of int. 2020-04-10 06:48:22 +01:00
5021dcfcd6 Remove obsolete enums 2020-04-08 20:44:01 +02:00
406c2790e3 Replace is_commiting_action with is_committing_action 2020-04-08 18:52:04 +02:00
4ffc0d6b3f Refactored shadowmapping.
- Made shadow bias size independent, so it will remain when changing light or camera size.
- Implemented normal offset bias, which greatly enhances quality.
- Added transmission to subsurface scattering
- Reimplemented shadow filter modes

Closes #17260
2020-04-08 11:19:43 -03:00
8c8e3ba918 Merge pull request #37579 from Calinou/improve-shader-error-output
Improve the shader error console output
2020-04-07 09:17:37 +02:00
94fab21348 Fix aspect ratio on hmd projection matrix
(cherry picked from commit a7438f0e61)
2020-04-05 12:41:29 +02:00
5fae0c454a Improve the shader error console output
This makes the line gutter look more like an actual line gutter,
which makes it less confusing.
2020-04-04 14:27:44 +02:00
27ddb27da8 Fix C# bindings after recent breaking changes 2020-04-03 01:38:48 +02:00
ea7b497065 Replace more occurrences of NULL with nullptr 2020-04-02 14:56:01 +02:00
95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
5f11e15571 Merge pull request #37504 from qarmin/out_of_bound_cursor
Fix array out of bounds access caused by uninitialised variables
2020-04-02 13:07:55 +02:00
d648f77119 Make dict erase node sequenced godotengine#37477
* Updated macro call to make the visual Dictionary Erase node sequenced.
2020-04-01 22:10:12 -05:00
359bebd8c0 Fix out of bound array access caused by unassigned variable 2020-04-01 19:29:35 +02:00
cb53b1d88e some typo in method binds fixed 2020-04-01 14:01:18 +05:30
c1ee20a05d Fix profiler frame number stops updating when window is minimized 2020-03-31 03:49:29 +02:00
cd4e46ee65 SCons: Format buildsystem files with psf/black
Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.
2020-03-30 09:05:53 +02:00
0c24a844ec Ensure COWData does not reallocate on push back, fixes #22561 2020-03-27 21:52:42 -03:00
a6f3bc7c69 Renaming of servers for coherency.
VisualServer -> RenderingServer
PhysicsServer -> PhysicsServer3D
Physics2DServer -> PhysicsServer2D
NavigationServer -> NavigationServer3D
Navigation2DServer -> NavigationServer2D

Also renamed corresponding files.
2020-03-27 15:21:27 -03:00
f725bd99f4 Fix some -Wmaybe-uninitialized warnings
Namely:
```
modules/basis_universal/register_types.cpp: In function 'Ref<Image> basis_universal_unpacker(const Vector<unsigned char>&)':
modules/basis_universal/register_types.cpp:266:15: warning: 'imgfmt' may be used uninitialized in this function [-Wmaybe-uninitialized]
  266 |  image->create(info.m_width, info.m_height, info.m_total_levels > 1, imgfmt, gpudata);
      |  ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
modules/basis_universal/register_types.cpp:255:39: warning: 'format' may be used uninitialized in this function [-Wmaybe-uninitialized]
  255 |    bool ret = tr.transcode_image_level(ptr, size, 0, i, dst + ofs, level.m_total_blocks - i, format);
      |               ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```

```
servers/visual_server.cpp: In member function 'Error VisualServer::_surface_set_data(Array, uint32_t, uint32_t*, uint32_t, Vector<unsigned char>&, int, Vector<unsigned char>&, int, AABB&, Vector<AABB>&)':
servers/visual_server.cpp:636:15: warning: 'iw' may be used uninitialized in this function [-Wmaybe-uninitialized]
  636 |       copymem(&iw[i * 2], &v, 2);
      |               ^
```

```
core/image.cpp: In member function 'Error Image::generate_mipmap_roughness(Image::RoughnessChannel, const Ref<Image>&)':
core/image.cpp:1683:11: warning: 'roughness' may be used uninitialized in this function [-Wmaybe-uninitialized]
 1683 |     float roughness;
      |           ^~~~~~~~~
```
2020-03-27 14:33:06 +01:00
15a9f94346 Add macOS DisplayServer implementation.
Change global menu to use Callable, add support for check items and submenus.
2020-03-26 16:24:05 +01:00
543fb1c4da Separate DisplayServer from OS on Windows 2020-03-26 15:49:41 +01:00