mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Unify and streamline connecting to Resource changes
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
#include "environment.h"
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/core_string_names.h"
|
||||
#include "scene/resources/gradient_texture.h"
|
||||
#include "servers/rendering_server.h"
|
||||
|
||||
@@ -1004,9 +1003,7 @@ void Environment::set_adjustment_color_correction(Ref<Texture> p_color_correctio
|
||||
adjustment_color_correction = p_color_correction;
|
||||
Ref<GradientTexture1D> grad_tex = p_color_correction;
|
||||
if (grad_tex.is_valid()) {
|
||||
if (!grad_tex->is_connected(CoreStringNames::get_singleton()->changed, callable_mp(this, &Environment::_update_adjustment))) {
|
||||
grad_tex->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Environment::_update_adjustment));
|
||||
}
|
||||
grad_tex->connect_changed(callable_mp(this, &Environment::_update_adjustment));
|
||||
}
|
||||
Ref<Texture2D> adjustment_texture_2d = adjustment_color_correction;
|
||||
if (adjustment_texture_2d.is_valid()) {
|
||||
|
||||
Reference in New Issue
Block a user