From 0c12e633d4e6b1f8c8edb275ced0374e684195b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 25 Apr 2025 15:40:13 +0200 Subject: [PATCH] Style: Apply fixes from clang-format 18.1.3 --- core/extension/gdextension_interface.cpp | 2 +- core/math/geometry_3d.cpp | 2 +- core/variant/variant_internal.h | 2 +- core/variant/variant_setget.cpp | 8 ++-- drivers/gles3/shaders/sky.glsl | 2 - .../storage/render_scene_buffers_gles3.h | 6 +-- drivers/gles3/storage/texture_storage.h | 4 +- drivers/vulkan/vulkan_context.cpp | 4 +- drivers/windows/file_access_windows.cpp | 2 +- editor/editor_resource_preview.h | 2 +- editor/gui/editor_title_bar.h | 2 +- editor/plugins/font_config_plugin.h | 8 ++-- .../plugins/gpu_particles_3d_editor_plugin.h | 2 +- editor/plugins/text_editor.h | 4 +- editor/plugins/tiles/tile_data_editors.cpp | 2 +- editor/plugins/tiles/tile_data_editors.h | 12 ++--- editor/plugins/tiles/tile_map_editor.h | 6 +-- .../language_server/gdscript_extend_parser.h | 4 +- modules/text_server_adv/text_server_adv.h | 2 +- modules/text_server_fb/text_server_fb.cpp | 2 +- modules/text_server_fb/text_server_fb.h | 2 +- platform/android/export/export_plugin.cpp | 2 +- .../godotengine/godot/plugin/SignalInfo.java | 2 +- platform/ios/os_ios.mm | 2 +- platform/linuxbsd/joypad_linux.cpp | 2 +- platform/macos/display_server_macos.mm | 2 +- platform/windows/display_server_windows.cpp | 4 +- scene/gui/color_mode.h | 2 +- scene/resources/camera_attributes.h | 2 +- scene/resources/primitive_meshes.h | 2 +- scene/resources/tile_set.h | 38 +++++++-------- servers/display_server.h | 4 +- servers/physics_3d/godot_soft_body_3d.cpp | 2 +- .../dummy/storage/material_storage.h | 2 +- .../rendering/dummy/storage/texture_storage.h | 48 +++++++++---------- .../rendering/renderer_rd/environment/fog.h | 4 +- .../rendering/renderer_rd/environment/gi.h | 4 +- .../forward_mobile/render_forward_mobile.h | 10 ++-- .../renderer_rd/renderer_scene_render_rd.h | 6 +-- .../rendering/renderer_rd/shaders/canvas.glsl | 14 +++--- .../renderer_rd/shaders/environment/sky.glsl | 7 ++- .../shaders/environment/volumetric_fog.glsl | 5 +- .../scene_forward_clustered.glsl | 12 ++--- .../forward_mobile/scene_forward_mobile.glsl | 14 +++--- .../renderer_rd/shaders/particles.glsl | 7 ++- servers/xr/xr_interface.h | 4 +- tests/test_macros.h | 10 ++-- 47 files changed, 142 insertions(+), 149 deletions(-) diff --git a/core/extension/gdextension_interface.cpp b/core/extension/gdextension_interface.cpp index e02e7aa701f..de4875accdd 100644 --- a/core/extension/gdextension_interface.cpp +++ b/core/extension/gdextension_interface.cpp @@ -1373,7 +1373,7 @@ static void gdextension_editor_remove_plugin(GDExtensionConstStringNamePtr p_cla #endif } -#define REGISTER_INTERFACE_FUNC(m_name) GDExtension::register_interface_function(#m_name, (GDExtensionInterfaceFunctionPtr)&gdextension_##m_name) +#define REGISTER_INTERFACE_FUNC(m_name) GDExtension::register_interface_function(#m_name, (GDExtensionInterfaceFunctionPtr) & gdextension_##m_name) void gdextension_setup_interface() { REGISTER_INTERFACE_FUNC(get_godot_version); diff --git a/core/math/geometry_3d.cpp b/core/math/geometry_3d.cpp index 9dd88485f90..1a182e233ed 100644 --- a/core/math/geometry_3d.cpp +++ b/core/math/geometry_3d.cpp @@ -393,7 +393,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 116210e8dea..7d6f1c42bfe 100644 --- a/core/variant/variant_internal.h +++ b/core/variant/variant_internal.h @@ -810,7 +810,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 05f7abf32c9..036ed95ea69 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/sky.glsl b/drivers/gles3/shaders/sky.glsl index 9f9c22cf6d3..30e1805c39a 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 543e1aeb152..314113217f7 100644 --- a/drivers/gles3/storage/render_scene_buffers_gles3.h +++ b/drivers/gles3/storage/render_scene_buffers_gles3.h @@ -76,9 +76,9 @@ public: virtual ~RenderSceneBuffersGLES3(); virtual void configure(const RenderSceneBuffersConfiguration *p_config) 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 e5678031180..f10b7cd469e 100644 --- a/drivers/gles3/storage/texture_storage.h +++ b/drivers/gles3/storage/texture_storage.h @@ -506,7 +506,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. @@ -570,7 +570,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/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp index 7a397a170de..fe7ff68d41e 100644 --- a/drivers/vulkan/vulkan_context.cpp +++ b/drivers/vulkan/vulkan_context.cpp @@ -1487,8 +1487,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_NULL_V_MSG(fp##entrypoint, ERR_CANT_CREATE, \ - "vkGetInstanceProcAddr failed to find vk" #entrypoint); \ + ERR_FAIL_NULL_V_MSG(fp##entrypoint, 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 e0889d5ad03..d4ca9714811 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -47,7 +47,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_resource_preview.h b/editor/editor_resource_preview.h index 324245ba238..25d1c937325 100644 --- a/editor/editor_resource_preview.h +++ b/editor/editor_resource_preview.h @@ -55,7 +55,7 @@ public: virtual bool handles(const String &p_type) const; virtual Ref generate(const Ref &p_from, const Size2 &p_size, Dictionary &p_metadata) const; virtual Ref generate_from_path(const String &p_path, const Size2 &p_size, Dictionary &p_metadata) const; - virtual void abort(){}; + virtual void abort() {}; virtual bool generate_small_preview_automatically() const; virtual bool can_generate_small_preview() const; diff --git a/editor/gui/editor_title_bar.h b/editor/gui/editor_title_bar.h index 4055476b820..56a1865dc5d 100644 --- a/editor/gui/editor_title_bar.h +++ b/editor/gui/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 a4ec2d882b0..6fff9066f3d 100644 --- a/editor/plugins/text_editor.h +++ b/editor/plugins/text_editor.h @@ -126,8 +126,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 58c641c61a5..bd54c71b8f3 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -1034,7 +1034,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 4bba5bb4673..a71d6128b50 100644 --- a/editor/plugins/tiles/tile_data_editors.h +++ b/editor/plugins/tiles/tile_data_editors.h @@ -54,7 +54,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(); @@ -63,13 +63,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 c9a1efe62da..7e8340b43f3 100644 --- a/editor/plugins/tiles/tile_map_editor.h +++ b/editor/plugins/tiles/tile_map_editor.h @@ -62,9 +62,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 TileMapSubEditorPlugin { diff --git a/modules/gdscript/language_server/gdscript_extend_parser.h b/modules/gdscript/language_server/gdscript_extend_parser.h index a808f19e5b5..239f7d9f43f 100644 --- a/modules/gdscript/language_server/gdscript_extend_parser.h +++ b/modules/gdscript/language_server/gdscript_extend_parser.h @@ -37,10 +37,10 @@ #include "core/variant/variant.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 COLUMN_NUMBER_TO_INDEX -#define COLUMN_NUMBER_TO_INDEX(p_column) ((p_column)-1) +#define COLUMN_NUMBER_TO_INDEX(p_column) ((p_column) - 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 cbd2911aaf5..410a9d75ac4 100644 --- a/modules/text_server_adv/text_server_adv.h +++ b/modules/text_server_adv/text_server_adv.h @@ -691,7 +691,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 f12275d10c7..a74c60f9813 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -73,7 +73,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 5c30ea0c05e..35bbc01d77f 100644 --- a/modules/text_server_fb/text_server_fb.h +++ b/modules/text_server_fb/text_server_fb.h @@ -559,7 +559,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 5fd0039fb72..ce72aaf06fc 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -384,7 +384,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/ios/os_ios.mm b/platform/ios/os_ios.mm index 3a90eb8eb63..1d91e46a3a5 100644 --- a/platform/ios/os_ios.mm +++ b/platform/ios/os_ios.mm @@ -53,8 +53,8 @@ #if defined(VULKAN_ENABLED) #include "servers/rendering/renderer_rd/renderer_compositor_rd.h" -#import #include "drivers/vulkan/godot_vulkan.h" +#import #endif // Initialization order between compilation units is not guaranteed, diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index 827c5677855..96089146f6b 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 c1207b36e0f..11907daee8d 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -3982,7 +3982,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 8dd07a0bded..c4beca22ba4 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -2630,9 +2630,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/gui/color_mode.h b/scene/gui/color_mode.h index 84e9d4542df..e58c15f7692 100644 --- a/scene/gui/color_mode.h +++ b/scene/gui/color_mode.h @@ -50,7 +50,7 @@ public: virtual Color get_color() const = 0; - virtual void _value_changed(){}; + virtual void _value_changed() {}; virtual void slider_draw(int p_which) = 0; virtual bool apply_theme() const { return false; } 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 5b788b726e3..8c9114f42e5 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 313c4df65de..fb942333eff 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -557,25 +557,25 @@ public: // Not exposed. virtual void set_tile_set(const TileSet *p_tile_set); TileSet *get_tile_set() const; - 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 d2e112d2241..75166def65e 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -366,7 +366,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; @@ -522,7 +522,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 0c2b935554a..e6219773267 100644 --- a/servers/physics_3d/godot_soft_body_3d.cpp +++ b/servers/physics_3d/godot_soft_body_3d.cpp @@ -595,7 +595,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 957fb1fc435..f5cb5f40eb6 100644 --- a/servers/rendering/dummy/storage/material_storage.h +++ b/servers/rendering/dummy/storage/material_storage.h @@ -98,7 +98,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 1331ca72c25..d60583fe7b6 100644 --- a/servers/rendering/dummy/storage/texture_storage.h +++ b/servers/rendering/dummy/storage/texture_storage.h @@ -56,14 +56,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 */ @@ -88,18 +88,18 @@ public: ERR_FAIL_NULL(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); @@ -110,31 +110,31 @@ 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 Image::Format texture_get_format(RID p_texture) const override { return Image::FORMAT_MAX; } - 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(); }; - virtual void texture_rd_initialize(RID p_texture, const RID &p_rd_texture, const RS::TextureLayeredType p_layer_type = RS::TEXTURE_LAYERED_2D_ARRAY) override{}; + virtual void texture_rd_initialize(RID p_texture, const RID &p_rd_texture, const RS::TextureLayeredType p_layer_type = RS::TEXTURE_LAYERED_2D_ARRAY) override {}; virtual RID texture_get_rd_texture(RID p_texture, bool p_srgb = false) const override { return RID(); }; virtual uint64_t texture_get_native_handle(RID p_texture, bool p_srgb = false) const override { return 0; }; /* 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 25fb190f444..6a8f61d9c3a 100644 --- a/servers/rendering/renderer_rd/environment/fog.h +++ b/servers/rendering/renderer_rd/environment/fog.h @@ -316,8 +316,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 c46d4cbd25b..edbdefdc613 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; }; @@ -673,7 +673,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 f10d3c15689..886f1d1ce35 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h @@ -391,12 +391,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 211d191039d..58291505076 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.h @@ -206,9 +206,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 */ diff --git a/servers/rendering/renderer_rd/shaders/canvas.glsl b/servers/rendering/renderer_rd/shaders/canvas.glsl index a234798e77b..2d4a1229b3d 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 @@ -238,11 +237,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 4e5b11aed86..40e111780ca 100644 --- a/servers/rendering/renderer_rd/shaders/environment/sky.glsl +++ b/servers/rendering/renderer_rd/shaders/environment/sky.glsl @@ -106,9 +106,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; @@ -245,9 +246,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 6ba1fe2819a..33b0e3d668f 100644 --- a/servers/rendering/renderer_rd/shaders/environment/volumetric_fog.glsl +++ b/servers/rendering/renderer_rd/shaders/environment/volumetric_fog.glsl @@ -77,9 +77,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 206c2fb2452..61e15197c45 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 @@ -115,9 +115,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; @@ -731,11 +732,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 5ed36697030..58515352dd3 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 @@ -102,11 +102,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 @@ -592,11 +591,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 5fa41547275..0c3d3c3fb55 100644 --- a/servers/rendering/renderer_rd/shaders/particles.glsl +++ b/servers/rendering/renderer_rd/shaders/particles.glsl @@ -168,11 +168,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 c76d0fbf68a..5961e77c3dc 100644 --- a/servers/xr/xr_interface.h +++ b/servers/xr/xr_interface.h @@ -133,10 +133,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 bc85ec6ddc9..a173b37a2de 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; \