Commit graph

310 commits

Author SHA1 Message Date
bruvzg 618eb27e8b Move alert function from DisplayServer to OS. 2021-07-22 21:50:35 +03:00
Hugo Locurcio 5ea1c75d63
Rename String.is_abs_path() to String.is_absolute_path()
This is more consistent with `NodePath.is_absolute()`.
2021-06-03 16:00:06 +02:00
Rémi Verschelde 0e1d45b210
OS: Remove code duplicate in XDG paths handling
Follow-up to #48542.
2021-05-21 12:49:09 +02:00
Hugo Locurcio 011a99316a
Only allow absolute paths in XDG environment variables
The XDG Base Directory specification does not allow using relative paths
(which broke things in Godot anyway). If a relative path is detected,
it should be ignored.
2021-05-20 18:37:28 +02:00
Rémi Verschelde 5b16020846
Replace remaining uses of NULL with nullptr
Follow-up to #38736 (these uses were likely added after this PR was merged).
2021-04-29 11:53:27 +02:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Rémi Verschelde e4c0572385
Merge pull request #44593 from madmiraal/rename-mainloop-methods
Rename MainLoop methods to match Node methods
2020-12-28 14:44:28 +01:00
Marcel Admiraal 5b937d493f Rename empty() to is_empty() 2020-12-28 10:39:56 +00:00
Marcel Admiraal d9e9eb8d04 Rename MainLoop methods to match Node methods 2020-12-22 12:34:57 +00:00
Rémi Verschelde 37d0d757d6
Merge pull request #40708 from bruvzg/improve_os_locale
Improve `OS::get_locale()` and documentation.
2020-12-10 11:49:00 +01:00
Andrii Doroshenko (Xrayez) 6f426c3360 Port ClassDB tests to use doctest
Extracted the most minimal core initialization functionality from
`setup()` and `setup2()` so that `ClassDB` could be tested properly
(input, audio, rendering, physics etc, are excluded).

Display and rendering servers/singletons are not initialized at all.

Due to the fact that most subsystems are disabled, fixed various crashes in the
process (in order):
- `AcceptDialog` OK/cancel swap behavior (used `DisplayServer` while
  `register_scene_types()`);
- `make_default_theme` which depends on `RenderingServer`;
- `XRServer` singleton access while calling `register_modules_types()`;
- hidden bug in a way joypads are cleaned up (MacOS and Linux only).

Removed manual `ClassDB` init/cleanup calls from `test_validate_testing.h`.

ClassDB tests:

Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
2020-08-16 16:41:02 +03:00
bruvzg f797e1c078
Improve OS::get_locale() on macOS and Windows, replace "-" with "_" and use system macros instead of bitwise AND. Add locale format info to the documentation. 2020-08-11 13:19:19 +03:00
Aaron Franke 9986439352
Commit other files changed by file_format.sh 2020-07-13 14:14:11 -04:00
Daniel Ting b8e6ff9a7f Fix opening URLS with special characters in macOS
The Online Tutorials section of InputMap in the editor's built-in
documentation viewer contains this link:

docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#inputmap

The macOS implementation for opening a link percent-encodes it before
sending it to the browser, resulting in a 404. This is to fix #13422
where filenames with special characters could not be opened in Finder.
However, this breaks URLS so I added a check to see if the resource
scheme is file:// and if so, only then is it escaped. This allows other
schemes like `http`, `ftp`, and `mailto` to be used.
2020-07-03 23:00:48 -05: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 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
bruvzg 0c4c530514
[macOS] Re-add define for build with 10.14 SDK, remove unsupported 10.12 checks. 2020-04-26 21:17:10 +03:00
bruvzg 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
Rémi Verschelde cb282c6ef0 Style: Set clang-format Standard to Cpp11
For us, it practically only changes the fact that `A<A<int>>` is now
used instead of the C++03 compatible `A<A<int> >`.

Note: clang-format 10+ changed the `Standard` arguments to fully
specified `c++11`, `c++14`, etc. versions, but we can't use `c++17`
now if we want to preserve compatibility with clang-format 8 and 9.
`Cpp11` is still supported as deprecated alias for `Latest`.
2020-03-17 07:36:24 +01:00
Pedro J. Estébanez 9a3a2b03b8 Drop old semaphore implementation
- Removed platform-specific implementations.
- Now all semaphores are in-object, unless they need to be conditionally created.
- Similarly to `Mutex`, provided a dummy implementation for when `NO_THREADS` is defined.
- Similarly to `Mutex`, methods are made `const` for easy use in such contexts.
- Language bindings updated: `wait()` and `post()` are now `void`.
- Language bindings updated: `try_wait()` added.

Bonus:
- Rewritten the `#ifdef` in `mutex.h` to meet the code style.
2020-03-03 13:20:42 +01:00
bruvzg 1af06d3d46
Rename scancode to keycode.
Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap.
Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
2020-02-25 12:30:33 +02:00
Rémi Verschelde 6bb075a53f Travis: Use Ubuntu 18.04 (bionic) as base image
It's now available and allows us to have a better default environment,
with GCC 7.4.0 and Clang 7.

We now need GCC 7+ for C++17 support so it's more efficient to upgrade
the image than to install it on Ubuntu 16.04 (xenial).

Also fixes a couple -Wdeprecated-declarations warnings on macOS now
that we build against macOS 10.12.
2020-02-22 20:00:28 +01:00
Juan Linietsky 3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Rémi Verschelde 3dea5fd631 Remove incomplete battery status/power API
It was initially implemented in #5871 for Godot 3.0, but never really
completed or thoroughly tested for most platforms. It then stayed in
limbo and nobody seems really keen to finish it, so it's better to
remove it in 4.0, and re-add eventually (possibly with a different API)
if there's demand and an implementation confirmed working on all
platforms.

Closes #8770.
2020-02-14 13:43:32 +01:00
bruvzg 0ce4433686 Restore parts of #33783 and #32809 missing after rebase. 2020-02-11 12:06:30 +01:00
Rémi Verschelde fff4240bb4 Fix code formatting issues and VS compilation
Also temporarily disable multicheck build so that we get a full build
even when there are style issues on Vulkan.

Fixes #33356.
2020-02-11 12:05:19 +01:00
Rémi Verschelde a8e14bee58 Merge pull request #32821 from bruvzg/vlk_fix_macos_exit
[Vulkan, macOS] Fix RID leaks and crashes on exit.
2020-02-11 12:04:20 +01:00
bruvzg a85923b972 Move Vulkan context/rendering_device destruction to windowWillClose notification. 2020-02-11 12:04:16 +01:00
bruvzg d5df1b651c Improve HiDPI handling, fix incorrect window viewport clipping. 2020-02-11 12:04:04 +01:00
bruvzg b456bfad5c Add runtime GLES2 / Vulkan context selection. 2020-02-11 11:57:34 +01:00
bruvzg eb48be51db Add static Vulkan loader.
Initial Vulkan support for Windows.
Initial Vulkan support for macOS.
2020-02-11 11:57:11 +01:00
Juan Linietsky 3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
Rémi Verschelde 0ead0eeabb Merge pull request #35301 from Calinou/improve-console-error-logging
Improve the console error logging appearance
2020-02-10 11:16:01 +01:00
Marcel Admiraal 5af3b4ca27 Remove duplicate ERR_PRINT macro. 2020-02-05 11:13:24 +01:00
Haoyu Qiu 8f881847c0 Adds extra cursors for macOS
Before, plain arrow cursor or unsuitable ones were used.
2020-01-31 14:16:06 +08:00
Hugo Locurcio 580b8cc012
Improve the console error logging appearance
This makes secondary information less visually prominent
to improve overall readability.

Various loggers were also tweaked for consistency.
2020-01-19 00:24:17 +01:00
Haoyu Qiu bda9145aae Fixes IME input backspace on macOS 2020-01-14 19:41:42 +08:00
bruvzg d07cdc594f
[macOS] Load PCK from the .app bundle resources, instead of changing working directory. 2020-01-10 18:02:29 +02:00
Rémi Verschelde 8454804972
Merge pull request #33967 from Calinou/add-os-is-window-focused
Add an `OS.is_window_focused()` getter
2020-01-06 11:39:18 +01:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
bruvzg 29ba673fca
[macOS] Send resize event without actually resizing window on backing change.
Co-authored-by: Haoyu Qiu <timothyqiu32@gmail.com>
2019-12-08 18:29:31 +02:00
bruvzg 2ef8c5fac5
iOS modular build and export implementation. 2019-12-01 21:57:18 +02:00
Hugo Locurcio 21a3923410
Add an OS.is_window_focused() getter
This makes it possible to know whether the window is focused
at a given time, without having to track the focus state manually
using `NOTIFICATION_WM_FOCUS_IN` and `NOTIFICATION_WM_FOCUS_OUT`.

This partially addresses #33928.
2019-11-28 16:42:51 +01:00
bruvzg c8bf0ee062
[macOS] Fix locale detection. 2019-11-25 15:55:17 +02:00
bruvzg e423e1c663
[macOS] Remove CVDisplayLink v-sync hack. 2019-11-21 11:01:47 +02:00
bruvzg f675621725
[macOS, Windows, X11] Add graphic tablet pen pressure and tilt support to InputEventMouseMotion event. 2019-10-30 14:42:21 +02:00
bruvzg 7b64340eb0
Fix compilation warnings in macOS build, enable warnings=extra werror=yes for macOS CI. 2019-10-24 20:37:56 +03:00
bruvzg 509afcea92
Fix non-HiDPI mode on HiDPI displays on macOS Catalina. 2019-10-13 23:15:20 +03:00
PouleyKetchoupp 5bfe32eaa4 Properly revert cursor when using set_custom_mouse_cursor with null
Fixes #32486
2019-10-03 13:02:11 +02:00
bruvzg db6d4352ea
[macOS] Add methods to modify global and dock menus. Add ability to open multiple editor/project manager instances, recent/favourite project list to project manager dock menu and opened scene list to editor dock menu. 2019-08-26 16:45:49 +03:00