Commit graph

568 commits

Author SHA1 Message Date
Guilherme Felipe 1bae73d7d0 Add Input::get_current_cursor_shape
[Clean up] Removed unused/unnecessary methods.
2019-04-15 15:22:09 -03:00
Bojidar Marinov f04f127680
Fix as operator generating opcode 38 errors
Closes #27489
Fixup of 466a76ac2c

Additionally, update `GDScriptCompiler` test to use Ref and to include `as` expressions.
2019-04-10 13:18:50 +03:00
Rémi Verschelde c8994b56f9 Style: Apply new changes from clang-format 8.0
It seems to stay compatible with formatting done by clang-format 6.0 and 7.0,
so contributors can keep using those versions for now (they will not undo those
changes).
2019-04-09 17:09:48 +02:00
Rémi Verschelde 1ca555f1fb
Merge pull request #26760 from Xrayez/26744-fix-string-to-lower
Reorder reverse caps characters table for string lower case conversion
2019-04-08 10:48:15 +02:00
Rémi Verschelde 03bd93e3b3
Merge pull request #26830 from KidRigger/physics_fps_bug
Fixes physic_fps=0 bug that prevented quit.
2019-04-05 16:56:29 +02:00
Rémi Verschelde fc370b3feb Fix -Wimplicit-fallthrough warnings from GCC 8
Adds `FALLTHROUGH` macro to specify when a fallthrough is intentional.
Can be replaced by `[[fallthrough]]` if/when we switch to C++17.

The warning is now enabled by default for GCC on `extra` warnings level
(part of GCC's `-Wextra`). It's not enabled in Clang's `-Wextra` yet,
but we could enable it manually once we switch to C++11. There's no
equivalent feature in MSVC for now.

Fixes #26135.
2019-04-05 15:14:53 +02:00
Andrii Doroshenko (Xrayez) 34e6737413 Reorder reverse caps characters table for string lower case conversion
The binary search algorithm used to lookup character codes in the table
relies that the data must be ordered. This fixes `to_lower()` string
method to convert upper case to lower case properly, so that the
algorithm doesn't terminate prematurely.

Co-authored-by: AndreevAndrei (avandrei) <avandrei@MacBookAAV.local>
2019-04-05 11:10:15 +03:00
Pedro J. Estébanez 9c3ddf05cb Revert accidental commits
This reverts commit fb37284c02.
This reverts commit 4db0f51b9a.
2019-03-20 21:43:55 +01:00
Pedro J. Estébanez 4db0f51b9a Create live view dock [wip] 2019-03-20 20:44:43 +01:00
Bojidar Marinov b64f9f03f8
Fix duplicated lines in GDScript bytecode
Fixes #26789
2019-03-14 18:38:07 +02:00
Rémi Verschelde 775e74e0d4
Merge pull request #26484 from Andrettin/Configurable-Tooltip-Offset
Make the Tooltip Position Offset Configurable
2019-03-13 20:12:22 +01:00
Rémi Verschelde bba854bac6
Merge pull request #26851 from RandomShaper/fix-26460-fake-event-flood
Fix fake null-motion mouse event flood
2019-03-09 22:40:53 +01:00
Pedro J. Estébanez f757460ec8 Fix fake null-motion mouse event flood
This commit also improves a bit the code quality by making the intent of fake events (and themselves) more explicit.

Fixes #26460.
2019-03-09 22:04:17 +01:00
Anish Bhobe 3c27980a17 Fixes physic_fps=0 bug.
Added a condition to check if the loop exited without iteration
being run by checking the return value from idle().

Fixes: #26321
2019-03-09 17:13:08 +05:30
Rémi Verschelde d462e5153d Set editor hint early for Project Manager and Editor
We need it in setup() already before initializing the renderer,
as it's used to force fallback to GLES2 if GLES3 fails.

Fixes #26806.
2019-03-09 01:04:55 +01:00
Juan Linietsky 34a29cb0de
Merge pull request #26669 from RandomShaper/fix-26460
Improve/fix picking
2019-03-06 13:55:01 -03:00
Rémi Verschelde 05ed316114 Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@4f9962c7b2.
2019-03-06 17:13:40 +01:00
Pedro J. Estébanez 82902656ac Improve/fix picking
Acknowledge mouse button events as position tellers (to make picking more solid; for instance, the touch mouse is raised with a mouse unpressed event that may have a more current position)
Forget mouse position for physics if touch mouse raised (because the position known as last is no longer meaningful)
Remove needless check for mouse over/exit (now there's code to inject an spurious move for cases where camera/objects have moved)
Restrict 2D mouse over/exit to mouse events (including emulated from touch; true touches shouldn't trigger the signals)

Fixes #26460.
2019-03-05 22:33:34 +01:00
Rémi Verschelde b0f782a0e3 Disable driver fallback to GLES2 by default
GLES2 is not designed to be a drop-in replacement for the GLES3 backend,
so the fallback mode has to be used knowingly. It *can* make sense for
simple projects which make sure to handle the differences between both
rendering backends, but most users should stick to one supported backend.

By making it opt-in, we can now use this parameter to define whether to
export ETC textures to Android and iOS when using GLES3 + Fallback.

When using GLES3 without Fallback on Android, set the proper min GLES
version in the AndroidManifest.

Also made the option boolean and renamed it for clarity and to avoid
conflict with the previous String option (which would always evaluate as
"true" otherwise).

Fixes #26569.
2019-03-05 16:36:46 +01:00
Juan Linietsky ecd8795755 Use accumulated input by default, fixes #26395 2019-03-05 08:31:22 -03:00
Juan Linietsky a1e73dcc94 Add support for event accumlation (off by default, on for editor), fixes #26536 2019-03-03 19:53:13 -03:00
Andrettin 30c07c1ae1 Made the tooltip position offset configurable 2019-03-02 12:11:42 +01:00
marxin aff84ec55d Fix -Wsuggest-attribute=format warnings. 2019-02-27 06:56:50 +01:00
Rémi Verschelde 8862d37e69 Fix property hint for stretch strink setting
Fixes #25184.
2019-02-25 16:53:33 +01:00
Juan Linietsky 9d78274e06 Make allowed pid for window takeover happen immediately, fixes #21431 2019-02-23 12:09:35 -03:00
Hein-Pieter van Braam 4f49d09272 Don't crash when parse_utf8 receives a NULL pointer
This can happen when chaining calls to various string methods when the
string is empty.
2019-02-22 19:28:19 +01:00
marxin 8d51618949 Add -Wshadow=local to warnings and fix reported issues.
Fixes #25316.
2019-02-20 19:44:12 +01:00
Rémi Verschelde 5d815a5526
Merge pull request #26087 from akien-mga/settings-per-pixel-transparency
ProjectSettings: fix category for per pixel transparency settings
2019-02-20 16:28:24 +01:00
Rémi Verschelde e7018e4017 ProjectSettings: fix category for per pixel transparency settings 2019-02-20 14:45:02 +01:00
Rémi Verschelde d35003d92a GDScript: Remove unused switch, case and do CF keywords
They had been reserved for future implementation, but we now have the
`match` CF keyword which does the same and more.

According to @reduz `do` was even added by mistake when copying from
the shader language parser, it was never intended to add support for
`do`... `while` loops, as the syntax would be awkward in GDScript,
and the added sugar is not worth it.

Fixes #25787.
2019-02-20 14:05:08 +01:00
marxin 155cbe0b37 Fix warnings seen with warnings=all and recent GCC 8.2. 2019-02-18 21:54:31 +01:00
Rémi Verschelde 75dae1b9a9 Drivers, main, servers: Ensure classes match their header filename
Renamed:
- `drivers/alsamidi/alsa_midi.h` -> `midi_driver_alsamidi.h`
  (same for `coremidi` and `winmidi`)
- `main/timer_sync.h` -> `main_timer_sync.h`
- `servers/visual/visual_server_global.h` -> `visual_server_globals.h`
2019-02-12 14:39:47 +01:00
Rémi Verschelde 13c50e8aa5
Merge pull request #25481 from hpvb/fix-ubsan-asan-reports
Fix many asan and ubsan reported issues
2019-02-12 12:21:01 +01:00
Rémi Verschelde c363857426 Be explicit about usage of GDScript tests
Also drop empty "image" test, and print proper error when passing wrong
test name.

Fixes #25638.
2019-02-10 15:11:32 +01:00
Aaron Franke 3f837d5cc5 [Core] Rename Matrix3 file to Basis
The code already referred to "Basis", it's just the file name that was different for some reason.
2019-02-09 14:42:23 -05:00
Hein-Pieter van Braam d308eb091a Fix many asan and ubsan reported issues
This allows most demos to run without any ubsan or asan errors. There
are still some things in thirdpart/ and some things in AudioServer that
needs a look but this fixes a lot of issues. This should help debug less
obvious issues, hopefully.

This fixes #25217 and fixes #25218
2019-01-30 06:43:56 +01:00
Juan Linietsky 8ff00ca52d Make recursive nature of iteration not fail. 2019-01-24 13:09:05 -03:00
Juan Linietsky 99d997e424 Do not fail on recursive iteration. Not ideal but should work for now and not crash. Fixes #25272
Eventually some sort of main even queue should be implemented to do this properly.
2019-01-24 12:42:57 -03:00
Juan Linietsky 0c9fd3c4b4 Avoid cyclic iteration check, fixes #24969 2019-01-22 13:17:39 -03:00
Rémi Verschelde 3c288f1052 Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@c5af5d58f4.
Closes #25138.
2019-01-21 15:48:31 +01:00
Rémi Verschelde 789bad18f9 Donors: Remove GameDev.tv from splash screen 2019-01-16 13:12:49 +01:00
Rémi Verschelde 053d7f3765 Fix some errors found by static analysis
Fixes items 10, 16 and 19 from PVS-Studio blog post
in #24014.
2019-01-16 10:59:45 +01:00
Rémi Verschelde 02ffc59270 GLES2: Make Nvidia flicker workaround opt-in
It has a big impact on 2D and text rendering performance (cf. #24466)
so the solution seems worse than the bug it aims to work around.

It's now opt-in via "rendering/quality/2d/gles2_use_nvidia_rect_flicker_workaround"
for those who need it and have a simple enough game for the performance
drop not to be an issue.

Fixes #24466.
2019-01-14 19:02:07 +01:00
Ibrahn Sahir cbb396c006 Repair String lstrip and rstrip.
Background: lstrip and rstrip were broken by changes to String in:
0e29f7974b
which removed it's access to Vector::find(CharType).

Moved Vector's find up into CowData so it can be shared by Vector and String.
Added String::find_char using CowData::find.
Implemented rstrip and lstrip using find_char.
Added a few tests for String rstrip and lstrip.
2019-01-07 17:34:44 +00:00
Wilson E. Alvarez caf5e92121
Fixed out of bounds axis name access 2019-01-04 19:34:14 -05:00
Hein-Pieter van Braam ac99ed3cda String[size()] should return a default constructed CharType
As per the C++ standard 21.3.4.1 for std::string:
Returns: If pos < size(), returns data()[pos]. Otherwise, if pos ==
size(), the const version returns charT(). Otherwise, the behavior is
undefined.

Since the behavior is undefined Godot now does the same thing for const
and non-const versions of operator[].

This fixes #21242 and fixes #22221.
2019-01-04 17:48:03 +00:00
Timo Schwarzer 8d79fea969
Don't apply target_fps in editor 2019-01-03 18:22:42 +01: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 9cb18232c2 Core: Drop unused global_defaults logic
It used to be used for Android and iOS to specify platform-specific
project settings overrides, but we now have feature tags for that.
2018-12-20 11:02:49 +01:00
Rémi Verschelde 4d546164e7 Fix maybe-uninitialized warnings from GCC 4.8.x
Fixes the following warnings in `p=server target=release_debug` builds
on Travis CI:
```
./core/os/memory.h: In function 'MainLoop* TestOAHashMap::test()':
./core/os/memory.h:108:111: warning: 'dummy' may be used uninitialized in this function [-Wmaybe-uninitialized]
 #define memnew_placement(m_placement, m_class) _post_initialize(new (m_placement, sizeof(m_class), "") m_class)
                                                                                                               ^
main/tests/test_oa_hash_map.cpp:98:7: note: 'dummy' was declared here
   int dummy;
       ^

scene/resources/bit_mask.cpp:447:3: warning: 'next_i' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/resources/bit_mask.cpp:448:4: warning: 'next_j' may be used uninitialized in this function [-Wmaybe-uninitialized]
```
2018-12-17 12:42:26 +01:00