summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/bind/core_bind.cpp12
-rw-r--r--core/bind/core_bind.h4
-rw-r--r--core/os/os.cpp2
-rw-r--r--core/os/os.h13
-rw-r--r--core/os/power.h42
-rw-r--r--core/variant.h1
-rw-r--r--editor/editor_file_dialog.cpp3
-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/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/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/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
62 files changed, 412 insertions, 210 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 0f217c8235..d0acd04497 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -440,7 +440,7 @@ bool _OS::is_vsync_enabled() const {
return OS::get_singleton()->is_vsync_enabled();
}
-PowerState _OS::get_power_state() {
+OS::PowerState _OS::get_power_state() {
return OS::get_singleton()->get_power_state();
}
@@ -1142,11 +1142,11 @@ void _OS::_bind_methods() {
BIND_ENUM_CONSTANT(SYSTEM_DIR_PICTURES);
BIND_ENUM_CONSTANT(SYSTEM_DIR_RINGTONES);
- BIND_ENUM_CONSTANT(POWERSTATE_UNKNOWN);
- BIND_ENUM_CONSTANT(POWERSTATE_ON_BATTERY);
- BIND_ENUM_CONSTANT(POWERSTATE_NO_BATTERY);
- BIND_ENUM_CONSTANT(POWERSTATE_CHARGING);
- BIND_ENUM_CONSTANT(POWERSTATE_CHARGED);
+ BIND_ENUM_CONSTANT(OS::POWERSTATE_UNKNOWN);
+ BIND_ENUM_CONSTANT(OS::POWERSTATE_ON_BATTERY);
+ BIND_ENUM_CONSTANT(OS::POWERSTATE_NO_BATTERY);
+ BIND_ENUM_CONSTANT(OS::POWERSTATE_CHARGING);
+ BIND_ENUM_CONSTANT(OS::POWERSTATE_CHARGED);
}
_OS::_OS() {
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 1a3782c471..0578c2b80f 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"
@@ -303,7 +303,7 @@ public:
void set_use_vsync(bool p_enable);
bool is_vsync_enabled() const;
- PowerState get_power_state();
+ OS::PowerState get_power_state();
int get_power_seconds_left();
int get_power_percent_left();
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 258708eea2..259a416cee 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,
@@ -410,7 +417,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();
@@ -428,6 +435,6 @@ public:
virtual ~OS();
};
-VARIANT_ENUM_CAST(PowerState);
+VARIANT_ENUM_CAST(OS::PowerState);
#endif
diff --git a/core/os/power.h b/core/os/power.h
deleted file mode 100644
index 59a091012e..0000000000
--- a/core/os/power.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*************************************************************************/
-/* power.h */
-/*************************************************************************/
-/* 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. */
-/*************************************************************************/
-
-#ifndef CORE_OS_POWER_H_
-#define CORE_OS_POWER_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;
-
-#endif /* CORE_OS_POWER_H_ */
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/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index abcdc0b64c..f1ec1486cf 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -1214,6 +1214,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/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 093f01c49f..09f0b3d011 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 ebaebd84ce..b5163609c2 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -212,7 +212,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 f502fb9a9c..c18e3ff7c3 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -1901,7 +1901,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 5814d883cd..a061536e7a 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -2331,7 +2331,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 0c5965bf51..5d2b84746e 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -278,7 +278,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/os_x11.cpp b/platform/x11/os_x11.cpp
index f96343c92c..ea91fe20da 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -2149,7 +2149,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 51240fa023..c1f9505063 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -265,7 +265,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/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 6a8226c0e1..2d06a5f92d 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 341ae45ce8..5b2559f3b4 100644
--- a/scene/audio/audio_player.cpp
+++ b/scene/audio/audio_player.cpp
@@ -310,6 +310,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/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 db282262ec..662f95e61a 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -759,6 +759,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 29014a7ced..8f9d59a440 100644
--- a/servers/audio_server.cpp
+++ b/servers/audio_server.cpp
@@ -1081,6 +1081,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() {