summaryrefslogtreecommitdiffstats
path: root/core/io/resource_loader.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | 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 🎆
* fix custom loader/saver brokenZae2020-11-151-1/+1
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-4/+4
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Merge pull request #41460 from Calinou/improve-resource-load-fail-messageRémi Verschelde2020-09-031-1/+2
|\ | | | | Improve the resource loading error message to mention the need to import
| * Improve the resource loading error message to mention the need to importHugo Locurcio2020-08-221-1/+2
| | | | | | | | | | This is a common pitfall when setting up projects in a headless environment.
* | [funexpected] clear missed remaps on deinitialization, fixes ↵Yakov Borevich2020-08-311-0/+3
|/ | | | godotengine/godot#34221
* Remove String::find_last (same as rfind)Stijn Hinlopen2020-07-031-1/+1
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-43/+74
| | | | | 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-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | 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-141-59/+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-141-1/+0
| | | | | | | | | | 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.
* Exposed RenderingDevice to script APIJuan Linietsky2020-04-201-2/+2
| | | | | | | | | | | | | Also added an easier way to load native GLSL shaders. Extras: Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload. Note: The precommit hooks are broken because they don't seem to support enums from one class being used in another. Feel free to fix this after merging this PR.
* Replace NULL with nullptrlupoDharkael2020-04-021-8/+8
|
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-2/+2
| | | | | | | | | | 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`.
* Fixes bugs found by Sonarcloud and Coverityqarmin2020-03-021-0/+1
|
* Removed interactive loader, added proper thread loading.Juan Linietsky2020-02-281-224/+372
|
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-261-27/+4
| | | | | | | | | | | | | | | | 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 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-181-8/+8
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr.Juan Linietsky2020-02-151-1/+1
|
* GIProbes working.Juan Linietsky2020-02-111-1/+2
|
* Several fixes to 3D rendering, and multimesh implementation.Juan Linietsky2020-02-111-0/+1
|
* Remove duplicate ERR_PRINT macro.Marcel Admiraal2020-02-051-2/+2
|
* Check if resource exists before loadingTomasz Chabora2020-01-081-0/+5
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | 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.
* ResourceLoader: Add language code matching for localized resourcesRémi Verschelde2019-12-041-15/+38
| | | | | | | | Near matching was not implemented like in TranslationServer, so a resource remapped for 'ru' (but not 'ru_RU') would not be used as fallback if the system locale was 'ru_RU'. Fixes #34058.
* Added some obvious errors explanationsqarmin2019-09-251-1/+1
|
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-171-29/+13
| | | | | | | | | 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?)
* Add some code changes/fixes proposed by Coverity and Clang Tidyqarmin2019-08-071-2/+1
|
* Remove unnecessary code and add some error explanationsqarmin2019-07-011-4/+0
|
* Added ability for multiple images to be imported as an atlasJuan Linietsky2019-04-191-0/+24
| | | | | This adds support for groups in the import system, which point to a single file. Add property hint for saving files in file field
* Allow class_name scripts to have nested inheritanceGeorge Marques2019-03-091-1/+1
|
* Better warnings when resources can't be saved. Fixes #26531Juan Linietsky2019-03-041-0/+25
|
* Add -Wshadow=local to warnings and fix reported issues.marxin2019-02-201-3/+3
| | | | Fixes #25316.
* Make resource loader cycle checker work on a per-thread basis.Juan Linietsky2019-02-161-7/+33
| | | | This removes editor errors saying cycles existed when the thumbnailer was running.
* Core: Ensure classes match their header filenameRémi Verschelde2019-02-121-1/+1
| | | | | | | | | | | | | | | 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`
* Avoid cyclic resource loading of any type, fixes #22673Juan Linietsky2019-01-271-10/+116
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Added basic support for custom resource savers and loadersMarc Gilleron2018-12-151-4/+192
|
* Moved folding outside the resource files, now saved outside the project.Juan Linietsky2018-10-291-0/+10
|
* Fixes to baker, restored xatlas and fixed bake options.Juan Linietsky2018-10-051-0/+2
|
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-8/+10
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Change ResourceLoader::load to make it more thread safe.Juan Linietsky2018-09-021-5/+25
|
* Add print_verbose to print to stdout only in verbose modeRémi Verschelde2018-08-241-13/+4
| | | | | | Equivalent of the cumbersome: if (OS::get_singleton()->is_stdout_verbose()) print_line(msg);
* Fix ResourceLoader::exists() false negative and readd deprecated has()Rémi Verschelde2018-08-121-1/+2
|
* Added function ResourceLoader.exists(), to check if a resource exists. ↵Juan Linietsky2018-08-101-0/+33
| | | | Closes #19140
* Revert "added get_creation_time function for gdscript"Juan Linietsky2018-08-101-1/+0
|
* Merge pull request #18914 from notwarp/masterJuan Linietsky2018-08-101-0/+1
|\ | | | | added get_creation_time function for gdscript
| * added get_creation_time function for gdscriptDaniele Giuliani2018-05-161-0/+1
| |
* | Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.