diff options
Diffstat (limited to 'servers')
-rw-r--r-- | servers/audio_server.cpp | 1 | ||||
-rw-r--r-- | servers/visual/shader_language.cpp | 6 | ||||
-rw-r--r-- | servers/visual/visual_server_canvas.cpp | 8 | ||||
-rw-r--r-- | servers/visual/visual_server_canvas.h | 6 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 2 | ||||
-rw-r--r-- | servers/visual/visual_server_wrap_mt.cpp | 1 | ||||
-rw-r--r-- | servers/visual/visual_server_wrap_mt.h | 3 | ||||
-rw-r--r-- | servers/visual_server.cpp | 4 | ||||
-rw-r--r-- | servers/visual_server.h | 2 |
9 files changed, 17 insertions, 16 deletions
diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 0317fe45ae..f2198bdf2f 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -122,7 +122,6 @@ int AudioDriverManager::get_driver_count() { } void AudioDriverManager::initialize(int p_driver) { - AudioDriver *driver; int failed_driver = -1; // Check if there is a selected driver diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 1828cf8a4b..f0f93ff2a7 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -3209,8 +3209,6 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui var.precision = precision; var.line = tk_line; - p_block->variables[name] = var; - VariableDeclarationNode::Declaration decl; decl.name = name; @@ -3219,7 +3217,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui tk = _get_token(); if (tk.type == TK_OP_ASSIGN) { - //variable creted with assignment! must parse an expression + //variable created with assignment! must parse an expression Node *n = _parse_and_reduce_expression(p_block, p_builtin_types); if (!n) return ERR_PARSE_ERROR; @@ -3233,6 +3231,8 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui tk = _get_token(); } + p_block->variables[name] = var; + vardecl->declarations.push_back(decl); if (tk.type == TK_COMMA) { 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..531c6045d6 100644 --- a/servers/visual_server.cpp +++ b/servers/visual_server.cpp @@ -711,7 +711,7 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_ if (first) { for (int i = 0; i < total_bones; i++) { - r_bone_aabb[i].size == Vector3(-1, -1, -1); //negative means unused + r_bone_aabb[i].size = Vector3(-1, -1, -1); //negative means unused } } @@ -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; |