diff options
Diffstat (limited to 'scene/main/scene_tree.h')
-rw-r--r-- | scene/main/scene_tree.h | 60 |
1 files changed, 14 insertions, 46 deletions
diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index 2f805d074f..319b5a7e74 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -36,12 +36,14 @@ #include "core/os/thread_safe.h" #include "core/self_list.h" #include "scene/resources/mesh.h" -#include "scene/resources/world.h" #include "scene/resources/world_2d.h" +#include "scene/resources/world_3d.h" + +#undef Window class PackedScene; class Node; -class Viewport; +class Window; class Material; class Mesh; class SceneDebugger; @@ -76,22 +78,6 @@ class SceneTree : public MainLoop { public: typedef void (*IdleCallback)(); - enum StretchMode { - - STRETCH_MODE_DISABLED, - STRETCH_MODE_2D, - STRETCH_MODE_VIEWPORT, - }; - - enum StretchAspect { - - STRETCH_ASPECT_IGNORE, - STRETCH_ASPECT_KEEP, - STRETCH_ASPECT_KEEP_WIDTH, - STRETCH_ASPECT_KEEP_HEIGHT, - STRETCH_ASPECT_EXPAND, - }; - private: struct Group { @@ -101,7 +87,7 @@ private: Group() { changed = false; }; }; - Viewport *root; + Window *root; uint64_t tree_version; float physics_process_time; @@ -119,15 +105,12 @@ private: Map<StringName, Group> group_map; bool _quit; bool initialized; - bool input_handled; - Size2 last_screen_size; StringName tree_changed_name; StringName node_added_name; StringName node_removed_name; StringName node_renamed_name; - bool use_font_oversampling; int64_t current_frame; int64_t current_event; int node_count; @@ -147,14 +130,6 @@ private: int call_lock; Set<Node *> call_skip; //skip erased nodes - StretchMode stretch_mode; - StretchAspect stretch_aspect; - Size2i stretch_min; - real_t stretch_shrink; - - void _update_font_oversampling(float p_ratio); - void _update_root_rect(); - List<ObjectID> delete_queue; Map<UGCall, Vector<Variant>> unique_group_calls; @@ -208,14 +183,13 @@ private: void make_group_changed(const StringName &p_group); void _notify_group_pause(const StringName &p_group, int p_notification); - void _call_input_pause(const StringName &p_group, const StringName &p_method, const Ref<InputEvent> &p_input); Variant _call_group_flags(const Variant **p_args, int p_argcount, Callable::CallError &r_error); Variant _call_group(const Variant **p_args, int p_argcount, Callable::CallError &r_error); void _flush_delete_queue(); //optimization friend class CanvasItem; - friend class Spatial; + friend class Node3D; friend class Viewport; SelfList<Node>::List xform_change_list; @@ -232,6 +206,13 @@ private: static int idle_callback_count; void _call_idle_callbacks(); + void _main_window_focus_in(); + void _main_window_close(); + void _main_window_go_back(); + + //used by viewport + void _call_input_pause(const StringName &p_group, const StringName &p_method, const Ref<InputEvent> &p_input, Viewport *p_viewport); + protected: void _notification(int p_notification); static void _bind_methods(); @@ -249,7 +230,7 @@ public: GROUP_CALL_MULTILEVEL = 8, }; - _FORCE_INLINE_ Viewport *get_root() const { return root; } + _FORCE_INLINE_ Window *get_root() const { return root; } void call_group_flags(uint32_t p_call_flags, const StringName &p_group, const StringName &p_function, VARIANT_ARG_LIST); void notify_group_flags(uint32_t p_call_flags, const StringName &p_group, int p_notification); @@ -261,8 +242,6 @@ public: void flush_transform_notifications(); - virtual void input_text(const String &p_text); - virtual void input_event(const Ref<InputEvent> &p_event); virtual void init(); virtual bool iteration(float p_time); @@ -275,8 +254,6 @@ public: void quit(int p_exit_code = -1); - void set_input_as_handled(); - bool is_input_handled(); _FORCE_INLINE_ float get_physics_process_time() const { return physics_process_time; } _FORCE_INLINE_ float get_idle_process_time() const { return idle_process_time; } @@ -335,11 +312,6 @@ public: void get_nodes_in_group(const StringName &p_group, List<Node *> *p_list); bool has_group(const StringName &p_identifier) const; - void set_screen_stretch(StretchMode p_mode, StretchAspect p_aspect, const Size2 &p_minsize, real_t p_shrink = 1); - - void set_use_font_oversampling(bool p_oversampling); - bool is_using_font_oversampling() const; - //void change_scene(const String& p_path); //Node *get_loaded_scene(); @@ -359,8 +331,6 @@ public: static SceneTree *get_singleton() { return singleton; } - void drop_files(const Vector<String> &p_files, int p_from_screen = 0); - void global_menu_action(const Variant &p_id, const Variant &p_meta); void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const; //network API @@ -388,8 +358,6 @@ public: ~SceneTree(); }; -VARIANT_ENUM_CAST(SceneTree::StretchMode); -VARIANT_ENUM_CAST(SceneTree::StretchAspect); VARIANT_ENUM_CAST(SceneTree::GroupCallFlags); #endif |