summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/image.cpp24
-rw-r--r--core/image.h1
-rw-r--r--core/ring_buffer.h17
-rw-r--r--doc/classes/Node2D.xml2
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp13
-rw-r--r--editor/editor_about.cpp3
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h4
-rwxr-xr-xmisc/dist/osx_tools.app/Contents/Info.plist4
-rw-r--r--platform/android/SCsub2
-rw-r--r--platform/android/build.gradle.template4
-rw-r--r--platform/android/java/gradle/wrapper/gradle-wrapper.properties2
-rw-r--r--scene/2d/collision_polygon_2d.cpp2
-rw-r--r--scene/2d/collision_shape_2d.cpp2
-rw-r--r--scene/2d/node_2d.cpp22
-rw-r--r--scene/2d/node_2d.h6
-rw-r--r--scene/2d/tile_map.cpp2
-rw-r--r--scene/3d/skeleton.cpp4
-rw-r--r--scene/gui/text_edit.cpp12
-rw-r--r--servers/visual/visual_server_canvas.cpp8
-rw-r--r--servers/visual/visual_server_canvas.h6
-rw-r--r--servers/visual/visual_server_raster.h2
-rw-r--r--servers/visual/visual_server_wrap_mt.cpp1
-rw-r--r--servers/visual/visual_server_wrap_mt.h3
-rw-r--r--servers/visual_server.cpp2
-rw-r--r--servers/visual_server.h2
26 files changed, 64 insertions, 88 deletions
diff --git a/core/image.cpp b/core/image.cpp
index 2f2d7efd7c..11429b8782 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -47,7 +47,6 @@ const char *Image::format_names[Image::FORMAT_MAX] = {
"RGBA8",
"RGBA4444",
"RGBA5551",
- "RGB10A2",
"RFloat", //float
"RGFloat",
"RGBFloat",
@@ -113,7 +112,6 @@ int Image::get_format_pixel_size(Format p_format) {
case FORMAT_RGBA8: return 4;
case FORMAT_RGBA4444: return 2;
case FORMAT_RGBA5551: return 2;
- case FORMAT_RGB10A2: return 4;
case FORMAT_RF:
return 4; //float
case FORMAT_RGF: return 8;
@@ -1980,15 +1978,6 @@ Color Image::get_pixel(int p_x, int p_y) const {
float a = ((u >> 15) & 0x1) / 1.0;
return Color(r, g, b, a);
} break;
- case FORMAT_RGB10A2: {
-
- uint32_t u = ((uint32_t *)ptr)[ofs];
- float r = (u & 0x3FF) / 1023.0;
- float g = ((u >> 10) & 0x3FF) / 1023.0;
- float b = ((u >> 20) & 0x3FF) / 1023.0;
- float a = ((u >> 30) & 0x3) / 3.0;
- return Color(r, g, b, a);
- } break;
case FORMAT_RF: {
float r = ((float *)ptr)[ofs];
@@ -2134,18 +2123,6 @@ void Image::set_pixel(int p_x, int p_y, const Color &p_color) {
((uint16_t *)ptr)[ofs] = rgba;
} break;
- case FORMAT_RGB10A2: {
-
- uint32_t rgba = 0;
-
- rgba = uint32_t(CLAMP(p_color.r * 1023.0, 0, 1023));
- rgba |= uint32_t(CLAMP(p_color.g * 1023.0, 0, 1023)) << 10;
- rgba |= uint32_t(CLAMP(p_color.b * 1023.0, 0, 1023)) << 20;
- rgba |= uint32_t(CLAMP(p_color.a * 3.0, 0, 3)) << 30;
-
- ((uint32_t *)ptr)[ofs] = rgba;
-
- } break;
case FORMAT_RF: {
((float *)ptr)[ofs] = p_color.r;
@@ -2323,7 +2300,6 @@ void Image::_bind_methods() {
BIND_ENUM_CONSTANT(FORMAT_RGBA8);
BIND_ENUM_CONSTANT(FORMAT_RGBA4444);
BIND_ENUM_CONSTANT(FORMAT_RGBA5551);
- BIND_ENUM_CONSTANT(FORMAT_RGB10A2);
BIND_ENUM_CONSTANT(FORMAT_RF); //float
BIND_ENUM_CONSTANT(FORMAT_RGF);
BIND_ENUM_CONSTANT(FORMAT_RGBF);
diff --git a/core/image.h b/core/image.h
index efb62a6a29..767f3c6ac5 100644
--- a/core/image.h
+++ b/core/image.h
@@ -68,7 +68,6 @@ public:
FORMAT_RGBA8,
FORMAT_RGBA4444,
FORMAT_RGBA5551,
- FORMAT_RGB10A2,
FORMAT_RF, //float
FORMAT_RGF,
FORMAT_RGBF,
diff --git a/core/ring_buffer.h b/core/ring_buffer.h
index 4b4a7fe9cf..c8562a0570 100644
--- a/core/ring_buffer.h
+++ b/core/ring_buffer.h
@@ -40,7 +40,7 @@ class RingBuffer {
int write_pos;
int size_mask;
- inline int inc(int &p_var, int p_size) {
+ inline int inc(int &p_var, int p_size) const {
int ret = p_var;
p_var += p_size;
p_var = p_var & size_mask;
@@ -50,7 +50,7 @@ class RingBuffer {
public:
T read() {
ERR_FAIL_COND_V(space_left() < 1, T());
- return data[inc(read_pos, 1)];
+ return data.ptr()[inc(read_pos, 1)];
};
int read(T *p_buf, int p_size, bool p_advance = true) {
@@ -63,8 +63,9 @@ public:
int end = pos + to_read;
end = MIN(end, size());
int total = end - pos;
+ const T *read = data.ptr();
for (int i = 0; i < total; i++) {
- p_buf[dst++] = data[pos + i];
+ p_buf[dst++] = read[pos + i];
};
to_read -= total;
pos = 0;
@@ -75,7 +76,7 @@ public:
return p_size;
};
- int copy(T *p_buf, int p_offset, int p_size) {
+ int copy(T *p_buf, int p_offset, int p_size) const {
int left = data_left();
if ((p_offset + p_size) > left) {
@@ -101,7 +102,7 @@ public:
return p_size;
};
- int find(const T &t, int p_offset, int p_max_size) {
+ int find(const T &t, int p_offset, int p_max_size) const {
int left = data_left();
if ((p_offset + p_max_size) > left) {
@@ -164,7 +165,7 @@ public:
return p_size;
};
- inline int space_left() {
+ inline int space_left() const {
int left = read_pos - write_pos;
if (left < 0) {
return size() + left - 1;
@@ -174,11 +175,11 @@ public:
};
return left - 1;
};
- inline int data_left() {
+ inline int data_left() const {
return size() - space_left() - 1;
};
- inline int size() {
+ inline int size() const {
return data.size();
};
diff --git a/doc/classes/Node2D.xml b/doc/classes/Node2D.xml
index 81978809d7..ae2a67312e 100644
--- a/doc/classes/Node2D.xml
+++ b/doc/classes/Node2D.xml
@@ -157,7 +157,7 @@
<member name="transform" type="Transform2D" setter="set_transform" getter="get_transform">
Local [Transform2D].
</member>
- <member name="z" type="int" setter="set_z" getter="get_z">
+ <member name="z_index" type="int" setter="set_z_index" getter="get_z_index">
Z-index. Controls the order in which the nodes render. A node with a higher Z-index will display in front of others.
</member>
<member name="z_as_relative" type="bool" setter="set_z_as_relative" getter="is_z_relative">
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 365840b2d8..d35d624589 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -193,13 +193,6 @@ Ref<Image> RasterizerStorageGLES3::_get_gl_image_and_format(const Ref<Image> &p_
r_gl_type = GL_UNSIGNED_SHORT_5_5_5_1;
} break;
- case Image::FORMAT_RGB10A2: {
-
- r_gl_internal_format = GL_RGB10_A2;
- r_gl_format = GL_RGBA;
- r_gl_type = GL_UNSIGNED_INT_2_10_10_10_REV;
-
- } break;
case Image::FORMAT_RF: {
r_gl_internal_format = GL_R32F;
@@ -6097,7 +6090,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
color_internal_format = GL_RGB10_A2;
color_format = GL_RGBA;
color_type = GL_UNSIGNED_INT_2_10_10_10_REV;
- image_format = Image::FORMAT_RGB10A2;
+ image_format = Image::FORMAT_RGBA8;
} else {
color_internal_format = GL_RGBA8;
@@ -6950,6 +6943,10 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
glDeleteTextures(1, &cls->distance);
canvas_light_shadow_owner.free(p_rid);
memdelete(cls);
+ } else if (particles_owner.owns(p_rid)) {
+ Particles *particles = particles_owner.get(p_rid);
+ particles_owner.free(p_rid);
+ memdelete(particles);
} else {
return false;
}
diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp
index 1d6d933924..7fa4776141 100644
--- a/editor/editor_about.cpp
+++ b/editor/editor_about.cpp
@@ -131,7 +131,8 @@ EditorAbout::EditorAbout() {
Label *about_text = memnew(Label);
about_text->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
- about_text->set_text(VERSION_FULL_NAME + hash + String::utf8("\n\xc2\xa9 2007-2018 Juan Linietsky, Ariel Manzur.\n\xc2\xa9 2014-2017 ") +
+ about_text->set_text(VERSION_FULL_NAME + hash +
+ String::utf8("\n\xc2\xa9 2007-2018 Juan Linietsky, Ariel Manzur.\n\xc2\xa9 2014-2018 ") +
TTR("Godot Engine contributors") + "\n");
hbc->add_child(about_text);
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index 052817f40a..a52c914096 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -641,7 +641,7 @@ void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_no
_SelectResult res;
res.item = c;
- res.z = node ? node->get_z() : 0;
+ res.z_index = node ? node->get_z_index() : 0;
res.has_z = node;
r_items.push_back(res);
}
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index f14f1a92a6..0866fe77aa 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -252,10 +252,10 @@ class CanvasItemEditor : public VBoxContainer {
struct _SelectResult {
CanvasItem *item;
- float z;
+ float z_index;
bool has_z;
_FORCE_INLINE_ bool operator<(const _SelectResult &p_rr) const {
- return has_z && p_rr.has_z ? p_rr.z < z : p_rr.has_z;
+ return has_z && p_rr.has_z ? p_rr.z_index < z_index : p_rr.has_z;
}
};
diff --git a/misc/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist
index 2a4914ec75..895eda14db 100755
--- a/misc/dist/osx_tools.app/Contents/Info.plist
+++ b/misc/dist/osx_tools.app/Contents/Info.plist
@@ -9,7 +9,7 @@
<key>CFBundleName</key>
<string>Godot</string>
<key>CFBundleGetInfoString</key>
- <string>(c) 2007-2018 Juan Linietsky, Ariel Manzur./string>
+ <string>(c) 2007-2018 Juan Linietsky, Ariel Manzur.</string>
<key>CFBundleIconFile</key>
<string>Godot.icns</string>
<key>CFBundleIdentifier</key>
@@ -25,7 +25,7 @@
<key>CFBundleVersion</key>
<string>3.0-dev</string>
<key>NSHumanReadableCopyright</key>
- <string>© 2007-2018 Juan Linietsky, Ariel Manzur./string>
+ <string>© 2007-2018 Juan Linietsky, Ariel Manzur.</string>
<key>LSMinimumSystemVersion</key>
<string>10.9.0</string>
<key>LSMinimumSystemVersionByArchitecture</key>
diff --git a/platform/android/SCsub b/platform/android/SCsub
index 0cd91276ef..d2285a82dd 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -104,7 +104,7 @@ gradle_asset_dirs_text = ""
gradle_default_config_text = ""
minSdk = 18
-targetSdk = 23
+targetSdk = 27
for x in env.android_default_config:
if x.startswith("minSdkVersion") and int(x.split(" ")[-1]) < minSdk:
diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template
index 4a44d1c5f9..13b4d3b6c7 100644
--- a/platform/android/build.gradle.template
+++ b/platform/android/build.gradle.template
@@ -31,8 +31,8 @@ android {
disable 'MissingTranslation'
}
- compileSdkVersion 26
- buildToolsVersion "26.0.1"
+ compileSdkVersion 27
+ buildToolsVersion "27.0.3"
useLibrary 'org.apache.http.legacy'
packagingOptions {
diff --git a/platform/android/java/gradle/wrapper/gradle-wrapper.properties b/platform/android/java/gradle/wrapper/gradle-wrapper.properties
index ee6901c9d7..fe37fa74a9 100644
--- a/platform/android/java/gradle/wrapper/gradle-wrapper.properties
+++ b/platform/android/java/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp
index e46bf3c77d..8c6b25f296 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -131,7 +131,7 @@ void CollisionPolygon2D::_notification(int p_what) {
/*if (Engine::get_singleton()->is_editor_hint()) {
//display above all else
set_z_as_relative(false);
- set_z(VS::CANVAS_ITEM_Z_MAX - 1);
+ set_z_index(VS::CANVAS_ITEM_Z_MAX - 1);
}*/
} break;
diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp
index 135ede829d..1956e23421 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -64,7 +64,7 @@ void CollisionShape2D::_notification(int p_what) {
/*if (Engine::get_singleton()->is_editor_hint()) {
//display above all else
set_z_as_relative(false);
- set_z(VS::CANVAS_ITEM_Z_MAX - 1);
+ set_z_index(VS::CANVAS_ITEM_Z_MAX - 1);
}*/
} break;
diff --git a/scene/2d/node_2d.cpp b/scene/2d/node_2d.cpp
index 2a305512af..e133f86ef7 100644
--- a/scene/2d/node_2d.cpp
+++ b/scene/2d/node_2d.cpp
@@ -329,13 +329,13 @@ void Node2D::set_global_transform(const Transform2D &p_transform) {
set_transform(p_transform);
}
-void Node2D::set_z(int p_z) {
+void Node2D::set_z_index(int p_z) {
ERR_FAIL_COND(p_z < VS::CANVAS_ITEM_Z_MIN);
ERR_FAIL_COND(p_z > VS::CANVAS_ITEM_Z_MAX);
- z = p_z;
- VS::get_singleton()->canvas_item_set_z(get_canvas_item(), z);
- _change_notify("z");
+ z_index = p_z;
+ VS::get_singleton()->canvas_item_set_z_index(get_canvas_item(), z_index);
+ _change_notify("z_index");
}
void Node2D::set_z_as_relative(bool p_enabled) {
@@ -351,9 +351,9 @@ bool Node2D::is_z_relative() const {
return z_relative;
}
-int Node2D::get_z() const {
+int Node2D::get_z_index() const {
- return z;
+ return z_index;
}
Transform2D Node2D::get_relative_transform_to_parent(const Node *p_parent) const {
@@ -427,8 +427,8 @@ void Node2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("to_local", "global_point"), &Node2D::to_local);
ClassDB::bind_method(D_METHOD("to_global", "local_point"), &Node2D::to_global);
- ClassDB::bind_method(D_METHOD("set_z", "z"), &Node2D::set_z);
- ClassDB::bind_method(D_METHOD("get_z"), &Node2D::get_z);
+ ClassDB::bind_method(D_METHOD("set_z_index", "z_index"), &Node2D::set_z_index);
+ ClassDB::bind_method(D_METHOD("get_z_index"), &Node2D::get_z_index);
ClassDB::bind_method(D_METHOD("set_z_as_relative", "enable"), &Node2D::set_z_as_relative);
ClassDB::bind_method(D_METHOD("is_z_relative"), &Node2D::is_z_relative);
@@ -448,8 +448,8 @@ void Node2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "global_scale", PROPERTY_HINT_NONE, "", 0), "set_global_scale", "get_global_scale");
ADD_PROPERTY(PropertyInfo(Variant::TRANSFORM2D, "global_transform", PROPERTY_HINT_NONE, "", 0), "set_global_transform", "get_global_transform");
- ADD_GROUP("Z", "");
- ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "z", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z", "get_z");
+ ADD_GROUP("Z Index", "");
+ ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"), "set_z_index", "get_z_index");
ADD_PROPERTYNO(PropertyInfo(Variant::BOOL, "z_as_relative"), "set_z_as_relative", "is_z_relative");
}
@@ -458,6 +458,6 @@ Node2D::Node2D() {
angle = 0;
_scale = Vector2(1, 1);
_xform_dirty = false;
- z = 0;
+ z_index = 0;
z_relative = true;
}
diff --git a/scene/2d/node_2d.h b/scene/2d/node_2d.h
index 7d2e5aa00c..321021a748 100644
--- a/scene/2d/node_2d.h
+++ b/scene/2d/node_2d.h
@@ -39,7 +39,7 @@ class Node2D : public CanvasItem {
Point2 pos;
float angle;
Size2 _scale;
- int z;
+ int z_index;
bool z_relative;
Transform2D _mat;
@@ -96,8 +96,8 @@ public:
void set_global_rotation_degrees(float p_degrees);
void set_global_scale(const Size2 &p_scale);
- void set_z(int p_z);
- int get_z() const;
+ void set_z_index(int p_z);
+ int get_z_index() const;
void look_at(const Vector2 &p_pos);
float get_angle_to(const Vector2 &p_pos) const;
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 73fce4be75..8bd5676bc7 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -336,7 +336,7 @@ void TileMap::_update_dirty_quadrants() {
debug_canvas_item = vs->canvas_item_create();
vs->canvas_item_set_parent(debug_canvas_item, canvas_item);
vs->canvas_item_set_z_as_relative_to_parent(debug_canvas_item, false);
- vs->canvas_item_set_z(debug_canvas_item, VS::CANVAS_ITEM_Z_MAX - 1);
+ vs->canvas_item_set_z_index(debug_canvas_item, VS::CANVAS_ITEM_Z_MAX - 1);
q.canvas_items.push_back(debug_canvas_item);
prev_debug_canvas_item = debug_canvas_item;
}
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index ef60a2151d..aaa378bb68 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -160,14 +160,14 @@ void Skeleton::_notification(int p_what) {
//if moved, just update transforms
VisualServer *vs = VisualServer::get_singleton();
- Bone *bonesptr = &bones[0];
+ const Bone *bonesptr = bones.ptr();
int len = bones.size();
Transform global_transform = get_global_transform();
Transform global_transform_inverse = global_transform.affine_inverse();
for (int i = 0; i < len; i++) {
- Bone &b = bonesptr[i];
+ const Bone &b = bonesptr[i];
vs->skeleton_bone_set_transform(skeleton, i, global_transform * (b.transform_final * global_transform_inverse));
}
} break;
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 5fbc0c9064..9247fc943b 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1498,7 +1498,7 @@ void TextEdit::_notification(int p_what) {
if (OS::get_singleton()->has_virtual_keyboard())
OS::get_singleton()->show_virtual_keyboard(get_text(), get_global_rect());
if (raised_from_completion) {
- VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 1);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 1);
}
} break;
@@ -1512,7 +1512,7 @@ void TextEdit::_notification(int p_what) {
if (OS::get_singleton()->has_virtual_keyboard())
OS::get_singleton()->hide_virtual_keyboard();
if (raised_from_completion) {
- VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 0);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 0);
}
} break;
}
@@ -5054,7 +5054,7 @@ void TextEdit::_confirm_completion() {
void TextEdit::_cancel_code_hint() {
- VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 0);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 0);
raised_from_completion = false;
completion_hint = "";
update();
@@ -5062,7 +5062,7 @@ void TextEdit::_cancel_code_hint() {
void TextEdit::_cancel_completion() {
- VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 0);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 0);
raised_from_completion = false;
if (!completion_active)
return;
@@ -5237,7 +5237,7 @@ void TextEdit::query_code_comple() {
void TextEdit::set_code_hint(const String &p_hint) {
- VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 1);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 1);
raised_from_completion = true;
completion_hint = p_hint;
completion_hint_offset = -0xFFFF;
@@ -5246,7 +5246,7 @@ void TextEdit::set_code_hint(const String &p_hint) {
void TextEdit::code_complete(const Vector<String> &p_strings, bool p_forced) {
- VisualServer::get_singleton()->canvas_item_set_z(get_canvas_item(), 1);
+ VisualServer::get_singleton()->canvas_item_set_z_index(get_canvas_item(), 1);
raised_from_completion = true;
completion_strings = p_strings;
completion_active = true;
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp
index 60530e48e2..b163402a07 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/visual/visual_server_canvas.cpp
@@ -102,9 +102,9 @@ void VisualServerCanvas::_render_canvas_item(Item *p_canvas_item, const Transfor
}
if (ci->z_relative)
- p_z = CLAMP(p_z + ci->z, VS::CANVAS_ITEM_Z_MIN, VS::CANVAS_ITEM_Z_MAX);
+ p_z = CLAMP(p_z + ci->z_index, VS::CANVAS_ITEM_Z_MIN, VS::CANVAS_ITEM_Z_MAX);
else
- p_z = ci->z;
+ p_z = ci->z_index;
for (int i = 0; i < child_item_count; i++) {
@@ -805,14 +805,14 @@ void VisualServerCanvas::canvas_item_set_sort_children_by_y(RID p_item, bool p_e
canvas_item->sort_y = p_enable;
}
-void VisualServerCanvas::canvas_item_set_z(RID p_item, int p_z) {
+void VisualServerCanvas::canvas_item_set_z_index(RID p_item, int p_z) {
ERR_FAIL_COND(p_z < VS::CANVAS_ITEM_Z_MIN || p_z > VS::CANVAS_ITEM_Z_MAX);
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
- canvas_item->z = p_z;
+ canvas_item->z_index = p_z;
}
void VisualServerCanvas::canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable) {
diff --git a/servers/visual/visual_server_canvas.h b/servers/visual/visual_server_canvas.h
index b86dd0316c..320fc2fb0b 100644
--- a/servers/visual/visual_server_canvas.h
+++ b/servers/visual/visual_server_canvas.h
@@ -39,7 +39,7 @@ public:
RID parent; // canvas it belongs to
List<Item *>::Element *E;
- int z;
+ int z_index;
bool z_relative;
bool sort_y;
Color modulate;
@@ -53,7 +53,7 @@ public:
Item() {
children_order_dirty = true;
E = NULL;
- z = 0;
+ z_index = 0;
modulate = Color(1, 1, 1, 1);
self_modulate = Color(1, 1, 1, 1);
sort_y = false;
@@ -187,7 +187,7 @@ public:
void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform);
void canvas_item_add_clip_ignore(RID p_item, bool p_ignore);
void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable);
- void canvas_item_set_z(RID p_item, int p_z);
+ void canvas_item_set_z_index(RID p_item, int p_z);
void canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable);
void canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable, const Rect2 &p_rect);
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 95d7269d7a..864ae81140 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -586,7 +586,7 @@ public:
BIND2(canvas_item_add_set_transform, RID, const Transform2D &)
BIND2(canvas_item_add_clip_ignore, RID, bool)
BIND2(canvas_item_set_sort_children_by_y, RID, bool)
- BIND2(canvas_item_set_z, RID, int)
+ BIND2(canvas_item_set_z_index, RID, int)
BIND2(canvas_item_set_z_as_relative_to_parent, RID, bool)
BIND3(canvas_item_set_copy_to_backbuffer, RID, bool, const Rect2 &)
diff --git a/servers/visual/visual_server_wrap_mt.cpp b/servers/visual/visual_server_wrap_mt.cpp
index a8422b805e..67b83b7618 100644
--- a/servers/visual/visual_server_wrap_mt.cpp
+++ b/servers/visual/visual_server_wrap_mt.cpp
@@ -6,6 +6,7 @@
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index 4062f91438..276e445f4d 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -6,6 +6,7 @@
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -503,7 +504,7 @@ public:
FUNC2(canvas_item_add_set_transform, RID, const Transform2D &)
FUNC2(canvas_item_add_clip_ignore, RID, bool)
FUNC2(canvas_item_set_sort_children_by_y, RID, bool)
- FUNC2(canvas_item_set_z, RID, int)
+ FUNC2(canvas_item_set_z_index, RID, int)
FUNC2(canvas_item_set_z_as_relative_to_parent, RID, bool)
FUNC3(canvas_item_set_copy_to_backbuffer, RID, bool, const Rect2 &)
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index b4949b6093..bf6d425fb9 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -1611,7 +1611,7 @@ void VisualServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("canvas_item_add_set_transform", "item", "transform"), &VisualServer::canvas_item_add_set_transform);
ClassDB::bind_method(D_METHOD("canvas_item_add_clip_ignore", "item", "ignore"), &VisualServer::canvas_item_add_clip_ignore);
ClassDB::bind_method(D_METHOD("canvas_item_set_sort_children_by_y", "item", "enabled"), &VisualServer::canvas_item_set_sort_children_by_y);
- ClassDB::bind_method(D_METHOD("canvas_item_set_z", "item", "z"), &VisualServer::canvas_item_set_z);
+ ClassDB::bind_method(D_METHOD("canvas_item_set_z_index", "item", "z_index"), &VisualServer::canvas_item_set_z_index);
ClassDB::bind_method(D_METHOD("canvas_item_set_z_as_relative_to_parent", "item", "enabled"), &VisualServer::canvas_item_set_z_as_relative_to_parent);
ClassDB::bind_method(D_METHOD("canvas_item_set_copy_to_backbuffer", "item", "enabled", "rect"), &VisualServer::canvas_item_set_copy_to_backbuffer);
ClassDB::bind_method(D_METHOD("canvas_item_clear", "item"), &VisualServer::canvas_item_clear);
diff --git a/servers/visual_server.h b/servers/visual_server.h
index e1def0b713..eb2c56cd3a 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -847,7 +847,7 @@ public:
virtual void canvas_item_add_set_transform(RID p_item, const Transform2D &p_transform) = 0;
virtual void canvas_item_add_clip_ignore(RID p_item, bool p_ignore) = 0;
virtual void canvas_item_set_sort_children_by_y(RID p_item, bool p_enable) = 0;
- virtual void canvas_item_set_z(RID p_item, int p_z) = 0;
+ virtual void canvas_item_set_z_index(RID p_item, int p_z) = 0;
virtual void canvas_item_set_z_as_relative_to_parent(RID p_item, bool p_enable) = 0;
virtual void canvas_item_set_copy_to_backbuffer(RID p_item, bool p_enable, const Rect2 &p_rect) = 0;