Commit graph

757 commits

Author SHA1 Message Date
RevoluPowered
579342810f t Add unit testing to Godot using DocTest and added to GitHub Actions CI
Implements exit codes into the engine so tests can return their statuses.
Ideally we don't do this, and we use FIXUP logic to 'begin' and 'end' the engine execution for tests specifically.

Since realistically we're initialising the engine here we don't want to do that, since String should not require an engine startup to test a single header.

This lowers the complexity of running the unit tests and even for
physics should be possible to implement such a fix.
2020-07-24 13:05:33 +01:00
Rémi Verschelde
dcf902df85 SCons: Remove unused DEBUG_MEMORY_ENABLED define
Its last use was removed in Godot 3.0, so it no longer makes sense to define.

Also removed `D3D_DEBUG_INFO` for Windows as it's likely a left over from a
long time ago pre-opensourcing when Godot had some form of Direct3D 9 support?
2020-07-23 09:39:10 +02:00
Zae
0107550cf1 fix crlf for clipboard 2020-07-20 23:07:20 +08:00
Rémi Verschelde
c8523038cc
Merge pull request #40268 from DanielZTing/master
Fix cancel/OK button order on macOS
2020-07-15 09:21:04 +02:00
bruvzg
996910b627
Add error messages if Vulkan init failed, prevent Vulkan context freeing uninitialized device and instance. 2020-07-13 19:24:21 +03:00
Daniel Ting
9605fc54c7 Fix cancel/OK button order on macOS
The macOS platform convention regarding button order is cancel on left,
OK on right.
2020-07-10 15:10:11 -05:00
Rémi Verschelde
73fddc623b
Merge pull request #39888 from nekomatata/windows-create-window-error
Fix errors when creating windows on Windows
2020-07-04 01:41:43 +02:00
Juan Linietsky
b14be5f271 Fix fullscreen flag on Windows, closes #37588 2020-07-02 22:09:17 -03:00
Juan Linietsky
438c380458 Add a separate application focus/in notification out from Window focus notification. 2020-06-30 10:40:06 -03:00
PouleyKetchoupp
1043576ff3 Fix errors when creating windows on Windows
Detecting the case where WM_SIZE is received during the window creation.
There's no need to call window_resize on the Vulkan context.

Also creating a WindowData entry early enough to avoid storing a
separate WindowData wrongly associated to INVALID_WINDOW_ID.

Fixes #39199
2020-06-27 18:26:34 +02:00
Rémi Verschelde
d808697760
Merge pull request #39751 from bruvzg/mingw_build_fix
Fix MinGW build (use uninitialized `ofs` variable introduced in 39701).
2020-06-22 13:07:14 +02:00
bruvzg
439c97e0ff
Fix use uninitialized ofs variable introduced in 39701. 2020-06-22 13:13:22 +03:00
bruvzg
fc1d1c3557
[Windows] Prevent overwriting old cursor handle on multiple mouse_mode changes, ensure mouse_mode is set before cursor_set_shape is called to restore cursor. 2020-06-22 13:05:18 +03:00
Bastiaan Olij
aa01b327d6 Fix missing slider joystick handling on Windows 2020-06-20 19:03:15 +10:00
Rémi Verschelde
3e07080942
Merge pull request #39427 from hcmlax/shortcut_issue_39351
fixed issue where shortcut doesn't work if alt is pressed before shift
2020-06-19 23:47:49 +02:00
unknown
d191a8b9f8 adding check for syskeydown on control and alt 2020-06-18 14:36:22 -07:00
Rémi Verschelde
fa01e666d2
Merge pull request #39542 from Ev1lbl0w/feature/kill-pid
Allow Godot to kill its own PID
2020-06-16 20:49:00 +02:00
Rémi Verschelde
4b5b60de85
Merge pull request #39189 from touilleMan/issue-38925
Unify OS.get_system_time_* and OS.get_unix_time
2020-06-15 23:57:16 +02:00
bruvzg
92352b1c23
Add keyboard layout enumeration / set / get functions (macOS, Windows, Linux/X11), remove latin variant function. 2020-06-13 11:02:00 +03:00
Rémi Verschelde
c4dd866a15
Merge pull request #38958 from lawnjelly/time_overflow_4
Fix overflow condition with QueryPerformanceCounter
2020-06-11 09:38:44 +02:00
Rémi Verschelde
c47a6f6325
Merge pull request #39060 from madmiraal/fix-38869
Update Windows GUID to SDL uid conversion.
2020-06-04 11:40:57 +02:00
Emmanuel Leblond
c6de3872f9
Remove OS.get_system_time_secs/get_system_time_msecs and change OS.get_unix_time return type to double 2020-05-31 14:19:31 +02:00
Marcel Admiraal
bc49d34123 Add dinput nullptr checks. 2020-05-30 13:59:30 +01:00
Marcel Admiraal
97a529b1d8 Do not probe joypads if DirectInput cannot be initialized. 2020-05-29 12:07:07 +01:00
Hugo Locurcio
fe09b4d2b3 Tweak the DirectInput initialization failure message
This closes #36662.
2020-05-28 09:45:17 +02:00
bruvzg
ef1a305e50
Ignore invalid tablet driver name, when non are available. 2020-05-26 21:03:45 +03:00
Marcel Admiraal
a833db80d9 Update Windows GUID to SDL uid conversion. 2020-05-26 12:46:42 +01:00
Rémi Verschelde
3be9c74d8b
Merge pull request #38951 from bruvzg/win_ink_block_mm_4
Block WM_MOUSEMOVE during Windows Ink pen handling.
2020-05-22 14:34:20 +02:00
lawnjelly
db9fa88160 Fix overflow condition with QueryPerformanceCounter
The previous code for OS_Windows::get_ticks_usec() multiplied the tick count by 1000000 before dividing by ticks_per_second. The ticks is counted in a 64 bit integer and is susceptible to overflow when a machine has been running for a long period of time (days) with a high frequency timer.

This PR separates the overall calculation into one for seconds and one for the remainder, removing the possibility of overflow due to the multiplier.
2020-05-22 12:46:35 +01:00
bruvzg
b08b027a9a
Block WM_MOUSEMOVE during Windows Ink pen handling. 2020-05-22 10:44:47 +03:00
GuidoRevers
cf20c0343f Fix segmentation fault when using context_vulkan after memdelete context_vulkan 2020-05-21 20:38:58 +02:00
bruvzg
d0b5174b6a
[Windows] Add tablet driver selection. 2020-05-20 09:37:32 +03:00
bruvzg
cac399a829
[Windows] Add quotes only to the command line arguments with special characters. 2020-05-19 16:34:15 +03:00
Eric Rybicki
e460456e60
Fix certain characters being recognized as special keys in Windows when using the us international layout 2020-05-18 14:47:54 +02:00
HaSa1002
434bf0572c Fix input event being dispatched multiple times on Windows 2020-05-16 16:17:50 +02:00
Rémi Verschelde
07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde
0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde
1f6f364a56 Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.

Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
2020-05-14 10:01:56 +02:00
Ev1lbl0w
75ce45440a
Allow Godot to kill it's own PID 2020-05-13 16:48:14 +01:00
Marcel Admiraal
e7fee711b3 Update game controller enums. 2020-05-13 10:33:32 +01:00
Rémi Verschelde
69de7ce38c Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine
Part of #33027.
2020-05-10 13:13:54 +02:00
Rémi Verschelde
e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
Rémi Verschelde
44db69a7da
Merge pull request #38561 from bruvzg/wintab_extra_mm_events
WinTab: Make movement smoother and handle pressure/tilt changes when cursor is not moving.
2020-05-08 12:19:55 +02:00
bruvzg
78c80de738
WinTab: Adds extra "mouse move" events to make movement smoother and correctly handle pressure/tilt change when cursor is not moving. 2020-05-08 10:56:42 +03:00
Eric M
97e77bcd19 Added mapping for KEY_MENU to VK_APPS (0x5d) so context menu's triggered by the keyboard menu button work 2020-05-08 11:22:21 +10:00
bruvzg
ba85db5a79
Remove WinTab error message. 2020-05-07 15:51:19 +03:00
bruvzg
d978658f81
[Windows] Add support for the WinTab API for pen input. 2020-05-05 14:16:02 +03:00
bruvzg
0128947894
[Linux/Windows] Set pressure to 1.0f when primary button is pressed and device is not pressure sensitive. 2020-05-03 20:13:01 +03:00
Rémi Verschelde
7e1e0f496b
Merge pull request #37802 from ThakeeNathees/window-position-bug-osx-x11
display server window position bug fix
2020-04-29 09:04:53 +02:00
Rémi Verschelde
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