mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-03-31 01:05:29 +02:00
Added a new World class and made Viewport inherit from it.
This commit is contained in:
parent
b886d14cf5
commit
aba4e9db3c
@ -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 {
|
||||
|
12
scene/main/world.cpp
Normal file
12
scene/main/world.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include "world.h"
|
||||
|
||||
World::World() {
|
||||
}
|
||||
World::~World() {
|
||||
}
|
||||
|
||||
void World::_notification(int p_what) {
|
||||
}
|
||||
|
||||
void World::_bind_methods() {
|
||||
}
|
19
scene/main/world.h
Normal file
19
scene/main/world.h
Normal file
@ -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
|
@ -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<Node>();
|
||||
ClassDB::register_virtual_class<InstancePlaceholder>();
|
||||
|
||||
ClassDB::register_class<World>();
|
||||
ClassDB::register_class<Viewport>();
|
||||
ClassDB::register_class<ViewportTexture>();
|
||||
ClassDB::register_class<HTTPRequest>();
|
||||
|
@ -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
|
||||
|
@ -87,4 +87,4 @@ public:
|
||||
~World3D();
|
||||
};
|
||||
|
||||
#endif // WORLD_H
|
||||
#endif // WORLD_3D_H
|
||||
|
Loading…
Reference in New Issue
Block a user