diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/csg/csg.cpp | 11 | ||||
-rw-r--r-- | modules/gdnative/gdnative/string.cpp | 6 | ||||
-rw-r--r-- | modules/gdnative/nativescript/nativescript.cpp | 4 | ||||
-rw-r--r-- | modules/gdscript/gdscript_tokenizer.cpp | 6 | ||||
-rw-r--r-- | modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs | 2 | ||||
-rw-r--r-- | modules/tga/image_loader_tga.cpp | 14 |
6 files changed, 24 insertions, 19 deletions
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp index d0c9bf5d38..6c0a3a4ca3 100644 --- a/modules/csg/csg.cpp +++ b/modules/csg/csg.cpp @@ -523,7 +523,7 @@ void CSGBrushOperation::MeshMerge::_add_distance(List<real_t> &r_intersectionsA, // Check if distance exists. for (const List<real_t>::Element *E = intersections.front(); E; E = E->next()) { - if (Math::abs(**E - p_distance) < vertex_snap) { + if (Math::is_equal_approx(**E, p_distance)) { return; } } @@ -1068,15 +1068,6 @@ void CSGBrushOperation::Build2DFaces::_find_edge_intersections(const Vector2 p_s break; } - // Don't create degenerate triangles. - Vector2 split_edge1[2] = { vertices[new_vertex_idx].point, edge_points[0] }; - Vector2 split_edge2[2] = { vertices[new_vertex_idx].point, edge_points[1] }; - Vector2 new_edge[2] = { vertices[new_vertex_idx].point, vertices[opposite_vertex_idx].point }; - if (are_segements_parallel(split_edge1, new_edge, vertex_snap2) && - are_segements_parallel(split_edge2, new_edge, vertex_snap2)) { - break; - } - // If opposite point is on the segemnt, add its index to segment indices too. Vector2 closest_point = Geometry2D::get_closest_point_to_segment(vertices[opposite_vertex_idx].point, p_segment_points); if ((closest_point - vertices[opposite_vertex_idx].point).length_squared() < vertex_snap2) { diff --git a/modules/gdnative/gdnative/string.cpp b/modules/gdnative/gdnative/string.cpp index 724a4b56cb..f89f647aca 100644 --- a/modules/gdnative/gdnative/string.cpp +++ b/modules/gdnative/gdnative/string.cpp @@ -613,19 +613,19 @@ int64_t GDAPI godot_string_char_to_int64_with_len(const wchar_t *p_str, int p_le int64_t GDAPI godot_string_hex_to_int64(const godot_string *p_self) { const String *self = (const String *)p_self; - return self->hex_to_int64(false); + return self->hex_to_int(false); } int64_t GDAPI godot_string_hex_to_int64_with_prefix(const godot_string *p_self) { const String *self = (const String *)p_self; - return self->hex_to_int64(); + return self->hex_to_int(); } int64_t GDAPI godot_string_to_int64(const godot_string *p_self) { const String *self = (const String *)p_self; - return self->to_int64(); + return self->to_int(); } double GDAPI godot_string_unicode_char_to_double(const wchar_t *p_str, const wchar_t **r_end) { diff --git a/modules/gdnative/nativescript/nativescript.cpp b/modules/gdnative/nativescript/nativescript.cpp index 06b9534fce..94aa2125c2 100644 --- a/modules/gdnative/nativescript/nativescript.cpp +++ b/modules/gdnative/nativescript/nativescript.cpp @@ -1853,7 +1853,7 @@ void NativeReloadNode::_notification(int p_what) { #ifdef TOOLS_ENABLED switch (p_what) { - case NOTIFICATION_WM_FOCUS_OUT: { + case NOTIFICATION_APPLICATION_FOCUS_OUT: { if (unloaded) { break; } @@ -1887,7 +1887,7 @@ void NativeReloadNode::_notification(int p_what) { } break; - case NOTIFICATION_WM_FOCUS_IN: { + case NOTIFICATION_APPLICATION_FOCUS_IN: { if (!unloaded) { break; } diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index 2db42601c6..82def3f877 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -952,16 +952,16 @@ void GDScriptTokenizerText::_advance() { INCPOS(i); if (hexa_found) { - int64_t val = str.hex_to_int64(); + int64_t val = str.hex_to_int(); _make_constant(val); } else if (bin_found) { - int64_t val = str.bin_to_int64(); + int64_t val = str.bin_to_int(); _make_constant(val); } else if (period_found || exponent_found) { double val = str.to_double(); _make_constant(val); } else { - int64_t val = str.to_int64(); + int64_t val = str.to_int(); _make_constant(val); } diff --git a/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs b/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs index ae05710f4f..b30c857c64 100644 --- a/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs +++ b/modules/mono/editor/GodotTools/GodotTools/HotReloadAssemblyWatcher.cs @@ -10,7 +10,7 @@ namespace GodotTools public override void _Notification(int what) { - if (what == Node.NotificationWmFocusIn) + if (what == Node.NotificationWmWindowFocusIn) { RestartTimer(); diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp index ce889a4928..1475d24792 100644 --- a/modules/tga/image_loader_tga.cpp +++ b/modules/tga/image_loader_tga.cpp @@ -30,6 +30,8 @@ #include "image_loader_tga.h" +#include "core/error_macros.h" +#include "core/io/file_access_memory.h" #include "core/os/os.h" #include "core/print_string.h" @@ -311,5 +313,17 @@ void ImageLoaderTGA::get_recognized_extensions(List<String> *p_extensions) const p_extensions->push_back("tga"); } +static Ref<Image> _tga_mem_loader_func(const uint8_t *p_png, int p_size) { + FileAccessMemory memfile; + Error open_memfile_error = memfile.open_custom(p_png, p_size); + ERR_FAIL_COND_V_MSG(open_memfile_error, Ref<Image>(), "Could not create memfile for TGA image buffer."); + Ref<Image> img; + img.instance(); + Error load_error = ImageLoaderTGA().load_image(img, &memfile, false, 1.0f); + ERR_FAIL_COND_V_MSG(load_error, Ref<Image>(), "Failed to load TGA image."); + return img; +} + ImageLoaderTGA::ImageLoaderTGA() { + Image::_tga_mem_loader_func = _tga_mem_loader_func; } |