summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/io/multiplayer_api.cpp5
-rw-r--r--doc/classes/ARVRAnchor.xml6
-rw-r--r--doc/classes/ARVRCamera.xml6
-rw-r--r--doc/classes/ARVRController.xml6
-rw-r--r--doc/classes/ARVROrigin.xml2
-rw-r--r--doc/classes/AnimationNodeBlendSpace2D.xml6
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp12
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp18
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp5
-rw-r--r--editor/editor_properties_array_dict.cpp12
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp4
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp1
-rw-r--r--main/splash_editor.pngbin37619 -> 39571 bytes
-rw-r--r--main/tests/test_math.cpp23
-rw-r--r--modules/csg/csg_shape.cpp4
-rw-r--r--modules/gdscript/gdscript_editor.cpp6
-rw-r--r--modules/gdscript/gdscript_function.h10
-rw-r--r--modules/gdscript/gdscript_parser.cpp19
-rw-r--r--modules/webm/libvpx/SCsub4
-rw-r--r--platform/android/SCsub2
-rw-r--r--platform/android/detect.py19
-rw-r--r--platform/android/export/export.cpp5
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java26
-rw-r--r--platform/iphone/detect.py2
-rw-r--r--scene/animation/animation_blend_space_1d.cpp2
-rw-r--r--scene/resources/texture.cpp4
26 files changed, 131 insertions, 78 deletions
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp
index 30c5bfcaa7..7680d47620 100644
--- a/core/io/multiplayer_api.cpp
+++ b/core/io/multiplayer_api.cpp
@@ -122,6 +122,7 @@ void MultiplayerAPI::clear() {
connected_peers.clear();
path_get_cache.clear();
path_send_cache.clear();
+ packet_cache.clear();
last_send_cache_id = 1;
}
@@ -131,6 +132,8 @@ void MultiplayerAPI::set_root_node(Node *p_node) {
void MultiplayerAPI::set_network_peer(const Ref<NetworkedMultiplayerPeer> &p_peer) {
+ if (p_peer == network_peer) return; // Nothing to do
+
if (network_peer.is_valid()) {
network_peer->disconnect("peer_connected", this, "_add_peer");
network_peer->disconnect("peer_disconnected", this, "_del_peer");
@@ -857,6 +860,8 @@ void MultiplayerAPI::_bind_methods() {
}
MultiplayerAPI::MultiplayerAPI() {
+ rpc_sender_id = 0;
+ root_node = NULL;
clear();
}
diff --git a/doc/classes/ARVRAnchor.xml b/doc/classes/ARVRAnchor.xml
index fa93d9668c..5b9188b171 100644
--- a/doc/classes/ARVRAnchor.xml
+++ b/doc/classes/ARVRAnchor.xml
@@ -5,8 +5,8 @@
</brief_description>
<description>
The ARVR Anchor point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them.
- This node is mapped to one of the anchors through its unique id. When you receive a signal that a new anchor is available you should add this node to your scene for that anchor. You can predefine nodes and set the id and the nodes will simply remain on 0,0,0 until a plane is recognised.
- Keep in mind that as long as plane detection is enable the size, placing and orientation of an anchor will be updates as the detection logic learns more about the real world out there especially if only part of the surface is in view.
+ This node is mapped to one of the anchors through its unique id. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the id and the nodes will simply remain on 0,0,0 until a plane is recognised.
+ Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view.
</description>
<tutorials>
</tutorials>
@@ -31,7 +31,7 @@
<return type="Plane">
</return>
<description>
- Returns a plane aligned with our anchor, handy for intersection testing
+ Returns a plane aligned with our anchor; handy for intersection testing.
</description>
</method>
<method name="get_size" qualifiers="const">
diff --git a/doc/classes/ARVRCamera.xml b/doc/classes/ARVRCamera.xml
index e74b435e11..aca8282a7c 100644
--- a/doc/classes/ARVRCamera.xml
+++ b/doc/classes/ARVRCamera.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="ARVRCamera" inherits="Camera" category="Core" version="3.1">
<brief_description>
- A camera node with a few overrules for AR/VR applied such as location tracking.
+ A camera node with a few overrules for AR/VR applied, such as location tracking.
</brief_description>
<description>
- This is a helper spatial node for our camera, note that if stereoscopic rendering is applicable (VR-HMD) most of the camera properties are ignored as the HMD information overrides them. The only properties that can be trusted are the near and far planes.
- The position and orientation of this node is automatically updated by the ARVR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that in contrast to the ARVR Controller the render thread has access to the most up to date tracking data of the HMD and the location of the ARVRCamera can lag a few milliseconds behind what is used for rendering as a result.
+ This is a helper spatial node for our camera; note that, if stereoscopic rendering is applicable (VR-HMD), most of the camera properties are ignored, as the HMD information overrides them. The only properties that can be trusted are the near and far planes.
+ The position and orientation of this node is automatically updated by the ARVR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the ARVR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the ARVRCamera can lag a few milliseconds behind what is used for rendering as a result.
</description>
<tutorials>
</tutorials>
diff --git a/doc/classes/ARVRController.xml b/doc/classes/ARVRController.xml
index d3d6fce537..ccb55375d2 100644
--- a/doc/classes/ARVRController.xml
+++ b/doc/classes/ARVRController.xml
@@ -4,8 +4,8 @@
A spatial node representing a spatially tracked controller.
</brief_description>
<description>
- This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy pass throughs to the state of buttons and such on the controllers.
- Controllers are linked by their id. You can create controller nodes before the controllers are available. Say your game always uses two controllers (one for each hand) you can predefine the controllers with id 1 and 2 and they will become active as soon as the controllers are identified. If you expect additional controllers to be used you should react to the signals and add ARVRController nodes to your scene.
+ This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy passthroughs to the state of buttons and such on the controllers.
+ Controllers are linked by their id. You can create controller nodes before the controllers are available. Say your game always uses two controllers (one for each hand) you can predefine the controllers with id 1 and 2 and they will become active as soon as the controllers are identified. If you expect additional controllers to be used, you should react to the signals and add ARVRController nodes to your scene.
The position of the controller node is automatically updated by the ARVR Server. This makes this node ideal to add child nodes to visualise the controller.
</description>
<tutorials>
@@ -64,7 +64,7 @@
<member name="controller_id" type="int" setter="set_controller_id" getter="get_controller_id">
The controller's id.
A controller id of 0 is unbound and will always result in an inactive node. Controller id 1 is reserved for the first controller that identifies itself as the left hand controller and id 2 is reserved for the first controller that identifies itself as the right hand controller.
- For any other controller that the [ARVRServer] detects we continue with controller id 3.
+ For any other controller that the [ARVRServer] detects, we continue with controller id 3.
When a controller is turned off, its slot is freed. This ensures controllers will keep the same id even when controllers with lower ids are turned off.
</member>
<member name="rumble" type="float" setter="set_rumble" getter="get_rumble">
diff --git a/doc/classes/ARVROrigin.xml b/doc/classes/ARVROrigin.xml
index 80626338f2..55062ba3ae 100644
--- a/doc/classes/ARVROrigin.xml
+++ b/doc/classes/ARVROrigin.xml
@@ -6,7 +6,7 @@
<description>
This is a special node within the AR/VR system that maps the physical location of the center of our tracking space to the virtual location within our game world.
There should be only one of these nodes in your scene and you must have one. All the ARVRCamera, ARVRController and ARVRAnchor nodes should be direct children of this node for spatial tracking to work correctly.
- It is the position of this node that you update when you're character needs to move through your game world while we're not moving in the real world. Movement in the real world is always in relation to this origin point.
+ It is the position of this node that you update when your character needs to move through your game world while we're not moving in the real world. Movement in the real world is always in relation to this origin point.
So say that your character is driving a car, the ARVROrigin node should be a child node of this car. If you implement a teleport system to move your character, you change the position of this node. Etc.
</description>
<tutorials>
diff --git a/doc/classes/AnimationNodeBlendSpace2D.xml b/doc/classes/AnimationNodeBlendSpace2D.xml
index 55e27fc331..b205c01468 100644
--- a/doc/classes/AnimationNodeBlendSpace2D.xml
+++ b/doc/classes/AnimationNodeBlendSpace2D.xml
@@ -126,6 +126,12 @@
<member name="y_label" type="String" setter="set_y_label" getter="get_y_label">
</member>
</members>
+ <signals>
+ <signal name="triangles_updated">
+ <description>
+ </description>
+ </signal>
+ </signals>
<constants>
<constant name="BLEND_MODE_INTERPOLATED" value="0" enum="BlendMode">
</constant>
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index 6d1c636f42..bbae3d3d22 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -1303,6 +1303,14 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons
t = t->get_ptr();
+#ifdef TOOLS_ENABLED
+ if (t->detect_normal && texture_hints[i] == ShaderLanguage::ShaderNode::Uniform::HINT_NORMAL) {
+ t->detect_normal(t->detect_normal_ud);
+ }
+#endif
+ if (t->render_target)
+ t->render_target->used_in_frame = true;
+
if (t->redraw_if_visible) {
VisualServerRaster::redraw_request();
}
@@ -1826,8 +1834,8 @@ void RasterizerCanvasGLES2::initialize() {
glBindBuffer(GL_ARRAY_BUFFER, 0);
- uint32_t index_size = GLOBAL_DEF("rendering/limits/buffers/canvas_polygon_index_size_kb", 128);
- ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/buffers/canvas_polygon_index_size_kb", PropertyInfo(Variant::INT, "rendering/limits/buffers/canvas_polygon_index_size_kb", PROPERTY_HINT_RANGE, "0,256,1,or_greater"));
+ uint32_t index_size = GLOBAL_DEF("rendering/limits/buffers/canvas_polygon_index_buffer_size_kb", 128);
+ ProjectSettings::get_singleton()->set_custom_property_info("rendering/limits/buffers/canvas_polygon_index_buffer_size_kb", PropertyInfo(Variant::INT, "rendering/limits/buffers/canvas_polygon_index_buffer_size_kb", PROPERTY_HINT_RANGE, "0,256,1,or_greater"));
index_size *= 1024; // kb
glGenBuffers(1, &data.polygon_index_buffer);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index d9f1fe1212..e4783e907b 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -1245,6 +1245,24 @@ bool RasterizerSceneGLES2::_setup_material(RasterizerStorageGLES2::Material *p_m
t = t->get_ptr();
+ if (t->redraw_if_visible) { //must check before proxy because this is often used with proxies
+ VisualServerRaster::redraw_request();
+ }
+
+#ifdef TOOLS_ENABLED
+ if (t->detect_3d) {
+ t->detect_3d(t->detect_3d_ud);
+ }
+#endif
+
+#ifdef TOOLS_ENABLED
+ if (t->detect_normal && texture_hints[i] == ShaderLanguage::ShaderNode::Uniform::HINT_NORMAL) {
+ t->detect_normal(t->detect_normal_ud);
+ }
+#endif
+ if (t->render_target)
+ t->render_target->used_in_frame = true;
+
glBindTexture(t->target, t->tex_id);
if (i == 0) {
state.current_main_tex = t->tex_id;
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index bc1883b09d..06b84aeab4 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -1144,6 +1144,11 @@ void RasterizerCanvasGLES3::_canvas_item_render_commands(Item *p_item, Item *cur
void RasterizerCanvasGLES3::_copy_texscreen(const Rect2 &p_rect) {
+ if (storage->frame.current_rt->effects.mip_maps[0].sizes.size() == 0) {
+ ERR_EXPLAIN("Can't use screen texture copying in a render target configured without copy buffers");
+ ERR_FAIL();
+ }
+
glDisable(GL_BLEND);
state.canvas_texscreen_used = true;
diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp
index dd802bc72e..20cb6ab534 100644
--- a/editor/editor_properties_array_dict.cpp
+++ b/editor/editor_properties_array_dict.cpp
@@ -360,10 +360,14 @@ void EditorPropertyArray::update_property() {
vbox->add_child(hb);
hb->add_child(prop);
prop->set_h_size_flags(SIZE_EXPAND_FILL);
- Button *edit = memnew(Button);
- edit->set_icon(get_icon("Edit", "EditorIcons"));
- hb->add_child(edit);
- edit->connect("pressed", this, "_change_type", varray(edit, i + offset));
+
+ if (subtype == Variant::NIL) {
+ Button *edit = memnew(Button);
+ edit->set_icon(get_icon("Edit", "EditorIcons"));
+ hb->add_child(edit);
+ edit->connect("pressed", this, "_change_type", varray(edit, i + offset));
+ }
+
} else {
vbox->add_child(prop);
}
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index b0e812a130..86d6799b19 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -573,10 +573,10 @@ bool CanvasItemEditor::_get_bone_shape(Vector<Vector2> *shape, Vector<Vector2> *
Node2D *from_node = Object::cast_to<Node2D>(ObjectDB::get_instance(bone->key().from));
Node2D *to_node = Object::cast_to<Node2D>(ObjectDB::get_instance(bone->key().to));
- if (!from_node->is_inside_tree())
- return false; //may have been removed
if (!from_node)
return false;
+ if (!from_node->is_inside_tree())
+ return false; //may have been removed
if (!to_node && bone->get().length == 0)
return false;
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 1ac7ee89d6..1d7b4ffa41 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -482,6 +482,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
polygons_prev = node->get_polygons();
node->set_polygon(points_prev);
node->set_uv(points_prev);
+ node->set_internal_vertex_count(0);
uv_edit_draw->update();
} else {
diff --git a/main/splash_editor.png b/main/splash_editor.png
index d5bc2f1ce6..d8677f1749 100644
--- a/main/splash_editor.png
+++ b/main/splash_editor.png
Binary files differ
diff --git a/main/tests/test_math.cpp b/main/tests/test_math.cpp
index c833bac4ab..a082abcaba 100644
--- a/main/tests/test_math.cpp
+++ b/main/tests/test_math.cpp
@@ -444,14 +444,11 @@ MainLoop *test() {
float bb = (rgbe >> 18) & 0x1ff;
float eb = (rgbe >> 27);
float mb = Math::pow(2, eb - 15.0 - 9.0);
- ;
float rd = rb * mb;
float gd = gb * mb;
float bd = bb * mb;
print_line("RGBE: " + Color(rd, gd, bd));
-
- return NULL;
}
print_line("Dvectors: " + itos(MemoryPool::allocs_used));
@@ -482,8 +479,6 @@ MainLoop *test() {
print_line("later Mem used: " + itos(MemoryPool::total_memory));
print_line("Mlater Ax mem used: " + itos(MemoryPool::max_memory));
- return NULL;
-
List<String> cmdlargs = OS::get_singleton()->get_cmdline_args();
if (cmdlargs.empty()) {
@@ -492,6 +487,11 @@ MainLoop *test() {
}
String test = cmdlargs.back()->get();
+ if (test == "math") {
+ // Not a file name but the test name, abort.
+ // FIXME: This test is ugly as heck, needs fixing :)
+ return NULL;
+ }
FileAccess *fa = FileAccess::open(test, FileAccess::READ);
@@ -516,8 +516,6 @@ MainLoop *test() {
print_line("Found class: " + getclass.get_class());
}
- return NULL;
-
{
Vector<int> hashes;
@@ -557,13 +555,10 @@ MainLoop *test() {
}
print_line("DONE");
-
- return NULL;
}
- {
+ {
print_line("NUM: " + itos(-128));
- return NULL;
}
{
@@ -593,7 +588,6 @@ MainLoop *test() {
print_line("after v: " + v + " a: " + rtos(a));
}
- return NULL;
String ret;
List<String> args;
@@ -602,7 +596,6 @@ MainLoop *test() {
print_line("error: " + itos(err));
print_line(ret);
- return NULL;
Basis m3;
m3.rotate(Vector3(1, 0, 0), 0.2);
m3.rotate(Vector3(0, 1, 0), 1.77);
@@ -611,17 +604,13 @@ MainLoop *test() {
m32.set_euler(m3.get_euler());
print_line("ELEULEEEEEEEEEEEEEEEEEER: " + m3.get_euler() + " vs " + m32.get_euler());
- return NULL;
-
{
-
Dictionary d;
d["momo"] = 1;
Dictionary b = d;
b["44"] = 4;
}
- return NULL;
print_line("inters: " + rtos(Geometry::segment_intersects_circle(Vector2(-5, 0), Vector2(-2, 0), Vector2(), 1.0)));
print_line("cross: " + Vector3(1, 2, 3).cross(Vector3(4, 5, 7)));
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 809fd841c1..a13f731c11 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -1132,9 +1132,9 @@ CSGBrush *CSGBox::_build_brush() {
for (int k = 0; k < 3; k++) {
if (i < 3)
- face_points[j][(i + k) % 3] = v[k] * (i >= 3 ? -1 : 1);
+ face_points[j][(i + k) % 3] = v[k];
else
- face_points[3 - j][(i + k) % 3] = v[k] * (i >= 3 ? -1 : 1);
+ face_points[3 - j][(i + k) % 3] = -v[k];
}
}
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 64678c7240..08ad101967 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -1181,7 +1181,11 @@ static bool _guess_identifier_type(const GDScriptCompletionContext &p_context, c
c.line = op->line;
c.block = blk;
if (_guess_expression_type(p_context, op->arguments[1], r_type)) {
- r_type.type.is_meta_type = false;
+ r_type.type.is_meta_type = false; // Right-hand of `is` will be a meta type, but the left-hand value is not
+ // Not an assignment, it shouldn't carry any value
+ r_type.value = Variant();
+ r_type.assigned_expression = NULL;
+
return true;
}
}
diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h
index aab1af1250..f4058664ff 100644
--- a/modules/gdscript/gdscript_function.h
+++ b/modules/gdscript/gdscript_function.h
@@ -74,8 +74,14 @@ struct GDScriptDataType {
return false;
}
Object *obj = p_variant.operator Object *();
- if (obj && !ClassDB::is_parent_class(obj->get_class_name(), native_type)) {
- return false;
+ if (obj) {
+ if (!ClassDB::is_parent_class(obj->get_class_name(), native_type)) {
+ // Try with underscore prefix
+ StringName underscore_native_type = "_" + native_type;
+ if (!ClassDB::is_parent_class(obj->get_class_name(), underscore_native_type)) {
+ return false;
+ }
+ }
}
return true;
} break;
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index c6c2e57ba5..1292e11209 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -6228,7 +6228,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_node_type(Node *p_node) {
if (check_types && index_type.has_type) {
if (base_type.kind == DataType::BUILTIN) {
// Check if indexing is valid
- bool error = index_type.kind != DataType::BUILTIN;
+ bool error = index_type.kind != DataType::BUILTIN && base_type.builtin_type != Variant::DICTIONARY;
if (!error) {
switch (base_type.builtin_type) {
// Expect int or real as index
@@ -6771,10 +6771,10 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
valid = _get_function_signature(base_type, callee_name, return_type, arg_types,
default_args_count, is_static, is_vararg);
- if (valid) {
- return_type = original_type;
- return_type.is_meta_type = false;
- }
+ return_type = original_type;
+ return_type.is_meta_type = false;
+
+ valid = true; // There's always an initializer, we can asume this is true
}
if (!valid) {
@@ -6833,6 +6833,7 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
} break;
}
+#ifdef DEBUG_ENABLED
if (!check_types) {
return return_type;
}
@@ -6858,11 +6859,9 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
if (!par_type.has_type) {
_mark_line_as_unsafe(p_call->line);
-#ifdef DEBUG_ENABLED
if (par_type.may_yield && p_call->arguments[i]->type == Node::TYPE_OPERATOR) {
_add_warning(GDScriptWarning::FUNCTION_MAY_YIELD, p_call->line, _find_function_name(static_cast<OperatorNode *>(p_call->arguments[i])));
}
-#endif // DEBUG_ENABLED
} else if (!_is_type_compatible(arg_types[i - arg_diff], par_type, true)) {
// Supertypes are acceptable for dynamic compliance
if (!_is_type_compatible(par_type, arg_types[i - arg_diff])) {
@@ -6875,14 +6874,14 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
_mark_line_as_unsafe(p_call->line);
}
} else {
-#ifdef DEBUG_ENABLED
if (arg_type.kind == DataType::BUILTIN && arg_type.builtin_type == Variant::INT && par_type.kind == DataType::BUILTIN && par_type.builtin_type == Variant::REAL) {
_add_warning(GDScriptWarning::NARROWING_CONVERSION, p_call->line, callee_name);
}
-#endif // DEBUG_ENABLED
}
}
+#endif // DEBUG_ENABLED
+
return return_type;
}
@@ -8114,6 +8113,7 @@ Error GDScriptParser::_parse(const String &p_base_path) {
check_types = false;
#endif
+#ifdef DEBUG_ENABLED
// Resolve all class-level stuff before getting into function blocks
_check_class_level_types(main_class);
@@ -8128,7 +8128,6 @@ Error GDScriptParser::_parse(const String &p_base_path) {
return ERR_PARSE_ERROR;
}
-#ifdef DEBUG_ENABLED
// Resolve warning ignores
Vector<Pair<int, String> > warning_skips = tokenizer->get_warning_skips();
bool warning_is_error = GLOBAL_GET("debug/gdscript/warnings/treat_warnings_as_errors").booleanize();
diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub
index df75dca310..2639d20620 100644
--- a/modules/webm/libvpx/SCsub
+++ b/modules/webm/libvpx/SCsub
@@ -272,9 +272,9 @@ else:
import platform
is_x11_or_server_arm = ((env["platform"] == 'x11' or env["platform"] == 'server') and (platform.machine().startswith('arm') or platform.machine().startswith('aarch')))
is_ios_x86 = (env["platform"] == 'iphone' and ("arch" in env and env["arch"].startswith('x86')))
- is_android_x86 = (env["platform"] == 'android' and env["android_arch"] == 'x86')
+ is_android_x86 = (env["platform"] == 'android' and env["android_arch"].startswith('x86'))
if is_android_x86:
- cpu_bits = '32'
+ cpu_bits = '32' if env["android_arch"] == 'x86' else '64'
webm_cpu_x86 = not is_x11_or_server_arm and (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86)
webm_cpu_arm = is_x11_or_server_arm or (not is_ios_x86 and env["platform"] == 'iphone') or (not is_android_x86 and env["platform"] == 'android')
diff --git a/platform/android/SCsub b/platform/android/SCsub
index ad682b9324..47d5035224 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -152,6 +152,8 @@ elif env['android_arch'] == 'arm64v8':
lib_arch_dir = 'arm64-v8a'
elif env['android_arch'] == 'x86':
lib_arch_dir = 'x86'
+elif env['android_arch'] == 'x86_64':
+ lib_arch_dir = 'x86_64'
else:
print('WARN: Architecture not suitable for embedding into APK; keeping .so at \\bin')
diff --git a/platform/android/detect.py b/platform/android/detect.py
index b031e51d8c..aa48252435 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -27,7 +27,7 @@ def get_opts():
return [
('ANDROID_NDK_ROOT', 'Path to the Android NDK', os.environ.get("ANDROID_NDK_ROOT", 0)),
('ndk_platform', 'Target platform (android-<api>, e.g. "android-18")', "android-18"),
- EnumVariable('android_arch', 'Target architecture', "armv7", ('armv7', 'armv6', 'arm64v8', 'x86')),
+ EnumVariable('android_arch', 'Target architecture', "armv7", ('armv7', 'armv6', 'arm64v8', 'x86', 'x86_64')),
BoolVariable('android_neon', 'Enable NEON support (armv7 only)', True),
BoolVariable('android_stl', 'Enable Android STL support (for modules)', True)
]
@@ -94,7 +94,7 @@ def configure(env):
## Architecture
- if env['android_arch'] not in ['armv7', 'armv6', 'arm64v8', 'x86']:
+ if env['android_arch'] not in ['armv7', 'armv6', 'arm64v8', 'x86', 'x86_64']:
env['android_arch'] = 'armv7'
neon_text = ""
@@ -110,6 +110,16 @@ def configure(env):
abi_subpath = "i686-linux-android"
arch_subpath = "x86"
env["x86_libtheora_opt_gcc"] = True
+ if env['android_arch'] == 'x86_64':
+ if get_platform(env["ndk_platform"]) < 21:
+ print("WARNING: android_arch=x86_64 is not supported by ndk_platform lower than android-21; setting ndk_platform=android-21")
+ env["ndk_platform"] = "android-21"
+ env['ARCH'] = 'arch-x86_64'
+ env.extra_suffix = ".x86_64" + env.extra_suffix
+ target_subpath = "x86_64-4.9"
+ abi_subpath = "x86_64-linux-android"
+ arch_subpath = "x86_64"
+ env["x86_libtheora_opt_gcc"] = True
elif env['android_arch'] == 'armv6':
env['ARCH'] = 'arch-arm'
env.extra_suffix = ".armv6" + env.extra_suffix
@@ -233,6 +243,9 @@ def configure(env):
# The NDK adds this if targeting API < 21, so we can drop it when Godot targets it at least
env.Append(CPPFLAGS=['-mstackrealign'])
+ elif env['android_arch'] == 'x86_64':
+ target_opts = ['-target', 'x86_64-none-linux-android']
+
elif env["android_arch"] == "armv6":
target_opts = ['-target', 'armv6-none-linux-androideabi']
env.Append(CPPFLAGS='-D__ARM_ARCH_6__ -march=armv6 -mfpu=vfp -mfloat-abi=softfp'.split())
@@ -282,7 +295,7 @@ def configure(env):
'/toolchains/' + target_subpath + '/prebuilt/' + host_subpath + '/' + abi_subpath + '/lib'])
env.Append(CPPPATH=['#platform/android'])
- env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL', '-DMPC_FIXED_POINT'])
+ env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL'])
env.Append(LIBS=['OpenSLES', 'EGL', 'GLESv3', 'android', 'log', 'z', 'dl'])
# TODO: Move that to opus module's config
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index f4a2a1020f..18b985bcf5 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -552,14 +552,13 @@ class EditorExportAndroid : public EditorExportPlatform {
static Vector<String> get_abis() {
Vector<String> abis;
- // We can still build armv7 in theory, but it doesn't make much
+ // We can still build armv6 in theory, but it doesn't make much
// sense for games, so disabling for now.
//abis.push_back("armeabi");
abis.push_back("armeabi-v7a");
abis.push_back("arm64-v8a");
abis.push_back("x86");
- // Don't expose x86_64 for now, we don't support it in detect.py
- //abis.push_back("x86_64");
+ abis.push_back("x86_64");
return abis;
}
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java
index 8041c5f97e..a10d7876f4 100644
--- a/platform/android/java/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/src/org/godotengine/godot/Godot.java
@@ -119,7 +119,6 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
private boolean use_debug_opengl = false;
private boolean mStatePaused;
private int mState;
- private boolean keep_screen_on = true;
static private Intent mCurrentIntent;
@@ -297,31 +296,26 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
});
final String[] current_command_line = command_line;
- final GodotView view = mView;
mView.queueEvent(new Runnable() {
@Override
public void run() {
GodotLib.setup(current_command_line);
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- view.setKeepScreenOn("True".equals(GodotLib.getGlobal("display/window/energy_saving/keep_screen_on")));
- }
- });
+ setKeepScreenOn("True".equals(GodotLib.getGlobal("display/window/energy_saving/keep_screen_on")));
}
});
}
public void setKeepScreenOn(final boolean p_enabled) {
- keep_screen_on = p_enabled;
- if (mView != null) {
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- mView.setKeepScreenOn(p_enabled);
+ runOnUiThread(new Runnable() {
+ @Override
+ public void run() {
+ if (p_enabled) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+ } else {
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
}
- });
- }
+ }
+ });
}
public void alert(final String message, final String title) {
diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py
index 797a7d31aa..d0e6a4cefe 100644
--- a/platform/iphone/detect.py
+++ b/platform/iphone/detect.py
@@ -173,7 +173,7 @@ def configure(env):
env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate'
env.Append(CPPPATH=['#platform/iphone'])
- env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES_ENABLED', '-DMPC_FIXED_POINT', '-DCOREAUDIO_ENABLED'])
+ env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES_ENABLED', '-DCOREAUDIO_ENABLED'])
# TODO: Move that to opus module's config
if 'module_opus_enabled' in env and env['module_opus_enabled']:
diff --git a/scene/animation/animation_blend_space_1d.cpp b/scene/animation/animation_blend_space_1d.cpp
index 360ba84374..dded44b990 100644
--- a/scene/animation/animation_blend_space_1d.cpp
+++ b/scene/animation/animation_blend_space_1d.cpp
@@ -110,7 +110,7 @@ void AnimationNodeBlendSpace1D::add_blend_point(const Ref<AnimationRootNode> &p_
if (p_at_index == -1 || p_at_index == blend_points_used) {
p_at_index = blend_points_used;
} else {
- for (int i = blend_points_used - 1; i > p_at_index; i++) {
+ for (int i = blend_points_used - 1; i > p_at_index; i--) {
blend_points[i] = blend_points[i - 1];
}
}
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index d9ace8d650..4984af57b5 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -324,7 +324,7 @@ bool ImageTexture::is_pixel_opaque(int p_x, int p_y) const {
int y = p_y * ah / h;
x = CLAMP(x, 0, aw);
- y = CLAMP(y, 0, aw);
+ y = CLAMP(y, 0, ah);
return alpha_cache->get_bit(Point2(x, y));
}
@@ -791,7 +791,7 @@ bool StreamTexture::is_pixel_opaque(int p_x, int p_y) const {
int y = p_y * ah / h;
x = CLAMP(x, 0, aw);
- y = CLAMP(y, 0, aw);
+ y = CLAMP(y, 0, ah);
return alpha_cache->get_bit(Point2(x, y));
}