summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/variant_op.cpp22
-rw-r--r--doc/classes/Area.xml47
-rw-r--r--doc/classes/Area2D.xml69
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp4
-rw-r--r--main/main.cpp22
-rw-r--r--misc/dist/linux/godot.6165
-rw-r--r--misc/dist/linux/godot.appdata.xml34
-rw-r--r--misc/dist/linux/godot.desktop9
-rw-r--r--platform/osx/os_osx.h1
-rw-r--r--platform/osx/os_osx.mm23
-rw-r--r--platform/windows/detect.py9
-rw-r--r--platform/x11/detect.py3
-rw-r--r--scene/2d/collision_object_2d.cpp2
-rw-r--r--scene/3d/collision_object.cpp2
14 files changed, 322 insertions, 90 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 8755897eed..feaddb3a3c 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -334,6 +334,13 @@ bool Variant::booleanize() const {
DEFAULT_OP_ARRAY_OP_BODY(m_prefix, m_op_name, m_name, m_type, !=, !=, true, false, false) \
}
+#define DEFAULT_OP_ARRAY_NEQ(m_prefix, m_op_name, m_name, m_type) \
+ CASE_TYPE(m_prefix, m_op_name, m_name) { \
+ if (p_b.type == NIL) \
+ _RETURN(true) \
+ DEFAULT_OP_ARRAY_OP_BODY(m_prefix, m_op_name, m_name, m_type, !=, ==, true, true, false) \
+ }
+
#define DEFAULT_OP_ARRAY_LT(m_prefix, m_op_name, m_name, m_type) \
DEFAULT_OP_ARRAY_OP(m_prefix, m_op_name, m_name, m_type, <, !=, false, a_len < array_b.size(), true)
@@ -555,14 +562,13 @@ void Variant::evaluate(const Operator &p_op, const Variant &p_a,
DEFAULT_OP_STR_NULL(math, OP_NOT_EQUAL, NODE_PATH, !=, NodePath);
DEFAULT_OP_LOCALMEM_NULL(math, OP_NOT_EQUAL, _RID, !=, RID);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_BYTE_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_INT_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_REAL_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_STRING_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_VECTOR2_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_VECTOR3_ARRAY);
- CASE_TYPE(math, OP_NOT_EQUAL, POOL_COLOR_ARRAY);
- _RETURN_FAIL;
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_BYTE_ARRAY, uint8_t);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_INT_ARRAY, int);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_REAL_ARRAY, real_t);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_STRING_ARRAY, String);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_VECTOR2_ARRAY, Vector2);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_VECTOR3_ARRAY, Vector3);
+ DEFAULT_OP_ARRAY_NEQ(math, OP_NOT_EQUAL, POOL_COLOR_ARRAY, Color);
}
SWITCH_OP(math, OP_LESS, p_a.type) {
diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml
index c59bbee084..8797575038 100644
--- a/doc/classes/Area.xml
+++ b/doc/classes/Area.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Area" inherits="CollisionObject" category="Core" version="3.0.alpha.custom_build">
<brief_description>
- General purpose area detection and influence for 3D physics.
+ General purpose area node for detection and 3D physics influence.
</brief_description>
<description>
- General purpose area detection for 3D physics. Areas can be used for detection of objects that enter/exit them, as well as overriding space parameters (changing gravity, damping, etc). For this, use any space override different from AREA_SPACE_OVERRIDE_DISABLE and point gravity at the center of mass.
+ 3D area that detects [CollisionObject] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).
</description>
<tutorials>
</tutorials>
@@ -88,14 +88,14 @@
<return type="Array">
</return>
<description>
- Return a list of the areas that are totally or partially inside this area.
+ Returns a list of intersecting [Area]\ s.
</description>
</method>
<method name="get_overlapping_bodies" qualifiers="const">
<return type="Array">
</return>
<description>
- Return a list of the bodies ([PhysicsBody]) that are totally or partially inside this area.
+ Returns a list of intersecting [PhysicsBody]\ s.
</description>
</method>
<method name="get_priority" qualifiers="const">
@@ -169,7 +169,7 @@
<argument index="0" name="area" type="Node">
</argument>
<description>
- Return whether the area passed is totally or partially inside this area.
+ If [code]true[/code] the given area overlaps the Area.
</description>
</method>
<method name="overlaps_body" qualifiers="const">
@@ -178,7 +178,7 @@
<argument index="0" name="body" type="Node">
</argument>
<description>
- Return whether the body passed is totally or partially inside this area.
+ If [code]true[/code] the given body overlaps the Area.
</description>
</method>
<method name="set_angular_damp">
@@ -374,30 +374,43 @@
</methods>
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp">
+ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
</member>
<member name="audio_bus_name" type="String" setter="set_audio_bus" getter="get_audio_bus">
+ The name of the area's audio bus.
</member>
<member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus">
+ If [code]true[/code] the area's audio bus overrides the default audio bus. Default value: [code]false[/code].
</member>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer">
+ The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [code]collision_mask[/code].
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask">
+ The physics layers this area scans to determine collision detection.
</member>
<member name="gravity" type="float" setter="set_gravity" getter="get_gravity">
+ The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
</member>
<member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale">
+ The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
</member>
<member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point">
+ If [code]true[/code] gravity is calculated from a point (set via [code]gravity_vec[/code]). Also see [code]space_override[/code]. Default value: [code]false[/code].
</member>
<member name="gravity_vec" type="Vector3" setter="set_gravity_vector" getter="get_gravity_vector">
+ The area's gravity vector (not normalized). If gravity is a point (see [method is_gravity_a_point]), this will be the point of attraction.
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp">
+ The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
</member>
<member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable">
+ If [code]true[/code] other monitoring areas can detect this area. Default value: [code]true[/code].
</member>
<member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring">
+ If [code]true[/code] the area detects bodies or areas entering and exiting it. Default value: [code]true[/code].
</member>
<member name="priority" type="float" setter="set_priority" getter="get_priority">
+ The area's priority. Higher priority areas are processed first. Default value: 0.
</member>
<member name="reverb_bus_amount" type="float" setter="set_reverb_amount" getter="get_reverb_amount">
</member>
@@ -408,6 +421,7 @@
<member name="reverb_bus_uniformity" type="float" setter="set_reverb_uniformity" getter="get_reverb_uniformity">
</member>
<member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area.SpaceOverride">
+ Override mode for gravity and damping calculations within this area. See the SPACE_OVERRIDE_* constants for values.
</member>
</members>
<signals>
@@ -415,14 +429,14 @@
<argument index="0" name="area" type="Object">
</argument>
<description>
- This signal is triggered only once when an area enters this area. The only parameter passed is the area that entered this area.
+ Emitted when another area enters.
</description>
</signal>
<signal name="area_exited">
<argument index="0" name="area" type="Object">
</argument>
<description>
- This signal is triggered only once when an area exits this area. The only parameter passed is the area that exited this area.
+ Emitted when another area exits.
</description>
</signal>
<signal name="area_shape_entered">
@@ -435,7 +449,7 @@
<argument index="3" name="self_shape" type="int">
</argument>
<description>
- This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when another area enters, reporting which areas overlapped.
</description>
</signal>
<signal name="area_shape_exited">
@@ -448,21 +462,21 @@
<argument index="3" name="self_shape" type="int">
</argument>
<description>
- This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when another area exits, reporting which areas were overlapping.
</description>
</signal>
<signal name="body_entered">
<argument index="0" name="body" type="Object">
</argument>
<description>
- This signal is triggered only once when a body enters this area. The only parameter passed is the body that entered this area.
+ Emitted when a [PhysicsBody] object enters.
</description>
</signal>
<signal name="body_exited">
<argument index="0" name="body" type="Object">
</argument>
<description>
- This signal is triggered only once when a body exits this area. The only parameter passed is the body that exited this area.
+ Emitted when a [PhysicsBody2D] object exits.
</description>
</signal>
<signal name="body_shape_entered">
@@ -475,7 +489,7 @@
<argument index="3" name="area_shape" type="int">
</argument>
<description>
- This signal triggers only once when a body enters this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape of the body that entered this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when a [PhysicsBody2D] object enters, reporting which shapes overlapped.
</description>
</signal>
<signal name="body_shape_exited">
@@ -488,20 +502,25 @@
<argument index="3" name="area_shape" type="int">
</argument>
<description>
- This signal triggers only once when a body exits this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape exiting this area, and the fourth one is the index of the shape in this area that reported the exit.
+ Emitted when a [PhysicsBody2D] object exits, reporting which shapes were overlapping.
</description>
</signal>
</signals>
<constants>
<constant name="SPACE_OVERRIDE_DISABLED" value="0">
+ This area does not affect gravity/damping.
</constant>
<constant name="SPACE_OVERRIDE_COMBINE" value="1">
+ This area adds its gravity/damping values to whatever has been calculated so far (in [code]priority[/code] order).
</constant>
<constant name="SPACE_OVERRIDE_COMBINE_REPLACE" value="2">
+ This area adds its gravity/damping values to whatever has been calculated so far (in [code]priority[/code] order), ignoring any lower priority areas.
</constant>
<constant name="SPACE_OVERRIDE_REPLACE" value="3">
+ This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
</constant>
<constant name="SPACE_OVERRIDE_REPLACE_COMBINE" value="4">
+ This area replaces any gravity/damping calculated so far (in [code]priority[/code] order), but keeps calculating the rest of the areas.
</constant>
</constants>
</class>
diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml
index cef5053289..0cbc079962 100644
--- a/doc/classes/Area2D.xml
+++ b/doc/classes/Area2D.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Area2D" inherits="CollisionObject2D" category="Core" version="3.0.alpha.custom_build">
<brief_description>
- 2D area that detects nodes that enter or exit it. Can override 2D physics properties within range.
+ 2D area for detection and 2D physics influence.
</brief_description>
<description>
- 2D area that detects nodes that enter or exit it. Change the 'space_override' property SPACE_OVERRIDE_* to override physics parameters for nodes like [Rigidbody2D]. E.g. gravity, damping... See [CollisionObject2D] for usage.
+ 2D area that detects [CollisionObject2D] nodes overlapping, entering, or exiting. Can also alter or override local physics parameters (gravity, damping).
</description>
<tutorials>
</tutorials>
@@ -88,14 +88,14 @@
<return type="Array">
</return>
<description>
- Returns a list of the [Area2D]s that intersect with this area.
+ Returns a list of intersecting [Area2D]\ s.
</description>
</method>
<method name="get_overlapping_bodies" qualifiers="const">
<return type="Array">
</return>
<description>
- Return a list of the [PhysicsBody2D]s that intersect with this area.
+ Returns a list of intersecting [PhysicsBody2D]\ s.
</description>
</method>
<method name="get_priority" qualifiers="const">
@@ -145,7 +145,7 @@
<argument index="0" name="area" type="Node">
</argument>
<description>
- Return whether the area passed is totally or partially inside this area.
+ If [code]true[/code] the given area overlaps the Area2D.
</description>
</method>
<method name="overlaps_body" qualifiers="const">
@@ -154,7 +154,7 @@
<argument index="0" name="body" type="Node">
</argument>
<description>
- Return whether the body passed is totally or partially inside this area.
+ If [code]true[/code] the given body overlaps the Area2D.
</description>
</method>
<method name="set_angular_damp">
@@ -318,49 +318,46 @@
</methods>
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp">
- The rate at which objects stop spinning in this area. Represents the amount of speed lost per second. If 1.0, physics bodies in the area stop rotating immediately. If 0.0, they never slow down. Does not incorporate external forces. The physics-update's rate affects 'angular_damp'.
+ The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
</member>
<member name="audio_bus_name" type="String" setter="set_audio_bus_name" getter="get_audio_bus_name">
- The name of the Area2D's audio bus.
+ The name of the area's audio bus.
</member>
<member name="audio_bus_override" type="bool" setter="set_audio_bus_override" getter="is_overriding_audio_bus">
- If [code]true[/code], overrides the default audio bus with the Area2D's. Defaults to [code]false[/code].
+ If [code]true[/code] the area's audio bus overrides the default audio bus. Default value: [code]false[/code].
</member>
<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer">
- The physics layer this Area2D is in.
- Collidable objects can exist in any of 32 different layers. These layers are not visual, but more of a tagging system instead. A collidable can use these layers/tags to select with which objects it can collide, using [method set_collision_mask].
- A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans.
+ The area's physics layer(s). Collidable objects can exist in any of 32 different layers. A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See also [code]collision_mask[/code].
</member>
<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask">
- The physics layers this Area2D scans to determine collision detections.
+ The physics layers this area scans to determine collision detection.
</member>
<member name="gravity" type="float" setter="set_gravity" getter="get_gravity">
- The gravity intensity within the Area2D (ranges -1024 to 1024). This is useful to alter the force of gravity without altering its direction.
- This value multiplies the gravity vector, whether it is the given vector ([method set_gravity_vector]), or a calculated one (when using a center of gravity).
+ The area's gravity intensity (ranges from -1024 to 1024). This value multiplies the gravity vector. This is useful to alter the force of gravity without altering its direction.
</member>
<member name="gravity_distance_scale" type="float" setter="set_gravity_distance_scale" getter="get_gravity_distance_scale">
- The falloff factor for point gravity. The greater this value is, the faster the strength of gravity decreases with the square of distance.
+ The falloff factor for point gravity. The greater the value, the faster gravity decreases with distance.
</member>
<member name="gravity_point" type="bool" setter="set_gravity_is_point" getter="is_gravity_a_point">
- If [code]true[/code], calculates gravity from a particular point during a space override (see [method set_space_override_mode]). If a point, [Vector2] position is set with [method set_gravity_vector]. Defaults to [code]false[/code].
+ If [code]true[/code] gravity is calculated from a point (set via [code]gravity_vec[/code]). Also see [code]space_override[/code]. Default value: [code]false[/code].
</member>
<member name="gravity_vec" type="Vector2" setter="set_gravity_vector" getter="get_gravity_vector">
- The gravitational direction/strength as a vector (not normalized). If gravity is a point (see [method is_gravity_a_point]), this will be the attraction center.
+ The area's gravity vector (not normalized). If gravity is a point (see [method is_gravity_a_point]), this will be the point of attraction.
</member>
<member name="linear_damp" type="float" setter="set_linear_damp" getter="get_linear_damp">
- The rate at which objects stop spinning in this area. Represents the amount of speed lost per second. If 1.0, physics bodies in the area stop rotating immediately. If 0.0, they never slow down. Does not incorporate external forces. The physics-update's rate affects 'angular_damp'.
+ The rate at which objects stop moving in this area. Represents the linear velocity lost per second. Values range from [code]0[/code] (no damping) to [code]1[/code] (full damping).
</member>
<member name="monitorable" type="bool" setter="set_monitorable" getter="is_monitorable">
- If [code]true[/code], other monitoring areas can detect this Area2D (is it undetectable at the moment?). Defaults to [code]true[/code].
+ If [code]true[/code] other monitoring areas can detect this area. Default value: [code]true[/code].
</member>
<member name="monitoring" type="bool" setter="set_monitoring" getter="is_monitoring">
- If [code]true[/code], this detects bodies/areas entering/exiting it (can it detect others at the moment?). Defaults to [code]true[/code].
+ If [code]true[/code] the area detects bodies or areas entering and exiting it. Default value: [code]true[/code].
</member>
<member name="priority" type="float" setter="set_priority" getter="get_priority">
- The processing order for this priority. Ranges from 0 to 128. Defaults to 0. Higher priorities are processed first.
+ The area's priority. Higher priority areas are processed first. Default value: 0.
</member>
<member name="space_override" type="int" setter="set_space_override_mode" getter="get_space_override_mode" enum="Area2D.SpaceOverride">
- How to override gravity and damping calculations within this Area2D, if at all. Consult the SPACE_OVERRIDE_* constants for available options.
+ Override mode for gravity and damping calculations within this area. See the SPACE_OVERRIDE_* constants for values.
</member>
</members>
<signals>
@@ -368,14 +365,14 @@
<argument index="0" name="area" type="Object">
</argument>
<description>
- This signal is triggered only once when an area enters this area. The only parameter passed is the area that entered this area.
+ Emitted when another area enters.
</description>
</signal>
<signal name="area_exited">
<argument index="0" name="area" type="Object">
</argument>
<description>
- This signal is triggered only once when an area exits this area. The only parameter passed is the area that exited this area.
+ Emitted when another area exits.
</description>
</signal>
<signal name="area_shape_entered">
@@ -388,7 +385,7 @@
<argument index="3" name="self_shape" type="int">
</argument>
<description>
- This signal triggers only once when an area enters this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when another area enters, reporting which shapes overlapped.
</description>
</signal>
<signal name="area_shape_exited">
@@ -401,21 +398,21 @@
<argument index="3" name="self_shape" type="int">
</argument>
<description>
- This signal triggers only once when an area exits this area. The first parameter is the area's [RID]. The second one is the area as an object. The third one is the index of the shape entering this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when another area exits, reporting which shapes were overlapping.
</description>
</signal>
<signal name="body_entered">
<argument index="0" name="body" type="Object">
</argument>
<description>
- This signal is triggered only once when a body enters this area. The only parameter passed is the body that entered this area.
+ Emitted when a [PhysicsBody2D] object enters.
</description>
</signal>
<signal name="body_exited">
<argument index="0" name="body" type="Object">
</argument>
<description>
- This signal is triggered only once when a body exits this area. The only parameter passed is the body that exited this area.
+ Emitted when a [PhysicsBody2D] object exits.
</description>
</signal>
<signal name="body_shape_entered">
@@ -428,7 +425,7 @@
<argument index="3" name="area_shape" type="int">
</argument>
<description>
- This signal triggers only once when a body enters this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape of the body that entered this area, and the fourth one is the index of the shape in this area that reported the entering.
+ Emitted when a [PhysicsBody2D] object enters, reporting which shapes overlapped.
</description>
</signal>
<signal name="body_shape_exited">
@@ -441,25 +438,25 @@
<argument index="3" name="area_shape" type="int">
</argument>
<description>
- This signal triggers only once when a body exits this area. The first parameter is the body's [RID]. The second one is the body as an object. The third one is the index of the shape exiting this area, and the fourth one is the index of the shape in this area that reported the exit.
+ Emitted when a [PhysicsBody2D] object exits, reporting which shapes were overlapping.
</description>
</signal>
</signals>
<constants>
<constant name="SPACE_OVERRIDE_DISABLED" value="0">
- This area does not affect gravity/damp. These are areas that exist only to detect collisions and objects entering or exiting them.
+ This area does not affect gravity/damping.
</constant>
<constant name="SPACE_OVERRIDE_COMBINE" value="1">
- This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects.
+ This area adds its gravity/damping values to whatever has been calculated so far (in [code]priority[/code] order).
</constant>
<constant name="SPACE_OVERRIDE_COMBINE_REPLACE" value="2">
- This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one.
+ This area adds its gravity/damping values to whatever has been calculated so far (in [code]priority[/code] order), ignoring any lower priority areas.
</constant>
<constant name="SPACE_OVERRIDE_REPLACE" value="3">
- This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas.
+ This area replaces any gravity/damping, even the defaults, ignoring any lower priority areas.
</constant>
<constant name="SPACE_OVERRIDE_REPLACE_COMBINE" value="4">
- This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one.
+ This area replaces any gravity/damping calculated so far (in [code]priority[/code] order), but keeps calculating the rest of the areas.
</constant>
</constants>
</class>
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index b85ffd6c67..328d07d7a8 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -351,6 +351,10 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
return PoolVector<Vector2>();
}
+ if (id == prev_id) {
+ return PoolVector<Vector2>();
+ }
+
Rect2i r = node->get_item_rect();
r.position = r.position / node->get_cell_size();
r.size = r.size / node->get_cell_size();
diff --git a/main/main.cpp b/main/main.cpp
index 1f7418ba2a..27c4a769c9 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -74,6 +74,7 @@
#include "performance.h"
#include "translation.h"
#include "version.h"
+#include "version_hash.gen.h"
static ProjectSettings *globals = NULL;
static Engine *engine = NULL;
@@ -122,6 +123,14 @@ static String unescape_cmdline(const String &p_str) {
return p_str.replace("%20", " ");
}
+static String get_full_version_string() {
+
+ String hash = String(VERSION_HASH);
+ if (hash.length() != 0)
+ hash = "." + hash.left(7);
+ return String(VERSION_MKSTRING) + hash;
+}
+
//#define DEBUG_INIT
#ifdef DEBUG_INIT
@@ -132,7 +141,7 @@ static String unescape_cmdline(const String &p_str) {
void Main::print_help(const char *p_binary) {
- OS::get_singleton()->print(VERSION_FULL_NAME " - https://godotengine.org\n");
+ print_line(String(_MKSTR(VERSION_NAME)) + " v" + get_full_version_string() + " - https://godotengine.org");
OS::get_singleton()->print("(c) 2007-2017 Juan Linietsky, Ariel Manzur.\n");
OS::get_singleton()->print("(c) 2014-2017 Godot Engine contributors.\n");
OS::get_singleton()->print("\n");
@@ -141,6 +150,7 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print("General options:\n");
OS::get_singleton()->print(" -h, --help Display this help message.\n");
+ OS::get_singleton()->print(" --version Display the version string.\n");
OS::get_singleton()->print(" -v, --verbose Use verbose stdout mode.\n");
OS::get_singleton()->print(" --quiet Quiet mode, silences stdout messages. Errors are still displayed.\n");
OS::get_singleton()->print("\n");
@@ -195,7 +205,7 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --time-scale <scale> Force time scale (higher values are faster, 1.0 is normal speed).\n");
OS::get_singleton()->print(" --disable-render-loop Disable render loop so rendering only occurs when called explicitly from script.\n");
OS::get_singleton()->print(" --disable-crash-handler Disable crash handler when supported by the platform code.\n");
- OS::get_singleton()->print(" --fixed-fps <fps> Forces a fixed ratio between process and fixed_process timing, for use when precision is required, or when rendering to video files. Setting this will disable real-time syncronization, so that run speed is only capped by performance\n");
+ OS::get_singleton()->print(" --fixed-fps <fps> Force a fixed number of frames per second. This setting disables real\-time synchronization.\n");
OS::get_singleton()->print("\n");
OS::get_singleton()->print("Standalone tools:\n");
@@ -203,7 +213,7 @@ void Main::print_help(const char *p_binary) {
#ifdef TOOLS_ENABLED
OS::get_singleton()->print(" --export <target> Export the project using the given export target.\n");
OS::get_singleton()->print(" --export-debug Use together with --export, enables debug mode for the template.\n");
- OS::get_singleton()->print(" --doctool <file> Dump the whole engine API to <file> in XML format. If <file> exists, it will be merged.\n");
+ OS::get_singleton()->print(" --doctool <path> Dump the engine API reference to the given <path> in XML format, merging if existing files are found.\n");
OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n");
#ifdef DEBUG_METHODS_ENABLED
OS::get_singleton()->print(" --gdnative-generate-json-api Generate JSON dump of the Godot API for GDNative bindings.\n");
@@ -268,7 +278,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
while (I) {
I->get() = unescape_cmdline(I->get().strip_escapes());
- //print_line("CMD: "+I->get());
I = I->next();
}
@@ -318,6 +327,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
show_help = true;
goto error;
+ } else if (I->get() == "--version") {
+
+ print_line(get_full_version_string());
+ goto error;
+
} else if (I->get() == "--resolution") { // force resolution
if (I->next()) {
diff --git a/misc/dist/linux/godot.6 b/misc/dist/linux/godot.6
new file mode 100644
index 0000000000..d83bcb1556
--- /dev/null
+++ b/misc/dist/linux/godot.6
@@ -0,0 +1,165 @@
+.TH GODOT "6" "September 2017" "godot 3.0-alpha" "Games"
+.SH NAME
+godot \- multi-platform 2D and 3D game engine with a feature rich editor
+.SH SYNOPSIS
+.B godot
+[\fI\,options\/\fR] [path to scene or 'project.godot' file]
+.SH DESCRIPTION
+Godot Engine is an advanced, feature packed, multi\-platform 2D and 3D game
+engine.
+.br
+It provides a huge set of common tools, so you can just focus on making
+your game without reinventing the wheel.
+.SS "General options:"
+.TP
+\fB\-h\fR, \fB\-\-help\fR
+Display this help message.
+.TP
+\fB\-\-version\fR
+Display the version string.
+.TP
+\fB\-v\fR, \fB\-\-verbose\fR
+Use verbose stdout mode.
+.TP
+\fB\-\-quiet\fR
+Quiet mode, silences stdout messages. Errors are still displayed.
+.SS "Run options:"
+.TP
+\fB\-e\fR, \fB\-\-editor\fR
+Start the editor instead of running the scene.
+.TP
+\fB\-p\fR, \fB\-\-project\-manager\fR
+Start the project manager, even if a project is auto\-detected.
+.TP
+\fB\-l\fR, \fB\-\-language\fR <locale>
+Use a specific locale (<locale> being a two\-letter code).
+.TP
+\fB\-\-path\fR <directory>
+Path to a project (<directory> must contain a 'project.godot' file).
+.TP
+\fB\-\-main\-pack\fR <file>
+Path to a pack (.pck) file to load.
+.TP
+\fB\-\-render\-thread\fR <mode>
+Render thread mode ('unsafe', 'safe', 'separate').
+.TP
+\fB\-\-remote\-fs\fR <address>
+Remote filesystem (<host/IP>[:<port>] address).
+.TP
+\fB\-\-remote\-fs\-password\fR <password>
+Password for remote filesystem.
+.TP
+\fB\-\-audio\-driver\fR <driver>
+Audio driver ('PulseAudio', 'ALSA').
+.TP
+\fB\-\-video\-driver\fR <driver>
+Video driver ('GLES3').
+.SS "Display options:"
+.TP
+\fB\-f\fR, \fB\-\-fullscreen\fR
+Request fullscreen mode.
+.TP
+\fB\-m\fR, \fB\-\-maximized\fR
+Request a maximized window.
+.TP
+\fB\-w\fR, \fB\-\-windowed\fR
+Request windowed mode.
+.TP
+\fB\-\-resolution\fR <W>x<H>
+Request window resolution.
+.TP
+\fB\-\-position\fR <X>,<Y>
+Request window position.
+.TP
+\fB\-\-low\-dpi\fR
+Force low\-DPI mode (macOS and Windows only).
+.TP
+\fB\-\-no\-window\fR
+Disable window creation (Windows only). Useful together with \fB\-\-script\fR.
+.SS "Debug options:"
+.TP
+\fB\-d\fR, \fB\-\-debug\fR
+Debug (local stdout debugger).
+.TP
+\fB\-b\fR, \fB\-\-breakpoints\fR
+Breakpoint list as source::line comma\-separated pairs, no spaces (use %20 instead).
+.TP
+\fB\-\-profiling\fR
+Enable profiling in the script debugger.
+.TP
+\fB\-\-remote\-debug\fR <address>
+Remote debug (<host/IP>:<port> address).
+.TP
+\fB\-\-debug\-collisions\fR
+Show collisions shapes when running the scene.
+.TP
+\fB\-\-debug\-navigation\fR
+Show navigation polygons when running the scene.
+.TP
+\fB\-\-frame\-delay\fR <ms>
+Simulate high CPU load (delay each frame by <ms> milliseconds).
+.TP
+\fB\-\-time\-scale\fR <scale>
+Force time scale (higher values are faster, 1.0 is normal speed).
+.TP
+\fB\-\-disable\-render\-loop\fR
+Disable render loop so rendering only occurs when called explicitly from script.
+.TP
+\fB\-\-disable\-crash\-handler\fR
+Disable crash handler when supported by the platform code.
+.TP
+\fB\-\-fixed\-fps\fR <fps>
+Force a fixed number of frames per second. This setting disables real\-time synchronization.
+.SS "Standalone tools:"
+.TP
+\fB\-s\fR, \fB\-\-script\fR <script>
+Run a script.
+.TP
+\fB\-\-export\fR <target>
+Export the project using the given export target.
+.TP
+\fB\-\-export\-debug\fR
+Use together with \fB\-\-export\fR, enables debug mode for the template.
+.TP
+\fB\-\-doctool\fR <path>
+Dump the engine API reference to the given <path> in XML format, merging if existing files are found.
+.TP
+\fB\-\-no\-docbase\fR
+Disallow dumping the base types (used with \fB\-\-doctool\fR).
+.TP
+\fB\-\-gdnative\-generate\-json\-api\fR
+Generate JSON dump of the Godot API for GDNative bindings.
+.TP
+\fB\-\-test\fR <test>
+Run a unit test ('string', 'containers', 'math', 'render', 'multimesh', 'gui', 'io', 'shaderlang', 'physics', 'oa_hash_map').
+.SH FILES
+~/.godot/
+.RS
+User\-specific configuration and cache folder, contains persistent editor and game configuration and saved files, temporary metadata, etc.
+.RE
+~/.godot/app_userdata/
+.RS
+Contains the default configuration and user data folders for Godot\-made games (\fIuser://\fR path).
+.RE
+~/.godot/templates/
+.RS
+Installation folder for "export templates", compiled binaries of the engine to deploy on the many supported platforms.
+.RE
+/usr/share/doc/godot/
+.RS
+Additional documentation files.
+.RE
+/usr/share/licenses/godot/
+.RS
+Detailed licensing information.
+.RE
+.SH "SEE ALSO"
+See the project website at \fIhttps://godotengine.org\fR and the source
+code repository at \fIhttps://github.com/godotengine/godot\fR for more details.
+.SH BUGS
+Godot Engine is a free and open source project and welcomes any kind of
+contributions. In particular, you can report issues or make suggestions on
+Godot's issue tracker at \fIhttps://github.com/godotengine/godot/issues\fR.
+.SH AUTHOR
+Man page written by Rémi Verschelde <akien@godotengine.org> on behalf of the
+Godot Engine development team.
diff --git a/misc/dist/linux/godot.appdata.xml b/misc/dist/linux/godot.appdata.xml
new file mode 100644
index 0000000000..20a6c0ec26
--- /dev/null
+++ b/misc/dist/linux/godot.appdata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright 2017 Rémi Verschelde <akien@godotengine.org> -->
+<component type="desktop">
+ <id>godot.desktop</id>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>MIT</project_license>
+ <name>Godot Engine</name>
+ <summary>Multi-platform 2D and 3D game engine with a feature rich editor</summary>
+ <description>
+ <p>
+ Godot is an advanced, feature packed, multi-platform 2D and 3D game
+ engine. It provides a huge set of common tools, so you can just focus on
+ making your game without reinventing the wheel.
+ </p>
+ <p>
+ Godot is completely free and open source under the very permissive MIT
+ license. No strings attached, no royalties, nothing. Your game is yours,
+ down to the last line of engine code.
+ </p>
+ </description>
+ <screenshots>
+ <screenshot type="default" width="1330" height="720">
+ <caption>3D project loaded in the Godot Engine editor</caption>
+ <image>http://download.tuxfamily.org/godotengine/media/screenshots/editor_3d_fracteed-720p.jpg</image>
+ </screenshot>
+ </screenshots>
+ <url type="homepage">https://godotengine.org</url>
+ <url type="bugtracker">https://github.com/godotengine/godot/issues</url>
+ <url type="help">http://docs.godotengine.org</url>
+ <url type="donation">https://godotengine.org/donate</url>
+ <url type="translate">https://hosted.weblate.org/projects/godot-engine/godot</url>
+ <developer_name>The Godot Engine Community</developer_name>
+ <update_contact>akien_at_godotengine_dot_org</update_contact>
+</component>
diff --git a/misc/dist/linux/godot.desktop b/misc/dist/linux/godot.desktop
new file mode 100644
index 0000000000..545c491256
--- /dev/null
+++ b/misc/dist/linux/godot.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=Godot Engine
+GenericName=Libre game engine
+Comment=Multi-platform 2D and 3D game engine with a feature rich editor
+Exec=godot -pm
+Icon=godot
+Terminal=false
+Type=Application
+Categories=Development;IDE;
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h
index c6a9aeba88..6c81da04f5 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -184,7 +184,6 @@ public:
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen = 0) const;
virtual String get_executable_path() const;
- virtual String get_resource_dir() const;
virtual LatinKeyboardVariant get_latin_keyboard_variant() const;
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 2e300c963d..9a26adc155 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1733,29 +1733,6 @@ String OS_OSX::get_executable_path() const {
}
}
-String OS_OSX::get_resource_dir() const {
- /*
- Bastiaan Olij - I'm leaving this code commented out but in place so we can have a further discussion about this later on.
- For loading the package file from the resource folder it makes more sense to make this call work in ProjectSettings::setup
- instead of relying on changing the current working folder as is the case right now (see godot_main_osx.mm).
- The problem is that when this function returns a value we try and load a project.godot file from this resources folder and
- stop attempting to load anything else if that fails. That breaks our tools build.
- One possible solution is to only apply this logic in a non-tools build with an ifdef block.
-
- For now however, just returning this to working condition.
-
- // start with our executable path
- String path = get_executable_path();
-
- int pos = path.find_last("/Contents/MacOS/");
- if (pos < 0)
- return OS::get_resource_dir();
-
- return path.substr(0, pos) + "/Contents/Resources/";
-*/
- return OS::get_resource_dir();
-}
-
// Returns string representation of keys, if they are printable.
//
static NSString *createStringForKeys(const CGKeyCode *keyCode, int length) {
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 65eb51a2f3..053ea466f3 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -64,6 +64,7 @@ def get_opts():
return [
('mingw_prefix_32', 'MinGW prefix (Win32)', mingw32),
('mingw_prefix_64', 'MinGW prefix (Win64)', mingw64),
+ ('use_lto', 'Use link time optimization (when using MingW)', 'no'),
('debug_symbols', 'Add debug symbols to release version (yes/no/full)', 'yes')
]
@@ -256,11 +257,15 @@ def configure(env):
env["CC"] = mingw_prefix + "gcc"
env['AS'] = mingw_prefix + "as"
env['CXX'] = mingw_prefix + "g++"
- env['AR'] = mingw_prefix + "ar"
- env['RANLIB'] = mingw_prefix + "ranlib"
+ env['AR'] = mingw_prefix + "gcc-ar"
+ env['RANLIB'] = mingw_prefix + "gcc-ranlib"
env['LD'] = mingw_prefix + "g++"
env["x86_libtheora_opt_gcc"] = True
+ if (env["use_lto"] == "yes"):
+ env.Append(CCFLAGS=['-flto'])
+ env.Append(LINKFLAGS=['-flto'])
+
## Compile flags
env.Append(CCFLAGS=['-DWINDOWS_ENABLED', '-mwindows'])
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 591398dd6d..b9b4ad8201 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -120,6 +120,9 @@ def configure(env):
if (env["use_lto"] == "yes"):
env.Append(CCFLAGS=['-flto'])
env.Append(LINKFLAGS=['-flto'])
+ if (env["use_llvm"] == "no"):
+ env['RANLIB'] = 'gcc-ranlib'
+ env['AR'] = 'gcc-ar'
env.Append(CCFLAGS=['-pipe'])
env.Append(LINKFLAGS=['-pipe'])
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp
index ce56b85a9e..73e5dc6021 100644
--- a/scene/2d/collision_object_2d.cpp
+++ b/scene/2d/collision_object_2d.cpp
@@ -82,7 +82,7 @@ uint32_t CollisionObject2D::create_shape_owner(Object *p_owner) {
uint32_t id;
if (shapes.size() == 0) {
- id = 1;
+ id = 0;
} else {
id = shapes.back()->key() + 1;
}
diff --git a/scene/3d/collision_object.cpp b/scene/3d/collision_object.cpp
index 1c0633fba7..7b4770e435 100644
--- a/scene/3d/collision_object.cpp
+++ b/scene/3d/collision_object.cpp
@@ -161,7 +161,7 @@ uint32_t CollisionObject::create_shape_owner(Object *p_owner) {
uint32_t id;
if (shapes.size() == 0) {
- id = 1;
+ id = 0;
} else {
id = shapes.back()->key() + 1;
}