mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
This commit is contained in:
parent
0be6d925dc
commit
07bc4e2f96
@ -83,9 +83,11 @@ const Variant &Array::operator[](int p_idx) const {
|
||||
int Array::size() const {
|
||||
return _p->array.size();
|
||||
}
|
||||
|
||||
bool Array::empty() const {
|
||||
return _p->array.empty();
|
||||
}
|
||||
|
||||
void Array::clear() {
|
||||
_p->array.clear();
|
||||
}
|
||||
@ -151,6 +153,7 @@ void Array::_assign(const Array &p_array) {
|
||||
void Array::operator=(const Array &p_array) {
|
||||
_assign(p_array);
|
||||
}
|
||||
|
||||
void Array::push_back(const Variant &p_value) {
|
||||
ERR_FAIL_COND(!_p->typed.validate(p_value, "push_back"));
|
||||
_p->array.push_back(p_value);
|
||||
@ -509,6 +512,7 @@ Array::Array() {
|
||||
_p = memnew(ArrayPrivate);
|
||||
_p->refcount.init();
|
||||
}
|
||||
|
||||
Array::~Array() {
|
||||
_unref();
|
||||
}
|
||||
|
@ -69,6 +69,7 @@ _ResourceLoader *_ResourceLoader::singleton = nullptr;
|
||||
Error _ResourceLoader::load_threaded_request(const String &p_path, const String &p_type_hint, bool p_use_sub_threads) {
|
||||
return ResourceLoader::load_threaded_request(p_path, p_type_hint, p_use_sub_threads);
|
||||
}
|
||||
|
||||
_ResourceLoader::ThreadLoadStatus _ResourceLoader::load_threaded_get_status(const String &p_path, Array r_progress) {
|
||||
float progress = 0;
|
||||
ResourceLoader::ThreadLoadStatus tls = ResourceLoader::load_threaded_get_status(p_path, &progress);
|
||||
@ -76,6 +77,7 @@ _ResourceLoader::ThreadLoadStatus _ResourceLoader::load_threaded_get_status(cons
|
||||
r_progress[0] = progress;
|
||||
return (ThreadLoadStatus)tls;
|
||||
}
|
||||
|
||||
RES _ResourceLoader::load_threaded_get(const String &p_path) {
|
||||
Error error;
|
||||
RES res = ResourceLoader::load_threaded_get(p_path, &error);
|
||||
@ -198,6 +200,7 @@ void _OS::set_use_file_access_save_and_swap(bool p_enable) {
|
||||
void _OS::set_low_processor_usage_mode(bool p_enabled) {
|
||||
OS::get_singleton()->set_low_processor_usage_mode(p_enabled);
|
||||
}
|
||||
|
||||
bool _OS::is_in_low_processor_usage_mode() const {
|
||||
return OS::get_singleton()->is_in_low_processor_usage_mode();
|
||||
}
|
||||
@ -252,6 +255,7 @@ int _OS::get_process_id() const {
|
||||
bool _OS::has_environment(const String &p_var) const {
|
||||
return OS::get_singleton()->has_environment(p_var);
|
||||
}
|
||||
|
||||
String _OS::get_environment(const String &p_var) const {
|
||||
return OS::get_singleton()->get_environment(p_var);
|
||||
}
|
||||
@ -259,6 +263,7 @@ String _OS::get_environment(const String &p_var) const {
|
||||
String _OS::get_name() const {
|
||||
return OS::get_singleton()->get_name();
|
||||
}
|
||||
|
||||
Vector<String> _OS::get_cmdline_args() {
|
||||
List<String> cmdline = OS::get_singleton()->get_cmdline_args();
|
||||
Vector<String> cmdlinev;
|
||||
@ -811,6 +816,7 @@ Vector<Plane> _Geometry::build_box_planes(const Vector3 &p_extents) {
|
||||
Vector<Plane> _Geometry::build_cylinder_planes(float p_radius, float p_height, int p_sides, Vector3::Axis p_axis) {
|
||||
return Geometry::build_cylinder_planes(p_radius, p_height, p_sides, p_axis);
|
||||
}
|
||||
|
||||
Vector<Plane> _Geometry::build_capsule_planes(float p_radius, float p_height, int p_sides, int p_lats, Vector3::Axis p_axis) {
|
||||
return Geometry::build_capsule_planes(p_radius, p_height, p_sides, p_lats, p_axis);
|
||||
}
|
||||
@ -860,22 +866,27 @@ Vector<Vector3> _Geometry::get_closest_points_between_segments(const Vector3 &p1
|
||||
r.set(1, r2);
|
||||
return r;
|
||||
}
|
||||
|
||||
Vector2 _Geometry::get_closest_point_to_segment_2d(const Vector2 &p_point, const Vector2 &p_a, const Vector2 &p_b) {
|
||||
Vector2 s[2] = { p_a, p_b };
|
||||
return Geometry::get_closest_point_to_segment_2d(p_point, s);
|
||||
}
|
||||
|
||||
Vector3 _Geometry::get_closest_point_to_segment(const Vector3 &p_point, const Vector3 &p_a, const Vector3 &p_b) {
|
||||
Vector3 s[2] = { p_a, p_b };
|
||||
return Geometry::get_closest_point_to_segment(p_point, s);
|
||||
}
|
||||
|
||||
Vector2 _Geometry::get_closest_point_to_segment_uncapped_2d(const Vector2 &p_point, const Vector2 &p_a, const Vector2 &p_b) {
|
||||
Vector2 s[2] = { p_a, p_b };
|
||||
return Geometry::get_closest_point_to_segment_uncapped_2d(p_point, s);
|
||||
}
|
||||
|
||||
Vector3 _Geometry::get_closest_point_to_segment_uncapped(const Vector3 &p_point, const Vector3 &p_a, const Vector3 &p_b) {
|
||||
Vector3 s[2] = { p_a, p_b };
|
||||
return Geometry::get_closest_point_to_segment_uncapped(p_point, s);
|
||||
}
|
||||
|
||||
Variant _Geometry::ray_intersects_triangle(const Vector3 &p_from, const Vector3 &p_dir, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2) {
|
||||
Vector3 res;
|
||||
if (Geometry::ray_intersects_triangle(p_from, p_dir, p_v0, p_v1, p_v2, &res))
|
||||
@ -883,6 +894,7 @@ Variant _Geometry::ray_intersects_triangle(const Vector3 &p_from, const Vector3
|
||||
else
|
||||
return Variant();
|
||||
}
|
||||
|
||||
Variant _Geometry::segment_intersects_triangle(const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_v0, const Vector3 &p_v1, const Vector3 &p_v2) {
|
||||
Vector3 res;
|
||||
if (Geometry::segment_intersects_triangle(p_from, p_to, p_v0, p_v1, p_v2, &res))
|
||||
@ -906,6 +918,7 @@ Vector<Vector3> _Geometry::segment_intersects_sphere(const Vector3 &p_from, cons
|
||||
r.set(1, norm);
|
||||
return r;
|
||||
}
|
||||
|
||||
Vector<Vector3> _Geometry::segment_intersects_cylinder(const Vector3 &p_from, const Vector3 &p_to, float p_height, float p_radius) {
|
||||
Vector<Vector3> r;
|
||||
Vector3 res, norm;
|
||||
@ -917,6 +930,7 @@ Vector<Vector3> _Geometry::segment_intersects_cylinder(const Vector3 &p_from, co
|
||||
r.set(1, norm);
|
||||
return r;
|
||||
}
|
||||
|
||||
Vector<Vector3> _Geometry::segment_intersects_convex(const Vector3 &p_from, const Vector3 &p_to, const Vector<Plane> &p_planes) {
|
||||
Vector<Vector3> r;
|
||||
Vector3 res, norm;
|
||||
@ -1198,9 +1212,11 @@ void _File::close() {
|
||||
memdelete(f);
|
||||
f = nullptr;
|
||||
}
|
||||
|
||||
bool _File::is_open() const {
|
||||
return f != nullptr;
|
||||
}
|
||||
|
||||
String _File::get_path() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, "", "File must be opened before use.");
|
||||
return f->get_path();
|
||||
@ -1215,10 +1231,12 @@ void _File::seek(int64_t p_position) {
|
||||
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
|
||||
f->seek(p_position);
|
||||
}
|
||||
|
||||
void _File::seek_end(int64_t p_position) {
|
||||
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
|
||||
f->seek_end(p_position);
|
||||
}
|
||||
|
||||
int64_t _File::get_position() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
return f->get_position();
|
||||
@ -1238,14 +1256,17 @@ uint8_t _File::get_8() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
return f->get_8();
|
||||
}
|
||||
|
||||
uint16_t _File::get_16() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
return f->get_16();
|
||||
}
|
||||
|
||||
uint32_t _File::get_32() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
return f->get_32();
|
||||
}
|
||||
|
||||
uint64_t _File::get_64() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
return f->get_64();
|
||||
@ -1255,10 +1276,12 @@ float _File::get_float() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
return f->get_float();
|
||||
}
|
||||
|
||||
double _File::get_double() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
return f->get_double();
|
||||
}
|
||||
|
||||
real_t _File::get_real() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
return f->get_real();
|
||||
@ -1332,6 +1355,7 @@ void _File::set_endian_swap(bool p_swap) {
|
||||
if (f)
|
||||
f->set_endian_swap(p_swap);
|
||||
}
|
||||
|
||||
bool _File::get_endian_swap() {
|
||||
return eswap;
|
||||
}
|
||||
@ -1347,16 +1371,19 @@ void _File::store_8(uint8_t p_dest) {
|
||||
|
||||
f->store_8(p_dest);
|
||||
}
|
||||
|
||||
void _File::store_16(uint16_t p_dest) {
|
||||
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
|
||||
|
||||
f->store_16(p_dest);
|
||||
}
|
||||
|
||||
void _File::store_32(uint32_t p_dest) {
|
||||
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
|
||||
|
||||
f->store_32(p_dest);
|
||||
}
|
||||
|
||||
void _File::store_64(uint64_t p_dest) {
|
||||
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
|
||||
|
||||
@ -1368,11 +1395,13 @@ void _File::store_float(float p_dest) {
|
||||
|
||||
f->store_float(p_dest);
|
||||
}
|
||||
|
||||
void _File::store_double(double p_dest) {
|
||||
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
|
||||
|
||||
f->store_double(p_dest);
|
||||
}
|
||||
|
||||
void _File::store_real(real_t p_real) {
|
||||
ERR_FAIL_COND_MSG(!f, "File must be opened before use.");
|
||||
|
||||
@ -1562,6 +1591,7 @@ String _Directory::get_next() {
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
bool _Directory::current_is_dir() const {
|
||||
ERR_FAIL_COND_V_MSG(!d, false, "Directory must be opened before use.");
|
||||
return d->current_is_dir();
|
||||
@ -1576,10 +1606,12 @@ int _Directory::get_drive_count() {
|
||||
ERR_FAIL_COND_V_MSG(!d, 0, "Directory must be opened before use.");
|
||||
return d->get_drive_count();
|
||||
}
|
||||
|
||||
String _Directory::get_drive(int p_drive) {
|
||||
ERR_FAIL_COND_V_MSG(!d, "", "Directory must be opened before use.");
|
||||
return d->get_drive(p_drive);
|
||||
}
|
||||
|
||||
int _Directory::get_current_drive() {
|
||||
ERR_FAIL_COND_V_MSG(!d, 0, "Directory must be opened before use.");
|
||||
return d->get_current_drive();
|
||||
@ -1589,10 +1621,12 @@ Error _Directory::change_dir(String p_dir) {
|
||||
ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use.");
|
||||
return d->change_dir(p_dir);
|
||||
}
|
||||
|
||||
String _Directory::get_current_dir() {
|
||||
ERR_FAIL_COND_V_MSG(!d, "", "Directory must be opened before use.");
|
||||
return d->get_current_dir();
|
||||
}
|
||||
|
||||
Error _Directory::make_dir(String p_dir) {
|
||||
ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use.");
|
||||
if (!p_dir.is_rel_path()) {
|
||||
@ -1603,6 +1637,7 @@ Error _Directory::make_dir(String p_dir) {
|
||||
}
|
||||
return d->make_dir(p_dir);
|
||||
}
|
||||
|
||||
Error _Directory::make_dir_recursive(String p_dir) {
|
||||
ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use.");
|
||||
if (!p_dir.is_rel_path()) {
|
||||
@ -1646,6 +1681,7 @@ Error _Directory::copy(String p_from, String p_to) {
|
||||
ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use.");
|
||||
return d->copy(p_from, p_to);
|
||||
}
|
||||
|
||||
Error _Directory::rename(String p_from, String p_to) {
|
||||
ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use.");
|
||||
if (!p_from.is_rel_path()) {
|
||||
@ -1657,6 +1693,7 @@ Error _Directory::rename(String p_from, String p_to) {
|
||||
|
||||
return d->rename(p_from, p_to);
|
||||
}
|
||||
|
||||
Error _Directory::remove(String p_name) {
|
||||
ERR_FAIL_COND_V_MSG(!d, ERR_UNCONFIGURED, "Directory must be opened before use.");
|
||||
if (!p_name.is_rel_path()) {
|
||||
@ -1915,6 +1952,7 @@ String _Thread::get_id() const {
|
||||
bool _Thread::is_active() const {
|
||||
return active;
|
||||
}
|
||||
|
||||
Variant _Thread::wait_to_finish() {
|
||||
ERR_FAIL_COND_V_MSG(!thread, Variant(), "Thread must exist to wait for its completion.");
|
||||
ERR_FAIL_COND_V_MSG(!active, Variant(), "Thread must be active to wait for its completion.");
|
||||
@ -1961,6 +1999,7 @@ PackedStringArray _ClassDB::get_class_list() const {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
PackedStringArray _ClassDB::get_inheriters_from_class(const StringName &p_class) const {
|
||||
List<StringName> classes;
|
||||
ClassDB::get_inheriters_from_class(p_class, &classes);
|
||||
@ -1974,18 +2013,23 @@ PackedStringArray _ClassDB::get_inheriters_from_class(const StringName &p_class)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
StringName _ClassDB::get_parent_class(const StringName &p_class) const {
|
||||
return ClassDB::get_parent_class(p_class);
|
||||
}
|
||||
|
||||
bool _ClassDB::class_exists(const StringName &p_class) const {
|
||||
return ClassDB::class_exists(p_class);
|
||||
}
|
||||
|
||||
bool _ClassDB::is_parent_class(const StringName &p_class, const StringName &p_inherits) const {
|
||||
return ClassDB::is_parent_class(p_class, p_inherits);
|
||||
}
|
||||
|
||||
bool _ClassDB::can_instance(const StringName &p_class) const {
|
||||
return ClassDB::can_instance(p_class);
|
||||
}
|
||||
|
||||
Variant _ClassDB::instance(const StringName &p_class) const {
|
||||
Object *obj = ClassDB::instance(p_class);
|
||||
if (!obj)
|
||||
@ -2002,6 +2046,7 @@ Variant _ClassDB::instance(const StringName &p_class) const {
|
||||
bool _ClassDB::has_signal(StringName p_class, StringName p_signal) const {
|
||||
return ClassDB::has_signal(p_class, p_signal);
|
||||
}
|
||||
|
||||
Dictionary _ClassDB::get_signal(StringName p_class, StringName p_signal) const {
|
||||
MethodInfo signal;
|
||||
if (ClassDB::get_signal(p_class, p_signal, &signal)) {
|
||||
@ -2010,6 +2055,7 @@ Dictionary _ClassDB::get_signal(StringName p_class, StringName p_signal) const {
|
||||
return Dictionary();
|
||||
}
|
||||
}
|
||||
|
||||
Array _ClassDB::get_signal_list(StringName p_class, bool p_no_inheritance) const {
|
||||
List<MethodInfo> signals;
|
||||
ClassDB::get_signal_list(p_class, &signals, p_no_inheritance);
|
||||
@ -2098,6 +2144,7 @@ int _ClassDB::get_integer_constant(const StringName &p_class, const StringName &
|
||||
ERR_FAIL_COND_V(!found, 0);
|
||||
return c;
|
||||
}
|
||||
|
||||
StringName _ClassDB::get_category(const StringName &p_node) const {
|
||||
return ClassDB::get_category(p_node);
|
||||
}
|
||||
@ -2141,6 +2188,7 @@ void _ClassDB::_bind_methods() {
|
||||
void _Engine::set_iterations_per_second(int p_ips) {
|
||||
Engine::get_singleton()->set_iterations_per_second(p_ips);
|
||||
}
|
||||
|
||||
int _Engine::get_iterations_per_second() const {
|
||||
return Engine::get_singleton()->get_iterations_per_second();
|
||||
}
|
||||
|
@ -72,6 +72,7 @@ ObjectID Callable::get_object_id() const {
|
||||
return ObjectID(object);
|
||||
}
|
||||
}
|
||||
|
||||
StringName Callable::get_method() const {
|
||||
ERR_FAIL_COND_V_MSG(is_custom(), StringName(),
|
||||
vformat("Can't get method on CallableCustom \"%s\".", operator String()));
|
||||
@ -117,9 +118,11 @@ bool Callable::operator==(const Callable &p_callable) const {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool Callable::operator!=(const Callable &p_callable) const {
|
||||
return !(*this == p_callable);
|
||||
}
|
||||
|
||||
bool Callable::operator<(const Callable &p_callable) const {
|
||||
bool custom_a = is_custom();
|
||||
bool custom_b = p_callable.is_custom();
|
||||
@ -222,6 +225,7 @@ Callable::Callable(ObjectID p_object, const StringName &p_method) {
|
||||
object = p_object;
|
||||
method = p_method;
|
||||
}
|
||||
|
||||
Callable::Callable(CallableCustom *p_custom) {
|
||||
if (p_custom->referenced) {
|
||||
object = 0;
|
||||
@ -231,6 +235,7 @@ Callable::Callable(CallableCustom *p_custom) {
|
||||
object = 0; //ensure object is all zero, since pointer may be 32 bits
|
||||
custom = p_custom;
|
||||
}
|
||||
|
||||
Callable::Callable(const Callable &p_callable) {
|
||||
if (p_callable.is_custom()) {
|
||||
if (!p_callable.custom->ref_count.ref()) {
|
||||
@ -262,9 +267,11 @@ CallableCustom::CallableCustom() {
|
||||
Object *Signal::get_object() const {
|
||||
return ObjectDB::get_instance(object);
|
||||
}
|
||||
|
||||
ObjectID Signal::get_object_id() const {
|
||||
return object;
|
||||
}
|
||||
|
||||
StringName Signal::get_name() const {
|
||||
return name;
|
||||
}
|
||||
@ -307,17 +314,20 @@ Error Signal::emit(const Variant **p_arguments, int p_argcount) const {
|
||||
|
||||
return obj->emit_signal(name, p_arguments, p_argcount);
|
||||
}
|
||||
|
||||
Error Signal::connect(const Callable &p_callable, const Vector<Variant> &p_binds, uint32_t p_flags) {
|
||||
Object *object = get_object();
|
||||
ERR_FAIL_COND_V(!object, ERR_UNCONFIGURED);
|
||||
|
||||
return object->connect(name, p_callable, p_binds, p_flags);
|
||||
}
|
||||
|
||||
void Signal::disconnect(const Callable &p_callable) {
|
||||
Object *object = get_object();
|
||||
ERR_FAIL_COND(!object);
|
||||
object->disconnect(name, p_callable);
|
||||
}
|
||||
|
||||
bool Signal::is_connected(const Callable &p_callable) const {
|
||||
Object *object = get_object();
|
||||
ERR_FAIL_COND_V(!object, false);
|
||||
|
@ -255,6 +255,7 @@ bool ClassDB::is_parent_class(const StringName &p_class, const StringName &p_inh
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ClassDB::get_class_list(List<StringName> *p_classes) {
|
||||
OBJTYPE_RLOCK;
|
||||
|
||||
@ -505,6 +506,7 @@ Object *ClassDB::instance(const StringName &p_class) {
|
||||
#endif
|
||||
return ti->creation_func();
|
||||
}
|
||||
|
||||
bool ClassDB::can_instance(const StringName &p_class) {
|
||||
OBJTYPE_RLOCK;
|
||||
|
||||
@ -934,6 +936,7 @@ void ClassDB::get_property_list(StringName p_class, List<PropertyInfo> *p_list,
|
||||
check = check->inherits_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
bool ClassDB::set_property(Object *p_object, const StringName &p_property, const Variant &p_value, bool *r_valid) {
|
||||
ClassInfo *type = classes.getptr(p_object->get_class_name());
|
||||
ClassInfo *check = type;
|
||||
@ -978,6 +981,7 @@ bool ClassDB::set_property(Object *p_object, const StringName &p_property, const
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ClassDB::get_property(Object *p_object, const StringName &p_property, Variant &r_value) {
|
||||
ClassInfo *type = classes.getptr(p_object->get_class_name());
|
||||
ClassInfo *check = type;
|
||||
|
@ -213,6 +213,7 @@ void Color::invert() {
|
||||
g = 1.0 - g;
|
||||
b = 1.0 - b;
|
||||
}
|
||||
|
||||
void Color::contrast() {
|
||||
r = Math::fmod(r + 0.5, 1.0);
|
||||
g = Math::fmod(g + 0.5, 1.0);
|
||||
|
@ -269,6 +269,7 @@ void PHashTranslation::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
p_list->push_back(PropertyInfo(Variant::PACKED_BYTE_ARRAY, "strings"));
|
||||
p_list->push_back(PropertyInfo(Variant::OBJECT, "load_from", PROPERTY_HINT_RESOURCE_TYPE, "Translation", PROPERTY_USAGE_EDITOR));
|
||||
}
|
||||
|
||||
void PHashTranslation::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("generate", "from"), &PHashTranslation::generate);
|
||||
}
|
||||
|
@ -154,6 +154,7 @@ void ResourceFormatSaverCrypto::get_recognized_extensions(const RES &p_resource,
|
||||
p_extensions->push_back("key");
|
||||
}
|
||||
}
|
||||
|
||||
bool ResourceFormatSaverCrypto::recognize(const RES &p_resource) const {
|
||||
return Object::cast_to<X509Certificate>(*p_resource) || Object::cast_to<CryptoKey>(*p_resource);
|
||||
}
|
||||
|
@ -62,11 +62,13 @@ void ScriptDebugger::remove_breakpoint(int p_line, const StringName &p_source) {
|
||||
if (breakpoints[p_line].size() == 0)
|
||||
breakpoints.erase(p_line);
|
||||
}
|
||||
|
||||
bool ScriptDebugger::is_breakpoint(int p_line, const StringName &p_source) const {
|
||||
if (!breakpoints.has(p_line))
|
||||
return false;
|
||||
return breakpoints[p_line].has(p_source);
|
||||
}
|
||||
|
||||
bool ScriptDebugger::is_breakpoint_line(int p_line) const {
|
||||
return breakpoints.has(p_line);
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ Variant &Dictionary::operator[](const Variant &p_key) {
|
||||
const Variant &Dictionary::operator[](const Variant &p_key) const {
|
||||
return _p->variant_map[p_key];
|
||||
}
|
||||
|
||||
const Variant *Dictionary::getptr(const Variant &p_key) const {
|
||||
OrderedHashMap<Variant, Variant, VariantHasher, VariantComparator>::ConstElement E = ((const OrderedHashMap<Variant, Variant, VariantHasher, VariantComparator> *)&_p->variant_map)->find(p_key);
|
||||
|
||||
@ -115,6 +116,7 @@ Variant Dictionary::get(const Variant &p_key, const Variant &p_default) const {
|
||||
int Dictionary::size() const {
|
||||
return _p->variant_map.size();
|
||||
}
|
||||
|
||||
bool Dictionary::empty() const {
|
||||
return !_p->variant_map.size();
|
||||
}
|
||||
@ -170,6 +172,7 @@ void Dictionary::_unref() const {
|
||||
}
|
||||
_p = nullptr;
|
||||
}
|
||||
|
||||
uint32_t Dictionary::hash() const {
|
||||
uint32_t h = hash_djb2_one_32(Variant::DICTIONARY);
|
||||
|
||||
@ -254,6 +257,7 @@ Dictionary::Dictionary() {
|
||||
_p = memnew(DictionaryPrivate);
|
||||
_p->refcount.init();
|
||||
}
|
||||
|
||||
Dictionary::~Dictionary() {
|
||||
_unref();
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ void Engine::set_iterations_per_second(int p_ips) {
|
||||
ERR_FAIL_COND_MSG(p_ips <= 0, "Engine iterations per second must be greater than 0.");
|
||||
ips = p_ips;
|
||||
}
|
||||
|
||||
int Engine::get_iterations_per_second() const {
|
||||
return ips;
|
||||
}
|
||||
|
@ -2283,6 +2283,7 @@ Error Image::decompress() {
|
||||
Error Image::compress(CompressMode p_mode, CompressSource p_source, float p_lossy_quality) {
|
||||
return compress_from_channels(p_mode, detect_used_channels(p_source), p_lossy_quality);
|
||||
}
|
||||
|
||||
Error Image::compress_from_channels(CompressMode p_mode, UsedChannels p_channels, float p_lossy_quality) {
|
||||
switch (p_mode) {
|
||||
case COMPRESS_S3TC: {
|
||||
@ -3359,6 +3360,7 @@ void Image::convert_rg_to_ra_rgba8() {
|
||||
w[i + 2] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void Image::convert_ra_rgba8_to_rg() {
|
||||
ERR_FAIL_COND(format != FORMAT_RGBA8);
|
||||
ERR_FAIL_COND(!data.size());
|
||||
|
@ -672,6 +672,7 @@ void Input::set_mouse_position(const Point2 &p_posf) {
|
||||
Point2 Input::get_mouse_position() const {
|
||||
return mouse_pos;
|
||||
}
|
||||
|
||||
Point2 Input::get_last_mouse_speed() const {
|
||||
return mouse_speed_track.speed;
|
||||
}
|
||||
@ -812,6 +813,7 @@ void Input::accumulate_input_event(const Ref<InputEvent> &p_event) {
|
||||
|
||||
accumulated_events.push_back(p_event);
|
||||
}
|
||||
|
||||
void Input::flush_accumulated_events() {
|
||||
while (accumulated_events.front()) {
|
||||
parse_input_event(accumulated_events.front()->get());
|
||||
|
@ -131,6 +131,7 @@ void InputEventFromWindow::_bind_methods() {
|
||||
void InputEventFromWindow::set_window_id(int64_t p_id) {
|
||||
window_id = p_id;
|
||||
}
|
||||
|
||||
int64_t InputEventFromWindow::get_window_id() const {
|
||||
return window_id;
|
||||
}
|
||||
@ -148,6 +149,7 @@ bool InputEventWithModifiers::get_shift() const {
|
||||
void InputEventWithModifiers::set_alt(bool p_enabled) {
|
||||
alt = p_enabled;
|
||||
}
|
||||
|
||||
bool InputEventWithModifiers::get_alt() const {
|
||||
return alt;
|
||||
}
|
||||
@ -155,6 +157,7 @@ bool InputEventWithModifiers::get_alt() const {
|
||||
void InputEventWithModifiers::set_control(bool p_enabled) {
|
||||
control = p_enabled;
|
||||
}
|
||||
|
||||
bool InputEventWithModifiers::get_control() const {
|
||||
return control;
|
||||
}
|
||||
@ -162,6 +165,7 @@ bool InputEventWithModifiers::get_control() const {
|
||||
void InputEventWithModifiers::set_metakey(bool p_enabled) {
|
||||
meta = p_enabled;
|
||||
}
|
||||
|
||||
bool InputEventWithModifiers::get_metakey() const {
|
||||
return meta;
|
||||
}
|
||||
@ -169,6 +173,7 @@ bool InputEventWithModifiers::get_metakey() const {
|
||||
void InputEventWithModifiers::set_command(bool p_enabled) {
|
||||
command = p_enabled;
|
||||
}
|
||||
|
||||
bool InputEventWithModifiers::get_command() const {
|
||||
return command;
|
||||
}
|
||||
@ -359,6 +364,7 @@ void InputEventKey::_bind_methods() {
|
||||
void InputEventMouse::set_button_mask(int p_mask) {
|
||||
button_mask = p_mask;
|
||||
}
|
||||
|
||||
int InputEventMouse::get_button_mask() const {
|
||||
return button_mask;
|
||||
}
|
||||
@ -366,6 +372,7 @@ int InputEventMouse::get_button_mask() const {
|
||||
void InputEventMouse::set_position(const Vector2 &p_pos) {
|
||||
pos = p_pos;
|
||||
}
|
||||
|
||||
Vector2 InputEventMouse::get_position() const {
|
||||
return pos;
|
||||
}
|
||||
@ -373,6 +380,7 @@ Vector2 InputEventMouse::get_position() const {
|
||||
void InputEventMouse::set_global_position(const Vector2 &p_global_pos) {
|
||||
global_pos = p_global_pos;
|
||||
}
|
||||
|
||||
Vector2 InputEventMouse::get_global_position() const {
|
||||
return global_pos;
|
||||
}
|
||||
@ -405,6 +413,7 @@ float InputEventMouseButton::get_factor() const {
|
||||
void InputEventMouseButton::set_button_index(int p_index) {
|
||||
button_index = p_index;
|
||||
}
|
||||
|
||||
int InputEventMouseButton::get_button_index() const {
|
||||
return button_index;
|
||||
}
|
||||
@ -412,6 +421,7 @@ int InputEventMouseButton::get_button_index() const {
|
||||
void InputEventMouseButton::set_pressed(bool p_pressed) {
|
||||
pressed = p_pressed;
|
||||
}
|
||||
|
||||
bool InputEventMouseButton::is_pressed() const {
|
||||
return pressed;
|
||||
}
|
||||
@ -419,6 +429,7 @@ bool InputEventMouseButton::is_pressed() const {
|
||||
void InputEventMouseButton::set_doubleclick(bool p_doubleclick) {
|
||||
doubleclick = p_doubleclick;
|
||||
}
|
||||
|
||||
bool InputEventMouseButton::is_doubleclick() const {
|
||||
return doubleclick;
|
||||
}
|
||||
@ -739,6 +750,7 @@ int InputEventJoypadButton::get_button_index() const {
|
||||
void InputEventJoypadButton::set_pressed(bool p_pressed) {
|
||||
pressed = p_pressed;
|
||||
}
|
||||
|
||||
bool InputEventJoypadButton::is_pressed() const {
|
||||
return pressed;
|
||||
}
|
||||
@ -746,6 +758,7 @@ bool InputEventJoypadButton::is_pressed() const {
|
||||
void InputEventJoypadButton::set_pressure(float p_pressure) {
|
||||
pressure = p_pressure;
|
||||
}
|
||||
|
||||
float InputEventJoypadButton::get_pressure() const {
|
||||
return pressure;
|
||||
}
|
||||
@ -798,6 +811,7 @@ void InputEventJoypadButton::_bind_methods() {
|
||||
void InputEventScreenTouch::set_index(int p_index) {
|
||||
index = p_index;
|
||||
}
|
||||
|
||||
int InputEventScreenTouch::get_index() const {
|
||||
return index;
|
||||
}
|
||||
@ -805,6 +819,7 @@ int InputEventScreenTouch::get_index() const {
|
||||
void InputEventScreenTouch::set_position(const Vector2 &p_pos) {
|
||||
pos = p_pos;
|
||||
}
|
||||
|
||||
Vector2 InputEventScreenTouch::get_position() const {
|
||||
return pos;
|
||||
}
|
||||
@ -812,6 +827,7 @@ Vector2 InputEventScreenTouch::get_position() const {
|
||||
void InputEventScreenTouch::set_pressed(bool p_pressed) {
|
||||
pressed = p_pressed;
|
||||
}
|
||||
|
||||
bool InputEventScreenTouch::is_pressed() const {
|
||||
return pressed;
|
||||
}
|
||||
@ -860,6 +876,7 @@ int InputEventScreenDrag::get_index() const {
|
||||
void InputEventScreenDrag::set_position(const Vector2 &p_pos) {
|
||||
pos = p_pos;
|
||||
}
|
||||
|
||||
Vector2 InputEventScreenDrag::get_position() const {
|
||||
return pos;
|
||||
}
|
||||
@ -867,6 +884,7 @@ Vector2 InputEventScreenDrag::get_position() const {
|
||||
void InputEventScreenDrag::set_relative(const Vector2 &p_relative) {
|
||||
relative = p_relative;
|
||||
}
|
||||
|
||||
Vector2 InputEventScreenDrag::get_relative() const {
|
||||
return relative;
|
||||
}
|
||||
@ -874,6 +892,7 @@ Vector2 InputEventScreenDrag::get_relative() const {
|
||||
void InputEventScreenDrag::set_speed(const Vector2 &p_speed) {
|
||||
speed = p_speed;
|
||||
}
|
||||
|
||||
Vector2 InputEventScreenDrag::get_speed() const {
|
||||
return speed;
|
||||
}
|
||||
@ -922,6 +941,7 @@ void InputEventScreenDrag::_bind_methods() {
|
||||
void InputEventAction::set_action(const StringName &p_action) {
|
||||
action = p_action;
|
||||
}
|
||||
|
||||
StringName InputEventAction::get_action() const {
|
||||
return action;
|
||||
}
|
||||
@ -929,6 +949,7 @@ StringName InputEventAction::get_action() const {
|
||||
void InputEventAction::set_pressed(bool p_pressed) {
|
||||
pressed = p_pressed;
|
||||
}
|
||||
|
||||
bool InputEventAction::is_pressed() const {
|
||||
return pressed;
|
||||
}
|
||||
|
@ -78,6 +78,7 @@ void ConfigFile::set_value(const String &p_section, const String &p_key, const V
|
||||
values[p_section][p_key] = p_value;
|
||||
}
|
||||
}
|
||||
|
||||
Variant ConfigFile::get_value(const String &p_section, const String &p_key, Variant p_default) const {
|
||||
if (!values.has(p_section) || !values[p_section].has(p_key)) {
|
||||
ERR_FAIL_COND_V_MSG(p_default.get_type() == Variant::NIL, Variant(),
|
||||
@ -91,6 +92,7 @@ Variant ConfigFile::get_value(const String &p_section, const String &p_key, Vari
|
||||
bool ConfigFile::has_section(const String &p_section) const {
|
||||
return values.has(p_section);
|
||||
}
|
||||
|
||||
bool ConfigFile::has_section_key(const String &p_section, const String &p_key) const {
|
||||
if (!values.has(p_section))
|
||||
return false;
|
||||
@ -102,6 +104,7 @@ void ConfigFile::get_sections(List<String> *r_sections) const {
|
||||
r_sections->push_back(E.key());
|
||||
}
|
||||
}
|
||||
|
||||
void ConfigFile::get_section_keys(const String &p_section, List<String> *r_keys) const {
|
||||
ERR_FAIL_COND_MSG(!values.has(p_section), vformat("Cannot get keys from nonexistent section \"%s\".", p_section));
|
||||
|
||||
|
@ -132,6 +132,7 @@ Error FileAccessCompressed::_open(const String &p_path, int p_mode_flags) {
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
void FileAccessCompressed::close() {
|
||||
if (!f)
|
||||
return;
|
||||
@ -221,6 +222,7 @@ void FileAccessCompressed::seek_end(int64_t p_position) {
|
||||
seek(read_total + p_position);
|
||||
}
|
||||
}
|
||||
|
||||
size_t FileAccessCompressed::get_position() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
if (writing) {
|
||||
@ -229,6 +231,7 @@ size_t FileAccessCompressed::get_position() const {
|
||||
return read_block * block_size + read_pos;
|
||||
}
|
||||
}
|
||||
|
||||
size_t FileAccessCompressed::get_len() const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
if (writing) {
|
||||
@ -277,6 +280,7 @@ uint8_t FileAccessCompressed::get_8() const {
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int FileAccessCompressed::get_buffer(uint8_t *p_dst, int p_length) const {
|
||||
ERR_FAIL_COND_V_MSG(!f, 0, "File must be opened before use.");
|
||||
ERR_FAIL_COND_V_MSG(writing, 0, "File has not been opened in read mode.");
|
||||
|
@ -113,6 +113,7 @@ Error FileAccessEncrypted::open_and_parse_password(FileAccess *p_base, const Str
|
||||
Error FileAccessEncrypted::_open(const String &p_path, int p_mode_flags) {
|
||||
return OK;
|
||||
}
|
||||
|
||||
void FileAccessEncrypted::close() {
|
||||
if (!file)
|
||||
return;
|
||||
@ -189,9 +190,11 @@ void FileAccessEncrypted::seek(size_t p_position) {
|
||||
void FileAccessEncrypted::seek_end(int64_t p_position) {
|
||||
seek(data.size() + p_position);
|
||||
}
|
||||
|
||||
size_t FileAccessEncrypted::get_position() const {
|
||||
return pos;
|
||||
}
|
||||
|
||||
size_t FileAccessEncrypted::get_len() const {
|
||||
return data.size();
|
||||
}
|
||||
@ -211,6 +214,7 @@ uint8_t FileAccessEncrypted::get_8() const {
|
||||
pos++;
|
||||
return b;
|
||||
}
|
||||
|
||||
int FileAccessEncrypted::get_buffer(uint8_t *p_dst, int p_length) const {
|
||||
ERR_FAIL_COND_V_MSG(writing, 0, "File has not been opened in read mode.");
|
||||
|
||||
|
@ -300,6 +300,7 @@ void FileAccessNetwork::close() {
|
||||
opened = false;
|
||||
nc->unlock_mutex();
|
||||
}
|
||||
|
||||
bool FileAccessNetwork::is_open() const {
|
||||
return opened;
|
||||
}
|
||||
@ -318,10 +319,12 @@ void FileAccessNetwork::seek(size_t p_position) {
|
||||
void FileAccessNetwork::seek_end(int64_t p_position) {
|
||||
seek(total_size + p_position);
|
||||
}
|
||||
|
||||
size_t FileAccessNetwork::get_position() const {
|
||||
ERR_FAIL_COND_V_MSG(!opened, 0, "File must be opened before use.");
|
||||
return pos;
|
||||
}
|
||||
|
||||
size_t FileAccessNetwork::get_len() const {
|
||||
ERR_FAIL_COND_V_MSG(!opened, 0, "File must be opened before use.");
|
||||
return total_size;
|
||||
|
@ -224,12 +224,15 @@ void FileAccessPack::seek(size_t p_position) {
|
||||
f->seek(pf.offset + p_position);
|
||||
pos = p_position;
|
||||
}
|
||||
|
||||
void FileAccessPack::seek_end(int64_t p_position) {
|
||||
seek(pf.size + p_position);
|
||||
}
|
||||
|
||||
size_t FileAccessPack::get_position() const {
|
||||
return pos;
|
||||
}
|
||||
|
||||
size_t FileAccessPack::get_len() const {
|
||||
return pf.size;
|
||||
}
|
||||
@ -343,12 +346,15 @@ String DirAccessPack::get_next() {
|
||||
return String();
|
||||
}
|
||||
}
|
||||
|
||||
bool DirAccessPack::current_is_dir() const {
|
||||
return cdir;
|
||||
}
|
||||
|
||||
bool DirAccessPack::current_is_hidden() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void DirAccessPack::list_dir_end() {
|
||||
list_dirs.clear();
|
||||
list_files.clear();
|
||||
@ -357,6 +363,7 @@ void DirAccessPack::list_dir_end() {
|
||||
int DirAccessPack::get_drive_count() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
String DirAccessPack::get_drive(int p_drive) {
|
||||
return "";
|
||||
}
|
||||
@ -440,6 +447,7 @@ Error DirAccessPack::make_dir(String p_dir) {
|
||||
Error DirAccessPack::rename(String p_from, String p_to) {
|
||||
return ERR_UNAVAILABLE;
|
||||
}
|
||||
|
||||
Error DirAccessPack::remove(String p_name) {
|
||||
return ERR_UNAVAILABLE;
|
||||
}
|
||||
|
@ -179,6 +179,7 @@ void _profile_node_data(const String &p_what, ObjectID p_id) {
|
||||
EngineDebugger::profiler_add_frame_data("multiplayer", values);
|
||||
}
|
||||
}
|
||||
|
||||
void _profile_bandwidth_data(const String &p_inout, int p_size) {
|
||||
if (EngineDebugger::is_profiling("multiplayer")) {
|
||||
Array values;
|
||||
@ -668,6 +669,7 @@ Error MultiplayerAPI::_encode_and_compress_variant(const Variant &p_variant, uin
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
Error MultiplayerAPI::_decode_and_decompress_variant(Variant &r_variant, const uint8_t *p_buffer, int p_len, int *r_len) {
|
||||
const uint8_t *buf = p_buffer;
|
||||
int len = p_len;
|
||||
|
@ -117,6 +117,7 @@ Variant PacketPeer::_bnd_get_var(bool p_allow_objects) {
|
||||
Error PacketPeer::_put_packet(const Vector<uint8_t> &p_buffer) {
|
||||
return put_packet_buffer(p_buffer);
|
||||
}
|
||||
|
||||
Vector<uint8_t> PacketPeer::_get_packet() {
|
||||
Vector<uint8_t> raw;
|
||||
last_get_error = get_packet_buffer(raw);
|
||||
|
@ -291,6 +291,7 @@ Error PacketPeerUDP::_poll() {
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
bool PacketPeerUDP::is_listening() const {
|
||||
return _sock.is_valid() && _sock->is_open();
|
||||
}
|
||||
|
@ -607,6 +607,7 @@ void ResourceLoaderBinary::set_local_path(const String &p_local_path) {
|
||||
Ref<Resource> ResourceLoaderBinary::get_resource() {
|
||||
return resource;
|
||||
}
|
||||
|
||||
Error ResourceLoaderBinary::load() {
|
||||
if (error != OK)
|
||||
return error;
|
||||
@ -996,6 +997,7 @@ void ResourceFormatLoaderBinary::get_recognized_extensions_for_type(const String
|
||||
p_extensions->push_back(ext);
|
||||
}
|
||||
}
|
||||
|
||||
void ResourceFormatLoaderBinary::get_recognized_extensions(List<String> *p_extensions) const {
|
||||
List<String> extensions;
|
||||
ClassDB::get_resource_base_extensions(&extensions);
|
||||
|
@ -260,6 +260,7 @@ void ResourceLoader::_thread_load_function(void *p_userdata) {
|
||||
|
||||
thread_load_mutex->unlock();
|
||||
}
|
||||
|
||||
Error ResourceLoader::load_threaded_request(const String &p_path, const String &p_type_hint, bool p_use_sub_threads, const String &p_source_resource) {
|
||||
String local_path;
|
||||
if (p_path.is_rel_path())
|
||||
@ -412,6 +413,7 @@ ResourceLoader::ThreadLoadStatus ResourceLoader::load_threaded_get_status(const
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
RES ResourceLoader::load_threaded_get(const String &p_path, Error *r_error) {
|
||||
String local_path;
|
||||
if (p_path.is_rel_path())
|
||||
|
@ -122,6 +122,7 @@ void StreamPeer::put_u8(uint8_t p_val) {
|
||||
void StreamPeer::put_8(int8_t p_val) {
|
||||
put_data((const uint8_t *)&p_val, 1);
|
||||
}
|
||||
|
||||
void StreamPeer::put_u16(uint16_t p_val) {
|
||||
if (big_endian) {
|
||||
p_val = BSWAP16(p_val);
|
||||
@ -130,6 +131,7 @@ void StreamPeer::put_u16(uint16_t p_val) {
|
||||
encode_uint16(p_val, buf);
|
||||
put_data(buf, 2);
|
||||
}
|
||||
|
||||
void StreamPeer::put_16(int16_t p_val) {
|
||||
if (big_endian) {
|
||||
p_val = BSWAP16(p_val);
|
||||
@ -138,6 +140,7 @@ void StreamPeer::put_16(int16_t p_val) {
|
||||
encode_uint16(p_val, buf);
|
||||
put_data(buf, 2);
|
||||
}
|
||||
|
||||
void StreamPeer::put_u32(uint32_t p_val) {
|
||||
if (big_endian) {
|
||||
p_val = BSWAP32(p_val);
|
||||
@ -146,6 +149,7 @@ void StreamPeer::put_u32(uint32_t p_val) {
|
||||
encode_uint32(p_val, buf);
|
||||
put_data(buf, 4);
|
||||
}
|
||||
|
||||
void StreamPeer::put_32(int32_t p_val) {
|
||||
if (big_endian) {
|
||||
p_val = BSWAP32(p_val);
|
||||
@ -154,6 +158,7 @@ void StreamPeer::put_32(int32_t p_val) {
|
||||
encode_uint32(p_val, buf);
|
||||
put_data(buf, 4);
|
||||
}
|
||||
|
||||
void StreamPeer::put_u64(uint64_t p_val) {
|
||||
if (big_endian) {
|
||||
p_val = BSWAP64(p_val);
|
||||
@ -162,6 +167,7 @@ void StreamPeer::put_u64(uint64_t p_val) {
|
||||
encode_uint64(p_val, buf);
|
||||
put_data(buf, 8);
|
||||
}
|
||||
|
||||
void StreamPeer::put_64(int64_t p_val) {
|
||||
if (big_endian) {
|
||||
p_val = BSWAP64(p_val);
|
||||
@ -170,6 +176,7 @@ void StreamPeer::put_64(int64_t p_val) {
|
||||
encode_uint64(p_val, buf);
|
||||
put_data(buf, 8);
|
||||
}
|
||||
|
||||
void StreamPeer::put_float(float p_val) {
|
||||
uint8_t buf[4];
|
||||
|
||||
@ -181,6 +188,7 @@ void StreamPeer::put_float(float p_val) {
|
||||
|
||||
put_data(buf, 4);
|
||||
}
|
||||
|
||||
void StreamPeer::put_double(double p_val) {
|
||||
uint8_t buf[8];
|
||||
encode_double(p_val, buf);
|
||||
@ -190,16 +198,19 @@ void StreamPeer::put_double(double p_val) {
|
||||
}
|
||||
put_data(buf, 8);
|
||||
}
|
||||
|
||||
void StreamPeer::put_string(const String &p_string) {
|
||||
CharString cs = p_string.ascii();
|
||||
put_u32(cs.length());
|
||||
put_data((const uint8_t *)cs.get_data(), cs.length());
|
||||
}
|
||||
|
||||
void StreamPeer::put_utf8_string(const String &p_string) {
|
||||
CharString cs = p_string.utf8();
|
||||
put_u32(cs.length());
|
||||
put_data((const uint8_t *)cs.get_data(), cs.length());
|
||||
}
|
||||
|
||||
void StreamPeer::put_var(const Variant &p_variant, bool p_full_objects) {
|
||||
int len = 0;
|
||||
Vector<uint8_t> buf;
|
||||
@ -215,11 +226,13 @@ uint8_t StreamPeer::get_u8() {
|
||||
get_data(buf, 1);
|
||||
return buf[0];
|
||||
}
|
||||
|
||||
int8_t StreamPeer::get_8() {
|
||||
uint8_t buf[1];
|
||||
get_data(buf, 1);
|
||||
return buf[0];
|
||||
}
|
||||
|
||||
uint16_t StreamPeer::get_u16() {
|
||||
uint8_t buf[2];
|
||||
get_data(buf, 2);
|
||||
@ -229,6 +242,7 @@ uint16_t StreamPeer::get_u16() {
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
int16_t StreamPeer::get_16() {
|
||||
uint8_t buf[2];
|
||||
get_data(buf, 2);
|
||||
@ -238,6 +252,7 @@ int16_t StreamPeer::get_16() {
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
uint32_t StreamPeer::get_u32() {
|
||||
uint8_t buf[4];
|
||||
get_data(buf, 4);
|
||||
@ -247,6 +262,7 @@ uint32_t StreamPeer::get_u32() {
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
int32_t StreamPeer::get_32() {
|
||||
uint8_t buf[4];
|
||||
get_data(buf, 4);
|
||||
@ -256,6 +272,7 @@ int32_t StreamPeer::get_32() {
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
uint64_t StreamPeer::get_u64() {
|
||||
uint8_t buf[8];
|
||||
get_data(buf, 8);
|
||||
@ -265,6 +282,7 @@ uint64_t StreamPeer::get_u64() {
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
int64_t StreamPeer::get_64() {
|
||||
uint8_t buf[8];
|
||||
get_data(buf, 8);
|
||||
@ -274,6 +292,7 @@ int64_t StreamPeer::get_64() {
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
float StreamPeer::get_float() {
|
||||
uint8_t buf[4];
|
||||
get_data(buf, 4);
|
||||
@ -297,6 +316,7 @@ double StreamPeer::get_double() {
|
||||
|
||||
return decode_double(buf);
|
||||
}
|
||||
|
||||
String StreamPeer::get_string(int p_bytes) {
|
||||
if (p_bytes < 0)
|
||||
p_bytes = get_u32();
|
||||
@ -310,6 +330,7 @@ String StreamPeer::get_string(int p_bytes) {
|
||||
buf.write[p_bytes] = 0;
|
||||
return buf.ptr();
|
||||
}
|
||||
|
||||
String StreamPeer::get_utf8_string(int p_bytes) {
|
||||
if (p_bytes < 0)
|
||||
p_bytes = get_u32();
|
||||
@ -325,6 +346,7 @@ String StreamPeer::get_utf8_string(int p_bytes) {
|
||||
ret.parse_utf8((const char *)buf.ptr(), buf.size());
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant StreamPeer::get_var(bool p_allow_objects) {
|
||||
int len = get_32();
|
||||
Vector<uint8_t> var;
|
||||
@ -382,6 +404,7 @@ void StreamPeer::_bind_methods() {
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "big_endian"), "set_big_endian", "is_big_endian_enabled");
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
|
||||
void StreamPeerBuffer::_bind_methods() {
|
||||
@ -455,6 +478,7 @@ void StreamPeerBuffer::seek(int p_pos) {
|
||||
ERR_FAIL_COND(p_pos > data.size());
|
||||
pointer = p_pos;
|
||||
}
|
||||
|
||||
int StreamPeerBuffer::get_size() const {
|
||||
return data.size();
|
||||
}
|
||||
|
@ -190,6 +190,7 @@ void TranslationLoaderPO::get_recognized_extensions(List<String> *p_extensions)
|
||||
p_extensions->push_back("po");
|
||||
//p_extensions->push_back("mo"); //mo in the future...
|
||||
}
|
||||
|
||||
bool TranslationLoaderPO::handles_type(const String &p_type) const {
|
||||
return (p_type == "Translation");
|
||||
}
|
||||
|
@ -390,6 +390,7 @@ Error XMLParser::read() {
|
||||
XMLParser::NodeType XMLParser::get_node_type() {
|
||||
return node_type;
|
||||
}
|
||||
|
||||
String XMLParser::get_node_data() const {
|
||||
ERR_FAIL_COND_V(node_type != NODE_TEXT, "");
|
||||
return node_name;
|
||||
@ -399,17 +400,21 @@ String XMLParser::get_node_name() const {
|
||||
ERR_FAIL_COND_V(node_type == NODE_TEXT, "");
|
||||
return node_name;
|
||||
}
|
||||
|
||||
int XMLParser::get_attribute_count() const {
|
||||
return attributes.size();
|
||||
}
|
||||
|
||||
String XMLParser::get_attribute_name(int p_idx) const {
|
||||
ERR_FAIL_INDEX_V(p_idx, attributes.size(), "");
|
||||
return attributes[p_idx].name;
|
||||
}
|
||||
|
||||
String XMLParser::get_attribute_value(int p_idx) const {
|
||||
ERR_FAIL_INDEX_V(p_idx, attributes.size(), "");
|
||||
return attributes[p_idx].value;
|
||||
}
|
||||
|
||||
bool XMLParser::has_attribute(const String &p_name) const {
|
||||
for (int i = 0; i < attributes.size(); i++) {
|
||||
if (attributes[i].name == p_name)
|
||||
@ -418,6 +423,7 @@ bool XMLParser::has_attribute(const String &p_name) const {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
String XMLParser::get_attribute_value(const String &p_name) const {
|
||||
int idx = -1;
|
||||
for (int i = 0; i < attributes.size(); i++) {
|
||||
@ -445,6 +451,7 @@ String XMLParser::get_attribute_value_safe(const String &p_name) const {
|
||||
return "";
|
||||
return attributes[idx].value;
|
||||
}
|
||||
|
||||
bool XMLParser::is_empty() const {
|
||||
return node_empty;
|
||||
}
|
||||
@ -526,6 +533,7 @@ XMLParser::XMLParser() {
|
||||
special_characters.push_back("\"quot;");
|
||||
special_characters.push_back("'apos;");
|
||||
}
|
||||
|
||||
XMLParser::~XMLParser() {
|
||||
if (data)
|
||||
memdelete_arr(data);
|
||||
|
@ -39,6 +39,7 @@ real_t AABB::get_area() const {
|
||||
bool AABB::operator==(const AABB &p_rval) const {
|
||||
return ((position == p_rval.position) && (size == p_rval.size));
|
||||
}
|
||||
|
||||
bool AABB::operator!=(const AABB &p_rval) const {
|
||||
return ((position != p_rval.position) || (size != p_rval.size));
|
||||
}
|
||||
@ -238,6 +239,7 @@ Vector3 AABB::get_longest_axis() const {
|
||||
|
||||
return axis;
|
||||
}
|
||||
|
||||
int AABB::get_longest_axis_index() const {
|
||||
int axis = 0;
|
||||
real_t max_size = size.x;
|
||||
@ -269,6 +271,7 @@ Vector3 AABB::get_shortest_axis() const {
|
||||
|
||||
return axis;
|
||||
}
|
||||
|
||||
int AABB::get_shortest_axis_index() const {
|
||||
int axis = 0;
|
||||
real_t max_size = size.x;
|
||||
@ -290,11 +293,13 @@ AABB AABB::merge(const AABB &p_with) const {
|
||||
aabb.merge_with(p_with);
|
||||
return aabb;
|
||||
}
|
||||
|
||||
AABB AABB::expand(const Vector3 &p_vector) const {
|
||||
AABB aabb = *this;
|
||||
aabb.expand_to(p_vector);
|
||||
return aabb;
|
||||
}
|
||||
|
||||
AABB AABB::grow(real_t p_by) const {
|
||||
AABB aabb = *this;
|
||||
aabb.grow_by(p_by);
|
||||
|
@ -327,6 +327,7 @@ void Basis::rotate_local(const Vector3 &p_axis, real_t p_phi) {
|
||||
// M -> (M.R.Minv).M = M.R.
|
||||
*this = rotated_local(p_axis, p_phi);
|
||||
}
|
||||
|
||||
Basis Basis::rotated_local(const Vector3 &p_axis, real_t p_phi) const {
|
||||
return (*this) * Basis(p_axis, p_phi);
|
||||
}
|
||||
|
@ -238,6 +238,7 @@ real_t CameraMatrix::get_z_far() const {
|
||||
|
||||
return new_plane.d;
|
||||
}
|
||||
|
||||
real_t CameraMatrix::get_z_near() const {
|
||||
const real_t *matrix = (const real_t *)this->matrix;
|
||||
Plane new_plane = Plane(matrix[3] + matrix[2],
|
||||
|
@ -51,6 +51,7 @@ bool Geometry::is_point_in_polygon(const Vector2 &p_point, const Vector<Vector2>
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
void Geometry::MeshData::optimize_vertices() {
|
||||
|
@ -1218,6 +1218,7 @@ void Octree<T, use_pairs, AL>::set_pair_callback(PairCallback p_callback, void *
|
||||
pair_callback = p_callback;
|
||||
pair_callback_userdata = p_userdata;
|
||||
}
|
||||
|
||||
template <class T, bool use_pairs, class AL>
|
||||
void Octree<T, use_pairs, AL>::set_unpair_callback(UnpairCallback p_callback, void *p_userdata) {
|
||||
unpair_callback = p_callback;
|
||||
|
@ -145,6 +145,7 @@ void Transform::scale_basis(const Vector3 &p_scale) {
|
||||
void Transform::translate(real_t p_tx, real_t p_ty, real_t p_tz) {
|
||||
translate(Vector3(p_tx, p_ty, p_tz));
|
||||
}
|
||||
|
||||
void Transform::translate(const Vector3 &p_translation) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
origin[i] += basis[i].dot(p_translation);
|
||||
@ -174,6 +175,7 @@ bool Transform::is_equal_approx(const Transform &p_transform) const {
|
||||
bool Transform::operator==(const Transform &p_transform) const {
|
||||
return (basis == p_transform.basis && origin == p_transform.origin);
|
||||
}
|
||||
|
||||
bool Transform::operator!=(const Transform &p_transform) const {
|
||||
return (basis != p_transform.basis || origin != p_transform.origin);
|
||||
}
|
||||
|
@ -117,6 +117,7 @@ _FORCE_INLINE_ Vector3 Transform::xform(const Vector3 &p_vector) const {
|
||||
basis[1].dot(p_vector) + origin.y,
|
||||
basis[2].dot(p_vector) + origin.z);
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ Vector3 Transform::xform_inv(const Vector3 &p_vector) const {
|
||||
Vector3 v = p_vector - origin;
|
||||
|
||||
@ -138,6 +139,7 @@ _FORCE_INLINE_ Plane Transform::xform(const Plane &p_plane) const {
|
||||
|
||||
return Plane(normal, d);
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ Plane Transform::xform_inv(const Plane &p_plane) const {
|
||||
Vector3 point = p_plane.normal * p_plane.d;
|
||||
Vector3 point_dir = point + p_plane.normal;
|
||||
|
@ -123,15 +123,18 @@ void Transform2D::scale(const Size2 &p_scale) {
|
||||
scale_basis(p_scale);
|
||||
elements[2] *= p_scale;
|
||||
}
|
||||
|
||||
void Transform2D::scale_basis(const Size2 &p_scale) {
|
||||
elements[0][0] *= p_scale.x;
|
||||
elements[0][1] *= p_scale.y;
|
||||
elements[1][0] *= p_scale.x;
|
||||
elements[1][1] *= p_scale.y;
|
||||
}
|
||||
|
||||
void Transform2D::translate(real_t p_tx, real_t p_ty) {
|
||||
translate(Vector2(p_tx, p_ty));
|
||||
}
|
||||
|
||||
void Transform2D::translate(const Vector2 &p_translation) {
|
||||
elements[2] += basis_xform(p_translation);
|
||||
}
|
||||
|
@ -153,6 +153,7 @@ Vector2 Transform2D::xform(const Vector2 &p_vec) const {
|
||||
tdoty(p_vec)) +
|
||||
elements[2];
|
||||
}
|
||||
|
||||
Vector2 Transform2D::xform_inv(const Vector2 &p_vec) const {
|
||||
Vector2 v = p_vec - elements[2];
|
||||
|
||||
@ -160,6 +161,7 @@ Vector2 Transform2D::xform_inv(const Vector2 &p_vec) const {
|
||||
elements[0].dot(v),
|
||||
elements[1].dot(v));
|
||||
}
|
||||
|
||||
Rect2 Transform2D::xform(const Rect2 &p_rect) const {
|
||||
Vector2 x = elements[0] * p_rect.size.x;
|
||||
Vector2 y = elements[1] * p_rect.size.y;
|
||||
|
@ -192,13 +192,16 @@ bool Vector2::is_equal_approx(const Vector2 &p_v) const {
|
||||
Vector2i Vector2i::operator+(const Vector2i &p_v) const {
|
||||
return Vector2i(x + p_v.x, y + p_v.y);
|
||||
}
|
||||
|
||||
void Vector2i::operator+=(const Vector2i &p_v) {
|
||||
x += p_v.x;
|
||||
y += p_v.y;
|
||||
}
|
||||
|
||||
Vector2i Vector2i::operator-(const Vector2i &p_v) const {
|
||||
return Vector2i(x - p_v.x, y - p_v.y);
|
||||
}
|
||||
|
||||
void Vector2i::operator-=(const Vector2i &p_v) {
|
||||
x -= p_v.x;
|
||||
y -= p_v.y;
|
||||
@ -236,6 +239,7 @@ Vector2i Vector2i::operator-() const {
|
||||
bool Vector2i::operator==(const Vector2i &p_vec2) const {
|
||||
return x == p_vec2.x && y == p_vec2.y;
|
||||
}
|
||||
|
||||
bool Vector2i::operator!=(const Vector2i &p_vec2) const {
|
||||
return x != p_vec2.x || y != p_vec2.y;
|
||||
}
|
||||
|
@ -157,13 +157,16 @@ _FORCE_INLINE_ Vector2 operator*(real_t p_scalar, const Vector2 &p_vec) {
|
||||
_FORCE_INLINE_ Vector2 Vector2::operator+(const Vector2 &p_v) const {
|
||||
return Vector2(x + p_v.x, y + p_v.y);
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ void Vector2::operator+=(const Vector2 &p_v) {
|
||||
x += p_v.x;
|
||||
y += p_v.y;
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ Vector2 Vector2::operator-(const Vector2 &p_v) const {
|
||||
return Vector2(x - p_v.x, y - p_v.y);
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ void Vector2::operator-=(const Vector2 &p_v) {
|
||||
x -= p_v.x;
|
||||
y -= p_v.y;
|
||||
@ -201,6 +204,7 @@ _FORCE_INLINE_ Vector2 Vector2::operator-() const {
|
||||
_FORCE_INLINE_ bool Vector2::operator==(const Vector2 &p_vec2) const {
|
||||
return x == p_vec2.x && y == p_vec2.y;
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ bool Vector2::operator!=(const Vector2 &p_vec2) const {
|
||||
return x != p_vec2.x || y != p_vec2.y;
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ void Vector3::set_axis(int p_axis, real_t p_value) {
|
||||
ERR_FAIL_INDEX(p_axis, 3);
|
||||
coord[p_axis] = p_value;
|
||||
}
|
||||
|
||||
real_t Vector3::get_axis(int p_axis) const {
|
||||
ERR_FAIL_INDEX_V(p_axis, 3, 0);
|
||||
return operator[](p_axis);
|
||||
@ -54,6 +55,7 @@ real_t Vector3::get_axis(int p_axis) const {
|
||||
int Vector3::min_axis() const {
|
||||
return x < y ? (x < z ? 0 : 2) : (y < z ? 1 : 2);
|
||||
}
|
||||
|
||||
int Vector3::max_axis() const {
|
||||
return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0);
|
||||
}
|
||||
@ -63,6 +65,7 @@ void Vector3::snap(Vector3 p_val) {
|
||||
y = Math::stepify(y, p_val.y);
|
||||
z = Math::stepify(z, p_val.z);
|
||||
}
|
||||
|
||||
Vector3 Vector3::snapped(Vector3 p_val) const {
|
||||
Vector3 v = *this;
|
||||
v.snap(p_val);
|
||||
|
@ -256,6 +256,7 @@ Vector3 &Vector3::operator-=(const Vector3 &p_v) {
|
||||
z -= p_v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3 Vector3::operator-(const Vector3 &p_v) const {
|
||||
return Vector3(x - p_v.x, y - p_v.y, z - p_v.z);
|
||||
}
|
||||
@ -266,6 +267,7 @@ Vector3 &Vector3::operator*=(const Vector3 &p_v) {
|
||||
z *= p_v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3 Vector3::operator*(const Vector3 &p_v) const {
|
||||
return Vector3(x * p_v.x, y * p_v.y, z * p_v.z);
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ void Vector3i::set_axis(int p_axis, int32_t p_value) {
|
||||
ERR_FAIL_INDEX(p_axis, 3);
|
||||
coord[p_axis] = p_value;
|
||||
}
|
||||
|
||||
int32_t Vector3i::get_axis(int p_axis) const {
|
||||
ERR_FAIL_INDEX_V(p_axis, 3, 0);
|
||||
return operator[](p_axis);
|
||||
@ -42,6 +43,7 @@ int32_t Vector3i::get_axis(int p_axis) const {
|
||||
int Vector3i::min_axis() const {
|
||||
return x < y ? (x < z ? 0 : 2) : (y < z ? 1 : 2);
|
||||
}
|
||||
|
||||
int Vector3i::max_axis() const {
|
||||
return x < y ? (y < z ? 2 : 1) : (x < z ? 2 : 0);
|
||||
}
|
||||
|
@ -132,6 +132,7 @@ Vector3i &Vector3i::operator-=(const Vector3i &p_v) {
|
||||
z -= p_v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3i Vector3i::operator-(const Vector3i &p_v) const {
|
||||
return Vector3i(x - p_v.x, y - p_v.y, z - p_v.z);
|
||||
}
|
||||
@ -142,6 +143,7 @@ Vector3i &Vector3i::operator*=(const Vector3i &p_v) {
|
||||
z *= p_v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector3i Vector3i::operator*(const Vector3i &p_v) const {
|
||||
return Vector3i(x * p_v.x, y * p_v.y, z * p_v.z);
|
||||
}
|
||||
|
@ -118,6 +118,7 @@ Error MessageQueue::push_call(Object *p_object, const StringName &p_method, VARI
|
||||
Error MessageQueue::push_notification(Object *p_object, int p_notification) {
|
||||
return push_notification(p_object->get_instance_id(), p_notification);
|
||||
}
|
||||
|
||||
Error MessageQueue::push_set(Object *p_object, const StringName &p_prop, const Variant &p_value) {
|
||||
return push_set(p_object->get_instance_id(), p_prop, p_value);
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ void MethodBind::_set_returns(bool p_returns) {
|
||||
StringName MethodBind::get_name() const {
|
||||
return name;
|
||||
}
|
||||
|
||||
void MethodBind::set_name(const StringName &p_name) {
|
||||
name = p_name;
|
||||
}
|
||||
@ -67,6 +68,7 @@ void MethodBind::set_name(const StringName &p_name) {
|
||||
void MethodBind::set_argument_names(const Vector<StringName> &p_names) {
|
||||
arg_names = p_names;
|
||||
}
|
||||
|
||||
Vector<StringName> MethodBind::get_argument_names() const {
|
||||
return arg_names;
|
||||
}
|
||||
|
@ -62,12 +62,14 @@ bool NodePath::is_absolute() const {
|
||||
|
||||
return data->absolute;
|
||||
}
|
||||
|
||||
int NodePath::get_name_count() const {
|
||||
if (!data)
|
||||
return 0;
|
||||
|
||||
return data->path.size();
|
||||
}
|
||||
|
||||
StringName NodePath::get_name(int p_idx) const {
|
||||
ERR_FAIL_COND_V(!data, StringName());
|
||||
ERR_FAIL_INDEX_V(p_idx, data->path.size(), StringName());
|
||||
@ -80,6 +82,7 @@ int NodePath::get_subname_count() const {
|
||||
|
||||
return data->subpath.size();
|
||||
}
|
||||
|
||||
StringName NodePath::get_subname(int p_idx) const {
|
||||
ERR_FAIL_COND_V(!data, StringName());
|
||||
ERR_FAIL_INDEX_V(p_idx, data->subpath.size(), StringName());
|
||||
@ -133,6 +136,7 @@ bool NodePath::operator==(const NodePath &p_path) const {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool NodePath::operator!=(const NodePath &p_path) const {
|
||||
return (!(*this == p_path));
|
||||
}
|
||||
|
@ -160,11 +160,13 @@ MethodInfo::MethodInfo(const String &p_name) :
|
||||
name(p_name),
|
||||
flags(METHOD_FLAG_NORMAL) {
|
||||
}
|
||||
|
||||
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1) :
|
||||
name(p_name),
|
||||
flags(METHOD_FLAG_NORMAL) {
|
||||
arguments.push_back(p_param1);
|
||||
}
|
||||
|
||||
MethodInfo::MethodInfo(const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) :
|
||||
name(p_name),
|
||||
flags(METHOD_FLAG_NORMAL) {
|
||||
@ -209,12 +211,14 @@ MethodInfo::MethodInfo(Variant::Type ret, const String &p_name) :
|
||||
flags(METHOD_FLAG_NORMAL) {
|
||||
return_val.type = ret;
|
||||
}
|
||||
|
||||
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1) :
|
||||
name(p_name),
|
||||
flags(METHOD_FLAG_NORMAL) {
|
||||
return_val.type = ret;
|
||||
arguments.push_back(p_param1);
|
||||
}
|
||||
|
||||
MethodInfo::MethodInfo(Variant::Type ret, const String &p_name, const PropertyInfo &p_param1, const PropertyInfo &p_param2) :
|
||||
name(p_name),
|
||||
flags(METHOD_FLAG_NORMAL) {
|
||||
@ -320,6 +324,7 @@ bool Object::Connection::operator<(const Connection &p_conn) const {
|
||||
return signal < p_conn.signal;
|
||||
}
|
||||
}
|
||||
|
||||
Object::Connection::Connection(const Variant &p_variant) {
|
||||
Dictionary d = p_variant;
|
||||
if (d.has("signal"))
|
||||
@ -349,6 +354,7 @@ void Object::_postinitialize() {
|
||||
|
||||
void Object::get_valid_parents_static(List<String> *p_parents) {
|
||||
}
|
||||
|
||||
void Object::_get_valid_parents_static(List<String> *p_parents) {
|
||||
}
|
||||
|
||||
@ -739,6 +745,7 @@ Variant Object::getvar(const Variant &p_key, bool *r_valid) const {
|
||||
*r_valid = false;
|
||||
return Variant();
|
||||
}
|
||||
|
||||
void Object::setvar(const Variant &p_key, const Variant &p_value, bool *r_valid) {
|
||||
if (r_valid)
|
||||
*r_valid = false;
|
||||
@ -997,6 +1004,7 @@ Vector<String> Object::_get_meta_list_bind() const {
|
||||
|
||||
return _metaret;
|
||||
}
|
||||
|
||||
void Object::get_meta_list(List<String> *p_list) const {
|
||||
List<Variant> keys;
|
||||
metadata.get_key_list(&keys);
|
||||
@ -1318,6 +1326,7 @@ void Object::get_signals_connected_to_this(List<Connection> *p_connections) cons
|
||||
Error Object::connect_compat(const StringName &p_signal, Object *p_to_object, const StringName &p_to_method, const Vector<Variant> &p_binds, uint32_t p_flags) {
|
||||
return connect(p_signal, Callable(p_to_object, p_to_method), p_binds, p_flags);
|
||||
}
|
||||
|
||||
Error Object::connect(const StringName &p_signal, const Callable &p_callable, const Vector<Variant> &p_binds, uint32_t p_flags) {
|
||||
ERR_FAIL_COND_V(p_callable.is_null(), ERR_INVALID_PARAMETER);
|
||||
|
||||
|
@ -45,6 +45,7 @@ String DirAccess::_get_root_path() const {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
String DirAccess::_get_root_string() const {
|
||||
switch (_access_type) {
|
||||
case ACCESS_RESOURCES:
|
||||
|
@ -170,6 +170,7 @@ uint16_t FileAccess::get_16() const {
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
uint32_t FileAccess::get_32() const {
|
||||
uint32_t res;
|
||||
uint16_t a, b;
|
||||
@ -187,6 +188,7 @@ uint32_t FileAccess::get_32() const {
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
uint64_t FileAccess::get_64() const {
|
||||
uint64_t res;
|
||||
uint32_t a, b;
|
||||
@ -394,6 +396,7 @@ void FileAccess::store_16(uint16_t p_dest) {
|
||||
store_8(a);
|
||||
store_8(b);
|
||||
}
|
||||
|
||||
void FileAccess::store_32(uint32_t p_dest) {
|
||||
uint16_t a, b;
|
||||
|
||||
@ -407,6 +410,7 @@ void FileAccess::store_32(uint32_t p_dest) {
|
||||
store_16(a);
|
||||
store_16(b);
|
||||
}
|
||||
|
||||
void FileAccess::store_64(uint64_t p_dest) {
|
||||
uint32_t a, b;
|
||||
|
||||
|
@ -65,12 +65,14 @@ void MainLoop::init() {
|
||||
if (get_script_instance())
|
||||
get_script_instance()->call("_initialize");
|
||||
}
|
||||
|
||||
bool MainLoop::iteration(float p_time) {
|
||||
if (get_script_instance())
|
||||
return get_script_instance()->call("_iteration", p_time);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MainLoop::idle(float p_time) {
|
||||
if (get_script_instance())
|
||||
return get_script_instance()->call("_idle", p_time);
|
||||
|
@ -82,15 +82,18 @@ String OS::get_iso_date_time(bool local) const {
|
||||
uint64_t OS::get_splash_tick_msec() const {
|
||||
return _msec_splash;
|
||||
}
|
||||
|
||||
uint64_t OS::get_unix_time() const {
|
||||
return 0;
|
||||
};
|
||||
uint64_t OS::get_system_time_secs() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t OS::get_system_time_msecs() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OS::debug_break(){
|
||||
|
||||
// something
|
||||
@ -224,6 +227,7 @@ bool OS::is_no_window_mode_enabled() const {
|
||||
int OS::get_exit_code() const {
|
||||
return _exit_code;
|
||||
}
|
||||
|
||||
void OS::set_exit_code(int p_code) {
|
||||
_exit_code = p_code;
|
||||
}
|
||||
|
@ -329,6 +329,7 @@ Variant PackedDataContainer::_iter_init(const Array &p_iter) {
|
||||
Variant PackedDataContainer::_iter_next(const Array &p_iter) {
|
||||
return _iter_next_ofs(p_iter, 0);
|
||||
}
|
||||
|
||||
Variant PackedDataContainer::_iter_get(const Variant &p_iter) {
|
||||
return _iter_get_ofs(p_iter, 0);
|
||||
}
|
||||
@ -354,6 +355,7 @@ Variant PackedDataContainerRef::_iter_init(const Array &p_iter) {
|
||||
Variant PackedDataContainerRef::_iter_next(const Array &p_iter) {
|
||||
return from->_iter_next_ofs(p_iter, offset);
|
||||
}
|
||||
|
||||
Variant PackedDataContainerRef::_iter_get(const Variant &p_iter) {
|
||||
return from->_iter_get_ofs(p_iter, offset);
|
||||
}
|
||||
|
@ -491,6 +491,7 @@ void *PoolAllocator::get(ID p_mem) {
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void PoolAllocator::unlock(ID p_mem) {
|
||||
if (!needs_locking)
|
||||
return;
|
||||
|
@ -114,6 +114,7 @@ void ProjectSettings::set_initial_value(const String &p_name, const Variant &p_v
|
||||
ERR_FAIL_COND_MSG(!props.has(p_name), "Request for nonexistent project setting: " + p_name + ".");
|
||||
props[p_name].initial = p_value;
|
||||
}
|
||||
|
||||
void ProjectSettings::set_restart_if_changed(const String &p_name, bool p_restart) {
|
||||
ERR_FAIL_COND_MSG(!props.has(p_name), "Request for nonexistent project setting: " + p_name + ".");
|
||||
props[p_name].restart_if_changed = p_restart;
|
||||
@ -181,6 +182,7 @@ bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ProjectSettings::_get(const StringName &p_name, Variant &r_ret) const {
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
|
@ -105,6 +105,7 @@ void Resource::set_name(const String &p_name) {
|
||||
name = p_name;
|
||||
_change_notify("resource_name");
|
||||
}
|
||||
|
||||
String Resource::get_name() const {
|
||||
return name;
|
||||
}
|
||||
@ -444,6 +445,7 @@ bool ResourceCache::has(const String &p_path) {
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
Resource *ResourceCache::get(const String &p_path) {
|
||||
lock->read_lock();
|
||||
|
||||
|
@ -215,16 +215,20 @@ void ScriptServer::add_global_class(const StringName &p_class, const StringName
|
||||
g.base = p_base;
|
||||
global_classes[p_class] = g;
|
||||
}
|
||||
|
||||
void ScriptServer::remove_global_class(const StringName &p_class) {
|
||||
global_classes.erase(p_class);
|
||||
}
|
||||
|
||||
bool ScriptServer::is_global_class(const StringName &p_class) {
|
||||
return global_classes.has(p_class);
|
||||
}
|
||||
|
||||
StringName ScriptServer::get_global_class_language(const StringName &p_class) {
|
||||
ERR_FAIL_COND_V(!global_classes.has(p_class), StringName());
|
||||
return global_classes[p_class].language;
|
||||
}
|
||||
|
||||
String ScriptServer::get_global_class_path(const String &p_class) {
|
||||
ERR_FAIL_COND_V(!global_classes.has(p_class), String());
|
||||
return global_classes[p_class].path;
|
||||
@ -234,6 +238,7 @@ StringName ScriptServer::get_global_class_base(const String &p_class) {
|
||||
ERR_FAIL_COND_V(!global_classes.has(p_class), String());
|
||||
return global_classes[p_class].base;
|
||||
}
|
||||
|
||||
StringName ScriptServer::get_global_class_native_base(const String &p_class) {
|
||||
ERR_FAIL_COND_V(!global_classes.has(p_class), String());
|
||||
String base = global_classes[p_class].base;
|
||||
@ -242,6 +247,7 @@ StringName ScriptServer::get_global_class_native_base(const String &p_class) {
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
void ScriptServer::get_global_class_list(List<StringName> *r_global_classes) {
|
||||
const StringName *K = nullptr;
|
||||
List<StringName> classes;
|
||||
@ -253,6 +259,7 @@ void ScriptServer::get_global_class_list(List<StringName> *r_global_classes) {
|
||||
r_global_classes->push_back(E->get());
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptServer::save_global_classes() {
|
||||
List<StringName> gc;
|
||||
get_global_class_list(&gc);
|
||||
@ -366,6 +373,7 @@ bool PlaceHolderScriptInstance::set(const StringName &p_name, const Variant &p_v
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool PlaceHolderScriptInstance::get(const StringName &p_name, Variant &r_ret) const {
|
||||
if (values.has(p_name)) {
|
||||
r_ret = values[p_name];
|
||||
@ -431,6 +439,7 @@ void PlaceHolderScriptInstance::get_method_list(List<MethodInfo> *p_list) const
|
||||
script->get_script_method_list(p_list);
|
||||
}
|
||||
}
|
||||
|
||||
bool PlaceHolderScriptInstance::has_method(const StringName &p_method) const {
|
||||
if (script->is_placeholder_fallback_enabled())
|
||||
return false;
|
||||
|
@ -334,6 +334,7 @@ StringName StringName::search(const CharType *p_name) {
|
||||
|
||||
return StringName(); //does not exist
|
||||
}
|
||||
|
||||
StringName StringName::search(const String &p_name) {
|
||||
ERR_FAIL_COND_V(p_name == "", StringName());
|
||||
|
||||
|
@ -851,6 +851,7 @@ void Translation::set_locale(const String &p_locale) {
|
||||
void Translation::add_message(const StringName &p_src_text, const StringName &p_xlated_text) {
|
||||
translation_map[p_src_text] = p_xlated_text;
|
||||
}
|
||||
|
||||
StringName Translation::get_message(const StringName &p_src_text) const {
|
||||
const Map<StringName, StringName>::Element *E = translation_map.find(p_src_text);
|
||||
if (!E)
|
||||
@ -1011,6 +1012,7 @@ Vector<String> TranslationServer::get_all_locale_names() {
|
||||
void TranslationServer::add_translation(const Ref<Translation> &p_translation) {
|
||||
translations.insert(p_translation);
|
||||
}
|
||||
|
||||
void TranslationServer::remove_translation(const Ref<Translation> &p_translation) {
|
||||
translations.erase(p_translation);
|
||||
}
|
||||
|
@ -136,6 +136,7 @@ void UndoRedo::add_undo_method(Object *p_object, const StringName &p_method, VAR
|
||||
}
|
||||
actions.write[current_action + 1].undo_ops.push_back(undo_op);
|
||||
}
|
||||
|
||||
void UndoRedo::add_do_property(Object *p_object, const StringName &p_property, const Variant &p_value) {
|
||||
ERR_FAIL_COND(p_object == nullptr);
|
||||
ERR_FAIL_COND(action_level <= 0);
|
||||
@ -150,6 +151,7 @@ void UndoRedo::add_do_property(Object *p_object, const StringName &p_property, c
|
||||
do_op.args[0] = p_value;
|
||||
actions.write[current_action + 1].do_ops.push_back(do_op);
|
||||
}
|
||||
|
||||
void UndoRedo::add_undo_property(Object *p_object, const StringName &p_property, const Variant &p_value) {
|
||||
ERR_FAIL_COND(p_object == nullptr);
|
||||
ERR_FAIL_COND(action_level <= 0);
|
||||
@ -169,6 +171,7 @@ void UndoRedo::add_undo_property(Object *p_object, const StringName &p_property,
|
||||
undo_op.args[0] = p_value;
|
||||
actions.write[current_action + 1].undo_ops.push_back(undo_op);
|
||||
}
|
||||
|
||||
void UndoRedo::add_do_reference(Object *p_object) {
|
||||
ERR_FAIL_COND(p_object == nullptr);
|
||||
ERR_FAIL_COND(action_level <= 0);
|
||||
@ -181,6 +184,7 @@ void UndoRedo::add_do_reference(Object *p_object) {
|
||||
do_op.type = Operation::TYPE_REFERENCE;
|
||||
actions.write[current_action + 1].do_ops.push_back(do_op);
|
||||
}
|
||||
|
||||
void UndoRedo::add_undo_reference(Object *p_object) {
|
||||
ERR_FAIL_COND(p_object == nullptr);
|
||||
ERR_FAIL_COND(action_level <= 0);
|
||||
|
@ -247,6 +247,7 @@ String String::operator+(CharType p_chr) const {
|
||||
res+=p_chr;
|
||||
return res;
|
||||
}
|
||||
|
||||
*/
|
||||
String &String::operator+=(const String &p_str) {
|
||||
if (empty()) {
|
||||
@ -607,6 +608,7 @@ String String::get_with_code_lines() const {
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int String::get_slice_count(String p_splitter) const {
|
||||
if (empty())
|
||||
return 0;
|
||||
@ -959,6 +961,7 @@ String String::chr(CharType p_char) {
|
||||
CharType c[2] = { p_char, 0 };
|
||||
return String(c);
|
||||
}
|
||||
|
||||
String String::num(double p_num, int p_decimals) {
|
||||
#ifndef NO_USE_STDLIB
|
||||
|
||||
@ -1522,6 +1525,7 @@ String::String(CharType p_char) {
|
||||
shared=nullptr;
|
||||
copy_from(p_char);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
String::String(const char *p_str) {
|
||||
@ -2073,6 +2077,7 @@ String operator+(const char *p_chr, const String &p_str) {
|
||||
tmp += p_str;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
String operator+(CharType p_chr, const String &p_str) {
|
||||
return (String::chr(p_chr) + p_str);
|
||||
}
|
||||
@ -2217,6 +2222,7 @@ String String::insert(int p_at_pos, const String &p_string) const {
|
||||
|
||||
return pre + p_string + post;
|
||||
}
|
||||
|
||||
String String::substr(int p_from, int p_chars) const {
|
||||
if (p_chars == -1)
|
||||
p_chars = length() - p_from;
|
||||
@ -2467,6 +2473,7 @@ int String::rfind(const String &p_str, int p_from) const {
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int String::rfindn(const String &p_str, int p_from) const {
|
||||
// establish a limit
|
||||
int limit = length() - p_str.length();
|
||||
@ -2540,6 +2547,7 @@ bool String::begins_with(const String &p_string) const {
|
||||
// only if i == l the p_string matches the beginning
|
||||
return i == l;
|
||||
}
|
||||
|
||||
bool String::begins_with(const char *p_string) const {
|
||||
int l = length();
|
||||
if (l == 0 || !p_string)
|
||||
@ -2846,6 +2854,7 @@ String String::replace_first(const String &p_key, const String &p_with) const {
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
String String::replacen(const String &p_key, const String &p_with) const {
|
||||
String new_string;
|
||||
int search_from = 0;
|
||||
@ -3110,6 +3119,7 @@ String String::humanize_size(uint64_t p_size) {
|
||||
|
||||
return String::num(p_size / divisor).pad_decimals(digits) + " " + prefixes[prefix_idx];
|
||||
}
|
||||
|
||||
bool String::is_abs_path() const {
|
||||
if (length() > 1)
|
||||
return (operator[](0) == '/' || operator[](0) == '\\' || find(":/") != -1 || find(":\\") != -1);
|
||||
@ -3742,6 +3752,7 @@ String String::percent_encode() const {
|
||||
|
||||
return encoded;
|
||||
}
|
||||
|
||||
String String::percent_decode() const {
|
||||
CharString pe;
|
||||
|
||||
@ -3824,6 +3835,7 @@ String String::rpad(int min_length, const String &character) const {
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
// Left-pad with a character.
|
||||
String String::lpad(int min_length, const String &character) const {
|
||||
String s = *this;
|
||||
|
@ -1374,6 +1374,7 @@ Variant::operator signed int() const {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Variant::operator unsigned int() const {
|
||||
switch (type) {
|
||||
case NIL:
|
||||
@ -1517,6 +1518,7 @@ Variant::operator signed short() const {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Variant::operator unsigned short() const {
|
||||
switch (type) {
|
||||
case NIL:
|
||||
@ -1534,6 +1536,7 @@ Variant::operator unsigned short() const {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Variant::operator signed char() const {
|
||||
switch (type) {
|
||||
case NIL:
|
||||
@ -1551,6 +1554,7 @@ Variant::operator signed char() const {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Variant::operator unsigned char() const {
|
||||
switch (type) {
|
||||
case NIL:
|
||||
@ -1590,6 +1594,7 @@ Variant::operator float() const {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Variant::operator double() const {
|
||||
switch (type) {
|
||||
case NIL:
|
||||
@ -1935,6 +1940,7 @@ Variant::operator Plane() const {
|
||||
else
|
||||
return Plane();
|
||||
}
|
||||
|
||||
Variant::operator ::AABB() const {
|
||||
if (type == AABB)
|
||||
return *_data._aabb;
|
||||
@ -2077,6 +2083,7 @@ Variant::operator Node *() const {
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Variant::operator Control *() const {
|
||||
if (type == OBJECT)
|
||||
return Object::cast_to<Control>(_get_obj().obj);
|
||||
@ -2169,12 +2176,14 @@ Variant::operator Vector<uint8_t>() const {
|
||||
else
|
||||
return _convert_array_from_variant<Vector<uint8_t>>(*this);
|
||||
}
|
||||
|
||||
Variant::operator Vector<int32_t>() const {
|
||||
if (type == PACKED_INT32_ARRAY)
|
||||
return static_cast<PackedArrayRef<int32_t> *>(_data.packed_array)->array;
|
||||
else
|
||||
return _convert_array_from_variant<Vector<int>>(*this);
|
||||
}
|
||||
|
||||
Variant::operator Vector<int64_t>() const {
|
||||
if (type == PACKED_INT64_ARRAY)
|
||||
return static_cast<PackedArrayRef<int64_t> *>(_data.packed_array)->array;
|
||||
@ -2202,12 +2211,14 @@ Variant::operator Vector<String>() const {
|
||||
else
|
||||
return _convert_array_from_variant<Vector<String>>(*this);
|
||||
}
|
||||
|
||||
Variant::operator Vector<Vector3>() const {
|
||||
if (type == PACKED_VECTOR3_ARRAY)
|
||||
return static_cast<PackedArrayRef<Vector3> *>(_data.packed_array)->array;
|
||||
else
|
||||
return _convert_array_from_variant<Vector<Vector3>>(*this);
|
||||
}
|
||||
|
||||
Variant::operator Vector<Vector2>() const {
|
||||
if (type == PACKED_VECTOR2_ARRAY)
|
||||
return static_cast<PackedArrayRef<Vector2> *>(_data.packed_array)->array;
|
||||
@ -2280,6 +2291,7 @@ Variant::operator Vector<Variant>() const {
|
||||
|
||||
return variants;
|
||||
}
|
||||
|
||||
Variant::operator Vector<StringName>() const {
|
||||
Vector<String> from = operator Vector<String>();
|
||||
Vector<StringName> to;
|
||||
@ -2294,6 +2306,7 @@ Variant::operator Vector<StringName>() const {
|
||||
Variant::operator Margin() const {
|
||||
return (Margin) operator int();
|
||||
}
|
||||
|
||||
Variant::operator Orientation() const {
|
||||
return (Orientation) operator int();
|
||||
}
|
||||
@ -2326,6 +2339,7 @@ Variant::Variant(signed int p_int) {
|
||||
type = INT;
|
||||
_data._int = p_int;
|
||||
}
|
||||
|
||||
Variant::Variant(unsigned int p_int) {
|
||||
type = INT;
|
||||
_data._int = p_int;
|
||||
@ -2337,6 +2351,7 @@ Variant::Variant(signed long p_int) {
|
||||
type = INT;
|
||||
_data._int = p_int;
|
||||
}
|
||||
|
||||
Variant::Variant(unsigned long p_int) {
|
||||
type = INT;
|
||||
_data._int = p_int;
|
||||
@ -2357,22 +2372,27 @@ Variant::Variant(signed short p_short) {
|
||||
type = INT;
|
||||
_data._int = p_short;
|
||||
}
|
||||
|
||||
Variant::Variant(unsigned short p_short) {
|
||||
type = INT;
|
||||
_data._int = p_short;
|
||||
}
|
||||
|
||||
Variant::Variant(signed char p_char) {
|
||||
type = INT;
|
||||
_data._int = p_char;
|
||||
}
|
||||
|
||||
Variant::Variant(unsigned char p_char) {
|
||||
type = INT;
|
||||
_data._int = p_char;
|
||||
}
|
||||
|
||||
Variant::Variant(float p_float) {
|
||||
type = FLOAT;
|
||||
_data._float = p_float;
|
||||
}
|
||||
|
||||
Variant::Variant(double p_double) {
|
||||
type = FLOAT;
|
||||
_data._float = p_double;
|
||||
@ -2387,6 +2407,7 @@ Variant::Variant(const StringName &p_string) {
|
||||
type = STRING_NAME;
|
||||
memnew_placement(_data._mem, StringName(p_string));
|
||||
}
|
||||
|
||||
Variant::Variant(const String &p_string) {
|
||||
type = STRING;
|
||||
memnew_placement(_data._mem, String(p_string));
|
||||
@ -2401,10 +2422,12 @@ Variant::Variant(const CharType *p_wstring) {
|
||||
type = STRING;
|
||||
memnew_placement(_data._mem, String(p_wstring));
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector3 &p_vector3) {
|
||||
type = VECTOR3;
|
||||
memnew_placement(_data._mem, Vector3(p_vector3));
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector3i &p_vector3i) {
|
||||
type = VECTOR3I;
|
||||
memnew_placement(_data._mem, Vector3i(p_vector3i));
|
||||
@ -2434,6 +2457,7 @@ Variant::Variant(const Plane &p_plane) {
|
||||
type = PLANE;
|
||||
memnew_placement(_data._mem, Plane(p_plane));
|
||||
}
|
||||
|
||||
Variant::Variant(const ::AABB &p_aabb) {
|
||||
type = AABB;
|
||||
_data._aabb = memnew(::AABB(p_aabb));
|
||||
@ -2448,6 +2472,7 @@ Variant::Variant(const Quat &p_quat) {
|
||||
type = QUAT;
|
||||
memnew_placement(_data._mem, Quat(p_quat));
|
||||
}
|
||||
|
||||
Variant::Variant(const Transform &p_transform) {
|
||||
type = TRANSFORM;
|
||||
_data._transform = memnew(Transform(p_transform));
|
||||
@ -2457,6 +2482,7 @@ Variant::Variant(const Transform2D &p_transform) {
|
||||
type = TRANSFORM2D;
|
||||
_data._transform2d = memnew(Transform2D(p_transform));
|
||||
}
|
||||
|
||||
Variant::Variant(const Color &p_color) {
|
||||
type = COLOR;
|
||||
memnew_placement(_data._mem, Color(p_color));
|
||||
@ -2499,6 +2525,7 @@ Variant::Variant(const Callable &p_callable) {
|
||||
type = CALLABLE;
|
||||
memnew_placement(_data._mem, Callable(p_callable));
|
||||
}
|
||||
|
||||
Variant::Variant(const Signal &p_callable) {
|
||||
type = SIGNAL;
|
||||
memnew_placement(_data._mem, Signal(p_callable));
|
||||
@ -2543,6 +2570,7 @@ Variant::Variant(const Vector<uint8_t> &p_byte_array) {
|
||||
|
||||
_data.packed_array = PackedArrayRef<uint8_t>::create(p_byte_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector<int32_t> &p_int32_array) {
|
||||
type = PACKED_INT32_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<int32_t>::create(p_int32_array);
|
||||
@ -2567,6 +2595,7 @@ Variant::Variant(const Vector<String> &p_string_array) {
|
||||
type = PACKED_STRING_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<String>::create(p_string_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector<Vector3> &p_vector3_array) {
|
||||
type = PACKED_VECTOR3_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<Vector3>::create(p_vector3_array);
|
||||
@ -2576,6 +2605,7 @@ Variant::Variant(const Vector<Vector2> &p_vector2_array) {
|
||||
type = PACKED_VECTOR2_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<Vector2>::create(p_vector2_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector<Color> &p_color_array) {
|
||||
type = PACKED_COLOR_ARRAY;
|
||||
_data.packed_array = PackedArrayRef<Color>::create(p_color_array);
|
||||
@ -3275,12 +3305,14 @@ Vector<Variant> varray(const Variant &p_arg1) {
|
||||
v.push_back(p_arg1);
|
||||
return v;
|
||||
}
|
||||
|
||||
Vector<Variant> varray(const Variant &p_arg1, const Variant &p_arg2) {
|
||||
Vector<Variant> v;
|
||||
v.push_back(p_arg1);
|
||||
v.push_back(p_arg2);
|
||||
return v;
|
||||
}
|
||||
|
||||
Vector<Variant> varray(const Variant &p_arg1, const Variant &p_arg2, const Variant &p_arg3) {
|
||||
Vector<Variant> v;
|
||||
v.push_back(p_arg1);
|
||||
@ -3288,6 +3320,7 @@ Vector<Variant> varray(const Variant &p_arg1, const Variant &p_arg2, const Varia
|
||||
v.push_back(p_arg3);
|
||||
return v;
|
||||
}
|
||||
|
||||
Vector<Variant> varray(const Variant &p_arg1, const Variant &p_arg2, const Variant &p_arg3, const Variant &p_arg4) {
|
||||
Vector<Variant> v;
|
||||
v.push_back(p_arg1);
|
||||
|
@ -115,6 +115,7 @@
|
||||
TYPE(PREFIX, OP, PACKED_VECTOR3_ARRAY), \
|
||||
TYPE(PREFIX, OP, PACKED_COLOR_ARRAY), \
|
||||
}
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#define CASES(PREFIX) static const void *switch_table_##PREFIX[25][Variant::VARIANT_MAX] = { \
|
||||
@ -3536,6 +3537,7 @@ bool Variant::iter_init(Variant &r_iter, bool &valid) const {
|
||||
valid = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Variant::iter_next(Variant &r_iter, bool &valid) const {
|
||||
valid = true;
|
||||
switch (type) {
|
||||
|
@ -42,6 +42,7 @@ CharType VariantParser::StreamFile::get_char() {
|
||||
bool VariantParser::StreamFile::is_utf8() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool VariantParser::StreamFile::is_eof() const {
|
||||
return f->eof_reached();
|
||||
}
|
||||
@ -62,6 +63,7 @@ CharType VariantParser::StreamString::get_char() {
|
||||
bool VariantParser::StreamString::is_utf8() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool VariantParser::StreamString::is_eof() const {
|
||||
return pos > s.length();
|
||||
}
|
||||
|
@ -1887,6 +1887,7 @@ void RasterizerCanvasGLES2::canvas_light_shadow_buffer_update(RID p_buffer, cons
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
|
||||
}
|
||||
|
||||
void RasterizerCanvasGLES2::reset_canvas() {
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
@ -1918,6 +1919,7 @@ void RasterizerCanvasGLES2::_bind_quad_buffer() {
|
||||
glEnableVertexAttribArray(RS::ARRAY_VERTEX);
|
||||
glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, 0, nullptr);
|
||||
}
|
||||
|
||||
void RasterizerCanvasGLES2::draw_generic_textured_rect(const Rect2 &p_rect, const Rect2 &p_src) {
|
||||
state.canvas_shader.set_uniform(CanvasShaderGLES2::DST_RECT, Color(p_rect.position.x, p_rect.position.y, p_rect.size.x, p_rect.size.y));
|
||||
state.canvas_shader.set_uniform(CanvasShaderGLES2::SRC_RECT, Color(p_src.position.x, p_src.position.y, p_src.size.x, p_src.size.y));
|
||||
|
@ -460,6 +460,7 @@ int RasterizerSceneGLES2::get_directional_light_shadow_size(RID p_light_intance)
|
||||
|
||||
return shadow_size;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
RID RasterizerSceneGLES2::reflection_atlas_create() {
|
||||
@ -840,6 +841,7 @@ void RasterizerSceneGLES2::environment_set_fog_height(RID p_env, bool p_enable,
|
||||
env->fog_height_max = p_max_height;
|
||||
env->fog_height_curve = p_height_curve;
|
||||
}
|
||||
|
||||
bool RasterizerSceneGLES2::is_environment(RID p_env) {
|
||||
return environment_owner.owns(p_env);
|
||||
}
|
||||
@ -917,6 +919,7 @@ RID RasterizerSceneGLES2::gi_probe_instance_create() {
|
||||
|
||||
void RasterizerSceneGLES2::gi_probe_instance_set_light_data(RID p_probe, RID p_base, RID p_data) {
|
||||
}
|
||||
|
||||
void RasterizerSceneGLES2::gi_probe_instance_set_transform_to_data(RID p_probe, const Transform &p_xform) {
|
||||
}
|
||||
|
||||
@ -965,6 +968,7 @@ void RasterizerSceneGLES2::_add_geometry(RasterizerStorageGLES2::Geometry *p_geo
|
||||
_add_geometry_with_material(p_geometry, p_instance, p_owner, material, p_depth_pass, p_shadow_pass);
|
||||
}
|
||||
}
|
||||
|
||||
void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES2::GeometryOwner *p_owner, RasterizerStorageGLES2::Material *p_material, bool p_depth_pass, bool p_shadow_pass) {
|
||||
bool has_base_alpha = (p_material->shader->spatial.uses_alpha && !p_material->shader->spatial.uses_alpha_scissor) || p_material->shader->spatial.uses_screen_texture || p_material->shader->spatial.uses_depth_texture;
|
||||
bool has_blend_alpha = p_material->shader->spatial.blend_mode != RasterizerStorageGLES2::Shader::Spatial::BLEND_MODE_MIX;
|
||||
|
@ -2617,6 +2617,7 @@ Vector<Vector<uint8_t>> RasterizerStorageGLES2::mesh_surface_get_blend_shapes(RI
|
||||
|
||||
return mesh->surfaces[p_surface]->blend_shape_data;
|
||||
}
|
||||
|
||||
Vector<AABB> RasterizerStorageGLES2::mesh_surface_get_skeleton_aabb(RID p_mesh, int p_surface) const {
|
||||
const Mesh *mesh = mesh_owner.getornull(p_mesh);
|
||||
ERR_FAIL_COND_V(!mesh, Vector<AABB>());
|
||||
@ -2782,6 +2783,7 @@ AABB RasterizerStorageGLES2::mesh_get_aabb(RID p_mesh, RID p_skeleton) const {
|
||||
|
||||
return aabb;
|
||||
}
|
||||
|
||||
void RasterizerStorageGLES2::mesh_clear(RID p_mesh) {
|
||||
Mesh *mesh = mesh_owner.getornull(p_mesh);
|
||||
ERR_FAIL_COND(!mesh);
|
||||
@ -3560,6 +3562,7 @@ Transform RasterizerStorageGLES2::skeleton_bone_get_transform(RID p_skeleton, in
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void RasterizerStorageGLES2::skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform) {
|
||||
Skeleton *skeleton = skeleton_owner.getornull(p_skeleton);
|
||||
ERR_FAIL_COND(!skeleton);
|
||||
@ -3987,6 +3990,7 @@ void RasterizerStorageGLES2::reflection_probe_set_max_distance(RID p_probe, floa
|
||||
reflection_probe->max_distance = p_distance;
|
||||
reflection_probe->instance_change_notify(true, false);
|
||||
}
|
||||
|
||||
void RasterizerStorageGLES2::reflection_probe_set_extents(RID p_probe, const Vector3 &p_extents) {
|
||||
ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe);
|
||||
ERR_FAIL_COND(!reflection_probe);
|
||||
@ -3994,6 +3998,7 @@ void RasterizerStorageGLES2::reflection_probe_set_extents(RID p_probe, const Vec
|
||||
reflection_probe->extents = p_extents;
|
||||
reflection_probe->instance_change_notify(true, false);
|
||||
}
|
||||
|
||||
void RasterizerStorageGLES2::reflection_probe_set_origin_offset(RID p_probe, const Vector3 &p_offset) {
|
||||
ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe);
|
||||
ERR_FAIL_COND(!reflection_probe);
|
||||
@ -4009,6 +4014,7 @@ void RasterizerStorageGLES2::reflection_probe_set_as_interior(RID p_probe, bool
|
||||
reflection_probe->interior = p_enable;
|
||||
reflection_probe->instance_change_notify(true, false);
|
||||
}
|
||||
|
||||
void RasterizerStorageGLES2::reflection_probe_set_enable_box_projection(RID p_probe, bool p_enable) {
|
||||
ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe);
|
||||
ERR_FAIL_COND(!reflection_probe);
|
||||
@ -4023,6 +4029,7 @@ void RasterizerStorageGLES2::reflection_probe_set_enable_shadows(RID p_probe, bo
|
||||
reflection_probe->enable_shadows = p_enable;
|
||||
reflection_probe->instance_change_notify(true, false);
|
||||
}
|
||||
|
||||
void RasterizerStorageGLES2::reflection_probe_set_cull_mask(RID p_probe, uint32_t p_layers) {
|
||||
ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe);
|
||||
ERR_FAIL_COND(!reflection_probe);
|
||||
@ -4048,6 +4055,7 @@ AABB RasterizerStorageGLES2::reflection_probe_get_aabb(RID p_probe) const {
|
||||
|
||||
return aabb;
|
||||
}
|
||||
|
||||
RS::ReflectionProbeUpdateMode RasterizerStorageGLES2::reflection_probe_get_update_mode(RID p_probe) const {
|
||||
const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe);
|
||||
ERR_FAIL_COND_V(!reflection_probe, RS::REFLECTION_PROBE_UPDATE_ALWAYS);
|
||||
@ -4068,6 +4076,7 @@ Vector3 RasterizerStorageGLES2::reflection_probe_get_extents(RID p_probe) const
|
||||
|
||||
return reflection_probe->extents;
|
||||
}
|
||||
|
||||
Vector3 RasterizerStorageGLES2::reflection_probe_get_origin_offset(RID p_probe) const {
|
||||
const ReflectionProbe *reflection_probe = reflection_probe_owner.getornull(p_probe);
|
||||
ERR_FAIL_COND_V(!reflection_probe, Vector3());
|
||||
@ -4160,6 +4169,7 @@ void RasterizerStorageGLES2::gi_probe_set_compress(RID p_probe, bool p_enable) {
|
||||
bool RasterizerStorageGLES2::gi_probe_is_compressed(RID p_probe) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
float RasterizerStorageGLES2::gi_probe_get_energy(RID p_probe) const {
|
||||
return 0;
|
||||
}
|
||||
@ -4204,11 +4214,13 @@ void RasterizerStorageGLES2::lightmap_capture_set_bounds(RID p_capture, const AA
|
||||
capture->bounds = p_bounds;
|
||||
capture->instance_change_notify(true, false);
|
||||
}
|
||||
|
||||
AABB RasterizerStorageGLES2::lightmap_capture_get_bounds(RID p_capture) const {
|
||||
const LightmapCapture *capture = lightmap_capture_data_owner.getornull(p_capture);
|
||||
ERR_FAIL_COND_V(!capture, AABB());
|
||||
return capture->bounds;
|
||||
}
|
||||
|
||||
void RasterizerStorageGLES2::lightmap_capture_set_octree(RID p_capture, const Vector<uint8_t> &p_octree) {
|
||||
LightmapCapture *capture = lightmap_capture_data_owner.getornull(p_capture);
|
||||
ERR_FAIL_COND(!capture);
|
||||
@ -4223,6 +4235,7 @@ void RasterizerStorageGLES2::lightmap_capture_set_octree(RID p_capture, const Ve
|
||||
}
|
||||
capture->instance_change_notify(true, false);
|
||||
}
|
||||
|
||||
Vector<uint8_t> RasterizerStorageGLES2::lightmap_capture_get_octree(RID p_capture) const {
|
||||
const LightmapCapture *capture = lightmap_capture_data_owner.getornull(p_capture);
|
||||
ERR_FAIL_COND_V(!capture, Vector<uint8_t>());
|
||||
|
@ -190,4 +190,5 @@ void main() {
|
||||
void main() {
|
||||
|
||||
}
|
||||
|
||||
/* clang-format on */
|
||||
|
@ -257,4 +257,5 @@ FRAGMENT_SHADER_CODE
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* clang-format on */
|
||||
|
@ -1065,6 +1065,7 @@ float G_GGX_2cos(float cos_theta_m, float alpha) {
|
||||
// float sin2 = (1.0 - cos2);
|
||||
// return 1.0 / (cos_theta_m + sqrt(cos2 + alpha * alpha * sin2));
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// This approximates G_GGX_2cos(cos_theta_l, alpha) * G_GGX_2cos(cos_theta_v, alpha)
|
||||
@ -1087,6 +1088,7 @@ float G_GGX_anisotropic_2cos(float cos_theta_m, float alpha_x, float alpha_y, fl
|
||||
float s_y = alpha_y * sin_phi;
|
||||
return 1.0 / max(cos_theta_m + sqrt(cos2 + (s_x * s_x + s_y * s_y) * sin2), 0.001);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
// This approximates G_GGX_anisotropic_2cos(cos_theta_l, ...) * G_GGX_anisotropic_2cos(cos_theta_v, ...)
|
||||
|
@ -244,6 +244,7 @@ void OS_Unix::delay_usec(uint32_t p_usec) const {
|
||||
while (nanosleep(&rem, &rem) == EINTR) {
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t OS_Unix::get_ticks_usec() const {
|
||||
#if defined(__APPLE__)
|
||||
uint64_t longtime = mach_absolute_time() * _clock_scale;
|
||||
|
@ -87,6 +87,7 @@ Thread *ThreadPosix::create_func_posix(ThreadCreateCallback p_callback, void *p_
|
||||
|
||||
return tr;
|
||||
}
|
||||
|
||||
Thread::ID ThreadPosix::get_thread_id_func_posix() {
|
||||
void *value = pthread_getspecific(thread_id_key);
|
||||
|
||||
@ -97,6 +98,7 @@ Thread::ID ThreadPosix::get_thread_id_func_posix() {
|
||||
pthread_setspecific(thread_id_key, (void *)memnew(ID(new_id)));
|
||||
return new_id;
|
||||
}
|
||||
|
||||
void ThreadPosix::wait_to_finish_func_posix(Thread *p_thread) {
|
||||
ThreadPosix *tp = static_cast<ThreadPosix *>(p_thread);
|
||||
ERR_FAIL_COND(!tp);
|
||||
|
@ -2699,6 +2699,7 @@ Error RenderingDeviceVulkan::texture_copy(RID p_from_texture, RID p_to_texture,
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
Error RenderingDeviceVulkan::texture_resolve_multisample(RID p_from_texture, RID p_to_texture, bool p_sync_with_draw) {
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
@ -5323,12 +5324,14 @@ int RenderingDeviceVulkan::screen_get_width(DisplayServer::WindowID p_screen) co
|
||||
ERR_FAIL_COND_V_MSG(local_device.is_valid(), -1, "Local devices have no screen");
|
||||
return context->window_get_width(p_screen);
|
||||
}
|
||||
|
||||
int RenderingDeviceVulkan::screen_get_height(DisplayServer::WindowID p_screen) const {
|
||||
_THREAD_SAFE_METHOD_
|
||||
ERR_FAIL_COND_V_MSG(local_device.is_valid(), -1, "Local devices have no screen");
|
||||
|
||||
return context->window_get_height(p_screen);
|
||||
}
|
||||
|
||||
RenderingDevice::FramebufferFormatID RenderingDeviceVulkan::screen_get_framebuffer_format() const {
|
||||
_THREAD_SAFE_METHOD_
|
||||
ERR_FAIL_COND_V_MSG(local_device.is_valid(), INVALID_ID, "Local devices have no screen");
|
||||
@ -5978,6 +5981,7 @@ void RenderingDeviceVulkan::draw_list_bind_vertex_array(DrawListID p_list, RID p
|
||||
dl->validation.vertex_array_size = vertex_array->vertex_count;
|
||||
vkCmdBindVertexBuffers(dl->command_buffer, 0, vertex_array->buffers.size(), vertex_array->buffers.ptr(), vertex_array->offsets.ptr());
|
||||
}
|
||||
|
||||
void RenderingDeviceVulkan::draw_list_bind_index_array(DrawListID p_list, RID p_index_array) {
|
||||
DrawList *dl = _get_draw_list_ptr(p_list);
|
||||
ERR_FAIL_COND(!dl);
|
||||
@ -6164,6 +6168,7 @@ void RenderingDeviceVulkan::draw_list_enable_scissor(DrawListID p_list, const Re
|
||||
|
||||
vkCmdSetScissor(dl->command_buffer, 0, 1, &scissor);
|
||||
}
|
||||
|
||||
void RenderingDeviceVulkan::draw_list_disable_scissor(DrawListID p_list) {
|
||||
DrawList *dl = _get_draw_list_ptr(p_list);
|
||||
ERR_FAIL_COND(!dl);
|
||||
@ -6302,6 +6307,7 @@ void RenderingDeviceVulkan::compute_list_bind_compute_pipeline(ComputeListID p_l
|
||||
cl->validation.pipeline_push_constant_size = pipeline->push_constant_size;
|
||||
#endif
|
||||
}
|
||||
|
||||
void RenderingDeviceVulkan::compute_list_bind_uniform_set(ComputeListID p_list, RID p_uniform_set, uint32_t p_index) {
|
||||
ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST);
|
||||
ERR_FAIL_COND(!compute_list);
|
||||
@ -6424,6 +6430,7 @@ void RenderingDeviceVulkan::compute_list_set_push_constant(ComputeListID p_list,
|
||||
cl->validation.pipeline_push_constant_suppplied = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void RenderingDeviceVulkan::compute_list_dispatch(ComputeListID p_list, uint32_t p_x_groups, uint32_t p_y_groups, uint32_t p_z_groups) {
|
||||
ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST);
|
||||
ERR_FAIL_COND(!compute_list);
|
||||
@ -6646,6 +6653,7 @@ void RenderingDeviceVulkan::_free_internal(RID p_id) {
|
||||
ERR_PRINT("Attempted to free invalid ID: " + itos(p_id.get_id()));
|
||||
}
|
||||
}
|
||||
|
||||
void RenderingDeviceVulkan::free(RID p_id) {
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
@ -7163,10 +7171,12 @@ uint64_t RenderingDeviceVulkan::get_captured_timestamp_gpu_time(uint32_t p_index
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
uint64_t RenderingDeviceVulkan::get_captured_timestamp_cpu_time(uint32_t p_index) const {
|
||||
ERR_FAIL_UNSIGNED_INDEX_V(p_index, frames[frame].timestamp_result_count, 0);
|
||||
return frames[frame].timestamp_cpu_result_values[p_index];
|
||||
}
|
||||
|
||||
String RenderingDeviceVulkan::get_captured_timestamp_name(uint32_t p_index) const {
|
||||
ERR_FAIL_UNSIGNED_INDEX_V(p_index, frames[frame].timestamp_result_count, String());
|
||||
return frames[frame].timestamp_result_names[p_index];
|
||||
|
@ -1459,9 +1459,11 @@ VkDevice VulkanContext::get_device() {
|
||||
VkPhysicalDevice VulkanContext::get_physical_device() {
|
||||
return gpu;
|
||||
}
|
||||
|
||||
int VulkanContext::get_swapchain_image_count() const {
|
||||
return swapchainImageCount;
|
||||
}
|
||||
|
||||
uint32_t VulkanContext::get_graphics_queue() const {
|
||||
return graphics_queue_family_index;
|
||||
}
|
||||
|
@ -101,9 +101,11 @@ void DirAccessWindows::list_dir_end() {
|
||||
p->h = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
int DirAccessWindows::get_drive_count() {
|
||||
return drive_count;
|
||||
}
|
||||
|
||||
String DirAccessWindows::get_drive(int p_drive) {
|
||||
if (p_drive < 0 || p_drive >= drive_count)
|
||||
return "";
|
||||
@ -298,6 +300,7 @@ Error DirAccessWindows::remove(String p_path) {
|
||||
else
|
||||
return ::_wunlink(p_path.c_str()) == 0 ? OK : FAILED;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
FileType DirAccessWindows::get_file_type(const String& p_file) const {
|
||||
@ -325,6 +328,7 @@ FileType DirAccessWindows::get_file_type(const String& p_file) const {
|
||||
|
||||
return (attr&FILE_ATTRIBUTE_DIRECTORY)?FILE_TYPE_
|
||||
}
|
||||
|
||||
*/
|
||||
size_t DirAccessWindows::get_space_left() {
|
||||
uint64_t bytes = 0;
|
||||
|
@ -188,6 +188,7 @@ String FileAccessWindows::get_path_absolute() const {
|
||||
bool FileAccessWindows::is_open() const {
|
||||
return (f != nullptr);
|
||||
}
|
||||
|
||||
void FileAccessWindows::seek(size_t p_position) {
|
||||
ERR_FAIL_COND(!f);
|
||||
last_error = OK;
|
||||
@ -195,12 +196,14 @@ void FileAccessWindows::seek(size_t p_position) {
|
||||
check_errors();
|
||||
prev_op = 0;
|
||||
}
|
||||
|
||||
void FileAccessWindows::seek_end(int64_t p_position) {
|
||||
ERR_FAIL_COND(!f);
|
||||
if (fseek(f, p_position, SEEK_END))
|
||||
check_errors();
|
||||
prev_op = 0;
|
||||
}
|
||||
|
||||
size_t FileAccessWindows::get_position() const {
|
||||
size_t aux_position = 0;
|
||||
aux_position = ftell(f);
|
||||
@ -209,6 +212,7 @@ size_t FileAccessWindows::get_position() const {
|
||||
};
|
||||
return aux_position;
|
||||
}
|
||||
|
||||
size_t FileAccessWindows::get_len() const {
|
||||
ERR_FAIL_COND_V(!f, 0);
|
||||
|
||||
|
@ -66,9 +66,11 @@ Thread *ThreadWindows::create_func_windows(ThreadCreateCallback p_callback, void
|
||||
|
||||
return tr;
|
||||
}
|
||||
|
||||
Thread::ID ThreadWindows::get_thread_id_func_windows() {
|
||||
return (ID)GetCurrentThreadId(); //must implement
|
||||
}
|
||||
|
||||
void ThreadWindows::wait_to_finish_func_windows(Thread *p_thread) {
|
||||
ThreadWindows *tp = static_cast<ThreadWindows *>(p_thread);
|
||||
ERR_FAIL_COND(!tp);
|
||||
|
@ -150,6 +150,7 @@ void AudioDriverXAudio2::lock() {
|
||||
return;
|
||||
mutex.lock();
|
||||
}
|
||||
|
||||
void AudioDriverXAudio2::unlock() {
|
||||
if (!thread)
|
||||
return;
|
||||
|
@ -509,6 +509,7 @@ void AnimationBezierTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) {
|
||||
timeline = p_timeline;
|
||||
timeline->connect("zoom_changed", callable_mp(this, &AnimationBezierTrackEdit::_zoom_changed));
|
||||
}
|
||||
|
||||
void AnimationBezierTrackEdit::set_editor(AnimationTrackEditor *p_editor) {
|
||||
editor = p_editor;
|
||||
connect_compat("clear_selection", editor, "_clear_selection", varray(false));
|
||||
@ -541,6 +542,7 @@ void AnimationBezierTrackEdit::update_play_position() {
|
||||
void AnimationBezierTrackEdit::set_root(Node *p_root) {
|
||||
root = p_root;
|
||||
}
|
||||
|
||||
void AnimationBezierTrackEdit::_zoom_changed() {
|
||||
update();
|
||||
}
|
||||
|
@ -1684,6 +1684,7 @@ void AnimationTimelineEdit::set_use_fps(bool p_use_fps) {
|
||||
update_values();
|
||||
update();
|
||||
}
|
||||
|
||||
bool AnimationTimelineEdit::is_using_fps() const {
|
||||
return use_fps;
|
||||
}
|
||||
@ -2066,6 +2067,7 @@ int AnimationTrackEdit::get_key_height() const {
|
||||
|
||||
return type_icon->get_height();
|
||||
}
|
||||
|
||||
Rect2 AnimationTrackEdit::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
if (!animation.is_valid())
|
||||
return Rect2();
|
||||
@ -2262,6 +2264,7 @@ void AnimationTrackEdit::set_timeline(AnimationTimelineEdit *p_timeline) {
|
||||
timeline->connect("zoom_changed", callable_mp(this, &AnimationTrackEdit::_zoom_changed));
|
||||
timeline->connect("name_limit_changed", callable_mp(this, &AnimationTrackEdit::_zoom_changed));
|
||||
}
|
||||
|
||||
void AnimationTrackEdit::set_editor(AnimationTrackEditor *p_editor) {
|
||||
editor = p_editor;
|
||||
}
|
||||
@ -2761,6 +2764,7 @@ bool AnimationTrackEdit::can_drop_data(const Point2 &p_point, const Variant &p_d
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void AnimationTrackEdit::drop_data(const Point2 &p_point, const Variant &p_data) {
|
||||
Dictionary d = p_data;
|
||||
if (!d.has("type")) {
|
||||
@ -2844,6 +2848,7 @@ void AnimationTrackEdit::cancel_drop() {
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void AnimationTrackEdit::set_in_group(bool p_enable) {
|
||||
in_group = p_enable;
|
||||
update();
|
||||
@ -3135,6 +3140,7 @@ void AnimationTrackEditor::update_keying() {
|
||||
bool AnimationTrackEditor::has_keying() const {
|
||||
return keying;
|
||||
}
|
||||
|
||||
Dictionary AnimationTrackEditor::get_state() const {
|
||||
Dictionary state;
|
||||
state["fps_mode"] = timeline->is_using_fps();
|
||||
@ -3143,6 +3149,7 @@ Dictionary AnimationTrackEditor::get_state() const {
|
||||
state["v_scroll"] = scroll->get_v_scrollbar()->get_value();
|
||||
return state;
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::set_state(const Dictionary &p_state) {
|
||||
if (p_state.has("fps_mode")) {
|
||||
bool fps_mode = p_state["fps_mode"];
|
||||
@ -4076,6 +4083,7 @@ void AnimationTrackEditor::_update_step_spinbox() {
|
||||
|
||||
step->set_block_signals(false);
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_animation_update() {
|
||||
timeline->update();
|
||||
timeline->update_values();
|
||||
@ -4752,6 +4760,7 @@ void AnimationTrackEditor::_move_selection_commit() {
|
||||
|
||||
_update_key_edit();
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_move_selection_cancel() {
|
||||
moving_selection = false;
|
||||
for (int i = 0; i < track_edits.size(); i++) {
|
||||
@ -4762,6 +4771,7 @@ void AnimationTrackEditor::_move_selection_cancel() {
|
||||
bool AnimationTrackEditor::is_moving_selection() const {
|
||||
return moving_selection;
|
||||
}
|
||||
|
||||
float AnimationTrackEditor::get_moving_selection_offset() const {
|
||||
return moving_selection_offset;
|
||||
}
|
||||
@ -4953,6 +4963,7 @@ void AnimationTrackEditor::_anim_duplicate_keys(bool transpose) {
|
||||
_update_key_edit();
|
||||
}
|
||||
}
|
||||
|
||||
void AnimationTrackEditor::_edit_menu_pressed(int p_option) {
|
||||
last_menu_track_opt = p_option;
|
||||
switch (p_option) {
|
||||
|
@ -44,6 +44,7 @@ int AnimationTrackEditBool::get_key_height() const {
|
||||
Ref<Texture2D> checked = get_theme_icon("checked", "CheckBox");
|
||||
return checked->get_height();
|
||||
}
|
||||
|
||||
Rect2 AnimationTrackEditBool::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
Ref<Texture2D> checked = get_theme_icon("checked", "CheckBox");
|
||||
return Rect2(-checked->get_width() / 2, 0, checked->get_width(), get_size().height);
|
||||
@ -52,6 +53,7 @@ Rect2 AnimationTrackEditBool::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
bool AnimationTrackEditBool::is_key_selectable_by_distance() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AnimationTrackEditBool::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) {
|
||||
bool checked = get_animation()->track_get_key_value(get_track(), p_index);
|
||||
Ref<Texture2D> icon = get_theme_icon(checked ? "checked" : "unchecked", "CheckBox");
|
||||
@ -78,6 +80,7 @@ int AnimationTrackEditColor::get_key_height() const {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
return font->get_height() * 0.8;
|
||||
}
|
||||
|
||||
Rect2 AnimationTrackEditColor::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
int fh = font->get_height() * 0.8;
|
||||
@ -177,6 +180,7 @@ int AnimationTrackEditAudio::get_key_height() const {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
return int(font->get_height() * 1.5);
|
||||
}
|
||||
|
||||
Rect2 AnimationTrackEditAudio::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
Object *object = ObjectDB::get_instance(id);
|
||||
|
||||
@ -214,6 +218,7 @@ Rect2 AnimationTrackEditAudio::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
bool AnimationTrackEditAudio::is_key_selectable_by_distance() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) {
|
||||
Object *object = ObjectDB::get_instance(id);
|
||||
|
||||
@ -329,6 +334,7 @@ int AnimationTrackEditSpriteFrame::get_key_height() const {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
return int(font->get_height() * 2);
|
||||
}
|
||||
|
||||
Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
Object *object = ObjectDB::get_instance(id);
|
||||
|
||||
@ -402,6 +408,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
|
||||
bool AnimationTrackEditSpriteFrame::is_key_selectable_by_distance() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) {
|
||||
Object *object = ObjectDB::get_instance(id);
|
||||
|
||||
@ -525,6 +532,7 @@ int AnimationTrackEditSubAnim::get_key_height() const {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
return int(font->get_height() * 1.5);
|
||||
}
|
||||
|
||||
Rect2 AnimationTrackEditSubAnim::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
Object *object = ObjectDB::get_instance(id);
|
||||
|
||||
@ -558,6 +566,7 @@ Rect2 AnimationTrackEditSubAnim::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
bool AnimationTrackEditSubAnim::is_key_selectable_by_distance() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) {
|
||||
Object *object = ObjectDB::get_instance(id);
|
||||
|
||||
@ -750,6 +759,7 @@ int AnimationTrackEditTypeAudio::get_key_height() const {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
return int(font->get_height() * 1.5);
|
||||
}
|
||||
|
||||
Rect2 AnimationTrackEditTypeAudio::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
Ref<AudioStream> stream = get_animation()->audio_track_get_key_stream(get_track(), p_index);
|
||||
|
||||
@ -783,6 +793,7 @@ Rect2 AnimationTrackEditTypeAudio::get_key_rect(int p_index, float p_pixels_sec)
|
||||
bool AnimationTrackEditTypeAudio::is_key_selectable_by_distance() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) {
|
||||
Ref<AudioStream> stream = get_animation()->audio_track_get_key_stream(get_track(), p_index);
|
||||
|
||||
@ -928,6 +939,7 @@ bool AnimationTrackEditTypeAudio::can_drop_data(const Point2 &p_point, const Var
|
||||
|
||||
return AnimationTrackEdit::can_drop_data(p_point, p_data);
|
||||
}
|
||||
|
||||
void AnimationTrackEditTypeAudio::drop_data(const Point2 &p_point, const Variant &p_data) {
|
||||
if (p_point.x > get_timeline()->get_name_limit() && p_point.x < get_size().width - get_timeline()->get_buttons_width()) {
|
||||
Ref<AudioStream> stream;
|
||||
@ -1076,6 +1088,7 @@ int AnimationTrackEditTypeAnimation::get_key_height() const {
|
||||
Ref<Font> font = get_theme_font("font", "Label");
|
||||
return int(font->get_height() * 1.5);
|
||||
}
|
||||
|
||||
Rect2 AnimationTrackEditTypeAnimation::get_key_rect(int p_index, float p_pixels_sec) {
|
||||
Object *object = ObjectDB::get_instance(id);
|
||||
|
||||
@ -1109,6 +1122,7 @@ Rect2 AnimationTrackEditTypeAnimation::get_key_rect(int p_index, float p_pixels_
|
||||
bool AnimationTrackEditTypeAnimation::is_key_selectable_by_distance() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec, int p_x, bool p_selected, int p_clip_left, int p_clip_right) {
|
||||
Object *object = ObjectDB::get_instance(id);
|
||||
|
||||
|
@ -50,6 +50,7 @@ Variant ArrayPropertyEdit::get_array() const {
|
||||
void ArrayPropertyEdit::_notif_change() {
|
||||
_change_notify();
|
||||
}
|
||||
|
||||
void ArrayPropertyEdit::_notif_changev(const String &p_v) {
|
||||
_change_notify(p_v.utf8().get_data());
|
||||
}
|
||||
|
@ -35,6 +35,7 @@
|
||||
float AudioStreamPreview::get_length() const {
|
||||
return length;
|
||||
}
|
||||
|
||||
float AudioStreamPreview::get_max(float p_time, float p_time_next) const {
|
||||
if (length == 0)
|
||||
return 0;
|
||||
@ -60,6 +61,7 @@ float AudioStreamPreview::get_max(float p_time, float p_time_next) const {
|
||||
|
||||
return (vmax / 255.0) * 2.0 - 1.0;
|
||||
}
|
||||
|
||||
float AudioStreamPreview::get_min(float p_time, float p_time_next) const {
|
||||
if (length == 0)
|
||||
return 0;
|
||||
|
@ -482,6 +482,7 @@ void CreateDialog::set_preferred_search_result_type(const String &p_preferred_ty
|
||||
String CreateDialog::get_preferred_search_result_type() {
|
||||
return preferred_search_result_type;
|
||||
}
|
||||
|
||||
String CreateDialog::get_selected_type() {
|
||||
TreeItem *selected = search_options->get_selected();
|
||||
if (selected)
|
||||
@ -644,6 +645,7 @@ bool CreateDialog::can_drop_data_fw(const Point2 &p_point, const Variant &p_data
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CreateDialog::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
|
||||
Dictionary d = p_data;
|
||||
|
||||
|
@ -549,41 +549,49 @@ void EditorDebuggerNode::set_live_debugging(bool p_enabled) {
|
||||
dbg->set_live_debugging(p_enabled);
|
||||
});
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::update_live_edit_root() {
|
||||
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
|
||||
dbg->update_live_edit_root();
|
||||
});
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::live_debug_create_node(const NodePath &p_parent, const String &p_type, const String &p_name) {
|
||||
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
|
||||
dbg->live_debug_create_node(p_parent, p_type, p_name);
|
||||
});
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::live_debug_instance_node(const NodePath &p_parent, const String &p_path, const String &p_name) {
|
||||
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
|
||||
dbg->live_debug_instance_node(p_parent, p_path, p_name);
|
||||
});
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::live_debug_remove_node(const NodePath &p_at) {
|
||||
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
|
||||
dbg->live_debug_remove_node(p_at);
|
||||
});
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::live_debug_remove_and_keep_node(const NodePath &p_at, ObjectID p_keep_id) {
|
||||
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
|
||||
dbg->live_debug_remove_and_keep_node(p_at, p_keep_id);
|
||||
});
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::live_debug_restore_node(ObjectID p_id, const NodePath &p_at, int p_at_pos) {
|
||||
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
|
||||
dbg->live_debug_restore_node(p_id, p_at, p_at_pos);
|
||||
});
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name) {
|
||||
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
|
||||
dbg->live_debug_duplicate_node(p_at, p_new_name);
|
||||
});
|
||||
}
|
||||
|
||||
void EditorDebuggerNode::live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) {
|
||||
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
|
||||
dbg->live_debug_reparent_node(p_at, p_new_place, p_new_name, p_at_pos);
|
||||
|
@ -97,6 +97,7 @@ void ScriptEditorDebugger::debug_next() {
|
||||
_put_msg("next", Array());
|
||||
_clear_execution();
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::debug_step() {
|
||||
ERR_FAIL_COND(!breaked);
|
||||
|
||||
@ -1243,6 +1244,7 @@ void ScriptEditorDebugger::live_debug_instance_node(const NodePath &p_parent, co
|
||||
_put_msg("scene:live_instance_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_remove_node(const NodePath &p_at) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
@ -1250,6 +1252,7 @@ void ScriptEditorDebugger::live_debug_remove_node(const NodePath &p_at) {
|
||||
_put_msg("scene:live_remove_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_remove_and_keep_node(const NodePath &p_at, ObjectID p_keep_id) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
@ -1258,6 +1261,7 @@ void ScriptEditorDebugger::live_debug_remove_and_keep_node(const NodePath &p_at,
|
||||
_put_msg("scene:live_remove_and_keep_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_restore_node(ObjectID p_id, const NodePath &p_at, int p_at_pos) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
@ -1267,6 +1271,7 @@ void ScriptEditorDebugger::live_debug_restore_node(ObjectID p_id, const NodePath
|
||||
_put_msg("scene:live_restore_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_duplicate_node(const NodePath &p_at, const String &p_new_name) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
@ -1275,6 +1280,7 @@ void ScriptEditorDebugger::live_debug_duplicate_node(const NodePath &p_at, const
|
||||
_put_msg("scene:live_duplicate_node", msg);
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptEditorDebugger::live_debug_reparent_node(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos) {
|
||||
if (live_debug) {
|
||||
Array msg;
|
||||
|
@ -771,6 +771,7 @@ Error DocData::load_classes(const String &p_dir) {
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
Error DocData::erase_classes(const String &p_dir) {
|
||||
Error err;
|
||||
DirAccessRef da = DirAccess::open(p_dir, &err);
|
||||
@ -798,6 +799,7 @@ Error DocData::erase_classes(const String &p_dir) {
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
Error DocData::_load(Ref<XMLParser> parser) {
|
||||
Error err = OK;
|
||||
|
||||
|
@ -79,6 +79,7 @@ void EditorAtlasPacker::_plot_triangle(Ref<BitMap> p_bitmap, Vector2i *vertices)
|
||||
xt += dx_low;
|
||||
}
|
||||
}
|
||||
|
||||
void EditorAtlasPacker::chart_pack(Vector<Chart> &charts, int &r_width, int &r_height, int p_atlas_max_size, int p_cell_resolution) {
|
||||
int divide_by = MIN(64, p_cell_resolution);
|
||||
Vector<PlottedBitmap> bitmaps;
|
||||
|
@ -409,6 +409,7 @@ void EditorAudioBus::_solo_toggled() {
|
||||
|
||||
updating_bus = false;
|
||||
}
|
||||
|
||||
void EditorAudioBus::_mute_toggled() {
|
||||
updating_bus = true;
|
||||
|
||||
@ -422,6 +423,7 @@ void EditorAudioBus::_mute_toggled() {
|
||||
|
||||
updating_bus = false;
|
||||
}
|
||||
|
||||
void EditorAudioBus::_bypass_toggled() {
|
||||
updating_bus = true;
|
||||
|
||||
|
@ -137,6 +137,7 @@ void EditorHistory::add_object(ObjectID p_object, int p_relevel) {
|
||||
int EditorHistory::get_history_len() {
|
||||
return history.size();
|
||||
}
|
||||
|
||||
int EditorHistory::get_history_pos() {
|
||||
return current;
|
||||
}
|
||||
@ -156,6 +157,7 @@ ObjectID EditorHistory::get_history_obj(int p_obj) const {
|
||||
bool EditorHistory::is_at_beginning() const {
|
||||
return current <= 0;
|
||||
}
|
||||
|
||||
bool EditorHistory::is_at_end() const {
|
||||
return ((current + 1) >= history.size());
|
||||
}
|
||||
@ -189,6 +191,7 @@ bool EditorHistory::is_current_inspector_only() const {
|
||||
const History &h = history[current];
|
||||
return h.path[h.level].inspector_only;
|
||||
}
|
||||
|
||||
ObjectID EditorHistory::get_current() {
|
||||
if (current < 0 || current >= history.size())
|
||||
return ObjectID();
|
||||
@ -424,6 +427,7 @@ void EditorData::add_editor_plugin(EditorPlugin *p_plugin) {
|
||||
int EditorData::get_editor_plugin_count() const {
|
||||
return editor_plugins.size();
|
||||
}
|
||||
|
||||
EditorPlugin *EditorData::get_editor_plugin(int p_idx) {
|
||||
ERR_FAIL_INDEX_V(p_idx, editor_plugins.size(), nullptr);
|
||||
return editor_plugins[p_idx];
|
||||
@ -605,11 +609,13 @@ bool EditorData::check_and_update_scene(int p_idx) {
|
||||
int EditorData::get_edited_scene() const {
|
||||
return current_edited_scene;
|
||||
}
|
||||
|
||||
void EditorData::set_edited_scene(int p_idx) {
|
||||
ERR_FAIL_INDEX(p_idx, edited_scene.size());
|
||||
current_edited_scene = p_idx;
|
||||
//swap
|
||||
}
|
||||
|
||||
Node *EditorData::get_edited_scene_root(int p_idx) {
|
||||
if (p_idx < 0) {
|
||||
ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), nullptr);
|
||||
@ -619,6 +625,7 @@ Node *EditorData::get_edited_scene_root(int p_idx) {
|
||||
return edited_scene[p_idx].root;
|
||||
}
|
||||
}
|
||||
|
||||
void EditorData::set_edited_scene_root(Node *p_root) {
|
||||
ERR_FAIL_INDEX(current_edited_scene, edited_scene.size());
|
||||
edited_scene.write[current_edited_scene].root = p_root;
|
||||
@ -658,6 +665,7 @@ uint64_t EditorData::get_edited_scene_version() const {
|
||||
ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), 0);
|
||||
return edited_scene[current_edited_scene].version;
|
||||
}
|
||||
|
||||
uint64_t EditorData::get_scene_version(int p_idx) const {
|
||||
ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), 0);
|
||||
return edited_scene[p_idx].version;
|
||||
@ -669,6 +677,7 @@ String EditorData::get_scene_type(int p_idx) const {
|
||||
return "";
|
||||
return edited_scene[p_idx].root->get_class();
|
||||
}
|
||||
|
||||
void EditorData::move_edited_scene_to_index(int p_idx) {
|
||||
ERR_FAIL_INDEX(current_edited_scene, edited_scene.size());
|
||||
ERR_FAIL_INDEX(p_idx, edited_scene.size());
|
||||
@ -735,6 +744,7 @@ void EditorData::set_edited_scene_live_edit_root(const NodePath &p_root) {
|
||||
|
||||
edited_scene.write[current_edited_scene].live_edit_root = p_root;
|
||||
}
|
||||
|
||||
NodePath EditorData::get_edited_scene_live_edit_root() {
|
||||
ERR_FAIL_INDEX_V(current_edited_scene, edited_scene.size(), String());
|
||||
|
||||
@ -962,6 +972,7 @@ void EditorSelection::remove_node(Node *p_node) {
|
||||
p_node->disconnect("tree_exiting", callable_mp(this, &EditorSelection::_node_removed));
|
||||
//emit_signal("selection_changed");
|
||||
}
|
||||
|
||||
bool EditorSelection::is_selected(Node *p_node) const {
|
||||
return selection.has(p_node);
|
||||
}
|
||||
@ -1068,6 +1079,7 @@ void EditorSelection::clear() {
|
||||
changed = true;
|
||||
nl_changed = true;
|
||||
}
|
||||
|
||||
EditorSelection::EditorSelection() {
|
||||
emitted = false;
|
||||
changed = false;
|
||||
|
@ -190,6 +190,7 @@ void EditorExportPreset::set_patch(int p_index, const String &p_path) {
|
||||
patches.write[p_index] = p_path;
|
||||
EditorExport::singleton->save_presets();
|
||||
}
|
||||
|
||||
String EditorExportPreset::get_patch(int p_index) {
|
||||
ERR_FAIL_INDEX_V(p_index, patches.size(), String());
|
||||
return patches[p_index];
|
||||
@ -1082,6 +1083,7 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
|
||||
r_flags.push_back("--debug-navigation");
|
||||
}
|
||||
}
|
||||
|
||||
EditorExportPlatform::EditorExportPlatform() {
|
||||
}
|
||||
|
||||
@ -1375,6 +1377,7 @@ String EditorExportPlatformPC::get_name() const {
|
||||
String EditorExportPlatformPC::get_os_name() const {
|
||||
return os_name;
|
||||
}
|
||||
|
||||
Ref<Texture2D> EditorExportPlatformPC::get_logo() const {
|
||||
return logo;
|
||||
}
|
||||
@ -1534,9 +1537,11 @@ void EditorExportPlatformPC::set_release_64(const String &p_file) {
|
||||
void EditorExportPlatformPC::set_release_32(const String &p_file) {
|
||||
release_file_32 = p_file;
|
||||
}
|
||||
|
||||
void EditorExportPlatformPC::set_debug_64(const String &p_file) {
|
||||
debug_file_64 = p_file;
|
||||
}
|
||||
|
||||
void EditorExportPlatformPC::set_debug_32(const String &p_file) {
|
||||
debug_file_32 = p_file;
|
||||
}
|
||||
|
@ -100,6 +100,7 @@ void EditorFeatureProfile::set_disable_class_property(const StringName &p_class,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool EditorFeatureProfile::is_class_property_disabled(const StringName &p_class, const StringName &p_property) const {
|
||||
if (!disabled_properties.has(p_class)) {
|
||||
return false;
|
||||
@ -120,6 +121,7 @@ void EditorFeatureProfile::set_disable_feature(Feature p_feature, bool p_disable
|
||||
ERR_FAIL_INDEX(p_feature, FEATURE_MAX);
|
||||
features_disabled[p_feature] = p_disable;
|
||||
}
|
||||
|
||||
bool EditorFeatureProfile::is_feature_disabled(Feature p_feature) const {
|
||||
ERR_FAIL_INDEX_V(p_feature, FEATURE_MAX, false);
|
||||
return features_disabled[p_feature];
|
||||
|
@ -506,6 +506,7 @@ void EditorFileDialog::_push_history() {
|
||||
dir_next->set_disabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorFileDialog::_item_dc_selected(int p_item) {
|
||||
int current = p_item;
|
||||
if (current < 0 || current >= item_list->get_item_count())
|
||||
@ -877,6 +878,7 @@ void EditorFileDialog::clear_filters() {
|
||||
update_filters();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
void EditorFileDialog::add_filter(const String &p_filter) {
|
||||
filters.push_back(p_filter);
|
||||
update_filters();
|
||||
@ -886,12 +888,15 @@ void EditorFileDialog::add_filter(const String &p_filter) {
|
||||
String EditorFileDialog::get_current_dir() const {
|
||||
return dir_access->get_current_dir();
|
||||
}
|
||||
|
||||
String EditorFileDialog::get_current_file() const {
|
||||
return file->get_text();
|
||||
}
|
||||
|
||||
String EditorFileDialog::get_current_path() const {
|
||||
return dir_access->get_current_dir().plus_file(file->get_text());
|
||||
}
|
||||
|
||||
void EditorFileDialog::set_current_dir(const String &p_dir) {
|
||||
if (p_dir.is_rel_path())
|
||||
dir_access->change_dir(OS::get_singleton()->get_resource_dir());
|
||||
@ -899,6 +904,7 @@ void EditorFileDialog::set_current_dir(const String &p_dir) {
|
||||
update_dir();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
void EditorFileDialog::set_current_file(const String &p_file) {
|
||||
file->set_text(p_file);
|
||||
update_dir();
|
||||
@ -912,6 +918,7 @@ void EditorFileDialog::set_current_file(const String &p_file) {
|
||||
if (is_visible())
|
||||
_request_single_thumbnail(get_current_dir().plus_file(get_current_file()));
|
||||
}
|
||||
|
||||
void EditorFileDialog::set_current_path(const String &p_path) {
|
||||
if (!p_path.size())
|
||||
return;
|
||||
@ -1110,6 +1117,7 @@ void EditorFileDialog::_favorite_move_up() {
|
||||
update_file_list();
|
||||
}
|
||||
}
|
||||
|
||||
void EditorFileDialog::_favorite_move_down() {
|
||||
int current = favorites->get_current();
|
||||
|
||||
@ -1237,6 +1245,7 @@ void EditorFileDialog::_go_back() {
|
||||
dir_prev->set_disabled(local_history_pos == 0);
|
||||
dir_next->set_disabled(local_history_pos == local_history.size() - 1);
|
||||
}
|
||||
|
||||
void EditorFileDialog::_go_forward() {
|
||||
if (local_history_pos == local_history.size() - 1) {
|
||||
return;
|
||||
|
@ -56,6 +56,7 @@ int EditorFileSystemDirectory::find_file_index(const String &p_file) const {
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int EditorFileSystemDirectory::find_dir_index(const String &p_dir) const {
|
||||
for (int i = 0; i < subdirs.size(); i++) {
|
||||
if (subdirs[i]->name == p_dir)
|
||||
@ -1110,6 +1111,7 @@ void EditorFileSystem::_notification(int p_what) {
|
||||
bool EditorFileSystem::is_scanning() const {
|
||||
return scanning || scanning_changes;
|
||||
}
|
||||
|
||||
float EditorFileSystem::get_scanning_progress() const {
|
||||
return scan_total;
|
||||
}
|
||||
|
@ -127,6 +127,7 @@ void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p
|
||||
_fill_folds(p_root, p_node->get_child(i), p_folds, resource_folds, nodes_folded, resources);
|
||||
}
|
||||
}
|
||||
|
||||
void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path) {
|
||||
ERR_FAIL_NULL(p_scene);
|
||||
|
||||
@ -150,6 +151,7 @@ void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path
|
||||
file = EditorSettings::get_singleton()->get_project_settings_dir().plus_file(file);
|
||||
config->save(file);
|
||||
}
|
||||
|
||||
void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) {
|
||||
Ref<ConfigFile> config;
|
||||
config.instance();
|
||||
|
@ -1474,6 +1474,7 @@ void EditorHelp::search_again(bool p_search_previous) {
|
||||
int EditorHelp::get_scroll() const {
|
||||
return class_desc->get_v_scroll()->get_value();
|
||||
}
|
||||
|
||||
void EditorHelp::set_scroll(int p_scroll) {
|
||||
class_desc->get_v_scroll()->set_value(p_scroll);
|
||||
}
|
||||
|
@ -532,6 +532,7 @@ bool EditorProperty::use_keying_next() const {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void EditorProperty::set_checkable(bool p_checkable) {
|
||||
checkable = p_checkable;
|
||||
update();
|
||||
@ -737,9 +738,11 @@ void EditorProperty::_gui_input(const Ref<InputEvent> &p_event) {
|
||||
void EditorProperty::set_label_reference(Control *p_control) {
|
||||
label_reference = p_control;
|
||||
}
|
||||
|
||||
void EditorProperty::set_bottom_editor(Control *p_control) {
|
||||
bottom_editor = p_control;
|
||||
}
|
||||
|
||||
Variant EditorProperty::get_drag_data(const Point2 &p_point) {
|
||||
if (property == StringName())
|
||||
return Variant();
|
||||
@ -898,6 +901,7 @@ EditorProperty::EditorProperty() {
|
||||
label_reference = nullptr;
|
||||
bottom_editor = nullptr;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////
|
||||
|
||||
@ -930,6 +934,7 @@ bool EditorInspectorPlugin::can_handle(Object *p_object) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void EditorInspectorPlugin::parse_begin(Object *p_object) {
|
||||
if (get_script_instance()) {
|
||||
get_script_instance()->call("parse_begin", p_object);
|
||||
@ -956,6 +961,7 @@ bool EditorInspectorPlugin::parse_property(Object *p_object, Variant::Type p_typ
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void EditorInspectorPlugin::parse_end() {
|
||||
if (get_script_instance()) {
|
||||
get_script_instance()->call("parse_end");
|
||||
@ -1826,6 +1832,7 @@ void EditorInspector::update_tree() {
|
||||
|
||||
//see if this property exists and should be kept
|
||||
}
|
||||
|
||||
void EditorInspector::update_property(const String &p_prop) {
|
||||
if (!editor_property_map.has(p_prop))
|
||||
return;
|
||||
@ -1884,6 +1891,7 @@ void EditorInspector::set_keying(bool p_active) {
|
||||
keying = p_active;
|
||||
update_tree();
|
||||
}
|
||||
|
||||
void EditorInspector::set_read_only(bool p_read_only) {
|
||||
read_only = p_read_only;
|
||||
update_tree();
|
||||
@ -1892,6 +1900,7 @@ void EditorInspector::set_read_only(bool p_read_only) {
|
||||
bool EditorInspector::is_capitalize_paths_enabled() const {
|
||||
return capitalize_paths;
|
||||
}
|
||||
|
||||
void EditorInspector::set_enable_capitalize_paths(bool p_capitalize) {
|
||||
capitalize_paths = p_capitalize;
|
||||
update_tree();
|
||||
@ -1910,14 +1919,17 @@ void EditorInspector::set_use_doc_hints(bool p_enable) {
|
||||
use_doc_hints = p_enable;
|
||||
update_tree();
|
||||
}
|
||||
|
||||
void EditorInspector::set_hide_script(bool p_hide) {
|
||||
hide_script = p_hide;
|
||||
update_tree();
|
||||
}
|
||||
|
||||
void EditorInspector::set_use_filter(bool p_use) {
|
||||
use_filter = p_use;
|
||||
update_tree();
|
||||
}
|
||||
|
||||
void EditorInspector::register_text_enter(Node *p_line_edit) {
|
||||
search_box = Object::cast_to<LineEdit>(p_line_edit);
|
||||
if (search_box)
|
||||
|
@ -3250,9 +3250,11 @@ ImportDock *EditorNode::get_import_dock() {
|
||||
FileSystemDock *EditorNode::get_filesystem_dock() {
|
||||
return filesystem_dock;
|
||||
}
|
||||
|
||||
SceneTreeDock *EditorNode::get_scene_tree_dock() {
|
||||
return scene_tree_dock;
|
||||
}
|
||||
|
||||
InspectorDock *EditorNode::get_inspector_dock() {
|
||||
return inspector_dock;
|
||||
}
|
||||
|
@ -553,6 +553,7 @@ void EditorPlugin::forward_spatial_force_draw_over_viewport(Control *p_overlay)
|
||||
get_script_instance()->call("forward_spatial_force_draw_over_viewport", p_overlay);
|
||||
}
|
||||
}
|
||||
|
||||
String EditorPlugin::get_name() const {
|
||||
if (get_script_instance() && get_script_instance()->has_method("get_plugin_name")) {
|
||||
return get_script_instance()->call("get_plugin_name");
|
||||
@ -560,6 +561,7 @@ String EditorPlugin::get_name() const {
|
||||
|
||||
return String();
|
||||
}
|
||||
|
||||
const Ref<Texture2D> EditorPlugin::get_icon() const {
|
||||
if (get_script_instance() && get_script_instance()->has_method("get_plugin_icon")) {
|
||||
return get_script_instance()->call("get_plugin_icon");
|
||||
@ -567,6 +569,7 @@ const Ref<Texture2D> EditorPlugin::get_icon() const {
|
||||
|
||||
return Ref<Texture2D>();
|
||||
}
|
||||
|
||||
bool EditorPlugin::has_main_screen() const {
|
||||
if (get_script_instance() && get_script_instance()->has_method("has_main_screen")) {
|
||||
return get_script_instance()->call("has_main_screen");
|
||||
@ -574,6 +577,7 @@ bool EditorPlugin::has_main_screen() const {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void EditorPlugin::make_visible(bool p_visible) {
|
||||
if (get_script_instance() && get_script_instance()->has_method("make_visible")) {
|
||||
get_script_instance()->call("make_visible", p_visible);
|
||||
@ -597,6 +601,7 @@ bool EditorPlugin::handles(Object *p_object) const {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Dictionary EditorPlugin::get_state() const {
|
||||
if (get_script_instance() && get_script_instance()->has_method("get_state")) {
|
||||
return get_script_instance()->call("get_state");
|
||||
@ -638,6 +643,7 @@ void EditorPlugin::get_breakpoints(List<String> *p_breakpoints) {
|
||||
p_breakpoints->push_back(arr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
bool EditorPlugin::get_remove_list(List<Node *> *p_list) {
|
||||
return false;
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ void EditorPropertyText::update_property() {
|
||||
void EditorPropertyText::set_string_name(bool p_enabled) {
|
||||
string_name = p_enabled;
|
||||
}
|
||||
|
||||
void EditorPropertyText::set_placeholder(const String &p_string) {
|
||||
text->set_placeholder(p_string);
|
||||
}
|
||||
@ -209,12 +210,14 @@ EditorPropertyTextEnum::EditorPropertyTextEnum() {
|
||||
add_focusable(options);
|
||||
options->connect("item_selected", callable_mp(this, &EditorPropertyTextEnum::_option_selected));
|
||||
}
|
||||
|
||||
///////////////////// PATH /////////////////////////
|
||||
|
||||
void EditorPropertyPath::_path_selected(const String &p_path) {
|
||||
emit_changed(get_edited_property(), p_path);
|
||||
update_property();
|
||||
}
|
||||
|
||||
void EditorPropertyPath::_path_pressed() {
|
||||
if (!dialog) {
|
||||
dialog = memnew(EditorFileDialog);
|
||||
@ -1158,6 +1161,7 @@ void EditorPropertyRect2::update_property() {
|
||||
spin[3]->set_value(val.size.y);
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void EditorPropertyRect2::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
@ -1168,6 +1172,7 @@ void EditorPropertyRect2::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyRect2::_bind_methods() {
|
||||
}
|
||||
|
||||
@ -1239,6 +1244,7 @@ void EditorPropertyVector3::update_property() {
|
||||
spin[2]->set_value(val.z);
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void EditorPropertyVector3::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
@ -1249,6 +1255,7 @@ void EditorPropertyVector3::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyVector3::_bind_methods() {
|
||||
}
|
||||
|
||||
@ -1403,6 +1410,7 @@ void EditorPropertyRect2i::update_property() {
|
||||
spin[3]->set_value(val.size.y);
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void EditorPropertyRect2i::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
@ -1413,6 +1421,7 @@ void EditorPropertyRect2i::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyRect2i::_bind_methods() {
|
||||
}
|
||||
|
||||
@ -1484,6 +1493,7 @@ void EditorPropertyVector3i::update_property() {
|
||||
spin[2]->set_value(val.z);
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void EditorPropertyVector3i::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
@ -1494,6 +1504,7 @@ void EditorPropertyVector3i::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyVector3i::_bind_methods() {
|
||||
}
|
||||
|
||||
@ -1566,6 +1577,7 @@ void EditorPropertyPlane::update_property() {
|
||||
spin[3]->set_value(val.d);
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void EditorPropertyPlane::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
@ -1576,6 +1588,7 @@ void EditorPropertyPlane::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyPlane::_bind_methods() {
|
||||
}
|
||||
|
||||
@ -1649,6 +1662,7 @@ void EditorPropertyQuat::update_property() {
|
||||
spin[3]->set_value(val.w);
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void EditorPropertyQuat::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
@ -1659,6 +1673,7 @@ void EditorPropertyQuat::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyQuat::_bind_methods() {
|
||||
}
|
||||
|
||||
@ -1735,6 +1750,7 @@ void EditorPropertyAABB::update_property() {
|
||||
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void EditorPropertyAABB::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
@ -1745,6 +1761,7 @@ void EditorPropertyAABB::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyAABB::_bind_methods() {
|
||||
}
|
||||
|
||||
@ -1808,6 +1825,7 @@ void EditorPropertyTransform2D::update_property() {
|
||||
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void EditorPropertyTransform2D::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
@ -1818,6 +1836,7 @@ void EditorPropertyTransform2D::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyTransform2D::_bind_methods() {
|
||||
}
|
||||
|
||||
@ -1886,6 +1905,7 @@ void EditorPropertyBasis::update_property() {
|
||||
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void EditorPropertyBasis::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
@ -1896,6 +1916,7 @@ void EditorPropertyBasis::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyBasis::_bind_methods() {
|
||||
}
|
||||
|
||||
@ -1970,6 +1991,7 @@ void EditorPropertyTransform::update_property() {
|
||||
|
||||
setting = false;
|
||||
}
|
||||
|
||||
void EditorPropertyTransform::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
Color base = get_theme_color("accent_color", "Editor");
|
||||
@ -1980,6 +2002,7 @@ void EditorPropertyTransform::_notification(int p_what) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EditorPropertyTransform::_bind_methods() {
|
||||
}
|
||||
|
||||
@ -2913,6 +2936,7 @@ bool EditorPropertyResource::_is_drop_valid(const Dictionary &p_drag_data) const
|
||||
bool EditorPropertyResource::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
|
||||
return _is_drop_valid(p_data);
|
||||
}
|
||||
|
||||
void EditorPropertyResource::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {
|
||||
ERR_FAIL_COND(!_is_drop_valid(p_data));
|
||||
|
||||
|
@ -37,6 +37,7 @@ static float scale = 1.0;
|
||||
void editor_set_scale(float p_scale) {
|
||||
scale = p_scale;
|
||||
}
|
||||
|
||||
float editor_get_scale() {
|
||||
return scale;
|
||||
}
|
||||
|
@ -382,6 +382,7 @@ void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void ExportTemplateManager::_http_download_templates_completed(int p_status, int p_code, const PackedStringArray &headers, const PackedByteArray &p_data) {
|
||||
switch (p_status) {
|
||||
case HTTPRequest::RESULT_CANT_RESOLVE: {
|
||||
|
@ -1607,9 +1607,11 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
|
||||
uint32_t EditorSceneImporterCollada::get_import_flags() const {
|
||||
return IMPORT_SCENE | IMPORT_ANIMATION;
|
||||
}
|
||||
|
||||
void EditorSceneImporterCollada::get_extensions(List<String> *r_extensions) const {
|
||||
r_extensions->push_back("dae");
|
||||
}
|
||||
|
||||
Node *EditorSceneImporterCollada::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err) {
|
||||
ColladaImport state;
|
||||
uint32_t flags = Collada::IMPORT_FLAG_SCENE;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user