diff options
Diffstat (limited to 'servers')
44 files changed, 79 insertions, 79 deletions
diff --git a/servers/audio/audio_effect.h b/servers/audio/audio_effect.h index 5d14f03199..bea7292b8e 100644 --- a/servers/audio/audio_effect.h +++ b/servers/audio/audio_effect.h @@ -46,7 +46,7 @@ class AudioEffect : public Resource { GDCLASS(AudioEffect, Resource); public: - virtual Ref<AudioEffectInstance> instance() = 0; + virtual Ref<AudioEffectInstance> instantiate() = 0; AudioEffect(); }; diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp index ae07f999ed..aec6932326 100644 --- a/servers/audio/audio_stream.cpp +++ b/servers/audio/audio_stream.cpp @@ -100,7 +100,7 @@ void AudioStream::_bind_methods() { Ref<AudioStreamPlayback> AudioStreamMicrophone::instance_playback() { Ref<AudioStreamPlaybackMicrophone> playback; - playback.instance(); + playback.instantiate(); playbacks.insert(playback.ptr()); @@ -256,7 +256,7 @@ float AudioStreamRandomPitch::get_random_pitch() const { Ref<AudioStreamPlayback> AudioStreamRandomPitch::instance_playback() { Ref<AudioStreamPlaybackRandomPitch> playback; - playback.instance(); + playback.instantiate(); if (audio_stream.is_valid()) { playback->playback = audio_stream->instance_playback(); } diff --git a/servers/audio/effects/audio_effect_amplify.cpp b/servers/audio/effects/audio_effect_amplify.cpp index c5c1174670..79788d334b 100644 --- a/servers/audio/effects/audio_effect_amplify.cpp +++ b/servers/audio/effects/audio_effect_amplify.cpp @@ -44,9 +44,9 @@ void AudioEffectAmplifyInstance::process(const AudioFrame *p_src_frames, AudioFr mix_volume_db = volume_db; } -Ref<AudioEffectInstance> AudioEffectAmplify::instance() { +Ref<AudioEffectInstance> AudioEffectAmplify::instantiate() { Ref<AudioEffectAmplifyInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectAmplify>(this); ins->mix_volume_db = volume_db; return ins; diff --git a/servers/audio/effects/audio_effect_amplify.h b/servers/audio/effects/audio_effect_amplify.h index 2ece57854c..9d3facc230 100644 --- a/servers/audio/effects/audio_effect_amplify.h +++ b/servers/audio/effects/audio_effect_amplify.h @@ -56,7 +56,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_volume_db(float p_volume); float get_volume_db() const; diff --git a/servers/audio/effects/audio_effect_capture.cpp b/servers/audio/effects/audio_effect_capture.cpp index 78837c7531..065065042e 100644 --- a/servers/audio/effects/audio_effect_capture.cpp +++ b/servers/audio/effects/audio_effect_capture.cpp @@ -73,7 +73,7 @@ void AudioEffectCapture::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "buffer_length", PROPERTY_HINT_RANGE, "0.01,10,0.01"), "set_buffer_length", "get_buffer_length"); } -Ref<AudioEffectInstance> AudioEffectCapture::instance() { +Ref<AudioEffectInstance> AudioEffectCapture::instantiate() { if (!buffer_initialized) { float target_buffer_size = AudioServer::get_singleton()->get_mix_rate() * buffer_length_seconds; ERR_FAIL_COND_V(target_buffer_size <= 0 || target_buffer_size >= (1 << 27), Ref<AudioEffectInstance>()); @@ -84,7 +84,7 @@ Ref<AudioEffectInstance> AudioEffectCapture::instance() { clear_buffer(); Ref<AudioEffectCaptureInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectCapture>(this); return ins; diff --git a/servers/audio/effects/audio_effect_capture.h b/servers/audio/effects/audio_effect_capture.h index 82686d5b4c..7f50fc4965 100644 --- a/servers/audio/effects/audio_effect_capture.h +++ b/servers/audio/effects/audio_effect_capture.h @@ -64,7 +64,7 @@ protected: static void _bind_methods(); public: - virtual Ref<AudioEffectInstance> instance() override; + virtual Ref<AudioEffectInstance> instantiate() override; void set_buffer_length(float p_buffer_length_seconds); float get_buffer_length(); diff --git a/servers/audio/effects/audio_effect_chorus.cpp b/servers/audio/effects/audio_effect_chorus.cpp index eb2268aa2e..54cd5ed0bf 100644 --- a/servers/audio/effects/audio_effect_chorus.cpp +++ b/servers/audio/effects/audio_effect_chorus.cpp @@ -141,9 +141,9 @@ void AudioEffectChorusInstance::_process_chunk(const AudioFrame *p_src_frames, A buffer_pos += p_frame_count; } -Ref<AudioEffectInstance> AudioEffectChorus::instance() { +Ref<AudioEffectInstance> AudioEffectChorus::instantiate() { Ref<AudioEffectChorusInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectChorus>(this); for (int i = 0; i < 4; i++) { ins->filter_h[i] = AudioFrame(0, 0); diff --git a/servers/audio/effects/audio_effect_chorus.h b/servers/audio/effects/audio_effect_chorus.h index f5b023734a..f81bebb0ae 100644 --- a/servers/audio/effects/audio_effect_chorus.h +++ b/servers/audio/effects/audio_effect_chorus.h @@ -128,7 +128,7 @@ public: void set_dry(float amount); float get_dry() const; - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; AudioEffectChorus(); }; diff --git a/servers/audio/effects/audio_effect_compressor.cpp b/servers/audio/effects/audio_effect_compressor.cpp index bb4a90f3d6..cfa2ae6f79 100644 --- a/servers/audio/effects/audio_effect_compressor.cpp +++ b/servers/audio/effects/audio_effect_compressor.cpp @@ -112,9 +112,9 @@ void AudioEffectCompressorInstance::process(const AudioFrame *p_src_frames, Audi } } -Ref<AudioEffectInstance> AudioEffectCompressor::instance() { +Ref<AudioEffectInstance> AudioEffectCompressor::instantiate() { Ref<AudioEffectCompressorInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectCompressor>(this); ins->rundb = 0; ins->runratio = 0; diff --git a/servers/audio/effects/audio_effect_compressor.h b/servers/audio/effects/audio_effect_compressor.h index 33c60680fc..dae4618a64 100644 --- a/servers/audio/effects/audio_effect_compressor.h +++ b/servers/audio/effects/audio_effect_compressor.h @@ -65,7 +65,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_threshold(float p_threshold); float get_threshold() const; diff --git a/servers/audio/effects/audio_effect_delay.cpp b/servers/audio/effects/audio_effect_delay.cpp index ba50eeb0a3..07475e1ed4 100644 --- a/servers/audio/effects/audio_effect_delay.cpp +++ b/servers/audio/effects/audio_effect_delay.cpp @@ -111,9 +111,9 @@ void AudioEffectDelayInstance::_process_chunk(const AudioFrame *p_src_frames, Au } } -Ref<AudioEffectInstance> AudioEffectDelay::instance() { +Ref<AudioEffectInstance> AudioEffectDelay::instantiate() { Ref<AudioEffectDelayInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectDelay>(this); float ring_buffer_max_size = MAX_DELAY_MS + 100; //add 100ms of extra room, just in case diff --git a/servers/audio/effects/audio_effect_delay.h b/servers/audio/effects/audio_effect_delay.h index ff267d5023..50a2233e5f 100644 --- a/servers/audio/effects/audio_effect_delay.h +++ b/servers/audio/effects/audio_effect_delay.h @@ -126,7 +126,7 @@ public: void set_feedback_lowpass(float p_lowpass); float get_feedback_lowpass() const; - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; AudioEffectDelay(); }; diff --git a/servers/audio/effects/audio_effect_distortion.cpp b/servers/audio/effects/audio_effect_distortion.cpp index 5c076ca3fe..188b7a3301 100644 --- a/servers/audio/effects/audio_effect_distortion.cpp +++ b/servers/audio/effects/audio_effect_distortion.cpp @@ -93,9 +93,9 @@ void AudioEffectDistortionInstance::process(const AudioFrame *p_src_frames, Audi } } -Ref<AudioEffectInstance> AudioEffectDistortion::instance() { +Ref<AudioEffectInstance> AudioEffectDistortion::instantiate() { Ref<AudioEffectDistortionInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectDistortion>(this); ins->h[0] = 0; ins->h[1] = 0; diff --git a/servers/audio/effects/audio_effect_distortion.h b/servers/audio/effects/audio_effect_distortion.h index 9da800b79f..3a762f8cf6 100644 --- a/servers/audio/effects/audio_effect_distortion.h +++ b/servers/audio/effects/audio_effect_distortion.h @@ -68,7 +68,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_mode(Mode p_mode); Mode get_mode() const; diff --git a/servers/audio/effects/audio_effect_eq.cpp b/servers/audio/effects/audio_effect_eq.cpp index 01ac605bd7..e87944b74b 100644 --- a/servers/audio/effects/audio_effect_eq.cpp +++ b/servers/audio/effects/audio_effect_eq.cpp @@ -59,9 +59,9 @@ void AudioEffectEQInstance::process(const AudioFrame *p_src_frames, AudioFrame * } } -Ref<AudioEffectInstance> AudioEffectEQ::instance() { +Ref<AudioEffectInstance> AudioEffectEQ::instantiate() { Ref<AudioEffectEQInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectEQ>(this); ins->gains.resize(eq.get_band_count()); for (int i = 0; i < 2; i++) { diff --git a/servers/audio/effects/audio_effect_eq.h b/servers/audio/effects/audio_effect_eq.h index 38c63a7d4f..b99727d7c0 100644 --- a/servers/audio/effects/audio_effect_eq.h +++ b/servers/audio/effects/audio_effect_eq.h @@ -66,7 +66,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_band_gain_db(int p_band, float p_volume); float get_band_gain_db(int p_band) const; int get_band_count() const; diff --git a/servers/audio/effects/audio_effect_filter.cpp b/servers/audio/effects/audio_effect_filter.cpp index c2d6074825..1db8b1f1b5 100644 --- a/servers/audio/effects/audio_effect_filter.cpp +++ b/servers/audio/effects/audio_effect_filter.cpp @@ -100,9 +100,9 @@ AudioEffectFilterInstance::AudioEffectFilterInstance() { } } -Ref<AudioEffectInstance> AudioEffectFilter::instance() { +Ref<AudioEffectInstance> AudioEffectFilter::instantiate() { Ref<AudioEffectFilterInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectFilter>(this); return ins; diff --git a/servers/audio/effects/audio_effect_filter.h b/servers/audio/effects/audio_effect_filter.h index 9a48ccf70b..9aab97da29 100644 --- a/servers/audio/effects/audio_effect_filter.h +++ b/servers/audio/effects/audio_effect_filter.h @@ -88,7 +88,7 @@ public: void set_db(FilterDB p_db); FilterDB get_db() const; - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; AudioEffectFilter(AudioFilterSW::Mode p_mode = AudioFilterSW::LOWPASS); }; diff --git a/servers/audio/effects/audio_effect_limiter.cpp b/servers/audio/effects/audio_effect_limiter.cpp index 1a4b01d947..280411641b 100644 --- a/servers/audio/effects/audio_effect_limiter.cpp +++ b/servers/audio/effects/audio_effect_limiter.cpp @@ -67,9 +67,9 @@ void AudioEffectLimiterInstance::process(const AudioFrame *p_src_frames, AudioFr } } -Ref<AudioEffectInstance> AudioEffectLimiter::instance() { +Ref<AudioEffectInstance> AudioEffectLimiter::instantiate() { Ref<AudioEffectLimiterInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectLimiter>(this); return ins; diff --git a/servers/audio/effects/audio_effect_limiter.h b/servers/audio/effects/audio_effect_limiter.h index 8f3092c0e2..d5def670a4 100644 --- a/servers/audio/effects/audio_effect_limiter.h +++ b/servers/audio/effects/audio_effect_limiter.h @@ -71,7 +71,7 @@ public: void set_soft_clip_ratio(float p_soft_clip); float get_soft_clip_ratio() const; - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_volume_db(float p_volume); float get_volume_db() const; diff --git a/servers/audio/effects/audio_effect_panner.cpp b/servers/audio/effects/audio_effect_panner.cpp index 238e979e13..e2062609b9 100644 --- a/servers/audio/effects/audio_effect_panner.cpp +++ b/servers/audio/effects/audio_effect_panner.cpp @@ -40,9 +40,9 @@ void AudioEffectPannerInstance::process(const AudioFrame *p_src_frames, AudioFra } } -Ref<AudioEffectInstance> AudioEffectPanner::instance() { +Ref<AudioEffectInstance> AudioEffectPanner::instantiate() { Ref<AudioEffectPannerInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectPanner>(this); return ins; } diff --git a/servers/audio/effects/audio_effect_panner.h b/servers/audio/effects/audio_effect_panner.h index 0938824c64..d75bcaeb95 100644 --- a/servers/audio/effects/audio_effect_panner.h +++ b/servers/audio/effects/audio_effect_panner.h @@ -54,7 +54,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_pan(float p_cpanume); float get_pan() const; diff --git a/servers/audio/effects/audio_effect_phaser.cpp b/servers/audio/effects/audio_effect_phaser.cpp index 9b70f03a19..c76692eed7 100644 --- a/servers/audio/effects/audio_effect_phaser.cpp +++ b/servers/audio/effects/audio_effect_phaser.cpp @@ -78,9 +78,9 @@ void AudioEffectPhaserInstance::process(const AudioFrame *p_src_frames, AudioFra } } -Ref<AudioEffectInstance> AudioEffectPhaser::instance() { +Ref<AudioEffectInstance> AudioEffectPhaser::instantiate() { Ref<AudioEffectPhaserInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectPhaser>(this); ins->phase = 0; ins->h = AudioFrame(0, 0); diff --git a/servers/audio/effects/audio_effect_phaser.h b/servers/audio/effects/audio_effect_phaser.h index 563927c678..2a0ed64805 100644 --- a/servers/audio/effects/audio_effect_phaser.h +++ b/servers/audio/effects/audio_effect_phaser.h @@ -83,7 +83,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_range_min_hz(float p_hz); float get_range_min_hz() const; diff --git a/servers/audio/effects/audio_effect_pitch_shift.cpp b/servers/audio/effects/audio_effect_pitch_shift.cpp index 7b0151b9c1..bfbaeee3f3 100644 --- a/servers/audio/effects/audio_effect_pitch_shift.cpp +++ b/servers/audio/effects/audio_effect_pitch_shift.cpp @@ -298,9 +298,9 @@ void AudioEffectPitchShiftInstance::process(const AudioFrame *p_src_frames, Audi shift_r.PitchShift(base->pitch_scale, p_frame_count, fft_size, base->oversampling, sample_rate, in_r, out_r, 2); } -Ref<AudioEffectInstance> AudioEffectPitchShift::instance() { +Ref<AudioEffectInstance> AudioEffectPitchShift::instantiate() { Ref<AudioEffectPitchShiftInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectPitchShift>(this); static const int fft_sizes[FFT_SIZE_MAX] = { 256, 512, 1024, 2048, 4096 }; ins->fft_size = fft_sizes[fft_size]; diff --git a/servers/audio/effects/audio_effect_pitch_shift.h b/servers/audio/effects/audio_effect_pitch_shift.h index 669943fa43..3ed096cd94 100644 --- a/servers/audio/effects/audio_effect_pitch_shift.h +++ b/servers/audio/effects/audio_effect_pitch_shift.h @@ -109,7 +109,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_pitch_scale(float p_pitch_scale); float get_pitch_scale() const; diff --git a/servers/audio/effects/audio_effect_record.cpp b/servers/audio/effects/audio_effect_record.cpp index 2015ede81f..f71679d30f 100644 --- a/servers/audio/effects/audio_effect_record.cpp +++ b/servers/audio/effects/audio_effect_record.cpp @@ -134,9 +134,9 @@ AudioEffectRecordInstance::~AudioEffectRecordInstance() { finish(); } -Ref<AudioEffectInstance> AudioEffectRecord::instance() { +Ref<AudioEffectInstance> AudioEffectRecord::instantiate() { Ref<AudioEffectRecordInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectRecord>(this); ins->is_recording = false; @@ -269,7 +269,7 @@ Ref<AudioStreamSample> AudioEffectRecord::get_recording() const { } Ref<AudioStreamSample> sample; - sample.instance(); + sample.instantiate(); sample->set_data(dst_data); sample->set_format(dst_format); sample->set_mix_rate(AudioServer::get_singleton()->get_mix_rate()); diff --git a/servers/audio/effects/audio_effect_record.h b/servers/audio/effects/audio_effect_record.h index 8f56e227e0..1a89821f80 100644 --- a/servers/audio/effects/audio_effect_record.h +++ b/servers/audio/effects/audio_effect_record.h @@ -96,7 +96,7 @@ protected: static void debug(uint64_t time_diff, int p_frame_count); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_recording_active(bool p_record); bool is_recording_active() const; void set_format(AudioStreamSample::Format p_format); diff --git a/servers/audio/effects/audio_effect_reverb.cpp b/servers/audio/effects/audio_effect_reverb.cpp index b8d812680e..819f906773 100644 --- a/servers/audio/effects/audio_effect_reverb.cpp +++ b/servers/audio/effects/audio_effect_reverb.cpp @@ -79,9 +79,9 @@ AudioEffectReverbInstance::AudioEffectReverbInstance() { reverb[1].set_extra_spread_base(0.000521); //for stereo effect } -Ref<AudioEffectInstance> AudioEffectReverb::instance() { +Ref<AudioEffectInstance> AudioEffectReverb::instantiate() { Ref<AudioEffectReverbInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectReverb>(this); return ins; } diff --git a/servers/audio/effects/audio_effect_reverb.h b/servers/audio/effects/audio_effect_reverb.h index 141ba48e29..d01d1120bd 100644 --- a/servers/audio/effects/audio_effect_reverb.h +++ b/servers/audio/effects/audio_effect_reverb.h @@ -89,7 +89,7 @@ public: float get_wet() const; float get_hpf() const; - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_volume_db(float p_volume); float get_volume_db() const; diff --git a/servers/audio/effects/audio_effect_spectrum_analyzer.cpp b/servers/audio/effects/audio_effect_spectrum_analyzer.cpp index 44b7f64d52..6f9e7ac67d 100644 --- a/servers/audio/effects/audio_effect_spectrum_analyzer.cpp +++ b/servers/audio/effects/audio_effect_spectrum_analyzer.cpp @@ -207,9 +207,9 @@ Vector2 AudioEffectSpectrumAnalyzerInstance::get_magnitude_for_frequency_range(f } } -Ref<AudioEffectInstance> AudioEffectSpectrumAnalyzer::instance() { +Ref<AudioEffectInstance> AudioEffectSpectrumAnalyzer::instantiate() { Ref<AudioEffectSpectrumAnalyzerInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectSpectrumAnalyzer>(this); static const int fft_sizes[FFT_SIZE_MAX] = { 256, 512, 1024, 2048, 4096 }; ins->fft_size = fft_sizes[fft_size]; diff --git a/servers/audio/effects/audio_effect_spectrum_analyzer.h b/servers/audio/effects/audio_effect_spectrum_analyzer.h index fc275446f0..3c5ae4a5e8 100644 --- a/servers/audio/effects/audio_effect_spectrum_analyzer.h +++ b/servers/audio/effects/audio_effect_spectrum_analyzer.h @@ -90,7 +90,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_buffer_length(float p_seconds); float get_buffer_length() const; void set_tap_back_pos(float p_seconds); diff --git a/servers/audio/effects/audio_effect_stereo_enhance.cpp b/servers/audio/effects/audio_effect_stereo_enhance.cpp index dfdf154aa4..3a016b06b8 100644 --- a/servers/audio/effects/audio_effect_stereo_enhance.cpp +++ b/servers/audio/effects/audio_effect_stereo_enhance.cpp @@ -74,9 +74,9 @@ AudioEffectStereoEnhanceInstance::~AudioEffectStereoEnhanceInstance() { memdelete_arr(delay_ringbuff); } -Ref<AudioEffectInstance> AudioEffectStereoEnhance::instance() { +Ref<AudioEffectInstance> AudioEffectStereoEnhance::instantiate() { Ref<AudioEffectStereoEnhanceInstance> ins; - ins.instance(); + ins.instantiate(); ins->base = Ref<AudioEffectStereoEnhance>(this); diff --git a/servers/audio/effects/audio_effect_stereo_enhance.h b/servers/audio/effects/audio_effect_stereo_enhance.h index f99256470b..e0f9d79a94 100644 --- a/servers/audio/effects/audio_effect_stereo_enhance.h +++ b/servers/audio/effects/audio_effect_stereo_enhance.h @@ -68,7 +68,7 @@ protected: static void _bind_methods(); public: - Ref<AudioEffectInstance> instance() override; + Ref<AudioEffectInstance> instantiate() override; void set_pan_pullout(float p_amount); float get_pan_pullout() const; diff --git a/servers/audio/effects/audio_stream_generator.cpp b/servers/audio/effects/audio_stream_generator.cpp index d1a05ccf2a..bced2997ce 100644 --- a/servers/audio/effects/audio_stream_generator.cpp +++ b/servers/audio/effects/audio_stream_generator.cpp @@ -48,7 +48,7 @@ float AudioStreamGenerator::get_buffer_length() const { Ref<AudioStreamPlayback> AudioStreamGenerator::instance_playback() { Ref<AudioStreamGeneratorPlayback> playback; - playback.instance(); + playback.instantiate(); playback->generator = this; int target_buffer_size = mix_rate * buffer_len; playback->buffer.resize(nearest_shift(target_buffer_size)); diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index acfdfa783a..667087d1ec 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -794,7 +794,7 @@ void AudioServer::_update_bus_effects(int p_bus) { for (int i = 0; i < buses[p_bus]->channels.size(); i++) { buses.write[p_bus]->channels.write[i].effect_instances.resize(buses[p_bus]->effects.size()); for (int j = 0; j < buses[p_bus]->effects.size(); j++) { - Ref<AudioEffectInstance> fx = buses.write[p_bus]->effects.write[j].effect->instance(); + Ref<AudioEffectInstance> fx = buses.write[p_bus]->effects.write[j].effect->instantiate(); if (Object::cast_to<AudioEffectCompressorInstance>(*fx)) { Object::cast_to<AudioEffectCompressorInstance>(*fx)->set_current_channel(i); } @@ -813,7 +813,7 @@ void AudioServer::add_bus_effect(int p_bus, const Ref<AudioEffect> &p_effect, in Bus::Effect fx; fx.effect = p_effect; - //fx.instance=p_effect->instance(); + //fx.instance=p_effect->instantiate(); fx.enabled = true; #ifdef DEBUG_ENABLED fx.prof_time = 0; @@ -1188,7 +1188,7 @@ void AudioServer::set_bus_layout(const Ref<AudioBusLayout> &p_bus_layout) { Ref<AudioBusLayout> AudioServer::generate_bus_layout() const { Ref<AudioBusLayout> state; - state.instance(); + state.instantiate(); state->buses.resize(buses.size()); diff --git a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp index 43a4058ab6..be1642998c 100644 --- a/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_gi_rd.cpp @@ -1862,7 +1862,7 @@ void RendererSceneGIRD::SDFGI::render_region(RID p_render_buffers, int p_region, #if 0 Vector<uint8_t> data = RD::get_singleton()->texture_get_data(cascades[cascade].sdf, 0); Ref<Image> img; - img.instance(); + img.instantiate(); for (uint32_t i = 0; i < cascade_size; i++) { Vector<uint8_t> subarr = data.subarray(128 * 128 * i, 128 * 128 * (i + 1) - 1); img->create(cascade_size, cascade_size, false, Image::FORMAT_L8, subarr); @@ -1875,7 +1875,7 @@ void RendererSceneGIRD::SDFGI::render_region(RID p_render_buffers, int p_region, #if 0 Vector<uint8_t> data = RD::get_singleton()->texture_get_data(render_albedo, 0); Ref<Image> img; - img.instance(); + img.instantiate(); for (uint32_t i = 0; i < cascade_size; i++) { Vector<uint8_t> subarr = data.subarray(128 * 128 * i * 2, 128 * 128 * (i + 1) * 2 - 1); img->createcascade_size, cascade_size, false, Image::FORMAT_RGB565, subarr); diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp index be98fb42c0..089651cbfb 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp @@ -486,7 +486,7 @@ Ref<Image> RendererSceneRenderRD::environment_bake_panorama(RID p_env, bool p_ba color.b *= env->bg_energy; Ref<Image> ret; - ret.instance(); + ret.instantiate(); ret->create(p_size.width, p_size.height, false, Image::FORMAT_RGBAF); for (int i = 0; i < p_size.width; i++) { for (int j = 0; j < p_size.height; j++) { @@ -4174,7 +4174,7 @@ TypedArray<Image> RendererSceneRenderRD::bake_render_uv2(RID p_base, const Vecto { PackedByteArray data = RD::get_singleton()->texture_get_data(albedo_alpha_tex, 0); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(p_image_size.width, p_image_size.height, false, Image::FORMAT_RGBA8, data); RD::get_singleton()->free(albedo_alpha_tex); ret.push_back(img); @@ -4183,7 +4183,7 @@ TypedArray<Image> RendererSceneRenderRD::bake_render_uv2(RID p_base, const Vecto { PackedByteArray data = RD::get_singleton()->texture_get_data(normal_tex, 0); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(p_image_size.width, p_image_size.height, false, Image::FORMAT_RGBA8, data); RD::get_singleton()->free(normal_tex); ret.push_back(img); @@ -4192,7 +4192,7 @@ TypedArray<Image> RendererSceneRenderRD::bake_render_uv2(RID p_base, const Vecto { PackedByteArray data = RD::get_singleton()->texture_get_data(orm_tex, 0); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(p_image_size.width, p_image_size.height, false, Image::FORMAT_RGBA8, data); RD::get_singleton()->free(orm_tex); ret.push_back(img); @@ -4201,7 +4201,7 @@ TypedArray<Image> RendererSceneRenderRD::bake_render_uv2(RID p_base, const Vecto { PackedByteArray data = RD::get_singleton()->texture_get_data(emission_tex, 0); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(p_image_size.width, p_image_size.height, false, Image::FORMAT_RGBAH, data); RD::get_singleton()->free(emission_tex); ret.push_back(img); diff --git a/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp index 1aa01dd16e..2082ac9150 100644 --- a/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_sky_rd.cpp @@ -628,7 +628,7 @@ Ref<Image> RendererSceneSkyRD::Sky::bake_panorama(RendererStorageRD *p_storage, RD::get_singleton()->free(rad_tex); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(p_size.width, p_size.height, false, Image::FORMAT_RGBAF, data); for (int i = 0; i < p_size.width; i++) { for (int j = 0; j < p_size.height; j++) { diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index 246b5f0e4c..b95647b8b7 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -972,7 +972,7 @@ void RendererStorageRD::texture_2d_placeholder_initialize(RID p_texture) { //this could be better optimized to reuse an existing image , done this way //for now to get it working Ref<Image> image; - image.instance(); + image.instantiate(); image->create(4, 4, false, Image::FORMAT_RGBA8); for (int i = 0; i < 4; i++) { @@ -988,7 +988,7 @@ void RendererStorageRD::texture_2d_layered_placeholder_initialize(RID p_texture, //this could be better optimized to reuse an existing image , done this way //for now to get it working Ref<Image> image; - image.instance(); + image.instantiate(); image->create(4, 4, false, Image::FORMAT_RGBA8); for (int i = 0; i < 4; i++) { @@ -1014,7 +1014,7 @@ void RendererStorageRD::texture_3d_placeholder_initialize(RID p_texture) { //this could be better optimized to reuse an existing image , done this way //for now to get it working Ref<Image> image; - image.instance(); + image.instantiate(); image->create(4, 4, false, Image::FORMAT_RGBA8); for (int i = 0; i < 4; i++) { @@ -1044,7 +1044,7 @@ Ref<Image> RendererStorageRD::texture_2d_get(RID p_texture) const { Vector<uint8_t> data = RD::get_singleton()->texture_get_data(tex->rd_texture, 0); ERR_FAIL_COND_V(data.size() == 0, Ref<Image>()); Ref<Image> image; - image.instance(); + image.instantiate(); image->create(tex->width, tex->height, tex->mipmaps > 1, tex->validated_format, data); ERR_FAIL_COND_V(image->is_empty(), Ref<Image>()); if (tex->format != tex->validated_format) { @@ -1067,7 +1067,7 @@ Ref<Image> RendererStorageRD::texture_2d_layer_get(RID p_texture, int p_layer) c Vector<uint8_t> data = RD::get_singleton()->texture_get_data(tex->rd_texture, p_layer); ERR_FAIL_COND_V(data.size() == 0, Ref<Image>()); Ref<Image> image; - image.instance(); + image.instantiate(); image->create(tex->width, tex->height, tex->mipmaps > 1, tex->validated_format, data); ERR_FAIL_COND_V(image->is_empty(), Ref<Image>()); if (tex->format != tex->validated_format) { @@ -1095,7 +1095,7 @@ Vector<Ref<Image>> RendererStorageRD::texture_3d_get(RID p_texture) const { Vector<uint8_t> sub_region = all_data.subarray(bs.offset, bs.offset + bs.buffer_size - 1); Ref<Image> img; - img.instance(); + img.instantiate(); img->create(bs.size.width, bs.size.height, false, tex->validated_format, sub_region); ERR_FAIL_COND_V(img->is_empty(), Vector<Ref<Image>>()); if (tex->format != tex->validated_format) { diff --git a/servers/rendering/renderer_scene_occlusion_cull.cpp b/servers/rendering/renderer_scene_occlusion_cull.cpp index c491ccbe7a..54795f32a7 100644 --- a/servers/rendering/renderer_scene_occlusion_cull.cpp +++ b/servers/rendering/renderer_scene_occlusion_cull.cpp @@ -172,7 +172,7 @@ RID RendererSceneOcclusionCull::HZBuffer::get_debug_texture() { } if (debug_image.is_null()) { - debug_image.instance(); + debug_image.instantiate(); } unsigned char *ptrw = debug_data.ptrw(); diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp index 056cec4c1f..ddf2ee9fe3 100644 --- a/servers/rendering/rendering_device.cpp +++ b/servers/rendering/rendering_device.cpp @@ -143,7 +143,7 @@ Ref<RDShaderBytecode> RenderingDevice::_shader_compile_from_source(const Ref<RDS ERR_FAIL_COND_V(p_source.is_null(), Ref<RDShaderBytecode>()); Ref<RDShaderBytecode> bytecode; - bytecode.instance(); + bytecode.instantiate(); for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { String error; diff --git a/servers/rendering/rendering_device_binds.cpp b/servers/rendering/rendering_device_binds.cpp index 2f11360364..2652edb1bc 100644 --- a/servers/rendering/rendering_device_binds.cpp +++ b/servers/rendering/rendering_device_binds.cpp @@ -156,7 +156,7 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String } Ref<RDShaderFile> shader_file; - shader_file.instance(); + shader_file.instantiate(); if (base_error == "") { if (stage_found[RD::SHADER_STAGE_COMPUTE] && stages_found > 1) { @@ -173,7 +173,7 @@ Error RDShaderFile::parse_versions_from_text(const String &p_text, const String for (Map<StringName, String>::Element *E = version_texts.front(); E; E = E->next()) { Ref<RDShaderBytecode> bytecode; - bytecode.instance(); + bytecode.instantiate(); for (int i = 0; i < RD::SHADER_STAGE_MAX; i++) { String code = stage_code[i]; diff --git a/servers/text_server.cpp b/servers/text_server.cpp index daed612b02..6f48148cab 100644 --- a/servers/text_server.cpp +++ b/servers/text_server.cpp @@ -466,16 +466,16 @@ void TextServer::initialize_hex_code_box_fonts() { Vector<uint8_t> hex_box_data; Ref<Image> image; - image.instance(); + image.instantiate(); Ref<ImageTexture> hex_code_image_tex[2]; hex_box_data.resize(tamsyn5x9_png_len); memcpy(hex_box_data.ptrw(), tamsyn5x9_png, tamsyn5x9_png_len); image->load_png_from_buffer(hex_box_data); - hex_code_image_tex[0].instance(); + hex_code_image_tex[0].instantiate(); hex_code_image_tex[0]->create_from_image(image); - hex_code_box_font_tex[0].instance(); + hex_code_box_font_tex[0].instantiate(); hex_code_box_font_tex[0]->set_diffuse_texture(hex_code_image_tex[0]); hex_code_box_font_tex[0]->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); hex_box_data.clear(); @@ -483,9 +483,9 @@ void TextServer::initialize_hex_code_box_fonts() { hex_box_data.resize(tamsyn10x20_png_len); memcpy(hex_box_data.ptrw(), tamsyn10x20_png, tamsyn10x20_png_len); image->load_png_from_buffer(hex_box_data); - hex_code_image_tex[1].instance(); + hex_code_image_tex[1].instantiate(); hex_code_image_tex[1]->create_from_image(image); - hex_code_box_font_tex[1].instance(); + hex_code_box_font_tex[1].instantiate(); hex_code_box_font_tex[1]->set_diffuse_texture(hex_code_image_tex[1]); hex_code_box_font_tex[1]->set_texture_filter(CanvasItem::TEXTURE_FILTER_NEAREST); hex_box_data.clear(); |