summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/audio_stream_player_2d.cpp2
-rw-r--r--scene/2d/canvas_item.cpp2
-rw-r--r--scene/2d/collision_object_2d.cpp14
-rw-r--r--scene/2d/collision_object_2d.h2
-rw-r--r--scene/2d/physics_body_2d.cpp2
-rw-r--r--scene/3d/audio_stream_player_3d.cpp2
-rw-r--r--scene/3d/collision_object.cpp14
-rw-r--r--scene/3d/collision_object.h2
-rw-r--r--scene/3d/physics_body.cpp2
-rw-r--r--scene/3d/skeleton.cpp6
-rw-r--r--scene/3d/skeleton.h8
-rw-r--r--scene/3d/vehicle_body.cpp2
-rw-r--r--scene/3d/voxel_light_baker.cpp26
-rw-r--r--scene/3d/voxel_light_baker.h4
-rw-r--r--scene/gui/base_button.h4
-rw-r--r--scene/gui/control.cpp2
-rw-r--r--scene/gui/text_edit.cpp19
-rw-r--r--scene/gui/tree.cpp70
-rw-r--r--scene/gui/tree.h4
-rw-r--r--scene/main/node.cpp10
-rw-r--r--scene/main/viewport.cpp125
-rw-r--r--scene/main/viewport.h9
-rw-r--r--scene/resources/packed_scene.cpp4
-rw-r--r--scene/resources/primitive_meshes.h2
-rw-r--r--scene/resources/scene_format_text.cpp2
-rw-r--r--scene/resources/tile_set.cpp2
26 files changed, 121 insertions, 220 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
index ed602bbc70..b11deb08fd 100644
--- a/scene/2d/audio_stream_player_2d.cpp
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -195,7 +195,7 @@ void AudioStreamPlayer2D::_notification(int p_what) {
float dist = global_pos.distance_to(screen_in_global); //distance to screen center
if (dist > max_distance)
- continue; //cant hear this sound in this viewport
+ continue; //can't hear this sound in this viewport
float multiplier = Math::pow(1.0f - dist / max_distance, attenuation);
multiplier *= Math::db2linear(volume_db); //also apply player volume!
diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp
index 12d6f32567..87bcdae527 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -101,7 +101,7 @@ void CanvasItemMaterial::_update_shader() {
case LIGHT_MODE_UNSHADED: code += ",unshaded"; break;
case LIGHT_MODE_LIGHT_ONLY: code += ",light_only"; break;
}
- code += ";\n"; //thats it.
+ code += ";\n"; //that's it.
ShaderData shader_data;
shader_data.shader = VS::get_singleton()->shader_create();
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp
index e451e7a65b..89edbb6cc1 100644
--- a/scene/2d/collision_object_2d.cpp
+++ b/scene/2d/collision_object_2d.cpp
@@ -328,6 +328,20 @@ void CollisionObject2D::_update_pickable() {
Physics2DServer::get_singleton()->body_set_pickable(rid, pickable);
}
+String CollisionObject2D::get_configuration_warning() const {
+
+ String warning = Node2D::get_configuration_warning();
+
+ if (shapes.empty()) {
+ if (warning == String()) {
+ warning += "\n";
+ }
+ warning += TTR("This node has no children shapes, so it can't interact with the space.\nConsider adding CollisionShape2D or CollisionPolygon2D children nodes to define it's shape.");
+ }
+
+ return warning;
+}
+
void CollisionObject2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_rid"), &CollisionObject2D::get_rid);
diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h
index ee3cea46a5..6da63d1a0b 100644
--- a/scene/2d/collision_object_2d.h
+++ b/scene/2d/collision_object_2d.h
@@ -107,6 +107,8 @@ public:
void set_pickable(bool p_enabled);
bool is_pickable() const;
+ String get_configuration_warning() const;
+
_FORCE_INLINE_ RID get_rid() const { return rid; }
CollisionObject2D();
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 1b25b3588a..c4c9362387 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -807,7 +807,7 @@ String RigidBody2D::get_configuration_warning() const {
if (warning != String()) {
warning += "\n";
}
- warning += TTR("Size changes to RigidBody2D (in character or rigid modes) will be overriden by the physics engine when running.\nChange the size in children collision shapes instead.");
+ warning += TTR("Size changes to RigidBody2D (in character or rigid modes) will be overridden by the physics engine when running.\nChange the size in children collision shapes instead.");
}
return warning;
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index cf2a47f14c..bf3bc42e4e 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -320,7 +320,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
total_max = MAX(total_max, cam_area_pos.length());
}
if (total_max > max_distance) {
- continue; //cant hear this sound in this camera
+ continue; //can't hear this sound in this camera
}
}
diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp
index b246fe75f4..73770a2dd2 100644
--- a/scene/3d/collision_object.cpp
+++ b/scene/3d/collision_object.cpp
@@ -365,6 +365,20 @@ bool CollisionObject::get_capture_input_on_drag() const {
return capture_input_on_drag;
}
+String CollisionObject::get_configuration_warning() const {
+
+ String warning = Spatial::get_configuration_warning();
+
+ if (shapes.empty()) {
+ if (warning == String()) {
+ warning += "\n";
+ }
+ warning += TTR("This node has no children shapes, so it can't interact with the space.\nConsider adding CollisionShape or CollisionPolygon children nodes to define it's shape.");
+ }
+
+ return warning;
+}
+
CollisionObject::CollisionObject() {
capture_input_on_drag = false;
diff --git a/scene/3d/collision_object.h b/scene/3d/collision_object.h
index c58e02848f..f31d65e411 100644
--- a/scene/3d/collision_object.h
+++ b/scene/3d/collision_object.h
@@ -109,6 +109,8 @@ public:
_FORCE_INLINE_ RID get_rid() const { return rid; }
+ virtual String get_configuration_warning() const;
+
CollisionObject();
~CollisionObject();
};
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index a15a7dcead..bf7952b2dd 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -772,7 +772,7 @@ String RigidBody::get_configuration_warning() const {
if (warning != String()) {
warning += "\n";
}
- warning += TTR("Size changes to RigidBody (in character or rigid modes) will be overriden by the physics engine when running.\nChange the size in children collision shapes instead.");
+ warning += TTR("Size changes to RigidBody (in character or rigid modes) will be overridden by the physics engine when running.\nChange the size in children collision shapes instead.");
}
return warning;
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index 99541db4d3..d3a13c741e 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -61,7 +61,7 @@ bool Skeleton::_set(const StringName &p_path, const Variant &p_value) {
set_bone_enabled(which, p_value);
else if (what == "pose")
set_bone_pose(which, p_value);
- else if (what == "bound_childs") {
+ else if (what == "bound_children") {
Array children = p_value;
if (is_inside_tree()) {
@@ -105,7 +105,7 @@ bool Skeleton::_get(const StringName &p_path, Variant &r_ret) const {
r_ret = is_bone_enabled(which);
else if (what == "pose")
r_ret = get_bone_pose(which);
- else if (what == "bound_childs") {
+ else if (what == "bound_children") {
Array children;
for (const List<uint32_t>::Element *E = bones[which].nodes_bound.front(); E; E = E->next()) {
@@ -134,7 +134,7 @@ void Skeleton::_get_property_list(List<PropertyInfo> *p_list) const {
p_list->push_back(PropertyInfo(Variant::TRANSFORM, prep + "rest"));
p_list->push_back(PropertyInfo(Variant::BOOL, prep + "enabled"));
p_list->push_back(PropertyInfo(Variant::TRANSFORM, prep + "pose", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
- p_list->push_back(PropertyInfo(Variant::ARRAY, prep + "bound_childs"));
+ p_list->push_back(PropertyInfo(Variant::ARRAY, prep + "bound_children"));
}
}
diff --git a/scene/3d/skeleton.h b/scene/3d/skeleton.h
index de0d4216d9..d693670055 100644
--- a/scene/3d/skeleton.h
+++ b/scene/3d/skeleton.h
@@ -83,12 +83,12 @@ class Skeleton : public Spatial {
Array _get_bound_child_nodes_to_bone(int p_bone) const {
Array bound;
- List<Node *> childs;
- get_bound_child_nodes_to_bone(p_bone, &childs);
+ List<Node *> children;
+ get_bound_child_nodes_to_bone(p_bone, &children);
- for (int i = 0; i < childs.size(); i++) {
+ for (int i = 0; i < children.size(); i++) {
- bound.push_back(childs[i]);
+ bound.push_back(children[i]);
}
return bound;
}
diff --git a/scene/3d/vehicle_body.cpp b/scene/3d/vehicle_body.cpp
index aeee51c4b2..ed3bde9504 100644
--- a/scene/3d/vehicle_body.cpp
+++ b/scene/3d/vehicle_body.cpp
@@ -572,7 +572,7 @@ void VehicleBody::_resolve_single_bilateral(PhysicsDirectBodyState *s, const Vec
b2invmass);
// FIXME: rel_vel assignment here is overwritten by the following assignment.
- // What seemes to be intented in the next next assignment is: rel_vel = normal.dot(rel_vel);
+ // What seemes to be intended in the next next assignment is: rel_vel = normal.dot(rel_vel);
// Investigate why.
real_t rel_vel = jac.getRelativeVelocity(
s->get_linear_velocity(),
diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp
index e1717a56f3..d389b69ef3 100644
--- a/scene/3d/voxel_light_baker.cpp
+++ b/scene/3d/voxel_light_baker.cpp
@@ -461,16 +461,16 @@ void VoxelLightBaker::_plot_face(int p_idx, int p_level, int p_x, int p_y, int p
}
}
- if (bake_cells[p_idx].childs[i] == CHILD_EMPTY) {
+ if (bake_cells[p_idx].children[i] == CHILD_EMPTY) {
//sub cell must be created
uint32_t child_idx = bake_cells.size();
- bake_cells[p_idx].childs[i] = child_idx;
+ bake_cells[p_idx].children[i] = child_idx;
bake_cells.resize(bake_cells.size() + 1);
bake_cells[child_idx].level = p_level + 1;
}
- _plot_face(bake_cells[p_idx].childs[i], p_level + 1, nx, ny, nz, p_vtx, p_normal, p_uv, p_material, aabb);
+ _plot_face(bake_cells[p_idx].children[i], p_level + 1, nx, ny, nz, p_vtx, p_normal, p_uv, p_material, aabb);
}
}
}
@@ -700,7 +700,7 @@ void VoxelLightBaker::_init_light_plot(int p_idx, int p_level, int p_x, int p_y,
int half = (1 << (cell_subdiv - 1)) >> (p_level + 1);
for (int i = 0; i < 8; i++) {
- uint32_t child = bake_cells[p_idx].childs[i];
+ uint32_t child = bake_cells[p_idx].children[i];
if (child == CHILD_EMPTY)
continue;
@@ -809,7 +809,7 @@ uint32_t VoxelLightBaker::_find_cell_at_pos(const Cell *cells, int x, int y, int
ofs_z += half;
}
- cell = bc->childs[child];
+ cell = bc->children[child];
if (cell == CHILD_EMPTY)
return CHILD_EMPTY;
@@ -1257,7 +1257,7 @@ void VoxelLightBaker::_fixup_plot(int p_idx, int p_level) {
for (int i = 0; i < 8; i++) {
- uint32_t child = bake_cells[p_idx].childs[i];
+ uint32_t child = bake_cells[p_idx].children[i];
if (child == CHILD_EMPTY)
continue;
@@ -1483,7 +1483,7 @@ void VoxelLightBaker::_sample_baked_octree_filtered_and_anisotropic(const Vector
ofs_z += half;
}
- cell = bc->childs[child];
+ cell = bc->children[child];
if (cell == CHILD_EMPTY)
break;
@@ -1766,7 +1766,7 @@ Vector3 VoxelLightBaker::_compute_ray_trace_at_pos(const Vector3 &p_pos, const V
ofs_z += half;
}
- cell = bc->childs[child];
+ cell = bc->children[child];
if (unlikely(cell == CHILD_EMPTY))
break;
@@ -1928,7 +1928,7 @@ Error VoxelLightBaker::make_lightmap(const Transform &p_xform, Ref<Mesh> &p_mesh
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
if (lightmap_ptr[i * width + j].normal == Vector3())
- continue; //empty, dont write over it anyway
+ continue; //empty, don't write over it anyway
float gauss_sum = gauss_kernel[0];
Vector3 accum = lightmap_ptr[i * width + j].pos * gauss_kernel[0];
for (int k = 1; k < 4; k++) {
@@ -2191,7 +2191,7 @@ PoolVector<int> VoxelLightBaker::create_gi_probe_data() {
for (int i = 0; i < bake_cells.size(); i++) {
for (int j = 0; j < 8; j++) {
- w32[ofs++] = bake_cells[i].childs[j];
+ w32[ofs++] = bake_cells[i].children[j];
}
{ //albedo
@@ -2275,7 +2275,7 @@ void VoxelLightBaker::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb, Re
for (int i = 0; i < 8; i++) {
- uint32_t child = bake_cells[p_idx].childs[i];
+ uint32_t child = bake_cells[p_idx].children[i];
if (child == CHILD_EMPTY || child >= max_original_cells)
continue;
@@ -2290,7 +2290,7 @@ void VoxelLightBaker::_debug_mesh(int p_idx, int p_level, const AABB &p_aabb, Re
if (i & 4)
aabb.position.z += aabb.size.z;
- _debug_mesh(bake_cells[p_idx].childs[i], p_level + 1, aabb, p_multimesh, idx, p_mode);
+ _debug_mesh(bake_cells[p_idx].children[i], p_level + 1, aabb, p_multimesh, idx, p_mode);
}
}
}
@@ -2423,7 +2423,7 @@ PoolVector<uint8_t> VoxelLightBaker::create_capture_octree(int p_subdiv) {
}
for (int j = 0; j < 8; j++) {
- uint32_t child = bake_cells[demap[i]].childs[j];
+ uint32_t child = bake_cells[demap[i]].children[j];
octree[i].children[j] = child == CHILD_EMPTY ? CHILD_EMPTY : remap[child];
}
}
diff --git a/scene/3d/voxel_light_baker.h b/scene/3d/voxel_light_baker.h
index d270a26a2a..6a1f1253a3 100644
--- a/scene/3d/voxel_light_baker.h
+++ b/scene/3d/voxel_light_baker.h
@@ -60,7 +60,7 @@ private:
struct Cell {
- uint32_t childs[8];
+ uint32_t children[8];
float albedo[3]; //albedo in RGB24
float emission[3]; //accumulated light in 16:16 fixed point (needs to be integer for moving lights fast)
float normal[3];
@@ -70,7 +70,7 @@ private:
Cell() {
for (int i = 0; i < 8; i++) {
- childs[i] = CHILD_EMPTY;
+ children[i] = CHILD_EMPTY;
}
for (int i = 0; i < 3; i++) {
diff --git a/scene/gui/base_button.h b/scene/gui/base_button.h
index 9e0e1493d1..6917e112ab 100644
--- a/scene/gui/base_button.h
+++ b/scene/gui/base_button.h
@@ -90,8 +90,8 @@ public:
/* Signals */
- bool is_pressed() const; ///< return wether button is pressed (toggled in)
- bool is_pressing() const; ///< return wether button is pressed (toggled in)
+ bool is_pressed() const; ///< return whether button is pressed (toggled in)
+ bool is_pressing() const; ///< return whether button is pressed (toggled in)
bool is_hovered() const;
void set_pressed(bool p_pressed); ///only works in toggle mode
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index d9d033dfb9..01415594d3 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -2013,7 +2013,7 @@ Control *Control::find_prev_valid_focus() const {
if (from->is_set_as_toplevel() || !Object::cast_to<Control>(from->get_parent())) {
- //find last of the childs
+ //find last of the children
prev_child = _prev_control(from);
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 4d87a6b3ba..95bd676a08 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -455,7 +455,7 @@ void TextEdit::_update_selection_mode_word() {
end += 1;
}
- // inital selection
+ // initial selection
if (!selection.active) {
select(row, beg, row, end);
selection.selecting_column = beg;
@@ -888,7 +888,7 @@ void TextEdit::_notification(int p_what) {
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(xmargin_beg + ofs_x, ofs_y, char_w, get_row_height()), cache.selection_color);
}
} else {
- // if it has text, then draw current line marker in the margin, as line number ect will draw over it, draw the rest of line marker later.
+ // if it has text, then draw current line marker in the margin, as line number etc will draw over it, draw the rest of line marker later.
if (line == cursor.line && highlight_current_line) {
VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(0, ofs_y, xmargin_beg, get_row_height()), cache.current_line_color);
}
@@ -937,7 +937,7 @@ void TextEdit::_notification(int p_what) {
cache.font->draw(ci, Point2(cache.style_normal->get_margin(MARGIN_LEFT) + cache.breakpoint_gutter_width + ofs_x, ofs_y + cache.font->get_ascent()), fc, cache.line_number_color);
}
- //loop through charcters in one line
+ //loop through characters in one line
for (int j = 0; j < str.length(); j++) {
//look for keyword
@@ -1775,15 +1775,16 @@ void TextEdit::indent_left() {
void TextEdit::_get_mouse_pos(const Point2i &p_mouse, int &r_row, int &r_col) const {
float rows = p_mouse.y;
+ rows -= cache.style_normal->get_margin(MARGIN_TOP);
+ rows += (CLAMP(v_scroll->get_value() - get_line_scroll_pos(true), 0, 1) * get_row_height());
rows /= get_row_height();
- rows += v_scroll->get_value();
- int row = Math::floor(rows);
+ int first_vis_line = CLAMP(cursor.line_ofs, 0, text.size() - 1);
+ int row = first_vis_line + Math::floor(rows);
if (is_hiding_enabled()) {
// row will be offset by the hidden rows
- int lsp = get_line_scroll_pos(true);
- int f_ofs = num_lines_from(CLAMP(cursor.line_ofs, 0, text.size() - 1), MIN(row + 1 - cursor.line_ofs, text.size() - cursor.line_ofs)) - 1;
- row = cursor.line_ofs + f_ofs;
+ int f_ofs = num_lines_from(first_vis_line, rows + 1) - 1;
+ row = first_vis_line + f_ofs;
row = CLAMP(row, 0, text.size() - num_lines_from(text.size() - 1, -1));
}
@@ -3130,7 +3131,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
- if (!scancode_handled && !k->get_command()) { //for german kbds
+ if (!scancode_handled && !k->get_command()) { //for German kbds
if (k->get_unicode() >= 32) {
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index a4b703af9e..e12044fca2 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -45,12 +45,12 @@
void TreeItem::move_to_top() {
- if (!parent || parent->childs == this)
+ if (!parent || parent->children == this)
return; //already on top
TreeItem *prev = get_prev();
prev->next = next;
- next = parent->childs;
- parent->childs = this;
+ next = parent->children;
+ parent->children = this;
}
void TreeItem::move_to_bottom() {
@@ -65,7 +65,7 @@ void TreeItem::move_to_bottom() {
if (prev) {
prev->next = next;
} else {
- parent->childs = next;
+ parent->children = next;
}
last->next = this;
next = NULL;
@@ -368,10 +368,10 @@ TreeItem *TreeItem::get_next() {
TreeItem *TreeItem::get_prev() {
- if (!parent || parent->childs == this)
+ if (!parent || parent->children == this)
return NULL;
- TreeItem *prev = parent->childs;
+ TreeItem *prev = parent->children;
while (prev && prev->next != this)
prev = prev->next;
@@ -385,7 +385,7 @@ TreeItem *TreeItem::get_parent() {
TreeItem *TreeItem::get_children() {
- return childs;
+ return children;
}
TreeItem *TreeItem::get_prev_visible() {
@@ -402,10 +402,10 @@ TreeItem *TreeItem::get_prev_visible() {
} else {
current = prev;
- while (!current->collapsed && current->childs) {
+ while (!current->collapsed && current->children) {
//go to the very end
- current = current->childs;
+ current = current->children;
while (current->next)
current = current->next;
}
@@ -418,9 +418,9 @@ TreeItem *TreeItem::get_next_visible() {
TreeItem *current = this;
- if (!current->collapsed && current->childs) {
+ if (!current->collapsed && current->children) {
- current = current->childs;
+ current = current->children;
} else if (current->next) {
@@ -444,7 +444,7 @@ TreeItem *TreeItem::get_next_visible() {
void TreeItem::remove_child(TreeItem *p_item) {
ERR_FAIL_NULL(p_item);
- TreeItem **c = &childs;
+ TreeItem **c = &children;
while (*c) {
@@ -802,16 +802,16 @@ void TreeItem::_bind_methods() {
void TreeItem::clear_children() {
- TreeItem *c = childs;
+ TreeItem *c = children;
while (c) {
TreeItem *aux = c;
c = c->get_next();
- aux->parent = 0; // so it wont try to recursively autoremove from me in here
+ aux->parent = 0; // so it won't try to recursively autoremove from me in here
memdelete(aux);
}
- childs = 0;
+ children = 0;
};
TreeItem::TreeItem(Tree *p_tree) {
@@ -823,7 +823,7 @@ TreeItem::TreeItem(Tree *p_tree) {
parent = 0; // parent item
next = 0; // next in list
- childs = 0; //child items
+ children = 0; //child items
}
TreeItem::~TreeItem() {
@@ -977,9 +977,9 @@ int Tree::get_item_height(TreeItem *p_item) const {
int height = compute_item_height(p_item);
height += cache.vseparation;
- if (!p_item->collapsed) { /* if not collapsed, check the childs */
+ if (!p_item->collapsed) { /* if not collapsed, check the children */
- TreeItem *c = p_item->childs;
+ TreeItem *c = p_item->children;
while (c) {
@@ -1386,7 +1386,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
}
}
- if (!p_item->disable_folding && !hide_folding && p_item->childs) { //has childs, draw the guide box
+ if (!p_item->disable_folding && !hide_folding && p_item->children) { //has children, draw the guide box
Ref<Texture> arrow;
@@ -1413,9 +1413,9 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
children_pos.y += htotal;
}
- if (!p_item->collapsed) { /* if not collapsed, check the childs */
+ if (!p_item->collapsed) { /* if not collapsed, check the children */
- TreeItem *c = p_item->childs;
+ TreeItem *c = p_item->children;
while (c) {
@@ -1569,7 +1569,7 @@ void Tree::select_single_item(TreeItem *p_selected, TreeItem *p_current, int p_c
*r_in_range = false;
}
- TreeItem *c = p_current->childs;
+ TreeItem *c = p_current->children;
while (c) {
@@ -1635,7 +1635,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
if (!p_item->disable_folding && !hide_folding && (p_pos.x >= x_ofs && p_pos.x < (x_ofs + cache.item_margin))) {
- if (p_item->childs)
+ if (p_item->children)
p_item->set_collapsed(!p_item->is_collapsed());
return -1; //handled!
@@ -1942,9 +1942,9 @@ int Tree::propagate_mouse_event(const Point2i &p_pos, int x_ofs, int y_ofs, bool
new_pos.y -= item_h;
}
- if (!p_item->collapsed) { /* if not collapsed, check the childs */
+ if (!p_item->collapsed) { /* if not collapsed, check the children */
- TreeItem *c = p_item->childs;
+ TreeItem *c = p_item->children;
while (c) {
@@ -2988,7 +2988,7 @@ TreeItem *Tree::create_item(TreeItem *p_parent, int p_idx) {
ti->cells.resize(columns.size());
TreeItem *prev = NULL;
- TreeItem *c = p_parent->childs;
+ TreeItem *c = p_parent->children;
int idx = 0;
while (c) {
@@ -3003,7 +3003,7 @@ TreeItem *Tree::create_item(TreeItem *p_parent, int p_idx) {
if (prev)
prev->next = ti;
else
- p_parent->childs = ti;
+ p_parent->children = ti;
ti->parent = p_parent;
} else {
@@ -3036,8 +3036,8 @@ TreeItem *Tree::get_last_item() {
if (last->next)
last = last->next;
- else if (last->childs)
- last = last->childs;
+ else if (last->children)
+ last = last->children;
else
break;
}
@@ -3208,9 +3208,9 @@ TreeItem *Tree::get_next_selected(TreeItem *p_item) {
p_item = root;
} else {
- if (p_item->childs) {
+ if (p_item->children) {
- p_item = p_item->childs;
+ p_item = p_item->children;
} else if (p_item->next) {
@@ -3325,9 +3325,9 @@ int Tree::get_item_offset(TreeItem *p_item) const {
ofs += compute_item_height(it) + cache.vseparation;
- if (it->childs && !it->collapsed) {
+ if (it->children && !it->collapsed) {
- it = it->childs;
+ it = it->children;
} else if (it->next) {
@@ -3548,7 +3548,7 @@ TreeItem *Tree::_find_item_at_pos(TreeItem *p_item, const Point2 &p_pos, int &r_
}
if (p_item->is_collapsed())
- return NULL; // do not try childs, it's collapsed
+ return NULL; // do not try children, it's collapsed
TreeItem *n = p_item->get_children();
while (n) {
@@ -3821,7 +3821,7 @@ void Tree::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_rmb_select"), "set_allow_rmb_select", "get_allow_rmb_select");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hide_folding"), "set_hide_folding", "is_folding_hidden");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hide_root"), "set_hide_root", "is_root_hidden");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "drop_mode_flags", PROPERTY_HINT_FLAGS, "On Item,Inbetween"), "set_drop_mode_flags", "get_drop_mode_flags");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "drop_mode_flags", PROPERTY_HINT_FLAGS, "On Item,In between"), "set_drop_mode_flags", "get_drop_mode_flags");
ADD_PROPERTY(PropertyInfo(Variant::INT, "select_mode", PROPERTY_HINT_ENUM, "Single,Row,Multi"), "set_select_mode", "get_select_mode");
ADD_SIGNAL(MethodInfo("item_selected"));
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index 709ff73971..2a8546a743 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -144,13 +144,13 @@ private:
Vector<Cell> cells;
- bool collapsed; // wont show childs
+ bool collapsed; // won't show children
bool disable_folding;
int custom_min_height;
TreeItem *parent; // parent item
TreeItem *next; // next in list
- TreeItem *childs; //child items
+ TreeItem *children; //child items
Tree *tree; //tree (for reference)
TreeItem(Tree *p_tree);
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 148cdaf526..ac85dd64af 100644
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -184,7 +184,7 @@ void Node::_propagate_ready() {
}
void Node::_propagate_enter_tree() {
- // this needs to happen to all childs before any enter_tree
+ // this needs to happen to all children before any enter_tree
if (data.parent) {
data.tree = data.parent->data.tree;
@@ -1202,13 +1202,13 @@ void Node::_validate_child_name(Node *p_child, bool p_force_human_readable) {
unique = false;
} else {
//check if exists
- Node **childs = data.children.ptrw();
+ Node **children = data.children.ptrw();
int cc = data.children.size();
for (int i = 0; i < cc; i++) {
- if (childs[i] == p_child)
+ if (children[i] == p_child)
continue;
- if (childs[i]->data.name == p_child->data.name) {
+ if (children[i]->data.name == p_child->data.name) {
unique = false;
break;
}
@@ -1311,7 +1311,7 @@ void Node::_add_child_nocheck(Node *p_child, const StringName &p_name) {
}
/* Notify */
- //recognize childs created in this node constructor
+ //recognize children created in this node constructor
p_child->data.parent_owned = data.in_constructor;
add_child_notify(p_child);
}
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 1a2ea796bd..1ff1f4b6d8 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -196,8 +196,6 @@ void Viewport::_update_stretch_transform() {
if (size_override_stretch && size_override) {
- //print_line("sive override size "+size_override_size);
- //print_line("rect size "+size);
stretch_transform = Transform2D();
Size2 scale = size / (size_override_size + size_override_margin * 2);
stretch_transform.scale(scale);
@@ -211,114 +209,6 @@ void Viewport::_update_stretch_transform() {
_update_global_transform();
}
-void Viewport::_update_rect() {
-
- if (!is_inside_tree())
- return;
-
- /*if (!render_target && parent_control) {
-
- Control *c = parent_control;
-
- rect.pos=Point2();
- rect.size=c->get_size();
- }*/
- /*
- VisualServer::ViewportRect vr;
- vr.x=rect.pos.x;
- vr.y=rect.pos.y;
-
- if (render_target) {
- vr.x=0;
- vr.y=0;
- }
- vr.width=rect.size.width;
- vr.height=rect.size.height;
-
- VisualServer::get_singleton()->viewport_set_rect(viewport,vr);
- last_vp_rect=rect;
-
- if (canvas_item.is_valid()) {
- VisualServer::get_singleton()->canvas_item_set_custom_rect(canvas_item,true,rect);
- }
-
- emit_signal("size_changed");
- texture->emit_changed();
-*/
-}
-
-void Viewport::_parent_resized() {
-
- _update_rect();
-}
-
-void Viewport::_parent_draw() {
-}
-
-void Viewport::_parent_visibility_changed() {
-
- /*
- if (parent_control) {
-
- Control *c = parent_control;
- VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,c->is_visible_in_tree());
-
- _update_listener();
- _update_listener_2d();
- }
-*/
-}
-
-void Viewport::_vp_enter_tree() {
-
- /* if (parent_control) {
-
- Control *cparent=parent_control;
- RID parent_ci = cparent->get_canvas_item();
- ERR_FAIL_COND(!parent_ci.is_valid());
- canvas_item = VisualServer::get_singleton()->canvas_item_create();
-
- VisualServer::get_singleton()->canvas_item_set_parent(canvas_item,parent_ci);
- VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,false);
- //VisualServer::get_singleton()->canvas_item_attach_viewport(canvas_item,viewport);
- parent_control->connect("resized",this,"_parent_resized");
- parent_control->connect("visibility_changed",this,"_parent_visibility_changed");
- } else if (!parent){
-
- //VisualServer::get_singleton()->viewport_attach_to_screen(viewport,0);
-
- }
-*/
-}
-
-void Viewport::_vp_exit_tree() {
-
- /*
- if (parent_control) {
-
- parent_control->disconnect("resized",this,"_parent_resized");
- }
-
- if (parent_control) {
-
- parent_control->disconnect("visibility_changed",this,"_parent_visibility_changed");
- }
-
- if (canvas_item.is_valid()) {
-
- VisualServer::get_singleton()->free(canvas_item);
- canvas_item=RID();
-
- }
-
- if (!parent) {
-
- VisualServer::get_singleton()->viewport_detach(viewport);
-
- }
-*/
-}
-
void Viewport::update_worlds() {
if (!is_inside_tree())
@@ -376,7 +266,6 @@ void Viewport::_notification(int p_what) {
_update_listener();
_update_listener_2d();
- _update_rect();
find_world_2d()->_register_viewport(this, Rect2());
@@ -436,11 +325,6 @@ void Viewport::_notification(int p_what) {
if (world_2d.is_valid())
world_2d->_remove_viewport(this);
- /*
- if (!render_target)
- _vp_exit_tree();
- */
-
VisualServer::get_singleton()->viewport_set_scenario(viewport, RID());
// SpatialSoundServer::get_singleton()->listener_set_space(internal_listener, RID());
VisualServer::get_singleton()->viewport_remove_canvas(viewport, current_canvas);
@@ -718,7 +602,6 @@ void Viewport::set_size(const Size2 &p_size) {
size = p_size.floor();
VS::get_singleton()->viewport_set_size(viewport, size.width, size.height);
- _update_rect();
_update_stretch_transform();
emit_signal("size_changed");
@@ -1167,7 +1050,7 @@ void Viewport::set_size_override(bool p_enable, const Size2 &p_size, const Vecto
size_override_size = p_size;
}
size_override_margin = p_margin;
- _update_rect();
+
_update_stretch_transform();
emit_signal("size_changed");
}
@@ -1186,9 +1069,6 @@ void Viewport::set_size_override_stretch(bool p_enable) {
return;
size_override_stretch = p_enable;
- if (size_override) {
- _update_rect();
- }
_update_stretch_transform();
}
@@ -2684,9 +2564,6 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_transparent_background", "enable"), &Viewport::set_transparent_background);
ClassDB::bind_method(D_METHOD("has_transparent_background"), &Viewport::has_transparent_background);
- ClassDB::bind_method(D_METHOD("_parent_visibility_changed"), &Viewport::_parent_visibility_changed);
-
- ClassDB::bind_method(D_METHOD("_parent_resized"), &Viewport::_parent_resized);
ClassDB::bind_method(D_METHOD("_vp_input"), &Viewport::_vp_input);
ClassDB::bind_method(D_METHOD("_vp_input_text", "text"), &Viewport::_vp_input_text);
ClassDB::bind_method(D_METHOD("_vp_unhandled_input"), &Viewport::_vp_unhandled_input);
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 48e2929e54..07bbd3f1fa 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -206,12 +206,6 @@ private:
void _test_new_mouseover(ObjectID new_collider);
Map<ObjectID, uint64_t> physics_2d_mouseover;
- void _update_rect();
-
- void _parent_resized();
- void _parent_draw();
- void _parent_visibility_changed();
-
Ref<World2D> world_2d;
Ref<World> world;
Ref<World> own_world;
@@ -294,9 +288,6 @@ private:
_FORCE_INLINE_ Transform2D _get_input_pre_xform() const;
- void _vp_enter_tree();
- void _vp_exit_tree();
-
void _vp_input(const Ref<InputEvent> &p_ev);
void _vp_input_text(const String &p_text);
void _vp_unhandled_input(const Ref<InputEvent> &p_ev);
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index dd8d0e2141..3df9285bb6 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -1119,7 +1119,7 @@ void SceneState::set_bundled_scene(const Dictionary &p_dictionary) {
uint32_t name_index = r[idx++];
nd.name = name_index & ((1 << NAME_INDEX_BITS) - 1);
nd.index = (name_index >> NAME_INDEX_BITS);
- nd.index--; //0 is invaild, stored as 1
+ nd.index--; //0 is invalid, stored as 1
nd.instance = r[idx++];
nd.properties.resize(r[idx++]);
for (int j = 0; j < nd.properties.size(); j++) {
@@ -1212,7 +1212,7 @@ Dictionary SceneState::get_bundled_scene() const {
rnodes.push_back(nd.owner);
rnodes.push_back(nd.type);
uint32_t name_index = nd.name;
- if (nd.index < (1 << (32 - NAME_INDEX_BITS)) - 1) { //save if less than 16k childs
+ if (nd.index < (1 << (32 - NAME_INDEX_BITS)) - 1) { //save if less than 16k children
name_index |= uint32_t(nd.index + 1) << NAME_INDEX_BITS; //for backwards compatibility, index 0 is no index
}
rnodes.push_back(name_index);
diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h
index 2b7294141a..1eaa007bd7 100644
--- a/scene/resources/primitive_meshes.h
+++ b/scene/resources/primitive_meshes.h
@@ -39,7 +39,7 @@
@author Bastiaan Olij <mux213@gmail.com>
Base class for all the classes in this file, handles a number of code functions that are shared among all meshes.
- This class is set appart that it assumes a single surface is always generated for our mesh.
+ This class is set apart that it assumes a single surface is always generated for our mesh.
*/
class PrimitiveMesh : public Mesh {
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index 71a691fe27..0faa0dc770 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -1411,7 +1411,7 @@ void ResourceFormatSaverTextInstance::_find_resources(const Variant &p_variant,
I = I->next();
}
- resource_set.insert(res); //saved after, so the childs it needs are available when loaded
+ resource_set.insert(res); //saved after, so the children it needs are available when loaded
saved_resources.push_back(res);
} break;
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 800710ed2a..3138d73caf 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -212,7 +212,7 @@ bool TileSet::_get(const StringName &p_name, Variant &r_ret) const {
Vector3 v;
for (Map<Vector2, int>::Element *E = tile_map[id].autotile_data.priority_map.front(); E; E = E->next()) {
if (E->value() > 1) {
- //Dont save default value
+ //Don't save default value
v.x = E->key().x;
v.y = E->key().y;
v.z = E->value();