summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2019-06-19 17:03:19 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-11 11:53:27 +0100
commit42b44f43ee52eb664d3610d0fdae0eff14c00f0a (patch)
tree3125054b1d86f9eb1b10dd760b12010c3d6a1e89 /scene
parent9b0dd4f571ff431e23b9097e7f29746f4157be12 (diff)
Basic 2D engine is more or less working, needs more work for editor to be usable.
Diffstat (limited to 'scene')
-rw-r--r--scene/register_scene_types.cpp1
-rw-r--r--scene/resources/texture.h12
2 files changed, 11 insertions, 2 deletions
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index 3fd900c324..e0ac7c9e0c 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -649,6 +649,7 @@ void register_scene_types() {
ClassDB::register_class<World>();
ClassDB::register_class<Environment>();
ClassDB::register_class<World2D>();
+ ClassDB::register_virtual_class<Texture>();
ClassDB::register_virtual_class<Texture2D>();
ClassDB::register_virtual_class<Sky>();
ClassDB::register_class<PanoramaSky>();
diff --git a/scene/resources/texture.h b/scene/resources/texture.h
index 5620ff25a9..b255a3ebb2 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -42,7 +42,15 @@
#include "servers/camera_server.h"
#include "servers/visual_server.h"
-class Texture2D : public Resource {
+class Texture : public Resource {
+ GDCLASS(Texture, Resource);
+
+public:
+ Texture() {}
+};
+
+class Texture2D : public Texture {
+
GDCLASS(Texture2D, Resource);
OBJ_SAVE_TYPE(Texture2D); // Saves derived classes with common type so they can be interchanged.
@@ -332,7 +340,7 @@ public:
LargeTexture();
};
-class TextureLayered : public Resource {
+class TextureLayered : public Texture {
GDCLASS(TextureLayered, Resource);