diff options
Diffstat (limited to 'modules/gridmap/grid_map_editor_plugin.cpp')
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 28d301ada1..2144ff264f 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -925,7 +925,7 @@ void GridMapEditor::update_palette() { for (List<_CGMEItemSort>::Element *E = il.front(); E; E = E->next()) { int id = E->get().id; String name = mesh_library->get_item_name(id); - Ref<Texture> preview = mesh_library->get_item_preview(id); + Ref<Texture2D> preview = mesh_library->get_item_preview(id); if (name == "") { name = "#" + itos(id); @@ -1022,8 +1022,7 @@ void GridMapEditor::_draw_grids(const Vector3 &cell_size) { Vector3 edited_floor = node->has_meta("_editor_floor_") ? node->get_meta("_editor_floor_") : Variant(); for (int i = 0; i < 3; i++) { - if (VS::get_singleton()->mesh_get_surface_count(grid[i]) > 0) - VS::get_singleton()->mesh_remove_surface(grid[i], 0); + VS::get_singleton()->mesh_clear(grid[i]); edit_floor[i] = edited_floor[i]; } @@ -1447,8 +1446,8 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { inner_mat.instance(); inner_mat->set_albedo(Color(0.7, 0.7, 1.0, 0.2)); - inner_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - inner_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); + inner_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); + inner_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA); d[VS::ARRAY_VERTEX] = triangles; VisualServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh, VS::PRIMITIVE_TRIANGLES, d); @@ -1457,15 +1456,14 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { outer_mat.instance(); outer_mat->set_albedo(Color(0.7, 0.7, 1.0, 0.8)); outer_mat->set_on_top_of_alpha(); - outer_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - outer_mat->set_line_width(3.0); - outer_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); + + outer_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); + outer_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA); selection_floor_mat.instance(); selection_floor_mat->set_albedo(Color(0.80, 0.80, 1.0, 1)); selection_floor_mat->set_on_top_of_alpha(); - selection_floor_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - selection_floor_mat->set_line_width(3.0); + selection_floor_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); d[VS::ARRAY_VERTEX] = lines; VisualServer::get_singleton()->mesh_add_surface_from_arrays(selection_mesh, VS::PRIMITIVE_LINES, d); @@ -1492,10 +1490,10 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) { accumulated_floor_delta = 0.0; indicator_mat.instance(); - indicator_mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true); - indicator_mat->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true); - indicator_mat->set_flag(SpatialMaterial::FLAG_SRGB_VERTEX_COLOR, true); - indicator_mat->set_flag(SpatialMaterial::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); + indicator_mat->set_shading_mode(StandardMaterial3D::SHADING_MODE_UNSHADED); + indicator_mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA); + indicator_mat->set_flag(StandardMaterial3D::FLAG_SRGB_VERTEX_COLOR, true); + indicator_mat->set_flag(StandardMaterial3D::FLAG_ALBEDO_FROM_VERTEX_COLOR, true); indicator_mat->set_albedo(Color(0.8, 0.5, 0.1)); } |