summaryrefslogtreecommitdiffstats
path: root/core/os
Commit message (Collapse)AuthorAgeFilesLines
* Static analyzer fixes:bruvzg2020-12-092-6/+0
| | | | | | Removes unused code in OS. Fixes return types. Fixes few typos.
* [Complex Text Layouts] Implement TextServer interface. Implement Fallback ↵bruvzg2020-11-262-0/+2
| | | | TextServer.
* Initialize class/struct variables with default values in core/ and drivers/Rafał Mikrut2020-11-232-3/+2
|
* Remove empty lines around braces with the formatting scriptAaron Franke2020-11-166-8/+0
|
* Merge pull request #40748 from RandomShaper/improve_packed_fs_apiRémi Verschelde2020-11-101-3/+7
|\ | | | | Improve/fix packed data API
| * Improve/fix packed data APIPedro J. Estébanez2020-07-271-3/+7
| | | | | | | | | | | | | | - Enhance directory API - Fix `FileAccess::exists()` not checking for PackedData being disabled - Fix moving to the parent directory (`..`) - Allow absolute paths in existence checks
* | Reorganized core/ directory, it was too fatty alreadyreduz2020-11-0721-25/+822
| | | | | | | | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* | MainLoop: Remove deprecated methodsHaSa10022020-11-011-5/+0
| |
* | OS: Remove unused get_splash_tick_msecRémi Verschelde2020-09-242-6/+0
| | | | | | | | | | | | It was added in 3e20391bf607dc7c452b056854aed4a8c99ba0f6 but it doesn't seem particularly useful, and it was only implemented for the custom splash branch and not the default one, so it could return an uninitialized int.
* | [Complex Test Layouts] Change `String` to use UTF-32 encoding on all platforms.bruvzg2020-09-031-4/+4
| |
* | Register GDScript test tools as test commands to run via command-lineAndrii Doroshenko (Xrayez)2020-09-021-1/+3
|/
* Keep debug & verbose options after loading project from project managerPouleyKetchoupp2020-07-092-0/+6
|
* Move frame delaying functions from Main to OS.Fabio Alessandrelli2020-06-302-0/+39
| | | | | Will allow specific platforms to override it and avoid blocking on the main/GUI thread.
* Add a separate application focus/in notification out from Window focus ↵Juan Linietsky2020-06-302-4/+8
| | | | notification.
* Merge pull request #39189 from touilleMan/issue-38925Rémi Verschelde2020-06-152-12/+2
|\ | | | | Unify OS.get_system_time_* and OS.get_unix_time
| * Remove OS.get_system_time_secs/get_system_time_msecs and change ↵Emmanuel Leblond2020-05-312-12/+2
| | | | | | | | OS.get_unix_time return type to double
* | Print errors when calling MIDI input methods on unsupported platformsHugo Locurcio2020-05-311-1/+5
|/ | | | This partially addresses #32065.
* [Windows] Add tablet driver selection.bruvzg2020-05-201-2/+5
|
* Style: Remove unnecessary semicolons from `core`Rémi Verschelde2020-05-195-28/+29
| | | | | | | | | | Semicolons are not necessary after function definitions or control flow blocks, and having some code use them makes things inconsistent (and occasionally can mess up `clang-format`'s formatting). Removing them is tedious work though, I had to do this manually (regex + manual review) as I couldn't find a tool for that. All other code folders would need to get the same treatment.
* Style: Fix unnecessary semicolons that confused clang-formatRémi Verschelde2020-05-191-3/+2
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-1411-67/+124
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-144-0/+11
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-1420-229/+0
| | | | | | | | | | | | | | 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.
* Modernize remaining uses of 0/NULL instead of nullptr (C++11)Rémi Verschelde2020-05-141-2/+2
| | | | | Using clang-tidy's `modernize-use-nullptr`. https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-1416-117/+33
| | | | | | | | | | 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.
* Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde2020-05-102-8/+16
| | | | Part of #33027.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-104-9/+16
| | | | | | | 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.
* [Windows] Add support for the WinTab API for pen input.bruvzg2020-05-051-0/+2
|
* Rename InputFilter back to InputRémi Verschelde2020-04-282-3/+3
| | | | | | | | | | | | | | | | 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.
* Replace NULL with nullptrlupoDharkael2020-04-0211-41/+41
|
* SCons: Format buildsystem files with psf/blackRémi Verschelde2020-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | Configured for a max line length of 120 characters. psf/black is very opinionated and purposely doesn't leave much room for configuration. The output is mostly OK so that should be fine for us, but some things worth noting: - Manually wrapped strings will be reflowed, so by using a line length of 120 for the sake of preserving readability for our long command calls, it also means that some manually wrapped strings are back on the same line and should be manually merged again. - Code generators using string concatenation extensively look awful, since black puts each operand on a single line. We need to refactor these generators to use more pythonic string formatting, for which many options are available (`%`, `format` or f-strings). - CI checks and a pre-commit hook will be added to ensure that future buildsystem changes are well-formatted.
* Add macOS DisplayServer implementation.bruvzg2020-03-263-11/+3
| | | | Change global menu to use Callable, add support for check items and submenus.
* Separate DisplayServer from OS on WindowsJuan Linietsky2020-03-261-0/+1
|
* Working multiple window support, including editorJuan Linietsky2020-03-261-7/+7
|
* Refactored input, goes all via windows now.Juan Linietsky2020-03-264-44/+3
| | | | Also renamed Input to InputFilter because all it does is filter events.
* Effective DisplayServer separation, rename X11 -> LinuxBSDJuan Linietsky2020-03-262-466/+5
|
* Refactored Input, create DisplayServer and DisplayServerX11Juan Linietsky2020-03-267-2306/+4
|
* Style: Harmonize header guards to style guide [Core]Rémi Verschelde2020-03-2515-17/+17
|
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-173-5/+5
| | | | | | | | | | 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`.
* Fix mutex when building with no threads.Fabio Alessandrelli2020-03-082-9/+21
|
* Merge pull request #36752 from RandomShaper/rework_semaphoreRémi Verschelde2020-03-055-51/+16
|\ | | | | Drop old semaphore implementation
| * Drop old semaphore implementationPedro J. Estébanez2020-03-035-51/+16
| | | | | | | | | | | | | | | | | | | | | | | | - 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.
* | Improve UX of drive lettersPedro J. Estébanez2020-03-032-1/+7
|/ | | | | | | | | | Namely, move the drive dropdown to just the left of the path text box and don't include the former in the latter. This improves the UX on Windows. In the UNIX case, since its concept of drives is (ab)used to provide shortcuts to useful paths, its dropdown is kept at the original location.
* Merge pull request #18020 from bruvzg/input_fix_non_latin_and_add_hw_scancodesRémi Verschelde2020-03-014-23/+70
|\ | | | | Fix non-latin layout scancodes on Linux, adds access to physical scancodes.
| * Rename `scancode` to `keycode`.bruvzg2020-02-254-23/+70
| | | | | | | | | | Add `physical_keycode` (keyboard layout independent keycodes) to InputEventKey and InputMap. Fix non-latin keyboard layout keycodes on Linux/X11 (fallback to physical keycodes).
* | Fix InputEventKey::echo type from INT to BOOLYuri Roubinsky2020-03-011-1/+1
| |
* | Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-267-163/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main: - It's now implemented thanks to `<mutex>`. No more platform-specific implementations. - `BinaryMutex` (non-recursive) is added, as an alternative for special cases. - Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes. - Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts. - A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this. - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - Thread-safe utilities are therefore simpler now. Misc.: - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same. - Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock). - `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
* | Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-252-8/+8
|/ | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
* Added StringName as a variant type.Juan Linietsky2020-02-211-1/+1
| | | | Also changed all relevant properties defined manually to StringName.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-187-17/+12
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.