Only allow valid types in Decal, Light3D projector, PointLight2D texture and CSGMesh3D mesh

If an invalid type is supplied (which can still be done from a script),
a warning is printed (along with a workaround for ViewportTexture).

This also adds support for "negative" resource hints such as
"Texture2D,-ViewportTexture" to exclude one or more subclasses
from a class hint.

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
This commit is contained in:
Hugo Locurcio
2024-02-15 00:26:37 +01:00
committed by Rémi Verschelde
parent 2b7ea6223b
commit 7a04d85ec3
10 changed files with 97 additions and 21 deletions

View File

@@ -124,7 +124,7 @@
<description>
Returns an [Image] that is a copy of data from this [Texture2D] (a new [Image] is created each time). [Image]s can be accessed and manipulated directly.
[b]Note:[/b] This will return [code]null[/code] if this [Texture2D] is invalid.
[b]Note:[/b] This will fetch the texture data from the GPU, which might cause performance problems when overused.
[b]Note:[/b] This will fetch the texture data from the GPU, which might cause performance problems when overused. Avoid calling [method get_image] every frame, especially on large textures.
</description>
</method>
<method name="get_size" qualifiers="const">