summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/KinematicBody.xml2
-rw-r--r--doc/classes/KinematicBody2D.xml2
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp14
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp7
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.h2
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp6
-rw-r--r--editor/editor_fonts.cpp2
-rw-r--r--scene/3d/skeleton.cpp2
-rw-r--r--scene/main/viewport.cpp39
-rw-r--r--scene/main/viewport.h2
-rw-r--r--scene/resources/animation.cpp2
11 files changed, 67 insertions, 13 deletions
diff --git a/doc/classes/KinematicBody.xml b/doc/classes/KinematicBody.xml
index ad41f48ddd..a4fade6ab2 100644
--- a/doc/classes/KinematicBody.xml
+++ b/doc/classes/KinematicBody.xml
@@ -89,7 +89,7 @@
</argument>
<description>
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [code]KinematicBody[/code] or [RigidBody], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes.
- [code]linear_velocity[/code] is a value in pixels per second. Unlike in for example [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — this is done by the method.
+ [code]linear_velocity[/code] is the velocity vector (typically meters per second). Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
[code]floor_normal[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector3(0, 0, 0)[/code], everything is considered a wall. This is useful for topdown games.
[i]TODO: Update for new stop_on_slode argument.[/i] If the body is standing on a slope and the horizontal speed (relative to the floor's speed) goes below [code]slope_stop_min_velocity[/code], the body will stop completely. This prevents the body from sliding down slopes when you include gravity in [code]linear_velocity[/code]. When set to lower values, the body will not be able to stand still on steep slopes.
If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops.
diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml
index 986010f832..b94304b9a8 100644
--- a/doc/classes/KinematicBody2D.xml
+++ b/doc/classes/KinematicBody2D.xml
@@ -89,7 +89,7 @@
</argument>
<description>
Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [code]KinematicBody2D[/code] or [RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving or rotating platforms, or to make nodes push other nodes.
- [code]linear_velocity[/code] is a value in pixels per second. Unlike in for example [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — this is done by the method.
+ [code]linear_velocity[/code] is the velocity vector in pixels per second. Unlike in [method move_and_collide], you should [i]not[/i] multiply it by [code]delta[/code] — the physics engine handles applying the velocity.
[code]floor_normal[/code] is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of [code]Vector2(0, 0)[/code], everything is considered a wall. This is useful for topdown games.
[i]TODO: Update for stop_on_slope argument.[/i] If the body is standing on a slope and the horizontal speed (relative to the floor's speed) goes below [code]slope_stop_min_velocity[/code], the body will stop completely. This prevents the body from sliding down slopes when you include gravity in [code]linear_velocity[/code]. When set to lower values, the body will not be able to stand still on steep slopes.
If the body collides, it will change direction a maximum of [code]max_slides[/code] times before it stops.
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index e6ec6fb4fd..047eaaf0ac 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -317,9 +317,17 @@ void RasterizerCanvasGLES2::_draw_polygon(const int *p_indices, int p_index_coun
}
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
- glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(int) * p_index_count, p_indices);
-
- glDrawElements(GL_TRIANGLES, p_index_count, GL_UNSIGNED_INT, 0);
+ if (storage->config.support_32_bits_indices) { //should check for
+ glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(int) * p_index_count, p_indices);
+ glDrawElements(GL_TRIANGLES, p_index_count, GL_UNSIGNED_INT, 0);
+ } else {
+ uint16_t *index16 = (uint16_t *)alloca(sizeof(uint16_t) * p_index_count);
+ for (int i = 0; i < p_index_count; i++) {
+ index16[i] = uint16_t(p_indices[i]);
+ }
+ glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(uint16_t) * p_index_count, index16);
+ glDrawElements(GL_TRIANGLES, p_index_count, GL_UNSIGNED_SHORT, 0);
+ }
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index af698f3988..0622a353df 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -4658,6 +4658,13 @@ void RasterizerStorageGLES2::initialize() {
#else
config.use_rgba_2d_shadows = !(config.float_texture_supported && config.extensions.has("GL_EXT_texture_rg"));
#endif
+
+#ifdef GLES_OVER_GL
+ config.support_32_bits_indices = true;
+#else
+ config.support_32_bits_indices = config.extensions.has("GL_OES_element_index_uint");
+#endif
+
frame.count = 0;
frame.delta = 0;
frame.current_rt = NULL;
diff --git a/drivers/gles2/rasterizer_storage_gles2.h b/drivers/gles2/rasterizer_storage_gles2.h
index 6f3ea25cc9..ae14aaa9c0 100644
--- a/drivers/gles2/rasterizer_storage_gles2.h
+++ b/drivers/gles2/rasterizer_storage_gles2.h
@@ -78,6 +78,8 @@ public:
bool force_vertex_shading;
bool use_rgba_2d_shadows;
+
+ bool support_32_bits_indices;
} config;
struct Resources {
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index d1d063ad5b..d53b27eb88 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -2680,8 +2680,10 @@ void RasterizerSceneGLES3::_setup_environment(Environment *env, const CameraMatr
// Drop -O3 for this function as it triggers a GCC bug up until at least GCC 8.2.1.
// This refers to GH issue #19633.
// The bug has been reported to the GCC project.
+#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC push_options
-#pragma GCC optimize ("-O2")
+#pragma GCC optimize("-O2")
+#endif
void RasterizerSceneGLES3::_setup_directional_light(int p_index, const Transform &p_camera_inverse_transform, bool p_use_shadows) {
LightInstance *li = directional_lights[p_index];
@@ -2799,7 +2801,9 @@ void RasterizerSceneGLES3::_setup_directional_light(int p_index, const Transform
glBindBufferBase(GL_UNIFORM_BUFFER, 3, state.directional_ubo);
}
+#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC pop_options
+#endif
void RasterizerSceneGLES3::_setup_lights(RID *p_light_cull_result, int p_light_cull_count, const Transform &p_camera_inverse_transform, const CameraMatrix &p_camera_projection, RID p_shadow_atlas) {
diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp
index d0e7cda6b6..fa4172cded 100644
--- a/editor/editor_fonts.cpp
+++ b/editor/editor_fonts.cpp
@@ -242,6 +242,6 @@ void editor_register_fonts(Ref<Theme> p_theme) {
MAKE_SOURCE_FONT(df_output_code, int(EDITOR_DEF("run/output/font_size", 13)) * EDSCALE);
p_theme->set_font("output_source", "EditorFonts", df_output_code);
- MAKE_SOURCE_FONT(df_text_editor_status_code, 14 * EDSCALE);
+ MAKE_SOURCE_FONT(df_text_editor_status_code, default_font_size);
p_theme->set_font("status_source", "EditorFonts", df_text_editor_status_code);
}
diff --git a/scene/3d/skeleton.cpp b/scene/3d/skeleton.cpp
index 0db2250a3a..8caf4e8e39 100644
--- a/scene/3d/skeleton.cpp
+++ b/scene/3d/skeleton.cpp
@@ -320,7 +320,7 @@ void Skeleton::_notification(int p_what) {
}
b.transform_final = b.pose_global * b.rest_global_inverse;
- vs->skeleton_bone_set_transform(skeleton, i, global_transform * (b.transform_final * global_transform_inverse));
+ vs->skeleton_bone_set_transform(skeleton, order[i], global_transform * (b.transform_final * global_transform_inverse));
for (List<uint32_t>::Element *E = b.nodes_bound.front(); E; E = E->next()) {
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 0633d194f7..8df007dcc7 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1533,6 +1533,35 @@ void Viewport::_gui_call_input(Control *p_control, const Ref<InputEvent> &p_inpu
//_unblock();
}
+void Viewport::_gui_call_notification(Control *p_control, int p_what) {
+
+ CanvasItem *ci = p_control;
+ while (ci) {
+
+ Control *control = Object::cast_to<Control>(ci);
+ if (control) {
+
+ if (control->data.mouse_filter != Control::MOUSE_FILTER_IGNORE) {
+ control->notification(p_what);
+ }
+
+ if (!control->is_inside_tree())
+ break;
+
+ if (!control->is_inside_tree() || control->is_set_as_toplevel())
+ break;
+ if (control->data.mouse_filter == Control::MOUSE_FILTER_STOP)
+ break;
+ }
+
+ if (ci->is_set_as_toplevel())
+ break;
+
+ ci = ci->get_parent_item();
+ }
+
+ //_unblock();
+}
Control *Viewport::_gui_find_control(const Point2 &p_global) {
_gui_prepare_subwindows();
@@ -1975,13 +2004,15 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
if (over != gui.mouse_over) {
- if (gui.mouse_over)
- gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_EXIT);
+ if (gui.mouse_over) {
+ _gui_call_notification(gui.mouse_over, Control::NOTIFICATION_MOUSE_EXIT);
+ }
_gui_cancel_tooltip();
- if (over)
- over->notification(Control::NOTIFICATION_MOUSE_ENTER);
+ if (over) {
+ _gui_call_notification(over, Control::NOTIFICATION_MOUSE_ENTER);
+ }
}
gui.mouse_over = over;
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 0565fd3d18..cdb9d4afb5 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -305,6 +305,8 @@ private:
bool disable_input;
void _gui_call_input(Control *p_control, const Ref<InputEvent> &p_input);
+ void _gui_call_notification(Control *p_control, int p_what);
+
void _gui_prepare_subwindows();
void _gui_sort_subwindows();
void _gui_sort_roots();
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index 383f3f5d4e..3156e12c50 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -1815,7 +1815,7 @@ Variant Animation::value_track_interpolate(int p_track, float p_time) const {
bool ok = false;
- Variant res = _interpolate(vt->values, p_time, vt->update_mode == UPDATE_CONTINUOUS ? vt->interpolation : INTERPOLATION_NEAREST, vt->loop_wrap, &ok);
+ Variant res = _interpolate(vt->values, p_time, (vt->update_mode == UPDATE_CONTINUOUS || vt->update_mode == UPDATE_CAPTURE) ? vt->interpolation : INTERPOLATION_NEAREST, vt->loop_wrap, &ok);
if (ok) {