summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/bind/core_bind.cpp2
-rw-r--r--doc/classes/BaseButton.xml2
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp17
-rw-r--r--editor/plugins/animation_blend_space_2d_editor.cpp9
-rw-r--r--editor/plugins/animation_blend_space_2d_editor.h2
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp21
-rw-r--r--editor/project_export.cpp2
-rw-r--r--modules/gdnative/videodecoder/video_stream_gdnative.cpp2
-rw-r--r--platform/iphone/export/export.cpp30
-rw-r--r--platform/osx/os_osx.mm4
-rw-r--r--scene/animation/animation_blend_space_2d.cpp40
-rw-r--r--scene/animation/animation_blend_space_2d.h1
12 files changed, 90 insertions, 42 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 7a253ed85c..e81468e888 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -2423,7 +2423,7 @@ void _Thread::_start_func(void *ud) {
} break;
case Variant::CallError::CALL_ERROR_TOO_FEW_ARGUMENTS: {
- reason = "Too Many Arguments";
+ reason = "Too Few Arguments";
} break;
case Variant::CallError::CALL_ERROR_INVALID_METHOD: {
diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml
index 05ffe6cc11..ff3e22ba26 100644
--- a/doc/classes/BaseButton.xml
+++ b/doc/classes/BaseButton.xml
@@ -92,7 +92,7 @@
<argument index="0" name="button_pressed" type="bool">
</argument>
<description>
- This signal is emitted when the button was just toggled between pressed and normal states (only if toggle_mode is active). The new state is contained in the [i]pressed[/i] argument.
+ This signal is emitted when the button was just toggled between pressed and normal states (only if toggle_mode is active). The new state is contained in the [i]button_pressed[/i] argument.
</description>
</signal>
</signals>
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index f0496fc153..71b826d689 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -66,8 +66,13 @@
#endif
#endif
-#if !defined(GLES_OVER_GL) && !defined(IPHONE_ENABLED)
-// Used for debugging on mobile, but not iOS as EGL is not available
+#ifndef IPHONE_ENABLED
+// We include EGL below to get debug callback on GLES2 platforms,
+// but EGL is not available on iOS.
+#define CAN_DEBUG
+#endif
+
+#if !defined(GLES_OVER_GL) && defined(CAN_DEBUG)
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES2/gl2platform.h>
@@ -80,7 +85,7 @@
#define strcpy strcpy_s
#endif
-#ifndef IPHONE_ENABLED
+#ifdef CAN_DEBUG
static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const GLvoid *userParam) {
if (type == _EXT_DEBUG_TYPE_OTHER_ARB)
@@ -128,7 +133,7 @@ static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GL
ERR_PRINTS(output);
}
-#endif // IPHONE_ENABLED
+#endif // CAN_DEBUG
typedef void (*DEBUGPROCARB)(GLenum source,
GLenum type,
@@ -222,6 +227,7 @@ void RasterizerGLES2::initialize() {
#endif // GLAD_ENABLED
// For debugging
+#ifdef CAN_DEBUG
#ifdef GLES_OVER_GL
if (OS::get_singleton()->is_stdout_verbose() && GLAD_GL_ARB_debug_output) {
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_ERROR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, NULL, GL_TRUE);
@@ -237,7 +243,6 @@ void RasterizerGLES2::initialize() {
*/
}
#else
-#ifndef IPHONE_ENABLED
if (OS::get_singleton()->is_stdout_verbose()) {
DebugMessageCallbackARB callback = (DebugMessageCallbackARB)eglGetProcAddress("glDebugMessageCallback");
if (!callback) {
@@ -252,8 +257,8 @@ void RasterizerGLES2::initialize() {
glEnable(_EXT_DEBUG_OUTPUT);
}
}
-#endif // !IPHONE_ENABLED
#endif // GLES_OVER_GL
+#endif // CAN_DEBUG
const GLubyte *renderer = glGetString(GL_RENDERER);
print_line("OpenGL ES 2.0 Renderer: " + String((const char *)renderer));
diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp
index 664e3e8b7f..038e2d0b3e 100644
--- a/editor/plugins/animation_blend_space_2d_editor.cpp
+++ b/editor/plugins/animation_blend_space_2d_editor.cpp
@@ -47,11 +47,19 @@ bool AnimationNodeBlendSpace2DEditor::can_edit(const Ref<AnimationNode> &p_node)
return bs2d.is_valid();
}
+void AnimationNodeBlendSpace2DEditor::_blend_space_changed() {
+ blend_space_draw->update();
+}
+
void AnimationNodeBlendSpace2DEditor::edit(const Ref<AnimationNode> &p_node) {
+ if (blend_space.is_valid()) {
+ blend_space->disconnect("triangles_updated", this, "_blend_space_changed");
+ }
blend_space = p_node;
if (!blend_space.is_null()) {
+ blend_space->connect("triangles_updated", this, "_blend_space_changed");
_update_space();
}
}
@@ -837,6 +845,7 @@ void AnimationNodeBlendSpace2DEditor::_bind_methods() {
ClassDB::bind_method("_removed_from_graph", &AnimationNodeBlendSpace2DEditor::_removed_from_graph);
ClassDB::bind_method("_auto_triangles_toggled", &AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled);
+ ClassDB::bind_method("_blend_space_changed", &AnimationNodeBlendSpace2DEditor::_blend_space_changed);
ClassDB::bind_method("_file_opened", &AnimationNodeBlendSpace2DEditor::_file_opened);
}
diff --git a/editor/plugins/animation_blend_space_2d_editor.h b/editor/plugins/animation_blend_space_2d_editor.h
index 3c128a6ef9..74186791e1 100644
--- a/editor/plugins/animation_blend_space_2d_editor.h
+++ b/editor/plugins/animation_blend_space_2d_editor.h
@@ -138,6 +138,8 @@ class AnimationNodeBlendSpace2DEditor : public AnimationTreeNodeEditorPlugin {
MENU_LOAD_FILE_CONFIRM = 1002
};
+ void _blend_space_changed();
+
protected:
void _notification(int p_what);
static void _bind_methods();
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index a2873fe7d7..93d262f874 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -665,9 +665,9 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
//todo, could check whether it already exists?
polygons.push_back(polygon_create);
- undo_redo->create_action(TTR("Add Polygon"));
+ undo_redo->create_action(TTR("Add Custom Polygon"));
undo_redo->add_do_method(node, "set_polygons", polygons);
- undo_redo->add_undo_method(node, "set_polygons", polygons_prev);
+ undo_redo->add_undo_method(node, "set_polygons", node->get_polygons());
undo_redo->add_do_method(uv_edit_draw, "update");
undo_redo->add_undo_method(uv_edit_draw, "update");
undo_redo->commit_action();
@@ -705,9 +705,9 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
if (erase_index != -1) {
polygons.remove(erase_index);
- undo_redo->create_action(TTR("Remove Polygon"));
+ undo_redo->create_action(TTR("Remove Custom Polygon"));
undo_redo->add_do_method(node, "set_polygons", polygons);
- undo_redo->add_undo_method(node, "set_polygons", polygons_prev);
+ undo_redo->add_undo_method(node, "set_polygons", node->get_polygons());
undo_redo->add_do_method(uv_edit_draw, "update");
undo_redo->add_undo_method(uv_edit_draw, "update");
undo_redo->commit_action();
@@ -735,18 +735,21 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
} else if (uv_drag && !uv_create) {
- if (uv_edit_mode[0]->is_pressed()) { //edit uv
+ if (uv_edit_mode[0]->is_pressed()) { // Edit UV.
undo_redo->create_action(TTR("Transform UV Map"));
undo_redo->add_do_method(node, "set_uv", node->get_uv());
undo_redo->add_undo_method(node, "set_uv", points_prev);
- } else if (uv_edit_mode[1]->is_pressed()) { //edit polygon
+ undo_redo->add_do_method(uv_edit_draw, "update");
+ undo_redo->add_undo_method(uv_edit_draw, "update");
+ undo_redo->commit_action();
+ } else if (uv_edit_mode[1]->is_pressed() && uv_move_current == UV_MODE_EDIT_POINT) { // Edit polygon.
undo_redo->create_action(TTR("Transform Polygon"));
undo_redo->add_do_method(node, "set_polygon", node->get_polygon());
undo_redo->add_undo_method(node, "set_polygon", points_prev);
+ undo_redo->add_do_method(uv_edit_draw, "update");
+ undo_redo->add_undo_method(uv_edit_draw, "update");
+ undo_redo->commit_action();
}
- undo_redo->add_do_method(uv_edit_draw, "update");
- undo_redo->add_undo_method(uv_edit_draw, "update");
- undo_redo->commit_action();
uv_drag = false;
} else if (bone_painting) {
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index c0e785d2a1..c2f9df9877 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -1063,7 +1063,7 @@ ProjectExportDialog::ProjectExportDialog() {
VBoxContainer *main_vb = memnew(VBoxContainer);
add_child(main_vb);
- HBoxContainer *hbox = memnew(HBoxContainer);
+ HSplitContainer *hbox = memnew(HSplitContainer);
main_vb->add_child(hbox);
hbox->set_v_size_flags(SIZE_EXPAND_FILL);
diff --git a/modules/gdnative/videodecoder/video_stream_gdnative.cpp b/modules/gdnative/videodecoder/video_stream_gdnative.cpp
index 8239d57a77..a1590cef43 100644
--- a/modules/gdnative/videodecoder/video_stream_gdnative.cpp
+++ b/modules/gdnative/videodecoder/video_stream_gdnative.cpp
@@ -164,7 +164,7 @@ void VideoStreamPlaybackGDNative::update(float p_delta) {
}
}
- while (interface->get_playback_position(data_struct) < time) {
+ while (interface->get_playback_position(data_struct) < time && playing) {
update_texture();
}
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index c178b1eb18..ef81981ec0 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -1029,32 +1029,38 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
- bool valid = true;
String err;
+ r_missing_templates = find_export_template("iphone.zip") == String();
- if (!exists_export_template("iphone.zip", &err)) {
- valid = false;
+ if (p_preset->get("custom_package/debug") != "") {
+ if (FileAccess::exists(p_preset->get("custom_package/debug"))) {
+ r_missing_templates = false;
+ } else {
+ err += "Custom debug package not found.\n";
+ }
}
- if (p_preset->get("custom_package/debug") != "" && !FileAccess::exists(p_preset->get("custom_package/debug"))) {
- valid = false;
- err += "Custom debug package not found.\n";
+ if (p_preset->get("custom_package/release") != "") {
+ if (FileAccess::exists(p_preset->get("custom_package/release"))) {
+ r_missing_templates = false;
+ } else {
+ err += "Custom release package not found.\n";
+ }
}
- if (p_preset->get("custom_package/release") != "" && !FileAccess::exists(p_preset->get("custom_package/release"))) {
- valid = false;
- err += "Custom release package not found.\n";
- }
+ bool valid = !r_missing_templates;
String team_id = p_preset->get("application/app_store_team_id");
if (team_id.length() == 0) {
err += "App Store Team ID not specified - cannot configure the project.\n";
+ valid = false;
}
String identifier = p_preset->get("application/identifier");
String pn_err;
if (!is_package_name_valid(identifier, &pn_err)) {
err += "Invalid Identifier - " + pn_err + "\n";
+ valid = false;
}
for (unsigned int i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) {
@@ -1063,6 +1069,7 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset
if (icon_path.length() == 0) {
if (info.is_required) {
err += "Required icon is not specified in the preset.\n";
+ valid = false;
}
break;
}
@@ -1071,8 +1078,7 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset
if (!err.empty())
r_error = err;
- r_missing_templates = !valid;
- return err.empty();
+ return valid;
}
EditorExportPlatformIOS::EditorExportPlatformIOS() {
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 5880a0e0bd..ddd98ab88c 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -629,6 +629,7 @@ static void _mouseDownEvent(NSEvent *event, int index, int mask, bool pressed) {
const Vector2 pos = get_mouse_pos([event locationInWindow], backingScaleFactor);
mm->set_position(pos);
mm->set_global_position(pos);
+ mm->set_speed(OS_OSX::singleton->input->get_last_mouse_speed());
Vector2 relativeMotion = Vector2();
relativeMotion.x = [event deltaX] * OS_OSX::singleton -> _mouse_scale(backingScaleFactor);
relativeMotion.y = [event deltaY] * OS_OSX::singleton -> _mouse_scale(backingScaleFactor);
@@ -1615,7 +1616,8 @@ void OS_OSX::set_cursor_shape(CursorShape p_shape) {
case CURSOR_VSPLIT: [[NSCursor resizeUpDownCursor] set]; break;
case CURSOR_HSPLIT: [[NSCursor resizeLeftRightCursor] set]; break;
case CURSOR_HELP: [[NSCursor arrowCursor] set]; break;
- default: {};
+ default: {
+ };
}
}
diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp
index 8b26044805..d744d6cc8e 100644
--- a/scene/animation/animation_blend_space_2d.cpp
+++ b/scene/animation/animation_blend_space_2d.cpp
@@ -80,18 +80,15 @@ void AnimationNodeBlendSpace2D::add_blend_point(const Ref<AnimationRootNode> &p_
blend_points[p_at_index].node->connect("tree_changed", this, "_tree_changed", varray(), CONNECT_REFERENCE_COUNTED);
blend_points_used++;
- if (auto_triangles) {
- trianges_dirty = true;
- }
+ _queue_auto_triangles();
+
emit_signal("tree_changed");
}
void AnimationNodeBlendSpace2D::set_blend_point_position(int p_point, const Vector2 &p_position) {
ERR_FAIL_INDEX(p_point, blend_points_used);
blend_points[p_point].position = p_position;
- if (auto_triangles) {
- trianges_dirty = true;
- }
+ _queue_auto_triangles();
}
void AnimationNodeBlendSpace2D::set_blend_point_node(int p_point, const Ref<AnimationRootNode> &p_node) {
ERR_FAIL_INDEX(p_point, blend_points_used);
@@ -309,15 +306,27 @@ Vector<int> AnimationNodeBlendSpace2D::_get_triangles() const {
return t;
}
+void AnimationNodeBlendSpace2D::_queue_auto_triangles() {
+ if (!auto_triangles || trianges_dirty) {
+ return;
+ }
+
+ trianges_dirty = true;
+ call_deferred("_update_triangles");
+}
+
void AnimationNodeBlendSpace2D::_update_triangles() {
if (!auto_triangles || !trianges_dirty)
return;
+ print_line("updating triangles");
trianges_dirty = false;
triangles.clear();
- if (blend_points_used < 3)
+ if (blend_points_used < 3) {
+ emit_signal("triangles_updated");
return;
+ }
Vector<Vector2> points;
points.resize(blend_points_used);
@@ -327,9 +336,12 @@ void AnimationNodeBlendSpace2D::_update_triangles() {
Vector<Delaunay2D::Triangle> triangles = Delaunay2D::triangulate(points);
+ print_line("triangles generated: " + itos(triangles.size()));
+
for (int i = 0; i < triangles.size(); i++) {
add_triangle(triangles[i].points[0], triangles[i].points[1], triangles[i].points[2]);
}
+ emit_signal("triangles_updated");
}
Vector2 AnimationNodeBlendSpace2D::get_closest_point(const Vector2 &p_point) {
@@ -546,6 +558,10 @@ String AnimationNodeBlendSpace2D::get_caption() const {
}
void AnimationNodeBlendSpace2D::_validate_property(PropertyInfo &property) const {
+
+ if (auto_triangles && property.name == "triangles") {
+ property.usage = 0;
+ }
if (property.name.begins_with("blend_point_")) {
String left = property.name.get_slicec('/', 0);
int idx = left.get_slicec('_', 2).to_int();
@@ -557,10 +573,12 @@ void AnimationNodeBlendSpace2D::_validate_property(PropertyInfo &property) const
}
void AnimationNodeBlendSpace2D::set_auto_triangles(bool p_enable) {
- auto_triangles = p_enable;
- if (auto_triangles) {
- trianges_dirty = true;
+ if (auto_triangles == p_enable) {
+ return;
}
+
+ auto_triangles = p_enable;
+ _queue_auto_triangles();
}
bool AnimationNodeBlendSpace2D::get_auto_triangles() const {
@@ -625,6 +643,7 @@ void AnimationNodeBlendSpace2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_blend_mode"), &AnimationNodeBlendSpace2D::get_blend_mode);
ClassDB::bind_method(D_METHOD("_tree_changed"), &AnimationNodeBlendSpace2D::_tree_changed);
+ ClassDB::bind_method(D_METHOD("_update_triangles"), &AnimationNodeBlendSpace2D::_update_triangles);
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "auto_triangles", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_auto_triangles", "get_auto_triangles");
@@ -642,6 +661,7 @@ void AnimationNodeBlendSpace2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::STRING, "y_label", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_y_label", "get_y_label");
ADD_PROPERTY(PropertyInfo(Variant::INT, "blend_mode", PROPERTY_HINT_ENUM, "Interpolated,Discrete,Carry", PROPERTY_USAGE_NOEDITOR), "set_blend_mode", "get_blend_mode");
+ ADD_SIGNAL(MethodInfo("triangles_updated"));
BIND_ENUM_CONSTANT(BLEND_MODE_INTERPOLATED);
BIND_ENUM_CONSTANT(BLEND_MODE_DISCRETE);
BIND_ENUM_CONSTANT(BLEND_MODE_DISCRETE_CARRY);
diff --git a/scene/animation/animation_blend_space_2d.h b/scene/animation/animation_blend_space_2d.h
index 53885d4ad2..c21360beb9 100644
--- a/scene/animation/animation_blend_space_2d.h
+++ b/scene/animation/animation_blend_space_2d.h
@@ -82,6 +82,7 @@ protected:
bool trianges_dirty;
void _update_triangles();
+ void _queue_auto_triangles();
void _tree_changed();