diff options
-rw-r--r-- | .appveyor.yml | 2 | ||||
-rw-r--r-- | drivers/gles2/rasterizer_canvas_gles2.cpp | 7 | ||||
-rw-r--r-- | editor/plugins/editor_preview_plugins.cpp | 3 | ||||
-rw-r--r-- | editor/scene_tree_dock.cpp | 13 | ||||
-rwxr-xr-x | misc/dist/osx_tools.app/Contents/Info.plist | 4 | ||||
-rw-r--r-- | scene/2d/line_builder.cpp | 4 | ||||
-rw-r--r-- | scene/gui/graph_edit.cpp | 10 | ||||
-rw-r--r-- | scene/resources/texture.cpp | 11 | ||||
-rw-r--r-- | scene/resources/texture.h | 1 |
9 files changed, 46 insertions, 9 deletions
diff --git a/.appveyor.yml b/.appveyor.yml index 567da9cd5d..bd4a7b0ca8 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -18,7 +18,7 @@ cache: install: - SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - pip install -U wheel # needed for pip install scons to work, otherwise a flag is missing - - pip install scons + - pip install scons==3.0.1 - if defined VS call "%VS%" %ARCH% # if defined - so we can also use mingw before_build: diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp index 375c555d9e..e3d4884a5a 100644 --- a/drivers/gles2/rasterizer_canvas_gles2.cpp +++ b/drivers/gles2/rasterizer_canvas_gles2.cpp @@ -465,12 +465,11 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur state.canvas_shader.use_material((void *)p_material); } - Size2 abs_size = r->rect.size.abs(); Vector2 points[4] = { r->rect.position, - r->rect.position + Vector2(abs_size.x, 0.0), - r->rect.position + abs_size, - r->rect.position + Vector2(0.0, abs_size.y), + r->rect.position + Vector2(r->rect.size.x, 0.0), + r->rect.position + r->rect.size, + r->rect.position + Vector2(0.0, r->rect.size.y), }; if (r->rect.size.x < 0) { diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp index ccaddbc0a8..8464dfd0aa 100644 --- a/editor/plugins/editor_preview_plugins.cpp +++ b/editor/plugins/editor_preview_plugins.cpp @@ -86,6 +86,7 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2 Ref<Image> img; Ref<AtlasTexture> atex = p_from; + Ref<LargeTexture> ltex = p_from; if (atex.is_valid()) { Ref<Texture> tex = atex->get_atlas(); if (!tex.is_valid()) { @@ -93,6 +94,8 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2 } Ref<Image> atlas = tex->get_data(); img = atlas->get_rect(atex->get_region()); + } else if (ltex.is_valid()) { + img = ltex->to_image(); } else { Ref<Texture> tex = p_from; img = tex->get_data(); diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index a31fa9426a..6c79fad82c 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -1615,7 +1615,10 @@ void SceneTreeDock::_delete_confirm() { } void SceneTreeDock::_update_script_button() { - if (EditorNode::get_singleton()->get_editor_selection()->get_selection().size() == 1) { + if (EditorNode::get_singleton()->get_editor_selection()->get_selection().size() == 0) { + button_create_script->hide(); + button_clear_script->hide(); + } else if (EditorNode::get_singleton()->get_editor_selection()->get_selection().size() == 1) { Node *n = EditorNode::get_singleton()->get_editor_selection()->get_selected_node_list()[0]; if (n->get_script().is_null()) { button_create_script->show(); @@ -1626,6 +1629,14 @@ void SceneTreeDock::_update_script_button() { } } else { button_create_script->show(); + List<Node *> selection = EditorNode::get_singleton()->get_editor_selection()->get_selected_node_list(); + for (List<Node *>::Element *E = selection.front(); E; E = E->next()) { + Node *n = E->get(); + if (!n->get_script().is_null()) { + button_clear_script->show(); + return; + } + } button_clear_script->hide(); } } diff --git a/misc/dist/osx_tools.app/Contents/Info.plist b/misc/dist/osx_tools.app/Contents/Info.plist index ce394c33c8..97d769c824 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-2019 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> + <string>(c) 2007-2019 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> <key>CFBundleIconFile</key> <string>Godot.icns</string> <key>CFBundleIdentifier</key> @@ -25,7 +25,7 @@ <key>CFBundleVersion</key> <string>3.0</string> <key>NSHumanReadableCopyright</key> - <string>© 2007-2019 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> + <string>© 2007-2019 Juan Linietsky, Ariel Manzur & Godot Engine contributors</string> <key>LSMinimumSystemVersion</key> <string>10.9.0</string> <key>LSMinimumSystemVersionByArchitecture</key> diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp index 18302dcce1..eb09d3c9d3 100644 --- a/scene/2d/line_builder.cpp +++ b/scene/2d/line_builder.cpp @@ -279,6 +279,10 @@ void LineBuilder::build() { } } else { // No intersection: fallback + if (current_joint_mode == Line2D::LINE_JOINT_SHARP) { + // There is no fallback implementation for LINE_JOINT_SHARP so switch to the LINE_JOINT_BEVEL + current_joint_mode = Line2D::LINE_JOINT_BEVEL; + } pos_up1 = corner_pos_up; pos_down1 = corner_pos_down; } diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index b4e4f7125d..94c65b3e64 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -34,6 +34,10 @@ #include "core/os/keyboard.h" #include "scene/gui/box_container.h" +#ifdef TOOLS_ENABLED +#include "editor/editor_scale.h" +#endif + #define ZOOM_SCALE 1.2 #define MIN_ZOOM (((1 / ZOOM_SCALE) / ZOOM_SCALE) / ZOOM_SCALE) @@ -665,11 +669,15 @@ void GraphEdit::_draw_cos_line(CanvasItem *p_where, const Vector2 &p_from, const Vector<Color> colors; points.push_back(p_from); colors.push_back(p_color); - _bake_segment2d(points, colors, 0, 1, p_from, c1, p_to, c2, 0, 3, 9, 8, p_color, p_to_color, lines); + _bake_segment2d(points, colors, 0, 1, p_from, c1, p_to, c2, 0, 3, 9, 3, p_color, p_to_color, lines); points.push_back(p_to); colors.push_back(p_to_color); +#ifdef TOOLS_ENABLED + p_where->draw_polyline_colors(points, colors, Math::floor(2 * EDSCALE), true); +#else p_where->draw_polyline_colors(points, colors, 2, true); +#endif } void GraphEdit::_connections_layer_draw() { diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index ad962a3551..2e0f04ffcb 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -1205,6 +1205,17 @@ Ref<Texture> LargeTexture::get_piece_texture(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, pieces.size(), Ref<Texture>()); return pieces[p_idx].texture; } +Ref<Image> LargeTexture::to_image() const { + + Ref<Image> img = memnew(Image(this->get_width(), this->get_height(), false, Image::FORMAT_RGBA8)); + for (int i = 0; i < pieces.size(); i++) { + + Ref<Image> src_img = pieces[i].texture->get_data(); + img->blit_rect(src_img, Rect2(0, 0, src_img->get_width(), src_img->get_height()), pieces[i].offset); + } + + return img; +} void LargeTexture::_bind_methods() { diff --git a/scene/resources/texture.h b/scene/resources/texture.h index cf23aad239..2b67ebec62 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -330,6 +330,7 @@ public: int get_piece_count() const; Vector2 get_piece_offset(int p_idx) const; Ref<Texture> get_piece_texture(int p_idx) const; + Ref<Image> to_image() const; virtual void draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const; virtual void draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile = false, const Color &p_modulate = Color(1, 1, 1), bool p_transpose = false, const Ref<Texture> &p_normal_map = Ref<Texture>()) const; |