diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 84ad89918..7f264aad7 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -1,5 +1,6 @@ #ifndef VIEWPORT_H #define VIEWPORT_H + /*************************************************************************/ /* viewport.h */ /*************************************************************************/ @@ -30,6 +31,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ +#include "world.h" #include "core/math/transform_2d.h" #include "scene/main/node.h" #include "scene/resources/texture.h" @@ -87,8 +89,8 @@ public: ~ViewportTexture(); }; -class Viewport : public Node { - GDCLASS(Viewport, Node); +class Viewport : public World { + GDCLASS(Viewport, World); public: enum UpdateMode { diff --git a/scene/main/world.cpp b/scene/main/world.cpp new file mode 100644 index 000000000..a4c967dc2 --- /dev/null +++ b/scene/main/world.cpp @@ -0,0 +1,12 @@ +#include "world.h" + +World::World() { +} +World::~World() { +} + +void World::_notification(int p_what) { +} + +void World::_bind_methods() { +} \ No newline at end of file diff --git a/scene/main/world.h b/scene/main/world.h new file mode 100644 index 000000000..94258a2a8 --- /dev/null +++ b/scene/main/world.h @@ -0,0 +1,19 @@ +#ifndef WORLD_H +#define WORLD_H + +#include "node.h" + +class World : public Node { + GDCLASS(World, Node); + +public: + World(); + ~World(); + +protected: + void _notification(int p_what); + + static void _bind_methods(); +}; + +#endif diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 27bc2a655..64bda0872 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -133,6 +133,7 @@ #include "scene/main/resource_preloader.h" #include "scene/main/scene_tree.h" #include "scene/main/timer.h" +#include "scene/main/world.h" #include "scene/main/viewport.h" #include "scene/resources/audio_stream_sample.h" #include "scene/resources/bit_map.h" @@ -277,6 +278,7 @@ void register_scene_types() { ClassDB::register_class(); ClassDB::register_virtual_class(); + ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); ClassDB::register_class(); diff --git a/scene/resources/environment_3d.h b/scene/resources/environment_3d.h index 485cd5702..90da564fa 100644 --- a/scene/resources/environment_3d.h +++ b/scene/resources/environment_3d.h @@ -1,5 +1,6 @@ -#ifndef ENVIRONMENT_H -#define ENVIRONMENT_H +#ifndef ENVIRONMENT_3D_H +#define ENVIRONMENT_3D_H + /*************************************************************************/ /* environment.h */ /*************************************************************************/ @@ -418,4 +419,4 @@ VARIANT_ENUM_CAST(Environment3D::DOFBlurQuality) VARIANT_ENUM_CAST(Environment3D::SSAOQuality) VARIANT_ENUM_CAST(Environment3D::SSAOBlur) -#endif // ENVIRONMENT_H +#endif // ENVIRONMENT_3D_H diff --git a/scene/resources/world_3d.h b/scene/resources/world_3d.h index 716e42134..20956bc80 100644 --- a/scene/resources/world_3d.h +++ b/scene/resources/world_3d.h @@ -87,4 +87,4 @@ public: ~World3D(); }; -#endif // WORLD_H +#endif // WORLD_3D_H