summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct14
-rw-r--r--core/bind/core_bind.cpp4
-rw-r--r--core/bind/core_bind.h11
-rw-r--r--core/os/os.cpp2
-rw-r--r--core/os/os.h13
-rw-r--r--core/reference.cpp13
-rw-r--r--core/reference.h2
-rw-r--r--core/undo_redo.cpp4
-rw-r--r--core/variant.cpp4
-rw-r--r--core/variant.h1
-rw-r--r--doc/classes/AcceptDialog.xml12
-rw-r--r--doc/classes/AnimationTreePlayer.xml4
-rw-r--r--doc/classes/Area.xml10
-rw-r--r--doc/classes/AudioEffectDistortion.xml10
-rw-r--r--doc/classes/AudioEffectFilter.xml8
-rw-r--r--doc/classes/AudioServer.xml6
-rw-r--r--doc/classes/AudioStreamPlayer.xml6
-rw-r--r--doc/classes/AudioStreamSample.xml12
-rw-r--r--doc/classes/CollisionPolygon2D.xml4
-rw-r--r--doc/classes/Curve.xml6
-rw-r--r--doc/classes/EditorExportPlugin.xml61
-rw-r--r--doc/classes/EditorFileDialog.xml4
-rw-r--r--doc/classes/EditorPlugin.xml16
-rw-r--r--doc/classes/GeometryInstance.xml12
-rw-r--r--doc/classes/KinematicBody2D.xml3
-rw-r--r--doc/classes/KinematicCollision2D.xml14
-rw-r--r--doc/classes/Label.xml21
-rw-r--r--doc/classes/Light2D.xml12
-rw-r--r--doc/classes/Line2D.xml24
-rw-r--r--doc/classes/Mesh.xml68
-rw-r--r--doc/classes/NinePatchRect.xml15
-rw-r--r--doc/classes/OS.xml12
-rw-r--r--doc/classes/OmniLight.xml8
-rw-r--r--doc/classes/PhysicsServer.xml24
-rw-r--r--doc/classes/Reference.xml2
-rw-r--r--doc/classes/RigidBody.xml8
-rw-r--r--doc/classes/Spatial.xml72
-rw-r--r--doc/classes/TabContainer.xml6
-rw-r--r--doc/classes/TextureProgress.xml16
-rw-r--r--doc/classes/TextureRect.xml18
-rw-r--r--doc/classes/TouchScreenButton.xml4
-rw-r--r--doc/classes/Transform.xml22
-rw-r--r--doc/classes/Transform2D.xml18
-rw-r--r--doc/classes/TreeItem.xml6
-rw-r--r--doc/classes/Viewport.xml14
-rw-r--r--doc/classes/VisibilityNotifier.xml9
-rw-r--r--doc/classes/VisibilityNotifier2D.xml9
-rw-r--r--doc/classes/VisualScriptBuiltinFunc.xml116
-rw-r--r--doc/classes/VisualScriptFunctionCall.xml12
-rw-r--r--doc/classes/VisualScriptInputAction.xml8
-rw-r--r--doc/classes/VisualScriptMathConstant.xml18
-rw-r--r--doc/classes/VisualScriptPropertySet.xml24
-rw-r--r--doc/tools/doc_status.py54
-rw-r--r--editor/SCsub8
-rw-r--r--editor/doc/doc_data.cpp4
-rw-r--r--editor/editor_export.cpp141
-rw-r--r--editor/editor_export.h45
-rw-r--r--editor/editor_file_dialog.cpp5
-rw-r--r--editor/editor_node.cpp41
-rw-r--r--editor/editor_node.h1
-rw-r--r--editor/editor_plugin.cpp10
-rw-r--r--editor/editor_plugin.h3
-rw-r--r--editor/plugins/animation_tree_editor_plugin.cpp6
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp23
-rw-r--r--editor/property_editor.cpp8
-rw-r--r--main/input_default.cpp11
-rw-r--r--modules/gdnative/gd_native_library_editor.cpp148
-rw-r--r--modules/gdnative/gd_native_library_editor.h (renamed from core/os/power.h)35
-rw-r--r--modules/gdnative/gdnative/variant.cpp17
-rw-r--r--modules/gdnative/register_types.cpp11
-rw-r--r--modules/visual_script/visual_script_builtin_funcs.cpp59
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp20
-rw-r--r--modules/visual_script/visual_script_nodes.cpp15
-rw-r--r--platform/android/power_android.cpp16
-rw-r--r--platform/android/power_android.h6
-rw-r--r--platform/haiku/os_haiku.h2
-rw-r--r--platform/haiku/power_haiku.cpp6
-rw-r--r--platform/haiku/power_haiku.h6
-rw-r--r--platform/iphone/power_iphone.cpp8
-rw-r--r--platform/iphone/power_iphone.h6
-rw-r--r--platform/javascript/os_javascript.cpp2
-rw-r--r--platform/javascript/os_javascript.h2
-rw-r--r--platform/javascript/power_javascript.cpp6
-rw-r--r--platform/javascript/power_javascript.h6
-rw-r--r--platform/osx/os_osx.h2
-rw-r--r--platform/osx/os_osx.mm2
-rw-r--r--platform/osx/power_osx.cpp16
-rw-r--r--platform/osx/power_osx.h6
-rw-r--r--platform/server/os_server.cpp2
-rw-r--r--platform/server/os_server.h2
-rw-r--r--platform/uwp/os_uwp.cpp2
-rw-r--r--platform/uwp/os_uwp.h2
-rw-r--r--platform/uwp/power_uwp.cpp6
-rw-r--r--platform/uwp/power_uwp.h6
-rw-r--r--platform/windows/os_windows.cpp2
-rw-r--r--platform/windows/os_windows.h2
-rw-r--r--platform/windows/power_windows.cpp18
-rw-r--r--platform/windows/power_windows.h6
-rw-r--r--platform/x11/joypad_linux.cpp1
-rw-r--r--platform/x11/os_x11.cpp2
-rw-r--r--platform/x11/os_x11.h2
-rw-r--r--platform/x11/power_x11.cpp42
-rw-r--r--platform/x11/power_x11.h6
-rw-r--r--scene/2d/collision_polygon_2d.cpp3
-rw-r--r--scene/2d/light_2d.cpp7
-rw-r--r--scene/2d/line_2d.cpp15
-rw-r--r--scene/2d/line_2d.h19
-rw-r--r--scene/2d/line_builder.cpp52
-rw-r--r--scene/2d/line_builder.h27
-rw-r--r--scene/2d/screen_button.cpp3
-rw-r--r--scene/3d/area.cpp6
-rw-r--r--scene/3d/arvr_nodes.cpp4
-rw-r--r--scene/3d/light.cpp6
-rw-r--r--scene/3d/physics_body.cpp5
-rw-r--r--scene/3d/visual_instance.cpp11
-rw-r--r--scene/animation/animation_tree_player.cpp3
-rw-r--r--scene/audio/audio_player.cpp4
-rw-r--r--scene/gui/control.cpp12
-rw-r--r--scene/gui/tab_container.cpp4
-rw-r--r--scene/gui/tree.cpp4
-rw-r--r--scene/main/viewport.cpp9
-rw-r--r--scene/resources/audio_stream_sample.cpp8
-rw-r--r--scene/resources/curve.cpp4
-rw-r--r--scene/resources/mesh.cpp40
-rw-r--r--servers/audio/effects/audio_effect_distortion.cpp6
-rw-r--r--servers/audio/effects/audio_effect_filter.cpp5
-rw-r--r--servers/audio_server.cpp4
-rw-r--r--servers/physics_server.cpp14
128 files changed, 1579 insertions, 376 deletions
diff --git a/SConstruct b/SConstruct
index bc89aa7540..f2f1ea57f3 100644
--- a/SConstruct
+++ b/SConstruct
@@ -367,13 +367,13 @@ if selected_platform in platform_list:
if (config.can_build(selected_platform)):
config.configure(env)
env.module_list.append(x)
- try:
- doc_classes = config.get_doc_classes()
- doc_path = config.get_doc_path()
- for c in doc_classes:
- env.doc_class_path[c]="modules/"+x+"/"+doc_path
- except:
- pass
+ try:
+ doc_classes = config.get_doc_classes()
+ doc_path = config.get_doc_path()
+ for c in doc_classes:
+ env.doc_class_path[c]="modules/"+x+"/"+doc_path
+ except:
+ pass
sys.path.remove(tmppath)
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 0f217c8235..ab9c107d7a 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -440,8 +440,8 @@ bool _OS::is_vsync_enabled() const {
return OS::get_singleton()->is_vsync_enabled();
}
-PowerState _OS::get_power_state() {
- return OS::get_singleton()->get_power_state();
+_OS::PowerState _OS::get_power_state() {
+ return _OS::PowerState(OS::get_singleton()->get_power_state());
}
int _OS::get_power_seconds_left() {
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 1a3782c471..fc28ada0f8 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -36,7 +36,7 @@
#include "io/resource_saver.h"
#include "os/dir_access.h"
#include "os/file_access.h"
-#include "os/power.h"
+#include "os/os.h"
#include "os/semaphore.h"
#include "os/thread.h"
@@ -97,6 +97,14 @@ protected:
static _OS *singleton;
public:
+ enum PowerState {
+ POWERSTATE_UNKNOWN, /**< cannot determine power status */
+ POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
+ POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
+ POWERSTATE_CHARGING, /**< Plugged in, charging battery */
+ POWERSTATE_CHARGED /**< Plugged in, battery charged */
+ };
+
enum Weekday {
DAY_SUNDAY,
DAY_MONDAY,
@@ -312,6 +320,7 @@ public:
_OS();
};
+VARIANT_ENUM_CAST(_OS::PowerState);
VARIANT_ENUM_CAST(_OS::Weekday);
VARIANT_ENUM_CAST(_OS::Month);
VARIANT_ENUM_CAST(_OS::SystemDir);
diff --git a/core/os/os.cpp b/core/os/os.cpp
index 764f7fe6e6..437ce01a5e 100644
--- a/core/os/os.cpp
+++ b/core/os/os.cpp
@@ -485,7 +485,7 @@ bool OS::is_vsync_enabled() const {
return true;
}
-PowerState OS::get_power_state() {
+OS::PowerState OS::get_power_state() {
return POWERSTATE_UNKNOWN;
}
int OS::get_power_seconds_left() {
diff --git a/core/os/os.h b/core/os/os.h
index c378d36a35..2fc87e44a0 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -34,7 +34,6 @@
#include "image.h"
#include "list.h"
#include "os/main_loop.h"
-#include "power.h"
#include "ustring.h"
#include "vector.h"
#include <stdarg.h>
@@ -65,6 +64,14 @@ class OS {
public:
typedef void (*ImeCallback)(void *p_inp, String p_text, Point2 p_selection);
+ enum PowerState {
+ POWERSTATE_UNKNOWN, /**< cannot determine power status */
+ POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
+ POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
+ POWERSTATE_CHARGING, /**< Plugged in, charging battery */
+ POWERSTATE_CHARGED /**< Plugged in, battery charged */
+ };
+
enum RenderThreadMode {
RENDER_THREAD_UNSAFE,
@@ -413,7 +420,7 @@ public:
virtual void set_use_vsync(bool p_enable);
virtual bool is_vsync_enabled() const;
- virtual PowerState get_power_state();
+ virtual OS::PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
@@ -431,6 +438,6 @@ public:
virtual ~OS();
};
-VARIANT_ENUM_CAST(PowerState);
+VARIANT_ENUM_CAST(OS::PowerState);
#endif
diff --git a/core/reference.cpp b/core/reference.cpp
index bb70628cbe..7f93922d22 100644
--- a/core/reference.cpp
+++ b/core/reference.cpp
@@ -33,7 +33,7 @@
bool Reference::init_ref() {
- if (refcount.ref()) {
+ if (reference()) {
// this may fail in the scenario of two threads assigning the pointer for the FIRST TIME
// at the same time, which is never likely to happen (would be crazy to do)
@@ -41,7 +41,7 @@ bool Reference::init_ref() {
if (refcount_init.get() > 0) {
refcount_init.unref();
- refcount.unref(); // first referencing is already 1, so compensate for the ref above
+ unreference(); // first referencing is already 1, so compensate for the ref above
}
return true;
@@ -62,13 +62,16 @@ int Reference::reference_get_count() const {
return refcount.get();
}
-void Reference::reference() {
+bool Reference::reference() {
+ bool success = refcount.ref();
- refcount.ref();
- if (get_script_instance()) {
+ if (success && get_script_instance()) {
get_script_instance()->refcount_incremented();
}
+
+ return success;
}
+
bool Reference::unreference() {
bool die = refcount.unref();
diff --git a/core/reference.h b/core/reference.h
index ca3ae60418..bafc164276 100644
--- a/core/reference.h
+++ b/core/reference.h
@@ -51,7 +51,7 @@ protected:
public:
_FORCE_INLINE_ bool is_referenced() const { return refcount_init.get() < 1; }
bool init_ref();
- void reference();
+ bool reference(); // returns false if refcount is at zero and didn't get increased
bool unreference();
int reference_get_count() const;
diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp
index 4760047959..27fc73ec63 100644
--- a/core/undo_redo.cpp
+++ b/core/undo_redo.cpp
@@ -503,6 +503,10 @@ void UndoRedo::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear_history"), &UndoRedo::clear_history);
ClassDB::bind_method(D_METHOD("get_current_action_name"), &UndoRedo::get_current_action_name);
ClassDB::bind_method(D_METHOD("get_version"), &UndoRedo::get_version);
+ ClassDB::bind_method(D_METHOD("set_max_steps", "max_steps"), &UndoRedo::set_max_steps);
+ ClassDB::bind_method(D_METHOD("get_max_steps"), &UndoRedo::get_max_steps);
+ ClassDB::bind_method(D_METHOD("redo"), &UndoRedo::redo);
+ ClassDB::bind_method(D_METHOD("undo"), &UndoRedo::undo);
BIND_ENUM_CONSTANT(MERGE_DISABLE);
BIND_ENUM_CONSTANT(MERGE_ENDS);
diff --git a/core/variant.cpp b/core/variant.cpp
index 74f6b6a711..10d86152ee 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -2259,8 +2259,8 @@ Variant::Variant(const RefPtr &p_resource) {
type = OBJECT;
memnew_placement(_data._mem, ObjData);
- REF ref = p_resource;
- _get_obj().obj = ref.ptr();
+ REF *ref = reinterpret_cast<REF *>(p_resource.get_data());
+ _get_obj().obj = ref->ptr();
_get_obj().ref = p_resource;
}
diff --git a/core/variant.h b/core/variant.h
index c44608ebfa..e77e2e93c4 100644
--- a/core/variant.h
+++ b/core/variant.h
@@ -43,7 +43,6 @@
#include "math_2d.h"
#include "matrix3.h"
#include "node_path.h"
-#include "os/power.h"
#include "plane.h"
#include "quat.h"
#include "rect3.h"
diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml
index 8821a450e5..4244e66a35 100644
--- a/doc/classes/AcceptDialog.xml
+++ b/doc/classes/AcceptDialog.xml
@@ -21,8 +21,8 @@
<argument index="2" name="action" type="String" default="&quot;&quot;">
</argument>
<description>
- Add custom button to the dialog and return the created button.
- The button titled with [i]text[/i] and the [i]action[/i] will be passed to [custom_action] signal when it is pressed.
+ Adds a button with label [i]text[/i] and a custom [i]action[/i] to the dialog and returns the created button. [i]action[/i] will be passed to the [custom_action] signal when pressed.
+ If [code]true[/code], [i]right[/i] will place the button to the right of any sibling buttons. Default value: [code]false[/code].
</description>
</method>
<method name="add_cancel">
@@ -31,7 +31,7 @@
<argument index="0" name="name" type="String">
</argument>
<description>
- Add custom cancel button to the dialog and return the created button.
+ Adds a button with label [i]name[/i] and a cancel action to the dialog and returns the created button.
</description>
</method>
<method name="get_hide_on_ok" qualifiers="const">
@@ -68,7 +68,7 @@
<argument index="0" name="line_edit" type="Node">
</argument>
<description>
- Register a [LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted.
+ Registers a [LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted.
</description>
</method>
<method name="set_hide_on_ok">
@@ -99,14 +99,14 @@
<signals>
<signal name="confirmed">
<description>
- Emitted when accepted.
+ Emitted when the dialog is accepted.
</description>
</signal>
<signal name="custom_action">
<argument index="0" name="action" type="String">
</argument>
<description>
- Emitted with a custom button is added.
+ Emitted when a custom button is pressed. See [method add_button].
</description>
</signal>
</signals>
diff --git a/doc/classes/AnimationTreePlayer.xml b/doc/classes/AnimationTreePlayer.xml
index ad9bc922e4..e128b4d865 100644
--- a/doc/classes/AnimationTreePlayer.xml
+++ b/doc/classes/AnimationTreePlayer.xml
@@ -659,5 +659,9 @@
<constant name="NODE_TRANSITION" value="9">
Transition node.
</constant>
+ <constant name="ANIMATION_PROCESS_FIXED" value="0">
+ </constant>
+ <constant name="ANIMATION_PROCESS_IDLE" value="1">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Area.xml b/doc/classes/Area.xml
index 4e366e124e..c59bbee084 100644
--- a/doc/classes/Area.xml
+++ b/doc/classes/Area.xml
@@ -493,5 +493,15 @@
</signal>
</signals>
<constants>
+ <constant name="SPACE_OVERRIDE_DISABLED" value="0">
+ </constant>
+ <constant name="SPACE_OVERRIDE_COMBINE" value="1">
+ </constant>
+ <constant name="SPACE_OVERRIDE_COMBINE_REPLACE" value="2">
+ </constant>
+ <constant name="SPACE_OVERRIDE_REPLACE" value="3">
+ </constant>
+ <constant name="SPACE_OVERRIDE_REPLACE_COMBINE" value="4">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/AudioEffectDistortion.xml b/doc/classes/AudioEffectDistortion.xml
index d8b9dee9dc..e5c5a3b50e 100644
--- a/doc/classes/AudioEffectDistortion.xml
+++ b/doc/classes/AudioEffectDistortion.xml
@@ -93,5 +93,15 @@
</member>
</members>
<constants>
+ <constant name="MODE_CLIP" value="0">
+ </constant>
+ <constant name="MODE_ATAN" value="1">
+ </constant>
+ <constant name="MODE_LOFI" value="2">
+ </constant>
+ <constant name="MODE_OVERDRIVE" value="3">
+ </constant>
+ <constant name="MODE_WAVESHAPE" value="4">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/AudioEffectFilter.xml b/doc/classes/AudioEffectFilter.xml
index 6285539a61..17aa01d60a 100644
--- a/doc/classes/AudioEffectFilter.xml
+++ b/doc/classes/AudioEffectFilter.xml
@@ -77,5 +77,13 @@
</member>
</members>
<constants>
+ <constant name="FILTER_6DB" value="0">
+ </constant>
+ <constant name="FILTER_12DB" value="1">
+ </constant>
+ <constant name="FILTER_18DB" value="2">
+ </constant>
+ <constant name="FILTER_24DB" value="3">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml
index 7856537804..dc30c0c5f9 100644
--- a/doc/classes/AudioServer.xml
+++ b/doc/classes/AudioServer.xml
@@ -307,5 +307,11 @@
</signal>
</signals>
<constants>
+ <constant name="SPEAKER_MODE_STEREO" value="0">
+ </constant>
+ <constant name="SPEAKER_SURROUND_51" value="2">
+ </constant>
+ <constant name="SPEAKER_SURROUND_71" value="3">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/AudioStreamPlayer.xml b/doc/classes/AudioStreamPlayer.xml
index 64823c3be5..6ee0ba09a1 100644
--- a/doc/classes/AudioStreamPlayer.xml
+++ b/doc/classes/AudioStreamPlayer.xml
@@ -135,5 +135,11 @@
</signal>
</signals>
<constants>
+ <constant name="MIX_TARGET_STEREO" value="0">
+ </constant>
+ <constant name="MIX_TARGET_SURROUND" value="1">
+ </constant>
+ <constant name="MIX_TARGET_CENTER" value="2">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/AudioStreamSample.xml b/doc/classes/AudioStreamSample.xml
index e14a17a05c..22b820aa7d 100644
--- a/doc/classes/AudioStreamSample.xml
+++ b/doc/classes/AudioStreamSample.xml
@@ -125,5 +125,17 @@
</member>
</members>
<constants>
+ <constant name="FORMAT_8_BITS" value="0">
+ </constant>
+ <constant name="FORMAT_16_BITS" value="1">
+ </constant>
+ <constant name="FORMAT_IMA_ADPCM" value="2">
+ </constant>
+ <constant name="LOOP_DISABLED" value="0">
+ </constant>
+ <constant name="LOOP_FORWARD" value="1">
+ </constant>
+ <constant name="LOOP_PING_PONG" value="2">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/CollisionPolygon2D.xml b/doc/classes/CollisionPolygon2D.xml
index ef0f1ce451..b602610167 100644
--- a/doc/classes/CollisionPolygon2D.xml
+++ b/doc/classes/CollisionPolygon2D.xml
@@ -84,5 +84,9 @@
</member>
</members>
<constants>
+ <constant name="BUILD_SOLIDS" value="0">
+ </constant>
+ <constant name="BUILD_SEGMENTS" value="1">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Curve.xml b/doc/classes/Curve.xml
index bf9f7598e0..d676f635c9 100644
--- a/doc/classes/Curve.xml
+++ b/doc/classes/Curve.xml
@@ -227,5 +227,11 @@
</signal>
</signals>
<constants>
+ <constant name="TANGENT_FREE" value="0">
+ </constant>
+ <constant name="TANGENT_LINEAR" value="1">
+ </constant>
+ <constant name="TANGENT_MODE_COUNT" value="2">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/EditorExportPlugin.xml b/doc/classes/EditorExportPlugin.xml
new file mode 100644
index 0000000000..b0ed24b767
--- /dev/null
+++ b/doc/classes/EditorExportPlugin.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="EditorExportPlugin" inherits="Reference" category="Core" version="3.0.alpha.custom_build">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <tutorials>
+ </tutorials>
+ <demos>
+ </demos>
+ <methods>
+ <method name="_export_begin" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="features" type="PoolStringArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="_export_file" qualifiers="virtual">
+ <return type="void">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <argument index="1" name="type" type="String">
+ </argument>
+ <argument index="2" name="features" type="PoolStringArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="add_file">
+ <return type="void">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <argument index="1" name="file" type="PoolByteArray">
+ </argument>
+ <argument index="2" name="remap" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="add_shared_object">
+ <return type="void">
+ </return>
+ <argument index="0" name="path" type="String">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="skip">
+ <return type="void">
+ </return>
+ <description>
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml
index 1e0f27ef7f..6ae893f189 100644
--- a/doc/classes/EditorFileDialog.xml
+++ b/doc/classes/EditorFileDialog.xml
@@ -185,5 +185,9 @@
</constant>
<constant name="ACCESS_FILESYSTEM" value="2">
</constant>
+ <constant name="DISPLAY_THUMBNAILS" value="0">
+ </constant>
+ <constant name="DISPLAY_LIST" value="1">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/EditorPlugin.xml b/doc/classes/EditorPlugin.xml
index f620c33f7a..2831555d41 100644
--- a/doc/classes/EditorPlugin.xml
+++ b/doc/classes/EditorPlugin.xml
@@ -66,6 +66,14 @@
During run-time, this will be a simple object with a script so this function does not need to be called then.
</description>
</method>
+ <method name="add_export_plugin">
+ <return type="void">
+ </return>
+ <argument index="0" name="exporter" type="EditorExportPlugin">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="add_import_plugin">
<return type="void">
</return>
@@ -266,6 +274,14 @@
Remove a custom type added by [method EditorPlugin.add_custom_type]
</description>
</method>
+ <method name="remove_export_plugin">
+ <return type="void">
+ </return>
+ <argument index="0" name="exporter" type="EditorExportPlugin">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="remove_import_plugin">
<return type="void">
</return>
diff --git a/doc/classes/GeometryInstance.xml b/doc/classes/GeometryInstance.xml
index 550a1e97d7..57aec8be41 100644
--- a/doc/classes/GeometryInstance.xml
+++ b/doc/classes/GeometryInstance.xml
@@ -149,15 +149,17 @@
</member>
</members>
<constants>
- <constant name="FLAG_MAX" value="1" enum="">
+ <constant name="SHADOW_CASTING_SETTING_OFF" value="0">
</constant>
- <constant name="SHADOW_CASTING_SETTING_OFF" value="0" enum="">
+ <constant name="SHADOW_CASTING_SETTING_ON" value="1">
</constant>
- <constant name="SHADOW_CASTING_SETTING_ON" value="1" enum="">
+ <constant name="SHADOW_CASTING_SETTING_DOUBLE_SIDED" value="2">
</constant>
- <constant name="SHADOW_CASTING_SETTING_DOUBLE_SIDED" value="2" enum="">
+ <constant name="SHADOW_CASTING_SETTING_SHADOWS_ONLY" value="3">
</constant>
- <constant name="SHADOW_CASTING_SETTING_SHADOWS_ONLY" value="3" enum="">
+ <constant name="FLAG_USE_BAKED_LIGHT" value="0">
+ </constant>
+ <constant name="FLAG_MAX" value="1">
</constant>
</constants>
</class>
diff --git a/doc/classes/KinematicBody2D.xml b/doc/classes/KinematicBody2D.xml
index 26c7c6125d..dddae2c0fc 100644
--- a/doc/classes/KinematicBody2D.xml
+++ b/doc/classes/KinematicBody2D.xml
@@ -63,6 +63,7 @@
<argument index="0" name="rel_vec" type="Vector2">
</argument>
<description>
+ Moves the body along the given vector. The body will stop if it collides. Returns a [KinematicCollision2D], which contains information about the colliding body.
</description>
</method>
<method name="move_and_slide">
@@ -97,7 +98,7 @@
<argument index="1" name="rel_vec" type="Vector2">
</argument>
<description>
- Return true if there would be a collision if the body moved from the given point in the given direction.
+ Returns true if there would be a collision if the body moved from the given point in the given direction.
</description>
</method>
</methods>
diff --git a/doc/classes/KinematicCollision2D.xml b/doc/classes/KinematicCollision2D.xml
index 4ef35066d0..7a40a39292 100644
--- a/doc/classes/KinematicCollision2D.xml
+++ b/doc/classes/KinematicCollision2D.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="KinematicCollision2D" inherits="Reference" category="Core" version="3.0.alpha.custom_build">
<brief_description>
+ Collision data for KinematicBody2D collisions.
</brief_description>
<description>
+ Contains collision data for KinematicBody2D collisions. When a [KinematicBody2D] is moved using [method KinematicBody2D.move_and_collide], it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision2D object is returned.
+ This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response.
</description>
<tutorials>
</tutorials>
@@ -78,26 +81,37 @@
</methods>
<members>
<member name="collider" type="Object" setter="" getter="get_collider">
+ The colliding body.
</member>
<member name="collider_id" type="int" setter="" getter="get_collider_id">
+ The colliding body's unique [RID].
</member>
<member name="collider_metadata" type="Variant" setter="" getter="get_collider_metadata">
+ The colliding body's metadata. See [Object].
</member>
<member name="collider_shape" type="Object" setter="" getter="get_collider_shape">
+ The colliding body's shape.
</member>
<member name="collider_shape_index" type="int" setter="" getter="get_collider_shape_index">
+ The colliding shape's index. See [CollisionObject2D].
</member>
<member name="collider_velocity" type="Vector2" setter="" getter="get_collider_velocity">
+ The colliding object's velocity.
</member>
<member name="local_shape" type="Object" setter="" getter="get_local_shape">
+ The moving object's colliding shape.
</member>
<member name="normal" type="Vector2" setter="" getter="get_normal">
+ The colliding body's shape's normal at the point of collision.
</member>
<member name="position" type="Vector2" setter="" getter="get_position">
+ The point of collision.
</member>
<member name="remainder" type="Vector2" setter="" getter="get_remainder">
+ The moving object's remaining movement vector.
</member>
<member name="travel" type="Vector2" setter="" getter="get_travel">
+ The distance the moving object traveled before collision.
</member>
</members>
<constants>
diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml
index 2e860aac0c..8c5e69b407 100644
--- a/doc/classes/Label.xml
+++ b/doc/classes/Label.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Label" inherits="Control" category="Core" version="3.0.alpha.custom_build">
<brief_description>
- Control that displays formatted text.
+ Displays plain text in a line or wrapped inside a rectangle. For formatted text, use [RichTextLabel].
</brief_description>
<description>
- Label is a control that displays formatted text, optionally autowrapping it to the [Control] area. It inherits from range to be able to scroll wrapped text vertically.
+ Label displays plain text on the screen. It gives you control over the horizontal and vertical alignment, and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics or other formatting. For that, use [RichTextLabel] instead.
</description>
<tutorials>
</tutorials>
@@ -22,14 +22,14 @@
<return type="int">
</return>
<description>
- Return the amount of lines.
+ Returns the amount of lines of text the Label has.
</description>
</method>
<method name="get_line_height" qualifiers="const">
<return type="int">
</return>
<description>
- Return the height of a line.
+ Returns the font size in pixels.
</description>
</method>
<method name="get_lines_skipped" qualifiers="const">
@@ -98,14 +98,14 @@
<return type="bool">
</return>
<description>
- Return true if text would be cut off if it is too wide.
+ Return [code]true[/code] if text would be cut off if it is too wide.
</description>
</method>
<method name="is_uppercase" qualifiers="const">
<return type="bool">
</return>
<description>
- Return true if text is displayed in all capitals.
+ Return [code]true[/code] if text is displayed in all capitals.
</description>
</method>
<method name="set_align">
@@ -201,22 +201,31 @@
</methods>
<members>
<member name="align" type="int" setter="set_align" getter="get_align" enum="Label.Align">
+ Controls the text's horizontal align. Supports left, center, right, and fill, or justify. Set it to one of the [code]ALIGN_*[/code] constants.
</member>
<member name="autowrap" type="bool" setter="set_autowrap" getter="has_autowrap">
+ If [code]true[/code], wraps the text inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. Default: false.
</member>
<member name="clip_text" type="bool" setter="set_clip_text" getter="is_clipping_text">
+ If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle. It also lets you scale the node down freely.
</member>
<member name="lines_skipped" type="int" setter="set_lines_skipped" getter="get_lines_skipped">
+ The node ignores the first [code]lines_skipped[/code] lines before it starts to display text.
</member>
<member name="max_lines_visible" type="int" setter="set_max_lines_visible" getter="get_max_lines_visible">
+ Limits the lines of text the node shows on screen.
</member>
<member name="percent_visible" type="float" setter="set_percent_visible" getter="get_percent_visible">
+ Limits the count of visible characters. If you set [code]percent_visible[/code] to 50, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box.
</member>
<member name="text" type="String" setter="set_text" getter="get_text">
+ The text to display on screen.
</member>
<member name="uppercase" type="bool" setter="set_uppercase" getter="is_uppercase">
+ If [code]true[/code], all the text displays as UPPERCASE.
</member>
<member name="valign" type="int" setter="set_valign" getter="get_valign" enum="Label.VAlign">
+ Controls the text's vertical align. Supports top, center, bottom, and fill. Set it to one of the [code]VALIGN_*[/code] constants.
</member>
</members>
<constants>
diff --git a/doc/classes/Light2D.xml b/doc/classes/Light2D.xml
index 593799b57d..1386fc53d9 100644
--- a/doc/classes/Light2D.xml
+++ b/doc/classes/Light2D.xml
@@ -395,5 +395,17 @@
<constant name="MODE_MASK" value="3">
The light texture of the Light2D is used as a mask, hiding or revealing parts of the screen underneath depending on the value of each pixel of the light (mask) texture.
</constant>
+ <constant name="SHADOW_FILTER_NONE" value="0">
+ </constant>
+ <constant name="SHADOW_FILTER_PCF3" value="1">
+ </constant>
+ <constant name="SHADOW_FILTER_PCF5" value="2">
+ </constant>
+ <constant name="SHADOW_FILTER_PCF7" value="3">
+ </constant>
+ <constant name="SHADOW_FILTER_PCF9" value="4">
+ </constant>
+ <constant name="SHADOW_FILTER_PCF13" value="5">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Line2D.xml b/doc/classes/Line2D.xml
index e954173047..81fd255781 100644
--- a/doc/classes/Line2D.xml
+++ b/doc/classes/Line2D.xml
@@ -21,7 +21,7 @@
</description>
</method>
<method name="get_begin_cap_mode" qualifiers="const">
- <return type="int" enum="LineCapMode">
+ <return type="int" enum="Line2D.LineCapMode">
</return>
<description>
</description>
@@ -33,7 +33,7 @@
</description>
</method>
<method name="get_end_cap_mode" qualifiers="const">
- <return type="int" enum="LineCapMode">
+ <return type="int" enum="Line2D.LineCapMode">
</return>
<description>
</description>
@@ -45,7 +45,7 @@
</description>
</method>
<method name="get_joint_mode" qualifiers="const">
- <return type="int" enum="LineJointMode">
+ <return type="int" enum="Line2D.LineJointMode">
</return>
<description>
</description>
@@ -89,7 +89,7 @@
</description>
</method>
<method name="get_texture_mode" qualifiers="const">
- <return type="int" enum="LineTextureMode">
+ <return type="int" enum="Line2D.LineTextureMode">
</return>
<description>
</description>
@@ -112,7 +112,7 @@
<method name="set_begin_cap_mode">
<return type="void">
</return>
- <argument index="0" name="mode" type="int" enum="LineCapMode">
+ <argument index="0" name="mode" type="int" enum="Line2D.LineCapMode">
</argument>
<description>
</description>
@@ -128,7 +128,7 @@
<method name="set_end_cap_mode">
<return type="void">
</return>
- <argument index="0" name="mode" type="int" enum="LineCapMode">
+ <argument index="0" name="mode" type="int" enum="Line2D.LineCapMode">
</argument>
<description>
</description>
@@ -144,7 +144,7 @@
<method name="set_joint_mode">
<return type="void">
</return>
- <argument index="0" name="mode" type="int" enum="LineJointMode">
+ <argument index="0" name="mode" type="int" enum="Line2D.LineJointMode">
</argument>
<description>
</description>
@@ -194,7 +194,7 @@
<method name="set_texture_mode">
<return type="void">
</return>
- <argument index="0" name="mode" type="int" enum="LineTextureMode">
+ <argument index="0" name="mode" type="int" enum="Line2D.LineTextureMode">
</argument>
<description>
</description>
@@ -209,15 +209,15 @@
</method>
</methods>
<members>
- <member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="LineCapMode">
+ <member name="begin_cap_mode" type="int" setter="set_begin_cap_mode" getter="get_begin_cap_mode" enum="Line2D.LineCapMode">
</member>
<member name="default_color" type="Color" setter="set_default_color" getter="get_default_color">
</member>
- <member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="LineCapMode">
+ <member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" enum="Line2D.LineCapMode">
</member>
<member name="gradient" type="Gradient" setter="set_gradient" getter="get_gradient">
</member>
- <member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" enum="LineJointMode">
+ <member name="joint_mode" type="int" setter="set_joint_mode" getter="get_joint_mode" enum="Line2D.LineJointMode">
</member>
<member name="points" type="PoolVector2Array" setter="set_points" getter="get_points">
</member>
@@ -227,7 +227,7 @@
</member>
<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
</member>
- <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="LineTextureMode">
+ <member name="texture_mode" type="int" setter="set_texture_mode" getter="get_texture_mode" enum="Line2D.LineTextureMode">
</member>
<member name="width" type="float" setter="set_width" getter="get_width">
</member>
diff --git a/doc/classes/Mesh.xml b/doc/classes/Mesh.xml
index 66b52e7f48..658265d242 100644
--- a/doc/classes/Mesh.xml
+++ b/doc/classes/Mesh.xml
@@ -71,5 +71,73 @@
<constant name="PRIMITIVE_TRIANGLE_FAN" value="6">
Render array as triangle fans.
</constant>
+ <constant name="BLEND_SHAPE_MODE_NORMALIZED" value="0">
+ </constant>
+ <constant name="BLEND_SHAPE_MODE_RELATIVE" value="1">
+ </constant>
+ <constant name="ARRAY_FORMAT_VERTEX" value="1">
+ </constant>
+ <constant name="ARRAY_FORMAT_NORMAL" value="2">
+ </constant>
+ <constant name="ARRAY_FORMAT_TANGENT" value="4">
+ </constant>
+ <constant name="ARRAY_FORMAT_COLOR" value="8">
+ </constant>
+ <constant name="ARRAY_FORMAT_TEX_UV" value="16">
+ </constant>
+ <constant name="ARRAY_FORMAT_TEX_UV2" value="32">
+ </constant>
+ <constant name="ARRAY_FORMAT_BONES" value="64">
+ </constant>
+ <constant name="ARRAY_FORMAT_WEIGHTS" value="128">
+ </constant>
+ <constant name="ARRAY_FORMAT_INDEX" value="256">
+ </constant>
+ <constant name="ARRAY_COMPRESS_BASE" value="9">
+ </constant>
+ <constant name="ARRAY_COMPRESS_VERTEX" value="512">
+ </constant>
+ <constant name="ARRAY_COMPRESS_NORMAL" value="1024">
+ </constant>
+ <constant name="ARRAY_COMPRESS_TANGENT" value="2048">
+ </constant>
+ <constant name="ARRAY_COMPRESS_COLOR" value="4096">
+ </constant>
+ <constant name="ARRAY_COMPRESS_TEX_UV" value="8192">
+ </constant>
+ <constant name="ARRAY_COMPRESS_TEX_UV2" value="16384">
+ </constant>
+ <constant name="ARRAY_COMPRESS_BONES" value="32768">
+ </constant>
+ <constant name="ARRAY_COMPRESS_WEIGHTS" value="65536">
+ </constant>
+ <constant name="ARRAY_COMPRESS_INDEX" value="131072">
+ </constant>
+ <constant name="ARRAY_FLAG_USE_2D_VERTICES" value="262144">
+ </constant>
+ <constant name="ARRAY_FLAG_USE_16_BIT_BONES" value="524288">
+ </constant>
+ <constant name="ARRAY_COMPRESS_DEFAULT" value="97792">
+ </constant>
+ <constant name="ARRAY_VERTEX" value="0">
+ </constant>
+ <constant name="ARRAY_NORMAL" value="1">
+ </constant>
+ <constant name="ARRAY_TANGENT" value="2">
+ </constant>
+ <constant name="ARRAY_COLOR" value="3">
+ </constant>
+ <constant name="ARRAY_TEX_UV" value="4">
+ </constant>
+ <constant name="ARRAY_TEX_UV2" value="5">
+ </constant>
+ <constant name="ARRAY_BONES" value="6">
+ </constant>
+ <constant name="ARRAY_WEIGHTS" value="7">
+ </constant>
+ <constant name="ARRAY_INDEX" value="8">
+ </constant>
+ <constant name="ARRAY_MAX" value="9">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml
index 092e928ef9..6829b36e14 100644
--- a/doc/classes/NinePatchRect.xml
+++ b/doc/classes/NinePatchRect.xml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="NinePatchRect" inherits="Control" category="Core" version="3.0.alpha.custom_build">
<brief_description>
+ Scalable texture-based frame that tiles the texture's centers and sides, but keeps the corners' original size. Perfect for panels and dialog boxes.
</brief_description>
<description>
+ Better known as 9-slice panels, NinePatchRect produces clean panels of any size, based on a small texture. To do so, it splits the texture in a 3 by 3 grid. When you scale the node, it tiles the texture's sides horizontally or vertically, the center on both axes but it doesn't scale or tile the corners.
</description>
<tutorials>
</tutorials>
@@ -100,36 +102,49 @@
</methods>
<members>
<member name="axis_stretch_horizontal" type="int" setter="set_h_axis_stretch_mode" getter="get_h_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode">
+ Doesn't do anything at the time of writing.
</member>
<member name="axis_stretch_vertical" type="int" setter="set_v_axis_stretch_mode" getter="get_v_axis_stretch_mode" enum="NinePatchRect.AxisStretchMode">
+ Doesn't do anything at the time of writing.
</member>
<member name="draw_center" type="bool" setter="set_draw_center" getter="is_draw_center_enabled">
+ If [code]true[/code], draw the panel's center. Else, only draw the 9-slice's borders. Default value: [code]true[/code]
</member>
<member name="patch_margin_bottom" type="int" setter="set_patch_margin" getter="get_patch_margin">
+ The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values indivually to create panels with non-uniform borders.
</member>
<member name="patch_margin_left" type="int" setter="set_patch_margin" getter="get_patch_margin">
+ The height of the 9-slice's left column.
</member>
<member name="patch_margin_right" type="int" setter="set_patch_margin" getter="get_patch_margin">
+ The height of the 9-slice's right column.
</member>
<member name="patch_margin_top" type="int" setter="set_patch_margin" getter="get_patch_margin">
+ The height of the 9-slice's top row.
</member>
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect">
+ Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one.
</member>
<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
+ The node's texture resource.
</member>
</members>
<signals>
<signal name="texture_changed">
<description>
+ Fired when the node's texture changes.
</description>
</signal>
</signals>
<constants>
<constant name="AXIS_STRETCH_MODE_STRETCH" value="0">
+ Doesn't do anything at the time of writing. Default value for [code]axis_stretch_horizontal[/code] and [code]axis_stretch_vertical[/code].
</constant>
<constant name="AXIS_STRETCH_MODE_TILE" value="1">
+ Doesn't do anything at the time of writing.
</constant>
<constant name="AXIS_STRETCH_MODE_TILE_FIT" value="2">
+ Doesn't do anything at the time of writing.
</constant>
</constants>
</class>
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index 38f1eb8ce1..5b14d5a746 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -233,7 +233,7 @@
</description>
</method>
<method name="get_power_state">
- <return type="int" enum="PowerState">
+ <return type="int" enum="OS.PowerState">
</return>
<description>
</description>
@@ -840,15 +840,15 @@
</constant>
<constant name="SYSTEM_DIR_RINGTONES" value="7">
</constant>
- <constant name="POWERSTATE_UNKNOWN" value="0">
+ <constant name="OS::POWERSTATE_UNKNOWN" value="0">
</constant>
- <constant name="POWERSTATE_ON_BATTERY" value="1">
+ <constant name="OS::POWERSTATE_ON_BATTERY" value="1">
</constant>
- <constant name="POWERSTATE_NO_BATTERY" value="2">
+ <constant name="OS::POWERSTATE_NO_BATTERY" value="2">
</constant>
- <constant name="POWERSTATE_CHARGING" value="3">
+ <constant name="OS::POWERSTATE_CHARGING" value="3">
</constant>
- <constant name="POWERSTATE_CHARGED" value="4">
+ <constant name="OS::POWERSTATE_CHARGED" value="4">
</constant>
</constants>
</class>
diff --git a/doc/classes/OmniLight.xml b/doc/classes/OmniLight.xml
index 8750fd7e99..cb8e756a4c 100644
--- a/doc/classes/OmniLight.xml
+++ b/doc/classes/OmniLight.xml
@@ -51,5 +51,13 @@
</member>
</members>
<constants>
+ <constant name="SHADOW_DUAL_PARABOLOID" value="0">
+ </constant>
+ <constant name="SHADOW_CUBE" value="1">
+ </constant>
+ <constant name="SHADOW_DETAIL_VERTICAL" value="0">
+ </constant>
+ <constant name="SHADOW_DETAIL_HORIZONTAL" value="1">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/PhysicsServer.xml b/doc/classes/PhysicsServer.xml
index 93a50eb1bf..0076625ebd 100644
--- a/doc/classes/PhysicsServer.xml
+++ b/doc/classes/PhysicsServer.xml
@@ -1248,5 +1248,29 @@
</constant>
<constant name="INFO_ISLAND_COUNT" value="2">
</constant>
+ <constant name="SPACE_PARAM_CONTACT_RECYCLE_RADIUS" value="0">
+ </constant>
+ <constant name="SPACE_PARAM_CONTACT_MAX_SEPARATION" value="1">
+ </constant>
+ <constant name="SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION" value="2">
+ </constant>
+ <constant name="SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD" value="3">
+ </constant>
+ <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD" value="4">
+ </constant>
+ <constant name="SPACE_PARAM_BODY_TIME_TO_SLEEP" value="5">
+ </constant>
+ <constant name="SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO" value="6">
+ </constant>
+ <constant name="SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS" value="7">
+ </constant>
+ <constant name="BODY_AXIS_LOCK_DISABLED" value="0">
+ </constant>
+ <constant name="BODY_AXIS_LOCK_X" value="1">
+ </constant>
+ <constant name="BODY_AXIS_LOCK_Y" value="2">
+ </constant>
+ <constant name="BODY_AXIS_LOCK_Z" value="3">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Reference.xml b/doc/classes/Reference.xml
index a8ca4cde0c..2531ea88ad 100644
--- a/doc/classes/Reference.xml
+++ b/doc/classes/Reference.xml
@@ -18,7 +18,7 @@
</description>
</method>
<method name="reference">
- <return type="void">
+ <return type="bool">
</return>
<description>
Increase the internal reference counter. Use this only if you really know what you are doing.
diff --git a/doc/classes/RigidBody.xml b/doc/classes/RigidBody.xml
index 446c6d14cb..fc9d241e35 100644
--- a/doc/classes/RigidBody.xml
+++ b/doc/classes/RigidBody.xml
@@ -437,5 +437,13 @@
<constant name="MODE_CHARACTER" value="2">
Character body. This behaves like a rigid body, but can not rotate.
</constant>
+ <constant name="AXIS_LOCK_DISABLED" value="0">
+ </constant>
+ <constant name="AXIS_LOCK_X" value="1">
+ </constant>
+ <constant name="AXIS_LOCK_Y" value="2">
+ </constant>
+ <constant name="AXIS_LOCK_Z" value="3">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Spatial.xml b/doc/classes/Spatial.xml
index 076d0b9bc3..e43e4dcc1b 100644
--- a/doc/classes/Spatial.xml
+++ b/doc/classes/Spatial.xml
@@ -4,7 +4,7 @@
Most basic 3D game object, parent of all 3D related nodes.
</brief_description>
<description>
- Most basic 3D game object, with a 3D [Transform] and visibility settings. All 3D physics nodes and sprites inherit from Spatial. Use Spatial as a parent node to move, scale, rotate and show/hide children in a 3D project.
+ Most basic 3D game object, with a 3D [Transform] and visibility settings. All other 3D game objects inherit from Spatial. Use Spatial as a parent node to move, scale, rotate and show/hide children in a 3D project.
</description>
<tutorials>
</tutorials>
@@ -15,35 +15,35 @@
<return type="SpatialGizmo">
</return>
<description>
- Return the SpatialGizmo for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor.
+ Returns the SpatialGizmo for this node. Used for example in [EditorSpatialGizmo] as custom visualization and editing handles in Editor.
</description>
</method>
<method name="get_global_transform" qualifiers="const">
<return type="Transform">
</return>
<description>
- Return the global transform, relative to worldspace.
+ Returns the global transform, relative to worldspace.
</description>
</method>
<method name="get_parent_spatial" qualifiers="const">
<return type="Spatial">
</return>
<description>
- Return the parent [Spatial], or an empty [Object] if no parent exists or parent is not of type [Spatial].
+ Returns the parent [Spatial], or an empty [Object] if no parent exists or parent is not of type [Spatial].
</description>
</method>
<method name="get_rotation" qualifiers="const">
<return type="Vector3">
</return>
<description>
- Return the rotation (in radians).
+ Returns the rotation (in radians).
</description>
</method>
<method name="get_rotation_deg" qualifiers="const">
<return type="Vector3">
</return>
<description>
- Return the rotation (in degrees).
+ Returns the rotation (in degrees).
</description>
</method>
<method name="get_scale" qualifiers="const">
@@ -56,7 +56,7 @@
<return type="Transform">
</return>
<description>
- Return the local transform, relative to the bone parent.
+ Returns the local transform, relative to the bone parent.
</description>
</method>
<method name="get_translation" qualifiers="const">
@@ -69,7 +69,7 @@
<return type="World">
</return>
<description>
- Return current [World] resource this Spatial node is registered to.
+ Returns the current [World] resource this Spatial node is registered to.
</description>
</method>
<method name="global_rotate">
@@ -80,7 +80,7 @@
<argument index="1" name="radians" type="float">
</argument>
<description>
- Rotate current node along normal [Vector3] by angle in radians in Global space.
+ Rotates the current node along normal [Vector3] by angle in radians in Global space.
</description>
</method>
<method name="global_translate">
@@ -89,49 +89,49 @@
<argument index="0" name="offset" type="Vector3">
</argument>
<description>
- Move current node by [Vector3] offset in Global space.
+ Moves the node by [Vector3] offset in Global space.
</description>
</method>
<method name="hide">
<return type="void">
</return>
<description>
- Disable rendering of this node. Change Spatial Visible property to false.
+ Disables rendering of this node. Change Spatial Visible property to false.
</description>
</method>
<method name="is_local_transform_notification_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns whether node sends notification that its local transformation changed. Spatial will not propagate this by default.
+ Returns whether node notifies about its local transformation changes. Spatial will not propagate this by default.
</description>
</method>
<method name="is_set_as_toplevel" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns whether this node is set as Toplevel, ignoring its parent node transformations.
+ Returns whether this node is set as Toplevel, that is whether it ignores its parent nodes transformations.
</description>
</method>
<method name="is_transform_notification_enabled" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns whether node sends notification that its transformation changed. Spatial will not propagate this by default.
+ Returns whether the node notifies about its global and local transformation changes. Spatial will not propagate this by default.
</description>
</method>
<method name="is_visible" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns whether this node is set to be visible.
+ Returns whether the node is set to be visible.
</description>
</method>
<method name="is_visible_in_tree" qualifiers="const">
<return type="bool">
</return>
<description>
- Returns whether this node is visible, taking into consideration that its parents visibility.
+ Returns whether the node is visible, taking into consideration that its parents visibility.
</description>
</method>
<method name="look_at">
@@ -155,14 +155,14 @@
<argument index="2" name="up" type="Vector3">
</argument>
<description>
- Moves itself to specified position and then rotates itself to point into direction of target position. Operations take place in global space.
+ Moves the node to specified position and then rotates itself to point into direction of target position. Operations take place in global space.
</description>
</method>
<method name="orthonormalize">
<return type="void">
</return>
<description>
- Reset this node transformations (like scale, skew and taper) preserving its rotation and translation. Performs orthonormalization on this node [Transform3D].
+ Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation. Performs orthonormalization on this node [Transform3D].
</description>
</method>
<method name="rotate">
@@ -173,7 +173,7 @@
<argument index="1" name="radians" type="float">
</argument>
<description>
- Rotates node in local space on given normal [Vector3] by angle in radians.
+ Rotates the node in local space on given normal [Vector3] by angle in radians.
</description>
</method>
<method name="rotate_x">
@@ -182,7 +182,7 @@
<argument index="0" name="radians" type="float">
</argument>
<description>
- Rotates node in local space on X axis by angle in radians.
+ Rotates the node in local space on X axis by angle in radians.
</description>
</method>
<method name="rotate_y">
@@ -191,7 +191,7 @@
<argument index="0" name="radians" type="float">
</argument>
<description>
- Rotates node in local space on Y axis by angle in radians.
+ Rotates the node in local space on Y axis by angle in radians.
</description>
</method>
<method name="rotate_z">
@@ -200,7 +200,7 @@
<argument index="0" name="radians" type="float">
</argument>
<description>
- Rotates node in local space on Z axis by angle in radians.
+ Rotates the node in local space on Z axis by angle in radians.
</description>
</method>
<method name="set_as_toplevel">
@@ -209,7 +209,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Makes this node ignore its parents tranformations. Node tranformations are only in global space.
+ Makes the node ignore its parents tranformations. Node tranformations are only in global space.
</description>
</method>
<method name="set_gizmo">
@@ -243,7 +243,7 @@
<argument index="0" name="enabled" type="bool">
</argument>
<description>
- Set whether this node ignores notification that its transformation changed.
+ Set whether the node ignores notification that its transformation (global or local) changed.
</description>
</method>
<method name="set_notify_local_transform">
@@ -252,7 +252,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Set whether this node sends notification that its local transformation changed. Spatial will not propagate this by default.
+ Set whether the node notifies about its local transformation changes. Spatial will not propagate this by default.
</description>
</method>
<method name="set_notify_transform">
@@ -261,7 +261,7 @@
<argument index="0" name="enable" type="bool">
</argument>
<description>
- Set whether this node sends notification that its transformation changed. Spatial will not propagate this by default.
+ Set whether the node notifies about its global and local transformation changes. Spatial will not propagate this by default.
</description>
</method>
<method name="set_rotation">
@@ -320,7 +320,7 @@
<return type="void">
</return>
<description>
- Enable rendering of this node. Change Spatial Visible property to false.
+ Enables rendering of this node. Change Spatial Visible property to "True".
</description>
</method>
<method name="to_global" qualifiers="const">
@@ -329,7 +329,7 @@
<argument index="0" name="local_point" type="Vector3">
</argument>
<description>
- Tranform [Vector3] from this node local space to world space.
+ Tranforms [Vector3] "local_point" from this node's local space to world space.
</description>
</method>
<method name="to_local" qualifiers="const">
@@ -338,7 +338,7 @@
<argument index="0" name="global_point" type="Vector3">
</argument>
<description>
- Tranform [Vector3] from world space to this node local space.
+ Tranforms [Vector3] "global_point" from world space to this node's local space.
</description>
</method>
<method name="translate">
@@ -347,14 +347,14 @@
<argument index="0" name="offset" type="Vector3">
</argument>
<description>
- Change node position by given offset [Vector3].
+ Changes the node's position by given offset [Vector3].
</description>
</method>
<method name="update_gizmo">
<return type="void">
</return>
<description>
- Update [SpatialGizmo] of this node.
+ Updates the [SpatialGizmo] of this node.
</description>
</method>
</methods>
@@ -384,23 +384,23 @@
<signals>
<signal name="visibility_changed">
<description>
- Emitted when node visibility changed.
+ Emitted when node visibility changes.
</description>
</signal>
</signals>
<constants>
<constant name="NOTIFICATION_TRANSFORM_CHANGED" value="29" enum="">
- Spatial nodes receive this notification when their global transform changes. This means that either the current or a parent node changed its transform.
+ Spatial nodes receives this notification when their global transform changes. This means that either the current or a parent node changed its transform.
In order for NOTIFICATION_TRANSFORM_CHANGED to work user first needs to ask for it, with set_notify_transform(true).
</constant>
<constant name="NOTIFICATION_ENTER_WORLD" value="41" enum="">
- Spatial nodes receive this notification when they are registered to new [World] resource.
+ Spatial nodes receives this notification when they are registered to new [World] resource.
</constant>
<constant name="NOTIFICATION_EXIT_WORLD" value="42" enum="">
- Spatial nodes receive this notification when they are unregistered from current [World] resource.
+ Spatial nodes receives this notification when they are unregistered from current [World] resource.
</constant>
<constant name="NOTIFICATION_VISIBILITY_CHANGED" value="43" enum="">
- Spatial nodes receive this notification when their visibility changes.
+ Spatial nodes receives this notification when their visibility changes.
</constant>
</constants>
</class>
diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml
index f96b31262c..ffe99eb82b 100644
--- a/doc/classes/TabContainer.xml
+++ b/doc/classes/TabContainer.xml
@@ -190,6 +190,12 @@
</signal>
</signals>
<constants>
+ <constant name="ALIGN_LEFT" value="0">
+ </constant>
+ <constant name="ALIGN_CENTER" value="1">
+ </constant>
+ <constant name="ALIGN_RIGHT" value="2">
+ </constant>
</constants>
<theme_items>
<theme_item name="decrement" type="Texture">
diff --git a/doc/classes/TextureProgress.xml b/doc/classes/TextureProgress.xml
index 1ac031c411..0a6ffcdeb8 100644
--- a/doc/classes/TextureProgress.xml
+++ b/doc/classes/TextureProgress.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="TextureProgress" inherits="Range" category="Core" version="3.0.alpha.custom_build">
<brief_description>
- Textured progress bar implementation.
+ Textured progress bar.
</brief_description>
<description>
- [ProgressBar] implementation that is easier to theme (by just passing a few textures).
+ A [ProgressBar] that uses textures to display fill percentage. Can be set to linear or radial mode.
</description>
<tutorials>
</tutorials>
@@ -148,28 +148,40 @@
</methods>
<members>
<member name="fill_mode" type="int" setter="set_fill_mode" getter="get_fill_mode">
+ The fill direction. Uses FILL_* constants.
</member>
<member name="nine_patch_stretch" type="bool" setter="set_nine_patch_stretch" getter="get_nine_patch_stretch">
+ If [code]true[/code] textures will be stretched as [NinePatchRect]. Uses [code]stretch_margin[/code] properties (see below). Default value: [code]false[/code]
</member>
<member name="radial_center_offset" type="Vector2" setter="set_radial_center_offset" getter="get_radial_center_offset">
+ The offset amount for radial mode.
</member>
<member name="radial_fill_degrees" type="float" setter="set_fill_degrees" getter="get_fill_degrees">
+ The amount of the texture to use for radial mode.
</member>
<member name="radial_initial_angle" type="float" setter="set_radial_initial_angle" getter="get_radial_initial_angle">
+ Start angle for radial mode.
</member>
<member name="stretch_margin_bottom" type="int" setter="set_stretch_margin" getter="get_stretch_margin">
+ Nine-patch texture offset for bottom margin.
</member>
<member name="stretch_margin_left" type="int" setter="set_stretch_margin" getter="get_stretch_margin">
+ Nine-patch texture offset for left margin.
</member>
<member name="stretch_margin_right" type="int" setter="set_stretch_margin" getter="get_stretch_margin">
+ Nine-patch texture offset for right margin.
</member>
<member name="stretch_margin_top" type="int" setter="set_stretch_margin" getter="get_stretch_margin">
+ Nine-patch texture offset for top margin.
</member>
<member name="texture_over" type="Texture" setter="set_over_texture" getter="get_over_texture">
+ The [Texture] that will be drawn over the progress bar.
</member>
<member name="texture_progress" type="Texture" setter="set_progress_texture" getter="get_progress_texture">
+ The [Texture] used to display [code]value[/code].
</member>
<member name="texture_under" type="Texture" setter="set_under_texture" getter="get_under_texture">
+ The [Texture] that will be drawn under the progress bar.
</member>
</members>
<constants>
diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml
index 6d137cb14c..af5626ae84 100644
--- a/doc/classes/TextureRect.xml
+++ b/doc/classes/TextureRect.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="TextureRect" inherits="Control" category="Core" version="3.0.alpha.custom_build">
<brief_description>
- Control that draws a texture.
+ Draws a sprite or a texture inside a User Interface. The texture can tile or not.
</brief_description>
<description>
- Control that draws a texture.
+ Use TextureRect to draw icons and sprites in your User Interfaces. To create panels and menu boxes, take a look at [NinePatchFrame]. Its Stretch Mode property controls the texture's scale and placement. It can scale, tile and stay centered inside its bounding rectangle. TextureRect is one of the 5 most common nodes to create game UI.
</description>
<tutorials>
</tutorials>
@@ -56,31 +56,39 @@
</methods>
<members>
<member name="expand" type="bool" setter="set_expand" getter="has_expand">
- If [code]true[/code] texture will expand to fit. Default value: [code]false[/code].
+ If [code]true[/code], the texture scales to fit its bounding rectangle. Default value: [code]false[/code].
</member>
<member name="stretch_mode" type="int" setter="set_stretch_mode" getter="get_stretch_mode" enum="TextureRect.StretchMode">
- Stretch mode of the texture. Use STRETCH_* constants as value.
+ Controls the texture's behavior when you resize the node's bounding rectangle. Set it to one of the [code]STRETCH_*[/code] constants. See the constants to learn more.
</member>
<member name="texture" type="Texture" setter="set_texture" getter="get_texture">
- The [Texture] resource for the node.
+ The node's [Texture] resource.
</member>
</members>
<constants>
<constant name="STRETCH_SCALE_ON_EXPAND" value="0">
+ Scale to fit the node's bounding rectangle, only if [code]expand[/code] is [code]true[/code]. Default [code]stretch_mode[/code], for backwards compatibility. Until you set [code]expand[/code] to [code]true[/code], the texture will behave like [code]STRETCH_KEEP[/code].
</constant>
<constant name="STRETCH_SCALE" value="1">
+ Scale to fit the node's bounding rectangle.
</constant>
<constant name="STRETCH_TILE" value="2">
+ Tile inside the node's bounding rectangle.
</constant>
<constant name="STRETCH_KEEP" value="3">
+ The texture keeps its original size and stays in the bounding rectangle's top-left corner.
</constant>
<constant name="STRETCH_KEEP_CENTERED" value="4">
+ The texture keeps its original size and stays centered in the node's bounding rectangle.
</constant>
<constant name="STRETCH_KEEP_ASPECT" value="5">
+ Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio.
</constant>
<constant name="STRETCH_KEEP_ASPECT_CENTERED" value="6">
+ Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect ratio.
</constant>
<constant name="STRETCH_KEEP_ASPECT_COVERED" value="7">
+ Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits.
</constant>
</constants>
</class>
diff --git a/doc/classes/TouchScreenButton.xml b/doc/classes/TouchScreenButton.xml
index bf8af20da9..8a96fa1454 100644
--- a/doc/classes/TouchScreenButton.xml
+++ b/doc/classes/TouchScreenButton.xml
@@ -173,5 +173,9 @@
</signal>
</signals>
<constants>
+ <constant name="VISIBILITY_ALWAYS" value="0">
+ </constant>
+ <constant name="VISIBILITY_TOUCHSCREEN_ONLY" value="1">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Transform.xml b/doc/classes/Transform.xml
index d632eee70a..6780de1943 100644
--- a/doc/classes/Transform.xml
+++ b/doc/classes/Transform.xml
@@ -23,7 +23,7 @@
<argument index="3" name="origin" type="Vector3">
</argument>
<description>
- Construct the Transform from four [Vector3]. Each axis corresponds to local basis vectors (some of which may be scaled).
+ Constructs the Transform from four [Vector3]. Each axis corresponds to local basis vectors (some of which may be scaled).
</description>
</method>
<method name="Transform">
@@ -34,7 +34,7 @@
<argument index="1" name="origin" type="Vector3">
</argument>
<description>
- Construct the Transform from a [Basis] and [Vector3].
+ Constructs the Transform from a [Basis] and [Vector3].
</description>
</method>
<method name="Transform">
@@ -43,7 +43,7 @@
<argument index="0" name="from" type="Transform2D">
</argument>
<description>
- Construct the Transform from a [Transform2D].
+ Constructs the Transform from a [Transform2D].
</description>
</method>
<method name="Transform">
@@ -52,7 +52,7 @@
<argument index="0" name="from" type="Quat">
</argument>
<description>
- Construct the Transform from a [Quat]. The origin will be Vector3(0, 0, 0).
+ Constructs the Transform from a [Quat]. The origin will be Vector3(0, 0, 0).
</description>
</method>
<method name="Transform">
@@ -61,7 +61,7 @@
<argument index="0" name="from" type="Basis">
</argument>
<description>
- Construct the Transform from a [Basis]. The origin will be Vector3(0, 0, 0).
+ Constructs the Transform from a [Basis]. The origin will be Vector3(0, 0, 0).
</description>
</method>
<method name="affine_inverse">
@@ -79,7 +79,7 @@
<argument index="1" name="weight" type="float">
</argument>
<description>
- Interpolate to other Transform by weight amount (0-1).
+ Interpolates the transform to other Transform by weight amount (0-1).
</description>
</method>
<method name="inverse">
@@ -104,7 +104,7 @@
<return type="Transform">
</return>
<description>
- Returns a transfrom with the basis orthogonal (90 degrees), and normalized axis vectors.
+ Returns the transfrom with the basis orthogonal (90 degrees), and normalized axis vectors.
</description>
</method>
<method name="rotated">
@@ -115,7 +115,7 @@
<argument index="1" name="phi" type="float">
</argument>
<description>
- Rotate the transform around given axis by phi. The axis must be a normalized vector.
+ Rotates the transform around given axis by phi. The axis must be a normalized vector.
</description>
</method>
<method name="scaled">
@@ -124,7 +124,7 @@
<argument index="0" name="scale" type="Vector3">
</argument>
<description>
- Scale the transform by the specified 3D scaling factors.
+ Scales the transform by the specified 3D scaling factors.
</description>
</method>
<method name="translated">
@@ -133,7 +133,7 @@
<argument index="0" name="ofs" type="Vector3">
</argument>
<description>
- Translate the transform by the specified offset.
+ Translates the transform by the specified offset.
</description>
</method>
<method name="xform">
@@ -151,7 +151,7 @@
<argument index="0" name="v" type="var">
</argument>
<description>
- Inverse-transforms vector "v" by this transform.
+ Inverse-transforms the given vector "v" by this transform.
</description>
</method>
</methods>
diff --git a/doc/classes/Transform2D.xml b/doc/classes/Transform2D.xml
index b3b752c1da..4cbe9123f1 100644
--- a/doc/classes/Transform2D.xml
+++ b/doc/classes/Transform2D.xml
@@ -66,28 +66,28 @@
<argument index="0" name="v" type="var">
</argument>
<description>
- Inverse-transforms vector "v" by this transform basis (no translation).
+ Inverse-transforms the given vector "v" by this transform basis (no translation).
</description>
</method>
<method name="get_origin">
<return type="Vector2">
</return>
<description>
- Return the origin [Vector2] (translation).
+ Returns the origin [Vector2] (translation).
</description>
</method>
<method name="get_rotation">
<return type="float">
</return>
<description>
- Return the rotation (in radians).
+ Returns the rotation (in radians).
</description>
</method>
<method name="get_scale">
<return type="Vector2">
</return>
<description>
- Return the scale.
+ Returns the scale.
</description>
</method>
<method name="interpolate_with">
@@ -98,7 +98,7 @@
<argument index="1" name="weight" type="float">
</argument>
<description>
- Interpolate to other Transform2D by weight amount (0-1).
+ Interpolates the transform to other Transform2D by weight amount (0-1).
</description>
</method>
<method name="inverse">
@@ -112,7 +112,7 @@
<return type="Transform2D">
</return>
<description>
- Returns a transfrom with the basis orthogonal (90 degrees), and normalized axis vectors.
+ Returns the transfrom with the basis orthogonal (90 degrees), and normalized axis vectors.
</description>
</method>
<method name="rotated">
@@ -121,7 +121,7 @@
<argument index="0" name="phi" type="float">
</argument>
<description>
- Rotate the transform by phi.
+ Rotates the transform by phi.
</description>
</method>
<method name="scaled">
@@ -130,7 +130,7 @@
<argument index="0" name="scale" type="Vector2">
</argument>
<description>
- Scale the transform by the specified 2D scaling factors.
+ Scales the transform by the specified 2D scaling factors.
</description>
</method>
<method name="translated">
@@ -139,7 +139,7 @@
<argument index="0" name="offset" type="Vector2">
</argument>
<description>
- Translate the transform by the specified offset.
+ Translates the transform by the specified offset.
</description>
</method>
<method name="xform">
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index 02c264cbff..d1e45bd10f 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -545,5 +545,11 @@
</constant>
<constant name="CELL_MODE_CUSTOM" value="5">
</constant>
+ <constant name="ALIGN_LEFT" value="0">
+ </constant>
+ <constant name="ALIGN_CENTER" value="1">
+ </constant>
+ <constant name="ALIGN_RIGHT" value="2">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml
index c12ec86cbb..a5170b8d03 100644
--- a/doc/classes/Viewport.xml
+++ b/doc/classes/Viewport.xml
@@ -650,5 +650,19 @@
</constant>
<constant name="MSAA_16X" value="4">
</constant>
+ <constant name="USAGE_2D" value="0">
+ </constant>
+ <constant name="USAGE_2D_NO_SAMPLING" value="1">
+ </constant>
+ <constant name="USAGE_3D" value="2">
+ </constant>
+ <constant name="USAGE_3D_NO_EFFECTS" value="3">
+ </constant>
+ <constant name="CLEAR_MODE_ALWAYS" value="0">
+ </constant>
+ <constant name="CLEAR_MODE_NEVER" value="1">
+ </constant>
+ <constant name="CLEAR_MODE_ONLY_NEXT_FRAME" value="2">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/VisibilityNotifier.xml b/doc/classes/VisibilityNotifier.xml
index 4d76c7c927..816523fc27 100644
--- a/doc/classes/VisibilityNotifier.xml
+++ b/doc/classes/VisibilityNotifier.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisibilityNotifier" inherits="Spatial" category="Core" version="3.0.alpha.custom_build">
<brief_description>
- Detect when the node is visible on screen.
+ Detects when the node is visible on screen.
</brief_description>
<description>
- The VisibilityNotifier is used to notify when its bounding box enters the screen, is visible on the screen, or when it exits the screen.
+ The VisibilityNotifier detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a [Camera]'s view.
</description>
<tutorials>
</tutorials>
@@ -15,14 +15,14 @@
<return type="Rect3">
</return>
<description>
- Return the visibility bounding box of the VisibilityNotifier.
+ Returns the bounding box of the VisibilityNotifier.
</description>
</method>
<method name="is_on_screen" qualifiers="const">
<return type="bool">
</return>
<description>
- Return true if any part of the bounding box is on the screen.
+ If [code]true[/code] the bounding box is on the screen.
</description>
</method>
<method name="set_aabb">
@@ -37,6 +37,7 @@
</methods>
<members>
<member name="aabb" type="Rect3" setter="set_aabb" getter="get_aabb">
+ The VisibilityNotifier's bounding box.
</member>
</members>
<signals>
diff --git a/doc/classes/VisibilityNotifier2D.xml b/doc/classes/VisibilityNotifier2D.xml
index 1058e3d6d4..86227a0277 100644
--- a/doc/classes/VisibilityNotifier2D.xml
+++ b/doc/classes/VisibilityNotifier2D.xml
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisibilityNotifier2D" inherits="Node2D" category="Core" version="3.0.alpha.custom_build">
<brief_description>
- Detect when the node is visible on screen.
+ Detects when the node is visible on screen.
</brief_description>
<description>
- The VisibilityNotifier2D is used to notify when its bounding rectangle enters the screen, is visible on the screen, or when it exits the screen.
+ The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport.
</description>
<tutorials>
</tutorials>
@@ -15,14 +15,14 @@
<return type="Rect2">
</return>
<description>
- Return the visibility bounding rectangle of the VisibilityNotifier2D.
+ Returns the bounding rectangle of the VisibilityNotifier2D.
</description>
</method>
<method name="is_on_screen" qualifiers="const">
<return type="bool">
</return>
<description>
- Return true if any part of the bounding rectangle is on the screen.
+ If [code]true[/code] the bounding rectangle is on the screen.
</description>
</method>
<method name="set_rect">
@@ -37,6 +37,7 @@
</methods>
<members>
<member name="rect" type="Rect2" setter="set_rect" getter="get_rect">
+ The VisibilityNotifier2D's bounding rectangle.
</member>
</members>
<signals>
diff --git a/doc/classes/VisualScriptBuiltinFunc.xml b/doc/classes/VisualScriptBuiltinFunc.xml
index eb9af69ea9..a88633749e 100644
--- a/doc/classes/VisualScriptBuiltinFunc.xml
+++ b/doc/classes/VisualScriptBuiltinFunc.xml
@@ -29,5 +29,121 @@
</member>
</members>
<constants>
+ <constant name="MATH_SIN" value="0">
+ </constant>
+ <constant name="MATH_COS" value="1">
+ </constant>
+ <constant name="MATH_TAN" value="2">
+ </constant>
+ <constant name="MATH_SINH" value="3">
+ </constant>
+ <constant name="MATH_COSH" value="4">
+ </constant>
+ <constant name="MATH_TANH" value="5">
+ </constant>
+ <constant name="MATH_ASIN" value="6">
+ </constant>
+ <constant name="MATH_ACOS" value="7">
+ </constant>
+ <constant name="MATH_ATAN" value="8">
+ </constant>
+ <constant name="MATH_ATAN2" value="9">
+ </constant>
+ <constant name="MATH_SQRT" value="10">
+ </constant>
+ <constant name="MATH_FMOD" value="11">
+ </constant>
+ <constant name="MATH_FPOSMOD" value="12">
+ </constant>
+ <constant name="MATH_FLOOR" value="13">
+ </constant>
+ <constant name="MATH_CEIL" value="14">
+ </constant>
+ <constant name="MATH_ROUND" value="15">
+ </constant>
+ <constant name="MATH_ABS" value="16">
+ </constant>
+ <constant name="MATH_SIGN" value="17">
+ </constant>
+ <constant name="MATH_POW" value="18">
+ </constant>
+ <constant name="MATH_LOG" value="19">
+ </constant>
+ <constant name="MATH_EXP" value="20">
+ </constant>
+ <constant name="MATH_ISNAN" value="21">
+ </constant>
+ <constant name="MATH_ISINF" value="22">
+ </constant>
+ <constant name="MATH_EASE" value="23">
+ </constant>
+ <constant name="MATH_DECIMALS" value="24">
+ </constant>
+ <constant name="MATH_STEPIFY" value="25">
+ </constant>
+ <constant name="MATH_LERP" value="26">
+ </constant>
+ <constant name="MATH_DECTIME" value="27">
+ </constant>
+ <constant name="MATH_RANDOMIZE" value="28">
+ </constant>
+ <constant name="MATH_RAND" value="29">
+ </constant>
+ <constant name="MATH_RANDF" value="30">
+ </constant>
+ <constant name="MATH_RANDOM" value="31">
+ </constant>
+ <constant name="MATH_SEED" value="32">
+ </constant>
+ <constant name="MATH_RANDSEED" value="33">
+ </constant>
+ <constant name="MATH_DEG2RAD" value="34">
+ </constant>
+ <constant name="MATH_RAD2DEG" value="35">
+ </constant>
+ <constant name="MATH_LINEAR2DB" value="36">
+ </constant>
+ <constant name="MATH_DB2LINEAR" value="37">
+ </constant>
+ <constant name="LOGIC_MAX" value="38">
+ </constant>
+ <constant name="LOGIC_MIN" value="39">
+ </constant>
+ <constant name="LOGIC_CLAMP" value="40">
+ </constant>
+ <constant name="LOGIC_NEAREST_PO2" value="41">
+ </constant>
+ <constant name="OBJ_WEAKREF" value="42">
+ </constant>
+ <constant name="FUNC_FUNCREF" value="43">
+ </constant>
+ <constant name="TYPE_CONVERT" value="44">
+ </constant>
+ <constant name="TYPE_OF" value="45">
+ </constant>
+ <constant name="TYPE_EXISTS" value="46">
+ </constant>
+ <constant name="TEXT_CHAR" value="47">
+ </constant>
+ <constant name="TEXT_STR" value="48">
+ </constant>
+ <constant name="TEXT_PRINT" value="49">
+ </constant>
+ <constant name="TEXT_PRINTERR" value="50">
+ </constant>
+ <constant name="TEXT_PRINTRAW" value="51">
+ </constant>
+ <constant name="VAR_TO_STR" value="52">
+ </constant>
+ <constant name="STR_TO_VAR" value="53">
+ </constant>
+ <constant name="VAR_TO_BYTES" value="54">
+ </constant>
+ <constant name="BYTES_TO_VAR" value="55">
+ </constant>
+ <constant name="COLORN" value="56">
+ </constant>
+ <constant name="FUNC_MAX" value="57">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/VisualScriptFunctionCall.xml b/doc/classes/VisualScriptFunctionCall.xml
index 9a56831253..36c808afce 100644
--- a/doc/classes/VisualScriptFunctionCall.xml
+++ b/doc/classes/VisualScriptFunctionCall.xml
@@ -183,5 +183,17 @@
</constant>
<constant name="CALL_MODE_BASIC_TYPE" value="3">
</constant>
+ <constant name="CALL_MODE_SINGLETON" value="4">
+ </constant>
+ <constant name="RPC_DISABLED" value="0">
+ </constant>
+ <constant name="RPC_RELIABLE" value="1">
+ </constant>
+ <constant name="RPC_UNRELIABLE" value="2">
+ </constant>
+ <constant name="RPC_RELIABLE_TO_ID" value="3">
+ </constant>
+ <constant name="RPC_UNRELIABLE_TO_ID" value="4">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/VisualScriptInputAction.xml b/doc/classes/VisualScriptInputAction.xml
index b0f7827024..b555a0228b 100644
--- a/doc/classes/VisualScriptInputAction.xml
+++ b/doc/classes/VisualScriptInputAction.xml
@@ -45,5 +45,13 @@
</member>
</members>
<constants>
+ <constant name="MODE_PRESSED" value="0">
+ </constant>
+ <constant name="MODE_RELEASED" value="1">
+ </constant>
+ <constant name="MODE_JUST_PRESSED" value="2">
+ </constant>
+ <constant name="MODE_JUST_RELEASED" value="3">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/VisualScriptMathConstant.xml b/doc/classes/VisualScriptMathConstant.xml
index 8e0436edfa..1ef7d71e10 100644
--- a/doc/classes/VisualScriptMathConstant.xml
+++ b/doc/classes/VisualScriptMathConstant.xml
@@ -29,5 +29,23 @@
</member>
</members>
<constants>
+ <constant name="MATH_CONSTANT_ONE" value="0">
+ </constant>
+ <constant name="MATH_CONSTANT_PI" value="1">
+ </constant>
+ <constant name="MATH_CONSTANT_2PI" value="2">
+ </constant>
+ <constant name="MATH_CONSTANT_HALF_PI" value="3">
+ </constant>
+ <constant name="MATH_CONSTANT_E" value="4">
+ </constant>
+ <constant name="MATH_CONSTANT_SQRT2" value="5">
+ </constant>
+ <constant name="MATH_CONSTANT_INF" value="6">
+ </constant>
+ <constant name="MATH_CONSTANT_NAN" value="7">
+ </constant>
+ <constant name="MATH_CONSTANT_MAX" value="8">
+ </constant>
</constants>
</class>
diff --git a/doc/classes/VisualScriptPropertySet.xml b/doc/classes/VisualScriptPropertySet.xml
index a129cc36f8..88d47a7463 100644
--- a/doc/classes/VisualScriptPropertySet.xml
+++ b/doc/classes/VisualScriptPropertySet.xml
@@ -149,5 +149,29 @@
</constant>
<constant name="CALL_MODE_INSTANCE" value="2">
</constant>
+ <constant name="CALL_MODE_BASIC_TYPE" value="3">
+ </constant>
+ <constant name="ASSIGN_OP_NONE" value="0">
+ </constant>
+ <constant name="ASSIGN_OP_ADD" value="1">
+ </constant>
+ <constant name="ASSIGN_OP_SUB" value="2">
+ </constant>
+ <constant name="ASSIGN_OP_MUL" value="3">
+ </constant>
+ <constant name="ASSIGN_OP_DIV" value="4">
+ </constant>
+ <constant name="ASSIGN_OP_MOD" value="5">
+ </constant>
+ <constant name="ASSIGN_OP_SHIFT_LEFT" value="6">
+ </constant>
+ <constant name="ASSIGN_OP_SHIFT_RIGHT" value="7">
+ </constant>
+ <constant name="ASSIGN_OP_BIT_AND" value="8">
+ </constant>
+ <constant name="ASSIGN_OP_BIT_OR" value="9">
+ </constant>
+ <constant name="ASSIGN_OP_BIT_XOR" value="10">
+ </constant>
</constants>
</class>
diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py
index 1386e91ce1..6b6b794f11 100644
--- a/doc/tools/doc_status.py
+++ b/doc/tools/doc_status.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
+import os
import sys
import re
import math
@@ -220,6 +221,21 @@ class ClassStatus:
def generate_for_class(c):
status = ClassStatus()
status.name = c.attrib['name']
+
+ # setgets do not count
+ methods = []
+ for tag in list(c):
+ if tag.tag in ['methods']:
+ for sub_tag in list(tag):
+ methods.append(sub_tag.find('name'))
+ if tag.tag in ['members']:
+ for sub_tag in list(tag):
+ try:
+ methods.remove(sub_tag.find('setter'))
+ methods.remove(sub_tag.find('getter'))
+ except:
+ pass
+
for tag in list(c):
if tag.tag == 'brief_description':
@@ -230,13 +246,16 @@ class ClassStatus:
elif tag.tag in ['methods', 'signals']:
for sub_tag in list(tag):
- descr = sub_tag.find('description')
- status.progresses[tag.tag].increment(len(descr.text.strip()) > 0)
-
+ if sub_tag.find('name') in methods or tag.tag == 'signals':
+ descr = sub_tag.find('description')
+ status.progresses[tag.tag].increment(len(descr.text.strip()) > 0)
elif tag.tag in ['constants', 'members']:
for sub_tag in list(tag):
status.progresses[tag.tag].increment(len(sub_tag.text.strip()) > 0)
+ elif tag.tag in ['tutorials', 'demos']:
+ pass # Ignore those tags for now
+
elif tag.tag in ['theme_items']:
pass # Ignore those tags, since they seem to lack description at all
@@ -252,6 +271,7 @@ class ClassStatus:
input_file_list = []
input_class_list = []
+merged_file = ""
for arg in sys.argv[1:]:
if arg.startswith('--'):
@@ -259,8 +279,10 @@ for arg in sys.argv[1:]:
elif arg.startswith('-'):
for f in arg[1:]:
flags[f] = not flags[f]
- elif arg.endswith('.xml'):
- input_file_list.append(arg)
+ elif os.path.isdir(arg):
+ for f in os.listdir(arg):
+ if f.endswith('.xml'):
+ input_file_list.append(os.path.join(arg, f));
else:
input_class_list.append(arg)
@@ -287,10 +309,9 @@ if flags['u']:
if len(input_file_list) < 1 or flags['h']:
if not flags['h']:
- print(color('section', 'Invalid usage') + ': At least one classes.xml file is required')
- print(color('section', 'Usage') + ': doc_status.py [flags] <classes.xml> [class names]')
+ print(color('section', 'Invalid usage') + ': Please specify a classes directory')
+ print(color('section', 'Usage') + ': doc_status.py [flags] <classes_dir> [class names]')
print('\t< and > signify required parameters, while [ and ] signify optional parameters.')
- print('\tNote that you can give more than one classes file, in which case they will be merged on-the-fly.')
print(color('section', 'Available flags') + ':')
possible_synonym_list = list(long_flags)
possible_synonym_list.sort()
@@ -327,11 +348,10 @@ for file in input_file_list:
version = doc.attrib['version']
- for c in list(doc):
- if c.attrib['name'] in class_names:
- continue
- class_names.append(c.attrib['name'])
- classes[c.attrib['name']] = c
+ if doc.attrib['name'] in class_names:
+ continue
+ class_names.append(doc.attrib['name'])
+ classes[doc.attrib['name']] = doc
class_names.sort()
@@ -344,7 +364,7 @@ if len(input_class_list) < 1:
################################################################################
table = [table_column_names]
-table_row_chars = '+- '
+table_row_chars = '| - '
table_column_chars = '|'
total_status = ClassStatus('Total')
@@ -406,7 +426,7 @@ for row in table:
divider_string = table_row_chars[0]
for cell_i in range(len(table[0])):
- divider_string += table_row_chars[1] * (table_column_sizes[cell_i] + 2) + table_row_chars[0]
+ divider_string += table_row_chars[1] + table_row_chars[2] * (table_column_sizes[cell_i]) + table_row_chars[1] + table_row_chars[0]
print(divider_string)
for row_i, row in enumerate(table):
@@ -414,9 +434,9 @@ for row_i, row in enumerate(table):
for cell_i, cell in enumerate(row):
padding_needed = table_column_sizes[cell_i] - nonescape_len(cell) + 2
if cell_i == 0:
- row_string += table_row_chars[2] + cell + table_row_chars[2] * (padding_needed - 1)
+ row_string += table_row_chars[3] + cell + table_row_chars[3] * (padding_needed - 1)
else:
- row_string += table_row_chars[2] * math.floor(padding_needed / 2) + cell + table_row_chars[2] * math.ceil((padding_needed / 2))
+ row_string += table_row_chars[3] * math.floor(padding_needed / 2) + cell + table_row_chars[3] * math.ceil((padding_needed / 2))
row_string += table_column_chars
print(row_string)
diff --git a/editor/SCsub b/editor/SCsub
index 839d8e74c1..315865ad32 100644
--- a/editor/SCsub
+++ b/editor/SCsub
@@ -41,7 +41,7 @@ def make_doc_header(target, source, env):
src = s.srcnode().abspath
f = open_utf8(src, "r")
content = f.read()
- buf+=content
+ buf+=content
buf = encode_utf8(docbegin + buf + docend)
decomp_size = len(buf)
@@ -385,13 +385,13 @@ def make_license_header(target, source, env):
def _make_doc_data_class_path(to_path):
- g = open_utf8(os.path.join(to_path,"doc_data_class_path.gen.h"), "wb")
+ g = open_utf8(os.path.join(to_path,"doc_data_class_path.gen.h"), "w")
g.write("static const int _doc_data_class_path_count="+str(len(env.doc_class_path))+";\n")
g.write("struct _DocDataClassPath { const char* name; const char* path; };\n")
g.write("static const _DocDataClassPath _doc_data_class_paths["+str(len(env.doc_class_path)+1)+"]={\n");
for c in env.doc_class_path:
- g.write("{\""+c+"\",\""+env.doc_class_path[c]+"\"},\n")
+ g.write("{\""+c+"\",\""+env.doc_class_path[c]+"\"},\n")
g.write("{NULL,NULL}\n")
g.write("};\n")
@@ -414,7 +414,7 @@ if (env["tools"] == "yes"):
docs=[]
print("cdir is: "+env.Dir('#').abspath)
for f in os.listdir(os.path.join(env.Dir('#').abspath,"doc/classes")):
- docs.append("#doc/classes/"+f)
+ docs.append("#doc/classes/"+f)
_make_doc_data_class_path(os.path.join(env.Dir('#').abspath,"editor/doc"))
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp
index 272a5af59b..d35dc53ae1 100644
--- a/editor/doc/doc_data.cpp
+++ b/editor/doc/doc_data.cpp
@@ -170,6 +170,8 @@ static void return_doc_from_retinfo(DocData::MethodDoc &p_method, const Property
if (p_retinfo.type == Variant::INT && p_retinfo.usage & PROPERTY_USAGE_CLASS_IS_ENUM) {
p_method.return_enum = p_retinfo.class_name;
+ if (p_method.return_enum.begins_with("_")) //proxy class
+ p_method.return_enum = p_method.return_enum.substr(1, p_method.return_enum.length());
p_method.return_type = "int";
} else if (p_retinfo.class_name != StringName()) {
p_method.return_type = p_retinfo.class_name;
@@ -190,6 +192,8 @@ static void argument_doc_from_arginfo(DocData::ArgumentDoc &p_argument, const Pr
if (p_arginfo.type == Variant::INT && p_arginfo.usage & PROPERTY_USAGE_CLASS_IS_ENUM) {
p_argument.enumeration = p_arginfo.class_name;
+ if (p_argument.enumeration.begins_with("_")) //proxy class
+ p_argument.enumeration = p_argument.enumeration.substr(1, p_argument.enumeration.length());
p_argument.type = "int";
} else if (p_arginfo.class_name != StringName()) {
p_argument.type = p_arginfo.class_name;
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 8623b9acdb..d08a595fd2 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -476,19 +476,77 @@ void EditorExportPlatform::_edit_filter_list(Set<String> &r_list, const String &
memdelete(da);
}
-Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata) {
+void EditorExportPlugin::add_file(const String &p_path, const Vector<uint8_t> &p_file, bool p_remap) {
+
+ ExtraFile ef;
+ ef.data = p_file;
+ ef.path = p_path;
+ ef.remap = p_remap;
+ extra_files.push_back(ef);
+}
+
+void EditorExportPlugin::add_shared_object(const String &p_path) {
+
+ shared_objects.push_back(p_path);
+}
+
+void EditorExportPlugin::_export_file_script(const String &p_path, const String &p_type, const PoolVector<String> &p_features) {
+
+ if (get_script_instance()) {
+ get_script_instance()->call("_export_file", p_path, p_type, p_features);
+ }
+}
+
+void EditorExportPlugin::_export_begin_script(const PoolVector<String> &p_features) {
+
+ if (get_script_instance()) {
+ get_script_instance()->call("_export_begin", p_features);
+ }
+}
+
+void EditorExportPlugin::_export_file(const String &p_path, const String &p_type, const Set<String> &p_features) {
+}
+
+void EditorExportPlugin::_export_begin(const Set<String> &p_features) {
+}
+
+void EditorExportPlugin::skip() {
+
+ skipped = true;
+}
+
+void EditorExportPlugin::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("add_shared_object", "path"), &EditorExportPlugin::add_shared_object);
+ ClassDB::bind_method(D_METHOD("add_file", "path", "file", "remap"), &EditorExportPlugin::add_file);
+ ClassDB::bind_method(D_METHOD("skip"), &EditorExportPlugin::skip);
+
+ BIND_VMETHOD(MethodInfo("_export_file", PropertyInfo(Variant::STRING, "path"), PropertyInfo(Variant::STRING, "type"), PropertyInfo(Variant::POOL_STRING_ARRAY, "features")));
+ BIND_VMETHOD(MethodInfo("_export_begin", PropertyInfo(Variant::POOL_STRING_ARRAY, "features")));
+}
+
+EditorExportPlugin::EditorExportPlugin() {
+ skipped = false;
+}
+
+Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata, EditorExportSaveSharedObject p_so_func) {
Ref<EditorExportPlatform> platform = p_preset->get_platform();
List<String> feature_list;
platform->get_preset_features(p_preset, &feature_list);
//figure out features
Set<String> features;
+ PoolVector<String> features_pv;
for (List<String>::Element *E = feature_list.front(); E; E = E->next()) {
features.insert(E->get());
+ features_pv.push_back(E->get());
}
+ Vector<Ref<EditorExportPlugin> > export_plugins = EditorExport::get_singleton()->get_export_plugins();
+
//figure out paths of files that will be exported
Set<String> paths;
+ Vector<String> path_remaps;
if (p_preset->get_export_filter() == EditorExportPreset::EXPORT_ALL_RESOURCES) {
//find stuff
@@ -508,6 +566,25 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
_edit_filter_list(paths, p_preset->get_include_filter(), false);
_edit_filter_list(paths, p_preset->get_exclude_filter(), true);
+ //initial export plugin callback
+ for (int i = 0; i < export_plugins.size(); i++) {
+ if (export_plugins[i]->get_script_instance()) { //script based
+ export_plugins[i]->_export_begin_script(features_pv);
+ } else {
+ export_plugins[i]->_export_begin(features);
+ }
+ if (p_so_func) {
+ for (int j = 0; j < export_plugins[i]->shared_objects.size(); j++) {
+ p_so_func(p_udata, export_plugins[i]->shared_objects[j]);
+ }
+ }
+ for (int j = 0; j < export_plugins[i]->extra_files.size(); j++) {
+ p_func(p_udata, export_plugins[i]->extra_files[j].path, export_plugins[i]->extra_files[j].data, 0, paths.size());
+ }
+
+ export_plugins[i]->_clear();
+ }
+
//store everything in the export medium
int idx = 0;
int total = paths.size();
@@ -515,6 +592,7 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
for (Set<String>::Element *E = paths.front(); E; E = E->next()) {
String path = E->get();
+ String type = ResourceLoader::get_resource_type(path);
if (FileAccess::exists(path + ".import")) {
//file is imported, replace by what it imports
@@ -551,9 +629,42 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
p_func(p_udata, path + ".import", array, idx, total);
} else {
+
+ bool do_export = true;
+ for (int i = 0; i < export_plugins.size(); i++) {
+ if (export_plugins[i]->get_script_instance()) { //script based
+ export_plugins[i]->_export_file_script(path, type, features_pv);
+ } else {
+ export_plugins[i]->_export_file(path, type, features);
+ }
+ if (p_so_func) {
+ for (int j = 0; j < export_plugins[i]->shared_objects.size(); j++) {
+ p_so_func(p_udata, export_plugins[i]->shared_objects[j]);
+ }
+ }
+
+ for (int j = 0; j < export_plugins[i]->extra_files.size(); j++) {
+ p_func(p_udata, export_plugins[i]->extra_files[j].path, export_plugins[i]->extra_files[j].data, idx, total);
+ if (export_plugins[i]->extra_files[j].remap) {
+ do_export = false; //if remap, do not
+ path_remaps.push_back(path);
+ path_remaps.push_back(export_plugins[i]->extra_files[j].path);
+ }
+ }
+
+ if (export_plugins[i]->skipped) {
+ do_export = false;
+ }
+ export_plugins[i]->_clear();
+
+ if (!do_export)
+ break; //apologies, not exporting
+ }
//just store it as it comes
- Vector<uint8_t> array = FileAccess::get_file_as_array(path);
- p_func(p_udata, path, array, idx, total);
+ if (do_export) {
+ Vector<uint8_t> array = FileAccess::get_file_as_array(path);
+ p_func(p_udata, path, array, idx, total);
+ }
}
idx++;
@@ -575,9 +686,14 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
}
}
+ ProjectSettings::CustomMap custom_map;
+ if (path_remaps.size()) {
+ custom_map["path_remap/remapped_paths"] = path_remaps;
+ }
+
String config_file = "project.binary";
String engine_cfb = EditorSettings::get_singleton()->get_settings_path() + "/tmp/tmp" + config_file;
- ProjectSettings::get_singleton()->save_custom(engine_cfb, ProjectSettings::CustomMap(), custom_list);
+ ProjectSettings::get_singleton()->save_custom(engine_cfb, custom_map, custom_list);
Vector<uint8_t> data = FileAccess::get_file_as_array(engine_cfb);
p_func(p_udata, "res://" + config_file, data, idx, total);
@@ -867,6 +983,23 @@ void EditorExport::remove_export_preset(int p_idx) {
export_presets.remove(p_idx);
}
+void EditorExport::add_export_plugin(const Ref<EditorExportPlugin> &p_plugin) {
+
+ if (export_plugins.find(p_plugin) == 1) {
+ export_plugins.push_back(p_plugin);
+ }
+}
+
+void EditorExport::remove_export_plugin(const Ref<EditorExportPlugin> &p_plugin) {
+
+ export_plugins.erase(p_plugin);
+}
+
+Vector<Ref<EditorExportPlugin> > EditorExport::get_export_plugins() {
+
+ return export_plugins;
+}
+
void EditorExport::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
diff --git a/editor/editor_export.h b/editor/editor_export.h
index 3b99c68c85..b6ea4fd889 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -124,6 +124,7 @@ class EditorExportPlatform : public Reference {
public:
typedef Error (*EditorExportSaveFunction)(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total);
+ typedef Error (*EditorExportSaveSharedObject)(void *p_userdata, const String &p_path);
private:
struct SavedData {
@@ -189,7 +190,7 @@ public:
virtual String get_name() const = 0;
virtual Ref<Texture> get_logo() const = 0;
- Error export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata);
+ Error export_project_files(const Ref<EditorExportPreset> &p_preset, EditorExportSaveFunction p_func, void *p_udata, EditorExportSaveSharedObject p_so_func = NULL);
Error save_pack(const Ref<EditorExportPreset> &p_preset, const String &p_path);
Error save_zip(const Ref<EditorExportPreset> &p_preset, const String &p_path);
@@ -219,11 +220,49 @@ public:
EditorExportPlatform();
};
+class EditorExportPlugin : public Reference {
+ GDCLASS(EditorExportPlugin, Reference)
+
+ friend class EditorExportPlatform;
+
+ Vector<String> shared_objects;
+ struct ExtraFile {
+ String path;
+ Vector<uint8_t> data;
+ bool remap;
+ };
+ Vector<ExtraFile> extra_files;
+ bool skipped;
+
+ _FORCE_INLINE_ void _clear() {
+ shared_objects.clear();
+ extra_files.clear();
+ skipped = false;
+ }
+
+ void _export_file_script(const String &p_path, const String &p_type, const PoolVector<String> &p_features);
+ void _export_begin_script(const PoolVector<String> &p_features);
+
+protected:
+ void add_file(const String &p_path, const Vector<uint8_t> &p_file, bool p_remap);
+ void add_shared_object(const String &p_path);
+ void skip();
+
+ virtual void _export_file(const String &p_path, const String &p_type, const Set<String> &p_features);
+ virtual void _export_begin(const Set<String> &p_features);
+
+ static void _bind_methods();
+
+public:
+ EditorExportPlugin();
+};
+
class EditorExport : public Node {
GDCLASS(EditorExport, Node);
Vector<Ref<EditorExportPlatform> > export_platforms;
Vector<Ref<EditorExportPreset> > export_presets;
+ Vector<Ref<EditorExportPlugin> > export_plugins;
Timer *save_timer;
bool block_save;
@@ -251,6 +290,10 @@ public:
Ref<EditorExportPreset> get_export_preset(int p_idx);
void remove_export_preset(int p_idx);
+ void add_export_plugin(const Ref<EditorExportPlugin> &p_plugin);
+ void remove_export_plugin(const Ref<EditorExportPlugin> &p_plugin);
+ Vector<Ref<EditorExportPlugin> > get_export_plugins();
+
void load_config();
bool poll_export_platforms();
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 0d6c552d1d..288b923e87 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -107,8 +107,6 @@ void EditorFileDialog::_notification(int p_what) {
fav_down->set_icon(get_icon("MoveDown", "EditorIcons"));
fav_rm->set_icon(get_icon("RemoveSmall", "EditorIcons"));
- Theme::get_default()->clear_icon("ResizedFile", "EditorIcons");
- Theme::get_default()->clear_icon("ResizedFolder", "EditorIcons");
update_file_list();
}
}
@@ -1198,6 +1196,9 @@ void EditorFileDialog::_bind_methods() {
BIND_ENUM_CONSTANT(ACCESS_RESOURCES);
BIND_ENUM_CONSTANT(ACCESS_USERDATA);
BIND_ENUM_CONSTANT(ACCESS_FILESYSTEM);
+
+ BIND_ENUM_CONSTANT(DISPLAY_THUMBNAILS);
+ BIND_ENUM_CONSTANT(DISPLAY_LIST);
}
void EditorFileDialog::set_show_hidden_files(bool p_show) {
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 4bcf5a49e6..3f0520379a 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -254,7 +254,7 @@ void EditorNode::_notification(int p_what) {
get_tree()->get_root()->set_as_audio_listener_2d(false);
get_tree()->set_auto_accept_quit(false);
get_tree()->connect("files_dropped", this, "_dropped_files");
- property_editable_warning->set_icon(gui_base->get_icon("NodeWarning","EditorIcons"));
+ property_editable_warning->set_icon(gui_base->get_icon("NodeWarning", "EditorIcons"));
}
if (p_what == NOTIFICATION_EXIT_TREE) {
@@ -1436,18 +1436,18 @@ void EditorNode::_edit_current() {
EditorNode::get_singleton()->get_import_dock()->set_edit_path(current_res->get_path());
int subr_idx = current_res->get_path().find("::");
- if (subr_idx!=-1) {
- String base_path=current_res->get_path().substr(0,subr_idx);
- if (FileAccess::exists(base_path+".import")) {
- editable_warning=TTR("This resource belongs to a scene that was imported, so it's not editable.\nPlease read the documentation relevant to importing scenes to better understand this workflow.");
+ if (subr_idx != -1) {
+ String base_path = current_res->get_path().substr(0, subr_idx);
+ if (FileAccess::exists(base_path + ".import")) {
+ editable_warning = TTR("This resource belongs to a scene that was imported, so it's not editable.\nPlease read the documentation relevant to importing scenes to better understand this workflow.");
} else {
- if (!get_edited_scene() || get_edited_scene()->get_filename()!=base_path) {
- editable_warning=TTR("This resource belongs to a scene that was instanced or inherited.\nChanges to it will not be kept when saving the current scene.");
+ if (!get_edited_scene() || get_edited_scene()->get_filename() != base_path) {
+ editable_warning = TTR("This resource belongs to a scene that was instanced or inherited.\nChanges to it will not be kept when saving the current scene.");
}
}
- } else if (current_res->get_path().is_resource_file()){
- if (FileAccess::exists(current_res->get_path()+".import")) {
- editable_warning=TTR("This resource was imported, so it's not editable. Change it's settings in the import panel and re-import.");
+ } else if (current_res->get_path().is_resource_file()) {
+ if (FileAccess::exists(current_res->get_path() + ".import")) {
+ editable_warning = TTR("This resource was imported, so it's not editable. Change it's settings in the import panel and re-import.");
}
}
} else if (is_node) {
@@ -1465,10 +1465,10 @@ void EditorNode::_edit_current() {
}
object_menu->get_popup()->clear();
- if (get_edited_scene() && get_edited_scene()->get_filename()!=String()) {
+ if (get_edited_scene() && get_edited_scene()->get_filename() != String()) {
String source_scene = get_edited_scene()->get_filename();
- if (FileAccess::exists(source_scene+".import")) {
- editable_warning=TTR("This scene was imported, so changes to it will not be kept.\nInstancing it or inheriting will allow making changes to it.\nPlease read the documentation relevant to importing scenes to better understand this workflow.");
+ if (FileAccess::exists(source_scene + ".import")) {
+ editable_warning = TTR("This scene was imported, so changes to it will not be kept.\nInstancing it or inheriting will allow making changes to it.\nPlease read the documentation relevant to importing scenes to better understand this workflow.");
}
}
@@ -1478,10 +1478,9 @@ void EditorNode::_edit_current() {
node_dock->set_node(NULL);
}
- if (editable_warning!=String()) {
+ if (editable_warning != String()) {
property_editable_warning->show(); //hide by default
property_editable_warning_dialog->set_text(editable_warning);
-
}
/* Take care of PLUGIN EDITOR */
@@ -3252,9 +3251,9 @@ void EditorNode::register_editor_types() {
ClassDB::register_class<EditorFileSystemDirectory>();
ClassDB::register_virtual_class<ScriptEditor>();
ClassDB::register_virtual_class<EditorInterface>();
+ ClassDB::register_class<EditorExportPlugin>();
// FIXME: Is this stuff obsolete, or should it be ported to new APIs?
- //ClassDB::register_class<EditorExportPlugin>();
//ClassDB::register_class<EditorScenePostImport>();
//ClassDB::register_type<EditorImportExport>();
}
@@ -4511,8 +4510,6 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method("_toggle_distraction_free_mode", &EditorNode::_toggle_distraction_free_mode);
ClassDB::bind_method("_property_editable_warning_pressed", &EditorNode::_property_editable_warning_pressed);
-
-
ClassDB::bind_method(D_METHOD("get_gui_base"), &EditorNode::get_gui_base);
ClassDB::bind_method(D_METHOD("_bottom_panel_switch"), &EditorNode::_bottom_panel_switch);
@@ -5273,14 +5270,13 @@ EditorNode::EditorNode() {
search_bar->add_child(clear_button);
clear_button->connect("pressed", this, "_clear_search_box");
- property_editable_warning = memnew (Button);
+ property_editable_warning = memnew(Button);
property_editable_warning->set_text(TTR("Changes may be lost!"));
prop_editor_base->add_child(property_editable_warning);
- property_editable_warning_dialog = memnew( AcceptDialog );
+ property_editable_warning_dialog = memnew(AcceptDialog);
gui_base->add_child(property_editable_warning_dialog);
property_editable_warning->hide();
- property_editable_warning->connect("pressed",this,"_property_editable_warning_pressed");
-
+ property_editable_warning->connect("pressed", this, "_property_editable_warning_pressed");
property_editor = memnew(PropertyEditor);
property_editor->set_autoclear(true);
@@ -5302,7 +5298,6 @@ EditorNode::EditorNode() {
dock_slot[DOCK_SLOT_RIGHT_UL]->add_child(import_dock);
import_dock->set_name(TTR("Import"));
-
bool use_single_dock_column = (OS::get_singleton()->get_screen_size(OS::get_singleton()->get_current_screen()).x < 1200);
node_dock = memnew(NodeDock);
diff --git a/editor/editor_node.h b/editor/editor_node.h
index 5c6c5be4c8..f1cdb7b892 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -609,7 +609,6 @@ private:
void _license_tree_selected();
-
protected:
void _notification(int p_what);
static void _bind_methods();
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 86acfcc50e..246599be11 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -530,6 +530,14 @@ void EditorPlugin::remove_import_plugin(const Ref<EditorImportPlugin> &p_importe
EditorFileSystem::get_singleton()->scan();
}
+void EditorPlugin::add_export_plugin(const Ref<EditorExportPlugin> &p_exporter) {
+ EditorExport::get_singleton()->add_export_plugin(p_exporter);
+}
+
+void EditorPlugin::remove_export_plugin(const Ref<EditorExportPlugin> &p_exporter) {
+ EditorExport::get_singleton()->remove_export_plugin(p_exporter);
+}
+
void EditorPlugin::set_window_layout(Ref<ConfigFile> p_layout) {
if (get_script_instance() && get_script_instance()->has_method("set_window_layout")) {
@@ -585,6 +593,8 @@ void EditorPlugin::_bind_methods() {
ClassDB::bind_method(D_METHOD("queue_save_layout"), &EditorPlugin::queue_save_layout);
ClassDB::bind_method(D_METHOD("add_import_plugin", "importer"), &EditorPlugin::add_import_plugin);
ClassDB::bind_method(D_METHOD("remove_import_plugin", "importer"), &EditorPlugin::remove_import_plugin);
+ ClassDB::bind_method(D_METHOD("add_export_plugin", "exporter"), &EditorPlugin::add_export_plugin);
+ ClassDB::bind_method(D_METHOD("remove_export_plugin", "exporter"), &EditorPlugin::remove_export_plugin);
ClassDB::bind_method(D_METHOD("set_input_event_forwarding_always_enabled"), &EditorPlugin::set_input_event_forwarding_always_enabled);
ClassDB::bind_method(D_METHOD("get_editor_interface"), &EditorPlugin::get_editor_interface);
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 99328f8149..18530e9ce4 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -191,6 +191,9 @@ public:
void add_import_plugin(const Ref<EditorImportPlugin> &p_importer);
void remove_import_plugin(const Ref<EditorImportPlugin> &p_importer);
+ void add_export_plugin(const Ref<EditorExportPlugin> &p_exporter);
+ void remove_export_plugin(const Ref<EditorExportPlugin> &p_exporter);
+
EditorPlugin();
virtual ~EditorPlugin();
};
diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp
index 054124da8f..414b091475 100644
--- a/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_tree_editor_plugin.cpp
@@ -476,7 +476,7 @@ void AnimationTreeEditor::_draw_node(const StringName &p_node) {
Color font_color = get_color("font_color", "PopupMenu");
Color font_color_title = get_color("font_color_hover", "PopupMenu");
font_color_title.a *= 0.8;
- Ref<Texture> slot_icon = get_icon("NodeRealSlot", "EditorIcons");
+ Ref<Texture> slot_icon = get_icon("VisualShaderPort", "EditorIcons");
Size2 size = get_node_size(p_node);
Point2 pos = anim_tree->node_get_pos(p_node);
@@ -599,7 +599,7 @@ void AnimationTreeEditor::_draw_node(const StringName &p_node) {
if (editable) {
- Ref<Texture> arrow = get_icon("arrow", "Tree");
+ Ref<Texture> arrow = get_icon("GuiDropdown", "EditorIcons");
Point2 arrow_ofs(w - arrow->get_width(), Math::floor((h - arrow->get_height()) / 2));
arrow->draw(ci, ofs + arrow_ofs);
}
@@ -671,7 +671,7 @@ Point2 AnimationTreeEditor::_get_slot_pos(const StringName &p_node_id, bool p_in
Ref<StyleBox> style = get_stylebox("panel", "PopupMenu");
Ref<Font> font = get_font("font", "PopupMenu");
- Ref<Texture> slot_icon = get_icon("NodeRealSlot", "EditorIcons");
+ Ref<Texture> slot_icon = get_icon("VisualShaderPort", "EditorIcons");
Size2 size = get_node_size(p_node_id);
Point2 pos = anim_tree->node_get_pos(p_node_id);
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index 704d474746..2c42150cee 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -76,18 +76,29 @@ void SpatialEditorViewport::_update_camera(float p_interp_delta) {
} else
camera->set_perspective(get_fov(), get_znear(), get_zfar());
- float inertia = EDITOR_DEF("editors/3d/orbit_inertia", 0.5);
- inertia = MAX(0, inertia);
+ //when not being manipulated, move softly
+ float free_orbit_inertia = EDITOR_DEF("editors/3d/free_orbit_inertia", 0.15);
+ float free_translation_inertia = EDITOR_DEF("editors/3d/free_translation_inertia", 0.15);
+ //when being manipulated, move more quickly
+ float manip_orbit_inertia = EDITOR_DEF("editors/3d/manipulation_orbit_inertia", 0.075);
+ float manip_translation_inertia = EDITOR_DEF("editors/3d/manipulation_translation_inertia", 0.075);
+
+ //determine if being manipulated
+ bool manipulated = (Input::get_singleton()->get_mouse_button_mask() & (2 | 4)) || Input::get_singleton()->is_key_pressed(KEY_SHIFT) || Input::get_singleton()->is_key_pressed(KEY_ALT) || Input::get_singleton()->is_key_pressed(KEY_CONTROL);
+
+ float orbit_inertia = MAX(0.00001, manipulated ? manip_orbit_inertia : free_orbit_inertia);
+ float translation_inertia = MAX(0.0001, manipulated ? manip_translation_inertia : free_translation_inertia);
Cursor old_camera_cursor = camera_cursor;
camera_cursor = cursor;
- camera_cursor.x_rot = Math::lerp(old_camera_cursor.x_rot, cursor.x_rot, p_interp_delta * (1 / inertia));
- camera_cursor.y_rot = Math::lerp(old_camera_cursor.y_rot, cursor.y_rot, p_interp_delta * (1 / inertia));
+ camera_cursor.x_rot = Math::lerp(old_camera_cursor.x_rot, cursor.x_rot, MIN(1.f, p_interp_delta * (1 / orbit_inertia)));
+ camera_cursor.y_rot = Math::lerp(old_camera_cursor.y_rot, cursor.y_rot, MIN(1.f, p_interp_delta * (1 / orbit_inertia)));
- bool disable_interp = (Input::get_singleton()->get_mouse_button_mask() & (2 | 4)) || Input::get_singleton()->is_key_pressed(KEY_SHIFT) || Input::get_singleton()->is_key_pressed(KEY_ALT) || Input::get_singleton()->is_key_pressed(KEY_CONTROL);
+ camera_cursor.pos = old_camera_cursor.pos.linear_interpolate(cursor.pos, MIN(1.f, p_interp_delta * (1 / translation_inertia)));
+ camera_cursor.distance = Math::lerp(old_camera_cursor.distance, cursor.distance, MIN(1.f, p_interp_delta * (1 / translation_inertia)));
- if (p_interp_delta == 0 || disable_interp || is_freelook_active()) {
+ if (p_interp_delta == 0 || is_freelook_active()) {
camera_cursor = cursor;
}
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index c7a4e1fc3b..b7300b9610 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -861,13 +861,13 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
menu->add_separator();
}
- menu->add_icon_item(get_icon("Load", "EditorIcons"), "Load", OBJ_MENU_LOAD);
+ menu->add_icon_item(get_icon("Load", "EditorIcons"), TTR("Load"), OBJ_MENU_LOAD);
if (!RES(v).is_null()) {
- menu->add_icon_item(get_icon("Edit", "EditorIcons"), "Edit", OBJ_MENU_EDIT);
- menu->add_icon_item(get_icon("Clear", "EditorIcons"), "Clear", OBJ_MENU_CLEAR);
- menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), "Make Unique", OBJ_MENU_MAKE_UNIQUE);
+ menu->add_icon_item(get_icon("Edit", "EditorIcons"), TTR("Edit"), OBJ_MENU_EDIT);
+ menu->add_icon_item(get_icon("Clear", "EditorIcons"), TTR("Clear"), OBJ_MENU_CLEAR);
+ menu->add_icon_item(get_icon("Duplicate", "EditorIcons"), TTR("Make Unique"), OBJ_MENU_MAKE_UNIQUE);
RES r = v;
if (r.is_valid() && r->get_path().is_resource_file()) {
menu->add_separator();
diff --git a/main/input_default.cpp b/main/input_default.cpp
index b4c9a6207f..902d3168d8 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -80,7 +80,7 @@ bool InputDefault::is_key_pressed(int p_scancode) const {
bool InputDefault::is_mouse_button_pressed(int p_button) const {
_THREAD_SAFE_METHOD_
- return (mouse_button_mask & (1 << p_button)) != 0;
+ return (mouse_button_mask & (1 << (p_button - 1))) != 0;
}
static int _combine_device(int p_value, int p_device) {
@@ -265,10 +265,11 @@ void InputDefault::parse_input_event(const Ref<InputEvent> &p_event) {
if (mb.is_valid() && !mb->is_doubleclick()) {
- if (mb->is_pressed())
- mouse_button_mask |= (1 << mb->get_button_index());
- else
- mouse_button_mask &= ~(1 << mb->get_button_index());
+ if (mb->is_pressed()) {
+ mouse_button_mask |= (1 << (mb->get_button_index() - 1));
+ } else {
+ mouse_button_mask &= ~(1 << (mb->get_button_index() - 1));
+ }
if (main_loop && emulate_touch && mb->get_button_index() == 1) {
Ref<InputEventScreenTouch> touch_event;
diff --git a/modules/gdnative/gd_native_library_editor.cpp b/modules/gdnative/gd_native_library_editor.cpp
new file mode 100644
index 0000000000..cc2c2b69a6
--- /dev/null
+++ b/modules/gdnative/gd_native_library_editor.cpp
@@ -0,0 +1,148 @@
+/*************************************************************************/
+/* gd_native_library_editor.cpp */
+/*************************************************************************/
+/* This file is part of: */
+/* GODOT ENGINE */
+/* https://godotengine.org */
+/*************************************************************************/
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
+/* */
+/* Permission is hereby granted, free of charge, to any person obtaining */
+/* a copy of this software and associated documentation files (the */
+/* "Software"), to deal in the Software without restriction, including */
+/* without limitation the rights to use, copy, modify, merge, publish, */
+/* distribute, sublicense, and/or sell copies of the Software, and to */
+/* permit persons to whom the Software is furnished to do so, subject to */
+/* the following conditions: */
+/* */
+/* The above copyright notice and this permission notice shall be */
+/* included in all copies or substantial portions of the Software. */
+/* */
+/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
+/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
+/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
+/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
+/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
+/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
+/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+/*************************************************************************/
+#ifdef TOOLS_ENABLED
+#include "gd_native_library_editor.h"
+
+#include "gdnative.h"
+
+void GDNativeLibraryEditor::_find_gdnative_singletons(EditorFileSystemDirectory *p_dir, const Set<String> &enabled_list) {
+
+ // check children
+
+ for (int i = 0; i < p_dir->get_file_count(); i++) {
+ String file_type = p_dir->get_file_type(i);
+
+ if (file_type != "GDNativeLibrary") {
+ continue;
+ }
+
+ Ref<GDNativeLibrary> lib = ResourceLoader::load(p_dir->get_file_path(i));
+ if (lib.is_valid() && lib->is_singleton_gdnative()) {
+ String path = p_dir->get_file_path(i);
+ TreeItem *ti = libraries->create_item(libraries->get_root());
+ ti->set_text(0, path.get_file());
+ ti->set_tooltip(0, path);
+ ti->set_metadata(0, path);
+ ti->set_cell_mode(1, TreeItem::CELL_MODE_RANGE);
+ ti->set_text(1, "Disabled,Enabled");
+ bool enabled = enabled_list.has(path) ? true : false;
+
+ ti->set_range(1, enabled ? 1 : 0);
+ ti->set_custom_color(1, enabled ? Color(0, 1, 0) : Color(1, 0, 0));
+ }
+ }
+
+ // check subdirectories
+ for (int i = 0; i < p_dir->get_subdir_count(); i++) {
+ _find_gdnative_singletons(p_dir->get_subdir(i), enabled_list);
+ }
+}
+
+void GDNativeLibraryEditor::_update_libraries() {
+
+ updating = true;
+ libraries->clear();
+ libraries->create_item(); //rppt
+
+ Vector<String> enabled_paths;
+ if (ProjectSettings::get_singleton()->has("gdnative/singletons")) {
+ enabled_paths = ProjectSettings::get_singleton()->get("gdnative/singletons");
+ }
+ Set<String> enabled_list;
+ for (int i = 0; i < enabled_paths.size(); i++) {
+ enabled_list.insert(enabled_paths[i]);
+ }
+
+ EditorFileSystemDirectory *fs = EditorFileSystem::get_singleton()->get_filesystem();
+ if (fs) {
+ _find_gdnative_singletons(fs, enabled_list);
+ }
+
+ updating = false;
+}
+
+void GDNativeLibraryEditor::_item_edited() {
+ if (updating)
+ return;
+
+ TreeItem *item = libraries->get_edited();
+ if (!item)
+ return;
+
+ bool enabled = item->get_range(1);
+ String path = item->get_metadata(0);
+
+ Vector<String> enabled_paths;
+ if (ProjectSettings::get_singleton()->has("gdnative/singletons")) {
+ enabled_paths = ProjectSettings::get_singleton()->get("gdnative/singletons");
+ }
+
+ if (enabled) {
+ if (enabled_paths.find(path) == -1) {
+ enabled_paths.push_back(path);
+ }
+ } else {
+ enabled_paths.erase(path);
+ }
+
+ if (enabled_paths.size()) {
+ ProjectSettings::get_singleton()->set("gdnative/singletons", enabled_paths);
+ } else {
+ ProjectSettings::get_singleton()->set("gdnative/singletons", Variant());
+ }
+}
+
+void GDNativeLibraryEditor::_notification(int p_what) {
+
+ if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
+ if (is_visible_in_tree()) {
+ _update_libraries();
+ }
+ }
+}
+
+void GDNativeLibraryEditor::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("_item_edited"), &GDNativeLibraryEditor::_item_edited);
+}
+
+GDNativeLibraryEditor::GDNativeLibraryEditor() {
+ libraries = memnew(Tree);
+ libraries->set_columns(2);
+ libraries->set_column_titles_visible(true);
+ libraries->set_column_title(0, TTR("Library"));
+ libraries->set_column_title(1, TTR("Status"));
+ libraries->set_hide_root(true);
+ add_margin_child(TTR("Libraries: "), libraries, true);
+ updating = false;
+ libraries->connect("item_edited", this, "_item_edited");
+}
+
+#endif // TOOLS_ENABLED
diff --git a/core/os/power.h b/modules/gdnative/gd_native_library_editor.h
index 59a091012e..a11c4620dd 100644
--- a/core/os/power.h
+++ b/modules/gdnative/gd_native_library_editor.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* power.h */
+/* gd_native_library_editor.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,16 +27,29 @@
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
+#ifndef GD_NATIVE_LIBRARY_EDITOR_H
+#define GD_NATIVE_LIBRARY_EDITOR_H
-#ifndef CORE_OS_POWER_H_
-#define CORE_OS_POWER_H_
+#ifdef TOOLS_ENABLED
+#include "editor/editor_file_system.h"
+#include "editor/project_settings_editor.h"
-typedef enum {
- POWERSTATE_UNKNOWN, /**< cannot determine power status */
- POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */
- POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */
- POWERSTATE_CHARGING, /**< Plugged in, charging battery */
- POWERSTATE_CHARGED /**< Plugged in, battery charged */
-} PowerState;
+class GDNativeLibraryEditor : public VBoxContainer {
+ Tree *libraries;
-#endif /* CORE_OS_POWER_H_ */
+ bool updating;
+ void _update_libraries();
+
+ void _find_gdnative_singletons(EditorFileSystemDirectory *p_dir, const Set<String> &enabled_list);
+ void _item_edited();
+
+protected:
+ void _notification(int p_what);
+ static void _bind_methods();
+
+public:
+ GDNativeLibraryEditor();
+};
+
+#endif
+#endif // GD_NATIVE_LIBRARY_EDITOR_H
diff --git a/modules/gdnative/gdnative/variant.cpp b/modules/gdnative/gdnative/variant.cpp
index b61f80b1f9..1b2aae607f 100644
--- a/modules/gdnative/gdnative/variant.cpp
+++ b/modules/gdnative/gdnative/variant.cpp
@@ -29,6 +29,7 @@
/*************************************************************************/
#include "gdnative/variant.h"
+#include "core/reference.h"
#include "core/variant.h"
#ifdef __cplusplus
@@ -158,7 +159,21 @@ void GDAPI godot_variant_new_rid(godot_variant *r_dest, const godot_rid *p_rid)
void GDAPI godot_variant_new_object(godot_variant *r_dest, const godot_object *p_obj) {
Variant *dest = (Variant *)r_dest;
Object *obj = (Object *)p_obj;
- memnew_placement_custom(dest, Variant, Variant(obj));
+ Reference *reference = Object::cast_to<Reference>(obj);
+ REF ref;
+ if (reference) {
+ ref = REF(reference);
+ }
+ if (!ref.is_null()) {
+ memnew_placement_custom(dest, Variant, Variant(ref.get_ref_ptr()));
+ } else {
+#if defined(DEBUG_METHODS_ENABLED)
+ if (reference) {
+ ERR_PRINT("Reference object has 0 refcount in godot_variant_new_object - you lost it somewhere.");
+ }
+#endif
+ memnew_placement_custom(dest, Variant, Variant(obj));
+ }
}
void GDAPI godot_variant_new_dictionary(godot_variant *r_dest, const godot_dictionary *p_dict) {
diff --git a/modules/gdnative/register_types.cpp b/modules/gdnative/register_types.cpp
index 559e9fa455..997c342045 100644
--- a/modules/gdnative/register_types.cpp
+++ b/modules/gdnative/register_types.cpp
@@ -43,7 +43,7 @@
#ifdef TOOLS_ENABLED
#include "editor/editor_node.h"
-
+#include "gd_native_library_editor.h"
// Class used to discover singleton gdnative files
void actual_discoverer_handler();
@@ -115,7 +115,12 @@ void actual_discoverer_handler() {
GDNativeSingletonDiscover *discoverer = NULL;
-void discoverer_callback() {
+static void editor_init_callback() {
+
+ GDNativeLibraryEditor *library_editor = memnew(GDNativeLibraryEditor);
+ library_editor->set_name(TTR("GDNative"));
+ ProjectSettingsEditor::get_singleton()->get_tabs()->add_child(library_editor);
+
discoverer = memnew(GDNativeSingletonDiscover);
EditorFileSystem::get_singleton()->connect("filesystem_changed", discoverer, "get_class");
}
@@ -184,7 +189,7 @@ void register_gdnative_types() {
#ifdef TOOLS_ENABLED
if (Engine::get_singleton()->is_editor_hint()) {
- EditorNode::add_init_callback(discoverer_callback);
+ EditorNode::add_init_callback(editor_init_callback);
}
#endif
diff --git a/modules/visual_script/visual_script_builtin_funcs.cpp b/modules/visual_script/visual_script_builtin_funcs.cpp
index 2c8796820e..972be5f5a4 100644
--- a/modules/visual_script/visual_script_builtin_funcs.cpp
+++ b/modules/visual_script/visual_script_builtin_funcs.cpp
@@ -1175,6 +1175,65 @@ void VisualScriptBuiltinFunc::_bind_methods() {
cc += func_name[i];
}
ADD_PROPERTY(PropertyInfo(Variant::INT, "function", PROPERTY_HINT_ENUM, cc), "set_func", "get_func");
+
+ BIND_ENUM_CONSTANT(MATH_SIN);
+ BIND_ENUM_CONSTANT(MATH_COS);
+ BIND_ENUM_CONSTANT(MATH_TAN);
+ BIND_ENUM_CONSTANT(MATH_SINH);
+ BIND_ENUM_CONSTANT(MATH_COSH);
+ BIND_ENUM_CONSTANT(MATH_TANH);
+ BIND_ENUM_CONSTANT(MATH_ASIN);
+ BIND_ENUM_CONSTANT(MATH_ACOS);
+ BIND_ENUM_CONSTANT(MATH_ATAN);
+ BIND_ENUM_CONSTANT(MATH_ATAN2);
+ BIND_ENUM_CONSTANT(MATH_SQRT);
+ BIND_ENUM_CONSTANT(MATH_FMOD);
+ BIND_ENUM_CONSTANT(MATH_FPOSMOD);
+ BIND_ENUM_CONSTANT(MATH_FLOOR);
+ BIND_ENUM_CONSTANT(MATH_CEIL);
+ BIND_ENUM_CONSTANT(MATH_ROUND);
+ BIND_ENUM_CONSTANT(MATH_ABS);
+ BIND_ENUM_CONSTANT(MATH_SIGN);
+ BIND_ENUM_CONSTANT(MATH_POW);
+ BIND_ENUM_CONSTANT(MATH_LOG);
+ BIND_ENUM_CONSTANT(MATH_EXP);
+ BIND_ENUM_CONSTANT(MATH_ISNAN);
+ BIND_ENUM_CONSTANT(MATH_ISINF);
+ BIND_ENUM_CONSTANT(MATH_EASE);
+ BIND_ENUM_CONSTANT(MATH_DECIMALS);
+ BIND_ENUM_CONSTANT(MATH_STEPIFY);
+ BIND_ENUM_CONSTANT(MATH_LERP);
+ BIND_ENUM_CONSTANT(MATH_DECTIME);
+ BIND_ENUM_CONSTANT(MATH_RANDOMIZE);
+ BIND_ENUM_CONSTANT(MATH_RAND);
+ BIND_ENUM_CONSTANT(MATH_RANDF);
+ BIND_ENUM_CONSTANT(MATH_RANDOM);
+ BIND_ENUM_CONSTANT(MATH_SEED);
+ BIND_ENUM_CONSTANT(MATH_RANDSEED);
+ BIND_ENUM_CONSTANT(MATH_DEG2RAD);
+ BIND_ENUM_CONSTANT(MATH_RAD2DEG);
+ BIND_ENUM_CONSTANT(MATH_LINEAR2DB);
+ BIND_ENUM_CONSTANT(MATH_DB2LINEAR);
+ BIND_ENUM_CONSTANT(LOGIC_MAX);
+ BIND_ENUM_CONSTANT(LOGIC_MIN);
+ BIND_ENUM_CONSTANT(LOGIC_CLAMP);
+ BIND_ENUM_CONSTANT(LOGIC_NEAREST_PO2);
+ BIND_ENUM_CONSTANT(OBJ_WEAKREF);
+ BIND_ENUM_CONSTANT(FUNC_FUNCREF);
+ BIND_ENUM_CONSTANT(TYPE_CONVERT);
+ BIND_ENUM_CONSTANT(TYPE_OF);
+ BIND_ENUM_CONSTANT(TYPE_EXISTS);
+ BIND_ENUM_CONSTANT(TEXT_CHAR);
+ BIND_ENUM_CONSTANT(TEXT_STR);
+ BIND_ENUM_CONSTANT(TEXT_PRINT);
+ BIND_ENUM_CONSTANT(TEXT_PRINTERR);
+ BIND_ENUM_CONSTANT(TEXT_PRINTRAW);
+ BIND_ENUM_CONSTANT(VAR_TO_STR);
+ BIND_ENUM_CONSTANT(STR_TO_VAR);
+ BIND_ENUM_CONSTANT(VAR_TO_BYTES);
+ BIND_ENUM_CONSTANT(BYTES_TO_VAR);
+ BIND_ENUM_CONSTANT(COLORN);
+ BIND_ENUM_CONSTANT(FUNC_MAX);
}
VisualScriptBuiltinFunc::VisualScriptBuiltinFunc() {
diff --git a/modules/visual_script/visual_script_func_nodes.cpp b/modules/visual_script/visual_script_func_nodes.cpp
index 5fcc5b0ad9..267946750f 100644
--- a/modules/visual_script/visual_script_func_nodes.cpp
+++ b/modules/visual_script/visual_script_func_nodes.cpp
@@ -748,6 +748,13 @@ void VisualScriptFunctionCall::_bind_methods() {
BIND_ENUM_CONSTANT(CALL_MODE_NODE_PATH);
BIND_ENUM_CONSTANT(CALL_MODE_INSTANCE);
BIND_ENUM_CONSTANT(CALL_MODE_BASIC_TYPE);
+ BIND_ENUM_CONSTANT(CALL_MODE_SINGLETON);
+
+ BIND_ENUM_CONSTANT(RPC_DISABLED);
+ BIND_ENUM_CONSTANT(RPC_RELIABLE);
+ BIND_ENUM_CONSTANT(RPC_UNRELIABLE);
+ BIND_ENUM_CONSTANT(RPC_RELIABLE_TO_ID);
+ BIND_ENUM_CONSTANT(RPC_UNRELIABLE_TO_ID);
}
class VisualScriptNodeInstanceFunctionCall : public VisualScriptNodeInstance {
@@ -1487,6 +1494,19 @@ void VisualScriptPropertySet::_bind_methods() {
BIND_ENUM_CONSTANT(CALL_MODE_SELF);
BIND_ENUM_CONSTANT(CALL_MODE_NODE_PATH);
BIND_ENUM_CONSTANT(CALL_MODE_INSTANCE);
+ BIND_ENUM_CONSTANT(CALL_MODE_BASIC_TYPE);
+
+ BIND_ENUM_CONSTANT(ASSIGN_OP_NONE);
+ BIND_ENUM_CONSTANT(ASSIGN_OP_ADD);
+ BIND_ENUM_CONSTANT(ASSIGN_OP_SUB);
+ BIND_ENUM_CONSTANT(ASSIGN_OP_MUL);
+ BIND_ENUM_CONSTANT(ASSIGN_OP_DIV);
+ BIND_ENUM_CONSTANT(ASSIGN_OP_MOD);
+ BIND_ENUM_CONSTANT(ASSIGN_OP_SHIFT_LEFT);
+ BIND_ENUM_CONSTANT(ASSIGN_OP_SHIFT_RIGHT);
+ BIND_ENUM_CONSTANT(ASSIGN_OP_BIT_AND);
+ BIND_ENUM_CONSTANT(ASSIGN_OP_BIT_OR);
+ BIND_ENUM_CONSTANT(ASSIGN_OP_BIT_XOR);
}
class VisualScriptNodeInstancePropertySet : public VisualScriptNodeInstance {
diff --git a/modules/visual_script/visual_script_nodes.cpp b/modules/visual_script/visual_script_nodes.cpp
index 39f23fcf50..b617c11bab 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -1882,6 +1882,16 @@ void VisualScriptMathConstant::_bind_methods() {
cc += const_name[i];
}
ADD_PROPERTY(PropertyInfo(Variant::INT, "constant", PROPERTY_HINT_ENUM, cc), "set_math_constant", "get_math_constant");
+
+ BIND_ENUM_CONSTANT(MATH_CONSTANT_ONE);
+ BIND_ENUM_CONSTANT(MATH_CONSTANT_PI);
+ BIND_ENUM_CONSTANT(MATH_CONSTANT_2PI);
+ BIND_ENUM_CONSTANT(MATH_CONSTANT_HALF_PI);
+ BIND_ENUM_CONSTANT(MATH_CONSTANT_E);
+ BIND_ENUM_CONSTANT(MATH_CONSTANT_SQRT2);
+ BIND_ENUM_CONSTANT(MATH_CONSTANT_INF);
+ BIND_ENUM_CONSTANT(MATH_CONSTANT_NAN);
+ BIND_ENUM_CONSTANT(MATH_CONSTANT_MAX);
}
VisualScriptMathConstant::VisualScriptMathConstant() {
@@ -3535,6 +3545,11 @@ void VisualScriptInputAction::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::STRING, "action"), "set_action_name", "get_action_name");
ADD_PROPERTY(PropertyInfo(Variant::INT, "mode", PROPERTY_HINT_ENUM, "Pressed,Released,JustPressed,JustReleased"), "set_action_mode", "get_action_mode");
+
+ BIND_ENUM_CONSTANT(MODE_PRESSED);
+ BIND_ENUM_CONSTANT(MODE_RELEASED);
+ BIND_ENUM_CONSTANT(MODE_JUST_PRESSED);
+ BIND_ENUM_CONSTANT(MODE_JUST_RELEASED);
}
VisualScriptInputAction::VisualScriptInputAction() {
diff --git a/platform/android/power_android.cpp b/platform/android/power_android.cpp
index 98d4d810b9..48c9377a5a 100644
--- a/platform/android/power_android.cpp
+++ b/platform/android/power_android.cpp
@@ -198,19 +198,19 @@ bool power_android::GetPowerInfo_Android() {
if (Android_JNI_GetPowerInfo(&plugged, &charged, &battery, &this->nsecs_left, &this->percent_left) != -1) {
if (plugged) {
if (charged) {
- this->power_state = POWERSTATE_CHARGED;
+ this->power_state = OS::POWERSTATE_CHARGED;
} else if (battery) {
- this->power_state = POWERSTATE_CHARGING;
+ this->power_state = OS::POWERSTATE_CHARGING;
} else {
- this->power_state = POWERSTATE_NO_BATTERY;
+ this->power_state = OS::POWERSTATE_NO_BATTERY;
this->nsecs_left = -1;
this->percent_left = -1;
}
} else {
- this->power_state = POWERSTATE_ON_BATTERY;
+ this->power_state = OS::POWERSTATE_ON_BATTERY;
}
} else {
- this->power_state = POWERSTATE_UNKNOWN;
+ this->power_state = OS::POWERSTATE_UNKNOWN;
this->nsecs_left = -1;
this->percent_left = -1;
}
@@ -218,12 +218,12 @@ bool power_android::GetPowerInfo_Android() {
return true;
}
-PowerState power_android::get_power_state() {
+OS::PowerState power_android::get_power_state() {
if (GetPowerInfo_Android()) {
return power_state;
} else {
WARN_PRINT("Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN");
- return POWERSTATE_UNKNOWN;
+ return OS::POWERSTATE_UNKNOWN;
}
}
@@ -246,7 +246,7 @@ int power_android::get_power_percent_left() {
}
power_android::power_android()
- : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) {
+ : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
}
power_android::~power_android() {
diff --git a/platform/android/power_android.h b/platform/android/power_android.h
index fc618c660d..4c7af1c771 100644
--- a/platform/android/power_android.h
+++ b/platform/android/power_android.h
@@ -31,7 +31,7 @@
#ifndef PLATFORM_ANDROID_POWER_ANDROID_H_
#define PLATFORM_ANDROID_POWER_ANDROID_H_
-#include "os/power.h"
+#include "os/os.h"
#include <android/native_window_jni.h>
class power_android {
@@ -57,7 +57,7 @@ private:
int nsecs_left;
int percent_left;
- PowerState power_state;
+ OS::PowerState power_state;
bool GetPowerInfo_Android();
bool UpdatePowerInfo();
@@ -71,7 +71,7 @@ public:
static struct LocalReferenceHolder LocalReferenceHolder_Setup(const char *func);
static void LocalReferenceHolder_Cleanup(struct LocalReferenceHolder *refholder);
- PowerState get_power_state();
+ OS::PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
};
diff --git a/platform/haiku/os_haiku.h b/platform/haiku/os_haiku.h
index cb68f9303f..d2fafb9129 100644
--- a/platform/haiku/os_haiku.h
+++ b/platform/haiku/os_haiku.h
@@ -117,7 +117,7 @@ public:
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen = 0) const;
virtual String get_executable_path() const;
- virtual PowerState get_power_state();
+ virtual OS::PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
diff --git a/platform/haiku/power_haiku.cpp b/platform/haiku/power_haiku.cpp
index 449b43a621..8718b317a3 100644
--- a/platform/haiku/power_haiku.cpp
+++ b/platform/haiku/power_haiku.cpp
@@ -37,12 +37,12 @@ bool PowerHaiku::UpdatePowerInfo() {
return false;
}
-PowerState PowerHaiku::get_power_state() {
+OS::PowerState PowerHaiku::get_power_state() {
if (UpdatePowerInfo()) {
return power_state;
} else {
WARN_PRINT("Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN");
- return POWERSTATE_UNKNOWN;
+ return OS::POWERSTATE_UNKNOWN;
}
}
@@ -65,7 +65,7 @@ int PowerX11::get_power_percent_left() {
}
PowerHaiku::PowerHaiku()
- : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) {
+ : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
}
PowerHaiku::~PowerHaiku() {
diff --git a/platform/haiku/power_haiku.h b/platform/haiku/power_haiku.h
index 12513bdaef..59a93cd976 100644
--- a/platform/haiku/power_haiku.h
+++ b/platform/haiku/power_haiku.h
@@ -31,11 +31,13 @@
#ifndef PLATFORM_HAIKU_POWER_HAIKU_H_
#define PLATFORM_HAIKU_POWER_HAIKU_H_
+#include <os/os.h>
+
class PowerHaiku {
private:
int nsecs_left;
int percent_left;
- PowerState power_state;
+ OS::PowerState power_state;
bool UpdatePowerInfo();
@@ -43,7 +45,7 @@ public:
PowerHaiku();
virtual ~PowerHaiku();
- PowerState get_power_state();
+ OS::PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
};
diff --git a/platform/iphone/power_iphone.cpp b/platform/iphone/power_iphone.cpp
index 2811e62108..055d31ef0a 100644
--- a/platform/iphone/power_iphone.cpp
+++ b/platform/iphone/power_iphone.cpp
@@ -30,15 +30,15 @@
#include "power_iphone.h"
-bool PowerState::UpdatePowerInfo() {
+bool OS::PowerState::UpdatePowerInfo() {
return false;
}
-PowerState PowerIphone::get_power_state() {
+OS::PowerState PowerIphone::get_power_state() {
if (UpdatePowerInfo()) {
return power_state;
} else {
- return POWERSTATE_UNKNOWN;
+ return OS::POWERSTATE_UNKNOWN;
}
}
@@ -59,7 +59,7 @@ int PowerIphone::get_power_percent_left() {
}
PowerIphone::PowerIphone()
- : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) {
+ : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
// TODO Auto-generated constructor stub
}
diff --git a/platform/iphone/power_iphone.h b/platform/iphone/power_iphone.h
index b4fb8d62dc..6270a8069c 100644
--- a/platform/iphone/power_iphone.h
+++ b/platform/iphone/power_iphone.h
@@ -31,11 +31,13 @@
#ifndef PLATFORM_IPHONE_POWER_IPHONE_H_
#define PLATFORM_IPHONE_POWER_IPHONE_H_
+#include <os/os.h>
+
class PowerIphone {
private:
int nsecs_left;
int percent_left;
- PowerState power_state;
+ OS::PowerState power_state;
bool UpdatePowerInfo();
@@ -43,7 +45,7 @@ public:
PowerIphone();
virtual ~PowerIphone();
- PowerState get_power_state();
+ OS::PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
};
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index ac8d367366..543d028576 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -976,7 +976,7 @@ String OS_JavaScript::get_joy_guid(int p_device) const {
return input->get_joy_guid_remapped(p_device);
}
-PowerState OS_JavaScript::get_power_state() {
+OS::PowerState OS_JavaScript::get_power_state() {
return power_manager->get_power_state();
}
diff --git a/platform/javascript/os_javascript.h b/platform/javascript/os_javascript.h
index f78a3f2768..4c6469cb58 100644
--- a/platform/javascript/os_javascript.h
+++ b/platform/javascript/os_javascript.h
@@ -165,7 +165,7 @@ public:
virtual String get_joy_guid(int p_device) const;
bool joy_connection_changed(int p_type, const EmscriptenGamepadEvent *p_event);
- virtual PowerState get_power_state();
+ virtual OS::PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
diff --git a/platform/javascript/power_javascript.cpp b/platform/javascript/power_javascript.cpp
index 3d54146595..10964502d4 100644
--- a/platform/javascript/power_javascript.cpp
+++ b/platform/javascript/power_javascript.cpp
@@ -36,12 +36,12 @@ bool PowerJavascript::UpdatePowerInfo() {
return false;
}
-PowerState PowerJavascript::get_power_state() {
+OS::PowerState PowerJavascript::get_power_state() {
if (UpdatePowerInfo()) {
return power_state;
} else {
WARN_PRINT("Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN");
- return POWERSTATE_UNKNOWN;
+ return OS::POWERSTATE_UNKNOWN;
}
}
@@ -64,7 +64,7 @@ int PowerJavascript::get_power_percent_left() {
}
PowerJavascript::PowerJavascript()
- : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) {
+ : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
}
PowerJavascript::~PowerJavascript() {
diff --git a/platform/javascript/power_javascript.h b/platform/javascript/power_javascript.h
index 834d765557..8454c5d728 100644
--- a/platform/javascript/power_javascript.h
+++ b/platform/javascript/power_javascript.h
@@ -31,13 +31,13 @@
#ifndef PLATFORM_JAVASCRIPT_POWER_JAVASCRIPT_H_
#define PLATFORM_JAVASCRIPT_POWER_JAVASCRIPT_H_
-#include "os/power.h"
+#include "os/os.h"
class PowerJavascript {
private:
int nsecs_left;
int percent_left;
- PowerState power_state;
+ OS::PowerState power_state;
bool UpdatePowerInfo();
@@ -45,7 +45,7 @@ public:
PowerJavascript();
virtual ~PowerJavascript();
- PowerState get_power_state();
+ OS::PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
};
diff --git a/platform/osx/os_osx.h b/platform/osx/os_osx.h
index ca3e5745e9..059dd5afd0 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -216,7 +216,7 @@ public:
virtual void set_ime_position(const Point2 &p_pos);
virtual void set_ime_intermediate_text_callback(ImeCallback p_callback, void *p_inp);
- virtual PowerState get_power_state();
+ virtual OS::PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index beda6f4c38..5a23d76755 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1914,7 +1914,7 @@ String OS_OSX::get_joy_guid(int p_device) const {
return input->get_joy_guid_remapped(p_device);
}
-PowerState OS_OSX::get_power_state() {
+OS::PowerState OS_OSX::get_power_state() {
return power_manager->get_power_state();
}
diff --git a/platform/osx/power_osx.cpp b/platform/osx/power_osx.cpp
index 5f3938cb91..eed03e63c1 100644
--- a/platform/osx/power_osx.cpp
+++ b/platform/osx/power_osx.cpp
@@ -174,7 +174,7 @@ bool power_osx::GetPowerInfo_MacOSX() {
nsecs_left = -1;
percent_left = -1;
- power_state = POWERSTATE_UNKNOWN;
+ power_state = OS::POWERSTATE_UNKNOWN;
if (blob != NULL) {
CFArrayRef list = IOPSCopyPowerSourcesList(blob);
@@ -194,13 +194,13 @@ bool power_osx::GetPowerInfo_MacOSX() {
}
if (!have_battery) {
- power_state = POWERSTATE_NO_BATTERY;
+ power_state = OS::POWERSTATE_NO_BATTERY;
} else if (charging) {
- power_state = POWERSTATE_CHARGING;
+ power_state = OS::POWERSTATE_CHARGING;
} else if (have_ac) {
- power_state = POWERSTATE_CHARGED;
+ power_state = OS::POWERSTATE_CHARGED;
} else {
- power_state = POWERSTATE_ON_BATTERY;
+ power_state = OS::POWERSTATE_ON_BATTERY;
}
CFRelease(list);
@@ -218,11 +218,11 @@ bool power_osx::UpdatePowerInfo() {
return false;
}
-PowerState power_osx::get_power_state() {
+OS::PowerState power_osx::get_power_state() {
if (UpdatePowerInfo()) {
return power_state;
} else {
- return POWERSTATE_UNKNOWN;
+ return OS::POWERSTATE_UNKNOWN;
}
}
@@ -243,7 +243,7 @@ int power_osx::get_power_percent_left() {
}
power_osx::power_osx()
- : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) {
+ : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
}
power_osx::~power_osx() {
diff --git a/platform/osx/power_osx.h b/platform/osx/power_osx.h
index 692c850d7c..20e47e9cd9 100644
--- a/platform/osx/power_osx.h
+++ b/platform/osx/power_osx.h
@@ -33,7 +33,7 @@
#include "dir_access_osx.h"
#include "os/file_access.h"
-#include "os/power.h"
+#include "os/os.h"
#include <CoreFoundation/CoreFoundation.h>
class power_osx {
@@ -41,7 +41,7 @@ class power_osx {
private:
int nsecs_left;
int percent_left;
- PowerState power_state;
+ OS::PowerState power_state;
void checkps(CFDictionaryRef dict, bool *have_ac, bool *have_battery, bool *charging);
bool GetPowerInfo_MacOSX(/*PowerState * state, int *seconds, int *percent*/);
bool UpdatePowerInfo();
@@ -50,7 +50,7 @@ public:
power_osx();
virtual ~power_osx();
- PowerState get_power_state();
+ OS::PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
};
diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp
index 44034e815d..e2bb464e76 100644
--- a/platform/server/os_server.cpp
+++ b/platform/server/os_server.cpp
@@ -200,7 +200,7 @@ void OS_Server::move_window_to_foreground() {
void OS_Server::set_cursor_shape(CursorShape p_shape) {
}
-PowerState OS_Server::get_power_state() {
+OS::PowerState OS_Server::get_power_state() {
return power_manager->get_power_state();
}
diff --git a/platform/server/os_server.h b/platform/server/os_server.h
index f3db053be3..8c0ca1a58d 100644
--- a/platform/server/os_server.h
+++ b/platform/server/os_server.h
@@ -106,7 +106,7 @@ public:
void run();
- virtual PowerState get_power_state();
+ virtual OS::PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp
index 3a8932aae2..fd8904fa0a 100644
--- a/platform/uwp/os_uwp.cpp
+++ b/platform/uwp/os_uwp.cpp
@@ -855,7 +855,7 @@ bool OSUWP::_check_internal_feature_support(const String &p_feature) {
return p_feature == "pc" || p_feature == "s3tc";
}
-PowerState OSUWP::get_power_state() {
+OS::PowerState OSUWP::get_power_state() {
return power_manager->get_power_state();
}
diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h
index 5f36396017..a7a5d32cb9 100644
--- a/platform/uwp/os_uwp.h
+++ b/platform/uwp/os_uwp.h
@@ -259,7 +259,7 @@ public:
void input_event(const Ref<InputEvent> &p_event);
- virtual PowerState get_power_state();
+ virtual OS::PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
diff --git a/platform/uwp/power_uwp.cpp b/platform/uwp/power_uwp.cpp
index 07a726647d..81e97b1391 100644
--- a/platform/uwp/power_uwp.cpp
+++ b/platform/uwp/power_uwp.cpp
@@ -31,7 +31,7 @@
#include "power_uwp.h"
PowerUWP::PowerUWP()
- : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) {
+ : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
}
PowerUWP::~PowerUWP() {
@@ -47,12 +47,12 @@ bool PowerUWP::UpdatePowerInfo() {
return false;
}
-PowerState PowerUWP::get_power_state() {
+OS::PowerState PowerUWP::get_power_state() {
if (UpdatePowerInfo()) {
return power_state;
} else {
WARN_PRINT("Power management is not implemented on this platform, defaulting to POWERSTATE_UNKNOWN");
- return POWERSTATE_UNKNOWN;
+ return OS::POWERSTATE_UNKNOWN;
}
}
diff --git a/platform/uwp/power_uwp.h b/platform/uwp/power_uwp.h
index 9a9811a4f5..0c57689c50 100644
--- a/platform/uwp/power_uwp.h
+++ b/platform/uwp/power_uwp.h
@@ -33,14 +33,14 @@
#include "os/dir_access.h"
#include "os/file_access.h"
-#include "os/power.h"
+#include "os/os.h"
class PowerUWP {
private:
int nsecs_left;
int percent_left;
- PowerState power_state;
+ OS::PowerState power_state;
bool UpdatePowerInfo();
@@ -48,7 +48,7 @@ public:
PowerUWP();
virtual ~PowerUWP();
- PowerState get_power_state();
+ OS::PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
};
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 530072db6e..62954e1a56 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -2353,7 +2353,7 @@ bool OS_Windows::is_vsync_enabled() const {
return true;
}
-PowerState OS_Windows::get_power_state() {
+OS::PowerState OS_Windows::get_power_state() {
return power_manager->get_power_state();
}
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 474b0fea5c..1a01ac950d 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -281,7 +281,7 @@ public:
virtual void set_use_vsync(bool p_enable);
virtual bool is_vsync_enabled() const;
- virtual PowerState get_power_state();
+ virtual OS::PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
diff --git a/platform/windows/power_windows.cpp b/platform/windows/power_windows.cpp
index b37e189a3a..8d86f160f1 100644
--- a/platform/windows/power_windows.cpp
+++ b/platform/windows/power_windows.cpp
@@ -64,19 +64,19 @@ bool PowerWindows::GetPowerInfo_Windows() {
/* This API should exist back to Win95. */
if (!GetSystemPowerStatus(&status)) {
/* !!! FIXME: push GetLastError() into GetError() */
- power_state = POWERSTATE_UNKNOWN;
+ power_state = OS::POWERSTATE_UNKNOWN;
} else if (status.BatteryFlag == 0xFF) { /* unknown state */
- power_state = POWERSTATE_UNKNOWN;
+ power_state = OS::POWERSTATE_UNKNOWN;
} else if (status.BatteryFlag & (1 << 7)) { /* no battery */
- power_state = POWERSTATE_NO_BATTERY;
+ power_state = OS::POWERSTATE_NO_BATTERY;
} else if (status.BatteryFlag & (1 << 3)) { /* charging */
- power_state = POWERSTATE_CHARGING;
+ power_state = OS::POWERSTATE_CHARGING;
need_details = TRUE;
} else if (status.ACLineStatus == 1) {
- power_state = POWERSTATE_CHARGED; /* on AC, not charging. */
+ power_state = OS::POWERSTATE_CHARGED; /* on AC, not charging. */
need_details = TRUE;
} else {
- power_state = POWERSTATE_ON_BATTERY; /* not on AC. */
+ power_state = OS::POWERSTATE_ON_BATTERY; /* not on AC. */
need_details = TRUE;
}
@@ -97,11 +97,11 @@ bool PowerWindows::GetPowerInfo_Windows() {
return TRUE; /* always the definitive answer on Windows. */
}
-PowerState PowerWindows::get_power_state() {
+OS::PowerState PowerWindows::get_power_state() {
if (GetPowerInfo_Windows()) {
return power_state;
} else {
- return POWERSTATE_UNKNOWN;
+ return OS::POWERSTATE_UNKNOWN;
}
}
@@ -122,7 +122,7 @@ int PowerWindows::get_power_percent_left() {
}
PowerWindows::PowerWindows()
- : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) {
+ : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
}
PowerWindows::~PowerWindows() {
diff --git a/platform/windows/power_windows.h b/platform/windows/power_windows.h
index 9da9841f48..0745615195 100644
--- a/platform/windows/power_windows.h
+++ b/platform/windows/power_windows.h
@@ -33,7 +33,7 @@
#include "os/dir_access.h"
#include "os/file_access.h"
-#include "os/power.h"
+#include "os/os.h"
#include <windows.h>
@@ -42,7 +42,7 @@ class PowerWindows {
private:
int nsecs_left;
int percent_left;
- PowerState power_state;
+ OS::PowerState power_state;
bool GetPowerInfo_Windows();
@@ -50,7 +50,7 @@ public:
PowerWindows();
virtual ~PowerWindows();
- PowerState get_power_state();
+ OS::PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
};
diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp
index 3453297716..428385f7cb 100644
--- a/platform/x11/joypad_linux.cpp
+++ b/platform/x11/joypad_linux.cpp
@@ -125,7 +125,6 @@ void JoypadLinux::enumerate_joypads(udev *p_udev) {
enumerate = udev_enumerate_new(p_udev);
udev_enumerate_add_match_subsystem(enumerate, "input");
- udev_enumerate_add_match_property(enumerate, "ID_INPUT_JOYPAD", "1");
udev_enumerate_scan_devices(enumerate);
devices = udev_enumerate_get_list_entry(enumerate);
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index f61ccacb98..4e78e0318c 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -2167,7 +2167,7 @@ void OS_X11::set_context(int p_context) {
}
}
-PowerState OS_X11::get_power_state() {
+OS::PowerState OS_X11::get_power_state() {
return power_manager->get_power_state();
}
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index 14c737d45e..2ba7f07cef 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -269,7 +269,7 @@ public:
virtual void set_use_vsync(bool p_enable);
virtual bool is_vsync_enabled() const;
- virtual PowerState get_power_state();
+ virtual OS::PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
diff --git a/platform/x11/power_x11.cpp b/platform/x11/power_x11.cpp
index 32100354a6..76ff7f91fb 100644
--- a/platform/x11/power_x11.cpp
+++ b/platform/x11/power_x11.cpp
@@ -252,7 +252,7 @@ bool PowerX11::GetPowerInfo_Linux_proc_acpi() {
this->nsecs_left = -1;
this->percent_left = -1;
- this->power_state = POWERSTATE_UNKNOWN;
+ this->power_state = OS::POWERSTATE_UNKNOWN;
dirp->change_dir(proc_acpi_battery_path);
Error err = dirp->list_dir_begin();
@@ -282,13 +282,13 @@ bool PowerX11::GetPowerInfo_Linux_proc_acpi() {
}
if (!have_battery) {
- this->power_state = POWERSTATE_NO_BATTERY;
+ this->power_state = OS::POWERSTATE_NO_BATTERY;
} else if (charging) {
- this->power_state = POWERSTATE_CHARGING;
+ this->power_state = OS::POWERSTATE_CHARGING;
} else if (have_ac) {
- this->power_state = POWERSTATE_CHARGED;
+ this->power_state = OS::POWERSTATE_CHARGED;
} else {
- this->power_state = POWERSTATE_ON_BATTERY;
+ this->power_state = OS::POWERSTATE_ON_BATTERY;
}
return true; /* definitive answer. */
@@ -400,17 +400,17 @@ bool PowerX11::GetPowerInfo_Linux_proc_apm() {
}
if (battery_flag == 0xFF) { /* unknown state */
- this->power_state = POWERSTATE_UNKNOWN;
+ this->power_state = OS::POWERSTATE_UNKNOWN;
} else if (battery_flag & (1 << 7)) { /* no battery */
- this->power_state = POWERSTATE_NO_BATTERY;
+ this->power_state = OS::POWERSTATE_NO_BATTERY;
} else if (battery_flag & (1 << 3)) { /* charging */
- this->power_state = POWERSTATE_CHARGING;
+ this->power_state = OS::POWERSTATE_CHARGING;
need_details = true;
} else if (ac_status == 1) {
- this->power_state = POWERSTATE_CHARGED; /* on AC, not charging. */
+ this->power_state = OS::POWERSTATE_CHARGED; /* on AC, not charging. */
need_details = true;
} else {
- this->power_state = POWERSTATE_ON_BATTERY;
+ this->power_state = OS::POWERSTATE_ON_BATTERY;
need_details = true;
}
@@ -445,7 +445,7 @@ bool PowerX11::GetPowerInfo_Linux_sys_class_power_supply(/*PowerState *state, in
return false;
}
- this->power_state = POWERSTATE_NO_BATTERY; /* assume we're just plugged in. */
+ this->power_state = OS::POWERSTATE_NO_BATTERY; /* assume we're just plugged in. */
this->nsecs_left = -1;
this->percent_left = -1;
@@ -454,7 +454,7 @@ bool PowerX11::GetPowerInfo_Linux_sys_class_power_supply(/*PowerState *state, in
while (name != "") {
bool choose = false;
char str[64];
- PowerState st;
+ OS::PowerState st;
int secs;
int pct;
@@ -475,17 +475,17 @@ bool PowerX11::GetPowerInfo_Linux_sys_class_power_supply(/*PowerState *state, in
/* some drivers don't offer this, so if it's not explicitly reported assume it's present. */
if (read_power_file(base, name.utf8().get_data(), "present", str, sizeof(str)) && (String(str) == "0\n")) {
- st = POWERSTATE_NO_BATTERY;
+ st = OS::POWERSTATE_NO_BATTERY;
} else if (!read_power_file(base, name.utf8().get_data(), "status", str, sizeof(str))) {
- st = POWERSTATE_UNKNOWN; /* uh oh */
+ st = OS::POWERSTATE_UNKNOWN; /* uh oh */
} else if (String(str) == "Charging\n") {
- st = POWERSTATE_CHARGING;
+ st = OS::POWERSTATE_CHARGING;
} else if (String(str) == "Discharging\n") {
- st = POWERSTATE_ON_BATTERY;
+ st = OS::POWERSTATE_ON_BATTERY;
} else if ((String(str) == "Full\n") || (String(str) == "Not charging\n")) {
- st = POWERSTATE_CHARGED;
+ st = OS::POWERSTATE_CHARGED;
} else {
- st = POWERSTATE_UNKNOWN; /* uh oh */
+ st = OS::POWERSTATE_UNKNOWN; /* uh oh */
}
if (!read_power_file(base, name.utf8().get_data(), "capacity", str, sizeof(str))) {
@@ -543,17 +543,17 @@ bool PowerX11::UpdatePowerInfo() {
}
PowerX11::PowerX11()
- : nsecs_left(-1), percent_left(-1), power_state(POWERSTATE_UNKNOWN) {
+ : nsecs_left(-1), percent_left(-1), power_state(OS::POWERSTATE_UNKNOWN) {
}
PowerX11::~PowerX11() {
}
-PowerState PowerX11::get_power_state() {
+OS::PowerState PowerX11::get_power_state() {
if (UpdatePowerInfo()) {
return power_state;
} else {
- return POWERSTATE_UNKNOWN;
+ return OS::POWERSTATE_UNKNOWN;
}
}
diff --git a/platform/x11/power_x11.h b/platform/x11/power_x11.h
index e34223036d..7fc258bc0d 100644
--- a/platform/x11/power_x11.h
+++ b/platform/x11/power_x11.h
@@ -33,14 +33,14 @@
#include "os/dir_access.h"
#include "os/file_access.h"
-#include "os/power.h"
+#include "os/os.h"
class PowerX11 {
private:
int nsecs_left;
int percent_left;
- PowerState power_state;
+ OS::PowerState power_state;
FileAccessRef open_power_file(const char *base, const char *node, const char *key);
bool read_power_file(const char *base, const char *node, const char *key, char *buf, size_t buflen);
@@ -58,7 +58,7 @@ public:
PowerX11();
virtual ~PowerX11();
- PowerState get_power_state();
+ OS::PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
};
diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp
index e2764a6e8d..a840744c78 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -302,6 +302,9 @@ void CollisionPolygon2D::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR2_ARRAY, "polygon"), "set_polygon", "get_polygon");
ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "disabled"), "set_disabled", "is_disabled");
ADD_PROPERTYNZ(PropertyInfo(Variant::BOOL, "one_way_collision"), "set_one_way_collision", "is_one_way_collision_enabled");
+
+ BIND_ENUM_CONSTANT(BUILD_SOLIDS);
+ BIND_ENUM_CONSTANT(BUILD_SEGMENTS);
}
CollisionPolygon2D::CollisionPolygon2D() {
diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp
index 1bca2c6f37..516acefe2a 100644
--- a/scene/2d/light_2d.cpp
+++ b/scene/2d/light_2d.cpp
@@ -443,6 +443,13 @@ void Light2D::_bind_methods() {
BIND_ENUM_CONSTANT(MODE_SUB);
BIND_ENUM_CONSTANT(MODE_MIX);
BIND_ENUM_CONSTANT(MODE_MASK);
+
+ BIND_ENUM_CONSTANT(SHADOW_FILTER_NONE);
+ BIND_ENUM_CONSTANT(SHADOW_FILTER_PCF3);
+ BIND_ENUM_CONSTANT(SHADOW_FILTER_PCF5);
+ BIND_ENUM_CONSTANT(SHADOW_FILTER_PCF7);
+ BIND_ENUM_CONSTANT(SHADOW_FILTER_PCF9);
+ BIND_ENUM_CONSTANT(SHADOW_FILTER_PCF13);
}
Light2D::Light2D() {
diff --git a/scene/2d/line_2d.cpp b/scene/2d/line_2d.cpp
index c87a9a5b1e..d8cef5b937 100644
--- a/scene/2d/line_2d.cpp
+++ b/scene/2d/line_2d.cpp
@@ -28,13 +28,14 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "line_2d.h"
+#include "line_builder.h"
#include "core_string_names.h"
// Needed so we can bind functions
-VARIANT_ENUM_CAST(LineJointMode)
-VARIANT_ENUM_CAST(LineCapMode)
-VARIANT_ENUM_CAST(LineTextureMode)
+VARIANT_ENUM_CAST(Line2D::LineJointMode)
+VARIANT_ENUM_CAST(Line2D::LineCapMode)
+VARIANT_ENUM_CAST(Line2D::LineTextureMode)
Line2D::Line2D()
: Node2D() {
@@ -134,7 +135,7 @@ void Line2D::set_texture_mode(const LineTextureMode mode) {
update();
}
-LineTextureMode Line2D::get_texture_mode() const {
+Line2D::LineTextureMode Line2D::get_texture_mode() const {
return _texture_mode;
}
@@ -143,7 +144,7 @@ void Line2D::set_joint_mode(LineJointMode mode) {
update();
}
-LineJointMode Line2D::get_joint_mode() const {
+Line2D::LineJointMode Line2D::get_joint_mode() const {
return _joint_mode;
}
@@ -152,7 +153,7 @@ void Line2D::set_begin_cap_mode(LineCapMode mode) {
update();
}
-LineCapMode Line2D::get_begin_cap_mode() const {
+Line2D::LineCapMode Line2D::get_begin_cap_mode() const {
return _begin_cap_mode;
}
@@ -161,7 +162,7 @@ void Line2D::set_end_cap_mode(LineCapMode mode) {
update();
}
-LineCapMode Line2D::get_end_cap_mode() const {
+Line2D::LineCapMode Line2D::get_end_cap_mode() const {
return _end_cap_mode;
}
diff --git a/scene/2d/line_2d.h b/scene/2d/line_2d.h
index 017ccf13ff..36aadfd265 100644
--- a/scene/2d/line_2d.h
+++ b/scene/2d/line_2d.h
@@ -30,7 +30,6 @@
#ifndef LINE2D_H
#define LINE2D_H
-#include "line_builder.h"
#include "node_2d.h"
class Line2D : public Node2D {
@@ -38,6 +37,24 @@ class Line2D : public Node2D {
GDCLASS(Line2D, Node2D)
public:
+ enum LineJointMode {
+ LINE_JOINT_SHARP = 0,
+ LINE_JOINT_BEVEL,
+ LINE_JOINT_ROUND
+ };
+
+ enum LineCapMode {
+ LINE_CAP_NONE = 0,
+ LINE_CAP_BOX,
+ LINE_CAP_ROUND
+ };
+
+ enum LineTextureMode {
+ LINE_TEXTURE_NONE = 0,
+ LINE_TEXTURE_TILE
+ // TODO STRETCH mode
+ };
+
Line2D();
void set_points(const PoolVector<Vector2> &p_points);
diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp
index 53db30e3ce..4873c47827 100644
--- a/scene/2d/line_builder.cpp
+++ b/scene/2d/line_builder.cpp
@@ -92,14 +92,14 @@ static inline Vector2 interpolate(const Rect2 &r, const Vector2 &v) {
//----------------------------------------------------------------------------
LineBuilder::LineBuilder() {
- joint_mode = LINE_JOINT_SHARP;
+ joint_mode = Line2D::LINE_JOINT_SHARP;
width = 10;
default_color = Color(0.4, 0.5, 1);
gradient = NULL;
sharp_limit = 2.f;
round_precision = 8;
- begin_cap_mode = LINE_CAP_NONE;
- end_cap_mode = LINE_CAP_NONE;
+ begin_cap_mode = Line2D::LINE_CAP_NONE;
+ end_cap_mode = Line2D::LINE_CAP_NONE;
_interpolate_color = false;
_last_index[0] = 0;
@@ -141,7 +141,7 @@ void LineBuilder::build() {
float current_distance1 = 0.f;
float total_distance = 0.f;
_interpolate_color = gradient != NULL;
- bool distance_required = _interpolate_color || texture_mode == LINE_TEXTURE_TILE;
+ bool distance_required = _interpolate_color || texture_mode == Line2D::LINE_TEXTURE_TILE;
if (distance_required)
total_distance = calculate_total_distance(points);
if (_interpolate_color)
@@ -153,7 +153,7 @@ void LineBuilder::build() {
float uvx1 = 0.f;
// Begin cap
- if (begin_cap_mode == LINE_CAP_BOX) {
+ if (begin_cap_mode == Line2D::LINE_CAP_BOX) {
// Push back first vertices a little bit
pos_up0 -= f0 * hw;
pos_down0 -= f0 * hw;
@@ -161,8 +161,8 @@ void LineBuilder::build() {
total_distance += width;
current_distance0 += hw;
current_distance1 = current_distance0;
- } else if (begin_cap_mode == LINE_CAP_ROUND) {
- if (texture_mode == LINE_TEXTURE_TILE) {
+ } else if (begin_cap_mode == Line2D::LINE_CAP_ROUND) {
+ if (texture_mode == Line2D::LINE_TEXTURE_TILE) {
uvx0 = 0.5f;
}
new_arc(pos0, pos_up0 - pos0, -Math_PI, color0, Rect2(0.f, 0.f, 1.f, 1.f));
@@ -247,15 +247,15 @@ void LineBuilder::build() {
corner_pos_down = corner_pos_in;
}
- LineJointMode current_joint_mode = joint_mode;
+ Line2D::LineJointMode current_joint_mode = joint_mode;
Vector2 pos_up1, pos_down1;
if (intersection_result == SEGMENT_INTERSECT) {
// Fallback on bevel if sharp angle is too high (because it would produce very long miters)
- if (current_joint_mode == LINE_JOINT_SHARP && corner_pos_out.distance_squared_to(pos1) / hw_sq > sharp_limit_sq) {
- current_joint_mode = LINE_JOINT_BEVEL;
+ if (current_joint_mode == Line2D::LINE_JOINT_SHARP && corner_pos_out.distance_squared_to(pos1) / hw_sq > sharp_limit_sq) {
+ current_joint_mode = Line2D::LINE_JOINT_BEVEL;
}
- if (current_joint_mode == LINE_JOINT_SHARP) {
+ if (current_joint_mode == Line2D::LINE_JOINT_SHARP) {
// In this case, we won't create joint geometry,
// The previous and next line quads will directly share an edge.
pos_up1 = corner_pos_up;
@@ -284,7 +284,7 @@ void LineBuilder::build() {
if (_interpolate_color) {
color1 = gradient->get_color_at_offset(current_distance1 / total_distance);
}
- if (texture_mode == LINE_TEXTURE_TILE) {
+ if (texture_mode == Line2D::LINE_TEXTURE_TILE) {
uvx0 = current_distance0 / width;
uvx1 = current_distance1 / width;
}
@@ -298,7 +298,7 @@ void LineBuilder::build() {
pos0 = pos1;
current_distance0 = current_distance1;
if (intersection_result == SEGMENT_INTERSECT) {
- if (current_joint_mode == LINE_JOINT_SHARP) {
+ if (current_joint_mode == Line2D::LINE_JOINT_SHARP) {
pos_up0 = pos_up1;
pos_down0 = pos_down1;
} else {
@@ -317,7 +317,7 @@ void LineBuilder::build() {
// From this point, bu0 and bd0 concern the next segment
// Add joint geometry
- if (current_joint_mode != LINE_JOINT_SHARP) {
+ if (current_joint_mode != Line2D::LINE_JOINT_SHARP) {
/* ________________ cbegin
* / \
@@ -337,9 +337,9 @@ void LineBuilder::build() {
cend = pos_up0;
}
- if (current_joint_mode == LINE_JOINT_BEVEL) {
+ if (current_joint_mode == Line2D::LINE_JOINT_BEVEL) {
strip_add_tri(cend, orientation);
- } else if (current_joint_mode == LINE_JOINT_ROUND) {
+ } else if (current_joint_mode == Line2D::LINE_JOINT_ROUND) {
Vector2 vbegin = cbegin - pos1;
Vector2 vend = cend - pos1;
strip_add_arc(pos1, vbegin.angle_to(vend), orientation);
@@ -360,7 +360,7 @@ void LineBuilder::build() {
Vector2 pos_down1 = pos1 - u0 * hw;
// End cap (box)
- if (end_cap_mode == LINE_CAP_BOX) {
+ if (end_cap_mode == Line2D::LINE_CAP_BOX) {
pos_up1 += f0 * hw;
pos_down1 += f0 * hw;
}
@@ -371,14 +371,14 @@ void LineBuilder::build() {
if (_interpolate_color) {
color1 = gradient->get_color(gradient->get_points_count() - 1);
}
- if (texture_mode == LINE_TEXTURE_TILE) {
+ if (texture_mode == Line2D::LINE_TEXTURE_TILE) {
uvx1 = current_distance1 / width;
}
strip_add_quad(pos_up1, pos_down1, color1, uvx1);
// End cap (round)
- if (end_cap_mode == LINE_CAP_ROUND) {
+ if (end_cap_mode == Line2D::LINE_CAP_ROUND) {
// Note: color is not used in case we don't interpolate...
Color color = _interpolate_color ? gradient->get_color(gradient->get_points_count() - 1) : Color(0, 0, 0);
new_arc(pos1, pos_up1 - pos1, Math_PI, color, Rect2(uvx1 - 0.5f, 0.f, 1.f, 1.f));
@@ -396,7 +396,7 @@ void LineBuilder::strip_begin(Vector2 up, Vector2 down, Color color, float uvx)
colors.push_back(color);
}
- if (texture_mode != LINE_TEXTURE_NONE) {
+ if (texture_mode != Line2D::LINE_TEXTURE_NONE) {
uvs.push_back(Vector2(uvx, 0.f));
uvs.push_back(Vector2(uvx, 1.f));
}
@@ -420,7 +420,7 @@ void LineBuilder::strip_new_quad(Vector2 up, Vector2 down, Color color, float uv
colors.push_back(color);
}
- if (texture_mode != LINE_TEXTURE_NONE) {
+ if (texture_mode != Line2D::LINE_TEXTURE_NONE) {
uvs.push_back(uvs[_last_index[UP]]);
uvs.push_back(uvs[_last_index[DOWN]]);
uvs.push_back(Vector2(uvx, UP));
@@ -449,7 +449,7 @@ void LineBuilder::strip_add_quad(Vector2 up, Vector2 down, Color color, float uv
colors.push_back(color);
}
- if (texture_mode != LINE_TEXTURE_NONE) {
+ if (texture_mode != Line2D::LINE_TEXTURE_NONE) {
uvs.push_back(Vector2(uvx, 0.f));
uvs.push_back(Vector2(uvx, 1.f));
}
@@ -476,7 +476,7 @@ void LineBuilder::strip_add_tri(Vector2 up, Orientation orientation) {
Orientation opposite_orientation = orientation == UP ? DOWN : UP;
- if (texture_mode != LINE_TEXTURE_NONE) {
+ if (texture_mode != Line2D::LINE_TEXTURE_NONE) {
// UVs are just one slice of the texture all along
// (otherwise we can't share the bottom vertice)
uvs.push_back(uvs[_last_index[opposite_orientation]]);
@@ -541,7 +541,7 @@ void LineBuilder::new_arc(Vector2 center, Vector2 vbegin, float angle_delta, Col
vertices.push_back(center);
if (_interpolate_color)
colors.push_back(color);
- if (texture_mode != LINE_TEXTURE_NONE)
+ if (texture_mode != Line2D::LINE_TEXTURE_NONE)
uvs.push_back(interpolate(uv_rect, Vector2(0.5f, 0.5f)));
// Arc vertices
@@ -552,7 +552,7 @@ void LineBuilder::new_arc(Vector2 center, Vector2 vbegin, float angle_delta, Col
vertices.push_back(rpos);
if (_interpolate_color)
colors.push_back(color);
- if (texture_mode != LINE_TEXTURE_NONE) {
+ if (texture_mode != Line2D::LINE_TEXTURE_NONE) {
Vector2 tsc = Vector2(Math::cos(tt), Math::sin(tt));
uvs.push_back(interpolate(uv_rect, 0.5f * (tsc + Vector2(1.f, 1.f))));
tt += angle_step;
@@ -565,7 +565,7 @@ void LineBuilder::new_arc(Vector2 center, Vector2 vbegin, float angle_delta, Col
vertices.push_back(rpos);
if (_interpolate_color)
colors.push_back(color);
- if (texture_mode != LINE_TEXTURE_NONE) {
+ if (texture_mode != Line2D::LINE_TEXTURE_NONE) {
tt = tt_begin + angle_delta;
Vector2 tsc = Vector2(Math::cos(tt), Math::sin(tt));
uvs.push_back(interpolate(uv_rect, 0.5f * (tsc + Vector2(1.f, 1.f))));
diff --git a/scene/2d/line_builder.h b/scene/2d/line_builder.h
index 227e0abd08..f12fbf6f82 100644
--- a/scene/2d/line_builder.h
+++ b/scene/2d/line_builder.h
@@ -31,39 +31,22 @@
#define LINE_BUILDER_H
#include "color.h"
+#include "line_2d.h"
#include "math_2d.h"
#include "scene/resources/color_ramp.h"
-enum LineJointMode {
- LINE_JOINT_SHARP = 0,
- LINE_JOINT_BEVEL,
- LINE_JOINT_ROUND
-};
-
-enum LineCapMode {
- LINE_CAP_NONE = 0,
- LINE_CAP_BOX,
- LINE_CAP_ROUND
-};
-
-enum LineTextureMode {
- LINE_TEXTURE_NONE = 0,
- LINE_TEXTURE_TILE
- // TODO STRETCH mode
-};
-
class LineBuilder {
public:
// TODO Move in a struct and reference it
// Input
Vector<Vector2> points;
- LineJointMode joint_mode;
- LineCapMode begin_cap_mode;
- LineCapMode end_cap_mode;
+ Line2D::LineJointMode joint_mode;
+ Line2D::LineCapMode begin_cap_mode;
+ Line2D::LineCapMode end_cap_mode;
float width;
Color default_color;
Gradient *gradient;
- LineTextureMode texture_mode;
+ Line2D::LineTextureMode texture_mode;
float sharp_limit;
int round_precision;
// TODO offset_joints option (offers alternative implementation of round joints)
diff --git a/scene/2d/screen_button.cpp b/scene/2d/screen_button.cpp
index c9bf6675d2..bf7c5a3ba4 100644
--- a/scene/2d/screen_button.cpp
+++ b/scene/2d/screen_button.cpp
@@ -399,6 +399,9 @@ void TouchScreenButton::_bind_methods() {
ADD_SIGNAL(MethodInfo("pressed"));
ADD_SIGNAL(MethodInfo("released"));
+
+ BIND_ENUM_CONSTANT(VISIBILITY_ALWAYS);
+ BIND_ENUM_CONSTANT(VISIBILITY_TOUCHSCREEN_ONLY);
}
TouchScreenButton::TouchScreenButton() {
diff --git a/scene/3d/area.cpp b/scene/3d/area.cpp
index 217cb71230..266bc5e381 100644
--- a/scene/3d/area.cpp
+++ b/scene/3d/area.cpp
@@ -729,6 +729,12 @@ void Area::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::STRING, "reverb_bus_name", PROPERTY_HINT_ENUM, ""), "set_reverb_bus", "get_reverb_bus");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "reverb_bus_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_amount", "get_reverb_amount");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "reverb_bus_uniformity", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_reverb_uniformity", "get_reverb_uniformity");
+
+ BIND_ENUM_CONSTANT(SPACE_OVERRIDE_DISABLED);
+ BIND_ENUM_CONSTANT(SPACE_OVERRIDE_COMBINE);
+ BIND_ENUM_CONSTANT(SPACE_OVERRIDE_COMBINE_REPLACE);
+ BIND_ENUM_CONSTANT(SPACE_OVERRIDE_REPLACE);
+ BIND_ENUM_CONSTANT(SPACE_OVERRIDE_REPLACE_COMBINE);
}
Area::Area()
diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp
index 966dd88a2c..147d3bf115 100644
--- a/scene/3d/arvr_nodes.cpp
+++ b/scene/3d/arvr_nodes.cpp
@@ -184,7 +184,7 @@ int ARVRController::get_joystick_id() const {
int ARVRController::is_button_pressed(int p_button) const {
int joy_id = get_joystick_id();
- if (joy_id == 0) {
+ if (joy_id == -1) {
return false;
};
@@ -193,7 +193,7 @@ int ARVRController::is_button_pressed(int p_button) const {
float ARVRController::get_joystick_axis(int p_axis) const {
int joy_id = get_joystick_id();
- if (joy_id == 0) {
+ if (joy_id == -1) {
return 0.0;
};
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index 096f787873..7402e664d9 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -405,6 +405,12 @@ void OmniLight::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "omni_attenuation", PROPERTY_HINT_EXP_EASING), "set_param", "get_param", PARAM_ATTENUATION);
ADD_PROPERTY(PropertyInfo(Variant::INT, "omni_shadow_mode", PROPERTY_HINT_ENUM, "Dual Paraboloid,Cube"), "set_shadow_mode", "get_shadow_mode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "omni_shadow_detail", PROPERTY_HINT_ENUM, "Vertical,Horizontal"), "set_shadow_detail", "get_shadow_detail");
+
+ BIND_ENUM_CONSTANT(SHADOW_DUAL_PARABOLOID);
+ BIND_ENUM_CONSTANT(SHADOW_CUBE);
+
+ BIND_ENUM_CONSTANT(SHADOW_DETAIL_VERTICAL);
+ BIND_ENUM_CONSTANT(SHADOW_DETAIL_HORIZONTAL);
}
OmniLight::OmniLight()
diff --git a/scene/3d/physics_body.cpp b/scene/3d/physics_body.cpp
index 7525eb5069..6551deabf2 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -874,6 +874,11 @@ void RigidBody::_bind_methods() {
BIND_ENUM_CONSTANT(MODE_KINEMATIC);
BIND_ENUM_CONSTANT(MODE_RIGID);
BIND_ENUM_CONSTANT(MODE_CHARACTER);
+
+ BIND_ENUM_CONSTANT(AXIS_LOCK_DISABLED);
+ BIND_ENUM_CONSTANT(AXIS_LOCK_X);
+ BIND_ENUM_CONSTANT(AXIS_LOCK_Y);
+ BIND_ENUM_CONSTANT(AXIS_LOCK_Z);
}
RigidBody::RigidBody()
diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp
index 0464a82f65..fa35d982eb 100644
--- a/scene/3d/visual_instance.cpp
+++ b/scene/3d/visual_instance.cpp
@@ -288,12 +288,13 @@ void GeometryInstance::_bind_methods() {
//ADD_SIGNAL( MethodInfo("visibility_changed"));
- BIND_CONSTANT(FLAG_MAX);
+ BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_OFF);
+ BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_ON);
+ BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_DOUBLE_SIDED);
+ BIND_ENUM_CONSTANT(SHADOW_CASTING_SETTING_SHADOWS_ONLY);
- BIND_CONSTANT(SHADOW_CASTING_SETTING_OFF);
- BIND_CONSTANT(SHADOW_CASTING_SETTING_ON);
- BIND_CONSTANT(SHADOW_CASTING_SETTING_DOUBLE_SIDED);
- BIND_CONSTANT(SHADOW_CASTING_SETTING_SHADOWS_ONLY);
+ BIND_ENUM_CONSTANT(FLAG_USE_BAKED_LIGHT);
+ BIND_ENUM_CONSTANT(FLAG_MAX);
}
GeometryInstance::GeometryInstance() {
diff --git a/scene/animation/animation_tree_player.cpp b/scene/animation/animation_tree_player.cpp
index 7a5c7e450b..38d0527288 100644
--- a/scene/animation/animation_tree_player.cpp
+++ b/scene/animation/animation_tree_player.cpp
@@ -1808,6 +1808,9 @@ void AnimationTreePlayer::_bind_methods() {
BIND_ENUM_CONSTANT(NODE_TIMESCALE);
BIND_ENUM_CONSTANT(NODE_TIMESEEK);
BIND_ENUM_CONSTANT(NODE_TRANSITION);
+
+ BIND_ENUM_CONSTANT(ANIMATION_PROCESS_FIXED);
+ BIND_ENUM_CONSTANT(ANIMATION_PROCESS_IDLE);
}
AnimationTreePlayer::AnimationTreePlayer() {
diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp
index 6a582c9a3d..661d085dfd 100644
--- a/scene/audio/audio_player.cpp
+++ b/scene/audio/audio_player.cpp
@@ -308,6 +308,10 @@ void AudioStreamPlayer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::STRING, "bus", PROPERTY_HINT_ENUM, ""), "set_bus", "get_bus");
ADD_SIGNAL(MethodInfo("finished"));
+
+ BIND_ENUM_CONSTANT(MIX_TARGET_STEREO);
+ BIND_ENUM_CONSTANT(MIX_TARGET_SURROUND);
+ BIND_ENUM_CONSTANT(MIX_TARGET_CENTER);
}
AudioStreamPlayer::AudioStreamPlayer() {
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 87dfd95724..2d5b54257a 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -809,9 +809,9 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName &
// try with custom themes
Control *theme_owner = data.theme_owner;
- while (theme_owner) {
+ StringName class_name = type;
- StringName class_name = type;
+ while (theme_owner) {
while (class_name != StringName()) {
if (theme_owner->data.theme->has_stylebox(p_name, class_name)) {
@@ -829,6 +829,14 @@ Ref<StyleBox> Control::get_stylebox(const StringName &p_name, const StringName &
theme_owner = NULL;
}
+ class_name = type;
+
+ while (class_name != StringName()) {
+ if (Theme::get_default()->has_stylebox(p_name, class_name))
+ return Theme::get_default()->get_stylebox(p_name, class_name);
+
+ class_name = ClassDB::get_parent_class_nocheck(class_name);
+ }
return Theme::get_default()->get_stylebox(p_name, type);
}
Ref<Font> Control::get_font(const StringName &p_name, const StringName &p_type) const {
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp
index 461ae3444b..657e8590d4 100644
--- a/scene/gui/tab_container.cpp
+++ b/scene/gui/tab_container.cpp
@@ -655,6 +655,10 @@ void TabContainer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "tab_align", PROPERTY_HINT_ENUM, "Left,Center,Right"), "set_tab_align", "get_tab_align");
ADD_PROPERTY(PropertyInfo(Variant::INT, "current_tab", PROPERTY_HINT_RANGE, "-1,4096,1", PROPERTY_USAGE_EDITOR), "set_current_tab", "get_current_tab");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "tabs_visible"), "set_tabs_visible", "are_tabs_visible");
+
+ BIND_ENUM_CONSTANT(ALIGN_LEFT);
+ BIND_ENUM_CONSTANT(ALIGN_CENTER);
+ BIND_ENUM_CONSTANT(ALIGN_RIGHT);
}
TabContainer::TabContainer() {
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 4975b66744..7fa29d312e 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -771,6 +771,10 @@ void TreeItem::_bind_methods() {
BIND_ENUM_CONSTANT(CELL_MODE_RANGE_EXPRESSION);
BIND_ENUM_CONSTANT(CELL_MODE_ICON);
BIND_ENUM_CONSTANT(CELL_MODE_CUSTOM);
+
+ BIND_ENUM_CONSTANT(ALIGN_LEFT);
+ BIND_ENUM_CONSTANT(ALIGN_CENTER);
+ BIND_ENUM_CONSTANT(ALIGN_RIGHT);
}
void TreeItem::clear_children() {
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 567b1dd7a1..d27a1a5641 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -2762,6 +2762,15 @@ void Viewport::_bind_methods() {
BIND_ENUM_CONSTANT(MSAA_4X);
BIND_ENUM_CONSTANT(MSAA_8X);
BIND_ENUM_CONSTANT(MSAA_16X);
+
+ BIND_ENUM_CONSTANT(USAGE_2D);
+ BIND_ENUM_CONSTANT(USAGE_2D_NO_SAMPLING);
+ BIND_ENUM_CONSTANT(USAGE_3D);
+ BIND_ENUM_CONSTANT(USAGE_3D_NO_EFFECTS);
+
+ BIND_ENUM_CONSTANT(CLEAR_MODE_ALWAYS);
+ BIND_ENUM_CONSTANT(CLEAR_MODE_NEVER);
+ BIND_ENUM_CONSTANT(CLEAR_MODE_ONLY_NEXT_FRAME);
}
Viewport::Viewport() {
diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp
index 659322897a..dff0fb8588 100644
--- a/scene/resources/audio_stream_sample.cpp
+++ b/scene/resources/audio_stream_sample.cpp
@@ -536,6 +536,14 @@ void AudioStreamSample::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "mix_rate"), "set_mix_rate", "get_mix_rate");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "stereo"), "set_stereo", "is_stereo");
ADD_PROPERTY(PropertyInfo(Variant::POOL_BYTE_ARRAY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_data", "get_data");
+
+ BIND_ENUM_CONSTANT(FORMAT_8_BITS);
+ BIND_ENUM_CONSTANT(FORMAT_16_BITS);
+ BIND_ENUM_CONSTANT(FORMAT_IMA_ADPCM);
+
+ BIND_ENUM_CONSTANT(LOOP_DISABLED);
+ BIND_ENUM_CONSTANT(LOOP_FORWARD);
+ BIND_ENUM_CONSTANT(LOOP_PING_PONG);
}
AudioStreamSample::AudioStreamSample() {
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp
index 2e89a739bd..1066848dd1 100644
--- a/scene/resources/curve.cpp
+++ b/scene/resources/curve.cpp
@@ -514,6 +514,10 @@ void Curve::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "_set_data", "_get_data");
ADD_SIGNAL(MethodInfo(SIGNAL_RANGE_CHANGED));
+
+ BIND_ENUM_CONSTANT(TANGENT_FREE);
+ BIND_ENUM_CONSTANT(TANGENT_LINEAR);
+ BIND_ENUM_CONSTANT(TANGENT_MODE_COUNT);
}
int Curve2D::get_point_count() const {
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index 04efe88102..db5d87d703 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -422,6 +422,46 @@ void Mesh::_bind_methods() {
BIND_ENUM_CONSTANT(PRIMITIVE_TRIANGLES);
BIND_ENUM_CONSTANT(PRIMITIVE_TRIANGLE_STRIP);
BIND_ENUM_CONSTANT(PRIMITIVE_TRIANGLE_FAN);
+
+ BIND_ENUM_CONSTANT(BLEND_SHAPE_MODE_NORMALIZED);
+ BIND_ENUM_CONSTANT(BLEND_SHAPE_MODE_RELATIVE);
+
+ BIND_ENUM_CONSTANT(ARRAY_FORMAT_VERTEX);
+ BIND_ENUM_CONSTANT(ARRAY_FORMAT_NORMAL);
+ BIND_ENUM_CONSTANT(ARRAY_FORMAT_TANGENT);
+ BIND_ENUM_CONSTANT(ARRAY_FORMAT_COLOR);
+ BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV);
+ BIND_ENUM_CONSTANT(ARRAY_FORMAT_TEX_UV2);
+ BIND_ENUM_CONSTANT(ARRAY_FORMAT_BONES);
+ BIND_ENUM_CONSTANT(ARRAY_FORMAT_WEIGHTS);
+ BIND_ENUM_CONSTANT(ARRAY_FORMAT_INDEX);
+
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_BASE);
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_VERTEX);
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_NORMAL);
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_TANGENT);
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_COLOR);
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_TEX_UV);
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_TEX_UV2);
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_BONES);
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_WEIGHTS);
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_INDEX);
+
+ BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_2D_VERTICES);
+ BIND_ENUM_CONSTANT(ARRAY_FLAG_USE_16_BIT_BONES);
+
+ BIND_ENUM_CONSTANT(ARRAY_COMPRESS_DEFAULT);
+
+ BIND_ENUM_CONSTANT(ARRAY_VERTEX);
+ BIND_ENUM_CONSTANT(ARRAY_NORMAL);
+ BIND_ENUM_CONSTANT(ARRAY_TANGENT);
+ BIND_ENUM_CONSTANT(ARRAY_COLOR);
+ BIND_ENUM_CONSTANT(ARRAY_TEX_UV);
+ BIND_ENUM_CONSTANT(ARRAY_TEX_UV2);
+ BIND_ENUM_CONSTANT(ARRAY_BONES);
+ BIND_ENUM_CONSTANT(ARRAY_WEIGHTS);
+ BIND_ENUM_CONSTANT(ARRAY_INDEX);
+ BIND_ENUM_CONSTANT(ARRAY_MAX);
}
Mesh::Mesh() {
diff --git a/servers/audio/effects/audio_effect_distortion.cpp b/servers/audio/effects/audio_effect_distortion.cpp
index f2bcabc3cb..3e6280f033 100644
--- a/servers/audio/effects/audio_effect_distortion.cpp
+++ b/servers/audio/effects/audio_effect_distortion.cpp
@@ -175,6 +175,12 @@ void AudioEffectDistortion::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "keep_hf_hz", PROPERTY_HINT_RANGE, "1,20000,1"), "set_keep_hf_hz", "get_keep_hf_hz");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "drive", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_drive", "get_drive");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "post_gain", PROPERTY_HINT_RANGE, "-80,24,0.01"), "set_post_gain", "get_post_gain");
+
+ BIND_ENUM_CONSTANT(MODE_CLIP);
+ BIND_ENUM_CONSTANT(MODE_ATAN);
+ BIND_ENUM_CONSTANT(MODE_LOFI);
+ BIND_ENUM_CONSTANT(MODE_OVERDRIVE);
+ BIND_ENUM_CONSTANT(MODE_WAVESHAPE);
}
AudioEffectDistortion::AudioEffectDistortion() {
diff --git a/servers/audio/effects/audio_effect_filter.cpp b/servers/audio/effects/audio_effect_filter.cpp
index 64a9db51a5..019494c74a 100644
--- a/servers/audio/effects/audio_effect_filter.cpp
+++ b/servers/audio/effects/audio_effect_filter.cpp
@@ -159,6 +159,11 @@ void AudioEffectFilter::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::REAL, "resonance", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_resonance", "get_resonance");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "gain", PROPERTY_HINT_RANGE, "0,4,0.01"), "set_gain", "get_gain");
ADD_PROPERTY(PropertyInfo(Variant::INT, "dB", PROPERTY_HINT_ENUM, "6db,12db,18db,24db"), "set_db", "get_db");
+
+ BIND_ENUM_CONSTANT(FILTER_6DB);
+ BIND_ENUM_CONSTANT(FILTER_12DB);
+ BIND_ENUM_CONSTANT(FILTER_18DB);
+ BIND_ENUM_CONSTANT(FILTER_24DB);
}
AudioEffectFilter::AudioEffectFilter(AudioFilterSW::Mode p_mode) {
diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp
index ed62e65846..4b728f821a 100644
--- a/servers/audio_server.cpp
+++ b/servers/audio_server.cpp
@@ -1094,6 +1094,10 @@ void AudioServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("generate_bus_layout"), &AudioServer::generate_bus_layout);
ADD_SIGNAL(MethodInfo("bus_layout_changed"));
+
+ BIND_ENUM_CONSTANT(SPEAKER_MODE_STEREO);
+ BIND_ENUM_CONSTANT(SPEAKER_SURROUND_51);
+ BIND_ENUM_CONSTANT(SPEAKER_SURROUND_71);
}
AudioServer::AudioServer() {
diff --git a/servers/physics_server.cpp b/servers/physics_server.cpp
index d4e37be882..28ab31b8f6 100644
--- a/servers/physics_server.cpp
+++ b/servers/physics_server.cpp
@@ -704,6 +704,20 @@ void PhysicsServer::_bind_methods() {
BIND_ENUM_CONSTANT(INFO_ACTIVE_OBJECTS);
BIND_ENUM_CONSTANT(INFO_COLLISION_PAIRS);
BIND_ENUM_CONSTANT(INFO_ISLAND_COUNT);
+
+ BIND_ENUM_CONSTANT(SPACE_PARAM_CONTACT_RECYCLE_RADIUS);
+ BIND_ENUM_CONSTANT(SPACE_PARAM_CONTACT_MAX_SEPARATION);
+ BIND_ENUM_CONSTANT(SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION);
+ BIND_ENUM_CONSTANT(SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD);
+ BIND_ENUM_CONSTANT(SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD);
+ BIND_ENUM_CONSTANT(SPACE_PARAM_BODY_TIME_TO_SLEEP);
+ BIND_ENUM_CONSTANT(SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO);
+ BIND_ENUM_CONSTANT(SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS);
+
+ BIND_ENUM_CONSTANT(BODY_AXIS_LOCK_DISABLED);
+ BIND_ENUM_CONSTANT(BODY_AXIS_LOCK_X);
+ BIND_ENUM_CONSTANT(BODY_AXIS_LOCK_Y);
+ BIND_ENUM_CONSTANT(BODY_AXIS_LOCK_Z);
}
PhysicsServer::PhysicsServer() {