Commit graph

720 commits

Author SHA1 Message Date
Rémi Verschelde
0743a07447
Revert "Add Min/Max Window Size Setting" 2019-08-17 16:19:18 +02:00
Rémi Verschelde
822a41a8c0
Merge pull request #31367 from sparkart/add_minmax_winsize_setting
Add Min/Max Window Size Setting
2019-08-17 11:21:56 +02:00
Emmanuel Barroga
a7bf643a7b Add Min/Max Window Size Setting
Add project settings to easily set the minimum and maximum window size.
2019-08-15 12:19:09 -07:00
IAmActuallyCthulhu
82b9557803
Remove redundant author doc comments 2019-08-12 04:26:38 -05:00
Rémi Verschelde
839cc98cb9
Merge pull request #31290 from nekomatata/fix-test-regex-disabled
Fixed link errors when building in debug with RegEx module disabled
2019-08-12 10:05:35 +02:00
PouleyKetchoupp
360fb0ffa8 Fixed link errors when building in debug with option module_regex_enabled=no 2019-08-11 12:17:18 +02:00
Michael Alexsander Silva Dias
5ca7460421 Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "main" and "servers" directories 2019-08-09 11:27:39 -03:00
Hugo Locurcio
47c615caf3
Cap the number of warnings/errors per second rather than per frame
This reproduces the behavior used for printing when using the remote
debugger. The default limit is 100 errors and 100 warnings per second,
which makes it possible to display much more GDScript warnings
before overflowing.

This also adds a "Too many warnings" message, so that warnings
don't look like errors when overflowing anymore.

This closes #21896.
2019-07-31 17:29:26 +02:00
Guilherme Felipe
508761e0cd Fix set_default_cursor_shape always sending motion event 2019-07-29 14:00:37 -03:00
Tomasz Chabora
bd5b73108f Don't release action if it's not pressed 2019-07-24 18:18:03 +02:00
Chaosus
080c0bb7fe Added count method to String 2019-07-23 18:55:54 +03:00
Rémi Verschelde
66d09a6b4c SCons: Fix uses of [].append instead of env.add_source_files()
Also added support for SCons project-absolute paths (starting with #) and
warning about duplicates in add_source_files(), and fixed
default_controller_mappings.gen.cpp being included twice after first build
due to *.cpp globbing.

Part of #30270.
2019-07-22 15:08:32 +02:00
Rémi Verschelde
20a3bb9c48
Merge pull request #30226 from lawnjelly/interpolate
Add access to interpolation fraction for fixed timestep interpolation
2019-07-18 15:44:14 +02:00
Chaosus
c37379456f Implemented local shader arrays 2019-07-15 15:57:39 +03:00
lawnjelly
bf6c301b9c Add access to interpolation fraction for fixed timestep interpolation
Addresses #30068

This is a prerequisite for allowing proper support for fixed timestep interpolation, exposing the interpolation fraction to the engine, modules and gdscript.

The interpolation fraction is the fraction through the current physics tick at the time of the current frame.
2019-07-11 08:25:26 +01:00
Hugo Locurcio
28d3a6051c
Use base Color() constructors instead of Color::html()
This results in slightly smaller binaries (-17 KB for an editor binary)
as no strings need to be allocated.
2019-07-08 21:17:10 +02:00
Rémi Verschelde
56269e2db8
Merge pull request #29613 from Calinou/doctool-create-directories
Make `--doctool` create directories if they don't exist
2019-07-08 15:08:45 +02:00
qarmin
9a77d748c0 Fixes minor issues found by static analyzer 2019-07-07 23:08:51 +02:00
Hugo Locurcio
a84124fd1d
Make --doctool create directories if they don't exist
This prevents errors due to missing directories when generating
engine documentation.

This closes #17297.
2019-07-04 17:01:07 +02:00
Rémi Verschelde
98e7ec1e26
Revert "Add godot version in backtrace message" 2019-07-01 13:58:57 +02:00
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
Rémi Verschelde
32afd19541
Merge pull request #22548 from fire/visualscript_whitespace
Visualscript search fixes
2018-10-16 12:54:43 +02:00
Pedro J. Estébanez
9692549c34 Track screen drag speed
Following the universal input handling effort, this works the same for every platform, as long as the touch move event coming from it contains the relative movement.

The same tracking algorithm used to track the mouse speed is used here, but tracking separately each touch index.

Fixes #3623.
2018-10-14 18:01:06 +02:00
K. S. Ernest (iFire) Lee
47b42787e3 Make visualscript search better.
* There were spaces unequally inside the function definitions.
* camelcase_to_underscore() should also work for numbers inside of the camel case.
* Removed the builtin concept
* Capitalize descriptions from methods too.
* Match the visual script functions by removing the empty arguments "( )"
* Add some test cases
2018-10-11 14:22:40 -07:00
Florian Jung
15d3c96afd Add testcase whether OAHashMap loses keys
This demonstrates issue #22928.
2018-10-11 09:57:35 +02:00
Guilherme Felipe
f402253939 [x11] Use "application/config/name" for WM_CLASS 2018-10-05 17:18:10 -03:00
Rémi Verschelde
f48ee838e7 Fix GCC 8 warnings about potentially unitialized variables
Fixes the following GCC 8 warnings:
```
core/image.cpp:730:44: warning: 'mip1_weight' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:293:20: warning: 'mip2' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:293:20: warning: 'mip1' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/audio_stream_preview.cpp:58:19: warning: 'vmax' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/audio_stream_preview.cpp:85:19: warning: 'vmin' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/editor_themes.cpp:306:53: warning: 'preset_contrast' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/plugins/animation_blend_space_2d_editor.cpp:459:27: warning: 'prev_idx' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/plugins/animation_blend_space_2d_editor.cpp:443:27: warning: 'prev_idx' may be used uninitialized in this function [-Wmaybe-uninitialized]
main/tests/test_oa_hash_map.cpp:57:29: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized]
modules/csg/csg.cpp:764:40: warning: 'max_angle' may be used uninitialized in this function [-Wmaybe-uninitialized]
modules/csg/csg_shape.cpp:1945:3: warning: 'face_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/3d/voxel_light_baker.cpp:1593:8: warning: 'cone_aperture' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/3d/voxel_light_baker.cpp:1592:6: warning: 'cone_dir_count' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/animation/animation_blend_space_2d.cpp:471:8: warning: 'mind' may be used uninitialized in this function [-Wmaybe-uninitialized]

core/os/memory.cpp:94: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
core/os/memory.cpp:95: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
core/os/memory.cpp:98: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas]
```
2018-10-04 13:08:41 +02:00
Rémi Verschelde
6ab78d9ffb Fix some more warnings reported by CI
Fixes the following Clang 7 warnings:
```
core/io/marshalls.cpp:872:10: warning: unused variable 'f' [-Wunused-variable]

core/ustring.cpp:1831:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
core/ustring.cpp:1832:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]

drivers/gles3/rasterizer_gles3.cpp:82:24: warning: unused function '_gl_debug_print' [-Wunused-function,34]

main/main.cpp:118:13: warning: unused variable 'auto_build_solutions' [-Wunused-variable]

modules/csg/csg_gizmos.cpp:225:46: warning: 'current' may be used uninitialized in this function [-Wmaybe-uninitialized]
```
2018-10-03 14:13:42 +02:00
William Tumeo
62218ea41b Editor: Skip loading main scene if restore_scenes_on_load is used 2018-10-02 15:41:16 -03:00
Rémi Verschelde
ff1794a7a0
Merge pull request #22621 from groud/limit_window_size
Avoid the window size to go below 0
2018-10-02 18:42:56 +02:00
groud
943feeee10 Avoid the window size to go below 0 2018-10-02 14:51:24 +02:00
Rémi Verschelde
c026e3957a Fix warnings on virtual methods [-Woverloaded-virtual] [-Wdelete-non-virtual-dtor]
Fixes the following Clang 7 warnings:
```
editor/editor_help.h:123:7: warning: 'EditorHelpIndex::popup' hides overloaded virtual function [-Woverloaded-virtual]
editor/editor_help.h:95:7: warning: 'EditorHelpSearch::popup' hides overloaded virtual function [-Woverloaded-virtual]
editor/editor_help.h:96:7: warning: 'EditorHelpSearch::popup' hides overloaded virtual function [-Woverloaded-virtual]
editor/plugins/curve_editor_plugin.h:141:15: warning: 'CurvePreviewGenerator::generate' hides overloaded virtual function [-Woverloaded-virtual]
editor/plugins/script_editor_plugin.h:70:7: warning: 'ScriptEditorQuickOpen::popup' hides overloaded virtual function [-Woverloaded-virtual]
editor/quick_open.h:69:7: warning: 'EditorQuickOpen::popup' hides overloaded virtual function [-Woverloaded-virtual]
main/tests/test_io.cpp:53:15: warning: 'TestIO::TestMainLoop::input_event' hides overloaded virtual function [-Woverloaded-virtual]
servers/audio/effects/audio_effect_record.h:69:15: warning: 'AudioEffectRecordInstance::process_silence' hides overloaded virtual function [-Woverloaded-virtual]

core/os/memory.h:119:2: warning: destructor called on non-final 'ContextGL_X11' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
core/os/memory.h:119:2: warning: destructor called on non-final 'EditorScriptCodeCompletionCache' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
core/os/memory.h:119:2: warning: destructor called on non-final 'Engine' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
core/os/memory.h:119:2: warning: destructor called on non-final 'PhysicalBone::JointData' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
core/os/memory.h:119:2: warning: destructor called on non-final 'VisualServerScene' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
core/os/memory.h:119:2: warning: destructor called on non-final 'VisualServerViewport' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
```
2018-10-02 13:40:17 +02:00
Rémi Verschelde
3771a4b9ba Fix build after ##21492 2018-10-02 10:47:51 +02:00
Rémi Verschelde
b4c1d40869
Merge pull request #21492 from Maykeye/astar
Changed A* exit condition, added 2 tests for it
2018-10-02 10:30:12 +02:00
Rémi Verschelde
e98eb0c113
Merge pull request #22466 from akien-mga/controllerdb-update
Sync controller mappings DB with SDL2 community repo
2018-10-02 10:03:32 +02:00
Rémi Verschelde
7163551a3b Input: Add mapping for X-Box One S controller on Linux
Also PR'ed upstream, so could be removed from the Godot file
and synced with upstream if/when merged:
https://github.com/gabomdq/SDL_GameControllerDB/pull/222

Fixes #18167.
2018-10-02 09:14:47 +02:00
Rémi Verschelde
b1b625f4f5 Fix various Clang 7 warnings about unused stuff
Namely:
[-Wunneeded-internal-declaration]
[-Wunused-comparison]
[-Wunused-const-variable]
[-Wunused-function]
[-Wunused-private-fields]

Fixes the following Clang 7 warnings:
```
editor/plugins/script_editor_plugin.cpp:1417:20: warning: function '_find_node_with_script' is not needed and will not be emitted [-Wunneeded-internal-declaration]
editor/scene_tree_dock.cpp:1859:14: warning: function '_find_last_visible' is not needed and will not be emitted [-Wunneeded-internal-declaration]

modules/gdscript/gdscript_parser.cpp:7838:19: warning: equality comparison result unused [-Wunused-comparison]

scene/resources/mesh.cpp:549:35: warning: unused variable '_array_types' [-Wunused-const-variable]
scene/resources/mesh.cpp:563:18: warning: unused variable '_format_translate' [-Wunused-const-variable]

drivers/gles3/rasterizer_scene_gles3.cpp:54:28: warning: unused function 'store_transform2d' [-Wunused-function]

core/io/file_access_network.h:50:6: warning: private field 'ml' is not used [-Wunused-private-field]
core/io/file_access_zip.h:93:14: warning: private field 'archive' is not used [-Wunused-private-field]
core/io/resource_format_binary.h:122:6: warning: private field 'bin_meta_idx' is not used [-Wunused-private-field]
core/message_queue.h:47:9: warning: private field 'mutex' is not used [-Wunused-private-field]
main/tests/test_gui.cpp:63:11: warning: private field 'control' is not used [-Wunused-private-field]
modules/gdscript/gdscript_parser.h:558:7: warning: private field 'completion_static' is not used [-Wunused-private-field]
platform/x11/os_x11.h:148:11: warning: private field 'ip_unix' is not used [-Wunused-private-field]
platform/x11/os_x11.h:180:7: warning: private field 'net_wm_icon' is not used [-Wunused-private-field]
platform/x11/os_x11.h:189:6: warning: private field 'audio_driver_index' is not used [-Wunused-private-field]
platform/x11/os_x11.h:190:15: warning: private field 'capture_idle' is not used [-Wunused-private-field]
servers/physics/body_pair_sw.h:79:6: warning: private field 'cc' is not used [-Wunused-private-field]
servers/visual/visual_server_raster.h:62:7: warning: private field 'draw_extra_frame' is not used [-Wunused-private-field]
```
2018-10-01 17:32:12 +02:00
Rémi Verschelde
fc8b73a935 Main: Use ImageLoader directly instead of Image::load
Image::load is now issuing warnings (since ef50957) to prevent users
from using it to load images at runtime which would be included in
their exported game.

So we now use ImageLoader explicitly instead for the custom-handled
cases in Main.

Fixes #21072, supersedes #22321.
2018-09-30 21:31:16 +02:00
Rémi Verschelde
3a2ca68af3 SCons: Build thirdparty code in own env, disable warnings
Also remove unnecessary `Export('env')` in other SCsubs,
Export should only be used when exporting *new* objects.
2018-09-28 14:07:39 +02:00
Rémi Verschelde
7b081a7fc8 Fix warnings about unhandled enum value in switch [-Wswitch]
Fixes GCC 5 warnings of the form:

core/io/http_client.cpp:288:9: warning: enumeration value 'STATUS_SSL_HANDSHAKE_ERROR' not handled in switch [-Wswitch]
core/io/marshalls.cpp:806:9: warning: enumeration value 'AABB' not handled in switch [-Wswitch]

Those can be trivial cases where adding a default fallback is the solution,
or more complex issues/hidden bugs where missed values are actually meant
to be handled.
2018-09-27 18:34:30 +02:00
Rémi Verschelde
cda5b0bfe1 Fix warnings about unused variables [-Wunused-variable]
Fixes the following GCC 5 warnings:
```
drivers/gles2/rasterizer_scene_gles2.cpp:1139:15: warning: unused variable 'offset' [-Wunused-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:1205:39: warning: unused variable 'multi_mesh' [-Wunused-variable]
drivers/gles2/rasterizer_storage_gles2.cpp:359:7: warning: unused variable 'srgb' [-Wunused-variable]
drivers/gles2/shader_gles2.cpp:1016:45: warning: unused variable 'texture_hints' [-Wunused-variable]
editor/animation_track_editor.cpp:776:9: warning: unused variable 'keys_to' [-Wunused-variable]
editor/editor_inspector.cpp:273:7: warning: unused variable 'vs_height' [-Wunused-variable]
editor/editor_themes.cpp:202:10: warning: unused variable 'begin_time' [-Wunused-variable]
editor/editor_themes.cpp:239:10: warning: unused variable 'end_time' [-Wunused-variable]
editor/plugins/animation_blend_tree_editor_plugin.cpp:726:17: warning: unused variable 'an' [-Wunused-variable]
editor/plugins/script_text_editor.cpp:1278:8: warning: unused variable 'fold_state' [-Wunused-variable]
main/main.cpp:132:13: warning: 'use_vsync' defined but not used [-Wunused-variable]
modules/cvtt/image_compress_cvtt.cpp:231:8: warning: unused variable 'y_end' [-Wunused-variable]
modules/cvtt/image_compress_cvtt.cpp:311:6: warning: unused variable 'shift' [-Wunused-variable]
modules/gdscript/gdscript_editor.cpp:58:7: warning: unused variable 'th' [-Wunused-variable]
modules/gridmap/grid_map.cpp:1084:6: warning: unused variable 'ofs' [-Wunused-variable]
modules/theora/video_stream_theora.cpp:442:9: warning: unused variable 'tr' [-Wunused-variable]
modules/visual_script/visual_script_editor.cpp:2606:6: warning: unused variable 'count' [-Wunused-variable]
modules/visual_script/visual_script_editor.cpp:2829:6: warning: unused variable 'seq_count' [-Wunused-variable]
modules/visual_script/visual_script_editor.cpp:2844:24: warning: unused variable 'vnode_function' [-Wunused-variable]
modules/websocket/lws_peer.cpp:122:12: warning: unused variable 'peer_data' [-Wunused-variable]
modules/websocket/lws_peer.cpp:135:12: warning: unused variable 'peer_data' [-Wunused-variable]
modules/websocket/lws_peer.cpp:63:12: warning: unused variable 'peer_data' [-Wunused-variable]
modules/websocket/lws_peer.cpp:91:12: warning: unused variable 'peer_data' [-Wunused-variable]
platform/android/export/export.cpp:763:16: warning: unused variable 'node_size' [-Wunused-variable]
scene/gui/rich_text_label.cpp:850:10: warning: unused variable 'x_ofs' [-Wunused-variable]
scene/gui/text_edit.cpp:653:8: warning: unused variable 'tab_w' [-Wunused-variable]
scene/resources/bit_mask.cpp:186:6: warning: unused variable 'i' [-Wunused-variable]
scene/resources/mesh.cpp:549:20: warning: '_array_name' defined but not used [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:107:10: warning: unused variable 'v2' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:108:10: warning: unused variable 'v3' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:109:10: warning: unused variable 'v4' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:110:10: warning: unused variable 'v5' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:111:10: warning: unused variable 'v0n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:112:10: warning: unused variable 'v1n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:113:10: warning: unused variable 'v2n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:114:10: warning: unused variable 'v3n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:115:10: warning: unused variable 'v4n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:116:10: warning: unused variable 'v5n' [-Wunused-variable]
servers/visual/default_mouse_cursor.xpm:2:21: warning: 'default_mouse_cursor_xpm' defined but not used [-Wunused-variable]
```
2018-09-27 16:25:24 +02:00
Rémi Verschelde
d8b30d42f5 Fix warnings for operator precedence disambiguation [-Wparentheses]
Fixes the following GCC 5 warnings:
```
core/io/resource_format_binary.cpp:1721:29: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses]
core/typedefs.h:108:24: warning: suggest parentheses around comparison in operand of '!=' [-Wparentheses]
editor/plugins/spatial_editor_plugin.cpp:2202:58: warning: suggest parentheses around comparison in operand of '!=' [-Wparentheses]
editor/plugins/spatial_editor_plugin.cpp:5002:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
main/input_default.cpp:346:59: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
main/input_default.cpp:348:60: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
main/input_default.cpp:579:57: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
modules/gridmap/grid_map_editor_plugin.cpp:613:14: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses]
modules/theora/video_stream_theora.cpp:335:34: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
modules/theora/video_stream_theora.cpp:336:35: warning: suggest parentheses around '+' in operand of '&' [-Wparentheses]
modules/visual_script/visual_script_property_selector.cpp:215:38: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
scene/gui/rich_text_label.cpp:424:84: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
scene/gui/rich_text_label.cpp:512:80: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
scene/gui/scroll_container.cpp:173:36: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
scene/gui/scroll_container.cpp:173:86: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
scene/gui/tree.cpp:1419:98: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
```
2018-09-27 10:29:48 +02:00
Rémi Verschelde
2b084352b9 Fix warnings on non-static data member initializers (C++11 feature)
We're not formally using C++11 yet so those trigger compilation warnings
(at least with GCC 5):

./main/input_default.h:122:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
  CursorShape default_shape = CURSOR_ARROW;
                              ^

Note: We may allow those eventually (especially for non-int static const),
but most of current occurrences were inconsistent with all other classes.

See also http://www.stroustrup.com/C++11FAQ.html#member-init
2018-09-27 10:29:48 +02:00
Rémi Verschelde
7c000cde62 Sync controller mappings DB with SDL2 community repo 2018-09-27 09:54:21 +02:00
Rémi Verschelde
eb4af940dd Main: Group static members and add some docs 2018-09-20 14:38:40 +02:00
Rémi Verschelde
0274ded34c
Merge pull request #22070 from capnm/fix_Input.set_default_cursor_shape_take2
Fix set_default_cursor_shape interaction with Control nodes
2018-09-19 09:26:21 +02:00
Martin Capitanio
64cecf9d61 Fix set_default_cursor_shape interaction with Control nodes
Do not call `set_cursor_shape` when the cursor is inside the `Control` node.

Make it work for x11 in MOUSE_MODE_CONFINED.
2018-09-15 20:54:22 +02:00
Fabio Alessandrelli
0e56377e96 Allow system certs file to be used by Editor.
Note, it will only used by the Editor, not when running the game.
This allows package maintainer to compile Godot to use system installed
certificates when accessing the AssetLib.
2018-09-15 14:45:54 +02:00
Rémi Verschelde
de644a628d Make boot splash background color always configurable
This also means that you can keep the default Godot splash and
set your own custom background color.

Fixes #22076.
2018-09-14 21:00:26 +02:00
Rémi Verschelde
1a16dabfb5
Merge pull request #21982 from luzpaz/misc-typos
Misc. typos
2018-09-13 10:59:00 +02:00
luz.paz
08bde5b2de Misc. typos
Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
2018-09-12 21:39:17 -04:00