diff --git a/platform/macos/display_server_macos.h b/platform/macos/display_server_macos.h index bd3c6af273b3..fb5483ed5ef5 100644 --- a/platform/macos/display_server_macos.h +++ b/platform/macos/display_server_macos.h @@ -289,8 +289,8 @@ class DisplayServerMacOS : public DisplayServer { virtual Color get_base_color() const override; virtual void set_system_theme_change_callback(const Callable &p_callable) override; - virtual Error dialog_show(String p_title, String p_description, Vector p_buttons, const Callable &p_callback) override; - virtual Error dialog_input_text(String p_title, String p_description, String p_partial, const Callable &p_callback) override; + virtual Error dialog_show(const String &p_title, const String &p_description, const Vector &p_buttons, const Callable &p_callback) override; + virtual Error dialog_input_text(const String &p_title, const String &p_description, const String &p_partial, const Callable &p_callback) override; virtual Error file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector &p_filters, const Callable &p_callback) override; virtual Error file_dialog_with_options_show(const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector &p_filters, const TypedArray &p_options, const Callable &p_callback) override; diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index cd2d8a60ace3..98c2294d9f79 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -900,7 +900,7 @@ } } -Error DisplayServerMacOS::dialog_show(String p_title, String p_description, Vector p_buttons, const Callable &p_callback) { +Error DisplayServerMacOS::dialog_show(const String &p_title, const String &p_description, const Vector &p_buttons, const Callable &p_callback) { _THREAD_SAFE_METHOD_ NSAlert *window = [[NSAlert alloc] init]; @@ -1190,7 +1190,7 @@ return OK; } -Error DisplayServerMacOS::dialog_input_text(String p_title, String p_description, String p_partial, const Callable &p_callback) { +Error DisplayServerMacOS::dialog_input_text(const String &p_title, const String &p_description, const String &p_partial, const Callable &p_callback) { _THREAD_SAFE_METHOD_ NSAlert *window = [[NSAlert alloc] init]; diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index f0f894d03b74..d90b993bbaba 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -1168,7 +1168,7 @@ float AudioServer::get_playback_speed_scale() const { return playback_speed_scale; } -void AudioServer::start_playback_stream(Ref p_playback, const StringName &p_bus, Vector p_volume_db_vector, float p_start_time, float p_pitch_scale) { +void AudioServer::start_playback_stream(Ref p_playback, const StringName &p_bus, const Vector &p_volume_db_vector, float p_start_time, float p_pitch_scale) { ERR_FAIL_COND(p_playback.is_null()); HashMap> map; @@ -1242,7 +1242,7 @@ void AudioServer::stop_playback_stream(Ref p_playback) { } while (!playback_node->state.compare_exchange_strong(old_state, new_state)); } -void AudioServer::set_playback_bus_exclusive(Ref p_playback, const StringName &p_bus, Vector p_volumes) { +void AudioServer::set_playback_bus_exclusive(Ref p_playback, const StringName &p_bus, const Vector &p_volumes) { ERR_FAIL_COND(p_volumes.size() != MAX_CHANNELS_PER_BUS); HashMap> map; @@ -1290,7 +1290,7 @@ void AudioServer::set_playback_bus_volumes_linear(Ref p_pla bus_details_graveyard.insert(old_bus_details); } -void AudioServer::set_playback_all_bus_volumes_linear(Ref p_playback, Vector p_volumes) { +void AudioServer::set_playback_all_bus_volumes_linear(Ref p_playback, const Vector &p_volumes) { ERR_FAIL_COND(p_playback.is_null()); ERR_FAIL_COND(p_volumes.size() != MAX_CHANNELS_PER_BUS); diff --git a/servers/audio_server.h b/servers/audio_server.h index 2d6fc6086073..afe8d89e217a 100644 --- a/servers/audio_server.h +++ b/servers/audio_server.h @@ -406,14 +406,14 @@ class AudioServer : public Object { float get_playback_speed_scale() const; // Convenience method. - void start_playback_stream(Ref p_playback, const StringName &p_bus, Vector p_volume_db_vector, float p_start_time = 0, float p_pitch_scale = 1); + void start_playback_stream(Ref p_playback, const StringName &p_bus, const Vector &p_volume_db_vector, float p_start_time = 0, float p_pitch_scale = 1); // Expose all parameters. void start_playback_stream(Ref p_playback, const HashMap> &p_bus_volumes, float p_start_time = 0, float p_pitch_scale = 1, float p_highshelf_gain = 0, float p_attenuation_cutoff_hz = 0); void stop_playback_stream(Ref p_playback); - void set_playback_bus_exclusive(Ref p_playback, const StringName &p_bus, Vector p_volumes); + void set_playback_bus_exclusive(Ref p_playback, const StringName &p_bus, const Vector &p_volumes); void set_playback_bus_volumes_linear(Ref p_playback, const HashMap> &p_bus_volumes); - void set_playback_all_bus_volumes_linear(Ref p_playback, Vector p_volumes); + void set_playback_all_bus_volumes_linear(Ref p_playback, const Vector &p_volumes); void set_playback_pitch_scale(Ref p_playback, float p_pitch_scale); void set_playback_paused(Ref p_playback, bool p_paused); void set_playback_highshelf_params(Ref p_playback, float p_gain, float p_attenuation_cutoff_hz); diff --git a/servers/camera/camera_feed.cpp b/servers/camera/camera_feed.cpp index 0661ffd576df..081bfca14faa 100644 --- a/servers/camera/camera_feed.cpp +++ b/servers/camera/camera_feed.cpp @@ -99,7 +99,7 @@ String CameraFeed::get_name() const { return name; } -void CameraFeed::set_name(String p_name) { +void CameraFeed::set_name(const String &p_name) { name = p_name; } @@ -149,7 +149,7 @@ CameraFeed::CameraFeed() { texture[CameraServer::FEED_CBCR_IMAGE] = RenderingServer::get_singleton()->texture_2d_placeholder_create(); } -CameraFeed::CameraFeed(String p_name, FeedPosition p_position) { +CameraFeed::CameraFeed(const String &p_name, FeedPosition p_position) { // initialize our feed id = CameraServer::get_singleton()->get_free_id(); base_width = 0; diff --git a/servers/camera/camera_feed.h b/servers/camera/camera_feed.h index b85a44cfaec1..6e61c43faf62 100644 --- a/servers/camera/camera_feed.h +++ b/servers/camera/camera_feed.h @@ -80,7 +80,7 @@ class CameraFeed : public RefCounted { void set_active(bool p_is_active); String get_name() const; - void set_name(String p_name); + void set_name(const String &p_name); int get_base_width() const; int get_base_height() const; @@ -94,7 +94,7 @@ class CameraFeed : public RefCounted { RID get_texture(CameraServer::FeedImage p_which); CameraFeed(); - CameraFeed(String p_name, FeedPosition p_position = CameraFeed::FEED_UNSPECIFIED); + CameraFeed(const String &p_name, FeedPosition p_position = CameraFeed::FEED_UNSPECIFIED); virtual ~CameraFeed(); FeedDataType get_datatype() const; diff --git a/servers/display_server.cpp b/servers/display_server.cpp index 54510576459b..7617dffff4ce 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -642,12 +642,12 @@ bool DisplayServer::get_swap_cancel_ok() { void DisplayServer::enable_for_stealing_focus(OS::ProcessID pid) { } -Error DisplayServer::dialog_show(String p_title, String p_description, Vector p_buttons, const Callable &p_callback) { +Error DisplayServer::dialog_show(const String &p_title, const String &p_description, const Vector &p_buttons, const Callable &p_callback) { WARN_PRINT("Native dialogs not supported by this display server."); return ERR_UNAVAILABLE; } -Error DisplayServer::dialog_input_text(String p_title, String p_description, String p_partial, const Callable &p_callback) { +Error DisplayServer::dialog_input_text(const String &p_title, const String &p_description, const String &p_partial, const Callable &p_callback) { WARN_PRINT("Native dialogs not supported by this display server."); return ERR_UNAVAILABLE; } diff --git a/servers/display_server.h b/servers/display_server.h index d0fe76faff37..408758076683 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -535,8 +535,8 @@ class DisplayServer : public Object { virtual void enable_for_stealing_focus(OS::ProcessID pid); - virtual Error dialog_show(String p_title, String p_description, Vector p_buttons, const Callable &p_callback); - virtual Error dialog_input_text(String p_title, String p_description, String p_partial, const Callable &p_callback); + virtual Error dialog_show(const String &p_title, const String &p_description, const Vector &p_buttons, const Callable &p_callback); + virtual Error dialog_input_text(const String &p_title, const String &p_description, const String &p_partial, const Callable &p_callback); enum FileDialogMode { FILE_DIALOG_MODE_OPEN_FILE, diff --git a/servers/physics_server_2d.h b/servers/physics_server_2d.h index 67fc0ed899d5..316f601684bb 100644 --- a/servers/physics_server_2d.h +++ b/servers/physics_server_2d.h @@ -789,7 +789,7 @@ class PhysicsServer2DManager : public Object { ClassInfo() {} - ClassInfo(String p_name, Callable p_create_callback) : + ClassInfo(const String &p_name, Callable p_create_callback) : name(p_name), create_callback(p_create_callback) {} diff --git a/servers/physics_server_3d.h b/servers/physics_server_3d.h index ea785fa03f1d..c41e1b4de837 100644 --- a/servers/physics_server_3d.h +++ b/servers/physics_server_3d.h @@ -997,7 +997,7 @@ class PhysicsServer3DManager : public Object { ClassInfo() {} - ClassInfo(String p_name, Callable p_create_callback) : + ClassInfo(const String &p_name, Callable p_create_callback) : name(p_name), create_callback(p_create_callback) {} diff --git a/servers/rendering/renderer_rd/effects/copy_effects.cpp b/servers/rendering/renderer_rd/effects/copy_effects.cpp index c7a7532d7694..c5ba1a0b01d5 100644 --- a/servers/rendering/renderer_rd/effects/copy_effects.cpp +++ b/servers/rendering/renderer_rd/effects/copy_effects.cpp @@ -1096,7 +1096,7 @@ void CopyEffects::cubemap_downsample_raster(RID p_source_cubemap, RID p_dest_fra RD::get_singleton()->draw_list_end(); } -void CopyEffects::cubemap_filter(RID p_source_cubemap, Vector p_dest_cubemap, bool p_use_array) { +void CopyEffects::cubemap_filter(RID p_source_cubemap, const Vector &p_dest_cubemap, bool p_use_array) { ERR_FAIL_COND_MSG(prefer_raster_effects, "Can't use compute based cubemap filter with the mobile renderer."); UniformSetCacheRD *uniform_set_cache = UniformSetCacheRD::get_singleton(); diff --git a/servers/rendering/renderer_rd/effects/copy_effects.h b/servers/rendering/renderer_rd/effects/copy_effects.h index 014f78e2b9bb..e99e1d1106b0 100644 --- a/servers/rendering/renderer_rd/effects/copy_effects.h +++ b/servers/rendering/renderer_rd/effects/copy_effects.h @@ -349,7 +349,7 @@ class CopyEffects { void copy_cubemap_to_dp(RID p_source_rd_texture, RID p_dst_framebuffer, const Rect2 &p_rect, const Vector2 &p_dst_size, float p_z_near, float p_z_far, bool p_dp_flip); void cubemap_downsample(RID p_source_cubemap, RID p_dest_cubemap, const Size2i &p_size); void cubemap_downsample_raster(RID p_source_cubemap, RID p_dest_framebuffer, uint32_t p_face_id, const Size2i &p_size); - void cubemap_filter(RID p_source_cubemap, Vector p_dest_cubemap, bool p_use_array); + void cubemap_filter(RID p_source_cubemap, const Vector &p_dest_cubemap, bool p_use_array); void cubemap_filter_raster(RID p_source_cubemap, RID p_dest_framebuffer, uint32_t p_face_id, uint32_t p_mip_level); void cubemap_roughness(RID p_source_rd_texture, RID p_dest_texture, uint32_t p_face_id, uint32_t p_sample_count, float p_roughness, float p_size); diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp index 42e1f7b6dc4f..01193ade39ad 100644 --- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp @@ -493,7 +493,7 @@ SceneShaderForwardClustered::~SceneShaderForwardClustered() { material_storage->material_free(debug_shadow_splits_material); } -void SceneShaderForwardClustered::init(const String p_defines) { +void SceneShaderForwardClustered::init(const String &p_defines) { RendererRD::MaterialStorage *material_storage = RendererRD::MaterialStorage::get_singleton(); { diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h index d5332032f9f0..c442ee30f4f0 100644 --- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h +++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.h @@ -255,7 +255,7 @@ class SceneShaderForwardClustered { SceneShaderForwardClustered(); ~SceneShaderForwardClustered(); - void init(const String p_defines); + void init(const String &p_defines); void set_default_specialization_constants(const Vector &p_constants); void enable_advanced_shader_group(bool p_needs_multiview = false); }; diff --git a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp index cf661bb8f4bf..e307034ee083 100644 --- a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp @@ -432,7 +432,7 @@ SceneShaderForwardMobile::SceneShaderForwardMobile() { singleton = this; } -void SceneShaderForwardMobile::init(const String p_defines) { +void SceneShaderForwardMobile::init(const String &p_defines) { RendererRD::MaterialStorage *material_storage = RendererRD::MaterialStorage::get_singleton(); /* SCENE SHADER */ diff --git a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h index 833b06c1e31b..d1bb869d7d8a 100644 --- a/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h +++ b/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.h @@ -206,7 +206,7 @@ class SceneShaderForwardMobile { Vector default_specialization_constants; - void init(const String p_defines); + void init(const String &p_defines); void set_default_specialization_constants(const Vector &p_constants); }; diff --git a/servers/rendering/renderer_scene_cull.h b/servers/rendering/renderer_scene_cull.h index 53f1f2d24617..03824203cd3e 100644 --- a/servers/rendering/renderer_scene_cull.h +++ b/servers/rendering/renderer_scene_cull.h @@ -1314,7 +1314,7 @@ class RendererSceneCull : public RenderingMethod { PASS1RC(float, environment_get_volumetric_fog_ambient_inject, RID) // Glow - PASS13(environment_set_glow, RID, bool, Vector, float, float, float, float, RS::EnvironmentGlowBlendMode, float, float, float, float, RID) + PASS13(environment_set_glow, RID, bool, const Vector &, float, float, float, float, RS::EnvironmentGlowBlendMode, float, float, float, float, RID) PASS1RC(bool, environment_get_glow_enabled, RID) PASS1RC(Vector, environment_get_glow_levels, RID) diff --git a/servers/rendering/renderer_scene_render.cpp b/servers/rendering/renderer_scene_render.cpp index 76c779900fba..048a5e99e726 100644 --- a/servers/rendering/renderer_scene_render.cpp +++ b/servers/rendering/renderer_scene_render.cpp @@ -490,7 +490,7 @@ float RendererSceneRender::environment_get_volumetric_fog_ambient_inject(RID p_e // GLOW -void RendererSceneRender::environment_set_glow(RID p_env, bool p_enable, Vector p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map) { +void RendererSceneRender::environment_set_glow(RID p_env, bool p_enable, const Vector &p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map) { environment_storage.environment_set_glow(p_env, p_enable, p_levels, p_intensity, p_strength, p_mix, p_bloom_threshold, p_blend_mode, p_hdr_bleed_threshold, p_hdr_bleed_scale, p_hdr_luminance_cap, p_glow_map_strength, p_glow_map); } diff --git a/servers/rendering/renderer_scene_render.h b/servers/rendering/renderer_scene_render.h index 719efa4df228..7479117c0abe 100644 --- a/servers/rendering/renderer_scene_render.h +++ b/servers/rendering/renderer_scene_render.h @@ -177,7 +177,7 @@ class RendererSceneRender { virtual void environment_set_volumetric_fog_filter_active(bool p_enable) = 0; // GLOW - void environment_set_glow(RID p_env, bool p_enable, Vector p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map); + void environment_set_glow(RID p_env, bool p_enable, const Vector &p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map); bool environment_get_glow_enabled(RID p_env) const; Vector environment_get_glow_levels(RID p_env) const; float environment_get_glow_intensity(RID p_env) const; diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index 1049cb63cd3c..bc48576b4d0a 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -1506,7 +1506,7 @@ bool RendererViewport::free(RID p_rid) { return false; } -void RendererViewport::handle_timestamp(String p_timestamp, uint64_t p_cpu_time, uint64_t p_gpu_time) { +void RendererViewport::handle_timestamp(const String &p_timestamp, uint64_t p_cpu_time, uint64_t p_gpu_time) { RID *vp = timestamp_vp_map.getptr(p_timestamp); if (!vp) { return; diff --git a/servers/rendering/renderer_viewport.h b/servers/rendering/renderer_viewport.h index b36fc7f57ff6..ef83e157746e 100644 --- a/servers/rendering/renderer_viewport.h +++ b/servers/rendering/renderer_viewport.h @@ -301,7 +301,7 @@ class RendererViewport { void viewport_set_vrs_update_mode(RID p_viewport, RS::ViewportVRSUpdateMode p_mode); void viewport_set_vrs_texture(RID p_viewport, RID p_texture); - void handle_timestamp(String p_timestamp, uint64_t p_cpu_time, uint64_t p_gpu_time); + void handle_timestamp(const String &p_timestamp, uint64_t p_cpu_time, uint64_t p_gpu_time); void draw_viewports(bool p_swap_buffers); diff --git a/servers/rendering/rendering_device_binds.cpp b/servers/rendering/rendering_device_binds.cpp index 986f01a52cb6..3ad74554a011 100644 --- a/servers/rendering/rendering_device_binds.cpp +++ b/servers/rendering/rendering_device_binds.cpp @@ -30,7 +30,7 @@ #include "rendering_device_binds.h" -Error RDShaderFile::parse_versions_from_text(const String &p_text, const String p_defines, OpenIncludeFunction p_include_func, void *p_include_func_userdata) { +Error RDShaderFile::parse_versions_from_text(const String &p_text, const String &p_defines, OpenIncludeFunction p_include_func, void *p_include_func_userdata) { ERR_FAIL_NULL_V(RenderingDevice::get_singleton(), ERR_UNAVAILABLE); Vector lines = p_text.split("\n"); diff --git a/servers/rendering/rendering_device_binds.h b/servers/rendering/rendering_device_binds.h index 4d9b56508000..1dd2118682b1 100644 --- a/servers/rendering/rendering_device_binds.h +++ b/servers/rendering/rendering_device_binds.h @@ -400,7 +400,7 @@ class RDShaderFile : public Resource { } typedef String (*OpenIncludeFunction)(const String &, void *userdata); - Error parse_versions_from_text(const String &p_text, const String p_defines = String(), OpenIncludeFunction p_include_func = nullptr, void *p_include_func_userdata = nullptr); + Error parse_versions_from_text(const String &p_text, const String &p_defines = String(), OpenIncludeFunction p_include_func = nullptr, void *p_include_func_userdata = nullptr); protected: Dictionary _get_versions() const { diff --git a/servers/rendering/rendering_method.h b/servers/rendering/rendering_method.h index 57fbf97d8cce..bf8f561d9097 100644 --- a/servers/rendering/rendering_method.h +++ b/servers/rendering/rendering_method.h @@ -228,7 +228,7 @@ class RenderingMethod { // Glow - virtual void environment_set_glow(RID p_env, bool p_enable, Vector p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map) = 0; + virtual void environment_set_glow(RID p_env, bool p_enable, const Vector &p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map) = 0; virtual bool environment_get_glow_enabled(RID p_env) const = 0; virtual Vector environment_get_glow_levels(RID p_env) const = 0; diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index 6e195a80020f..76badb65120f 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -731,7 +731,7 @@ class RenderingServerDefault : public RenderingServer { FUNC6(environment_set_ssil, RID, bool, float, float, float, float) FUNC6(environment_set_ssil_quality, EnvironmentSSILQuality, bool, float, int, float, float) - FUNC13(environment_set_glow, RID, bool, Vector, float, float, float, float, EnvironmentGlowBlendMode, float, float, float, float, RID) + FUNC13(environment_set_glow, RID, bool, const Vector &, float, float, float, float, EnvironmentGlowBlendMode, float, float, float, float, RID) FUNC1(environment_glow_set_use_bicubic_upscale, bool) FUNC4(environment_set_tonemap, RID, EnvironmentToneMapper, float, float) diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp index 66fcefe2287c..4a117eeba681 100644 --- a/servers/rendering/shader_language.cpp +++ b/servers/rendering/shader_language.cpp @@ -3558,7 +3558,7 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, const FunctionI return false; } -bool ShaderLanguage::_compare_datatypes(DataType p_datatype_a, String p_datatype_name_a, int p_array_size_a, DataType p_datatype_b, String p_datatype_name_b, int p_array_size_b) { +bool ShaderLanguage::_compare_datatypes(DataType p_datatype_a, const String &p_datatype_name_a, int p_array_size_a, DataType p_datatype_b, const String &p_datatype_name_b, int p_array_size_b) { bool result = true; if (p_datatype_a == TYPE_STRUCT || p_datatype_b == TYPE_STRUCT) { @@ -4402,7 +4402,7 @@ void ShaderLanguage::get_keyword_list(List *r_keywords) { } } -bool ShaderLanguage::is_control_flow_keyword(String p_keyword) { +bool ShaderLanguage::is_control_flow_keyword(const String &p_keyword) { return p_keyword == "break" || p_keyword == "case" || p_keyword == "continue" || diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h index ad3b78546d1d..4031483bf346 100644 --- a/servers/rendering/shader_language.h +++ b/servers/rendering/shader_language.h @@ -798,7 +798,7 @@ class ShaderLanguage { static uint32_t get_datatype_size(DataType p_type); static void get_keyword_list(List *r_keywords); - static bool is_control_flow_keyword(String p_keyword); + static bool is_control_flow_keyword(const String &p_keyword); static void get_builtin_funcs(List *r_keywords); static int instance_counter; @@ -1016,7 +1016,7 @@ class ShaderLanguage { _set_error(vformat(RTR("Expected a '%s'."), p_what)); } - void _set_expected_error(const String &p_first, const String p_second) { + void _set_expected_error(const String &p_first, const String &p_second) { _set_error(vformat(RTR("Expected a '%s' or '%s'."), p_first, p_second)); } @@ -1119,7 +1119,7 @@ class ShaderLanguage { static bool is_const_suffix_lut_initialized; Error _validate_precision(DataType p_type, DataPrecision p_precision); - bool _compare_datatypes(DataType p_datatype_a, String p_datatype_name_a, int p_array_size_a, DataType p_datatype_b, String p_datatype_name_b, int p_array_size_b); + bool _compare_datatypes(DataType p_datatype_a, const String &p_datatype_name_a, int p_array_size_a, DataType p_datatype_b, const String &p_datatype_name_b, int p_array_size_b); bool _compare_datatypes_in_nodes(Node *a, Node *b); bool _validate_function_call(BlockNode *p_block, const FunctionInfo &p_function_info, OperatorNode *p_func, DataType *r_ret_type, StringName *r_ret_type_str, bool *r_is_custom_function = nullptr); diff --git a/servers/rendering/storage/environment_storage.cpp b/servers/rendering/storage/environment_storage.cpp index 1bbb5da6bb91..93eb779b1149 100644 --- a/servers/rendering/storage/environment_storage.cpp +++ b/servers/rendering/storage/environment_storage.cpp @@ -427,7 +427,7 @@ float RendererEnvironmentStorage::environment_get_volumetric_fog_ambient_inject( // GLOW -void RendererEnvironmentStorage::environment_set_glow(RID p_env, bool p_enable, Vector p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map) { +void RendererEnvironmentStorage::environment_set_glow(RID p_env, bool p_enable, const Vector &p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map) { Environment *env = environment_owner.get_or_null(p_env); ERR_FAIL_NULL(env); ERR_FAIL_COND_MSG(p_levels.size() != 7, "Size of array of glow levels must be 7"); diff --git a/servers/rendering/storage/environment_storage.h b/servers/rendering/storage/environment_storage.h index 9f78808ff757..9eda69e82461 100644 --- a/servers/rendering/storage/environment_storage.h +++ b/servers/rendering/storage/environment_storage.h @@ -242,7 +242,7 @@ class RendererEnvironmentStorage { float environment_get_volumetric_fog_ambient_inject(RID p_env) const; // GLOW - void environment_set_glow(RID p_env, bool p_enable, Vector p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map); + void environment_set_glow(RID p_env, bool p_enable, const Vector &p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map); bool environment_get_glow_enabled(RID p_env) const; Vector environment_get_glow_levels(RID p_env) const; float environment_get_glow_intensity(RID p_env) const; diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 9fc67b04b1d7..f97abad24547 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -363,7 +363,7 @@ AABB _compute_aabb_from_points(const Vector3 *p_data, int p_length) { return AABB(min, max - min); } -Error RenderingServer::_surface_set_data(Array p_arrays, uint64_t p_format, uint32_t *p_offsets, uint32_t p_vertex_stride, uint32_t p_normal_stride, uint32_t p_attrib_stride, uint32_t p_skin_stride, Vector &r_vertex_array, Vector &r_attrib_array, Vector &r_skin_array, int p_vertex_array_len, Vector &r_index_array, int p_index_array_len, AABB &r_aabb, Vector &r_bone_aabb, Vector4 &r_uv_scale) { +Error RenderingServer::_surface_set_data(const Array &p_arrays, uint64_t p_format, uint32_t *p_offsets, uint32_t p_vertex_stride, uint32_t p_normal_stride, uint32_t p_attrib_stride, uint32_t p_skin_stride, Vector &r_vertex_array, Vector &r_attrib_array, Vector &r_skin_array, int p_vertex_array_len, Vector &r_index_array, int p_index_array_len, AABB &r_aabb, Vector &r_bone_aabb, Vector4 &r_uv_scale) { uint8_t *vw = r_vertex_array.ptrw(); uint8_t *aw = r_attrib_array.ptrw(); uint8_t *sw = r_skin_array.ptrw(); @@ -1385,7 +1385,7 @@ void RenderingServer::mesh_add_surface_from_arrays(RID p_mesh, PrimitiveType p_p mesh_add_surface(p_mesh, sd); } -Array RenderingServer::_get_array_from_surface(uint64_t p_format, Vector p_vertex_data, Vector p_attrib_data, Vector p_skin_data, int p_vertex_len, Vector p_index_data, int p_index_len, const AABB &p_aabb, const Vector4 &p_uv_scale) const { +Array RenderingServer::_get_array_from_surface(uint64_t p_format, const Vector &p_vertex_data, const Vector &p_attrib_data, const Vector &p_skin_data, int p_vertex_len, const Vector &p_index_data, int p_index_len, const AABB &p_aabb, const Vector4 &p_uv_scale) const { uint32_t offsets[RS::ARRAY_MAX]; uint32_t vertex_elem_size; @@ -2067,7 +2067,7 @@ void RenderingServer::_particles_set_trail_bind_poses(RID p_particles, const Typ particles_set_trail_bind_poses(p_particles, tbposes); } -Vector _convert_surface_version_1_to_surface_version_2(uint64_t p_format, Vector p_vertex_data, uint32_t p_vertex_count, uint32_t p_old_stride, uint32_t p_vertex_size, uint32_t p_normal_size, uint32_t p_position_stride, uint32_t p_normal_tangent_stride) { +Vector _convert_surface_version_1_to_surface_version_2(uint64_t p_format, const Vector &p_vertex_data, uint32_t p_vertex_count, uint32_t p_old_stride, uint32_t p_vertex_size, uint32_t p_normal_size, uint32_t p_position_stride, uint32_t p_normal_tangent_stride) { Vector new_vertex_data; new_vertex_data.resize(p_vertex_data.size()); uint8_t *dst_vertex_ptr = new_vertex_data.ptrw(); diff --git a/servers/rendering_server.h b/servers/rendering_server.h index 8450cb0198a7..c5bdf6ffd155 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -68,7 +68,7 @@ class RenderingServer : public Object { int mm_policy = 0; bool render_loop_enabled = true; - Array _get_array_from_surface(uint64_t p_format, Vector p_vertex_data, Vector p_attrib_data, Vector p_skin_data, int p_vertex_len, Vector p_index_data, int p_index_len, const AABB &p_aabb, const Vector4 &p_uv_scale) const; + Array _get_array_from_surface(uint64_t p_format, const Vector &p_vertex_data, const Vector &p_attrib_data, const Vector &p_skin_data, int p_vertex_len, const Vector &p_index_data, int p_index_len, const AABB &p_aabb, const Vector4 &p_uv_scale) const; const Vector2 SMALL_VEC2 = Vector2(CMP_EPSILON, CMP_EPSILON); const Vector3 SMALL_VEC3 = Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON); @@ -82,7 +82,7 @@ class RenderingServer : public Object { RID white_texture; RID test_material; - Error _surface_set_data(Array p_arrays, uint64_t p_format, uint32_t *p_offsets, uint32_t p_vertex_stride, uint32_t p_normal_stride, uint32_t p_attrib_stride, uint32_t p_skin_stride, Vector &r_vertex_array, Vector &r_attrib_array, Vector &r_skin_array, int p_vertex_array_len, Vector &r_index_array, int p_index_array_len, AABB &r_aabb, Vector &r_bone_aabb, Vector4 &r_uv_scale); + Error _surface_set_data(const Array &p_arrays, uint64_t p_format, uint32_t *p_offsets, uint32_t p_vertex_stride, uint32_t p_normal_stride, uint32_t p_attrib_stride, uint32_t p_skin_stride, Vector &r_vertex_array, Vector &r_attrib_array, Vector &r_skin_array, int p_vertex_array_len, Vector &r_index_array, int p_index_array_len, AABB &r_aabb, Vector &r_bone_aabb, Vector4 &r_uv_scale); static RenderingServer *(*create_func)(); static void _bind_methods(); @@ -1151,7 +1151,7 @@ class RenderingServer : public Object { ENV_GLOW_BLEND_MODE_MIX, }; - virtual void environment_set_glow(RID p_env, bool p_enable, Vector p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map) = 0; + virtual void environment_set_glow(RID p_env, bool p_enable, const Vector &p_levels, float p_intensity, float p_strength, float p_mix, float p_bloom_threshold, EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, float p_glow_map_strength, RID p_glow_map) = 0; virtual void environment_glow_set_use_bicubic_upscale(bool p_enable) = 0;