mirror of
https://github.com/godotengine/godot
synced 2024-09-05 05:38:35 +00:00
Merge pull request #11230 from maxim-sheronov/fix_enum_bindings
Fix enums bindings
This commit is contained in:
commit
7dffed485b
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
13
core/os/os.h
13
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
|
||||
|
|
|
@ -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_ */
|
|
@ -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"
|
||||
|
|
|
@ -1198,6 +1198,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) {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
};
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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))));
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue