Commit graph

650 commits

Author SHA1 Message Date
Rémi Verschelde d17eac735c
Merge pull request #29815 from NilsIrl/plus_file_1
Replace ` + "/" + ` with `String::file_add()`
2019-07-01 12:06:35 +02:00
Rémi Verschelde 336010d676
Merge pull request #28572 from lupoDharkael/trace-info
Add godot version in backtrace message
2019-07-01 09:44:53 +02:00
Rémi Verschelde b0809046be
Merge pull request #30154 from bojidar-bg/30149-export-flag-editor
Ensure --export implies --editor
2019-06-29 18:16:43 +02:00
Bojidar Marinov 9ebc146383
Ensure --export implies --editor
Fixes #30149
2019-06-28 15:34:09 +03:00
Bojidar Marinov 0c4c36d823
Add default values to the editor help, docs, and generated RST
Also, make spacing of "=" in the editor help a bit more consistent.
Closes #16086
2019-06-27 18:29:35 +03:00
Rémi Verschelde eaaff9da31
Merge pull request #29941 from qarmin/redundant_code_and_others
Remove redundant code, possible NULL pointers and others
2019-06-27 01:05:18 +02:00
qarmin 4e5310cc60 Some code changed with Clang-Tidy 2019-06-26 15:08:25 +02:00
Nils ANDRÉ-CHANG d2833d4f4d Replace + "/" + with String::file_add() 2019-06-23 13:33:50 +01:00
Luka Dornhecker ad504b926f Add option to toggle console window on Windows
This is an editor setting and its value can also be toggled
using an entry in the Editor toolbar. The console will still
appear briefly when starting the project manager or editor,
as it's still compiled as console application.

Does not impact exported games, which will still run without
console in release and with console in debug mode.

A project setting or export option could be added to disable
it in debug mode if there's demand for it, but that would
greatly reduce the usefulness of debug builds if Windows users
can no longer report error and crash messages.

Fixes #17889.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2019-06-20 16:55:52 +02:00
Andrii Doroshenko (Xrayez) 33f55369cb Enforce Unicode encoding in MSVC
This can help to solve compilation issues on systems with Japanese
locale with encodings like Shift_JIS and UTF-8-BOM.

Also be more consistent using String::utf8() to represent cyrilic
unicode characters in test_string.cpp

Clarified some comments in test_string.cpp for some Unicode characters.
2019-06-19 14:42:09 +03:00
Rémi Verschelde d2f38dbb28
Merge pull request #29470 from KoBeWi/_
Add a separator in debug output for readability
2019-06-19 00:19:14 +02:00
Rémi Verschelde 6ba1b4e371
Merge pull request #29764 from Calinou/boot-splash-no-filter-option
Add an option to disable boot splash filtering
2019-06-16 10:39:53 +02:00
Hugo Locurcio 786a7341a7
Add an option to disable boot splash filtering
Disabling filtering is usually desired in projects using a pixel art style.

This closes #19415.
2019-06-15 23:53:39 +02:00
Emmanuel Barroga 2cce5699ea Limit Physics Process FPS above 0
Resolves: #19734
2019-06-13 08:53:48 -07:00
Rémi Verschelde 0e6cac8ab8
Merge pull request #29465 from bruvzg/per_pixel_transp_impr
Removes redundant "splash" setting, improves per pixel transparency documentation.
2019-06-12 12:50:17 +02:00
Rémi Verschelde 6d16f2f053 Fix error macro calls not ending with semicolon
It's not necessary, but the vast majority of calls of error macros
do have an ending semicolon, so it's best to be consistent.
Most WARN_DEPRECATED calls did *not* have a semicolon, but there's
no reason for them to be treated differently.
2019-06-11 14:49:34 +02:00
Tomasz Chabora c478f2cb1a Add a separator in debug output for readability 2019-06-04 15:20:37 +02:00
bruvzg 54863b20e6
Removes redundant "display/window/per_pixel_transparency/splash" setting, improves per pixel transparency documentation. 2019-06-04 11:21:29 +03:00
Hugo Locurcio dc981d8af7
Display longer Git hashes in engine version dialogs
Due to the high number of commits in the Godot repository,
7-character hashes were starting to become occasionally ambiguous.

In contrast, 9-character hashes are currently unambiguous for
all commits.
2019-06-01 13:52:58 +02:00
Rémi Verschelde af2c742f53 Fix and expose String::strip_escapes(), use it in LineEdit paste
Supersedes #27736.
2019-05-31 15:49:14 +02:00
Rémi Verschelde b10dd110e5 Print engine version to stdout when starting Godot
Also include website URL and make it configurable via version.py
together with the rest of the engine branding.

Add mention to MIT license in --help output.
2019-05-28 11:19:21 +02:00
Rémi Verschelde e8fbb28e20
Merge pull request #29119 from bruvzg/native_icon_support
Add native window/taskbar icon support for Windows and macOS.
2019-05-27 12:09:42 +02:00
Rémi Verschelde a1a71c05ba
Merge pull request #28993 from Calinou/server-hide-noop-cli-arguments
Hide non-applicable CLI arguments in the server platform
2019-05-24 22:56:29 +02:00
Hugo Locurcio 2964e198e0
Hide non-applicable CLI arguments in the server platform
This refactors some of the CLI parsing code to follow the CLI help's
order, making it easier to toggle using compile-time defines.
2019-05-24 20:11:37 +02:00
bruvzg 2b9ed68d6a
Add native window/taskbar icon support for Windows and macOS.
Co-authored-by: Markus Törnqvist <mjt@nysv.org>
2019-05-24 14:23:57 +03:00
Rémi Verschelde b4e22cb98a
Merge pull request #28792 from Calinou/low-processor-mode-144hz
Tweak the default low-processor usage mode to be 144 Hz-friendly
2019-05-20 17:52:51 +02:00
Ryan Stein 42d6205e8c Add RegEx substitution testcase and fix relevant docs
(cherry picked from commit a31bbb4bd9)
2019-05-11 09:03:19 +02:00
Hugo Locurcio 8c7ee6dac4
Tweak the default low-processor usage mode to be 144 Hz-friendly
On high-refresh rate displays, the old default value (8000) effectively
limited redrawing to 125 FPS, no matter whether V-Sync was enabled
or not. The new value limits redrawing to a value slightly above
144 FPS, decreasing input lag and making the editor feel smoother
when using freelook.

60 Hz displays aren't affected by this change when V-Sync is enabled,
since V-Sync will take care of limiting redrawing to 60 FPS.
2019-05-09 22:40:20 +02:00
lupoDharkael 92ea1c3cca Add godot version in backtrace message 2019-05-01 16:52:02 +02:00
Guilherme Felipe c709dfdf06 [Input] Release keys/actions pressed if window loses focus
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
Co-authored-by: Marcelo Fernandez <marcelofg55@gmail.com>
2019-04-27 12:05:12 -03:00
Daw11 f104731b81 Add missing enum value to Performance::get_monitor_type 2019-04-22 15:15:09 +02:00
Daw11 04d0371648 Add a monitor for the orphan nodes
- Allow the user to keep track of the nodes that might leak
- Possible fix for #27103
2019-04-17 23:13:16 +02:00
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
Rémi Verschelde 9df7ed59fb
Merge pull request #19501 from Zylann/custom_loaders
Added basic support for custom resource savers and loaders
2018-12-16 14:26:56 +01:00
Marc Gilleron 065e2670af Added basic support for custom resource savers and loaders 2018-12-15 05:34:53 +00:00
Rémi Verschelde a03b72956d
Merge pull request #20081 from moiman100/fix-double-click-hold
Fixes is_pressed when holding double click.
2018-12-14 23:18:52 +01:00
Rémi Verschelde dc2fadc14d
Merge pull request #22733 from guilhermefelipecgs/fix_wm_class
[x11] Use "application/config/name" for WM_CLASS
2018-12-07 22:35:17 +01:00
Rémi Verschelde e4a2003b98
Merge pull request #22323 from williamd1k0/ignore-main-scene
Editor: Skip loading main scene if restore_scenes_on_load is used
2018-12-07 15:08:34 +01:00
Rémi Verschelde bc2e1eedc5 Tests: Drop old test_io referencing data which isn't included
This should eventually be rewritten to properly test IO features,
but this would be part of a bigger work on adding a proper testing
framework for Godot features.

Fixes #2454.
2018-12-05 00:47:05 +01:00
Aaron Franke cb01268562 Fix many errors found by PVS-Studio
Fix errors 2, 3, 4, 6, 8, 9, 11, 12, 13, 14, and 15.
2018-11-28 05:03:24 -05:00
Fabian a01608c389 Improved support for custom image loaders 2018-11-23 08:16:54 +10:30
Rémi Verschelde 35e533f34f
Merge pull request #23597 from vnen/network-fs-fix
Fix deploy with network filesystem
2018-11-10 21:54:14 +01:00
George Marques 9fac01e410 Fix deploy with network filesystem
Also make some prints only happen in verbose mode.
2018-11-10 10:51:31 -02:00
Davide Baldo 1b0c7515ff Allow to specify a custom strength when calling Input.action_press(), this allows virtual axis, mainly for mobile. 2018-11-10 10:25:59 +00:00
Rémi Verschelde eeee47196c
Merge pull request #23262 from swenner/more-cppcheck-fixes
More cppcheck fixes, fixes #22702
2018-10-25 21:12:14 +02:00
Simon Wenner 9fcf9ee813 fixed uninitialized variables and false positives found by CppCheck 2018-10-25 20:38:17 +02:00
Rémi Verschelde 1169196f04
Merge pull request #22779 from Superwaitsum/LimitSettings
Limit several project settings
2018-10-25 11:38:06 +02:00
Superwaitsum e5041ad0f5 Add some limits on the Editor Settings 2018-10-24 19:46:33 -05:00
Rémi Verschelde f62af9c2df
Merge pull request #23012 from RandomShaper/fix-touch-speed-tracking
Track screen drag speed
2018-10-24 17:56:37 +02:00
Max Hilbrunner a3072aa35e
Merge pull request #23035 from voithos/missingpck
Show an alert when a project is not found in release mode
2018-10-19 11:44:40 +02:00
Zaven Muradyan 552c518b80 Show an alert when a project is not found in release mode
Previously, an error message would get printed to the console, but this
is problematic in e.g. Windows where a console is not displayed. In the
case of a missing .pck file, the binary would just silently fail. Now,
it shows an alert.

Fixes #21994.
2018-10-17 20:48:53 -07:00