summaryrefslogtreecommitdiffstats
path: root/scene/register_scene_types.cpp
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2020-11-03 16:51:53 -0300
committerreduz <reduzio@gmail.com>2020-11-04 10:03:01 -0300
commitf123981a96c8ab7d7cb3e77ecbcf0048cb3b79e6 (patch)
tree9759e240a4043c1e5878a0a431ab6ae366792340 /scene/register_scene_types.cpp
parent3ec10bb07cb4a1ce1170c1d189475c8147576b7e (diff)
downloadredot-engine-f123981a96c8ab7d7cb3e77ecbcf0048cb3b79e6.tar.gz
Implement DirectionalLight2D
Also separated Light2D in PointLight2D and DirectionalLight2D. Used PointLight2D because its more of a point, and it does not work the same as OmniLight (as shape depends on texture). Added a few utility methods to Rect2D I needed.
Diffstat (limited to 'scene/register_scene_types.cpp')
-rw-r--r--scene/register_scene_types.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index f1dcc8e8a5..9d224dc744 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -628,7 +628,9 @@ void register_scene_types() {
ClassDB::register_class<Polygon2D>();
ClassDB::register_class<Skeleton2D>();
ClassDB::register_class<Bone2D>();
- ClassDB::register_class<Light2D>();
+ ClassDB::register_virtual_class<Light2D>();
+ ClassDB::register_class<PointLight2D>();
+ ClassDB::register_class<DirectionalLight2D>();
ClassDB::register_class<LightOccluder2D>();
ClassDB::register_class<OccluderPolygon2D>();
ClassDB::register_class<YSort>();
@@ -917,6 +919,7 @@ void register_scene_types() {
ClassDB::add_compatibility_class("VisualShaderNodeScalarUniform", "VisualShaderNodeFloatUniform");
ClassDB::add_compatibility_class("World", "World3D");
ClassDB::add_compatibility_class("StreamTexture", "StreamTexture2D");
+ ClassDB::add_compatibility_class("Light2D", "PointLight2D");
#endif