diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index 587b03ae825..6e8a4c63081 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -6,7 +6,7 @@ on: # SCONS_CACHE for windows must be set in the build environment env: # Used for the cache key. Add version suffix to force clean build. - GODOT_BASE_BRANCH: 4.0 + GODOT_BASE_BRANCH: "4.0" SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes SCONS_CACHE_MSVC_CONFIG: true diff --git a/core/math/geometry_3d.cpp b/core/math/geometry_3d.cpp index 590483bf202..0d8379e0dfe 100644 --- a/core/math/geometry_3d.cpp +++ b/core/math/geometry_3d.cpp @@ -394,7 +394,7 @@ static inline void _build_faces(uint8_t ***p_cell_status, int x, int y, int z, i return; } -#define vert(m_idx) Vector3(((m_idx)&4) >> 2, ((m_idx)&2) >> 1, (m_idx)&1) +#define vert(m_idx) Vector3(((m_idx) & 4) >> 2, ((m_idx) & 2) >> 1, (m_idx) & 1) static const uint8_t indices[6][4] = { { 7, 6, 4, 5 }, diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h index 0d55ee4ae2f..98c74eafae8 100644 --- a/core/variant/variant_internal.h +++ b/core/variant/variant_internal.h @@ -806,7 +806,7 @@ struct VariantInternalAccessor { #define VARIANT_ACCESSOR_NUMBER(m_type) \ template <> \ struct VariantInternalAccessor { \ - static _FORCE_INLINE_ m_type get(const Variant *v) { return (m_type)*VariantInternal::get_int(v); } \ + static _FORCE_INLINE_ m_type get(const Variant *v) { return (m_type) * VariantInternal::get_int(v); } \ static _FORCE_INLINE_ void set(Variant *v, m_type p_value) { *VariantInternal::get_int(v) = p_value; } \ }; diff --git a/core/variant/variant_setget.cpp b/core/variant/variant_setget.cpp index 30fb5d0e9fa..129af1f7570 100644 --- a/core/variant/variant_setget.cpp +++ b/core/variant/variant_setget.cpp @@ -428,9 +428,9 @@ Variant Variant::get_named(const StringName &p_member, bool &r_valid) const { } \ m_assign_type num; \ if (value->get_type() == Variant::INT) { \ - num = (m_assign_type)*VariantGetInternalPtr::get_ptr(value); \ + num = (m_assign_type) * VariantGetInternalPtr::get_ptr(value); \ } else if (value->get_type() == Variant::FLOAT) { \ - num = (m_assign_type)*VariantGetInternalPtr::get_ptr(value); \ + num = (m_assign_type) * VariantGetInternalPtr::get_ptr(value); \ } else { \ *oob = false; \ *valid = false; \ @@ -490,9 +490,9 @@ Variant Variant::get_named(const StringName &p_member, bool &r_valid) const { } \ m_assign_type num; \ if (value->get_type() == Variant::INT) { \ - num = (m_assign_type)*VariantGetInternalPtr::get_ptr(value); \ + num = (m_assign_type) * VariantGetInternalPtr::get_ptr(value); \ } else if (value->get_type() == Variant::FLOAT) { \ - num = (m_assign_type)*VariantGetInternalPtr::get_ptr(value); \ + num = (m_assign_type) * VariantGetInternalPtr::get_ptr(value); \ } else { \ *oob = false; \ *valid = false; \ diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 0b389b04788..97473eb6bc5 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -434,7 +434,7 @@ layout(std140) uniform GlobalShaderUniformData { //ubo:1 vec4 global_shader_uniforms[MAX_GLOBAL_SHADER_UNIFORMS]; }; - /* Material Uniforms */ +/* Material Uniforms */ #ifdef MATERIAL_UNIFORMS_USED diff --git a/drivers/gles3/shaders/sky.glsl b/drivers/gles3/shaders/sky.glsl index 2455ffb8e27..770869aef6c 100644 --- a/drivers/gles3/shaders/sky.glsl +++ b/drivers/gles3/shaders/sky.glsl @@ -190,9 +190,7 @@ void main() { #endif { - #CODE : SKY - } color *= luminance_multiplier; diff --git a/drivers/gles3/storage/render_scene_buffers_gles3.h b/drivers/gles3/storage/render_scene_buffers_gles3.h index d07a0812f64..bf8b47432d9 100644 --- a/drivers/gles3/storage/render_scene_buffers_gles3.h +++ b/drivers/gles3/storage/render_scene_buffers_gles3.h @@ -83,9 +83,9 @@ public: virtual ~RenderSceneBuffersGLES3(); virtual void configure(RID p_render_target, const Size2i p_internal_size, const Size2i p_target_size, RS::ViewportScaling3DMode p_scaling_3d_mode, float p_fsr_sharpness, float p_texture_mipmap_bias, RS::ViewportMSAA p_msaa, RenderingServer::ViewportScreenSpaceAA p_screen_space_aa, bool p_use_taa, bool p_use_debanding, uint32_t p_view_count) override; - virtual void set_fsr_sharpness(float p_fsr_sharpness) override{}; - virtual void set_texture_mipmap_bias(float p_texture_mipmap_bias) override{}; - virtual void set_use_debanding(bool p_use_debanding) override{}; + virtual void set_fsr_sharpness(float p_fsr_sharpness) override {}; + virtual void set_texture_mipmap_bias(float p_texture_mipmap_bias) override {}; + virtual void set_use_debanding(bool p_use_debanding) override {}; void free_render_buffer_data(); }; diff --git a/drivers/gles3/storage/texture_storage.h b/drivers/gles3/storage/texture_storage.h index 9803e9548a2..8c7b1773b71 100644 --- a/drivers/gles3/storage/texture_storage.h +++ b/drivers/gles3/storage/texture_storage.h @@ -507,7 +507,7 @@ public: RID texture_create_external(Texture::Type p_type, Image::Format p_format, unsigned int p_image, int p_width, int p_height, int p_depth, int p_layers, RS::TextureLayeredType p_layered_type = RS::TEXTURE_LAYERED_2D_ARRAY); virtual void texture_2d_update(RID p_texture, const Ref &p_image, int p_layer = 0) override; - virtual void texture_3d_update(RID p_texture, const Vector> &p_data) override{}; + virtual void texture_3d_update(RID p_texture, const Vector> &p_data) override {}; virtual void texture_proxy_update(RID p_proxy, RID p_base) override; //these two APIs can be used together or in combination with the others. @@ -573,7 +573,7 @@ public: virtual RID decal_allocate() override; virtual void decal_initialize(RID p_rid) override; - virtual void decal_free(RID p_rid) override{}; + virtual void decal_free(RID p_rid) override {}; virtual void decal_set_size(RID p_decal, const Vector3 &p_size) override; virtual void decal_set_texture(RID p_decal, RS::DecalTexture p_type, RID p_texture) override; diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index 172f2a044c3..d717a2c3f05 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -45,11 +45,11 @@ #endif #ifdef MSVC -#define S_ISREG(m) ((m)&_S_IFREG) +#define S_ISREG(m) ((m) & _S_IFREG) #include #endif #ifndef S_ISREG -#define S_ISREG(m) ((m)&S_IFREG) +#define S_ISREG(m) ((m) & S_IFREG) #endif void FileAccessUnix::check_errors() const { diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 3feed2b1095..04d08634832 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -1341,8 +1341,8 @@ Error VulkanContext::_create_physical_device(VkSurfaceKHR p_surface) { #define GET_INSTANCE_PROC_ADDR(inst, entrypoint) \ { \ fp##entrypoint = (PFN_vk##entrypoint)vkGetInstanceProcAddr(inst, "vk" #entrypoint); \ - ERR_FAIL_COND_V_MSG(fp##entrypoint == nullptr, ERR_CANT_CREATE, \ - "vkGetInstanceProcAddr failed to find vk" #entrypoint); \ + ERR_FAIL_COND_V_MSG(fp##entrypoint == nullptr, ERR_CANT_CREATE, \ + "vkGetInstanceProcAddr failed to find vk" #entrypoint); \ } GET_INSTANCE_PROC_ADDR(inst, GetPhysicalDeviceSurfaceSupportKHR); diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 03930626a52..1d4da2776de 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -46,7 +46,7 @@ #include #ifdef _MSC_VER -#define S_ISREG(m) ((m)&_S_IFREG) +#define S_ISREG(m) ((m) & _S_IFREG) #endif void FileAccessWindows::check_errors() const { diff --git a/editor/editor_title_bar.h b/editor/editor_title_bar.h index 4055476b820..56a1865dc5d 100644 --- a/editor/editor_title_bar.h +++ b/editor/editor_title_bar.h @@ -43,7 +43,7 @@ class EditorTitleBar : public HBoxContainer { protected: virtual void gui_input(const Ref &p_event) override; - static void _bind_methods(){}; + static void _bind_methods() {}; public: void set_can_move_window(bool p_enabled); diff --git a/editor/plugins/font_config_plugin.h b/editor/plugins/font_config_plugin.h index 6cea5967b2a..0c2ee92979a 100644 --- a/editor/plugins/font_config_plugin.h +++ b/editor/plugins/font_config_plugin.h @@ -104,7 +104,7 @@ class EditorPropertyFontMetaOverride : public EditorProperty { protected: void _notification(int p_what); - static void _bind_methods(){}; + static void _bind_methods() {}; void _edit_pressed(); void _page_changed(int p_page); @@ -140,7 +140,7 @@ class EditorPropertyOTVariation : public EditorProperty { protected: void _notification(int p_what); - static void _bind_methods(){}; + static void _bind_methods() {}; void _edit_pressed(); void _page_changed(int p_page); @@ -189,7 +189,7 @@ class EditorPropertyOTFeatures : public EditorProperty { protected: void _notification(int p_what); - static void _bind_methods(){}; + static void _bind_methods() {}; void _edit_pressed(); void _page_changed(int p_page); @@ -256,7 +256,7 @@ protected: virtual void _add_element() override; void _add_font(int p_option); - static void _bind_methods(){}; + static void _bind_methods() {}; public: EditorPropertyFontNamesArray(); diff --git a/editor/plugins/gpu_particles_3d_editor_plugin.h b/editor/plugins/gpu_particles_3d_editor_plugin.h index 176a45df56a..b9f0d9ffe6d 100644 --- a/editor/plugins/gpu_particles_3d_editor_plugin.h +++ b/editor/plugins/gpu_particles_3d_editor_plugin.h @@ -59,7 +59,7 @@ protected: Vector geometry; bool _generate(Vector &points, Vector &normals); - virtual void _generate_emission_points(){}; + virtual void _generate_emission_points() {}; void _node_selected(const NodePath &p_path); static void _bind_methods(); diff --git a/editor/plugins/text_editor.h b/editor/plugins/text_editor.h index 85e0fee6273..f95469c8dd3 100644 --- a/editor/plugins/text_editor.h +++ b/editor/plugins/text_editor.h @@ -122,8 +122,8 @@ public: virtual Variant get_navigation_state() override; virtual Vector get_functions() override; virtual PackedInt32Array get_breakpoints() override; - virtual void set_breakpoint(int p_line, bool p_enabled) override{}; - virtual void clear_breakpoints() override{}; + virtual void set_breakpoint(int p_line, bool p_enabled) override {}; + virtual void clear_breakpoints() override {}; virtual void goto_line(int p_line, bool p_with_error = false) override; void goto_line_selection(int p_line, int p_begin, int p_end); virtual void set_executing_line(int p_line) override; diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp index 8327fa57626..3818d0f743d 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -952,7 +952,7 @@ void TileDataDefaultEditor::forward_draw_over_atlas(TileAtlasView *p_tile_atlas_ } }; -void TileDataDefaultEditor::forward_draw_over_alternatives(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_set_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform){ +void TileDataDefaultEditor::forward_draw_over_alternatives(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_set_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform) { }; diff --git a/editor/plugins/tiles/tile_data_editors.h b/editor/plugins/tiles/tile_data_editors.h index 1ebf30aecd5..7551e074b94 100644 --- a/editor/plugins/tiles/tile_data_editors.h +++ b/editor/plugins/tiles/tile_data_editors.h @@ -53,7 +53,7 @@ private: protected: Ref tile_set; TileData *_get_tile_data(TileMapCell p_cell); - virtual void _tile_set_changed(){}; + virtual void _tile_set_changed() {}; static void _bind_methods(); @@ -62,13 +62,13 @@ public: // Input to handle painting. virtual Control *get_toolbar() { return nullptr; }; - virtual void forward_draw_over_atlas(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform){}; - virtual void forward_draw_over_alternatives(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform){}; - virtual void forward_painting_atlas_gui_input(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, const Ref &p_event){}; - virtual void forward_painting_alternatives_gui_input(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, const Ref &p_event){}; + virtual void forward_draw_over_atlas(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform) {}; + virtual void forward_draw_over_alternatives(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, CanvasItem *p_canvas_item, Transform2D p_transform) {}; + virtual void forward_painting_atlas_gui_input(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, const Ref &p_event) {}; + virtual void forward_painting_alternatives_gui_input(TileAtlasView *p_tile_atlas_view, TileSetAtlasSource *p_tile_atlas_source, const Ref &p_event) {}; // Used to draw the tile data property value over a tile. - virtual void draw_over_tile(CanvasItem *p_canvas_item, Transform2D p_transform, TileMapCell p_cell, bool p_selected = false){}; + virtual void draw_over_tile(CanvasItem *p_canvas_item, Transform2D p_transform, TileMapCell p_cell, bool p_selected = false) {}; }; class DummyObject : public Object { diff --git a/editor/plugins/tiles/tile_map_editor.h b/editor/plugins/tiles/tile_map_editor.h index 1cab1d1500c..e2caa8d45e5 100644 --- a/editor/plugins/tiles/tile_map_editor.h +++ b/editor/plugins/tiles/tile_map_editor.h @@ -60,9 +60,9 @@ public: }; virtual bool forward_canvas_gui_input(const Ref &p_event) { return false; }; - virtual void forward_canvas_draw_over_viewport(Control *p_overlay){}; - virtual void tile_set_changed(){}; - virtual void edit(ObjectID p_tile_map_id, int p_tile_map_layer){}; + virtual void forward_canvas_draw_over_viewport(Control *p_overlay) {}; + virtual void tile_set_changed() {}; + virtual void edit(ObjectID p_tile_map_id, int p_tile_map_layer) {}; }; class TileMapEditorTilesPlugin : public TileMapEditorPlugin { diff --git a/editor/project_converter_3_to_4.cpp b/editor/project_converter_3_to_4.cpp index c238a3b25e0..0397557411e 100644 --- a/editor/project_converter_3_to_4.cpp +++ b/editor/project_converter_3_to_4.cpp @@ -995,107 +995,108 @@ bool ProjectConverter3To4::test_conversion(RegExContainer ®_container) { // get_object_of_execution { - { String base = "var roman = kieliszek."; - String expected = "kieliszek."; - String got = get_object_of_execution(base); - if (got != expected) { - ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size())); + { + String base = "var roman = kieliszek."; + String expected = "kieliszek."; + String got = get_object_of_execution(base); + if (got != expected) { + ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size())); + } + valid = valid && (got == expected); + } + { + String base = "r."; + String expected = "r."; + String got = get_object_of_execution(base); + if (got != expected) { + ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size())); + } + valid = valid && (got == expected); + } + { + String base = "mortadela("; + String expected = ""; + String got = get_object_of_execution(base); + if (got != expected) { + ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size())); + } + valid = valid && (got == expected); + } + { + String base = "var node = $world/ukraine/lviv."; + String expected = "$world/ukraine/lviv."; + String got = get_object_of_execution(base); + if (got != expected) { + ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size())); + } + valid = valid && (got == expected); + } } - valid = valid && (got == expected); -} -{ - String base = "r."; - String expected = "r."; - String got = get_object_of_execution(base); - if (got != expected) { - ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size())); + // get_starting_space + { + String base = "\t\t\t var roman = kieliszek."; + String expected = "\t\t\t"; + String got = get_starting_space(base); + if (got != expected) { + ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size())); + } + valid = valid && (got == expected); } - valid = valid && (got == expected); -} -{ - String base = "mortadela("; - String expected = ""; - String got = get_object_of_execution(base); - if (got != expected) { - ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size())); + // Parse Arguments + { + String line = "( )"; + Vector got_vector = parse_arguments(line); + String got = ""; + String expected = ""; + for (String &part : got_vector) { + got += part + "|||"; + } + if (got != expected) { + ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size())); + } + valid = valid && (got == expected); } - valid = valid && (got == expected); -} -{ - String base = "var node = $world/ukraine/lviv."; - String expected = "$world/ukraine/lviv."; - String got = get_object_of_execution(base); - if (got != expected) { - ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size())); + { + String line = "(a , b , c)"; + Vector got_vector = parse_arguments(line); + String got = ""; + String expected = "a|||b|||c|||"; + for (String &part : got_vector) { + got += part + "|||"; + } + if (got != expected) { + ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size())); + } + valid = valid && (got == expected); } - valid = valid && (got == expected); -} -} -// get_starting_space -{ - String base = "\t\t\t var roman = kieliszek."; - String expected = "\t\t\t"; - String got = get_starting_space(base); - if (got != expected) { - ERR_PRINT(vformat("Failed to get proper data from get_object_of_execution. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", base, expected, expected.size(), got, got.size())); + { + String line = "(a , \"b,\" , c)"; + Vector got_vector = parse_arguments(line); + String got = ""; + String expected = "a|||\"b,\"|||c|||"; + for (String &part : got_vector) { + got += part + "|||"; + } + if (got != expected) { + ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size())); + } + valid = valid && (got == expected); } - valid = valid && (got == expected); -} -// Parse Arguments -{ - String line = "( )"; - Vector got_vector = parse_arguments(line); - String got = ""; - String expected = ""; - for (String &part : got_vector) { - got += part + "|||"; + { + String line = "(a , \"(,),,,,\" , c)"; + Vector got_vector = parse_arguments(line); + String got = ""; + String expected = "a|||\"(,),,,,\"|||c|||"; + for (String &part : got_vector) { + got += part + "|||"; + } + if (got != expected) { + ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size())); + } + valid = valid && (got == expected); } - if (got != expected) { - ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size())); - } - valid = valid && (got == expected); -} -{ - String line = "(a , b , c)"; - Vector got_vector = parse_arguments(line); - String got = ""; - String expected = "a|||b|||c|||"; - for (String &part : got_vector) { - got += part + "|||"; - } - if (got != expected) { - ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size())); - } - valid = valid && (got == expected); -} -{ - String line = "(a , \"b,\" , c)"; - Vector got_vector = parse_arguments(line); - String got = ""; - String expected = "a|||\"b,\"|||c|||"; - for (String &part : got_vector) { - got += part + "|||"; - } - if (got != expected) { - ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size())); - } - valid = valid && (got == expected); -} -{ - String line = "(a , \"(,),,,,\" , c)"; - Vector got_vector = parse_arguments(line); - String got = ""; - String expected = "a|||\"(,),,,,\"|||c|||"; - for (String &part : got_vector) { - got += part + "|||"; - } - if (got != expected) { - ERR_PRINT(vformat("Failed to get proper data from parse_arguments. \"%s\" should return \"%s\"(%d), got \"%s\"(%d), instead.", line, expected, expected.size(), got, got.size())); - } - valid = valid && (got == expected); -} -return valid; + return valid; } // Validate in all arrays if names don't do cyclic renames "Node" -> "Node2D" | "Node2D" -> "2DNode" diff --git a/modules/gdscript/language_server/gdscript_extend_parser.h b/modules/gdscript/language_server/gdscript_extend_parser.h index 4500cb01f37..2dffa6b8913 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.h +++ b/modules/gdscript/language_server/gdscript_extend_parser.h @@ -36,7 +36,7 @@ #include "godot_lsp.h" #ifndef LINE_NUMBER_TO_INDEX -#define LINE_NUMBER_TO_INDEX(p_line) ((p_line)-1) +#define LINE_NUMBER_TO_INDEX(p_line) ((p_line) - 1) #endif #ifndef SYMBOL_SEPERATOR diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h index dff87f3d744..3a0f65b4b0f 100644 --- a/modules/text_server_adv/text_server_adv.h +++ b/modules/text_server_adv/text_server_adv.h @@ -664,7 +664,7 @@ class TextServerAdvanced : public TextServerExtension { }; protected: - static void _bind_methods(){}; + static void _bind_methods() {}; void full_copy(ShapedTextDataAdvanced *p_shaped); void invalidate(ShapedTextDataAdvanced *p_shaped, bool p_text = false); diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index eac5ba4a076..51712d99afe 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -71,7 +71,7 @@ using namespace godot; /*************************************************************************/ -#define OT_TAG(c1, c2, c3, c4) ((int32_t)((((uint32_t)(c1)&0xff) << 24) | (((uint32_t)(c2)&0xff) << 16) | (((uint32_t)(c3)&0xff) << 8) | ((uint32_t)(c4)&0xff))) +#define OT_TAG(c1, c2, c3, c4) ((int32_t)((((uint32_t)(c1) & 0xff) << 24) | (((uint32_t)(c2) & 0xff) << 16) | (((uint32_t)(c3) & 0xff) << 8) | ((uint32_t)(c4) & 0xff))) bool TextServerFallback::_has_feature(Feature p_feature) const { switch (p_feature) { diff --git a/modules/text_server_fb/text_server_fb.h b/modules/text_server_fb/text_server_fb.h index d9e471154da..8e44aca81eb 100644 --- a/modules/text_server_fb/text_server_fb.h +++ b/modules/text_server_fb/text_server_fb.h @@ -534,7 +534,7 @@ class TextServerFallback : public TextServerExtension { Mutex ft_mutex; protected: - static void _bind_methods(){}; + static void _bind_methods() {}; void full_copy(ShapedTextDataFallback *p_shaped); void invalidate(ShapedTextDataFallback *p_shaped); diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index 888c202f9bf..a73ad6eee35 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -379,7 +379,7 @@ void EditorExportPlatformAndroid::_check_for_changes_poll_thread(void *ud) { d.description += "Chipset: " + p.get_slice("=", 1).strip_edges() + "\n"; } else if (p.begins_with("ro.opengles.version=")) { uint32_t opengl = p.get_slice("=", 1).to_int(); - d.description += "OpenGL: " + itos(opengl >> 16) + "." + itos((opengl >> 8) & 0xFF) + "." + itos((opengl)&0xFF) + "\n"; + d.description += "OpenGL: " + itos(opengl >> 16) + "." + itos((opengl >> 8) & 0xFF) + "." + itos((opengl) & 0xFF) + "\n"; } } diff --git a/platform/android/java/lib/src/org/godotengine/godot/plugin/SignalInfo.java b/platform/android/java/lib/src/org/godotengine/godot/plugin/SignalInfo.java index 4a166112abe..be5a7a2962e 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/plugin/SignalInfo.java +++ b/platform/android/java/lib/src/org/godotengine/godot/plugin/SignalInfo.java @@ -50,7 +50,7 @@ public final class SignalInfo { } this.name = signalName; - this.paramTypes = paramTypes == null ? new Class[ 0 ] : paramTypes; + this.paramTypes = paramTypes == null ? new Class[0] : paramTypes; this.paramTypesNames = new String[this.paramTypes.length]; for (int i = 0; i < this.paramTypes.length; i++) { this.paramTypesNames[i] = this.paramTypes[i].getName(); diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index bf460f6bd8b..f80fcbd71ad 100644 --- a/platform/linuxbsd/joypad_linux.cpp +++ b/platform/linuxbsd/joypad_linux.cpp @@ -50,7 +50,7 @@ #define LONG_BITS (sizeof(long) * 8) #define test_bit(nr, addr) (((1UL << ((nr) % LONG_BITS)) & ((addr)[(nr) / LONG_BITS])) != 0) -#define NBITS(x) ((((x)-1) / LONG_BITS) + 1) +#define NBITS(x) ((((x) - 1) / LONG_BITS) + 1) #ifdef UDEV_ENABLED static const char *ignore_str = "/dev/input/js"; diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index fb24bce71d8..7a7944d514c 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -3362,7 +3362,7 @@ void DisplayServerMacOS::cursor_set_custom_image(const Ref &p_cursor, uint8_t alpha = (color >> 24) & 0xFF; pixels[i * 4 + 0] = ((color >> 16) & 0xFF) * alpha / 255; pixels[i * 4 + 1] = ((color >> 8) & 0xFF) * alpha / 255; - pixels[i * 4 + 2] = ((color)&0xFF) * alpha / 255; + pixels[i * 4 + 2] = ((color) & 0xFF) * alpha / 255; pixels[i * 4 + 3] = alpha; } diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 6ce5fd2dd62..115cb64a46e 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -2219,9 +2219,9 @@ void DisplayServerWindows::set_context(Context p_context) { #define SIGNATURE_MASK 0xFFFFFF00 // Keeping the name suggested by Microsoft, but this macro really answers: // Is this mouse event emulated from touch or pen input? -#define IsPenEvent(dw) (((dw)&SIGNATURE_MASK) == MI_WP_SIGNATURE) +#define IsPenEvent(dw) (((dw) & SIGNATURE_MASK) == MI_WP_SIGNATURE) // This one tells whether the event comes from touchscreen (and not from pen). -#define IsTouchEvent(dw) (IsPenEvent(dw) && ((dw)&0x80)) +#define IsTouchEvent(dw) (IsPenEvent(dw) && ((dw) & 0x80)) void DisplayServerWindows::_touch_event(WindowID p_window, bool p_pressed, float p_x, float p_y, int idx) { if (touch_state.has(idx) == p_pressed) { diff --git a/scene/resources/camera_attributes.h b/scene/resources/camera_attributes.h index 0f819134e22..3347a2f1a61 100644 --- a/scene/resources/camera_attributes.h +++ b/scene/resources/camera_attributes.h @@ -53,7 +53,7 @@ protected: float auto_exposure_max = 64.0; float auto_exposure_speed = 0.5; float auto_exposure_scale = 0.4; - virtual void _update_auto_exposure(){}; + virtual void _update_auto_exposure() {}; public: virtual RID get_rid() const override; diff --git a/scene/resources/primitive_meshes.h b/scene/resources/primitive_meshes.h index e62f26b17c8..bfa34e1f717 100644 --- a/scene/resources/primitive_meshes.h +++ b/scene/resources/primitive_meshes.h @@ -75,7 +75,7 @@ protected: Vector2 get_uv2_scale(Vector2 p_margin_scale = Vector2(1.0, 1.0)) const; float get_lightmap_texel_size() const; - virtual void _update_lightmap_size(){}; + virtual void _update_lightmap_size() {}; public: virtual int get_surface_count() const override; diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index d62bac85701..9da4ff4577f 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -555,25 +555,25 @@ public: // Not exposed. virtual void set_tile_set(const TileSet *p_tile_set); - virtual void notify_tile_data_properties_should_change(){}; - virtual void add_occlusion_layer(int p_index){}; - virtual void move_occlusion_layer(int p_from_index, int p_to_pos){}; - virtual void remove_occlusion_layer(int p_index){}; - virtual void add_physics_layer(int p_index){}; - virtual void move_physics_layer(int p_from_index, int p_to_pos){}; - virtual void remove_physics_layer(int p_index){}; - virtual void add_terrain_set(int p_index){}; - virtual void move_terrain_set(int p_from_index, int p_to_pos){}; - virtual void remove_terrain_set(int p_index){}; - virtual void add_terrain(int p_terrain_set, int p_index){}; - virtual void move_terrain(int p_terrain_set, int p_from_index, int p_to_pos){}; - virtual void remove_terrain(int p_terrain_set, int p_index){}; - virtual void add_navigation_layer(int p_index){}; - virtual void move_navigation_layer(int p_from_index, int p_to_pos){}; - virtual void remove_navigation_layer(int p_index){}; - virtual void add_custom_data_layer(int p_index){}; - virtual void move_custom_data_layer(int p_from_index, int p_to_pos){}; - virtual void remove_custom_data_layer(int p_index){}; + virtual void notify_tile_data_properties_should_change() {}; + virtual void add_occlusion_layer(int p_index) {}; + virtual void move_occlusion_layer(int p_from_index, int p_to_pos) {}; + virtual void remove_occlusion_layer(int p_index) {}; + virtual void add_physics_layer(int p_index) {}; + virtual void move_physics_layer(int p_from_index, int p_to_pos) {}; + virtual void remove_physics_layer(int p_index) {}; + virtual void add_terrain_set(int p_index) {}; + virtual void move_terrain_set(int p_from_index, int p_to_pos) {}; + virtual void remove_terrain_set(int p_index) {}; + virtual void add_terrain(int p_terrain_set, int p_index) {}; + virtual void move_terrain(int p_terrain_set, int p_from_index, int p_to_pos) {}; + virtual void remove_terrain(int p_terrain_set, int p_index) {}; + virtual void add_navigation_layer(int p_index) {}; + virtual void move_navigation_layer(int p_from_index, int p_to_pos) {}; + virtual void remove_navigation_layer(int p_index) {}; + virtual void add_custom_data_layer(int p_index) {}; + virtual void move_custom_data_layer(int p_from_index, int p_to_pos) {}; + virtual void remove_custom_data_layer(int p_index) {}; virtual void reset_state() override; // Tiles. diff --git a/servers/display_server.h b/servers/display_server.h index aa30b25b654..6c2900d7d7b 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -332,7 +332,7 @@ public: virtual void delete_sub_window(WindowID p_id); virtual WindowID window_get_active_popup() const { return INVALID_WINDOW_ID; }; - virtual void window_set_popup_safe_rect(WindowID p_window, const Rect2i &p_rect){}; + virtual void window_set_popup_safe_rect(WindowID p_window, const Rect2i &p_rect) {}; virtual Rect2i window_get_popup_safe_rect(WindowID p_window) const { return Rect2i(); }; virtual int64_t window_get_native_handle(HandleType p_handle_type, WindowID p_window = MAIN_WINDOW_ID) const; @@ -475,7 +475,7 @@ public: virtual int tablet_get_driver_count() const { return 1; }; virtual String tablet_get_driver_name(int p_driver) const { return "default"; }; virtual String tablet_get_current_driver() const { return "default"; }; - virtual void tablet_set_current_driver(const String &p_driver){}; + virtual void tablet_set_current_driver(const String &p_driver) {}; virtual void process_events() = 0; diff --git a/servers/physics_3d/godot_soft_body_3d.cpp b/servers/physics_3d/godot_soft_body_3d.cpp index 1820a295537..330cc758ff0 100644 --- a/servers/physics_3d/godot_soft_body_3d.cpp +++ b/servers/physics_3d/godot_soft_body_3d.cpp @@ -598,7 +598,7 @@ void GodotSoftBody3D::generate_bending_constraints(int p_distance) { const uint32_t adj_size = n * n; unsigned *adj = memnew_arr(unsigned, adj_size); -#define IDX(_x_, _y_) ((_y_)*n + (_x_)) +#define IDX(_x_, _y_) ((_y_) * n + (_x_)) for (j = 0; j < n; ++j) { for (i = 0; i < n; ++i) { int idx_ij = j * n + i; diff --git a/servers/rendering/dummy/storage/material_storage.h b/servers/rendering/dummy/storage/material_storage.h index e8766b4a21a..b212e508981 100644 --- a/servers/rendering/dummy/storage/material_storage.h +++ b/servers/rendering/dummy/storage/material_storage.h @@ -60,7 +60,7 @@ public: virtual RID shader_allocate() override { return RID(); } virtual void shader_initialize(RID p_rid) override {} - virtual void shader_free(RID p_rid) override{}; + virtual void shader_free(RID p_rid) override {}; virtual void shader_set_code(RID p_shader, const String &p_code) override {} virtual void shader_set_path_hint(RID p_shader, const String &p_code) override {} @@ -77,7 +77,7 @@ public: /* MATERIAL API */ virtual RID material_allocate() override { return RID(); } virtual void material_initialize(RID p_rid) override {} - virtual void material_free(RID p_rid) override{}; + virtual void material_free(RID p_rid) override {}; virtual void material_set_render_priority(RID p_material, int priority) override {} virtual void material_set_shader(RID p_shader_material, RID p_shader) override {} diff --git a/servers/rendering/dummy/storage/texture_storage.h b/servers/rendering/dummy/storage/texture_storage.h index 67661ce8210..9b15bb0f4a4 100644 --- a/servers/rendering/dummy/storage/texture_storage.h +++ b/servers/rendering/dummy/storage/texture_storage.h @@ -58,14 +58,14 @@ public: /* Canvas Texture API */ virtual RID canvas_texture_allocate() override { return RID(); }; - virtual void canvas_texture_initialize(RID p_rid) override{}; - virtual void canvas_texture_free(RID p_rid) override{}; + virtual void canvas_texture_initialize(RID p_rid) override {}; + virtual void canvas_texture_free(RID p_rid) override {}; - virtual void canvas_texture_set_channel(RID p_canvas_texture, RS::CanvasTextureChannel p_channel, RID p_texture) override{}; - virtual void canvas_texture_set_shading_parameters(RID p_canvas_texture, const Color &p_base_color, float p_shininess) override{}; + virtual void canvas_texture_set_channel(RID p_canvas_texture, RS::CanvasTextureChannel p_channel, RID p_texture) override {}; + virtual void canvas_texture_set_shading_parameters(RID p_canvas_texture, const Color &p_base_color, float p_shininess) override {}; - virtual void canvas_texture_set_texture_filter(RID p_item, RS::CanvasItemTextureFilter p_filter) override{}; - virtual void canvas_texture_set_texture_repeat(RID p_item, RS::CanvasItemTextureRepeat p_repeat) override{}; + virtual void canvas_texture_set_texture_filter(RID p_item, RS::CanvasItemTextureFilter p_filter) override {}; + virtual void canvas_texture_set_texture_repeat(RID p_item, RS::CanvasItemTextureRepeat p_repeat) override {}; /* Texture API */ @@ -90,18 +90,18 @@ public: ERR_FAIL_COND(!t); t->image = p_image->duplicate(); }; - virtual void texture_2d_layered_initialize(RID p_texture, const Vector> &p_layers, RS::TextureLayeredType p_layered_type) override{}; - virtual void texture_3d_initialize(RID p_texture, Image::Format, int p_width, int p_height, int p_depth, bool p_mipmaps, const Vector> &p_data) override{}; - virtual void texture_proxy_initialize(RID p_texture, RID p_base) override{}; //all slices, then all the mipmaps, must be coherent + virtual void texture_2d_layered_initialize(RID p_texture, const Vector> &p_layers, RS::TextureLayeredType p_layered_type) override {}; + virtual void texture_3d_initialize(RID p_texture, Image::Format, int p_width, int p_height, int p_depth, bool p_mipmaps, const Vector> &p_data) override {}; + virtual void texture_proxy_initialize(RID p_texture, RID p_base) override {}; //all slices, then all the mipmaps, must be coherent - virtual void texture_2d_update(RID p_texture, const Ref &p_image, int p_layer = 0) override{}; - virtual void texture_3d_update(RID p_texture, const Vector> &p_data) override{}; - virtual void texture_proxy_update(RID p_proxy, RID p_base) override{}; + virtual void texture_2d_update(RID p_texture, const Ref &p_image, int p_layer = 0) override {}; + virtual void texture_3d_update(RID p_texture, const Vector> &p_data) override {}; + virtual void texture_proxy_update(RID p_proxy, RID p_base) override {}; //these two APIs can be used together or in combination with the others. - virtual void texture_2d_placeholder_initialize(RID p_texture) override{}; - virtual void texture_2d_layered_placeholder_initialize(RID p_texture, RenderingServer::TextureLayeredType p_layered_type) override{}; - virtual void texture_3d_placeholder_initialize(RID p_texture) override{}; + virtual void texture_2d_placeholder_initialize(RID p_texture) override {}; + virtual void texture_2d_layered_placeholder_initialize(RID p_texture, RenderingServer::TextureLayeredType p_layered_type) override {}; + virtual void texture_3d_placeholder_initialize(RID p_texture) override {}; virtual Ref texture_2d_get(RID p_texture) const override { DummyTexture *t = texture_owner.get_or_null(p_texture); @@ -112,18 +112,18 @@ public: virtual Vector> texture_3d_get(RID p_texture) const override { return Vector>(); }; virtual void texture_replace(RID p_texture, RID p_by_texture) override { texture_free(p_by_texture); }; - virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) override{}; + virtual void texture_set_size_override(RID p_texture, int p_width, int p_height) override {}; - virtual void texture_set_path(RID p_texture, const String &p_path) override{}; + virtual void texture_set_path(RID p_texture, const String &p_path) override {}; virtual String texture_get_path(RID p_texture) const override { return String(); }; - virtual void texture_set_detect_3d_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata) override{}; - virtual void texture_set_detect_normal_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata) override{}; - virtual void texture_set_detect_roughness_callback(RID p_texture, RS::TextureDetectRoughnessCallback p_callback, void *p_userdata) override{}; + virtual void texture_set_detect_3d_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata) override {}; + virtual void texture_set_detect_normal_callback(RID p_texture, RS::TextureDetectCallback p_callback, void *p_userdata) override {}; + virtual void texture_set_detect_roughness_callback(RID p_texture, RS::TextureDetectRoughnessCallback p_callback, void *p_userdata) override {}; - virtual void texture_debug_usage(List *r_info) override{}; + virtual void texture_debug_usage(List *r_info) override {}; - virtual void texture_set_force_redraw_if_visible(RID p_texture, bool p_enable) override{}; + virtual void texture_set_force_redraw_if_visible(RID p_texture, bool p_enable) override {}; virtual Size2 texture_size_with_proxy(RID p_proxy) override { return Size2(); }; @@ -132,7 +132,7 @@ public: /* DECAL API */ virtual RID decal_allocate() override { return RID(); } virtual void decal_initialize(RID p_rid) override {} - virtual void decal_free(RID p_rid) override{}; + virtual void decal_free(RID p_rid) override {}; virtual void decal_set_size(RID p_decal, const Vector3 &p_size) override {} virtual void decal_set_texture(RID p_decal, RS::DecalTexture p_type, RID p_texture) override {} diff --git a/servers/rendering/renderer_rd/environment/fog.h b/servers/rendering/renderer_rd/environment/fog.h index 277389c596d..503602635fc 100644 --- a/servers/rendering/renderer_rd/environment/fog.h +++ b/servers/rendering/renderer_rd/environment/fog.h @@ -314,8 +314,8 @@ public: int last_shadow_filter = -1; - virtual void configure(RenderSceneBuffersRD *p_render_buffers) override{}; - virtual void free_data() override{}; + virtual void configure(RenderSceneBuffersRD *p_render_buffers) override {}; + virtual void free_data() override {}; bool sync_gi_dependent_sets_validity(bool p_ensure_freed = false); diff --git a/servers/rendering/renderer_rd/environment/gi.h b/servers/rendering/renderer_rd/environment/gi.h index 651a660f5c7..49c6511257e 100644 --- a/servers/rendering/renderer_rd/environment/gi.h +++ b/servers/rendering/renderer_rd/environment/gi.h @@ -461,7 +461,7 @@ public: RID get_voxel_gi_buffer(); - virtual void configure(RenderSceneBuffersRD *p_render_buffers) override{}; + virtual void configure(RenderSceneBuffersRD *p_render_buffers) override {}; virtual void free_data() override; }; @@ -672,7 +672,7 @@ public: int32_t cascade_dynamic_light_count[SDFGI::MAX_CASCADES]; //used dynamically RID integrate_sky_uniform_set; - virtual void configure(RenderSceneBuffersRD *p_render_buffers) override{}; + virtual void configure(RenderSceneBuffersRD *p_render_buffers) override {}; virtual void free_data() override; ~SDFGI(); diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h index 214b39c4966..5789660ec49 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h @@ -360,12 +360,12 @@ protected: virtual RID _render_buffers_get_normal_texture(Ref p_render_buffers) override; virtual RID _render_buffers_get_velocity_texture(Ref p_render_buffers) override; - virtual void environment_set_ssao_quality(RS::EnvironmentSSAOQuality p_quality, bool p_half_size, float p_adaptive_target, int p_blur_passes, float p_fadeout_from, float p_fadeout_to) override{}; - virtual void environment_set_ssil_quality(RS::EnvironmentSSILQuality p_quality, bool p_half_size, float p_adaptive_target, int p_blur_passes, float p_fadeout_from, float p_fadeout_to) override{}; - virtual void environment_set_ssr_roughness_quality(RS::EnvironmentSSRRoughnessQuality p_quality) override{}; + virtual void environment_set_ssao_quality(RS::EnvironmentSSAOQuality p_quality, bool p_half_size, float p_adaptive_target, int p_blur_passes, float p_fadeout_from, float p_fadeout_to) override {}; + virtual void environment_set_ssil_quality(RS::EnvironmentSSILQuality p_quality, bool p_half_size, float p_adaptive_target, int p_blur_passes, float p_fadeout_from, float p_fadeout_to) override {}; + virtual void environment_set_ssr_roughness_quality(RS::EnvironmentSSRRoughnessQuality p_quality) override {}; - virtual void sub_surface_scattering_set_quality(RS::SubSurfaceScatteringQuality p_quality) override{}; - virtual void sub_surface_scattering_set_scale(float p_scale, float p_depth_scale) override{}; + virtual void sub_surface_scattering_set_quality(RS::SubSurfaceScatteringQuality p_quality) override {}; + virtual void sub_surface_scattering_set_scale(float p_scale, float p_depth_scale) override {}; /* Geometry instance */ diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.h b/servers/rendering/renderer_rd/renderer_scene_render_rd.h index 7c43021eb05..20ad41e8377 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.h @@ -204,9 +204,9 @@ public: /* LIGHTING */ - virtual void setup_added_reflection_probe(const Transform3D &p_transform, const Vector3 &p_half_size){}; - virtual void setup_added_light(const RS::LightType p_type, const Transform3D &p_transform, float p_radius, float p_spot_aperture){}; - virtual void setup_added_decal(const Transform3D &p_transform, const Vector3 &p_half_size){}; + virtual void setup_added_reflection_probe(const Transform3D &p_transform, const Vector3 &p_half_size) {}; + virtual void setup_added_light(const RS::LightType p_type, const Transform3D &p_transform, float p_radius, float p_spot_aperture) {}; + virtual void setup_added_decal(const Transform3D &p_transform, const Vector3 &p_half_size) {}; /* GI */ @@ -278,7 +278,7 @@ public: RID render_buffers_get_default_voxel_gi_buffer(); virtual void base_uniforms_changed() = 0; - virtual void update_uniform_sets(){}; + virtual void update_uniform_sets() {}; virtual void render_scene(const Ref &p_render_buffers, const CameraData *p_camera_data, const CameraData *p_prev_camera_data, const PagedArray &p_instances, const PagedArray &p_lights, const PagedArray &p_reflection_probes, const PagedArray &p_voxel_gi_instances, const PagedArray &p_decals, const PagedArray &p_lightmaps, const PagedArray &p_fog_volumes, RID p_environment, RID p_camera_attributes, RID p_shadow_atlas, RID p_occluder_debug_tex, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass, float p_screen_mesh_lod_threshold, const RenderShadowData *p_render_shadows, int p_render_shadow_count, const RenderSDFGIData *p_render_sdfgi_regions, int p_render_sdfgi_region_count, const RenderSDFGIUpdateData *p_sdfgi_update_data = nullptr, RenderingMethod::RenderInfo *r_render_info = nullptr) override; diff --git a/servers/rendering/renderer_rd/shaders/canvas.glsl b/servers/rendering/renderer_rd/shaders/canvas.glsl index 1fb8b28b154..a47477fd59c 100644 --- a/servers/rendering/renderer_rd/shaders/canvas.glsl +++ b/servers/rendering/renderer_rd/shaders/canvas.glsl @@ -27,11 +27,10 @@ layout(location = 3) out vec2 pixel_size_interp; #endif #ifdef MATERIAL_UNIFORMS_USED -layout(set = 1, binding = 0, std140) uniform MaterialUniforms{ - +layout(set = 1, binding = 0, std140) uniform MaterialUniforms { #MATERIAL_UNIFORMS - -} material; +} +material; #endif #GLOBALS @@ -224,11 +223,10 @@ layout(location = 3) in vec2 pixel_size_interp; layout(location = 0) out vec4 frag_color; #ifdef MATERIAL_UNIFORMS_USED -layout(set = 1, binding = 0, std140) uniform MaterialUniforms{ - +layout(set = 1, binding = 0, std140) uniform MaterialUniforms { #MATERIAL_UNIFORMS - -} material; +} +material; #endif vec2 screen_uv_to_sdf(vec2 p_uv) { diff --git a/servers/rendering/renderer_rd/shaders/environment/sky.glsl b/servers/rendering/renderer_rd/shaders/environment/sky.glsl index bf974a3fd50..c60fb0d0a04 100644 --- a/servers/rendering/renderer_rd/shaders/environment/sky.glsl +++ b/servers/rendering/renderer_rd/shaders/environment/sky.glsl @@ -118,9 +118,10 @@ layout(set = 0, binding = 3, std140) uniform DirectionalLights { directional_lights; #ifdef MATERIAL_UNIFORMS_USED -layout(set = 1, binding = 0, std140) uniform MaterialUniforms{ +layout(set = 1, binding = 0, std140) uniform MaterialUniforms { #MATERIAL_UNIFORMS -} material; +} +material; #endif layout(set = 2, binding = 0) uniform textureCube radiance; @@ -252,9 +253,7 @@ void main() { #endif //USE_CUBEMAP_PASS { - #CODE : SKY - } frag_color.rgb = color; diff --git a/servers/rendering/renderer_rd/shaders/environment/volumetric_fog.glsl b/servers/rendering/renderer_rd/shaders/environment/volumetric_fog.glsl index 8e4f5762fde..690c5befefb 100644 --- a/servers/rendering/renderer_rd/shaders/environment/volumetric_fog.glsl +++ b/servers/rendering/renderer_rd/shaders/environment/volumetric_fog.glsl @@ -90,9 +90,10 @@ layout(r32ui, set = 1, binding = 4) uniform volatile uimage3D light_only_map; #endif #ifdef MATERIAL_UNIFORMS_USED -layout(set = 2, binding = 0, std140) uniform MaterialUniforms{ +layout(set = 2, binding = 0, std140) uniform MaterialUniforms { #MATERIAL_UNIFORMS -} material; +} +material; #endif #GLOBALS diff --git a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl index 0098b13d5b5..2329f4887ed 100644 --- a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl @@ -96,9 +96,10 @@ layout(location = 8) out vec4 prev_screen_position; #endif #ifdef MATERIAL_UNIFORMS_USED -layout(set = MATERIAL_UNIFORM_SET, binding = 0, std140) uniform MaterialUniforms{ +layout(set = MATERIAL_UNIFORM_SET, binding = 0, std140) uniform MaterialUniforms { #MATERIAL_UNIFORMS -} material; +} +material; #endif float global_time; @@ -581,11 +582,10 @@ vec2 multiview_uv(vec2 uv) { #endif #ifdef MATERIAL_UNIFORMS_USED -layout(set = MATERIAL_UNIFORM_SET, binding = 0, std140) uniform MaterialUniforms{ - +layout(set = MATERIAL_UNIFORM_SET, binding = 0, std140) uniform MaterialUniforms { #MATERIAL_UNIFORMS - -} material; +} +material; #endif #GLOBALS diff --git a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl index 80f05e71216..00a4bbed86e 100644 --- a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl @@ -92,11 +92,10 @@ layout(location = 6) mediump out vec3 binormal_interp; #endif #ifdef MATERIAL_UNIFORMS_USED -layout(set = MATERIAL_UNIFORM_SET, binding = 0, std140) uniform MaterialUniforms{ - +layout(set = MATERIAL_UNIFORM_SET, binding = 0, std140) uniform MaterialUniforms { #MATERIAL_UNIFORMS - -} material; +} +material; #endif #ifdef MODE_DUAL_PARABOLOID @@ -556,11 +555,10 @@ vec2 multiview_uv(vec2 uv) { #endif #ifdef MATERIAL_UNIFORMS_USED -layout(set = MATERIAL_UNIFORM_SET, binding = 0, std140) uniform MaterialUniforms{ - +layout(set = MATERIAL_UNIFORM_SET, binding = 0, std140) uniform MaterialUniforms { #MATERIAL_UNIFORMS - -} material; +} +material; #endif #GLOBALS diff --git a/servers/rendering/renderer_rd/shaders/particles.glsl b/servers/rendering/renderer_rd/shaders/particles.glsl index a609076e2cc..6dc393ccfe9 100644 --- a/servers/rendering/renderer_rd/shaders/particles.glsl +++ b/servers/rendering/renderer_rd/shaders/particles.glsl @@ -179,11 +179,10 @@ layout(set = 2, binding = 1) uniform texture2D height_field_texture; /* SET 3: MATERIAL */ #ifdef MATERIAL_UNIFORMS_USED -layout(set = 3, binding = 0, std140) uniform MaterialUniforms{ - +layout(set = 3, binding = 0, std140) uniform MaterialUniforms { #MATERIAL_UNIFORMS - -} material; +} +material; #endif layout(push_constant, std430) uniform Params { diff --git a/servers/xr/xr_interface.h b/servers/xr/xr_interface.h index c32455f4663..e7f8f375411 100644 --- a/servers/xr/xr_interface.h +++ b/servers/xr/xr_interface.h @@ -132,10 +132,10 @@ public: virtual RID get_velocity_texture(); /* obtain velocity output texture (if applicable, used for spacewarp) */ virtual void process() = 0; - virtual void pre_render(){}; + virtual void pre_render() {}; virtual bool pre_draw_viewport(RID p_render_target) { return true; }; /* inform XR interface we are about to start our viewport draw process */ virtual Vector post_draw_viewport(RID p_render_target, const Rect2 &p_screen_rect) = 0; /* inform XR interface we finished our viewport draw process */ - virtual void end_frame(){}; + virtual void end_frame() {}; /** passthrough **/ diff --git a/tests/test_macros.h b/tests/test_macros.h index 5d1bcdecf40..b2908691867 100644 --- a/tests/test_macros.h +++ b/tests/test_macros.h @@ -161,11 +161,11 @@ int register_test_command(String p_command, TestFunc p_function); MessageQueue::get_singleton()->flush(); \ } -#define _UPDATE_EVENT_MODIFERS(m_event, m_modifers) \ - m_event->set_shift_pressed(((m_modifers)&KeyModifierMask::SHIFT) != Key::NONE); \ - m_event->set_alt_pressed(((m_modifers)&KeyModifierMask::ALT) != Key::NONE); \ - m_event->set_ctrl_pressed(((m_modifers)&KeyModifierMask::CTRL) != Key::NONE); \ - m_event->set_meta_pressed(((m_modifers)&KeyModifierMask::META) != Key::NONE); +#define _UPDATE_EVENT_MODIFERS(m_event, m_modifers) \ + m_event->set_shift_pressed(((m_modifers) & KeyModifierMask::SHIFT) != Key::NONE); \ + m_event->set_alt_pressed(((m_modifers) & KeyModifierMask::ALT) != Key::NONE); \ + m_event->set_ctrl_pressed(((m_modifers) & KeyModifierMask::CTRL) != Key::NONE); \ + m_event->set_meta_pressed(((m_modifers) & KeyModifierMask::META) != Key::NONE); #define _CREATE_GUI_MOUSE_EVENT(m_screen_pos, m_input, m_mask, m_modifers) \ Ref event; \