Skip to content

Commit

Permalink
Merge pull request #84109 from clayjohn/disable-disable_2d
Browse files Browse the repository at this point in the history
Revert "Add a Disable 2D property to Viewport"
  • Loading branch information
akien-mga committed Oct 28, 2023
2 parents fd49c42 + f672198 commit e2645d8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
5 changes: 1 addition & 4 deletions doc/classes/Viewport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -258,11 +258,8 @@
<member name="debug_draw" type="int" setter="set_debug_draw" getter="get_debug_draw" enum="Viewport.DebugDraw" default="0">
The overlay mode for test rendered geometry in debug purposes.
</member>
<member name="disable_2d" type="bool" setter="set_disable_2d" getter="is_2d_disabled" default="false">
If [code]true[/code], disables 2D rendering while keeping 3D rendering. See also [member disable_3d].
</member>
<member name="disable_3d" type="bool" setter="set_disable_3d" getter="is_3d_disabled" default="false">
If [code]true[/code], disables 3D rendering while keeping 2D rendering. See also [member disable_2d].
Disable 3D rendering (but keep 2D rendering).
</member>
<member name="fsr_sharpness" type="float" setter="set_fsr_sharpness" getter="get_fsr_sharpness" default="0.2">
Determines how sharp the upscaled image will be when using the FSR upscaling mode. Sharpness halves with every whole number. Values go from 0.0 (sharpest) to 2.0. Values above 2.0 won't make a visible difference.
Expand Down
15 changes: 0 additions & 15 deletions scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4019,17 +4019,6 @@ void Viewport::set_camera_3d_override_orthogonal(real_t p_size, real_t p_z_near,
}
}

void Viewport::set_disable_2d(bool p_disable) {
ERR_MAIN_THREAD_GUARD;
disable_2d = p_disable;
RenderingServer::get_singleton()->viewport_set_disable_2d(viewport, disable_2d);
}

bool Viewport::is_2d_disabled() const {
ERR_READ_THREAD_GUARD_V(false);
return disable_2d;
}

void Viewport::set_disable_3d(bool p_disable) {
ERR_MAIN_THREAD_GUARD;
disable_3d = p_disable;
Expand Down Expand Up @@ -4472,9 +4461,6 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_as_audio_listener_3d", "enable"), &Viewport::set_as_audio_listener_3d);
ClassDB::bind_method(D_METHOD("is_audio_listener_3d"), &Viewport::is_audio_listener_3d);

ClassDB::bind_method(D_METHOD("set_disable_2d", "disable"), &Viewport::set_disable_2d);
ClassDB::bind_method(D_METHOD("is_2d_disabled"), &Viewport::is_2d_disabled);

ClassDB::bind_method(D_METHOD("set_disable_3d", "disable"), &Viewport::set_disable_3d);
ClassDB::bind_method(D_METHOD("is_3d_disabled"), &Viewport::is_3d_disabled);

Expand All @@ -4499,7 +4485,6 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_vrs_texture", "texture"), &Viewport::set_vrs_texture);
ClassDB::bind_method(D_METHOD("get_vrs_texture"), &Viewport::get_vrs_texture);

ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disable_2d"), "set_disable_2d", "is_2d_disabled");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "disable_3d"), "set_disable_3d", "is_3d_disabled");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_xr"), "set_use_xr", "is_using_xr");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "own_world_3d"), "set_use_own_world_3d", "is_using_own_world_3d");
Expand Down
4 changes: 0 additions & 4 deletions scene/main/viewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ class Viewport : public Node {

void _update_audio_listener_2d();

bool disable_2d = false;
bool disable_3d = false;

void _propagate_viewport_notification(Node *p_node, int p_what);
Expand Down Expand Up @@ -739,9 +738,6 @@ class Viewport : public Node {
void set_camera_3d_override_perspective(real_t p_fovy_degrees, real_t p_z_near, real_t p_z_far);
void set_camera_3d_override_orthogonal(real_t p_size, real_t p_z_near, real_t p_z_far);

void set_disable_2d(bool p_disable);
bool is_2d_disabled() const;

void set_disable_3d(bool p_disable);
bool is_3d_disabled() const;

Expand Down

0 comments on commit e2645d8

Please sign in to comment.