summaryrefslogtreecommitdiffstats
path: root/drivers/windows
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Rename `String.is_abs_path()` to `String.is_absolute_path()`Hugo Locurcio2021-06-031-1/+1
| | | | | | | | | | | | This is more consistent with `NodePath.is_absolute()`.
* | | FileAccess: Don't err in `store_buffer` with buffer of size 0Rémi Verschelde2021-06-071-0/+1
|/ / | | | | | | | | | | | | | | | | | | | | The error check was added for `FileAccessUnix` but it's not an error when both `p_src` and `p_length` are zero. Added correct error checks to all implementations to prevent the actual erroneous case: `p_src` is nullptr but `p_length > 0` (risk of null pointer indexing). Fixes #33564.
* | Rename File::get_len() get_length()Marcel Admiraal2021-05-252-2/+2
| |
* | Add GDNative Framework loading and export support.bruvzg2021-05-241-1/+0
| |
* | Add symlink API to the DirAccess (on macOS and Linux).bruvzg2021-05-221-0/+5
| |
* | Change behavior of String.rightTomasz Chabora2021-05-201-1/+1
| |
* | Make all file access 64-bit (uint64_t)Pedro J. Estébanez2021-05-174-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the types of a big number of variables. General rules: - Using `uint64_t` in general. We also considered `int64_t` but eventually settled on keeping it unsigned, which is also closer to what one would expect with `size_t`/`off_t`. - We only keep `int64_t` for `seek_end` (takes a negative offset from the end) and for the `Variant` bindings, since `Variant::INT` is `int64_t`. This means we only need to guard against passing negative values in `core_bind.cpp`. - Using `uint32_t` integers for concepts not needing such a huge range, like pages, blocks, etc. In addition: - Improve usage of integer types in some related places; namely, `DirAccess`, core binds. Note: - On Windows, `_ftelli64` reports invalid values when using 32-bit MinGW with version < 8.0. This was an upstream bug fixed in 8.0. It breaks support for big files on 32-bit Windows builds made with that toolchain. We might add a workaround. Fixes #44363. Fixes godotengine/godot-proposals#400. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* | Allow nullptr with zero length in FileAccess get_bufferAlex Hirsch2021-03-161-1/+1
| | | | | | | | fix #47071
* | Add parameter checkes to FileAccess get_buffer functionsAlex Hirsch2021-03-091-0/+2
| | | | | | | | fix #46540
* | Modernize ThreadPedro J. Estébanez2021-01-292-155/+0
| | | | | | | | | | | | | | | | | | - Based on C++11's `thread` and `thread_local` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed (except for the few cases of non-portable functions) - Simpler for `NO_THREADS` - Thread ids are now the same across platforms (main is 1; others follow)
* | Modernize RWLockPedro J. Estébanez2021-01-192-150/+0
| | | | | | | | | | | | | | | | - Based on C++14's `shared_time_mutex` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed - Simpler for `NO_THREADS`
* | Update copyright statements to 2021Rémi Verschelde2021-01-018-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 🎆
* | Initialize class/struct variables with default values in core/ and drivers/Rafał Mikrut2020-11-232-7/+5
| |
* | Reorganized core/ directory, it was too fatty alreadyreduz2020-11-074-4/+4
|/ | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* [Complex Test Layouts] Change `String` to use UTF-32 encoding on all platforms.bruvzg2020-09-032-93/+96
|
* Fix Directory Open CheckNathan Franke2020-07-061-1/+5
|
* fix(Directory): remove erasing printNathan Franke2020-05-281-4/+0
| | | | Fixes #39106
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-143-0/+10
| | | | | | | | | | | | | | | | | | | | | | | 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-148-69/+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.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-144-25/+12
| | | | | | | | | | 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.
* Replace NULL with nullptrlupoDharkael2020-04-023-13/+13
|
* Fix res:// trimmed to s:// on WindowsPedro J. Estébanez2020-04-011-1/+7
|
* 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.
* Merge pull request #36752 from RandomShaper/rework_semaphoreRémi Verschelde2020-03-052-156/+0
|\ | | | | Drop old semaphore implementation
| * Drop old semaphore implementationPedro J. Estébanez2020-03-032-156/+0
| | | | | | | | | | | | | | | | | | | | | | | | - 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-3/+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.
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-262-164/+0
| | | | | | | | | | | | | | | | 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`.
* Added a spinlock template as well as a thread work pool class.Juan Linietsky2020-02-112-3/+3
| | | | Also, optimized shader compilation to happen on threads.
* Remove duplicate WARN_PRINT macro.Marcel Admiraal2020-02-051-1/+1
|
* Update copyright statements to 2020Rémi Verschelde2020-01-0112-24/+24
| | | | | | | | | | | 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.
* Handle missing file properly when checking for case mismatchPouleyKetchoupp2019-11-101-1/+1
| | | | This was causing false alarms to be randomly reported on Windows for files that didn't exist.
* FileAccessWindows: Add errno include for MinGWRémi Verschelde2019-08-211-0/+1
| | | | | | Apparently MSVC is happy with ENOENT without it, but MinGW seems to require it. Follow-up to #31499.
* Support for file not found in ConfigFile::Load and handle a few specific casesPouleyKetchoupp2019-08-211-3/+10
| | | | | | | EditorSettings::set_project_metadata: creates project_metadata.cfg if it doesn't exist EditorPlugin::get_config: removed (not used) Fixes #31444
* Replace last occurrences of 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG'Rémi Verschelde2019-08-171-2/+3
| | | | | | | | | | The last remaining ERR_EXPLAIN call is in FreeType code and makes sense as is (conditionally defines the error message). There are a few ERR_EXPLAINC calls for C-strings where String is not included which can stay as is to avoid adding additional _MSGC macros just for that. Part of #31244.
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-171-4/+1
| | | | | | | | | Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
* Remove redundant author doc commentsIAmActuallyCthulhu2019-08-124-16/+0
|
* Fix compilation warnings in JS and Windows buildsRémi Verschelde2019-06-151-2/+2
| | | | | | | | | | Warnings raised by Emscripten 1.38.0 and MinGW64 5.0.4 / GCC 8.3.0. JS can now build with `werror=yes warnings=extra`. MinGW64 still has a few warnings to resolve with `warnings=extra`, and only one with `warnings=all`. Part of #29033 and #29801.
* Fix errors when attempting to set UNIX permissions when unavailableHugo Locurcio2019-06-031-3/+1
| | | | | | This makes exporting from Windows to Linux work again. This closes #29416.
* Add FileAccess::set_unix_permissions for Unix platformsJuan Linietsky2019-04-072-0/+12
|
* Style: Apply new changes from clang-format 8.0Rémi Verschelde2019-04-091-1/+2
| | | | | | 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).
* Merge pull request #27589 from Chaosus/fix_fileRémi Verschelde2019-04-082-0/+34
|\ | | | | Fix File switching between reading and writing, opened with READ_WRITE on Windows
| * Fix File opened with READ_WRITE on WindowsChaosus2019-04-052-0/+34
| | | | | | To allows use read and write anytime and in any order
* | Capitalise drive lettersTwarit2019-03-101-1/+1
|/ | | | Matches how other application like to display the drive letters
* Fix style issues from recent commitsRémi Verschelde2019-03-031-1/+0
|
* Remove some windows printsJuan Linietsky2019-03-021-2/+2
|
* Core: Ensure classes match their header filenameRémi Verschelde2019-02-122-119/+0
| | | | | | | | | | | | | | | Also drop some unused files. Renamed: - `core/dvector.h` -> `pool_vector.h` - `core/io/resource_import.h` -> `resource_importer.h` - `core/sort.h` -> `sort_array.h` - `core/string_db.h` -> `string_name.h` Dropped: - `core/allocators.h` - `core/os/shell.h` - `core/variant_construct_string.cpp`
* Fix code style issuesRémi Verschelde2019-01-262-18/+17
|
* Fix compilation on UWPHein-Pieter van Braam2019-01-261-3/+3
| | | | | | It appears that MSVC and Mingw disagree about what conversions are legal here. We just use the 'wide' version of the call and use our native CharType instead of TCHAR.
* Add function to obtain filesystem type from DirAccess.Juan Linietsky2019-01-212-0/+32
| | | | Change EditorFileSystem to not use directory modification times on FAT32, fixes #20946
* Replace CreateThread with QueueUserWorkItemMarcin Zawiejski2019-01-191-7/+4
| | | Fixes #24869 stuttering on Windows by reusing long running threadpool threads instead of creating a new thread on each call to Thread::start.