summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/joint_2d.cpp5
-rw-r--r--scene/3d/voxel_gi.cpp2
-rw-r--r--scene/3d/voxelizer.cpp3
-rw-r--r--scene/gui/control.h2
-rw-r--r--scene/gui/tabs.cpp4
-rw-r--r--scene/main/node.cpp6
-rw-r--r--scene/main/node.h2
-rw-r--r--scene/resources/environment.cpp19
-rw-r--r--scene/resources/environment.h3
-rw-r--r--scene/resources/sky_material.cpp14
-rw-r--r--scene/resources/tile_set.cpp9
-rw-r--r--scene/resources/tile_set.h1
12 files changed, 34 insertions, 36 deletions
diff --git a/scene/2d/joint_2d.cpp b/scene/2d/joint_2d.cpp
index 3b371d4a07..8a528151cf 100644
--- a/scene/2d/joint_2d.cpp
+++ b/scene/2d/joint_2d.cpp
@@ -74,6 +74,8 @@ void Joint2D::_update_joint(bool p_only_free) {
PhysicsBody2D *body_a = Object::cast_to<PhysicsBody2D>(node_a);
PhysicsBody2D *body_b = Object::cast_to<PhysicsBody2D>(node_b);
+ bool valid = false;
+
if (node_a && !body_a && node_b && !body_b) {
warning = TTR("Node A and Node B must be PhysicsBody2Ds");
} else if (node_a && !body_a) {
@@ -86,11 +88,12 @@ void Joint2D::_update_joint(bool p_only_free) {
warning = TTR("Node A and Node B must be different PhysicsBody2Ds");
} else {
warning = String();
+ valid = true;
}
update_configuration_warnings();
- if (!warning.is_empty()) {
+ if (!valid) {
PhysicsServer2D::get_singleton()->joint_clear(joint);
return;
}
diff --git a/scene/3d/voxel_gi.cpp b/scene/3d/voxel_gi.cpp
index d3d12d94e9..377abd5b38 100644
--- a/scene/3d/voxel_gi.cpp
+++ b/scene/3d/voxel_gi.cpp
@@ -398,7 +398,7 @@ void VoxelGI::bake(Node *p_from_node, bool p_create_visual_debug) {
baker.end_bake();
- //create the data for visual server
+ //create the data for rendering server
if (p_create_visual_debug) {
MultiMeshInstance3D *mmi = memnew(MultiMeshInstance3D);
diff --git a/scene/3d/voxelizer.cpp b/scene/3d/voxelizer.cpp
index 04f371f4b2..aa1236521d 100644
--- a/scene/3d/voxelizer.cpp
+++ b/scene/3d/voxelizer.cpp
@@ -618,7 +618,6 @@ void Voxelizer::begin_bake(int p_subdiv, const AABB &p_bounds) {
bake_cells.resize(1);
material_cache.clear();
- print_line("subdiv: " + itos(p_subdiv));
//find out the actual real bounds, power of 2, which gets the highest subdivision
po2_bounds = p_bounds;
int longest_axis = po2_bounds.get_longest_axis_index();
@@ -661,7 +660,7 @@ void Voxelizer::end_bake() {
_fixup_plot(0, 0);
}
-//create the data for visual server
+//create the data for rendering server
int Voxelizer::get_voxel_gi_octree_depth() const {
return cell_subdiv;
diff --git a/scene/gui/control.h b/scene/gui/control.h
index bdc06319ea..be692b6a0c 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -408,7 +408,7 @@ public:
Rect2 get_rect() const;
Rect2 get_global_rect() const;
Rect2 get_screen_rect() const;
- Rect2 get_window_rect() const; ///< use with care, as it blocks waiting for the visual server
+ Rect2 get_window_rect() const; ///< use with care, as it blocks waiting for the rendering server
Rect2 get_anchorable_rect() const override;
void set_rect(const Rect2 &p_rect); // Reset anchors to begin and set rect, for faster container children sorting.
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp
index f305bf7013..0755a79eee 100644
--- a/scene/gui/tabs.cpp
+++ b/scene/gui/tabs.cpp
@@ -223,7 +223,7 @@ void Tabs::gui_input(const Ref<InputEvent> &p_event) {
}
int found = -1;
- for (int i = offset; i < tabs.size(); i++) {
+ for (int i = offset; i <= max_drawn_tab; i++) {
if (tabs[i].rb_rect.has_point(pos)) {
rb_pressing = true;
update();
@@ -914,7 +914,7 @@ void Tabs::drop_data(const Point2 &p_point, const Variant &p_data) {
int Tabs::get_tab_idx_at_point(const Point2 &p_point) const {
int hover_now = -1;
- for (int i = offset; i < tabs.size(); i++) {
+ for (int i = offset; i <= max_drawn_tab; i++) {
Rect2 rect = get_tab_rect(i);
if (rect.has_point(p_point)) {
hover_now = i;
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 0876c30dd1..189aebb47d 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -536,12 +536,13 @@ bool Node::is_multiplayer_authority() const {
/***** RPC CONFIG ********/
-uint16_t Node::rpc_config(const StringName &p_method, Multiplayer::RPCMode p_rpc_mode, Multiplayer::TransferMode p_transfer_mode, int p_channel) {
+uint16_t Node::rpc_config(const StringName &p_method, Multiplayer::RPCMode p_rpc_mode, bool p_call_local, Multiplayer::TransferMode p_transfer_mode, int p_channel) {
for (int i = 0; i < data.rpc_methods.size(); i++) {
if (data.rpc_methods[i].name == p_method) {
Multiplayer::RPCConfig &nd = data.rpc_methods.write[i];
nd.rpc_mode = p_rpc_mode;
nd.transfer_mode = p_transfer_mode;
+ nd.call_local = p_call_local;
nd.channel = p_channel;
return i | (1 << 15);
}
@@ -552,6 +553,7 @@ uint16_t Node::rpc_config(const StringName &p_method, Multiplayer::RPCMode p_rpc
nd.rpc_mode = p_rpc_mode;
nd.transfer_mode = p_transfer_mode;
nd.channel = p_channel;
+ nd.call_local = p_call_local;
data.rpc_methods.push_back(nd);
return ((uint16_t)data.rpc_methods.size() - 1) | (1 << 15);
}
@@ -2740,7 +2742,7 @@ void Node::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_multiplayer"), &Node::get_multiplayer);
ClassDB::bind_method(D_METHOD("get_custom_multiplayer"), &Node::get_custom_multiplayer);
ClassDB::bind_method(D_METHOD("set_custom_multiplayer", "api"), &Node::set_custom_multiplayer);
- ClassDB::bind_method(D_METHOD("rpc_config", "method", "rpc_mode", "transfer_mode", "channel"), &Node::rpc_config, DEFVAL(Multiplayer::TRANSFER_MODE_RELIABLE), DEFVAL(0));
+ ClassDB::bind_method(D_METHOD("rpc_config", "method", "rpc_mode", "call_local", "transfer_mode", "channel"), &Node::rpc_config, DEFVAL(false), DEFVAL(Multiplayer::TRANSFER_MODE_RELIABLE), DEFVAL(0));
ClassDB::bind_method(D_METHOD("set_editor_description", "editor_description"), &Node::set_editor_description);
ClassDB::bind_method(D_METHOD("get_editor_description"), &Node::get_editor_description);
diff --git a/scene/main/node.h b/scene/main/node.h
index 7d4c79cfba..e59a7a390a 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -466,7 +466,7 @@ public:
int get_multiplayer_authority() const;
bool is_multiplayer_authority() const;
- uint16_t rpc_config(const StringName &p_method, Multiplayer::RPCMode p_rpc_mode, Multiplayer::TransferMode p_transfer_mode, int p_channel = 0); // config a local method for RPC
+ uint16_t rpc_config(const StringName &p_method, Multiplayer::RPCMode p_rpc_mode, bool p_call_local = false, Multiplayer::TransferMode p_transfer_mode = Multiplayer::TRANSFER_MODE_RELIABLE, int p_channel = 0); // config a local method for RPC
Vector<Multiplayer::RPCConfig> get_node_rpc_methods() const;
void rpc(const StringName &p_method, VARIANT_ARG_LIST); // RPC, honors RPCMode, TransferMode, channel
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index cab6c0378a..9a3f081a8b 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -173,23 +173,13 @@ Environment::ReflectionSource Environment::get_reflection_source() const {
return reflection_source;
}
-void Environment::set_ao_color(const Color &p_color) {
- ao_color = p_color;
- _update_ambient_light();
-}
-
-Color Environment::get_ao_color() const {
- return ao_color;
-}
-
void Environment::_update_ambient_light() {
RS::get_singleton()->environment_set_ambient_light(
environment,
ambient_color,
RS::EnvironmentAmbientSource(ambient_source),
ambient_energy,
- ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source),
- ao_color);
+ ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source));
}
// Tonemap
@@ -302,7 +292,7 @@ int Environment::get_ssr_max_steps() const {
}
void Environment::set_ssr_fade_in(float p_fade_in) {
- ssr_fade_in = p_fade_in;
+ ssr_fade_in = MAX(p_fade_in, 0.0f);
_update_ssr();
}
@@ -311,7 +301,7 @@ float Environment::get_ssr_fade_in() const {
}
void Environment::set_ssr_fade_out(float p_fade_out) {
- ssr_fade_out = p_fade_out;
+ ssr_fade_out = MAX(p_fade_out, 0.0f);
_update_ssr();
}
@@ -1092,15 +1082,12 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_ambient_light_sky_contribution"), &Environment::get_ambient_light_sky_contribution);
ClassDB::bind_method(D_METHOD("set_reflection_source", "source"), &Environment::set_reflection_source);
ClassDB::bind_method(D_METHOD("get_reflection_source"), &Environment::get_reflection_source);
- ClassDB::bind_method(D_METHOD("set_ao_color", "color"), &Environment::set_ao_color);
- ClassDB::bind_method(D_METHOD("get_ao_color"), &Environment::get_ao_color);
ADD_GROUP("Ambient Light", "ambient_light_");
ADD_PROPERTY(PropertyInfo(Variant::INT, "ambient_light_source", PROPERTY_HINT_ENUM, "Background,Disabled,Color,Sky"), "set_ambient_source", "get_ambient_source");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ambient_light_color"), "set_ambient_light_color", "get_ambient_light_color");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ambient_light_sky_contribution", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_ambient_light_sky_contribution", "get_ambient_light_sky_contribution");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ambient_light_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_ambient_light_energy", "get_ambient_light_energy");
- ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ambient_light_occlusion_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_ao_color", "get_ao_color");
ADD_GROUP("Reflected Light", "reflected_light_");
ADD_PROPERTY(PropertyInfo(Variant::INT, "reflected_light_source", PROPERTY_HINT_ENUM, "Background,Disabled,Sky"), "set_reflection_source", "get_reflection_source");
diff --git a/scene/resources/environment.h b/scene/resources/environment.h
index 0df2c3cc27..46842754f4 100644
--- a/scene/resources/environment.h
+++ b/scene/resources/environment.h
@@ -116,7 +116,6 @@ private:
float ambient_energy = 1.0;
float ambient_sky_contribution = 1.0;
ReflectionSource reflection_source = REFLECTION_SOURCE_BG;
- Color ao_color;
void _update_ambient_light();
// Tonemap
@@ -250,8 +249,6 @@ public:
float get_ambient_light_sky_contribution() const;
void set_reflection_source(ReflectionSource p_source);
ReflectionSource get_reflection_source() const;
- void set_ao_color(const Color &p_color);
- Color get_ao_color() const;
// Tonemap
void set_tonemapper(ToneMapper p_tone_mapper);
diff --git a/scene/resources/sky_material.cpp b/scene/resources/sky_material.cpp
index b6d3c96cb7..de94c92cac 100644
--- a/scene/resources/sky_material.cpp
+++ b/scene/resources/sky_material.cpp
@@ -175,14 +175,14 @@ void ProceduralSkyMaterial::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_sun_curve"), &ProceduralSkyMaterial::get_sun_curve);
ADD_GROUP("Sky", "sky_");
- ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sky_top_color"), "set_sky_top_color", "get_sky_top_color");
- ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sky_horizon_color"), "set_sky_horizon_color", "get_sky_horizon_color");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sky_top_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_sky_top_color", "get_sky_top_color");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sky_horizon_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_sky_horizon_color", "get_sky_horizon_color");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sky_curve", PROPERTY_HINT_EXP_EASING), "set_sky_curve", "get_sky_curve");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sky_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_sky_energy", "get_sky_energy");
ADD_GROUP("Ground", "ground_");
- ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ground_bottom_color"), "set_ground_bottom_color", "get_ground_bottom_color");
- ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ground_horizon_color"), "set_ground_horizon_color", "get_ground_horizon_color");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ground_bottom_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_ground_bottom_color", "get_ground_bottom_color");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ground_horizon_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_ground_horizon_color", "get_ground_horizon_color");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ground_curve", PROPERTY_HINT_EXP_EASING), "set_ground_curve", "get_ground_curve");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "ground_energy", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_ground_energy", "get_ground_energy");
@@ -531,16 +531,16 @@ void PhysicalSkyMaterial::_bind_methods() {
ADD_GROUP("Rayleigh", "rayleigh_");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "rayleigh_coefficient", PROPERTY_HINT_RANGE, "0,64,0.01"), "set_rayleigh_coefficient", "get_rayleigh_coefficient");
- ADD_PROPERTY(PropertyInfo(Variant::COLOR, "rayleigh_color"), "set_rayleigh_color", "get_rayleigh_color");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "rayleigh_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_rayleigh_color", "get_rayleigh_color");
ADD_GROUP("Mie", "mie_");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mie_coefficient", PROPERTY_HINT_RANGE, "0,1,0.001"), "set_mie_coefficient", "get_mie_coefficient");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "mie_eccentricity", PROPERTY_HINT_RANGE, "-1,1,0.01"), "set_mie_eccentricity", "get_mie_eccentricity");
- ADD_PROPERTY(PropertyInfo(Variant::COLOR, "mie_color"), "set_mie_color", "get_mie_color");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "mie_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_mie_color", "get_mie_color");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "turbidity", PROPERTY_HINT_RANGE, "0,1000,0.01"), "set_turbidity", "get_turbidity");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sun_disk_scale", PROPERTY_HINT_RANGE, "0,360,0.01"), "set_sun_disk_scale", "get_sun_disk_scale");
- ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ground_color"), "set_ground_color", "get_ground_color");
+ ADD_PROPERTY(PropertyInfo(Variant::COLOR, "ground_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_ground_color", "get_ground_color");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "exposure", PROPERTY_HINT_RANGE, "0,128,0.01"), "set_exposure", "get_exposure");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dither_strength", PROPERTY_HINT_RANGE, "0,10,0.01"), "set_dither_strength", "get_dither_strength");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "night_sky", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_night_sky", "get_night_sky");
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 40eedb63c1..e19ca38b82 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -72,6 +72,7 @@ void TileSet::set_tile_shape(TileSet::TileShape p_shape) {
terrain_bits_meshes_dirty = true;
tile_meshes_dirty = true;
+ notify_property_list_changed();
emit_changed();
}
TileSet::TileShape TileSet::get_tile_shape() const {
@@ -2685,6 +2686,14 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::ARRAY, "tile_proxies/alternative_level", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR));
}
+void TileSet::_validate_property(PropertyInfo &property) const {
+ if (property.name == "tile_layout" && tile_shape == TILE_SHAPE_SQUARE) {
+ property.usage ^= PROPERTY_USAGE_READ_ONLY;
+ } else if (property.name == "tile_offset_axis" && tile_shape == TILE_SHAPE_SQUARE) {
+ property.usage ^= PROPERTY_USAGE_READ_ONLY;
+ }
+}
+
void TileSet::_bind_methods() {
// Sources management.
ClassDB::bind_method(D_METHOD("get_next_source_id"), &TileSet::get_next_source_id);
diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h
index 2b4929b3df..716b66405f 100644
--- a/scene/resources/tile_set.h
+++ b/scene/resources/tile_set.h
@@ -180,6 +180,7 @@ protected:
bool _set(const StringName &p_name, const Variant &p_value);
bool _get(const StringName &p_name, Variant &r_ret) const;
void _get_property_list(List<PropertyInfo> *p_list) const;
+ virtual void _validate_property(PropertyInfo &property) const override;
private:
// --- TileSet data ---