Commit Graph

1274 Commits

Author SHA1 Message Date
Rémi Verschelde 0fa767beff
Merge pull request #84508 from jsjtxietian/clean-copy
Clean unnecessary copy detected by clang-tidy
2024-01-04 14:25:58 +01:00
Rémi Verschelde 6c390b620d
Merge pull request #84445 from Rubonnek/add-const-references-clang-tidy
Add const references detected by clang-tidy
2024-01-04 14:25:33 +01:00
Yuri Sizov 6fc92e1d05 Merge pull request #84611 from AThousandShips/encode_invalid
Prevent encoding/decoding objects that cannot be instantiated
2023-12-19 20:32:42 +01:00
Yuri Sizov d8a65b3f46 Merge pull request #85464 from KoBeWi/only_say_verbose_when_not_verbose
Improve message about resources in use at exit
2023-12-19 13:01:59 +01:00
A Thousand Ships c1b8b87736 Prevent encoding/decoding objects that cannot be instantiated 2023-12-18 22:06:08 +01:00
Yuri Sizov a9a50938c0 Merge pull request #85991 from jsjtxietian/fix-bad-pos-state
Fix `FileAccessPack::get_buffer` updating position past the length of file
2023-12-18 18:18:01 +01:00
Wilson E. Alvarez a3cb1b096f
Add const references detected by clang-tidy 2023-12-16 13:36:44 -05:00
kobewi 397f0b31e4 Fix file disappearing when renaming dependencies 2023-12-14 22:28:48 +01:00
Rémi Verschelde b952b007b1
Merge pull request #84782 from rsburke4/image-fix
Prevent crash on conversion of invalid data in `Image`
2023-12-12 00:17:42 +01:00
rsburke4 dec2269bca Added error to catch conversion on invalid image 2023-12-10 15:06:22 -05:00
jsjtxietian 68a6fe81ab Fix FileAccessPack::get_buffer will update pos past the length of file 2023-12-10 16:21:16 +08:00
Yuri Sizov 2e94be2ea4 Merge pull request #84167 from SaracenOne/cache_mode_replace_fixes
Fix behavior of ResourceFormatLoader `CACHE_MODE_REPLACE`
2023-12-08 15:23:13 +01:00
kobewi f8f8fe0615 Improve message about resources in use at exit 2023-11-28 14:01:08 +01:00
Yuri Sizov bc1949d797 Correctly check scripts that must inherit `EditorPlugin`
Also updates some error messages related to this kind of check
across the codebase.
2023-11-23 16:24:43 +01:00
Saracen f392a9c4f8 Fix CACHE_MODE_REPLACE 2023-11-15 18:55:20 +00:00
Rémi Verschelde 2bcc2a3cd0
Merge pull request #84791 from akien-mga/fix-translation-remapping-check
Fix translation remapping check for imported resources
2023-11-12 23:00:08 +01:00
Rémi Verschelde 2729a78fd7
Fix translation remapping check for imported resources
Fixes #81660.
2023-11-12 13:17:12 +01:00
kobewi a3627b6e37 Assign temporary path to preloaded resources 2023-11-10 00:43:30 +01:00
jsjtxietian 8f6e8ef0d7 clean unnecessay copy detected by clang-tidy 2023-11-06 16:22:32 +08:00
Aaron Franke 58076b9ccb
Implement glTF compat version system for files from older Godot versions 2023-11-03 12:07:25 -05:00
Thomas ten Cate 2263d94cc3 Add comment why off-by-one error is hard to fix
See #83843

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2023-11-01 11:14:13 +01:00
Rémi Verschelde a3e4c4f41c
Merge pull request #84155 from AThousandShips/encode_fix
Prevent `encode_variant` doing `memcpy` from `nullptr`
2023-10-30 23:19:22 +01:00
K. S. Ernest (iFire) Lee 9877fa5058 Fix uninitialized variable in Image::fix_alpha_edges()
`core\io\image.cpp:3776:33: error: 'closest_color[0]' may be used uninitialized [-Werror=maybe-uninitialized]`
2023-10-29 22:59:03 -07:00
A Thousand Ships 210461f2ed Prevent `encode_variant` doing `memcpy` from `nullptr` 2023-10-29 18:06:21 +01:00
Haoyu Qiu dc7e309f48 Fix heap-use-after-free when resource loaded with load_threaded_request is never fetched
Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
2023-10-23 16:21:17 +08:00
Rémi Verschelde 51f81e1c88
Merge pull request #82957 from bruvzg/fs_case_check
Add method to check if filesystem is case sensitive.
2023-10-13 12:55:35 +02:00
Thaddeus Crews d8fdd419fa
Apply missing flag to vector4/projection 2023-10-12 11:18:45 -05:00
Paul Joannon bf3f6e3b55
Error handling for `FileAccess.get_file_as_*`
- Assign last error in said `FileAccess.get_file_as_bytes` and `FileAccess.get_file_as_string`
- Document error handling for said methods
2023-10-11 18:52:16 +02:00
bruvzg 97bcd8a631 Add method to check if filesystem is case sensitive. 2023-10-09 11:00:15 +03:00
A Thousand Ships f18aa00e85 Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable 2023-10-08 17:23:33 +02:00
Rémi Verschelde d616c3ecd0
Merge pull request #82408 from hpvb/fix-import-crash
Fix Image import crash
2023-09-27 14:03:47 +02:00
Rémi Verschelde 19057c07bc
Merge pull request #67080 from Mickeon/resource-virtual-local-to-scene-setup
Reimplement Resource.`_setup_local_to_scene` & deprecate signal
2023-09-27 14:03:28 +02:00
Hein-Pieter van Braam b5705958e6 Fix import crash
I was trying to import a solid colored metal/roughness texture that
worked in Godot 4.1.1 but failed to load on master. I eventually tracked
it down to this: to_x and to_y can be 0, which then leads them to be -1
later, which then causes ofs to overflow.

Some of these cases were hidden because of the use of Vector so we were
just happily scribbling in ram elsewhere.

Switched to LocalVector as it made debugging a bit easier.
2023-09-26 23:50:50 +02:00
Saracen 0b0a6109b6 Make notify_dependency_error only defer calls if called from secondary threads. 2023-09-26 03:36:11 +01:00
bitsawer 16c3a19d91 Expose and document Image.get_mipmap_count() 2023-09-19 14:34:59 +03:00
A Thousand Ships 893f889d74 [Core] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable 2023-09-11 19:45:49 +02:00
Micky 79ce0c6e80 Reimplement Resource.`_local_to_scene_setup` & remove workaround
Reimplements the virtual method _setup_local_to_scene, lost in #51970

Also deprecates the redundant `setup_local_to_scene_requested` signal.
2023-09-09 13:51:12 +02:00
Yuri Sizov d8ff69d53c Extract ScriptInstance to simplify includes
This allows to include script_instance.h directly in the
generated gdvirtual.gen.inc, and remove excessive includes
from the codebase.

This should also allow Resource to use GDVIRTUAL macros,
which wasn't possible previously due to a circular dependency.
2023-09-06 22:54:38 +02:00
David Nikdel 067807c1cb Remove nondeterminism in pck_packer
PCK files (like other build products) should be deterministic based on their inputs. Removed calls to Math::rand() that are being used to generate padding.

Looks like these were introduced as part of adding encryption support, but the padding being random does not have any cryptographic significance. This can be trivially inferred since file blocks that happen to be aligned don't get padding anyway.

If there's a desire to indroduce something that functions as a nonce it should probably be added explicitly and only if encryption is enabled.
remove Math::rand() calls in editor_export_platform.cpp

follow up to make consistent with pck_packer
2023-09-03 18:14:30 -04:00
clayjohn 0045dc204c Revert "Implement loading DDS textures at run-time"
This reverts commit 34ab1c8a36.
2023-08-29 14:25:16 +02:00
acazuc a00cf02241 Add support for KTX & KTX2 image format
Add support glTF KHR_texture_basisu extension
2023-08-19 10:27:29 +02:00
Rémi Verschelde e73a4a382e
Merge pull request #79201 from Rindbee/fix-setup-state-not-cleared
Clear the previously set state when configuring for a new scene root node
2023-08-17 15:43:38 +02:00
Rémi Verschelde efdff9cbc2
Fix GCC -Wmaybe-uninitialized warnings 2023-08-14 14:35:35 +02:00
bruvzg 8aa6f29b56
[FileAccess] Add methods to get/set "hidden" and "read-only" attributes on macOS/BSD and Windows. 2023-08-08 21:51:32 +03:00
Rindbee 4795c3cdfa Clear the previously set state when configuring for a new scene root node
Saving a subscene causes the main scene to be re-instantiated. And the resource
instance in the main scene will be reused when the main scene is re-instantiated.
So for resources with `resource_local_to_scene` enabled, resetting state may be
necessary (at least for `ViewportTexture`).
2023-08-08 23:49:53 +08:00
Rémi Verschelde faaf27f284
Fix various typos with codespell
Also includes typo fixes from #79993, #80068, #80276, and #80303.

Co-authored-by: betalars <contact@betalars.de>
Co-authored-by: spaceyjase <429978+spaceyjase@users.noreply.github.com>
Co-authored-by: Swarkin <102416174+Swarkin@users.noreply.github.com>
Co-authored-by: Raul Santos <raulsntos@gmail.com>
2023-08-07 13:09:47 +02:00
Marcin Nowak 34ab1c8a36 Implement loading DDS textures at run-time 2023-07-31 21:31:26 +02:00
Yuri Sizov 0be587521e Merge pull request #79737 from Calinou/resourceloader-load-error-clarify-expected-type
Mention expected resource type in ResourceLoader load error
2023-07-31 21:01:28 +02:00
Ithamar R. Adema f37c2b5be2 Fix ImageTextureLayered serialisation issues. 2023-07-23 13:54:04 +02:00
Hugo Locurcio 5bf64255b0
Mention expected resource type in ResourceLoader load error
This helps troubleshoot issues due to incorrect import types.
2023-07-21 04:45:34 +02:00