From da895e8542fcd19545287e4a99654f17c2d4c3d8 Mon Sep 17 00:00:00 2001 From: Guilherme Felipe Date: Thu, 3 Sep 2015 19:23:39 -0300 Subject: [PATCH 01/78] Fix for smoothing camera2D when you change zoom, fix #2074. --- scene/2d/camera_2d.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 49683da2265..52ae5d29547 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -57,7 +57,9 @@ void Camera2D::_update_scroll() { void Camera2D::set_zoom(const Vector2 &p_zoom) { zoom = p_zoom; + Point2 old_smoothed_camera_pos = smoothed_camera_pos; _update_scroll(); + smoothed_camera_pos = old_smoothed_camera_pos; }; Vector2 Camera2D::get_zoom() const { From abde648e6844fa328affed0f1002f56edb4ab69c Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Sun, 18 Oct 2015 13:31:44 -0300 Subject: [PATCH 02/78] Small fixes in some editor dialogs --- .../animation_player_editor_plugin.cpp | 1 + .../plugins/canvas_item_editor_plugin.cpp | 60 +++++++++++-------- tools/editor/plugins/mesh_editor_plugin.cpp | 13 ++-- .../plugins/multimesh_editor_plugin.cpp | 20 ++----- .../editor/plugins/multimesh_editor_plugin.h | 8 +-- .../editor/plugins/spatial_editor_plugin.cpp | 42 ++++--------- 6 files changed, 65 insertions(+), 79 deletions(-) diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index f8c484e8869..65565aae85c 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -1279,6 +1279,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { add_child(file); name_dialog = memnew( ConfirmationDialog ); + name_dialog->set_title("Create New Animation"); name_dialog->set_hide_on_ok(false); add_child(name_dialog); name = memnew( LineEdit ); diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index d318f6f6fac..b03eed77b1e 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -41,9 +41,9 @@ class SnapDialog : public ConfirmationDialog { OBJ_TYPE(SnapDialog,ConfirmationDialog); - -protected: - friend class CanvasItemEditor; + +friend class CanvasItemEditor; + SpinBox *grid_offset_x; SpinBox *grid_offset_y; SpinBox *grid_step_x; @@ -58,63 +58,75 @@ public: Label *label; VBoxContainer *container; GridContainer *child_container; - + set_title("Configure Snap"); get_ok()->set_text("Close"); - container = memnew(VBoxContainer); + + container = memnew( VBoxContainer ); add_child(container); - - child_container = memnew(GridContainer); + set_child_rect(container); + + child_container = memnew( GridContainer ); child_container->set_columns(3); container->add_child(child_container); - - label = memnew(Label); + + label = memnew( Label ); label->set_text("Grid Offset:"); child_container->add_child(label); - grid_offset_x=memnew(SpinBox); + label->set_h_size_flags(SIZE_EXPAND_FILL); + + grid_offset_x = memnew( SpinBox ); grid_offset_x->set_min(-SPIN_BOX_GRID_RANGE); grid_offset_x->set_max(SPIN_BOX_GRID_RANGE); grid_offset_x->set_suffix("px"); child_container->add_child(grid_offset_x); - grid_offset_y=memnew(SpinBox); + + grid_offset_y = memnew( SpinBox ); grid_offset_y->set_min(-SPIN_BOX_GRID_RANGE); grid_offset_y->set_max(SPIN_BOX_GRID_RANGE); grid_offset_y->set_suffix("px"); child_container->add_child(grid_offset_y); - label = memnew(Label); + label = memnew( Label ); label->set_text("Grid Step:"); child_container->add_child(label); - grid_step_x=memnew(SpinBox); + label->set_h_size_flags(SIZE_EXPAND_FILL); + + grid_step_x = memnew( SpinBox ); grid_step_x->set_min(-SPIN_BOX_GRID_RANGE); grid_step_x->set_max(SPIN_BOX_GRID_RANGE); grid_step_x->set_suffix("px"); child_container->add_child(grid_step_x); - grid_step_y=memnew(SpinBox); + + grid_step_y = memnew( SpinBox ); grid_step_y->set_min(-SPIN_BOX_GRID_RANGE); grid_step_y->set_max(SPIN_BOX_GRID_RANGE); grid_step_y->set_suffix("px"); child_container->add_child(grid_step_y); - - container->add_child(memnew(HSeparator)); - child_container = memnew(GridContainer); + container->add_child( memnew( HSeparator ) ); + + child_container = memnew( GridContainer ); child_container->set_columns(2); container->add_child(child_container); - label = memnew(Label); + label = memnew( Label ); label->set_text("Rotation Offset:"); child_container->add_child(label); - rotation_offset=memnew(SpinBox); + label->set_h_size_flags(SIZE_EXPAND_FILL); + + rotation_offset = memnew( SpinBox ); rotation_offset->set_min(-SPIN_BOX_ROTATION_RANGE); rotation_offset->set_max(SPIN_BOX_ROTATION_RANGE); rotation_offset->set_suffix("deg"); child_container->add_child(rotation_offset); - - label = memnew(Label); + + label = memnew( Label ); label->set_text("Rotation Step:"); child_container->add_child(label); - rotation_step=memnew(SpinBox); + label->set_h_size_flags(SIZE_EXPAND_FILL); + + rotation_step = memnew( SpinBox ); rotation_step->set_min(-SPIN_BOX_ROTATION_RANGE); rotation_step->set_max(SPIN_BOX_ROTATION_RANGE); rotation_step->set_suffix("deg"); @@ -2278,7 +2290,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { } break; case SNAP_CONFIGURE: { ((SnapDialog *)snap_dialog)->set_fields(snap_offset, snap_step, snap_rotation_offset, snap_rotation_step); - snap_dialog->popup_centered(Size2(200,160)); + snap_dialog->popup_centered(Size2(220,160)); } break; case ZOOM_IN: { zoom=zoom*(1.0/0.5); @@ -3173,7 +3185,7 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) { p->add_item("Paste Pose",ANIM_PASTE_POSE); p->add_item("Clear Pose",ANIM_CLEAR_POSE,KEY_MASK_SHIFT|KEY_K); - snap_dialog = memnew(SnapDialog); + snap_dialog = memnew( SnapDialog ); snap_dialog->connect("confirmed",this,"_snap_changed"); add_child(snap_dialog); diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/tools/editor/plugins/mesh_editor_plugin.cpp index 13d4c8db5ad..34ccf79feec 100644 --- a/tools/editor/plugins/mesh_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_editor_plugin.cpp @@ -160,7 +160,7 @@ void MeshInstanceEditor::_menu_option(int p_option) { } break; case MENU_OPTION_CREATE_OUTLINE_MESH: { - outline_dialog->popup_centered_minsize(); + outline_dialog->popup_centered(Vector2(200, 90)); } break; } @@ -231,14 +231,19 @@ MeshInstanceEditor::MeshInstanceEditor() { options->get_popup()->connect("item_pressed", this,"_menu_option"); outline_dialog = memnew( ConfirmationDialog ); - outline_dialog->set_title("Outline Size: "); + outline_dialog->set_title("Create Outline Mesh"); + + VBoxContainer *outline_dialog_vbc = memnew( VBoxContainer ); + outline_dialog->add_child(outline_dialog_vbc); + outline_dialog->set_child_rect(outline_dialog_vbc); + outline_size = memnew( SpinBox ); outline_size->set_min(0.001); outline_size->set_max(1024); outline_size->set_step(0.001); outline_size->set_val(0.05); - outline_dialog->add_child(outline_size); - outline_dialog->set_child_rect(outline_size); + outline_dialog_vbc->add_margin_child("Outline Size:",outline_size); + add_child(outline_dialog); outline_dialog->connect("confirmed",this,"_create_outline_mesh"); diff --git a/tools/editor/plugins/multimesh_editor_plugin.cpp b/tools/editor/plugins/multimesh_editor_plugin.cpp index 3c88b1d3a8a..a5c823f8bd2 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.cpp +++ b/tools/editor/plugins/multimesh_editor_plugin.cpp @@ -289,7 +289,7 @@ void MultiMeshEditor::_menu_option(int p_option) { _last_pp_node=node; } - populate_dialog->popup_centered(Size2(250,395)); + populate_dialog->popup_centered(Size2(250,380)); } break; } @@ -325,10 +325,8 @@ MultiMeshEditor::MultiMeshEditor() { options = memnew( MenuButton ); - //add_child(options); SpatialEditor::get_singleton()->add_control_to_menu_panel(options); - options->set_area_as_parent_rect(); - + options->set_text("MultiMesh"); options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MultiMeshInstance","EditorIcons")); @@ -373,12 +371,12 @@ MultiMeshEditor::MultiMeshEditor() { populate_axis->select(2); vbc->add_margin_child("Mesh Up Axis:",populate_axis); - populate_rotate_random = memnew( HScrollBar ); + populate_rotate_random = memnew( HSlider ); populate_rotate_random->set_max(1); populate_rotate_random->set_step(0.01); vbc->add_margin_child("Random Rotation:",populate_rotate_random); - populate_tilt_random = memnew( HScrollBar ); + populate_tilt_random = memnew( HSlider ); populate_tilt_random->set_max(1); populate_tilt_random->set_step(0.01); vbc->add_margin_child("Random Tilt:",populate_tilt_random); @@ -416,8 +414,7 @@ MultiMeshEditor::MultiMeshEditor() { std->connect("selected",this,"_browsed"); _last_pp_node=NULL; - //options->set_anchor(MARGIN_LEFT,Control::ANCHOR_END); - //options->set_anchor(MARGIN_RIGHT,Control::ANCHOR_END); + err_dialog = memnew( AcceptDialog ); add_child(err_dialog); } @@ -451,13 +448,6 @@ MultiMeshEditorPlugin::MultiMeshEditorPlugin(EditorNode *p_node) { multimesh_editor = memnew( MultiMeshEditor ); editor->get_viewport()->add_child(multimesh_editor); -// multimesh_editor->set_anchor(MARGIN_LEFT,Control::ANCHOR_END); -// multimesh_editor->set_anchor(MARGIN_RIGHT,Control::ANCHOR_END); - multimesh_editor->set_margin(MARGIN_LEFT,253); - multimesh_editor->set_margin(MARGIN_RIGHT,310); - multimesh_editor->set_margin(MARGIN_TOP,0); - multimesh_editor->set_margin(MARGIN_BOTTOM,10); - multimesh_editor->options->hide(); } diff --git a/tools/editor/plugins/multimesh_editor_plugin.h b/tools/editor/plugins/multimesh_editor_plugin.h index 4f0c0d008b7..edc3dfd55ff 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.h +++ b/tools/editor/plugins/multimesh_editor_plugin.h @@ -42,10 +42,10 @@ class MultiMeshEditor : public Control { OBJ_TYPE(MultiMeshEditor, Control ); - friend class MultiMeshEditorPlugin; +friend class MultiMeshEditorPlugin; AcceptDialog *err_dialog; - MenuButton * options; + MenuButton * options; MultiMeshInstance *_last_pp_node; bool browsing_source; @@ -59,8 +59,8 @@ class MultiMeshEditor : public Control { ConfirmationDialog *populate_dialog; OptionButton *populate_axis; - HScrollBar *populate_rotate_random; - HScrollBar *populate_tilt_random; + HSlider *populate_rotate_random; + HSlider *populate_tilt_random; SpinBox *populate_scale_random; SpinBox *populate_scale; SpinBox *populate_amount; diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 3ab93392650..f3458a768a8 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -2725,7 +2725,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { } break; case MENU_TRANSFORM_CONFIGURE_SNAP: { - snap_dialog->popup_centered(Size2(200,160)); + snap_dialog->popup_centered(Size2(200,180)); } break; case MENU_TRANSFORM_LOCAL_COORDS: { @@ -3793,46 +3793,24 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { snap_dialog = memnew( ConfirmationDialog ); snap_dialog->set_title("Snap Settings"); add_child(snap_dialog); - Label *l = memnew(Label); - l->set_text("Translate Snap:"); - l->set_pos(Point2(5,5)); - snap_dialog->add_child(l); + + VBoxContainer *snap_dialog_vbc = memnew( VBoxContainer ); + snap_dialog->add_child(snap_dialog_vbc); + snap_dialog->set_child_rect(snap_dialog_vbc); snap_translate = memnew( LineEdit ); - snap_translate->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - snap_translate->set_begin( Point2(15,22) ); - snap_translate->set_end( Point2(15,35) ); snap_translate->set_text("1"); - snap_dialog->add_child(snap_translate); - - l = memnew(Label); - l->set_text("Rotate Snap (deg.):"); - l->set_pos(Point2(5,45)); - snap_dialog->add_child(l); + snap_dialog_vbc->add_margin_child("Translate Snap:",snap_translate); snap_rotate = memnew( LineEdit ); - snap_rotate->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - snap_rotate->set_begin( Point2(15,62) ); - snap_rotate->set_end( Point2(15,75) ); snap_rotate->set_text("5"); - snap_dialog->add_child(snap_rotate); - - - l = memnew(Label); - l->set_text("Scale Snap (%):"); - l->set_pos(Point2(5,85)); - snap_dialog->add_child(l); + snap_dialog_vbc->add_margin_child("Rotate Snap (deg.):",snap_rotate); snap_scale = memnew( LineEdit ); - snap_scale->set_anchor( MARGIN_RIGHT, ANCHOR_END ); - snap_scale->set_begin( Point2(15,102) ); - snap_scale->set_end( Point2(15,115) ); snap_scale->set_text("5"); - snap_dialog->add_child(snap_scale); + snap_dialog_vbc->add_margin_child("Scale Snap (%):",snap_scale); - //snap_dialog->get_cancel()->hide(); - - /* SNAP DIALOG */ + /* SETTINGS DIALOG */ settings_dialog = memnew( ConfirmationDialog ); settings_dialog->set_title("Viewport Settings"); @@ -3906,7 +3884,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { xform_dialog = memnew( ConfirmationDialog ); xform_dialog->set_title("Transform Change"); add_child(xform_dialog); - l = memnew(Label); + Label *l = memnew(Label); l->set_text("Translate:"); l->set_pos(Point2(5,5)); xform_dialog->add_child(l); From ec394950ff7c8213768c9dfb2668f5d65bfdc07a Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Sun, 18 Oct 2015 15:13:17 -0300 Subject: [PATCH 03/78] Change MeshInstanceEditor outline dialog "Ok" button label --- tools/editor/plugins/mesh_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/editor/plugins/mesh_editor_plugin.cpp b/tools/editor/plugins/mesh_editor_plugin.cpp index 34ccf79feec..cea774f94ba 100644 --- a/tools/editor/plugins/mesh_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_editor_plugin.cpp @@ -212,7 +212,6 @@ MeshInstanceEditor::MeshInstanceEditor() { options = memnew( MenuButton ); - //add_child(options); SpatialEditor::get_singleton()->add_control_to_menu_panel(options); options->set_text("Mesh"); @@ -232,6 +231,7 @@ MeshInstanceEditor::MeshInstanceEditor() { outline_dialog = memnew( ConfirmationDialog ); outline_dialog->set_title("Create Outline Mesh"); + outline_dialog->get_ok()->set_text("Create"); VBoxContainer *outline_dialog_vbc = memnew( VBoxContainer ); outline_dialog->add_child(outline_dialog_vbc); From 4621d30d1b63c510c9928d073ef88be5b59248c0 Mon Sep 17 00:00:00 2001 From: firefly2442 Date: Sun, 18 Oct 2015 19:49:30 -0500 Subject: [PATCH 04/78] float to bool variable type, fixes: #2478 --- servers/visual/rasterizer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 15c757665bd..5063c1e19b1 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -690,7 +690,7 @@ public: Rect2 rect; RID texture; float margin[4]; - float draw_center; + bool draw_center; Color color; CommandStyle() { draw_center=true; type = TYPE_STYLE; } }; From 0a45fb6311023ae39be74d71054fd0042a8ba183 Mon Sep 17 00:00:00 2001 From: firefly2442 Date: Sun, 18 Oct 2015 20:50:32 -0500 Subject: [PATCH 05/78] duplicate conditional check --- tools/editor/plugins/shader_graph_editor_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/editor/plugins/shader_graph_editor_plugin.cpp b/tools/editor/plugins/shader_graph_editor_plugin.cpp index 684e7e32efb..3a7dc26466a 100644 --- a/tools/editor/plugins/shader_graph_editor_plugin.cpp +++ b/tools/editor/plugins/shader_graph_editor_plugin.cpp @@ -2542,7 +2542,7 @@ void ShaderGraphView::_notification(int p_what) { void ShaderGraphView::add_node(int p_type, const Vector2 &location) { - if ((p_type==ShaderGraph::NODE_INPUT||p_type==ShaderGraph::NODE_INPUT) && graph->node_count(type, p_type)>0) + if (p_type==ShaderGraph::NODE_INPUT && graph->node_count(type, p_type)>0) return; List existing; From bb68dc5210205da32b721681667360d8f54e2ea9 Mon Sep 17 00:00:00 2001 From: firefly2442 Date: Sun, 18 Oct 2015 21:45:27 -0500 Subject: [PATCH 06/78] remove child variable that is duplicated from parent class --- modules/gdscript/gd_parser.h | 1 - servers/visual/rasterizer_dummy.h | 4 ---- 2 files changed, 5 deletions(-) diff --git a/modules/gdscript/gd_parser.h b/modules/gdscript/gd_parser.h index 134279b6d82..04f3dff3dee 100644 --- a/modules/gdscript/gd_parser.h +++ b/modules/gdscript/gd_parser.h @@ -276,7 +276,6 @@ public: }; struct NewLineNode : public Node { - int line; NewLineNode() { type=TYPE_NEWLINE; } }; diff --git a/servers/visual/rasterizer_dummy.h b/servers/visual/rasterizer_dummy.h index 9249ad62564..ea39e9db6ad 100644 --- a/servers/visual/rasterizer_dummy.h +++ b/servers/visual/rasterizer_dummy.h @@ -162,10 +162,6 @@ class RasterizerDummy : public Rasterizer { uint32_t format; uint32_t morph_format; - RID material; - bool material_owned; - - Surface() { packed=false; From f256e421b52f248f76a7cb116c49f781f089aa49 Mon Sep 17 00:00:00 2001 From: Julian Murgia - StraToN Date: Mon, 19 Oct 2015 12:26:19 +0200 Subject: [PATCH 07/78] Fixed minor bug : quicklty pointing alternatively Script button and Close button on a tab showed both buttons as hovered --- scene/gui/tabs.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 6d84f028b31..10b1a626f07 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -103,11 +103,13 @@ void Tabs::_input_event(const InputEvent& p_event) { // test hovering right button and close button if (tabs[i].rb_rect.has_point(pos)) { rb_hover=i; + cb_hover=-1; hover_buttons = i; break; } else if (tabs[i].cb_rect.has_point(pos)) { cb_hover=i; + rb_hover=-1; hover_buttons = i; break; } From 1e36f36357ce2a44ffbb11276f0ce86a0dfe8606 Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Mon, 19 Oct 2015 08:00:41 -0300 Subject: [PATCH 08/78] Bind missing FixedMaterial constants, fixes #2628 --- scene/resources/material.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index bbb2a386f30..55bb4e90730 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -406,7 +406,6 @@ void FixedMaterial::_bind_methods() { BIND_CONSTANT( PARAM_SHADE_PARAM ); BIND_CONSTANT( PARAM_MAX ); - BIND_CONSTANT( TEXCOORD_SPHERE ); BIND_CONSTANT( TEXCOORD_UV ); BIND_CONSTANT( TEXCOORD_UV_TRANSFORM ); @@ -417,6 +416,11 @@ void FixedMaterial::_bind_methods() { BIND_CONSTANT( FLAG_USE_POINT_SIZE ); BIND_CONSTANT( FLAG_DISCARD_ALPHA ); + BIND_CONSTANT( LIGHT_SHADER_LAMBERT ); + BIND_CONSTANT( LIGHT_SHADER_WRAP ); + BIND_CONSTANT( LIGHT_SHADER_VELVET ); + BIND_CONSTANT( LIGHT_SHADER_TOON ); + } From 4345009a0eb1d2416316581d362795096e40768a Mon Sep 17 00:00:00 2001 From: MarianoGNU Date: Mon, 19 Oct 2015 12:21:19 -0300 Subject: [PATCH 09/78] add missing default value --- scene/gui/texture_progress.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index 0d549108fa3..c92929d9912 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -302,4 +302,5 @@ TextureProgress::TextureProgress() { mode=FILL_LEFT_TO_RIGHT; rad_center_off=Point2(); + rad_max_degrees=360; } From bf4bb3e17b731f1c726fef5e85fd9ea93b2acc3a Mon Sep 17 00:00:00 2001 From: MarianoGNU Date: Mon, 19 Oct 2015 15:26:00 -0300 Subject: [PATCH 10/78] Clamp filling angle instead of normalize --- scene/gui/texture_progress.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp index c92929d9912..c8930add6e8 100644 --- a/scene/gui/texture_progress.cpp +++ b/scene/gui/texture_progress.cpp @@ -233,11 +233,7 @@ float TextureProgress::get_radial_initial_angle() void TextureProgress::set_fill_degrees(float p_angle) { - while(p_angle>360) - p_angle-=360; - while (p_angle<0) - p_angle+=360; - rad_max_degrees=p_angle; + rad_max_degrees=CLAMP(p_angle,0,360); update(); } From 6df7d923797908ecf38684c0008c0e4b6475d884 Mon Sep 17 00:00:00 2001 From: MarianoGNU Date: Mon, 19 Oct 2015 17:46:13 -0300 Subject: [PATCH 11/78] Fix ButtonGroup broken layout --- scene/gui/button_group.cpp | 2 +- scene/gui/button_group.h | 6 ++-- .../resources/default_theme/default_theme.cpp | 4 +++ tools/editor/plugins/theme_editor_plugin.cpp | 36 +++++++++---------- 4 files changed, 25 insertions(+), 23 deletions(-) diff --git a/scene/gui/button_group.cpp b/scene/gui/button_group.cpp index 8d1fa80b847..c92d7f26960 100644 --- a/scene/gui/button_group.cpp +++ b/scene/gui/button_group.cpp @@ -155,6 +155,6 @@ void ButtonGroup::_bind_methods() { } -ButtonGroup::ButtonGroup() +ButtonGroup::ButtonGroup() : BoxContainer(true) { } diff --git a/scene/gui/button_group.h b/scene/gui/button_group.h index 24edf949940..74e847e9377 100644 --- a/scene/gui/button_group.h +++ b/scene/gui/button_group.h @@ -29,14 +29,14 @@ #ifndef BUTTON_GROUP_H #define BUTTON_GROUP_H -#include "scene/gui/control.h" +#include "scene/gui/box_container.h" class BaseButton; -class ButtonGroup : public Control { +class ButtonGroup : public BoxContainer { - OBJ_TYPE(ButtonGroup,Control); + OBJ_TYPE(ButtonGroup,BoxContainer); Set buttons; diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 5a99538a5f2..9f25337c3d4 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -299,6 +299,10 @@ void make_default_theme() { t->set_constant("hseparation","MenuButton", 3 ); + // ButtonGroup + + t->set_stylebox("panel","ButtonGroup", memnew( StyleBoxEmpty )); + // CheckBox Ref cbx_empty = memnew( StyleBoxEmpty ); diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp index 55e8f164d6f..63ba57bfc0a 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/tools/editor/plugins/theme_editor_plugin.cpp @@ -568,26 +568,24 @@ ThemeEditor::ThemeEditor() { CheckButton *cb = memnew( CheckButton ); cb->set_text("CheckButton"); first_vb->add_child(cb ); - CheckBox *cbx = memnew( CheckBox ); - cbx->set_text("CheckBox"); - first_vb->add_child(cbx ); + CheckBox *cbx = memnew( CheckBox ); + cbx->set_text("CheckBox"); + first_vb->add_child(cbx ); - /* TODO: This is not working properly, controls are overlapping*/ - /* - ButtonGroup *bg = memnew( ButtonGroup ); - bg->set_v_size_flags(SIZE_EXPAND_FILL); - VBoxContainer *gbvb = memnew( VBoxContainer ); - gbvb->set_v_size_flags(SIZE_EXPAND_FILL); - CheckBox *rbx1 = memnew( CheckBox ); - rbx1->set_text("CheckBox Radio1"); - rbx1->set_pressed(true); - gbvb->add_child(rbx1); - CheckBox *rbx2 = memnew( CheckBox ); - rbx2->set_text("CheckBox Radio2"); - gbvb->add_child(rbx2); - bg->add_child(gbvb); - first_vb->add_child(bg); - */ + + ButtonGroup *bg = memnew( ButtonGroup ); + bg->set_v_size_flags(SIZE_EXPAND_FILL); + VBoxContainer *gbvb = memnew( VBoxContainer ); + gbvb->set_v_size_flags(SIZE_EXPAND_FILL); + CheckBox *rbx1 = memnew( CheckBox ); + rbx1->set_text("CheckBox Radio1"); + rbx1->set_pressed(true); + gbvb->add_child(rbx1); + CheckBox *rbx2 = memnew( CheckBox ); + rbx2->set_text("CheckBox Radio2"); + gbvb->add_child(rbx2); + bg->add_child(gbvb); + first_vb->add_child(bg); MenuButton* test_menu_button = memnew( MenuButton ); test_menu_button->set_text("MenuButton"); From ad362fbc582fd8ff9239542971c60e670d0a689d Mon Sep 17 00:00:00 2001 From: firefly2442 Date: Mon, 19 Oct 2015 23:14:02 -0500 Subject: [PATCH 12/78] projects in the editor_settings.xml that are no longer found on disk will be removed --- tools/editor/project_manager.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 9f472914332..458b7b1133e 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -480,20 +480,25 @@ void ProjectManager::_load_recent_projects() { bool favorite = (_name.begins_with("favorite_projects/"))?true:false; uint64_t last_modified = 0; - if (FileAccess::exists(conf)) + if (FileAccess::exists(conf)) { last_modified = FileAccess::get_modified_time(conf); - String fscache = path.plus_file(".fscache"); - if (FileAccess::exists(fscache)) { - uint64_t cache_modified = FileAccess::get_modified_time(fscache); - if ( cache_modified > last_modified ) - last_modified = cache_modified; - } - ProjectItem item(project, path, conf, last_modified, favorite); - if (favorite) - favorite_projects.push_back(item); - else - projects.push_back(item); + String fscache = path.plus_file(".fscache"); + if (FileAccess::exists(fscache)) { + uint64_t cache_modified = FileAccess::get_modified_time(fscache); + if ( cache_modified > last_modified ) + last_modified = cache_modified; + } + + ProjectItem item(project, path, conf, last_modified, favorite); + if (favorite) + favorite_projects.push_back(item); + else + projects.push_back(item); + } else { + //project doesn't exist on disk but it's in the XML settings file + EditorSettings::get_singleton()->erase(_name); //remove it + } } projects.sort(); @@ -601,6 +606,8 @@ void ProjectManager::_load_recent_projects() { erase_btn->set_disabled(selected_list.size()<1); open_btn->set_disabled(selected_list.size()<1); run_btn->set_disabled(selected_list.size()<1 || (selected_list.size()==1 && single_selected_main=="")); + + EditorSettings::get_singleton()->save(); } void ProjectManager::_open_project_confirm() { From 96cff3a73b4b4d2cbd24a848a9f4950d54dd271f Mon Sep 17 00:00:00 2001 From: firefly2442 Date: Wed, 21 Oct 2015 14:28:23 -0500 Subject: [PATCH 13/78] when creating project, save icon using resource location by default --- tools/editor/project_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/editor/project_manager.cpp b/tools/editor/project_manager.cpp index 9f472914332..ee5521b8e13 100644 --- a/tools/editor/project_manager.cpp +++ b/tools/editor/project_manager.cpp @@ -193,7 +193,7 @@ class NewProjectDialog : public ConfirmationDialog { f->store_line("\n"); f->store_line("[application]"); f->store_line("name=\""+project_name->get_text()+"\""); - f->store_line("icon=\"icon.png\""); + f->store_line("icon=\"res://icon.png\""); memdelete(f); From 580a88c3ced6aa59db50fea6b7b5e02330689b09 Mon Sep 17 00:00:00 2001 From: firefly2442 Date: Wed, 21 Oct 2015 14:29:52 -0500 Subject: [PATCH 14/78] fix icon locations in demo projects --- demos/2d/fog_of_war/engine.cfg | 2 +- demos/2d/polygon_path_finder_demo/engine.cfg | 2 +- demos/gui/input_mapping/engine.cfg | 1 - demos/misc/tween/engine.cfg | 2 +- demos/misc/window_management/engine.cfg | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/demos/2d/fog_of_war/engine.cfg b/demos/2d/fog_of_war/engine.cfg index 5c4307b5bcb..1f56851c58b 100644 --- a/demos/2d/fog_of_war/engine.cfg +++ b/demos/2d/fog_of_war/engine.cfg @@ -2,7 +2,7 @@ name="Fog of War" main_scene="res://fog.scn" -icon="icon.png" +icon="res://icon.png" [input] diff --git a/demos/2d/polygon_path_finder_demo/engine.cfg b/demos/2d/polygon_path_finder_demo/engine.cfg index 41c4adf7017..de5593c4179 100644 --- a/demos/2d/polygon_path_finder_demo/engine.cfg +++ b/demos/2d/polygon_path_finder_demo/engine.cfg @@ -2,4 +2,4 @@ name="polygon_path_finder_demo" main_scene="res://new_scene_poly_with_holes.scn" -icon="icon.png" +icon="res://icon.png" diff --git a/demos/gui/input_mapping/engine.cfg b/demos/gui/input_mapping/engine.cfg index 959c0ac7d54..6470ec6cd8c 100644 --- a/demos/gui/input_mapping/engine.cfg +++ b/demos/gui/input_mapping/engine.cfg @@ -2,7 +2,6 @@ name="Input Mapping GUI" main_scene="res://controls.scn" -icon="icon.png" [display] diff --git a/demos/misc/tween/engine.cfg b/demos/misc/tween/engine.cfg index f97e540dbd6..3d3d639964e 100644 --- a/demos/misc/tween/engine.cfg +++ b/demos/misc/tween/engine.cfg @@ -2,7 +2,7 @@ name="Tween Demo" main_scene="res://main.xml" -icon="icon.png" +icon="res://icon.png" target_fps=60 [display] diff --git a/demos/misc/window_management/engine.cfg b/demos/misc/window_management/engine.cfg index 0a342316739..911d3fd4a12 100644 --- a/demos/misc/window_management/engine.cfg +++ b/demos/misc/window_management/engine.cfg @@ -2,7 +2,7 @@ name="Window Management" main_scene="res://window_management.scn" -icon="icon.png" +icon="res://icon.png" [display] From b86e3c3402c7a19ad34160ed36a1fae65dc43cca Mon Sep 17 00:00:00 2001 From: romulox_x Date: Wed, 21 Oct 2015 19:23:34 -0700 Subject: [PATCH 15/78] added low_memory_2d_mode, to indicate when 3D post processing buffers and viewport depth buffers should not be allocated --- drivers/gles2/rasterizer_gles2.cpp | 17 +++++++++++++---- drivers/gles2/rasterizer_gles2.h | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index d84ee5a7589..9bcce156cd0 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -4075,6 +4075,8 @@ void RasterizerGLES2::render_target_set_size(RID p_render_target,int p_width,int glDeleteTextures(1,&rt->color); rt->fbo=0; + rt->depth=0; + rt->color=0; rt->width=0; rt->height=0; rt->texture_ptr->tex_id=0; @@ -4094,12 +4096,14 @@ void RasterizerGLES2::render_target_set_size(RID p_render_target,int p_width,int glBindFramebuffer(GL_FRAMEBUFFER, rt->fbo); //depth - glGenRenderbuffers(1, &rt->depth); - glBindRenderbuffer(GL_RENDERBUFFER, rt->depth ); + if (!low_memory_2d) { + glGenRenderbuffers(1, &rt->depth); + glBindRenderbuffer(GL_RENDERBUFFER, rt->depth ); - glRenderbufferStorage(GL_RENDERBUFFER, use_depth24?_DEPTH_COMPONENT24_OES:GL_DEPTH_COMPONENT16, rt->width,rt->height); + glRenderbufferStorage(GL_RENDERBUFFER, use_depth24?_DEPTH_COMPONENT24_OES:GL_DEPTH_COMPONENT16, rt->width,rt->height); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rt->depth); + } //color glGenTextures(1, &rt->color); @@ -10293,7 +10297,11 @@ void RasterizerGLES2::_update_framebuffer() { framebuffer.fbo=0; } +#ifdef TOOLS_ENABLED framebuffer.active=use_fbo; +#else + framebuffer.active=use_fbo && !low_memory_2d; +#endif framebuffer.width=dwidth; framebuffer.height=dheight; framebuffer.scale=scale; @@ -11203,6 +11211,7 @@ RasterizerGLES2::RasterizerGLES2(bool p_compress_arrays,bool p_keep_ram_copy,boo use_fp16_fb=bool(GLOBAL_DEF("rasterizer/fp16_framebuffer",true)); use_shadow_mapping=true; use_fast_texture_filter=!bool(GLOBAL_DEF("rasterizer/trilinear_mipmap_filter",true)); + low_memory_2d=bool(GLOBAL_DEF("rasterizer/low_memory_2d_mode",false)); skel_default.resize(1024*4); for(int i=0;i<1024/3;i++) { diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index 507e46ae750..85e49d4f39f 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -105,7 +105,7 @@ class RasterizerGLES2 : public Rasterizer { float anisotropic_level; bool use_half_float; - + bool low_memory_2d; Vector skel_default; From 4e0511a8a0cb294d330f6fde0640365ae3173ab5 Mon Sep 17 00:00:00 2001 From: Brickcaster Date: Sat, 24 Oct 2015 21:47:48 -0400 Subject: [PATCH 16/78] Fix for negative coords. Regarding issue #2665 int() of negative numbers rounds up. Needed to add a condition to account for negative values. Thanks to Romulox_x for providing this solution. --- scene/2d/tile_map.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 418ee192b22..167b637bdcb 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -1031,13 +1031,12 @@ Vector2 TileMap::world_to_map(const Vector2& p_pos) const{ switch(half_offset) { case HALF_OFFSET_X: { - if (int(ret.y)&1) { - + if ( ret.y > 0 ? int(ret.y)&1 : (int(ret.y)-1)&1 ) { ret.x-=0.5; } } break; case HALF_OFFSET_Y: { - if (int(ret.x)&1) { + if ( ret.x > 0 ? int(ret.x)&1 : (int(ret.x)-1)&1) { ret.y-=0.5; } } break; From cf995d5f0783b9c8fc6c4493e6298e59c559c9d1 Mon Sep 17 00:00:00 2001 From: neikeq Date: Sun, 25 Oct 2015 18:00:29 +0100 Subject: [PATCH 17/78] Tooltip for the Inspector's history button --- tools/editor/editor_node.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index a3d7cbd7cf1..ecd4b402c8e 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -5173,6 +5173,7 @@ EditorNode::EditorNode() { editor_history_menu = memnew( MenuButton ); + editor_history_menu->set_tooltip("History of recently edited objects"); editor_history_menu->set_icon( gui_base->get_icon("History","EditorIcons")); prop_editor_hb->add_child(editor_history_menu); editor_history_menu->connect("about_to_show",this,"_prepare_history"); From ca7cfa9b4c5fbd487c9b5bcf9143cbfce35287e7 Mon Sep 17 00:00:00 2001 From: eska Date: Sun, 25 Oct 2015 23:13:46 +0100 Subject: [PATCH 18/78] Add all collision shapes to a tile when converting scenes to TileSets --- tools/editor/plugins/tile_set_editor_plugin.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/editor/plugins/tile_set_editor_plugin.cpp b/tools/editor/plugins/tile_set_editor_plugin.cpp index 39b0ef3c759..09115472a88 100644 --- a/tools/editor/plugins/tile_set_editor_plugin.cpp +++ b/tools/editor/plugins/tile_set_editor_plugin.cpp @@ -110,11 +110,15 @@ void TileSetEditor::_import_scene(Node *scene, Ref p_library, bool p_me if (!child2->cast_to()) continue; StaticBody2D *sb = child2->cast_to(); - if (sb->get_shape_count()==0) + int shape_count = sb->get_shape_count(); + if (shape_count==0) continue; - Ref collision=sb->get_shape(0); - if (collision.is_valid()) { - collisions.push_back(collision); + for (int shape_index=0; shape_index collision=sb->get_shape(shape_index); + if (collision.is_valid()) { + collisions.push_back(collision); + } } } From 3fbaa479e33466394cd243ab652bd1c4c082549a Mon Sep 17 00:00:00 2001 From: volzhs Date: Wed, 28 Oct 2015 15:48:37 +0900 Subject: [PATCH 19/78] improve android payments GodotPaymentV3 currently consumes purchased item right after purchasing. But, some in-app item should not consume like "remove ads permanently" So, I added "setAutoConsume(boolean)", "requestPurchased()", "consume(sku_string)". AutoConsume is true by default as before. usage: func _ready(): var payment = Globals.get_singleton("GodotPayments") payment.setPurchaseCallbackId(get_instance_ID()) payment.setAutoConsume(false) # default : true payment.requestPurchased() # callback : has_purchased payment.purchase("item_name") # callback : purchase_success, purchase_fail, purchase_cancel, purchase_owned payment.consume("item_name") # callback : consume_success func purchase_success(receipt, signature, sku): print("purchase_success : ", sku) func purchase_fail(): print("purchase_fail") func purchase_cancel(): print("purchase_cancel") func purchase_owned(sku): print("purchase_owned : ", sku) func consume_success(receipt, signature, sku): print("consume_success : ", sku) func has_purchased(receipt, signature, sku): if sku == "": print("has_purchased : nothing") else: print("has_purchased : ", sku) --- .../src/com/android/godot/GodotPaymentV3.java | 60 ++++++--- .../godot/payments/PaymentsManager.java | 127 ++++++++++++++---- .../android/godot/payments/PurchaseTask.java | 8 +- 3 files changed, 152 insertions(+), 43 deletions(-) diff --git a/platform/android/java/src/com/android/godot/GodotPaymentV3.java b/platform/android/java/src/com/android/godot/GodotPaymentV3.java index 0fd102ac55b..0799e1e83d9 100644 --- a/platform/android/java/src/com/android/godot/GodotPaymentV3.java +++ b/platform/android/java/src/com/android/godot/GodotPaymentV3.java @@ -27,7 +27,7 @@ public class GodotPaymentV3 extends Godot.SingletonBase { activity.getPaymentsManager().requestPurchase(sku, transactionId); } }); - }; + } /* public string requestPurchasedTicket(){ activity.getPaymentsManager() @@ -42,7 +42,7 @@ public class GodotPaymentV3 extends Godot.SingletonBase { public GodotPaymentV3(Activity p_activity) { - registerClass("GodotPayments", new String[] {"purchase", "setPurchaseCallbackId", "setPurchaseValidationUrlPrefix", "setTransactionId", "getSignature", "consumeUnconsumedPurchases"}); + registerClass("GodotPayments", new String[] {"purchase", "setPurchaseCallbackId", "setPurchaseValidationUrlPrefix", "setTransactionId", "getSignature", "consumeUnconsumedPurchases", "requestPurchased", "setAutoConsume", "consume"}); activity=(Godot) p_activity; } @@ -54,7 +54,6 @@ public class GodotPaymentV3 extends Godot.SingletonBase { activity.getPaymentsManager().consumeUnconsumedPurchases(); } }); - } private String signature; @@ -63,25 +62,26 @@ public class GodotPaymentV3 extends Godot.SingletonBase { } - public void callbackSuccess(String ticket, String signature){ -// Log.d(this.getClass().getName(), "PRE-Send callback to purchase success"); - GodotLib.callobject(purchaseCallbackId, "purchase_success", new Object[]{ticket, signature}); -// Log.d(this.getClass().getName(), "POST-Send callback to purchase success"); + public void callbackSuccess(String ticket, String signature, String sku){ +// Log.d(this.getClass().getName(), "PRE-Send callback to purchase success"); + GodotLib.callobject(purchaseCallbackId, "purchase_success", new Object[]{ticket, signature, sku}); +// Log.d(this.getClass().getName(), "POST-Send callback to purchase success"); } public void callbackSuccessProductMassConsumed(String ticket, String signature, String sku){ -// Log.d(this.getClass().getName(), "PRE-Send callback to consume success"); - GodotLib.calldeferred(purchaseCallbackId, "consume_success", new Object[]{ticket, signature, sku}); -// Log.d(this.getClass().getName(), "POST-Send callback to consume success"); +// Log.d(this.getClass().getName(), "PRE-Send callback to consume success"); + Log.d(this.getClass().getName(), "callbackSuccessProductMassConsumed > "+ticket+","+signature+","+sku); + GodotLib.calldeferred(purchaseCallbackId, "consume_success", new Object[]{ticket, signature, sku}); +// Log.d(this.getClass().getName(), "POST-Send callback to consume success"); } public void callbackSuccessNoUnconsumedPurchases(){ - GodotLib.calldeferred(purchaseCallbackId, "no_validation_required", new Object[]{}); + GodotLib.calldeferred(purchaseCallbackId, "no_validation_required", new Object[]{}); } public void callbackFail(){ - GodotLib.calldeferred(purchaseCallbackId, "purchase_fail", new Object[]{}); -// GodotLib.callobject(purchaseCallbackId, "purchase_fail", new Object[]{}); + GodotLib.calldeferred(purchaseCallbackId, "purchase_fail", new Object[]{}); +// GodotLib.callobject(purchaseCallbackId, "purchase_fail", new Object[]{}); } public void callbackCancel(){ @@ -89,6 +89,10 @@ public class GodotPaymentV3 extends Godot.SingletonBase { // GodotLib.callobject(purchaseCallbackId, "purchase_cancel", new Object[]{}); } + public void callbackAlreadyOwned(String sku){ + GodotLib.calldeferred(purchaseCallbackId, "purchase_owned", new Object[]{sku}); + } + public int getPurchaseCallbackId() { return purchaseCallbackId; } @@ -97,8 +101,6 @@ public class GodotPaymentV3 extends Godot.SingletonBase { this.purchaseCallbackId = purchaseCallbackId; } - - public String getPurchaseValidationUrlPrefix(){ return this.purchaseValidationUrlPrefix ; } @@ -107,12 +109,10 @@ public class GodotPaymentV3 extends Godot.SingletonBase { this.purchaseValidationUrlPrefix = url; } - public String getAccessToken() { return accessToken; } - public void setAccessToken(String accessToken) { this.accessToken = accessToken; } @@ -125,4 +125,30 @@ public class GodotPaymentV3 extends Godot.SingletonBase { return this.transactionId; } + // request purchased items are not consumed + public void requestPurchased(){ + activity.getPaymentsManager().setBaseSingleton(this); + activity.runOnUiThread(new Runnable() { + @Override + public void run() { + activity.getPaymentsManager().requestPurchased(); + } + }); + } + + // callback for requestPurchased() + public void callbackPurchased(String receipt, String signature, String sku){ + GodotLib.calldeferred(purchaseCallbackId, "has_purchased", new Object[]{receipt, signature, sku}); + } + + // consume item automatically after purchase. default is true. + public void setAutoConsume(boolean autoConsume){ + activity.getPaymentsManager().setAutoConsume(autoConsume); + } + + // consume a specific item + public void consume(String sku){ + activity.getPaymentsManager().consume(sku); + } } + diff --git a/platform/android/java/src/com/android/godot/payments/PaymentsManager.java b/platform/android/java/src/com/android/godot/payments/PaymentsManager.java index 5bf86d0b69f..189f7108c17 100644 --- a/platform/android/java/src/com/android/godot/payments/PaymentsManager.java +++ b/platform/android/java/src/com/android/godot/payments/PaymentsManager.java @@ -25,10 +25,8 @@ import com.android.vending.billing.IInAppBillingService; public class PaymentsManager { public static final int BILLING_RESPONSE_RESULT_OK = 0; - - public static final int REQUEST_CODE_FOR_PURCHASE = 0x1001; - + private static boolean auto_consume = true; private Activity activity; IInAppBillingService mService; @@ -69,13 +67,12 @@ public class PaymentsManager { } @Override - public void onServiceConnected(ComponentName name, - IBinder service) { - mService = IInAppBillingService.Stub.asInterface(service); + public void onServiceConnected(ComponentName name, IBinder service) { + mService = IInAppBillingService.Stub.asInterface(service); } }; - public void requestPurchase(String sku, String transactionId){ + public void requestPurchase(final String sku, String transactionId){ new PurchaseTask(mService, Godot.getInstance()) { @Override @@ -88,6 +85,12 @@ public class PaymentsManager { protected void canceled() { godotPaymentV3.callbackCancel(); } + + @Override + protected void alreadyOwned() { + godotPaymentV3.callbackAlreadyOwned(sku); + } + }.purchase(sku, transactionId); } @@ -114,26 +117,82 @@ public class PaymentsManager { }.consumeItAll(); } + public void requestPurchased(){ + try{ + PaymentsCache pc = new PaymentsCache(Godot.getInstance()); + +// Log.d("godot", "requestPurchased for " + activity.getPackageName()); + Bundle bundle = mService.getPurchases(3, activity.getPackageName(), "inapp",null); + +/* + for (String key : bundle.keySet()) { + Object value = bundle.get(key); + Log.d("godot", String.format("%s %s (%s)", key, value.toString(), value.getClass().getName())); + } +*/ + + if (bundle.getInt("RESPONSE_CODE") == 0){ + + final ArrayList myPurchases = bundle.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); + final ArrayList mySignatures = bundle.getStringArrayList("INAPP_DATA_SIGNATURE_LIST"); + + + if (myPurchases == null || myPurchases.size() == 0){ +// Log.d("godot", "No purchases!"); + godotPaymentV3.callbackPurchased("", "", ""); + return; + } + +// Log.d("godot", "# products are purchased:" + myPurchases.size()); + for (int i=0;i Date: Wed, 28 Oct 2015 10:34:02 -0300 Subject: [PATCH 20/78] Fix small memory leak --- tools/editor/script_editor_debugger.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/editor/script_editor_debugger.cpp b/tools/editor/script_editor_debugger.cpp index 8e0e7ddb49c..60f2afa2c28 100644 --- a/tools/editor/script_editor_debugger.cpp +++ b/tools/editor/script_editor_debugger.cpp @@ -1376,7 +1376,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){ vmem_refresh->connect("pressed",this,"_video_mem_request"); MarginContainer *vmmc = memnew( MarginContainer ); - vmmc = memnew( MarginContainer ); vmem_tree = memnew( Tree ); vmem_tree->set_v_size_flags(SIZE_EXPAND_FILL); vmem_tree->set_h_size_flags(SIZE_EXPAND_FILL); From 06e0eba4021975824fc7f3230461b7274886f61e Mon Sep 17 00:00:00 2001 From: eska Date: Wed, 28 Oct 2015 18:21:45 +0100 Subject: [PATCH 21/78] Set World2D default angular damp per global `physics_2d/default_angular_damp` --- scene/resources/world_2d.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index d8d9c5b6757..3b1f1d23461 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -374,7 +374,7 @@ World2D::World2D() { Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_GRAVITY,GLOBAL_DEF("physics_2d/default_gravity",98)); Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_GRAVITY_VECTOR,GLOBAL_DEF("physics_2d/default_gravity_vector",Vector2(0,1))); Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_LINEAR_DAMP,GLOBAL_DEF("physics_2d/default_density",0.1)); - Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_ANGULAR_DAMP,GLOBAL_DEF("physics_2d/default_density",1)); + Physics2DServer::get_singleton()->area_set_param(space,Physics2DServer::AREA_PARAM_ANGULAR_DAMP,GLOBAL_DEF("physics_2d/default_angular_damp",1)); Physics2DServer::get_singleton()->space_set_param(space,Physics2DServer::SPACE_PARAM_CONTACT_RECYCLE_RADIUS,1.0); Physics2DServer::get_singleton()->space_set_param(space,Physics2DServer::SPACE_PARAM_CONTACT_MAX_SEPARATION,1.5); Physics2DServer::get_singleton()->space_set_param(space,Physics2DServer::SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION,0.3); From b0b0f35e2cc6b2e95672a672ea599a22bb53ebd4 Mon Sep 17 00:00:00 2001 From: neikeq Date: Thu, 29 Oct 2015 20:37:09 +0100 Subject: [PATCH 22/78] Added some demo icons --- demos/2d/area_input/engine.cfg | 1 + demos/2d/area_input/icon.png | Bin 0 -> 1684 bytes demos/2d/dynamic_collision_shapes/engine.cfg | 1 + demos/2d/dynamic_collision_shapes/icon.png | Bin 0 -> 844 bytes demos/2d/hdr/engine.cfg | 1 + demos/2d/hdr/icon.png | Bin 0 -> 2670 bytes demos/2d/isometric_light/engine.cfg | 1 + demos/2d/isometric_light/icon.png | Bin 0 -> 3638 bytes demos/2d/light_mask/engine.cfg | 1 + demos/2d/light_mask/icon.png | Bin 0 -> 3344 bytes demos/2d/lights_shadows/engine.cfg | 1 + demos/2d/lights_shadows/icon.png | Bin 0 -> 2733 bytes demos/2d/navpoly/engine.cfg | 1 + demos/2d/navpoly/icon.png | Bin 0 -> 2420 bytes demos/2d/normalmaps/engine.cfg | 1 + demos/2d/normalmaps/icon.png | Bin 0 -> 4876 bytes demos/2d/screen_space_shaders/engine.cfg | 1 + demos/2d/screen_space_shaders/icon.png | Bin 0 -> 3341 bytes demos/2d/sdf_font/engine.cfg | 1 + demos/2d/sdf_font/icon.png | Bin 0 -> 1534 bytes demos/2d/splash/engine.cfg | 1 + demos/2d/splash/icon.png | Bin 0 -> 3408 bytes demos/2d/sprite_shaders/engine.cfg | 1 + demos/2d/sprite_shaders/icon.png | Bin 0 -> 3934 bytes demos/3d/navmesh/icon.png | Bin 0 -> 2803 bytes demos/3d/sat_test/engine.cfg | 1 + demos/3d/sat_test/icon.png | Bin 0 -> 2699 bytes demos/gui/rich_text_bbcode/engine.cfg | 1 + demos/gui/rich_text_bbcode/icon.png | Bin 0 -> 2293 bytes demos/misc/instancing/engine.cfg | 1 + demos/misc/instancing/icon.png | Bin 0 -> 2185 bytes 31 files changed, 15 insertions(+) create mode 100644 demos/2d/area_input/icon.png create mode 100644 demos/2d/dynamic_collision_shapes/icon.png create mode 100644 demos/2d/hdr/icon.png create mode 100644 demos/2d/isometric_light/icon.png create mode 100644 demos/2d/light_mask/icon.png create mode 100644 demos/2d/lights_shadows/icon.png create mode 100644 demos/2d/navpoly/icon.png create mode 100644 demos/2d/normalmaps/icon.png create mode 100644 demos/2d/screen_space_shaders/icon.png create mode 100644 demos/2d/sdf_font/icon.png create mode 100644 demos/2d/splash/icon.png create mode 100644 demos/2d/sprite_shaders/icon.png create mode 100644 demos/3d/navmesh/icon.png create mode 100644 demos/3d/sat_test/icon.png create mode 100644 demos/gui/rich_text_bbcode/icon.png create mode 100644 demos/misc/instancing/icon.png diff --git a/demos/2d/area_input/engine.cfg b/demos/2d/area_input/engine.cfg index 3227e9278fe..8fa2e15bebc 100644 --- a/demos/2d/area_input/engine.cfg +++ b/demos/2d/area_input/engine.cfg @@ -2,3 +2,4 @@ name="Area 2D Input Events" main_scene="res://input.scn" +icon="res://icon.png" diff --git a/demos/2d/area_input/icon.png b/demos/2d/area_input/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d9bb88169321f8d5af74c5f0b30d7f1e24b454bd GIT binary patch literal 1684 zcmV;F25b3=P)#2G`EE%xq&sTemS0ZBc^mjw{l0cZaaxJkuJuKIn|3Z z!iy!nf;p;xI;DFyp?El(bvc@JBA9DJV^>H|OeW2YI?#tVw}vIUfhD(oGo^VXs&+h^ zbx5#lJ$qwIq+&*FTvv`xR*FqdK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LJ_hbD)1?an z^r_lm_@Su)j9+^;e}J!#kB@Jmz--xy7R{G0k1B^FckbK{9ecXLV6agiB%1{Qw6NLn z86BvC$s6WHo(b{s^$GCt4GiQ2E`T^dAOdd#hR|ZPqXG;;)ftTe_)LHX!vm!W;lVlNjI|sLikg${j;m0+|CWMk`yWn>$ryFCzeJBhQ}61~YTkCzWuQ1_+YX z9?&`Vuece5z}^J_);v6u4QA#Xi?;yD1JaREHmiq)^O3OLLFubw~n zRp37W77jRZ%msM#D@T=o1V8|k=78&mFCF}}``xRTkA5fc(nLv$X_n}gH&{8~==HqZK(uGShz?E+Y_wReZFBH@R=0+RwQgTzsj`+jPBg= z==UpM5a9KWC--m9&f*OK!A^f6X2p+53^$;M0QBqJq=E`)_2ho@EM5Q#B*L#ruY`x= z7zxl6fUvgvht}!Y1AcD+y&jT$@a3%uQYq1R08@i5%YvH zJP^rr@%2~+^h(0%l5Ar|XawqH^iYI|g-C_3eToUMF^#h50vK!-Cjp&o-w0(O1V_wu zbu&GE@eCK?7D?_IY+8oVI14HxtSveLL{CDfG2$g*Uwv(qp6^xn3_*TGKqvcl?nohA z2o?j7c&W56-!7*+!3F{i6c3>xqK8hbGXbRx8JvNh@BI4zS3(d7ECf2CBG8LA(a4c5 cV`gUk1K;d3@V$5%J^%m!07*qoM6N<$f@~fky8r+H literal 0 HcmV?d00001 diff --git a/demos/2d/isometric_light/engine.cfg b/demos/2d/isometric_light/engine.cfg index 08393f17240..a5b053aa958 100644 --- a/demos/2d/isometric_light/engine.cfg +++ b/demos/2d/isometric_light/engine.cfg @@ -2,6 +2,7 @@ name="Isometric 2D + Lighting" main_scene="res://map.scn" +icon="res://icon.png" [input] diff --git a/demos/2d/isometric_light/icon.png b/demos/2d/isometric_light/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3de9749729eda77c7adbfcbc83404eff7fba310b GIT binary patch literal 3638 zcmV-64$1L}P)Q%_AkJ77~#fmu&HHZuqY2IR1mRx>hAFD~G$kZVv)J25c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J^KAn}GFtX9kACJ^xXew>_~H$4GD=UkxEfd#NC#!;$TjG>e*)0#P> z)NN)g&om9w7>Vb3X1Q9eL?4{t>U_Y}-vbwTw9kd|g?zzK3l&IdUS7-QPjfU*oAXJP z$0!Mi&1Sh0eDHLw59$Qr`J~ebfPSdUaiKz?fToZ01_Q#=lk7B7u!WI4&$?T%C0^jg zjp+3ev`!GMkDfza*ZlxQyEQIUEEWs#crFIX@q#E0hik_ioAOwGCbQWp5E6!oq9AYt zO%w2@4?TOjPS;NTJ*cxR^tV7RR$;om9)@AR$K$aqTct9I2!)Y=5JZY5^jZx7xH*2% zX^g1XlQ{Hu0Hji>Qc&+w)Ah48Gw({}vP&p!Nz!V4y(Un75a8P9*$2m;XkN9ty8+^E zpUeVa+qO2l3twB|QWyw#2oc(p(C=#+5bou7uRchILU^wZ1ON~KNTm%?AoDpHMk%>M z+on0R1WoJrDeA!EX8%LaA5w9)iwGB}wx`*9)Vf9~Efxp>L9uD93a1bSjiM-Y`QGK= z_$Y+qY%$tG1S5*o@_h;QcL^^Ra0bP$*>DO)X~PUh$J?*}1D0b;^~SEpegFUf07*qo IM6N<$f}3!yO#lD@ literal 0 HcmV?d00001 diff --git a/demos/2d/light_mask/engine.cfg b/demos/2d/light_mask/engine.cfg index 8b0ae6f61dd..39608669ab0 100644 --- a/demos/2d/light_mask/engine.cfg +++ b/demos/2d/light_mask/engine.cfg @@ -2,6 +2,7 @@ name="Using Lights As Mask" main_scene="res://lightmask.scn" +icon="res://icon.png" [rasterizer] diff --git a/demos/2d/light_mask/icon.png b/demos/2d/light_mask/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..c12b045e62ef34deb3f4b2482ec91e3b3cf4c8fe GIT binary patch literal 3344 zcmV+r4e#=aP){fOB+rQB+z>PEWnOy{f3Hk(#J|gpqi8e130k zYHMzDe2QjlbyHejNlHq|$H$tPoL_c~XJ&18XlGtvXJKJsN>EgZm#B7(q;76-Jzi{C zSz1v4Geg^FfoXI4>6W=A!_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#qsX4mY*e}6{rR5R!Z3~pDlynMs9H@df`YNJ6;TNLR%?G zWFbUI!hUh#SfhzP-`VS;;c5T?$=R%(0xz#TVfHd^Ad=GpNLXC^fIUnG(SJ9;cmgfZ k#q-ry-`8KhUw!@m10-t4XL&|c7ytkO07*qoM6N<$g1sxz-v9sr literal 0 HcmV?d00001 diff --git a/demos/2d/splash/engine.cfg b/demos/2d/splash/engine.cfg index cb50c7b1be9..e4614263052 100644 --- a/demos/2d/splash/engine.cfg +++ b/demos/2d/splash/engine.cfg @@ -2,6 +2,7 @@ name="Splash Screen" main_scene="res://splash.xml" +icon="res://icon.png" [display] diff --git a/demos/2d/splash/icon.png b/demos/2d/splash/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..88620eb35bc308b46f11b91c4c0e8978acbe6a66 GIT binary patch literal 3408 zcmV-W4X^TvP)JPmoF!aDIz~~kjuJCgC!nNNk+6fF}*r4TT)NO zKQ%vbjXiCO`uX|b&RaS-H?B7>xjQn>&dxc7Civ9Yn2mzU(ykJo&5JXmFN ze`8WoRHl?VpfxSf(a>nF#GIt4p`oEcUu}bGV^LmVa8gd3jW(;s)6B}s$jHb)i=;(& zjZk!kL~w$yNkHY|;@H^OUA59nt*frNB&ayeOYS8QX= zz+HZbTw7aQ<h6Ohrjc!b?D#kUuvxB=hCuwawYHz{Q)KosN~4YJ`%ri-@&; zdaQGAW@Tn&c4e2HWUHrOe0D&Nhd)Y2FJTuF;lRCnjFiJ^V#T>s(ZN%QSW$(NIJe}hhUcQkx+M}}pOlwq5mUo~o5nPFLL za#E6vPn%Oth=x3`p&!K8;^524b*Q^kp0DwKyPODJz-0000EbW%=J08Rce zzoMeQ+uPgQKfh|eQT_k`3GqopK~z}7WRqV=T2UOwog=ov1|?+*yIc?**+af5d${;; zuc_!}qNp#LpnDjh7Gvr%NS!7rb6G9c)XE^x@?j}HNWR9{MnMr#Q7?_X4ED0^X)xID z9JSOwdf|6}=X^is+~o>(6!Tl3$NebN&0a;{|G48aGno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VfZ5ycBk6OsS`002ovPDHLk FV1n2VIR5|u literal 0 HcmV?d00001 diff --git a/demos/gui/rich_text_bbcode/engine.cfg b/demos/gui/rich_text_bbcode/engine.cfg index e0ea296f6d9..5f68b6a0e65 100644 --- a/demos/gui/rich_text_bbcode/engine.cfg +++ b/demos/gui/rich_text_bbcode/engine.cfg @@ -2,3 +2,4 @@ name="Rich Text Label (BBCode)" main_scene="res://rich_text_bbcode.scn" +icon="res://icon.png" diff --git a/demos/gui/rich_text_bbcode/icon.png b/demos/gui/rich_text_bbcode/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..78358ba71b27b9de3d800aa1cec1cacb61519481 GIT binary patch literal 2293 zcmV|AB#oARr|sCMqH#CnqN??Ck6t8zA1^-WPj*EiEz~9U?3&FfuYX;NajXDK6aH z+$t(BA0H%FS6V_sMLFCeT&`?lQ>gwt}JwY}$JE5VYCLkqA!^OCmQr zBq}c%86Oi98Pd|ya&mQCTwq2_4Nbp@9OI5CfdgoS^9fp~a(YHDm|W@%txU_?YmIyyc(J3JQ`9RB|P@bK{B z;^NB6%M7@=x3{^htgWi5tA>V%ZEbLCYi}VuK`$>fCl?&Y#>cw4yRNRUq@<;hk&|z4 za#mJVOG`~OG&TYE_XXbH4X?3$e1COyc%-0gf`49aZCV{sRU_skE^9=6=7(0b6i9h?(SM&1n@@W|GB!TaD1?dL1=Lgr=2h!7S3(pI|!e|n}47InYp|ZKV ztfZc*8G)&xkE354oe`Ovm4=x6^OvHKklxpZhK7YZpo5i^fPjC0ytjK$D0moicD=ZC zv#xYw&v1f)Z+duRTC`zLLtjfeT|6yTT2WJ9UQvUAN@znwYF$4?NiSbLFKjC;p4=ih zF(5KK9D7+9Mp+lC8W*R*7ObTfyXh65r4-GI6R)li;G_@7;|_Ta4(gN*zrG6H8wKj- z1DTcs+Xn#5%lNDS00sd`L_t(o!_1ROZ__{+hG)ch?6JJZPHbmWDrKusHc}~@ASIis zCe5M*gc2GeP(@JMra}~2aRG@V2QC~q@(=ijI5r6(5n{XWN}lc0_gL@iG59Zp5kk{|z8vr#Zu`KJ`k%vLM#3vcb zsfaCBl2}CqYbr5mv;|=Ou0dj-s(S&7oj-CVnVpAm-l|X>P<)W1`1pC1hw(V2SF;o2 ztVVAE0+5zQGCQJP7?PnSC0~=dwrfQ3g#qjtrg2H74NouEcp)_pge^cdewi4{N3Zn6 z2ZSvPkZXCI|GK1dQd(JW{tU%fy+#y6`q=)&F2wJRdMXWXAiH;-4IwlcZs*4{1@XrPQKh1TB zR*uGf+;42Sto7EC-?{QEOzdT}r5EZ{_1stz)R{|7fek?F^Vm1hN5ix!>*;cgdd`|vti zn1v_#Lfh{E5~eb&!B~_XRu%y4HIjpGF@u8PGT8 z#Y2r|x~gYo!L6Y281sq;(8K4la#K(uM~y{W={O&PO8^`Vv&;=JIDBgXIOc2(5Koa) z5yNJHkC|biO~hm*AwmQYdQ~=DpZHv_s70q#h1RMzc-Vd>UVoa*1UI@CgOPq6czuzbrzLgL?vy zZ}m&i6ZeX^Pz06&TD9)C(z;*G3V?G9fX>$aZgKsp*w5M?Isoyn>Fo>cJH z`q#gfa=+#%{T~3Ocb~-g7x}N>|5f5sCo8d=Y~dqIv#A7YO3U_EIR-{SvckbsG(>F9 z*2&@Q45*lyeIR7>?@cu>?KVE z$?$>6#mo0Q;`AcZnV6W8$uPjQy5r7*4h{n&E&=EK8sdYIU09eEShh0o91X92{OFXY zy#%16^tVB6XHD*x43sp1!R1DU2^ zuHCNOKS==`1{2mWD0dYV6)9uZ#}eXV?5zA^NQDWbVI#y3bsir5It*X~bUaj)J%C_^ zF19Kigpqw9r3IpNZA;8-OLTR0BWytg5CK66D=}HU5EKUO+*pAb!(adaO3X!Zy8})9 P00000NkvXXu0mjfp5h?L literal 0 HcmV?d00001 diff --git a/demos/misc/instancing/engine.cfg b/demos/misc/instancing/engine.cfg index 52a28a3fce0..76b0c977214 100644 --- a/demos/misc/instancing/engine.cfg +++ b/demos/misc/instancing/engine.cfg @@ -2,6 +2,7 @@ name="Scene Instancing Demo" main_scene="res://container.scn" +icon="res://icon.png" [physics_2d] diff --git a/demos/misc/instancing/icon.png b/demos/misc/instancing/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7a6de677c5f07f5779df9b8d0050863e40bb61da GIT binary patch literal 2185 zcmV;42zK|0P)x3RRyASD*?_ znF>CQ3vIFsUZqY=N((%T3t^`UK#vM=ved%v+EInjFMo>yiO=E_&3tyr)UZ65so)$!q5I~I?{IG;I&KjxW-&lxMMzK!ZnIBusz+(2L}#T7VWdH2qa00_ zB2AVPNRtsmkPbeJ3^aubFM$t1e-}4;Rz!IeGItp^b>wevCp&2|KwvICUNb&h6C+zY zL|IHrOGrvfO-o5=hqhXIuTyob3|yfuSe!CenkiA24MC3vKaUAHj1D%14?TJxI&%>- zZ#_j;6CYM$P)|iiO+j?7L2s!STcHeGo;F&X3{{&VQJN=GnFmRiCrgtYNRkaqjvYjf z8bOT|K#dYPi4IAK6FZ0wM1(OzgA+Z15;=esHGRcnan@;U&1z~AC}9#NUp7HrI6_%O zNJwpsxnF^^Re!QJY^qCbs5WM$AYr8?VWbjQpCVS9D^!~zQJE4TUb8`?kbF^M?-ED3kH*LdfYolXmCOT!6Vq%M4U3^>|6cz~WA@ zKnRq08h2^j-P5G0d$jKE?(XjH?)L9=7D8$#O;7u+C+{0`=Kkis`yRj;sgW9~ks7JL zELZ%$s0+HH(`Q9ri~EziQt7yUSD^I!qy8pR6Qnk2*+^5tu=2Q;jf#kf>aHE%j&`z? zN}I;ycCv;1jE-Rdu`~HXOhTyD{CfXmJuKy##7Di8C75vDAv`MVxB4a)F5s~-xk+uK z(tTIQZ?x3)%Jb^97@K20bQjq)erS1oju>HzI3(sIG%Bj_aVLG)=2VuJ*2(24n`ag+ z*?VMW>(GFX3lD4LEI%BN*`D+t3;p$GYM0e z9Hg>v3!p2z(xyHwabiNwD4eUSoRE?oI20f((@<`;`z#RKPS2igiko}RvtBo{TAx-C~DStM*JC# z9L1m>2Ed9mlof-3>{0C3oVShlQW1!(yt zyWE(ptgOt;`q(UxG|gc3Tac?w`BJI0pM}BzXuVaInlu$;{rrs@3jmn4HqB%3L;>)y zWR;Ail|lv_#rvzE z1>9@F92&uc*@Nmr!Gwcj+mW;yK`dV6a$pop&SS_Rbe1MqDq9U=?FE{gq*8b@1438{5#zU#r z5fCtni6|CNT$*(=&VcMmm@-{v@T4Rsr#XNN$~)tuQzsl#*mYd4S5C4qyo2Ei3yX7& zbrvS}qCNmiyuY{>#31($AS{-`8Yz>d98Isug*$S~m0iAjhEHy!<*3Bi<{M6zWlia2 z!Vjn@N~=}Oo5SQHhz>HuvZ@M0CbZDpmwh||x)<@y9Fna^C31q?;R|;I)gB)1_5(b{ zCjkE-pD)6hTrOgVHY#O?diln2zh3XKqQKYeG35rTQcD5?&a;5 zHFe=i3umlz{7j>FawckW2JDBXkg%oeu|-<5uRi7pmaDtcj5GpNG%@e~lj9JbJYM!{FJ)8eB*k zaa~knf%k_mN3WbuQ8tKBGaKM_2>5*kH(z;i?pec|*UeYAZoU5T#_bPcOlh%LY@<$H z91}1sz}H?#NJ#JiE;u;k>V<~&>(@72fbwAh!xL%1U)BiVzXE&(PAfxKy#^#C00000 LNkvXXu0mjf4O*%a literal 0 HcmV?d00001 From 18392e28b6ab689ce334bc112f259b5d8be5c2ce Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Thu, 29 Oct 2015 20:44:12 -0300 Subject: [PATCH 23/78] Fix "Align with view" undo, fixes #1443 --- tools/editor/plugins/spatial_editor_plugin.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 3ab93392650..dadd8c30507 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -1957,11 +1957,11 @@ void SpatialEditorViewport::_menu_option(int p_option) { if (!se) continue; - Vector3 original_scale = sp->get_scale(); - sp->set_global_transform(camera_transform); - sp->set_scale(original_scale); - undo_redo->add_do_method(sp,"set_global_transform",sp->get_global_transform()); - undo_redo->add_undo_method(sp,"set_global_transform",se->original); + Transform xform = camera_transform; + xform.scale_basis(sp->get_scale()); + + undo_redo->add_do_method(sp,"set_global_transform",xform); + undo_redo->add_undo_method(sp,"set_global_transform",sp->get_global_transform()); } undo_redo->commit_action(); } break; From 8c0c279280015391e5620bd59428ccab99683224 Mon Sep 17 00:00:00 2001 From: Phobos Tro Date: Fri, 30 Oct 2015 19:56:07 +0800 Subject: [PATCH 24/78] Fixing memleaks in main/main.cpp --- main/main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 9cd190a0e8d..ef056d32194 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -796,7 +796,6 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas main_args.clear(); print_help(execpath); - if (performance) memdelete(performance); @@ -812,6 +811,8 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas memdelete(packed_data); if (file_access_network_client) memdelete(file_access_network_client); + if(path_remap) + memdelete(path_remap); // Note 1: *zip_packed_data live into *packed_data // Note 2: PackedData::~PackedData destroy this. @@ -820,7 +821,7 @@ Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phas // memdelete( zip_packed_data ); //#endif - + unregister_core_driver_types(); unregister_core_types(); OS::get_singleton()->_cmdline.clear(); From 825bc8b2932acf779703fbfa541725ce432546b1 Mon Sep 17 00:00:00 2001 From: eska Date: Sun, 1 Nov 2015 10:33:28 +0100 Subject: [PATCH 25/78] Add default focus StyleBox to MenuButton --- scene/resources/default_theme/default_theme.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 7e36366e740..ce042eac99a 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -311,6 +311,7 @@ void make_default_theme() { t->set_stylebox("pressed","MenuButton", sb_button_pressed ); t->set_stylebox("hover","MenuButton", sb_button_pressed ); t->set_stylebox("disabled","MenuButton", make_empty_stylebox(0,0,0,0) ); + t->set_stylebox("focus","MenuButton", sb_button_focus ); t->set_font("font","MenuButton", default_font ); From fc2c3bda5c637b82d00b42e5da948a09b8bd9aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 1 Nov 2015 17:50:44 +0100 Subject: [PATCH 26/78] Fix arguments parsing in the main function Fixes #2611 which was a regression from 692216b86ab97db91e7ff3903ffc9ac8e37433f6. The bogus behaviour considered that if there were more than one arguments left to parse, they would be a pair of arguments (switch and its parameter), and thus skipped the next argument in all cases (thus potentially skipping a "-editor", which triggered #2611). This is fixed by checking first for arguments that don't expect a parameter, and only afterwards for arguments that expect a parameter. And if a "pair" of arguments is not valid, we no longer increment the counter. --- main/main.cpp | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 9cd190a0e8d..3ef357e2534 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1007,8 +1007,21 @@ bool Main::start() { bool export_debug=false; List args = OS::get_singleton()->get_cmdline_args(); for (int i=0;i Date: Sun, 1 Nov 2015 20:53:26 +0100 Subject: [PATCH 27/78] Cosmetic fixes to SCons buildsystem - Removed trailing spaces - Made sure all indentation is done using tabs (fixes #39) - Potentially fixed an identation issue for openssl check --- SConstruct | 51 +++++++++++++++-------------- bin/tests/SCsub | 2 -- core/SCsub | 2 -- core/bind/SCsub | 2 -- core/io/SCsub | 2 -- core/math/SCsub | 2 -- core/os/SCsub | 2 -- drivers/SCsub | 1 - drivers/alsa/SCsub | 2 -- drivers/builtin_zlib/SCsub | 2 +- drivers/chibi/SCsub | 2 -- drivers/dds/SCsub | 1 - drivers/etc1/SCsub | 1 - drivers/gl_context/SCsub | 1 - drivers/gles2/shaders/SCsub | 2 -- drivers/jpg/SCsub | 1 - drivers/mpc/SCsub | 1 - drivers/nedmalloc/SCsub | 1 - drivers/nrex/SCsub | 2 -- drivers/ogg/SCsub | 1 - drivers/openssl/SCsub | 2 -- drivers/png/SCsub | 1 - drivers/squish/SCsub | 1 - drivers/theora/SCsub | 3 -- drivers/unix/SCsub | 2 -- drivers/vorbis/SCsub | 2 -- drivers/webp/SCsub | 1 - drivers/windows/SCsub | 2 -- main/SCsub | 2 -- modules/SCsub | 2 -- modules/gdscript/SCsub | 2 -- modules/gridmap/SCsub | 3 -- platform/android/SCsub | 4 +-- platform/bb10/SCsub | 1 - platform/flash/SCsub | 2 -- platform/windows/SCsub | 2 +- scene/2d/SCsub | 2 -- scene/3d/SCsub | 4 +-- scene/SCsub | 2 -- scene/animation/SCsub | 2 -- scene/audio/SCsub | 2 -- scene/gui/SCsub | 2 -- scene/io/SCsub | 2 -- scene/main/SCsub | 2 -- scene/resources/SCsub | 1 - scene/resources/default_theme/SCsub | 2 -- servers/SCsub | 2 -- servers/audio/SCsub | 2 -- servers/physics/SCsub | 2 -- servers/physics/joints/SCsub | 3 -- servers/physics_2d/SCsub | 1 - servers/spatial_sound/SCsub | 2 -- servers/spatial_sound_2d/SCsub | 2 -- servers/visual/SCsub | 2 -- tools/SCsub | 2 -- tools/collada/SCsub | 2 -- tools/doc/SCsub | 2 -- tools/docdump/SCsub | 2 -- tools/editor/SCsub | 11 +++---- tools/editor/fileserver/SCsub | 4 --- tools/editor/icons/SCsub | 19 +++++------ tools/editor/io_plugins/SCsub | 4 --- tools/editor/plugins/SCsub | 4 --- tools/freetype/SCsub | 4 +-- tools/pck/SCsub | 1 - 65 files changed, 46 insertions(+), 159 deletions(-) diff --git a/SConstruct b/SConstruct index 0087d97af36..05c53a15fc3 100644 --- a/SConstruct +++ b/SConstruct @@ -59,7 +59,7 @@ platform_arg = ARGUMENTS.get("platform", False) if (os.name=="posix"): pass elif (os.name=="nt"): - if (os.getenv("VSINSTALLDIR")==None or platform_arg=="android"): + if (os.getenv("VSINSTALLDIR")==None or platform_arg=="android"): custom_tools=['mingw'] env_base=Environment(tools=custom_tools,ENV = {'PATH' : os.environ['PATH']}); @@ -185,7 +185,7 @@ if selected_platform in platform_list: if env['vsproj']=="yes": env.vs_incs = [] env.vs_srcs = [] - + def AddToVSProject( sources ): for x in sources: if type(x) == type(""): @@ -197,12 +197,12 @@ if selected_platform in platform_list: basename = pieces[0] basename = basename.replace('\\\\','/') env.vs_srcs = env.vs_srcs + [basename + ".cpp"] - env.vs_incs = env.vs_incs + [basename + ".h"] - #print basename - env.AddToVSProject = AddToVSProject - + env.vs_incs = env.vs_incs + [basename + ".h"] + #print basename + env.AddToVSProject = AddToVSProject + env.extra_suffix="" - + if env["extra_suffix"] != '' : env.extra_suffix += '.'+env["extra_suffix"] @@ -229,7 +229,7 @@ if selected_platform in platform_list: #must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11) detect.configure(env) - #env['platform_libsuffix'] = env['LIBSUFFIX'] + #env['platform_libsuffix'] = env['LIBSUFFIX'] suffix="."+selected_platform @@ -284,10 +284,11 @@ if selected_platform in platform_list: if (env['musepack']=='yes'): env.Append(CPPFLAGS=['-DMUSEPACK_ENABLED']); - if (env['openssl']!='no'): - env.Append(CPPFLAGS=['-DOPENSSL_ENABLED']); - if (env['openssl']=="builtin"): - env.Append(CPPPATH=['#drivers/builtin_openssl2']) + + if (env['openssl']!='no'): + env.Append(CPPFLAGS=['-DOPENSSL_ENABLED']); + if (env['openssl']=="builtin"): + env.Append(CPPPATH=['#drivers/builtin_openssl2']) if (env["builtin_zlib"]=='yes'): env.Append(CPPPATH=['#drivers/builtin_zlib/zlib']) @@ -337,7 +338,7 @@ if selected_platform in platform_list: if (env['colored']=='yes'): methods.colored(sys,env) - + if (env['etc1']=='yes'): env.Append(CPPFLAGS=['-DETC1_ENABLED']) @@ -356,22 +357,22 @@ if selected_platform in platform_list: SConscript("main/SCsub") SConscript("platform/"+selected_platform+"/SCsub"); # build selected platform - - # Microsoft Visual Studio Project Generation - if (env['vsproj'])=="yes": - + + # Microsoft Visual Studio Project Generation + if (env['vsproj'])=="yes": + AddToVSProject(env.core_sources) AddToVSProject(env.main_sources) - AddToVSProject(env.modules_sources) + AddToVSProject(env.modules_sources) AddToVSProject(env.scene_sources) AddToVSProject(env.servers_sources) AddToVSProject(env.tool_sources) - + #env['MSVS_VERSION']='9.0' env['MSVSBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes" env['MSVSREBUILDCOM'] = "scons platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes vsproj=true" env['MSVSCLEANCOM'] = "scons --clean platform=" + selected_platform + " target=" + env["target"] + " bits=" + env["bits"] + " tools=yes" - + debug_variants = ['Debug|Win32']+['Debug|x64'] release_variants = ['Release|Win32']+['Release|x64'] release_debug_variants = ['Release_Debug|Win32']+['Release_Debug|x64'] @@ -382,11 +383,11 @@ if selected_platform in platform_list: targets = debug_targets + release_targets + release_debug_targets msvproj = env.MSVSProject(target = ['#godot' + env['MSVSPROJECTSUFFIX'] ], incs = env.vs_incs, - srcs = env.vs_srcs, - runfile = targets, - buildtarget = targets, - auto_build_solution=1, - variant = variants) + srcs = env.vs_srcs, + runfile = targets, + buildtarget = targets, + auto_build_solution=1, + variant = variants) else: diff --git a/bin/tests/SCsub b/bin/tests/SCsub index 6613df9c05b..57c9bc63b27 100644 --- a/bin/tests/SCsub +++ b/bin/tests/SCsub @@ -10,5 +10,3 @@ Export('env') lib = env.Library("tests",env.tests_sources) env.Prepend(LIBS=[lib]) - - diff --git a/core/SCsub b/core/SCsub index d04041141c9..4ce91c794f0 100644 --- a/core/SCsub +++ b/core/SCsub @@ -63,5 +63,3 @@ SConscript('bind/SCsub'); lib = env.Library("core",env.core_sources) env.Prepend(LIBS=[lib]) - - diff --git a/core/bind/SCsub b/core/bind/SCsub index c6ba1fa5376..7b4a6acbc07 100644 --- a/core/bind/SCsub +++ b/core/bind/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.core_sources,"*.cpp") Export('env') - - diff --git a/core/io/SCsub b/core/io/SCsub index 5aecb4b915b..3ff9b355a45 100644 --- a/core/io/SCsub +++ b/core/io/SCsub @@ -5,5 +5,3 @@ env.add_source_files(env.core_sources,"*.c") #env.core_sources.append("io/fastlz.c") Export('env') - - diff --git a/core/math/SCsub b/core/math/SCsub index c6ba1fa5376..7b4a6acbc07 100644 --- a/core/math/SCsub +++ b/core/math/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.core_sources,"*.cpp") Export('env') - - diff --git a/core/os/SCsub b/core/os/SCsub index c6ba1fa5376..7b4a6acbc07 100644 --- a/core/os/SCsub +++ b/core/os/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.core_sources,"*.cpp") Export('env') - - diff --git a/drivers/SCsub b/drivers/SCsub index bc46bf2cec3..b9567dec1ae 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -93,4 +93,3 @@ env.Prepend(LIBS=lib_list) #lib = env.Library("drivers",env.drivers_sources) #env.Prepend(LIBS=[lib]) - diff --git a/drivers/alsa/SCsub b/drivers/alsa/SCsub index bcd231579c1..9fbb467baa1 100644 --- a/drivers/alsa/SCsub +++ b/drivers/alsa/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.drivers_sources,"*.cpp") Export('env') - - diff --git a/drivers/builtin_zlib/SCsub b/drivers/builtin_zlib/SCsub index c322b236ab9..e5c81c0b3b1 100644 --- a/drivers/builtin_zlib/SCsub +++ b/drivers/builtin_zlib/SCsub @@ -1,7 +1,7 @@ Import('env') zlib_sources = [ - + "builtin_zlib/zlib/adler32.c", "builtin_zlib/zlib/compress.c", "builtin_zlib/zlib/crc32.c", diff --git a/drivers/chibi/SCsub b/drivers/chibi/SCsub index bcd231579c1..9fbb467baa1 100644 --- a/drivers/chibi/SCsub +++ b/drivers/chibi/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.drivers_sources,"*.cpp") Export('env') - - diff --git a/drivers/dds/SCsub b/drivers/dds/SCsub index e475de1dba7..159829384f8 100644 --- a/drivers/dds/SCsub +++ b/drivers/dds/SCsub @@ -8,4 +8,3 @@ dds_sources = [ env.drivers_sources+=dds_sources #env.add_source_files(env.drivers_sources, dds_sources) - diff --git a/drivers/etc1/SCsub b/drivers/etc1/SCsub index 251c3ffb868..4ce921ad9fd 100644 --- a/drivers/etc1/SCsub +++ b/drivers/etc1/SCsub @@ -12,4 +12,3 @@ if (env["etc1"] != "no"): #env.add_source_files(env.drivers_sources, etc_sources) Export('env') - diff --git a/drivers/gl_context/SCsub b/drivers/gl_context/SCsub index 0177eec6a2e..7cf8629fe18 100644 --- a/drivers/gl_context/SCsub +++ b/drivers/gl_context/SCsub @@ -3,4 +3,3 @@ Export('env'); env.add_source_files(env.drivers_sources,"*.cpp") env.add_source_files(env.drivers_sources,"*.c") - diff --git a/drivers/gles2/shaders/SCsub b/drivers/gles2/shaders/SCsub index 9679223b16c..38177d725fb 100644 --- a/drivers/gles2/shaders/SCsub +++ b/drivers/gles2/shaders/SCsub @@ -6,5 +6,3 @@ if env['BUILDERS'].has_key('GLSL120GLES'): env.GLSL120GLES('canvas_shadow.glsl'); env.GLSL120GLES('blur.glsl'); env.GLSL120GLES('copy.glsl'); - - diff --git a/drivers/jpg/SCsub b/drivers/jpg/SCsub index e1fcc5ea894..df91b10a025 100644 --- a/drivers/jpg/SCsub +++ b/drivers/jpg/SCsub @@ -10,4 +10,3 @@ jpg_sources = [ env.drivers_sources+=jpg_sources #env.add_source_files(env.drivers_sources, jpg_sources) - diff --git a/drivers/mpc/SCsub b/drivers/mpc/SCsub index af61d95e4cf..32ffdb863f3 100644 --- a/drivers/mpc/SCsub +++ b/drivers/mpc/SCsub @@ -19,4 +19,3 @@ env.add_source_files(env.drivers_sources,"*.cpp") #env.add_source_files(env.drivers_sources, mpc_sources) Export('env') - diff --git a/drivers/nedmalloc/SCsub b/drivers/nedmalloc/SCsub index 8c0028b41d4..8e6edd1f964 100644 --- a/drivers/nedmalloc/SCsub +++ b/drivers/nedmalloc/SCsub @@ -3,4 +3,3 @@ Export('env'); env.add_source_files(env.drivers_sources,"*.cpp") #env.add_source_files(env.drivers_sources,"*.c") - diff --git a/drivers/nrex/SCsub b/drivers/nrex/SCsub index 2441d3061b2..a00c7b86f4f 100644 --- a/drivers/nrex/SCsub +++ b/drivers/nrex/SCsub @@ -1,4 +1,3 @@ - Import('env') sources = [ @@ -6,4 +5,3 @@ sources = [ 'regex.cpp', ] env.add_source_files(env.drivers_sources, sources) - diff --git a/drivers/ogg/SCsub b/drivers/ogg/SCsub index dd598900643..c85d4404f35 100644 --- a/drivers/ogg/SCsub +++ b/drivers/ogg/SCsub @@ -8,4 +8,3 @@ ogg_sources = [ if env['theora'] != "yes" or env['use_theoraplayer_binary'] != "yes": env.drivers_sources+=ogg_sources - diff --git a/drivers/openssl/SCsub b/drivers/openssl/SCsub index 7197364e012..6d3e7e6732f 100644 --- a/drivers/openssl/SCsub +++ b/drivers/openssl/SCsub @@ -4,5 +4,3 @@ env.add_source_files(env.drivers_sources,"*.cpp") env.add_source_files(env.drivers_sources,"*.c") Export('env') - - diff --git a/drivers/png/SCsub b/drivers/png/SCsub index 7b937d4dfbd..9ee066cbb2f 100644 --- a/drivers/png/SCsub +++ b/drivers/png/SCsub @@ -38,4 +38,3 @@ env.drivers_sources+=png_sources #env.add_source_files(env.drivers_sources, png_sources) Export('env') - diff --git a/drivers/squish/SCsub b/drivers/squish/SCsub index d55a32ad5ee..da39dc1ebc0 100644 --- a/drivers/squish/SCsub +++ b/drivers/squish/SCsub @@ -21,4 +21,3 @@ if (env["tools"]=="yes"): #env.add_source_files(env.drivers_sources, squish_sources) Export('env') - diff --git a/drivers/theora/SCsub b/drivers/theora/SCsub index ecabce6c9dc..faa1ede6a7a 100644 --- a/drivers/theora/SCsub +++ b/drivers/theora/SCsub @@ -1,4 +1,3 @@ - Import('env') sources = [ @@ -34,5 +33,3 @@ sources = [ if env['use_theoraplayer_binary'] != "yes": env.drivers_sources += sources - - diff --git a/drivers/unix/SCsub b/drivers/unix/SCsub index bcd231579c1..9fbb467baa1 100644 --- a/drivers/unix/SCsub +++ b/drivers/unix/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.drivers_sources,"*.cpp") Export('env') - - diff --git a/drivers/vorbis/SCsub b/drivers/vorbis/SCsub index 2c137629ac2..4a16e80dfc6 100644 --- a/drivers/vorbis/SCsub +++ b/drivers/vorbis/SCsub @@ -1,4 +1,3 @@ - Import('env') sources = [ @@ -37,4 +36,3 @@ env.drivers_sources += sources if env['theora'] != "yes" or env['use_theoraplayer_binary'] != "yes": env.drivers_sources += sources_lib - diff --git a/drivers/webp/SCsub b/drivers/webp/SCsub index 3ae046ff79e..5596edbe093 100644 --- a/drivers/webp/SCsub +++ b/drivers/webp/SCsub @@ -61,4 +61,3 @@ env.drivers_sources+=webp_sources #env.add_source_files(env.drivers_sources, webp_sources) Export('env') - diff --git a/drivers/windows/SCsub b/drivers/windows/SCsub index bcd231579c1..9fbb467baa1 100644 --- a/drivers/windows/SCsub +++ b/drivers/windows/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.drivers_sources,"*.cpp") Export('env') - - diff --git a/main/SCsub b/main/SCsub index 795c427c8dd..fa60ffc3e8f 100644 --- a/main/SCsub +++ b/main/SCsub @@ -8,5 +8,3 @@ Export('env') lib = env.Library("main",env.main_sources) env.Prepend(LIBS=[lib]) - - diff --git a/modules/SCsub b/modules/SCsub index d215f72c089..9215bfd48fe 100644 --- a/modules/SCsub +++ b/modules/SCsub @@ -19,5 +19,3 @@ for x in env.module_list: lib = env_modules.Library("modules",env.modules_sources) env.Prepend(LIBS=[lib]) - - diff --git a/modules/gdscript/SCsub b/modules/gdscript/SCsub index d20da72b727..403fe68f662 100644 --- a/modules/gdscript/SCsub +++ b/modules/gdscript/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.modules_sources,"*.cpp") Export('env') - - diff --git a/modules/gridmap/SCsub b/modules/gridmap/SCsub index 4cb47e7e67d..211a043468e 100644 --- a/modules/gridmap/SCsub +++ b/modules/gridmap/SCsub @@ -1,6 +1,3 @@ Import('env') env.add_source_files(env.modules_sources,"*.cpp") - - - diff --git a/platform/android/SCsub b/platform/android/SCsub index 6feeb8b3655..834ee58adcb 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -62,10 +62,10 @@ pp_baseout.write( manifest ) for x in env.android_source_files: - shutil.copy(x,abspath+"/java/src/com/android/godot") + shutil.copy(x,abspath+"/java/src/com/android/godot") for x in env.android_module_libraries: - shutil.copy(x,abspath+"/java/libs") + shutil.copy(x,abspath+"/java/libs") env_android.SharedLibrary("#bin/libgodot",[android_objects],SHLIBSUFFIX=env["SHLIBSUFFIX"]) diff --git a/platform/bb10/SCsub b/platform/bb10/SCsub index 24f2b5d242b..81f6e726e47 100644 --- a/platform/bb10/SCsub +++ b/platform/bb10/SCsub @@ -19,4 +19,3 @@ if env['bb10_lgles_override'] == "yes": prog = None prog = env_bps.Program('#bin/godot', bb10_lib) - diff --git a/platform/flash/SCsub b/platform/flash/SCsub index b7aef3b65d7..4e5f26d52a3 100644 --- a/platform/flash/SCsub +++ b/platform/flash/SCsub @@ -36,5 +36,3 @@ java -jar $ALCHEMY/usr/lib/asc2.jar -md -strict -optimize -AS3 \ -import ../platform/flash/lib/libGL.abc \ ../platform/flash/Console.as """ - - diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 1ad32e79897..e7d7285b433 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -13,7 +13,7 @@ common_win=[ env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX"]) -# Microsoft Visual Studio Project Generation +# Microsoft Visual Studio Project Generation if (env['vsproj'])=="yes": env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"] for x in common_win: diff --git a/scene/2d/SCsub b/scene/2d/SCsub index 055d2f24741..bbe59b30540 100644 --- a/scene/2d/SCsub +++ b/scene/2d/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.scene_sources,"*.cpp") Export('env') - - diff --git a/scene/3d/SCsub b/scene/3d/SCsub index 3c2144bedcd..116e6415934 100644 --- a/scene/3d/SCsub +++ b/scene/3d/SCsub @@ -4,10 +4,8 @@ Import('env') if (env["disable_3d"]=="yes"): env.scene_sources.append("3d/spatial.cpp") - env.scene_sources.append("3d/skeleton.cpp") + env.scene_sources.append("3d/skeleton.cpp") else: env.add_source_files(env.scene_sources,"*.cpp") Export('env') - - diff --git a/scene/SCsub b/scene/SCsub index 8c4f0499c42..6d1dd0044fc 100644 --- a/scene/SCsub +++ b/scene/SCsub @@ -18,5 +18,3 @@ SConscript('io/SCsub'); lib = env.Library("scene",env.scene_sources) env.Prepend(LIBS=[lib]) - - diff --git a/scene/animation/SCsub b/scene/animation/SCsub index 055d2f24741..bbe59b30540 100644 --- a/scene/animation/SCsub +++ b/scene/animation/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.scene_sources,"*.cpp") Export('env') - - diff --git a/scene/audio/SCsub b/scene/audio/SCsub index 055d2f24741..bbe59b30540 100644 --- a/scene/audio/SCsub +++ b/scene/audio/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.scene_sources,"*.cpp") Export('env') - - diff --git a/scene/gui/SCsub b/scene/gui/SCsub index 055d2f24741..bbe59b30540 100644 --- a/scene/gui/SCsub +++ b/scene/gui/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.scene_sources,"*.cpp") Export('env') - - diff --git a/scene/io/SCsub b/scene/io/SCsub index 055d2f24741..bbe59b30540 100644 --- a/scene/io/SCsub +++ b/scene/io/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.scene_sources,"*.cpp") Export('env') - - diff --git a/scene/main/SCsub b/scene/main/SCsub index 055d2f24741..bbe59b30540 100644 --- a/scene/main/SCsub +++ b/scene/main/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.scene_sources,"*.cpp") Export('env') - - diff --git a/scene/resources/SCsub b/scene/resources/SCsub index eaa282ae1a2..bb9766e1caf 100644 --- a/scene/resources/SCsub +++ b/scene/resources/SCsub @@ -6,4 +6,3 @@ env.add_source_files(env.scene_sources,"*.c") Export('env') SConscript("default_theme/SCsub"); - diff --git a/scene/resources/default_theme/SCsub b/scene/resources/default_theme/SCsub index 055d2f24741..bbe59b30540 100644 --- a/scene/resources/default_theme/SCsub +++ b/scene/resources/default_theme/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.scene_sources,"*.cpp") Export('env') - - diff --git a/servers/SCsub b/servers/SCsub index 3871c30cfa0..d8618471018 100644 --- a/servers/SCsub +++ b/servers/SCsub @@ -15,5 +15,3 @@ SConscript('spatial_sound_2d/SCsub'); lib = env.Library("servers",env.servers_sources) env.Prepend(LIBS=[lib]) - - diff --git a/servers/audio/SCsub b/servers/audio/SCsub index 16fe3a59ac3..d31af2c1c49 100644 --- a/servers/audio/SCsub +++ b/servers/audio/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.servers_sources,"*.cpp") Export('env') - - diff --git a/servers/physics/SCsub b/servers/physics/SCsub index 3b84c5ef185..95296eadbee 100644 --- a/servers/physics/SCsub +++ b/servers/physics/SCsub @@ -5,5 +5,3 @@ env.add_source_files(env.servers_sources,"*.cpp") Export('env') SConscript("joints/SCsub") - - diff --git a/servers/physics/joints/SCsub b/servers/physics/joints/SCsub index 97d6edea21e..d31af2c1c49 100644 --- a/servers/physics/joints/SCsub +++ b/servers/physics/joints/SCsub @@ -3,6 +3,3 @@ Import('env') env.add_source_files(env.servers_sources,"*.cpp") Export('env') - - - diff --git a/servers/physics_2d/SCsub b/servers/physics_2d/SCsub index a2c2b51a616..ebb7f8be00d 100644 --- a/servers/physics_2d/SCsub +++ b/servers/physics_2d/SCsub @@ -1,4 +1,3 @@ Import('env') env.add_source_files(env.servers_sources,"*.cpp") - diff --git a/servers/spatial_sound/SCsub b/servers/spatial_sound/SCsub index 16fe3a59ac3..d31af2c1c49 100644 --- a/servers/spatial_sound/SCsub +++ b/servers/spatial_sound/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.servers_sources,"*.cpp") Export('env') - - diff --git a/servers/spatial_sound_2d/SCsub b/servers/spatial_sound_2d/SCsub index 16fe3a59ac3..d31af2c1c49 100644 --- a/servers/spatial_sound_2d/SCsub +++ b/servers/spatial_sound_2d/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.servers_sources,"*.cpp") Export('env') - - diff --git a/servers/visual/SCsub b/servers/visual/SCsub index 16fe3a59ac3..d31af2c1c49 100644 --- a/servers/visual/SCsub +++ b/servers/visual/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.servers_sources,"*.cpp") Export('env') - - diff --git a/tools/SCsub b/tools/SCsub index ce7df2c35b8..5613d8a6c91 100644 --- a/tools/SCsub +++ b/tools/SCsub @@ -17,5 +17,3 @@ if (env["tools"]!="no"): lib = env.Library("tool",env.tool_sources) env.Prepend(LIBS=[lib]) - - diff --git a/tools/collada/SCsub b/tools/collada/SCsub index c8eaa596d18..34524f10efb 100644 --- a/tools/collada/SCsub +++ b/tools/collada/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.tool_sources,"*.cpp") Export('env') - - diff --git a/tools/doc/SCsub b/tools/doc/SCsub index c8eaa596d18..34524f10efb 100644 --- a/tools/doc/SCsub +++ b/tools/doc/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.tool_sources,"*.cpp") Export('env') - - diff --git a/tools/docdump/SCsub b/tools/docdump/SCsub index c8eaa596d18..34524f10efb 100644 --- a/tools/docdump/SCsub +++ b/tools/docdump/SCsub @@ -3,5 +3,3 @@ Import('env') env.add_source_files(env.tool_sources,"*.cpp") Export('env') - - diff --git a/tools/editor/SCsub b/tools/editor/SCsub index 73ec5301774..cd46ff83533 100644 --- a/tools/editor/SCsub +++ b/tools/editor/SCsub @@ -28,7 +28,7 @@ def make_doc_header(target,source,env): - + if (env["tools"]=="yes"): @@ -43,17 +43,16 @@ if (env["tools"]=="yes"): f.write(reg_exporters_inc) f.write(reg_exporters) f.close() - + env.Depends("#tools/editor/doc_data_compressed.h","#doc/base/classes.xml") env.Command("#tools/editor/doc_data_compressed.h","#doc/base/classes.xml",make_doc_header) #make_doc_header(env.File("#tools/editor/doc_data_raw.h").srcnode().abspath,env.File("#doc/base/classes.xml").srcnode().abspath,env) - + env.add_source_files(env.tool_sources,"*.cpp") - + Export('env') - SConscript('icons/SCsub'); + SConscript('icons/SCsub'); SConscript('plugins/SCsub'); SConscript('fileserver/SCsub'); SConscript('io_plugins/SCsub'); - diff --git a/tools/editor/fileserver/SCsub b/tools/editor/fileserver/SCsub index b525fb3f75f..363a2ce4c0a 100644 --- a/tools/editor/fileserver/SCsub +++ b/tools/editor/fileserver/SCsub @@ -1,7 +1,3 @@ Import('env') Export('env') env.add_source_files(env.tool_sources,"*.cpp") - - - - diff --git a/tools/editor/icons/SCsub b/tools/editor/icons/SCsub index aea053d22b0..addf6879a22 100644 --- a/tools/editor/icons/SCsub +++ b/tools/editor/icons/SCsub @@ -9,30 +9,30 @@ def make_editor_icons_action(target, source, env): pixmaps = source s = cStringIO.StringIO() - + s.write("#include \"editor_icons.h\"\n\n") s.write("#include \"scene/resources/theme.h\"\n\n") for x in pixmaps: - + x=str(x) var_str=os.path.basename(x)[:-4]+"_png"; #print(var_str) - + s.write("static const unsigned char "+ var_str +"[]={\n"); - + pngf=open(x,"rb"); - + b=pngf.read(1); while(len(b)==1): s.write(hex(ord(b))) b=pngf.read(1); if (len(b)==1): s.write(",") - + s.write("\n};\n\n\n"); pngf.close(); - + s.write("static Ref make_icon(const uint8_t* p_png) {\n") s.write("\tRef texture( memnew( ImageTexture ) );\n") s.write("\ttexture->create_from_image( Image(p_png),ImageTexture::FLAG_FILTER );\n") @@ -42,14 +42,14 @@ def make_editor_icons_action(target, source, env): s.write("void editor_register_icons(Ref p_theme) {\n\n") for x in pixmaps: - + x=os.path.basename(str(x)) type=x[5:-4].title().replace("_",""); var_str=x[:-4]+"_png"; s.write("\tp_theme->set_icon(\""+type+"\",\"EditorIcons\",make_icon("+var_str+"));\n"); s.write("\n\n}\n\n"); - + f = open(dst,"wb") f.write(s.getvalue()) f.close() @@ -63,4 +63,3 @@ env.Alias('editor_icons',[env.MakeEditorIconsBuilder('#tools/editor/editor_icons env.tool_sources.append("#tools/editor/editor_icons.cpp") Export('env') - diff --git a/tools/editor/io_plugins/SCsub b/tools/editor/io_plugins/SCsub index b525fb3f75f..363a2ce4c0a 100644 --- a/tools/editor/io_plugins/SCsub +++ b/tools/editor/io_plugins/SCsub @@ -1,7 +1,3 @@ Import('env') Export('env') env.add_source_files(env.tool_sources,"*.cpp") - - - - diff --git a/tools/editor/plugins/SCsub b/tools/editor/plugins/SCsub index b525fb3f75f..363a2ce4c0a 100644 --- a/tools/editor/plugins/SCsub +++ b/tools/editor/plugins/SCsub @@ -1,7 +1,3 @@ Import('env') Export('env') env.add_source_files(env.tool_sources,"*.cpp") - - - - diff --git a/tools/freetype/SCsub b/tools/freetype/SCsub index a31b8c46020..65b4827f9c6 100644 --- a/tools/freetype/SCsub +++ b/tools/freetype/SCsub @@ -65,7 +65,5 @@ if (env["freetype"]=="builtin"): # lib = env.Library("freetype_builtin",ft_sources) # env.Prepend(LIBS=[lib]) - + Export('env') - - diff --git a/tools/pck/SCsub b/tools/pck/SCsub index b1fed9a4724..cf98ae145d1 100644 --- a/tools/pck/SCsub +++ b/tools/pck/SCsub @@ -2,4 +2,3 @@ Import('env') if env["tools"] == "yes": env.add_source_files(env.tool_sources, "*.cpp") - From b54d96ceba19801f3ec59e1a611f74b428cdebe2 Mon Sep 17 00:00:00 2001 From: Saracen Date: Mon, 2 Nov 2015 13:16:28 +0000 Subject: [PATCH 28/78] Added ability to write directly to 4-dimensional position vector from within custom vertex shader code. Bugfixes to shader graph code generation concerning xforms. --- drivers/gles2/rasterizer_gles2.cpp | 3 + drivers/gles2/shader_compiler_gles2.cpp | 224 ++++++++++++------------ drivers/gles2/shader_compiler_gles2.h | 3 + scene/resources/shader_graph.cpp | 26 ++- servers/visual/shader_language.cpp | 1 + 5 files changed, 143 insertions(+), 114 deletions(-) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index d84ee5a7589..44175c2cc3c 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -4641,6 +4641,9 @@ void RasterizerGLES2::_update_shader( Shader* p_shader) const { enablers.push_back("#define USE_TIME\n"); uses_time=true; } + if (vertex_flags.vertex_code_writes_position) { + enablers.push_back("#define VERTEX_SHADER_WRITE_POSITION\n"); + } material_shader.set_custom_shader_code(p_shader->custom_code_id,vertex_code, vertex_globals,fragment_code, light_code, fragment_globals,uniform_names,enablers); } else if (p_shader->mode==VS::SHADER_CANVAS_ITEM) { diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index d57512c9363..c8f59ce22b3 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -154,6 +154,9 @@ String ShaderCompilerGLES2::dump_node_code(SL::Node *p_node,int p_level,bool p_a if (vnode->name==vname_vertex && p_assign_left) { vertex_code_writes_vertex=true; } + if (vnode->name == vname_position && p_assign_left) { + vertex_code_writes_position = true; + } if (vnode->name==vname_color_interp) { flags->use_color_interp=true; } @@ -659,6 +662,7 @@ Error ShaderCompilerGLES2::compile(const String& p_code, ShaderLanguage::ShaderT uses_texpixel_size=false; uses_worldvec=false; vertex_code_writes_vertex=false; + vertex_code_writes_position = false; uses_shadow_color=false; uniforms=r_uniforms; flags=&r_flags; @@ -690,6 +694,7 @@ Error ShaderCompilerGLES2::compile(const String& p_code, ShaderLanguage::ShaderT r_flags.uses_texscreen=uses_texscreen; r_flags.uses_texpos=uses_texpos; r_flags.vertex_code_writes_vertex=vertex_code_writes_vertex; + r_flags.vertex_code_writes_position=vertex_code_writes_position; r_flags.uses_discard=uses_discard; r_flags.uses_screen_uv=uses_screen_uv; r_flags.uses_light=uses_light; @@ -778,125 +783,127 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() { replace_table["texscreen"]= "texscreen"; replace_table["texpos"]= "texpos"; - mode_replace_table[0]["SRC_VERTEX"]="vertex_in.xyz"; - mode_replace_table[0]["SRC_NORMAL"]="normal_in"; - mode_replace_table[0]["SRC_TANGENT"]="tangent_in"; - mode_replace_table[0]["SRC_BINORMALF"]="binormalf"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["POSITION"] = "gl_Position"; - mode_replace_table[0]["VERTEX"]="vertex_interp"; - mode_replace_table[0]["NORMAL"]="normal_interp"; - mode_replace_table[0]["TANGENT"]="tangent_interp"; - mode_replace_table[0]["BINORMAL"]="binormal_interp"; - mode_replace_table[0]["UV"]="uv_interp.xy"; - mode_replace_table[0]["UV2"]="uv_interp.zw"; - mode_replace_table[0]["COLOR"]="color_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_VERTEX"] = "vertex_in.xyz"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_NORMAL"] = "normal_in"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_TANGENT"]="tangent_in"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SRC_BINORMALF"]="binormalf"; + + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["VERTEX"]="vertex_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["NORMAL"]="normal_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["TANGENT"]="tangent_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["BINORMAL"]="binormal_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["UV"]="uv_interp.xy"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["UV2"]="uv_interp.zw"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["COLOR"]="color_interp"; //@TODO convert to glsl stuff - mode_replace_table[0]["SPEC_EXP"]="vertex_specular_exp"; - mode_replace_table[0]["WORLD_MATRIX"]="world_transform"; - mode_replace_table[0]["INV_CAMERA_MATRIX"]="camera_inverse_transform"; - mode_replace_table[0]["PROJECTION_MATRIX"]="projection_transform"; - mode_replace_table[0]["MODELVIEW_MATRIX"]="modelview"; - mode_replace_table[0]["POINT_SIZE"]="gl_PointSize"; - mode_replace_table[0]["VAR1"]="var1_interp"; - mode_replace_table[0]["VAR2"]="var2_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SPEC_EXP"]="vertex_specular_exp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["WORLD_MATRIX"]="world_transform"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["INV_CAMERA_MATRIX"]="camera_inverse_transform"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["PROJECTION_MATRIX"]="projection_transform"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["MODELVIEW_MATRIX"]="modelview"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["POINT_SIZE"]="gl_PointSize"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["VAR1"]="var1_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["VAR2"]="var2_interp"; -// mode_replace_table[0]["SCREEN_POS"]="SCREEN_POS"; -// mode_replace_table[0]["SCREEN_SIZE"]="SCREEN_SIZE"; - mode_replace_table[0]["INSTANCE_ID"]="instance_id"; - mode_replace_table[0]["TIME"]="time"; +// mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SCREEN_POS"]="SCREEN_POS"; +// mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["SCREEN_SIZE"]="SCREEN_SIZE"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["INSTANCE_ID"]="instance_id"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_VERTEX]["TIME"]="time"; - mode_replace_table[1]["VERTEX"]="vertex"; - //mode_replace_table[1]["POSITION"]="IN_POSITION"; - mode_replace_table[1]["NORMAL"]="normal"; - mode_replace_table[1]["TANGENT"]="tangent"; - mode_replace_table[1]["POSITION"]="gl_Position"; - mode_replace_table[1]["BINORMAL"]="binormal"; - mode_replace_table[1]["NORMALMAP"]="normalmap"; - mode_replace_table[1]["NORMALMAP_DEPTH"]="normaldepth"; - mode_replace_table[1]["VAR1"]="var1_interp"; - mode_replace_table[1]["VAR2"]="var2_interp"; - mode_replace_table[1]["UV"]="uv"; - mode_replace_table[1]["UV2"]="uv2"; - mode_replace_table[1]["SCREEN_UV"]="screen_uv"; - mode_replace_table[1]["VAR1"]="var1_interp"; - mode_replace_table[1]["VAR2"]="var2_interp"; - mode_replace_table[1]["COLOR"]="color"; - mode_replace_table[1]["DIFFUSE"]="diffuse.rgb"; - mode_replace_table[1]["DIFFUSE_ALPHA"]="diffuse"; - mode_replace_table[1]["SPECULAR"]="specular"; - mode_replace_table[1]["EMISSION"]="emission"; - mode_replace_table[1]["SHADE_PARAM"]="shade_param"; - mode_replace_table[1]["SPEC_EXP"]="specular_exp"; - mode_replace_table[1]["GLOW"]="glow"; - mode_replace_table[1]["DISCARD"]="discard_"; - mode_replace_table[1]["POINT_COORD"]="gl_PointCoord"; - mode_replace_table[1]["INV_CAMERA_MATRIX"]="camera_inverse_transform"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["VERTEX"]="vertex"; + //mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["POSITION"]="IN_POSITION"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["NORMAL"]="normal"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["TANGENT"]="tangent"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["POSITION"]="gl_Position"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["BINORMAL"]="binormal"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["NORMALMAP"]="normalmap"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["NORMALMAP_DEPTH"]="normaldepth"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["VAR1"]="var1_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["VAR2"]="var2_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["UV"]="uv"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["UV2"]="uv2"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["SCREEN_UV"]="screen_uv"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["VAR1"]="var1_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["VAR2"]="var2_interp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["COLOR"]="color"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["DIFFUSE"]="diffuse.rgb"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["DIFFUSE_ALPHA"]="diffuse"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["SPECULAR"]="specular"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["EMISSION"]="emission"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["SHADE_PARAM"]="shade_param"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["SPEC_EXP"]="specular_exp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["GLOW"]="glow"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["DISCARD"]="discard_"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["POINT_COORD"]="gl_PointCoord"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["INV_CAMERA_MATRIX"]="camera_inverse_transform"; - //mode_replace_table[1]["SCREEN_POS"]="SCREEN_POS"; - //mode_replace_table[1]["SCREEN_TEXEL_SIZE"]="SCREEN_TEXEL_SIZE"; - mode_replace_table[1]["TIME"]="time"; + //mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["SCREEN_POS"]="SCREEN_POS"; + //mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["SCREEN_TEXEL_SIZE"]="SCREEN_TEXEL_SIZE"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_FRAGMENT]["TIME"]="time"; ////////////// - mode_replace_table[2]["NORMAL"]="normal"; - //mode_replace_table[2]["POSITION"]="IN_POSITION"; - mode_replace_table[2]["LIGHT_DIR"]="light_dir"; - mode_replace_table[2]["LIGHT_DIFFUSE"]="light_diffuse"; - mode_replace_table[2]["LIGHT_SPECULAR"]="light_specular"; - mode_replace_table[2]["EYE_VEC"]="eye_vec"; - mode_replace_table[2]["DIFFUSE"]="mdiffuse"; - mode_replace_table[2]["SPECULAR"]="specular"; - mode_replace_table[2]["SPECULAR_EXP"]="specular_exp"; - mode_replace_table[2]["SHADE_PARAM"]="shade_param"; - mode_replace_table[2]["LIGHT"]="light"; - mode_replace_table[2]["POINT_COORD"]="gl_PointCoord"; - mode_replace_table[2]["TIME"]="time"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["NORMAL"]="normal"; + //mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["POSITION"]="IN_POSITION"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["LIGHT_DIR"]="light_dir"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["LIGHT_DIFFUSE"]="light_diffuse"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["LIGHT_SPECULAR"]="light_specular"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["EYE_VEC"]="eye_vec"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["DIFFUSE"]="mdiffuse"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["SPECULAR"]="specular"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["SPECULAR_EXP"]="specular_exp"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["SHADE_PARAM"]="shade_param"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["LIGHT"]="light"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["POINT_COORD"]="gl_PointCoord"; + mode_replace_table[ShaderLanguage::SHADER_MATERIAL_LIGHT]["TIME"]="time"; - mode_replace_table[3]["SRC_VERTEX"]="src_vtx"; - mode_replace_table[3]["VERTEX"]="outvec.xy"; - mode_replace_table[3]["WORLD_VERTEX"]="outvec.xy"; - mode_replace_table[3]["UV"]="uv_interp"; - mode_replace_table[3]["COLOR"]="color_interp"; - mode_replace_table[3]["VAR1"]="var1_interp"; - mode_replace_table[3]["VAR2"]="var2_interp"; - mode_replace_table[3]["POINT_SIZE"]="gl_PointSize"; - mode_replace_table[3]["WORLD_MATRIX"]="modelview_matrix"; - mode_replace_table[3]["PROJECTION_MATRIX"]="projection_matrix"; - mode_replace_table[3]["EXTRA_MATRIX"]="extra_matrix"; - mode_replace_table[3]["TIME"]="time"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["SRC_VERTEX"]="src_vtx"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["VERTEX"]="outvec.xy"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["WORLD_VERTEX"]="outvec.xy"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["UV"]="uv_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["COLOR"]="color_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["VAR1"]="var1_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["VAR2"]="var2_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["POINT_SIZE"]="gl_PointSize"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["WORLD_MATRIX"]="modelview_matrix"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["PROJECTION_MATRIX"]="projection_matrix"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["EXTRA_MATRIX"]="extra_matrix"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_VERTEX]["TIME"]="time"; - mode_replace_table[4]["POSITION"]="gl_Position"; - mode_replace_table[4]["NORMAL"]="normal"; - mode_replace_table[4]["NORMALMAP"]="normal_map"; - mode_replace_table[4]["NORMALMAP_DEPTH"]="normal_depth"; - mode_replace_table[4]["UV"]="uv_interp"; - mode_replace_table[4]["SRC_COLOR"]="color_interp"; - mode_replace_table[4]["COLOR"]="color"; - mode_replace_table[4]["TEXTURE"]="texture"; - mode_replace_table[4]["TEXTURE_PIXEL_SIZE"]="texpixel_size"; - mode_replace_table[4]["VAR1"]="var1_interp"; - mode_replace_table[4]["VAR2"]="var2_interp"; - mode_replace_table[4]["SCREEN_UV"]="screen_uv"; - mode_replace_table[4]["POINT_COORD"]="gl_PointCoord"; - mode_replace_table[4]["TIME"]="time"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["POSITION"]="gl_Position"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["NORMAL"]="normal"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["NORMALMAP"]="normal_map"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["NORMALMAP_DEPTH"]="normal_depth"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["UV"]="uv_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["SRC_COLOR"]="color_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["COLOR"]="color"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["TEXTURE"]="texture"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["TEXTURE_PIXEL_SIZE"]="texpixel_size"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["VAR1"]="var1_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["VAR2"]="var2_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["SCREEN_UV"]="screen_uv"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["POINT_COORD"]="gl_PointCoord"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_FRAGMENT]["TIME"]="time"; - mode_replace_table[5]["POSITION"]="gl_Position"; - mode_replace_table[5]["NORMAL"]="normal"; - mode_replace_table[5]["UV"]="uv_interp"; - mode_replace_table[5]["COLOR"]="color"; - mode_replace_table[5]["TEXTURE"]="texture"; - mode_replace_table[5]["TEXTURE_PIXEL_SIZE"]="texpixel_size"; - mode_replace_table[5]["VAR1"]="var1_interp"; - mode_replace_table[5]["VAR2"]="var2_interp"; - mode_replace_table[5]["LIGHT_VEC"]="light_vec"; - mode_replace_table[5]["LIGHT_HEIGHT"]="light_height"; - mode_replace_table[5]["LIGHT_COLOR"]="light"; - mode_replace_table[5]["LIGHT_UV"]="light_uv"; - mode_replace_table[5]["LIGHT"]="light_out"; - mode_replace_table[5]["SHADOW"]="shadow_color"; - mode_replace_table[5]["SCREEN_UV"]="screen_uv"; - mode_replace_table[5]["POINT_COORD"]="gl_PointCoord"; - mode_replace_table[5]["TIME"]="time"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["POSITION"]="gl_Position"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["NORMAL"]="normal"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["UV"]="uv_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["COLOR"]="color"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["TEXTURE"]="texture"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["TEXTURE_PIXEL_SIZE"]="texpixel_size"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["VAR1"]="var1_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["VAR2"]="var2_interp"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_VEC"]="light_vec"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_HEIGHT"]="light_height"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_COLOR"]="light"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT_UV"]="light_uv"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["LIGHT"]="light_out"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["SHADOW"]="shadow_color"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["SCREEN_UV"]="screen_uv"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["POINT_COORD"]="gl_PointCoord"; + mode_replace_table[ShaderLanguage::SHADER_CANVAS_ITEM_LIGHT]["TIME"]="time"; @@ -917,6 +924,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() { vname_var1_interp="VAR1"; vname_var2_interp="VAR2"; vname_vertex="VERTEX"; + vname_position = "POSITION"; vname_light="LIGHT"; vname_time="TIME"; vname_normalmap="NORMALMAP"; diff --git a/drivers/gles2/shader_compiler_gles2.h b/drivers/gles2/shader_compiler_gles2.h index 43902a75367..77532e03ff8 100644 --- a/drivers/gles2/shader_compiler_gles2.h +++ b/drivers/gles2/shader_compiler_gles2.h @@ -55,6 +55,7 @@ private: bool uses_texpixel_size; bool uses_worldvec; bool vertex_code_writes_vertex; + bool vertex_code_writes_position; bool uses_shadow_color; bool sinh_used; @@ -76,6 +77,7 @@ private: StringName vname_var1_interp; StringName vname_var2_interp; StringName vname_vertex; + StringName vname_position; StringName vname_light; StringName vname_time; StringName vname_normalmap; @@ -107,6 +109,7 @@ public: bool uses_texpos; bool uses_normalmap; bool vertex_code_writes_vertex; + bool vertex_code_writes_position; bool uses_discard; bool uses_screen_uv; bool use_color_interp; diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp index 49a1bdccb1e..d5204f45d54 100644 --- a/scene/resources/shader_graph.cpp +++ b/scene/resources/shader_graph.cpp @@ -2083,7 +2083,7 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vectordefaults[slot]; \ - code+=String(typestr[3])+" "+p_inputs[slot]+"=mat4(\n";\ + code+=String(typestr[2])+" "+p_inputs[slot]+"=mat4(\n";\ code+="\tvec4(vec3("+rtos(xf.basis.get_axis(0).x)+","+rtos(xf.basis.get_axis(0).y)+","+rtos(xf.basis.get_axis(0).z)+"),0),\n";\ code+="\tvec4(vec3("+rtos(xf.basis.get_axis(1).x)+","+rtos(xf.basis.get_axis(1).y)+","+rtos(xf.basis.get_axis(1).z)+"),0),\n";\ code+="\tvec4(vec3("+rtos(xf.basis.get_axis(2).x)+","+rtos(xf.basis.get_axis(2).y)+","+rtos(xf.basis.get_axis(2).z)+"),0),\n";\ @@ -2393,15 +2393,29 @@ void ShaderGraph::_add_node_code(ShaderType p_type,Node *p_node,const Vectorid,0)+"=xform("+p_inputs[0]+","+p_inputs[1]+","+p_inputs[2]+","+","+p_inputs[3]+");\n"; + code += OUTNAME(p_node->id, 0) + "=mat4(" + + "vec4(" + p_inputs[0] + ".x," + p_inputs[0] + ".y," + p_inputs[0] + ".z, 0.0)," + "vec4(" + p_inputs[1] + ".x," + p_inputs[1] + ".y," + p_inputs[1] + ".z, 0.0)," + "vec4(" + p_inputs[2] + ".x," + p_inputs[2] + ".y," + p_inputs[2] + ".z, 0.0)," + "vec4(" + p_inputs[3] + ".x," + p_inputs[3] + ".y," + p_inputs[3] + ".z, 1.0));\n"; }break; case NODE_XFORM_TO_VEC: { DEF_MATRIX(0); - code += OUTNAME(p_node->id,0)+"="+p_inputs[0]+".x;\n"; - code += OUTNAME(p_node->id,1)+"="+p_inputs[0]+".y;\n"; - code += OUTNAME(p_node->id,2)+"="+p_inputs[0]+".z;\n"; - code += OUTNAME(p_node->id,3)+"="+p_inputs[0]+".o;\n"; + code += OUTNAME(p_node->id, 0) + ";\n"; + code += OUTNAME(p_node->id, 1) + ";\n"; + code += OUTNAME(p_node->id, 2) + ";\n"; + code += OUTNAME(p_node->id, 3) + ";\n"; + code += "{\n"; + code += "\tvec4 xform_row_01=" + p_inputs[0] + ".x;\n"; + code += "\tvec4 xform_row_02=" + p_inputs[0] + ".y;\n"; + code += "\tvec4 xform_row_03=" + p_inputs[0] + ".z;\n"; + code += "\tvec4 xform_row_04=" + p_inputs[0] + ".w;\n"; + code += "\t" + OUTVAR(p_node->id, 0) + "=vec3(xform_row_01.x, xform_row_01.y, xform_row_01.z);\n"; + code += "\t" + OUTVAR(p_node->id, 1) + "=vec3(xform_row_02.x, xform_row_02.y, xform_row_02.z);\n"; + code += "\t" + OUTVAR(p_node->id, 2) + "=vec3(xform_row_03.x, xform_row_03.y, xform_row_03.z);\n"; + code += "\t" + OUTVAR(p_node->id, 3) + "=vec3(xform_row_04.x, xform_row_04.y, xform_row_04.z);\n"; + code += "}\n"; }break; case NODE_SCALAR_INTERP: { DEF_SCALAR(0); diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index ea56306241e..6532c3f0ac3 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1043,6 +1043,7 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::vertex_builtins_defs[]={ { "SRC_TANGENT", TYPE_VEC3}, { "SRC_BINORMALF", TYPE_FLOAT}, + { "POSITION", TYPE_VEC4 }, { "VERTEX", TYPE_VEC3}, { "NORMAL", TYPE_VEC3}, { "TANGENT", TYPE_VEC3}, From 56b7567b55df24ef0e78ecea6d2eea427d0ed066 Mon Sep 17 00:00:00 2001 From: Saracen Date: Mon, 19 Oct 2015 20:40:24 +0100 Subject: [PATCH 29/78] Added missing saving support to animation editor. --- .../animation_player_editor_plugin.cpp | 180 +++++++++++++++--- .../plugins/animation_player_editor_plugin.h | 22 ++- 2 files changed, 172 insertions(+), 30 deletions(-) diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index f8c484e8869..6ab5af539ac 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -27,7 +27,9 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*************************************************************************/ #include "animation_player_editor_plugin.h" +#include "globals.h" #include "io/resource_loader.h" +#include "io/resource_saver.h" #include "os/keyboard.h" #include "tools/editor/editor_settings.h" @@ -98,6 +100,8 @@ void AnimationPlayerEditor::_notification(int p_what) { duplicate_anim->set_icon( get_icon("Duplicate","EditorIcons") ); autoplay->set_icon( get_icon("AutoPlay","EditorIcons") ); load_anim->set_icon( get_icon("Folder","EditorIcons") ); + save_anim->set_icon(get_icon("Save", "EditorIcons")); + save_anim->get_popup()->connect("item_pressed", this, "_animation_save_menu"); remove_anim->set_icon( get_icon("Remove","EditorIcons") ); edit_anim->set_icon( get_icon("Edit","EditorIcons") ); blend_anim->set_icon( get_icon("Blend","EditorIcons") ); @@ -367,8 +371,78 @@ void AnimationPlayerEditor::_animation_load() { } file->popup_centered_ratio(); + current_option = RESOURCE_LOAD; +} +void AnimationPlayerEditor::_animation_save_in_path(const Ref& p_resource, const String& p_path) { + + int flg = 0; + if (EditorSettings::get_singleton()->get("on_save/compress_binary_resources")) + flg |= ResourceSaver::FLAG_COMPRESS; + if (EditorSettings::get_singleton()->get("on_save/save_paths_as_relative")) + flg |= ResourceSaver::FLAG_RELATIVE_PATHS; + + String path = Globals::get_singleton()->localize_path(p_path); + Error err = ResourceSaver::save(path, p_resource, flg | ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); + + if (err != OK) { + accept->set_text("Error saving resource!"); + accept->popup_centered_minsize(); + return; + } + // EditorFileSystem::get_singleton()->update_file(path,p_resource->get_type()); + + ((Resource*)p_resource.ptr())->set_path(path); + editor->emit_signal("resource_saved", p_resource); + +} + +void AnimationPlayerEditor::_animation_save(const Ref& p_resource) { + + if (p_resource->get_path().is_resource_file()) { + _animation_save_in_path(p_resource, p_resource->get_path()); + } + else { + _animation_save_as(p_resource); + } +} + +void AnimationPlayerEditor::_animation_save_as(const Ref& p_resource) { + + file->set_mode(EditorFileDialog::MODE_SAVE_FILE); + bool relpaths = (p_resource->has_meta("__editor_relpaths__") && p_resource->get_meta("__editor_relpaths__").operator bool()); + + List extensions; + ResourceSaver::get_recognized_extensions(p_resource, &extensions); + file->clear_filters(); + for (int i = 0; iadd_filter("*." + extensions[i] + " ; " + extensions[i].to_upper()); + } + + //file->set_current_path(current_path); + if (p_resource->get_path() != "") { + file->set_current_path(p_resource->get_path()); + if (extensions.size()) { + String ext = p_resource->get_path().extension().to_lower(); + if (extensions.find(ext) == NULL) { + file->set_current_path(p_resource->get_path().replacen("." + ext, "." + extensions.front()->get())); + } + } + } + else { + + String existing; + if (extensions.size()) { + existing = "new_" + p_resource->get_type().to_lower() + "." + extensions.front()->get().to_lower(); + } + file->set_current_path(existing); + + } + file->popup_centered_ratio(); + file->set_title("Save Resource As.."); + current_option = RESOURCE_SAVE; } void AnimationPlayerEditor::_animation_remove() { @@ -635,38 +709,55 @@ void AnimationPlayerEditor::_animation_edit() { //get_scene()->get_root_node()->call("_resource_selected",anim,""); } -void AnimationPlayerEditor::_file_selected(String p_file) { +void AnimationPlayerEditor::_dialog_action(String p_file) { - ERR_FAIL_COND(!player); + switch (current_option) { + case RESOURCE_LOAD: { + ERR_FAIL_COND(!player); - Ref res = ResourceLoader::load(p_file,"Animation"); - ERR_FAIL_COND(res.is_null()); - ERR_FAIL_COND( !res->is_type("Animation") ); - if (p_file.find_last("/")!=-1) { + Ref res = ResourceLoader::load(p_file, "Animation"); + ERR_FAIL_COND(res.is_null()); + ERR_FAIL_COND(!res->is_type("Animation")); + if (p_file.find_last("/") != -1) { - p_file=p_file.substr( p_file.find_last("/")+1, p_file.length() ); + p_file = p_file.substr(p_file.find_last("/") + 1, p_file.length()); + } + if (p_file.find_last("\\") != -1) { + + p_file = p_file.substr(p_file.find_last("\\") + 1, p_file.length()); + + } + + if (p_file.find(".") != -1) + p_file = p_file.substr(0, p_file.find(".")); + + undo_redo->create_action("Load Animation"); + undo_redo->add_do_method(player, "add_animation", p_file, res); + undo_redo->add_undo_method(player, "remove_animation", p_file); + if (player->has_animation(p_file)) { + undo_redo->add_undo_method(player, "add_animation", p_file, player->get_animation(p_file)); + + } + undo_redo->add_do_method(this, "_animation_player_changed", player); + undo_redo->add_undo_method(this, "_animation_player_changed", player); + undo_redo->commit_action(); + break; + } + case RESOURCE_SAVE: { + + String current = animation->get_item_text(animation->get_selected()); + if (current != "") { + Ref anim = player->get_animation(current); + + ERR_FAIL_COND(!anim->cast_to()) + + RES current_res = RES(anim->cast_to()); + + _animation_save_in_path(current_res, p_file); + } + } } - if (p_file.find_last("\\")!=-1) { - - p_file=p_file.substr( p_file.find_last("\\")+1, p_file.length() ); - - } - - if (p_file.find(".")!=-1) - p_file=p_file.substr(0,p_file.find(".")); - - undo_redo->create_action("Load Animation"); - undo_redo->add_do_method(player,"add_animation",p_file,res); - undo_redo->add_undo_method(player,"remove_animation",p_file); - if (player->has_animation(p_file)) { - undo_redo->add_undo_method(player,"add_animation",p_file,player->get_animation(p_file)); - - } - undo_redo->add_do_method(this,"_animation_player_changed",player); - undo_redo->add_undo_method(this,"_animation_player_changed",player); - undo_redo->commit_action(); - } void AnimationPlayerEditor::_scale_changed(const String& p_scale) { @@ -730,6 +821,8 @@ void AnimationPlayerEditor::_update_player() { blend_anim->set_disabled(animlist.size()==0); remove_anim->set_disabled(animlist.size()==0); resource_edit_anim->set_disabled(animlist.size()==0); + save_anim->set_disabled(animlist.size() == 0); + int active_idx=-1; for (List::Element *E=animlist.front();E;E=E->next()) { @@ -1072,6 +1165,23 @@ void AnimationPlayerEditor::_animation_tool_menu(int p_option) { } } +void AnimationPlayerEditor::_animation_save_menu(int p_option) { + + String current = animation->get_item_text(animation->get_selected()); + if (current != "") { + Ref anim = player->get_animation(current); + + switch (p_option) { + case ANIM_SAVE: + _animation_save(anim); + break; + case ANIM_SAVE_AS: + _animation_save_as(anim); + break; + } + } +} + void AnimationPlayerEditor::_unhandled_key_input(const InputEvent& p_ev) { if (is_visible() && p_ev.type==InputEvent::KEY && p_ev.key.pressed && !p_ev.key.echo && !p_ev.key.mod.alt && !p_ev.key.mod.control && !p_ev.key.mod.meta) { @@ -1117,7 +1227,7 @@ void AnimationPlayerEditor::_bind_methods() { ObjectTypeDB::bind_method(_MD("_animation_blend"),&AnimationPlayerEditor::_animation_blend); ObjectTypeDB::bind_method(_MD("_animation_edit"),&AnimationPlayerEditor::_animation_edit); ObjectTypeDB::bind_method(_MD("_animation_resource_edit"),&AnimationPlayerEditor::_animation_resource_edit); - ObjectTypeDB::bind_method(_MD("_file_selected"),&AnimationPlayerEditor::_file_selected); + ObjectTypeDB::bind_method(_MD("_dialog_action"),&AnimationPlayerEditor::_dialog_action); ObjectTypeDB::bind_method(_MD("_seek_value_changed"),&AnimationPlayerEditor::_seek_value_changed); ObjectTypeDB::bind_method(_MD("_animation_player_changed"),&AnimationPlayerEditor::_animation_player_changed); ObjectTypeDB::bind_method(_MD("_blend_edited"),&AnimationPlayerEditor::_blend_edited); @@ -1133,6 +1243,7 @@ void AnimationPlayerEditor::_bind_methods() { ObjectTypeDB::bind_method(_MD("_blend_editor_next_changed"),&AnimationPlayerEditor::_blend_editor_next_changed); ObjectTypeDB::bind_method(_MD("_unhandled_key_input"),&AnimationPlayerEditor::_unhandled_key_input); ObjectTypeDB::bind_method(_MD("_animation_tool_menu"),&AnimationPlayerEditor::_animation_tool_menu); + ObjectTypeDB::bind_method(_MD("_animation_save_menu"), &AnimationPlayerEditor::_animation_save_menu); @@ -1170,6 +1281,17 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { load_anim->set_tooltip("Load an animation from disk."); hb->add_child(load_anim); + save_anim = memnew(MenuButton); + save_anim->set_tooltip("Save the current animation"); + save_anim->get_popup()->add_item("Save", ANIM_SAVE); + save_anim->get_popup()->add_item("Save As..", ANIM_SAVE_AS); + save_anim->set_focus_mode(Control::FOCUS_NONE); + hb->add_child(save_anim); + + accept = memnew(AcceptDialog); + add_child(accept); + accept->connect("confirmed", this, "_menu_confirm_current"); + duplicate_anim = memnew( ToolButton ); hb->add_child(duplicate_anim); duplicate_anim->set_tooltip("Duplicate Animation"); @@ -1339,7 +1461,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor) { remove_anim->connect("pressed", this,"_animation_remove"); animation->connect("item_selected", this,"_animation_selected",Vector(),true); resource_edit_anim->connect("pressed", this,"_animation_resource_edit"); - file->connect("file_selected", this,"_file_selected"); + file->connect("file_selected", this,"_dialog_action"); seek->connect("value_changed", this, "_seek_value_changed",Vector(),true); scale->connect("text_entered", this, "_scale_changed",Vector(),true); editor->get_animation_editor()->connect("timeline_changed",this,"_animation_key_editor_seek"); diff --git a/tools/editor/plugins/animation_player_editor_plugin.h b/tools/editor/plugins/animation_player_editor_plugin.h index 57057425658..ac4d1ab6ba5 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.h +++ b/tools/editor/plugins/animation_player_editor_plugin.h @@ -55,6 +55,17 @@ class AnimationPlayerEditor : public VBoxContainer { TOOL_EDIT_RESOURCE }; + enum { + ANIM_SAVE, + ANIM_SAVE_AS + }; + + enum { + RESOURCE_LOAD, + RESOURCE_SAVE + }; + + OptionButton *animation; Button *stop; Button *play; @@ -70,6 +81,7 @@ class AnimationPlayerEditor : public VBoxContainer { Button *edit_anim; Button *resource_edit_anim; Button *load_anim; + MenuButton *save_anim; Button *blend_anim; Button *remove_anim; MenuButton *tool_anim; @@ -85,6 +97,8 @@ class AnimationPlayerEditor : public VBoxContainer { bool last_active; EditorFileDialog *file; + AcceptDialog *accept; + int current_option; struct BlendEditor { @@ -116,13 +130,18 @@ class AnimationPlayerEditor : public VBoxContainer { void _animation_rename(); void _animation_name_edited(); void _animation_load(); + + void _animation_save_in_path(const Ref& p_resource, const String& p_path); + void _animation_save(const Ref& p_resource); + void _animation_save_as(const Ref& p_resource); + void _animation_remove(); void _animation_blend(); void _animation_edit(); void _animation_duplicate(); void _animation_resource_edit(); void _scale_changed(const String& p_scale); - void _file_selected(String p_file); + void _dialog_action(String p_file); void _seek_frame_changed(const String& p_frame); void _seek_value_changed(float p_value); void _blend_editor_next_changed(const String& p_string); @@ -141,6 +160,7 @@ class AnimationPlayerEditor : public VBoxContainer { void _animation_key_editor_anim_len_changed(float p_new); void _unhandled_key_input(const InputEvent& p_ev); void _animation_tool_menu(int p_option); + void _animation_save_menu(int p_option); AnimationPlayerEditor(); protected: From 53c9e8301c41b8ede999a7596643e33e36d2ca40 Mon Sep 17 00:00:00 2001 From: Saracen Date: Fri, 18 Sep 2015 15:23:00 +0100 Subject: [PATCH 30/78] Ignore alpha materials in baked light ray-tracer. --- tools/editor/plugins/baked_light_baker.cpp | 174 +++++++++++++-------- tools/editor/plugins/baked_light_baker.h | 6 +- 2 files changed, 110 insertions(+), 70 deletions(-) diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp index 4599dbfb540..261d862b376 100644 --- a/tools/editor/plugins/baked_light_baker.cpp +++ b/tools/editor/plugins/baked_light_baker.cpp @@ -115,6 +115,8 @@ void BakedLightBaker::_add_mesh(const Ref& p_mesh,const Ref& p_m if (!mat_map.has(mat)) { MeshMaterial mm; + mm.is_double_sided = mat->get_flag(Material::FLAG_DOUBLE_SIDED); + mm.use_alpha = false; Ref fm = mat; if (fm.is_valid()) { @@ -128,6 +130,8 @@ void BakedLightBaker::_add_mesh(const Ref& p_mesh,const Ref& p_m mm.specular.color=mm.specular.color.to_linear(); mm.specular.tex=_get_mat_tex(fm->get_texture(FixedMaterial::PARAM_SPECULAR)); + + mm.use_alpha = fm->get_fixed_flag(FixedMaterial::FLAG_USE_ALPHA); } else { mm.diffuse.color=Color(1,1,1,1); @@ -311,7 +315,12 @@ void BakedLightBaker::_parse_geometry(Node* p_node) { lights.push_back(dirl); } - } else if (p_node->cast_to()){ + } + else if (p_node->cast_to()){ + // Ignore meshes and lights contained in baked light samplers + return; + } + else if (p_node->cast_to()){ Spatial *sp = p_node->cast_to(); @@ -472,6 +481,7 @@ BakedLightBaker::BVH* BakedLightBaker::_parse_bvh(BVH** p_children, int p_size, BVH* right = _parse_bvh(&p_children[p_size/2],p_size-p_size/2,p_depth+1,max_depth); BVH *_new = memnew(BVH); + _new->id=-1; _new->aabb=aabb; _new->center=aabb.pos+aabb.size*0.5; _new->children[0]=left; @@ -488,6 +498,7 @@ void BakedLightBaker::_make_bvh() { int max_depth=0; for(int i=0;iid=i; bases[i]->leaf=&triangles[i]; bases[i]->aabb.pos=triangles[i].vertices[0]; bases[i]->aabb.expand_to(triangles[i].vertices[1]); @@ -949,7 +960,7 @@ void BakedLightBaker::_plot_light(ThreadStack& thread_stack,const Vector3& p_plo } -float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,const Vector3& p_begin, const Vector3& p_end,float p_rest,const Color& p_light,float *p_att_curve,float p_att_pos,int p_att_curve_len,int p_bounces,bool p_first_bounce,bool p_only_dist) { +float BakedLightBaker::_throw_ray(ThreadStack& thread_stack, bool p_bake_direct, const Vector3& p_begin, const Vector3& p_end, float p_rest, const Color& p_light, float *p_att_curve, float p_att_pos, int p_att_curve_len, int p_bounces, bool p_first_bounce, bool p_only_dist, Vector &p_ignore_list) { uint32_t* stack = thread_stack.ray_stack; @@ -978,6 +989,7 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c Vector3 r_point; Vector3 end=p_end; + int triangle_id = -1; Triangle *triangle=NULL; //for(int i=0;ivertices[0],b.leaf->vertices[1],b.leaf->vertices[2]); + Face3 f3(b.leaf->vertices[0],b.leaf->vertices[1],b.leaf->vertices[2]); - Vector3 res; + Vector3 res; - if (f3.intersects_segment(p_begin,end,&res)) { + if (f3.intersects_segment(p_begin,end,&res)) { - float nd = n.dot(res); - if (nd0) - return -1; - - if (n.dot(r_normal)>0) - r_normal=-r_normal; + bool passthrough = false; //ok... Color diffuse_at_point(0.8,0.8,0.8); Color specular_at_point(0.0,0.0,0.0); + if (triangle->material) { + + if ((triangle->material->is_double_sided == true || triangle->material->use_alpha == true) && use_translucency == true) { + if (n.dot(r_normal)>0) + r_normal = -r_normal; + + if (triangle->material->use_alpha == true) + passthrough = true; + } + else { + if (n.dot(r_normal)>0) + return -1; + } + + //triangle->get_uv(r_point); + + diffuse_at_point = triangle->material->diffuse.get_color(uv); + specular_at_point = triangle->material->specular.get_color(uv); + } + else { + if (n.dot(r_normal)>0) + return -1; + } float dist = p_begin.distance_to(r_point); @@ -1139,23 +1176,18 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c //the multiplication can happen with more detail in the shader - - if (triangle->material) { - - //triangle->get_uv(r_point); - - diffuse_at_point=triangle->material->diffuse.get_color(uv); - specular_at_point=triangle->material->specular.get_color(uv); - } - - diffuse_at_point.r=res_light.r*diffuse_at_point.r; diffuse_at_point.g=res_light.g*diffuse_at_point.g; diffuse_at_point.b=res_light.b*diffuse_at_point.b; float ret=1e6; - if (p_bounces>0) { + if (passthrough == true && triangle_id !=-1) + { + p_ignore_list.push_back(triangle_id); + ret=_throw_ray(thread_stack, p_bake_direct, r_point, p_end, p_rest, p_light, p_att_curve, p_att_pos, p_att_curve_len, p_bounces, p_first_bounce, p_only_dist, p_ignore_list); + } + else if (p_bounces>0 ) { p_rest-=dist; @@ -1226,33 +1258,37 @@ float BakedLightBaker::_throw_ray(ThreadStack& thread_stack,bool p_bake_direct,c bool skip=false; - if (!p_first_bounce || p_bake_direct) { + if (passthrough == false) { + if (!p_first_bounce || p_bake_direct) { - float r = plot_size * cell_size*2; - if (dist0 && d 0 && d < r) { + //avoid accumulaiton of light on corners + //plot_light=plot_light.linear_interpolate(Color(0,0,0,0),1.0-sd/plot_size*plot_size); + skip = true; + + } + else { + //plot_light=Color(0,0,0,0); + } } } } diff --git a/tools/editor/plugins/baked_light_baker.h b/tools/editor/plugins/baked_light_baker.h index 8fbeeddc6a6..58197283a2c 100644 --- a/tools/editor/plugins/baked_light_baker.h +++ b/tools/editor/plugins/baked_light_baker.h @@ -92,6 +92,9 @@ public: Param diffuse; Param specular; Param emission; + + bool is_double_sided; + bool use_alpha; }; struct Triangle { @@ -154,6 +157,7 @@ public: struct BVH { + int id; AABB aabb; Vector3 center; Triangle *leaf; @@ -307,7 +311,7 @@ public: void _plot_light(ThreadStack& thread_stack,const Vector3& p_plot_pos,const AABB& p_plot_aabb,const Color& p_light,const Color& p_tint_light,bool p_only_full,const Plane& p_plane); //void _plot_light_point(const Vector3& p_plot_pos, Octant *p_octant, const AABB& p_aabb,const Color& p_light); - float _throw_ray(ThreadStack& thread_stack,bool p_bake_direct,const Vector3& p_begin, const Vector3& p_end,float p_rest,const Color& p_light,float *p_att_curve,float p_att_pos,int p_att_curve_len,int p_bounces,bool p_first_bounce=false,bool p_only_dist=false); + float _throw_ray(ThreadStack& thread_stack,bool p_bake_direct,const Vector3& p_begin, const Vector3& p_end,float p_rest,const Color& p_light,float *p_att_curve,float p_att_pos,int p_att_curve_len,int p_bounces,bool p_first_bounce=false,bool p_only_dist=false, Vector&p_ignore_list=Vector()); float total_light_area; From e723488aa3933ec0e56b8e09e44256f6dc5da344 Mon Sep 17 00:00:00 2001 From: Saracen Date: Sat, 31 Oct 2015 08:59:29 +0000 Subject: [PATCH 31/78] Moved deleting sample player in OS finalize methods to before deleting audio server to prevent crash when exiting. --- platform/bb10/os_bb10.cpp | 3 ++- platform/haiku/os_haiku.cpp | 3 ++- platform/server/os_server.cpp | 3 ++- platform/windows/os_windows.cpp | 3 ++- platform/winrt/os_winrt.cpp | 3 ++- platform/x11/os_x11.cpp | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/platform/bb10/os_bb10.cpp b/platform/bb10/os_bb10.cpp index d89033b1df0..c8e7ae561e7 100644 --- a/platform/bb10/os_bb10.cpp +++ b/platform/bb10/os_bb10.cpp @@ -195,9 +195,10 @@ void OSBB10::finalize() { // memdelete(debugger_connection_console); //} + memdelete(sample_manager); + audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); visual_server->finish(); memdelete(visual_server); diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index 1edb23d5049..ef483657ca5 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -137,9 +137,10 @@ void OS_Haiku::finalize() { spatial_sound_2d_server->finish(); memdelete(spatial_sound_2d_server); + memdelete(sample_manager); + audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); visual_server->finish(); memdelete(visual_server); diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 75e0878bac3..8b831140d68 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -107,9 +107,10 @@ void OS_Server::finalize() { // memdelete(debugger_connection_console); //} + memdelete(sample_manager); + audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); visual_server->finish(); memdelete(visual_server); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 438a5a69037..c6dae86222e 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1373,9 +1373,10 @@ void OS_Windows::finalize() { // memdelete(debugger_connection_console); //} + memdelete(sample_manager); + audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); memdelete(input); diff --git a/platform/winrt/os_winrt.cpp b/platform/winrt/os_winrt.cpp index 3e06d9d59b9..02de262508b 100644 --- a/platform/winrt/os_winrt.cpp +++ b/platform/winrt/os_winrt.cpp @@ -326,10 +326,11 @@ void OSWinrt::finalize() { //if (debugger_connection_console) { // memdelete(debugger_connection_console); //} + + memdelete(sample_manager); audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); memdelete(input); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 34bd1184a1d..3218230d0bf 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -452,9 +452,10 @@ void OS_X11::finalize() { // memdelete(debugger_connection_console); //} + memdelete(sample_manager); + audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); visual_server->finish(); memdelete(visual_server); From 957baf48dc86c6f4c6d00b74d384d7d7e636104b Mon Sep 17 00:00:00 2001 From: Saracen Date: Sun, 9 Aug 2015 17:43:44 +0100 Subject: [PATCH 32/78] BoneAttachment fix. --- scene/3d/skeleton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp index 4712ba308a8..cb81228dff1 100644 --- a/scene/3d/skeleton.cpp +++ b/scene/3d/skeleton.cpp @@ -250,7 +250,7 @@ void Skeleton::_notification(int p_what) { ERR_CONTINUE(!obj); Spatial *sp = obj->cast_to(); ERR_CONTINUE(!sp); - sp->set_transform(b.pose_global * b.rest_global_inverse); + sp->set_transform(b.pose_global); } } From e011bcf16291f55e1692a4d3092010c97923fcfc Mon Sep 17 00:00:00 2001 From: Saracen Date: Wed, 2 Sep 2015 13:11:34 +0100 Subject: [PATCH 33/78] Experimental retooling of AnimationTreePlayer to allow manual advancement. --- scene/animation/animation_tree_player.cpp | 96 +++++++++++++++++++++-- scene/animation/animation_tree_player.h | 19 ++++- 2 files changed, 105 insertions(+), 10 deletions(-) diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp index 14f2110915a..c7e259c3c68 100644 --- a/scene/animation/animation_tree_player.cpp +++ b/scene/animation/animation_tree_player.cpp @@ -29,6 +29,42 @@ #include "animation_tree_player.h" #include "animation_player.h" +#include "scene/scene_string_names.h" + + +void AnimationTreePlayer::set_animation_process_mode(AnimationProcessMode p_mode) { + + if (animation_process_mode == p_mode) + return; + + bool pr = processing; + if (pr) + _set_process(false); + animation_process_mode = p_mode; + if (pr) + _set_process(true); + +} + +AnimationTreePlayer::AnimationProcessMode AnimationTreePlayer::get_animation_process_mode() const{ + + return animation_process_mode; +} + +void AnimationTreePlayer::_set_process(bool p_process, bool p_force) +{ + if (processing == p_process && !p_force) + return; + + switch (animation_process_mode) { + + case ANIMATION_PROCESS_FIXED: set_fixed_process(p_process && active); break; + case ANIMATION_PROCESS_IDLE: set_process(p_process && active); break; + } + + processing = p_process; +} + bool AnimationTreePlayer::_set(const StringName& p_name, const Variant& p_value) { @@ -42,6 +78,11 @@ bool AnimationTreePlayer::_set(const StringName& p_name, const Variant& p_value) return true; } + if(String(p_name) == SceneStringNames::get_singleton()->playback_active) { + set_active(p_value); + return true; + } + if (String(p_name)!="data") return false; @@ -190,6 +231,11 @@ bool AnimationTreePlayer::_get(const StringName& p_name,Variant &r_ret) const { return true; } + if (String(p_name) == "playback/active") { + r_ret=is_active(); + return true; + } + if (String(p_name)!="data") return false; @@ -342,11 +388,24 @@ void AnimationTreePlayer::_get_property_list( List *p_list) const p_list->push_back( PropertyInfo(Variant::DICTIONARY,"data",PROPERTY_HINT_NONE,"",PROPERTY_USAGE_STORAGE|PROPERTY_USAGE_NETWORK) ); } +void AnimationTreePlayer::advance(float p_time) { + + _process_animation(p_time); +} void AnimationTreePlayer::_notification(int p_what) { switch(p_what) { + case NOTIFICATION_ENTER_TREE: { + + if (!processing) { + //make sure that a previous process state was not saved + //only process if "processing" is set + set_fixed_process(false); + set_process(false); + } + } break; case NOTIFICATION_READY: { dirty_caches=true; if (master!=NodePath()) { @@ -354,7 +413,19 @@ void AnimationTreePlayer::_notification(int p_what) { } } break; case NOTIFICATION_PROCESS: { - _process_animation(); + if (animation_process_mode==ANIMATION_PROCESS_FIXED) + break; + + if (processing) + _process_animation( get_process_delta_time() ); + } break; + case NOTIFICATION_FIXED_PROCESS: { + + if (animation_process_mode==ANIMATION_PROCESS_IDLE) + break; + + if (processing) + _process_animation(get_fixed_process_delta_time()); } break; } @@ -656,10 +727,7 @@ float AnimationTreePlayer::_process_node(const StringName& p_node,AnimationNode } -void AnimationTreePlayer::_process_animation() { - - if (!active) - return; +void AnimationTreePlayer::_process_animation(float p_delta) { if (last_error!=CONNECT_OK) return; @@ -675,7 +743,7 @@ void AnimationTreePlayer::_process_animation() { _process_node(out_name,&prev, 1.0, 0, true ); reset_request=false; } else - _process_node(out_name,&prev, 1.0, get_process_delta_time(), false ); + _process_node(out_name,&prev, 1.0, p_delta, false ); if (dirty_caches) { //some animation changed.. ignore this pass @@ -1520,8 +1588,12 @@ void AnimationTreePlayer::recompute_caches() { void AnimationTreePlayer::set_active(bool p_active) { - active=p_active; - set_process(active); + if (active == p_active) + return; + + active = p_active; + processing = active; + _set_process(processing, true); } bool AnimationTreePlayer::is_active() const { @@ -1743,13 +1815,18 @@ void AnimationTreePlayer::_bind_methods() { ObjectTypeDB::bind_method(_MD("get_node_list"),&AnimationTreePlayer::_get_node_list); + ObjectTypeDB::bind_method(_MD("set_animation_process_mode","mode"),&AnimationTreePlayer::set_animation_process_mode); + ObjectTypeDB::bind_method(_MD("get_animation_process_mode"),&AnimationTreePlayer::get_animation_process_mode); + ObjectTypeDB::bind_method(_MD("advance", "delta"), &AnimationTreePlayer::advance); ObjectTypeDB::bind_method(_MD("reset"),&AnimationTreePlayer::reset); ObjectTypeDB::bind_method(_MD("recompute_caches"),&AnimationTreePlayer::recompute_caches); + ADD_PROPERTY(PropertyInfo(Variant::INT, "playback/process_mode", PROPERTY_HINT_ENUM, "Fixed,Idle"), _SCS("set_animation_process_mode"), _SCS("get_animation_process_mode")); + BIND_CONSTANT( NODE_OUTPUT ); BIND_CONSTANT( NODE_ANIMATION ); BIND_CONSTANT( NODE_ONESHOT ); @@ -1770,6 +1847,9 @@ AnimationTreePlayer::AnimationTreePlayer() { out_name="out"; out->pos=Point2(40,40); node_map.insert( out_name , out); + AnimationProcessMode animation_process_mode; + animation_process_mode = ANIMATION_PROCESS_IDLE; + processing = false; active=false; dirty_caches=true; reset_request=false; diff --git a/scene/animation/animation_tree_player.h b/scene/animation/animation_tree_player.h index 9e936304c6d..9ea5ccf330d 100644 --- a/scene/animation/animation_tree_player.h +++ b/scene/animation/animation_tree_player.h @@ -34,6 +34,7 @@ #include "scene/3d/spatial.h" #include "scene/3d/skeleton.h" #include "scene/main/misc.h" +#include "animation_player.h" class AnimationTreePlayer : public Node { @@ -42,7 +43,10 @@ class AnimationTreePlayer : public Node { OBJ_CATEGORY("Animation Nodes"); public: - + enum AnimationProcessMode { + ANIMATION_PROCESS_FIXED, + ANIMATION_PROCESS_IDLE, + }; enum NodeType { @@ -256,13 +260,15 @@ private: ConnectError last_error; AnimationNode *active_list; + AnimationProcessMode animation_process_mode; + bool processing; bool active; bool dirty_caches; Map node_map; // return time left to finish animation float _process_node(const StringName& p_node,AnimationNode **r_prev_anim, float p_weight,float p_step, bool p_seek=false,const HashMap *p_filter=NULL, float p_reverse_weight=0); - void _process_animation(); + void _process_animation(float p_delta); bool reset_request; ConnectError _cycle_test(const StringName &p_at_node); @@ -409,12 +415,21 @@ public: ConnectError get_last_error() const; + void set_animation_process_mode(AnimationProcessMode p_mode); + AnimationProcessMode get_animation_process_mode() const; + + void _set_process(bool p_process, bool p_force = false); + + void advance(float p_time); + AnimationTreePlayer(); ~AnimationTreePlayer(); }; VARIANT_ENUM_CAST( AnimationTreePlayer::NodeType ); +VARIANT_ENUM_CAST( AnimationTreePlayer::AnimationProcessMode ); + #endif // ANIMATION_TREE_PLAYER_H From 539bbd66549545ce67bd46d49a6693d854bea634 Mon Sep 17 00:00:00 2001 From: Saracen Date: Mon, 3 Aug 2015 19:36:20 +0100 Subject: [PATCH 34/78] Disable baked lighting sampling on shadeless materials. --- drivers/gles2/rasterizer_gles2.cpp | 118 +++++++++++++++-------------- 1 file changed, 61 insertions(+), 57 deletions(-) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index d84ee5a7589..b602cf33f0d 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -6526,80 +6526,84 @@ void RasterizerGLES2::_render_list_forward(RenderList *p_render_list,const Trans material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_LIGHTMAP,false); material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_DP_SAMPLER,false); - if (e->instance->sampled_light.is_valid()) { + if (material->flags[VS::MATERIAL_FLAG_UNSHADED] == false && current_debug != VS::SCENARIO_DEBUG_SHADELESS) { - SampledLight *sl = sampled_light_owner.get(e->instance->sampled_light); - if (sl) { + if (e->instance->sampled_light.is_valid()) { - baked_light=NULL; //can't mix - material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_DP_SAMPLER,true); - glActiveTexture(GL_TEXTURE0+max_texture_units-3); - glBindTexture(GL_TEXTURE_2D,sl->texture); //bind the texture - sampled_light_dp_multiplier=sl->multiplier; - bind_dp_sampler=true; - } - } - - - if (!additive && baked_light) { - - if (baked_light->mode==VS::BAKED_LIGHT_OCTREE && baked_light->octree_texture.is_valid() && e->instance->baked_light_octree_xform) { - material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_OCTREE,true); - bind_baked_light_octree=true; - if (prev_baked_light!=baked_light) { - Texture *tex=texture_owner.get(baked_light->octree_texture); - if (tex) { - - glActiveTexture(GL_TEXTURE0+max_texture_units-3); - glBindTexture(tex->target,tex->tex_id); //bind the texture - } - if (baked_light->light_texture.is_valid()) { - Texture *texl=texture_owner.get(baked_light->light_texture); - if (texl) { - glActiveTexture(GL_TEXTURE0+max_texture_units-4); - glBindTexture(texl->target,texl->tex_id); //bind the light texture - } - } + SampledLight *sl = sampled_light_owner.get(e->instance->sampled_light); + if (sl) { + baked_light = NULL; //can't mix + material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_DP_SAMPLER, true); + glActiveTexture(GL_TEXTURE0 + max_texture_units - 3); + glBindTexture(GL_TEXTURE_2D, sl->texture); //bind the texture + sampled_light_dp_multiplier = sl->multiplier; + bind_dp_sampler = true; } - } else if (baked_light->mode==VS::BAKED_LIGHT_LIGHTMAPS) { + } - int lightmap_idx = e->instance->baked_lightmap_id; + if (!additive && baked_light) { - material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_LIGHTMAP,false); - bind_baked_lightmap=false; - - - if (baked_light->lightmaps.has(lightmap_idx)) { - - - RID texid = baked_light->lightmaps[lightmap_idx]; - - if (prev_baked_light!=baked_light || texid!=prev_baked_light_texture) { - - - Texture *tex = texture_owner.get(texid); + if (baked_light->mode == VS::BAKED_LIGHT_OCTREE && baked_light->octree_texture.is_valid() && e->instance->baked_light_octree_xform) { + material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_OCTREE, true); + bind_baked_light_octree = true; + if (prev_baked_light != baked_light) { + Texture *tex = texture_owner.get(baked_light->octree_texture); if (tex) { - glActiveTexture(GL_TEXTURE0+max_texture_units-3); - glBindTexture(tex->target,tex->tex_id); //bind the texture + glActiveTexture(GL_TEXTURE0 + max_texture_units - 3); + glBindTexture(tex->target, tex->tex_id); //bind the texture + } + if (baked_light->light_texture.is_valid()) { + Texture *texl = texture_owner.get(baked_light->light_texture); + if (texl) { + glActiveTexture(GL_TEXTURE0 + max_texture_units - 4); + glBindTexture(texl->target, texl->tex_id); //bind the light texture + } } - prev_baked_light_texture=texid; } + } + else if (baked_light->mode == VS::BAKED_LIGHT_LIGHTMAPS) { + + + int lightmap_idx = e->instance->baked_lightmap_id; + + material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_LIGHTMAP, false); + bind_baked_lightmap = false; + + + if (baked_light->lightmaps.has(lightmap_idx)) { + + + RID texid = baked_light->lightmaps[lightmap_idx]; + + if (prev_baked_light != baked_light || texid != prev_baked_light_texture) { + + + Texture *tex = texture_owner.get(texid); + if (tex) { + + glActiveTexture(GL_TEXTURE0 + max_texture_units - 3); + glBindTexture(tex->target, tex->tex_id); //bind the texture + } + + prev_baked_light_texture = texid; + } + + if (texid.is_valid()) { + material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_LIGHTMAP, true); + bind_baked_lightmap = true; + } - if (texid.is_valid()) { - material_shader.set_conditional(MaterialShaderGLES2::ENABLE_AMBIENT_LIGHTMAP,true); - bind_baked_lightmap=true; } - } } - } - if (int(prev_baked_light!=NULL) ^ int(baked_light!=NULL)) { - rebind=true; + if (int(prev_baked_light != NULL) ^ int(baked_light != NULL)) { + rebind = true; + } } } From 0006f035ebb020227ad5b67faf4e04b723b1e0ec Mon Sep 17 00:00:00 2001 From: Saracen Date: Sat, 15 Aug 2015 07:47:22 +0100 Subject: [PATCH 35/78] Added alignment to LineEdit GUI control. --- scene/gui/line_edit.cpp | 119 +++++++++++++++++++++++++++++++++++----- scene/gui/line_edit.h | 21 ++++++- 2 files changed, 124 insertions(+), 16 deletions(-) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 2b4d7db01e8..310e2fee8bd 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -145,6 +145,13 @@ void LineEdit::_input_event(InputEvent p_event) { int old_cursor_pos = cursor_pos; text = undo_text; + + Ref font = get_font("font"); + + cached_width = 0; + for (int i = 0; iget_char_size(text[i]).width; + if(old_cursor_pos > text.length()) { set_cursor_pos(text.length()); } else { @@ -164,6 +171,13 @@ void LineEdit::_input_event(InputEvent p_event) { selection_clear(); undo_text = text; text = text.substr(cursor_pos,text.length()-cursor_pos); + + Ref font = get_font("font"); + + cached_width = 0; + for (int i = 0; iget_char_size(text[i]).width; + set_cursor_pos(0); emit_signal("text_changed",text); _change_notify("text"); @@ -303,6 +317,18 @@ void LineEdit::_input_event(InputEvent p_event) { } } +void LineEdit::set_align(Align p_align) { + + ERR_FAIL_INDEX(p_align, 4); + align = p_align; + update(); +} + +LineEdit::Align LineEdit::get_align() const{ + + return align; +} + Variant LineEdit::get_drag_data(const Point2& p_point) { if (selection.drag_attempt && selection.enabled) { @@ -325,7 +351,13 @@ void LineEdit::drop_data(const Point2& p_point,const Variant& p_data){ if (p_data.get_type()==Variant::STRING) { set_cursor_at_pixel_pos(p_point.x); int selected = selection.end - selection.begin; + + Ref font = get_font("font"); + for (int i = selection.begin; iget_char_size(text[i]).width; + text.erase(selection.begin, selected); + append_at_cursor(p_data); selection.begin = cursor_pos-selected; selection.end = cursor_pos; @@ -365,8 +397,25 @@ void LineEdit::_notification(int p_what) { get_stylebox("focus")->draw( ci, Rect2( Point2(), size ) ); } - - int ofs=style->get_offset().x; + int x_ofs=0; + + switch (align) { + + case ALIGN_FILL: + case ALIGN_LEFT: { + + x_ofs=style->get_offset().x; + } break; + case ALIGN_CENTER: { + + x_ofs=x_ofs=int(size.width-(cached_width))/2; + } break; + case ALIGN_RIGHT: { + + x_ofs=x_ofs=int(size.width-style->get_offset().x-(cached_width)); + } break; + } + int ofs_max=width-style->get_minimum_size().width; int char_ofs=window_pos; @@ -391,29 +440,29 @@ void LineEdit::_notification(int p_what) { int char_width=font->get_char_size( cchar,next ).width; // end of widget, break! - if ( (ofs+char_width) > ofs_max ) + if ((x_ofs + char_width) > ofs_max) break; bool selected=selection.enabled && char_ofs>=selection.begin && char_ofscanvas_item_add_rect(ci,Rect2( Point2( ofs , y_ofs ),Size2( char_width, y_area )),selection_color); + VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(char_width, y_area)), selection_color); - font->draw_char(ci,Point2( ofs , y_ofs+font_ascent ), cchar, next,selected?font_color_selected:font_color ); + font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, selected ? font_color_selected : font_color); if (char_ofs==cursor_pos && has_focus()) VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( - Point2( ofs , y_ofs ), Size2( 1, y_area ) ), cursor_color ); + Point2( x_ofs , y_ofs ), Size2( 1, y_area ) ), cursor_color ); - ofs+=char_width; + x_ofs+=char_width; char_ofs++; } if (char_ofs==cursor_pos && has_focus()) //may be at the end VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2( - Point2( ofs , y_ofs ), Size2( 1, y_area ) ), cursor_color ); + Point2( x_ofs , y_ofs ), Size2( 1, y_area ) ), cursor_color ); } break; case NOTIFICATION_FOCUS_ENTER: { @@ -484,9 +533,29 @@ void LineEdit::shift_selection_check_post(bool p_shift) { void LineEdit::set_cursor_at_pixel_pos(int p_x) { - int ofs=window_pos; - int pixel_ofs=get_stylebox("normal")->get_offset().x; - Ref font=get_font("font"); + Ref font = get_font("font"); + int ofs = window_pos; + Ref style = get_stylebox("normal"); + int pixel_ofs = 0; + Size2 size = get_size(); + + switch (align) { + + case ALIGN_FILL: + case ALIGN_LEFT: { + + pixel_ofs = int(style->get_offset().x); + } break; + case ALIGN_CENTER: { + + pixel_ofs=int(size.width-(cached_width))/2; + } break; + case ALIGN_RIGHT: { + + pixel_ofs=int(size.width-style->get_offset().x-(cached_width)); + } break; + } + while (ofs font = get_font("font"); + cached_width -= font->get_char_size(text[cursor_pos - 1]).width; text.erase( cursor_pos-1, 1 ); @@ -626,17 +697,22 @@ void LineEdit::append_at_cursor(String p_text) { if ( ( max_length <= 0 ) || (text.length()+p_text.length() <= max_length)) { undo_text = text; + + Ref font = get_font("font"); + + for (int i = 0; iget_char_size(p_text[i]).width; + String pre = text.substr( 0, cursor_pos ); String post = text.substr( cursor_pos, text.length()-cursor_pos ); text=pre+p_text+post; set_cursor_pos(cursor_pos+p_text.length()); - } - } void LineEdit::clear_internal() { + cached_width = 0; cursor_pos=0; window_pos=0; undo_text=""; @@ -676,6 +752,12 @@ void LineEdit::selection_delete() { if (selection.enabled) { undo_text = text; + + Ref font = get_font("font"); + + for (int i = selection.begin; iget_char_size(text[i]).width; + text.erase(selection.begin,selection.end-selection.begin); cursor_pos-=CLAMP( cursor_pos-selection.begin, 0, selection.end-selection.begin); @@ -789,6 +871,8 @@ bool LineEdit::is_text_field() const { void LineEdit::_bind_methods() { + ObjectTypeDB::bind_method(_MD("set_align", "align"), &LineEdit::set_align); + ObjectTypeDB::bind_method(_MD("get_align"), &LineEdit::get_align); ObjectTypeDB::bind_method(_MD("_input_event"),&LineEdit::_input_event); ObjectTypeDB::bind_method(_MD("clear"),&LineEdit::clear); @@ -809,15 +893,22 @@ void LineEdit::_bind_methods() { ADD_SIGNAL( MethodInfo("text_changed", PropertyInfo( Variant::STRING, "text" )) ); ADD_SIGNAL( MethodInfo("text_entered", PropertyInfo( Variant::STRING, "text" )) ); + BIND_CONSTANT(ALIGN_LEFT); + BIND_CONSTANT(ALIGN_CENTER); + BIND_CONSTANT(ALIGN_RIGHT); + BIND_CONSTANT(ALIGN_FILL); + ADD_PROPERTY( PropertyInfo( Variant::STRING, "text" ), _SCS("set_text"),_SCS("get_text") ); + ADD_PROPERTYNZ(PropertyInfo(Variant::INT, "align", PROPERTY_HINT_ENUM, "Left,Center,Right,Fill"), _SCS("set_align"), _SCS("get_align")); ADD_PROPERTY( PropertyInfo( Variant::INT, "max_length" ), _SCS("set_max_length"),_SCS("get_max_length") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "editable" ), _SCS("set_editable"),_SCS("is_editable") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "secret" ), _SCS("set_secret"),_SCS("is_secret") ); - } LineEdit::LineEdit() { + align = ALIGN_LEFT; + cached_width = 0; cursor_pos=0; window_pos=0; max_length = 0; diff --git a/scene/gui/line_edit.h b/scene/gui/line_edit.h index b1c4c8f6169..f28136d66e1 100644 --- a/scene/gui/line_edit.h +++ b/scene/gui/line_edit.h @@ -36,7 +36,18 @@ class LineEdit : public Control { OBJ_TYPE( LineEdit, Control ); - + +public: + enum Align { + + ALIGN_LEFT, + ALIGN_CENTER, + ALIGN_RIGHT, + ALIGN_FILL + }; +private: + Align align; + bool editable; bool pass; @@ -46,6 +57,8 @@ class LineEdit : public Control { int cursor_pos; int window_pos; int max_length; // 0 for no maximum + + int cached_width; struct Selection { @@ -83,7 +96,8 @@ class LineEdit : public Control { protected: static void _bind_methods(); public: - + void set_align(Align p_align); + Align get_align() const; virtual Variant get_drag_data(const Point2& p_point); virtual bool can_drop_data(const Point2& p_point,const Variant& p_data) const; @@ -119,4 +133,7 @@ public: }; + +VARIANT_ENUM_CAST(LineEdit::Align); + #endif From e3c50ac63d57e484ae39761be54213cac8b4de4b Mon Sep 17 00:00:00 2001 From: Saracen Date: Wed, 2 Sep 2015 12:36:52 +0100 Subject: [PATCH 36/78] Aligned line edit fix. --- scene/gui/line_edit.cpp | 61 ++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 310e2fee8bd..8cf761bd82d 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -175,8 +175,10 @@ void LineEdit::_input_event(InputEvent p_event) { Ref font = get_font("font"); cached_width = 0; - for (int i = 0; iget_char_size(text[i]).width; + if (font != NULL) { + for (int i = 0; i < text.length(); i++) + cached_width += font->get_char_size(text[i]).width; + } set_cursor_pos(0); emit_signal("text_changed",text); @@ -353,8 +355,10 @@ void LineEdit::drop_data(const Point2& p_point,const Variant& p_data){ int selected = selection.end - selection.begin; Ref font = get_font("font"); - for (int i = selection.begin; iget_char_size(text[i]).width; + if (font != NULL) { + for (int i = selection.begin; i < selection.end; i++) + cached_width -= font->get_char_size(text[i]).width; + } text.erase(selection.begin, selected); @@ -559,7 +563,10 @@ void LineEdit::set_cursor_at_pixel_pos(int p_x) { while (ofsget_char_size( text[ofs] ).width; + int char_w = 0; + if (font != NULL) { + int char_w = font->get_char_size(text[ofs]).width; + } pixel_ofs+=char_w; if (pixel_ofs > p_x) { //found what we look for @@ -593,7 +600,9 @@ void LineEdit::delete_char() { if ((text.length()<=0) || (cursor_pos==0)) return; Ref font = get_font("font"); - cached_width -= font->get_char_size(text[cursor_pos - 1]).width; + if (font != NULL) { + cached_width -= font->get_char_size(text[cursor_pos - 1]).width; + } text.erase( cursor_pos-1, 1 ); @@ -664,13 +673,15 @@ void LineEdit::set_cursor_pos(int p_pos) { int width_to_cursor=0; int wp=window_pos; - for (int i=window_pos;iget_char_size( text[i] ).width; + if (font != NULL) { + for (int i=window_pos;iget_char_size( text[i] ).width; - while(width_to_cursor>=window_width && wpget_char_size( text[ wp ] ).width; - wp++; + while (width_to_cursor >= window_width && wp < text.length()) { + + width_to_cursor -= font->get_char_size(text[wp]).width; + wp++; + } } if (wp!=window_pos) @@ -699,9 +710,13 @@ void LineEdit::append_at_cursor(String p_text) { undo_text = text; Ref font = get_font("font"); - - for (int i = 0; iget_char_size(p_text[i]).width; + if (font != NULL) { + for (int i = 0; i < p_text.length(); i++) + cached_width += font->get_char_size(p_text[i]).width; + } + else { + cached_width = 0; + } String pre = text.substr( 0, cursor_pos ); String post = text.substr( cursor_pos, text.length()-cursor_pos ); @@ -753,10 +768,18 @@ void LineEdit::selection_delete() { undo_text = text; - Ref font = get_font("font"); - - for (int i = selection.begin; iget_char_size(text[i]).width; + if (text.size() > 0) + { + Ref font = get_font("font"); + if (font != NULL) { + for (int i = selection.begin; i < selection.end; i++) + cached_width -= font->get_char_size(text[i]).width; + } + } + else + { + cached_width = 0; + } text.erase(selection.begin,selection.end-selection.begin); cursor_pos-=CLAMP( cursor_pos-selection.begin, 0, selection.end-selection.begin); From 6bcc2e1f835c5e4f1c788f026e870019a4defff6 Mon Sep 17 00:00:00 2001 From: Saracen Date: Wed, 28 Oct 2015 20:03:10 +0000 Subject: [PATCH 37/78] Fixed broken set_loop_restart_time method in AudioStreamPlaybackOGGVorbis class. --- drivers/vorbis/audio_stream_ogg_vorbis.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vorbis/audio_stream_ogg_vorbis.h b/drivers/vorbis/audio_stream_ogg_vorbis.h index 827d8b0be39..5dbada962a0 100644 --- a/drivers/vorbis/audio_stream_ogg_vorbis.h +++ b/drivers/vorbis/audio_stream_ogg_vorbis.h @@ -85,7 +85,7 @@ public: virtual void stop(); virtual bool is_playing() const; - virtual void set_loop_restart_time(float p_time) { loop_restart_time=0; } + virtual void set_loop_restart_time(float p_time) { loop_restart_time=p_time; } virtual void set_paused(bool p_paused); virtual bool is_paused(bool p_paused) const; From 467ee040c485f317048d5aec97d5d6d0af1f54e7 Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Wed, 4 Nov 2015 15:38:02 -0300 Subject: [PATCH 38/78] Fix Range exp_edit property --- scene/gui/range.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp index ad708d16f03..7103ee651fc 100644 --- a/scene/gui/range.cpp +++ b/scene/gui/range.cpp @@ -243,7 +243,7 @@ void Range::_bind_methods() { ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/step" ), _SCS("set_step"), _SCS("get_step") ); ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/page" ), _SCS("set_page"), _SCS("get_page") ); ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/value" ), _SCS("set_val"), _SCS("get_val") ); - ADD_PROPERTY( PropertyInfo( Variant::REAL, "range/exp_edit" ), _SCS("set_exp_unit_value"), _SCS("is_unit_value_exp") ); + ADD_PROPERTY( PropertyInfo( Variant::BOOL, "range/exp_edit" ), _SCS("set_exp_unit_value"), _SCS("is_unit_value_exp") ); ADD_PROPERTY( PropertyInfo( Variant::BOOL, "rounded_values" ), _SCS("set_rounded_values"), _SCS("get_rounded_values") ); } From 8d48cf95b9408a0a54bb741c6b795d2e5179503d Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Thu, 5 Nov 2015 12:20:45 -0300 Subject: [PATCH 39/78] Add Tree checkbox check/uncheck behavior when pressing enter --- scene/gui/tree.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 5df6f2ced99..9789c838062 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2266,9 +2266,12 @@ bool Tree::edit_selected() { TreeItem::Cell &c = s->cells[col]; + if (c.mode==TreeItem::CELL_MODE_CHECK) { - - if (c.mode==TreeItem::CELL_MODE_CUSTOM) { + s->set_checked(col, !c.checked); + item_edited(col,s); + return true; + } else if (c.mode==TreeItem::CELL_MODE_CUSTOM) { edited_item=s; edited_col=col; From 03d4c05150deb7e78444a8c7f893855c07c0f775 Mon Sep 17 00:00:00 2001 From: George Marques Date: Fri, 6 Nov 2015 16:07:34 -0200 Subject: [PATCH 40/78] Fix Opus driver build for VS2010 and VS2012 Fix #2744 --- drivers/opus/opus_config.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/opus/opus_config.h b/drivers/opus/opus_config.h index c6470e92c3a..98c3e87cc62 100644 --- a/drivers/opus/opus_config.h +++ b/drivers/opus/opus_config.h @@ -7,12 +7,16 @@ /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 +#if (!defined( _MSC_VER ) || ( _MSC_VER >= 1800 )) + /* Define to 1 if you have the `lrint' function. */ #define HAVE_LRINT 1 /* Define to 1 if you have the `lrintf' function. */ #define HAVE_LRINTF 1 +#endif + /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 @@ -109,7 +113,11 @@ /* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ +#if (!defined( _MSC_VER ) || ( _MSC_VER >= 1800 )) #define restrict __restrict +#else +#undef restrict +#endif /* Work around a bug in Sun C++: it does not support _Restrict or __restrict__, even though the corresponding Sun C compiler ends up with "#define restrict _Restrict" or "#define restrict __restrict__" in the From d5fbd1d262fe8d38d550e23169af748e84667881 Mon Sep 17 00:00:00 2001 From: Franklin Sobrinho Date: Fri, 6 Nov 2015 18:52:15 -0300 Subject: [PATCH 41/78] Fix String content test --- core/variant_op.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 1cdf6d73198..763b8c11b44 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -2573,7 +2573,7 @@ bool Variant::in(const Variant& p_index, bool *r_valid) const { String idx=p_index; const String *str=reinterpret_cast(_data._mem); - return str->find("idx")!=-1; + return str->find(idx)!=-1; } } break; From 7828986b1c8583078038093ae9ab1b77f21ddde4 Mon Sep 17 00:00:00 2001 From: MarianoGNU Date: Fri, 6 Nov 2015 17:24:39 -0300 Subject: [PATCH 42/78] Add