diff options
Diffstat (limited to 'scene/resources')
30 files changed, 314 insertions, 0 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index 44aa3f8319..fb22b99b26 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -732,6 +732,7 @@ int Animation::_insert_pos(float p_time, T& p_keys) { } } + */ template <class T, class V> int Animation::_insert(float p_time, T &p_keys, const V &p_value) { @@ -1421,9 +1422,11 @@ Animation::TransformKey Animation::_interpolate(const Animation::TransformKey &p Vector3 Animation::_interpolate(const Vector3 &p_a, const Vector3 &p_b, float p_c) const { return p_a.lerp(p_b, p_c); } + Quat Animation::_interpolate(const Quat &p_a, const Quat &p_b, float p_c) const { return p_a.slerp(p_b, p_c); } + Variant Animation::_interpolate(const Variant &p_a, const Variant &p_b, float p_c) const { Variant dst; Variant::interpolate(p_a, p_b, p_c, dst); @@ -1443,12 +1446,15 @@ Animation::TransformKey Animation::_cubic_interpolate(const Animation::Transform return tk; } + Vector3 Animation::_cubic_interpolate(const Vector3 &p_pre_a, const Vector3 &p_a, const Vector3 &p_b, const Vector3 &p_post_b, float p_c) const { return p_a.cubic_interpolate(p_b, p_pre_a, p_post_b, p_c); } + Quat Animation::_cubic_interpolate(const Quat &p_pre_a, const Quat &p_a, const Quat &p_b, const Quat &p_post_b, float p_c) const { return p_a.cubic_slerp(p_b, p_pre_a, p_post_b, p_c); } + Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a, const Variant &p_b, const Variant &p_post_b, float p_c) const { Variant::Type type_a = p_a.get_type(); Variant::Type type_b = p_b.get_type(); @@ -1533,6 +1539,7 @@ Variant Animation::_cubic_interpolate(const Variant &p_pre_a, const Variant &p_a } } } + float Animation::_cubic_interpolate(const float &p_pre_a, const float &p_a, const float &p_b, const float &p_post_b, float p_c) const { return _interpolate(p_a, p_b, p_c); } @@ -2008,6 +2015,7 @@ void Animation::method_track_get_key_indices(int p_track, float p_time, float p_ _method_track_get_key_indices_in_range(mt, from_time, to_time, p_indices); } + Vector<Variant> Animation::method_track_get_params(int p_track, int p_key_idx) const { ERR_FAIL_INDEX_V(p_track, tracks.size(), Vector<Variant>()); Track *t = tracks[p_track]; @@ -2021,6 +2029,7 @@ Vector<Variant> Animation::method_track_get_params(int p_track, int p_key_idx) c return mk.params; } + StringName Animation::method_track_get_name(int p_track, int p_key_idx) const { ERR_FAIL_INDEX_V(p_track, tracks.size(), StringName()); Track *t = tracks[p_track]; @@ -2087,6 +2096,7 @@ void Animation::bezier_track_set_key_in_handle(int p_track, int p_index, const V } emit_changed(); } + void Animation::bezier_track_set_key_out_handle(int p_track, int p_index, const Vector2 &p_handle) { ERR_FAIL_INDEX(p_track, tracks.size()); Track *t = tracks[p_track]; @@ -2102,6 +2112,7 @@ void Animation::bezier_track_set_key_out_handle(int p_track, int p_index, const } emit_changed(); } + float Animation::bezier_track_get_key_value(int p_track, int p_index) const { ERR_FAIL_INDEX_V(p_track, tracks.size(), 0); Track *t = tracks[p_track]; @@ -2113,6 +2124,7 @@ float Animation::bezier_track_get_key_value(int p_track, int p_index) const { return bt->values[p_index].value.value; } + Vector2 Animation::bezier_track_get_key_in_handle(int p_track, int p_index) const { ERR_FAIL_INDEX_V(p_track, tracks.size(), Vector2()); Track *t = tracks[p_track]; @@ -2124,6 +2136,7 @@ Vector2 Animation::bezier_track_get_key_in_handle(int p_track, int p_index) cons return bt->values[p_index].value.in_handle; } + Vector2 Animation::bezier_track_get_key_out_handle(int p_track, int p_index) const { ERR_FAIL_INDEX_V(p_track, tracks.size(), Vector2()); Track *t = tracks[p_track]; @@ -2296,6 +2309,7 @@ RES Animation::audio_track_get_key_stream(int p_track, int p_key) const { return at->values[p_key].value.stream; } + float Animation::audio_track_get_key_start_offset(int p_track, int p_key) const { ERR_FAIL_INDEX_V(p_track, tracks.size(), 0); const Track *t = tracks[p_track]; @@ -2307,6 +2321,7 @@ float Animation::audio_track_get_key_start_offset(int p_track, int p_key) const return at->values[p_key].value.start_offset; } + float Animation::audio_track_get_key_end_offset(int p_track, int p_key) const { ERR_FAIL_INDEX_V(p_track, tracks.size(), 0); const Track *t = tracks[p_track]; @@ -2372,6 +2387,7 @@ void Animation::set_length(float p_length) { length = p_length; emit_changed(); } + float Animation::get_length() const { return length; } @@ -2380,6 +2396,7 @@ void Animation::set_loop(bool p_enabled) { loop = p_enabled; emit_changed(); } + bool Animation::has_loop() const { return loop; } diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp index b6608b47d0..dafcf12183 100644 --- a/scene/resources/audio_stream_sample.cpp +++ b/scene/resources/audio_stream_sample.cpp @@ -70,6 +70,7 @@ int AudioStreamPlaybackSample::get_loop_count() const { float AudioStreamPlaybackSample::get_playback_position() const { return float(offset >> MIX_FRAC_BITS) / base->mix_rate; } + void AudioStreamPlaybackSample::seek(float p_time) { if (base->format == AudioStreamSample::FORMAT_IMA_ADPCM) return; //no seeking in ima-adpcm @@ -404,6 +405,7 @@ AudioStreamSample::Format AudioStreamSample::get_format() const { void AudioStreamSample::set_loop_mode(LoopMode p_loop_mode) { loop_mode = p_loop_mode; } + AudioStreamSample::LoopMode AudioStreamSample::get_loop_mode() const { return loop_mode; } @@ -411,6 +413,7 @@ AudioStreamSample::LoopMode AudioStreamSample::get_loop_mode() const { void AudioStreamSample::set_loop_begin(int p_frame) { loop_begin = p_frame; } + int AudioStreamSample::get_loop_begin() const { return loop_begin; } @@ -418,6 +421,7 @@ int AudioStreamSample::get_loop_begin() const { void AudioStreamSample::set_loop_end(int p_frame) { loop_end = p_frame; } + int AudioStreamSample::get_loop_end() const { return loop_end; } @@ -426,12 +430,15 @@ void AudioStreamSample::set_mix_rate(int p_hz) { ERR_FAIL_COND(p_hz == 0); mix_rate = p_hz; } + int AudioStreamSample::get_mix_rate() const { return mix_rate; } + void AudioStreamSample::set_stereo(bool p_enable) { stereo = p_enable; } + bool AudioStreamSample::is_stereo() const { return stereo; } @@ -478,6 +485,7 @@ void AudioStreamSample::set_data(const Vector<uint8_t> &p_data) { AudioServer::get_singleton()->unlock(); } + Vector<uint8_t> AudioStreamSample::get_data() const { Vector<uint8_t> pv; diff --git a/scene/resources/bit_map.cpp b/scene/resources/bit_map.cpp index 27a5fee934..e23e3f4c4d 100644 --- a/scene/resources/bit_map.cpp +++ b/scene/resources/bit_map.cpp @@ -623,6 +623,7 @@ Ref<Image> BitMap::convert_to_image() const { return image; } + void BitMap::blit(const Vector2 &p_pos, const Ref<BitMap> &p_bitmap) { int x = p_pos.x; int y = p_pos.y; diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index d8f0640242..9c3e5ad437 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -529,6 +529,7 @@ void Curve::_bind_methods() { int Curve2D::get_point_count() const { return points.size(); } + void Curve2D::add_point(const Vector2 &p_pos, const Vector2 &p_in, const Vector2 &p_out, int p_atpos) { Point n; n.pos = p_pos; @@ -550,6 +551,7 @@ void Curve2D::set_point_position(int p_index, const Vector2 &p_pos) { baked_cache_dirty = true; emit_signal(CoreStringNames::get_singleton()->changed); } + Vector2 Curve2D::get_point_position(int p_index) const { ERR_FAIL_INDEX_V(p_index, points.size(), Vector2()); return points[p_index].pos; @@ -562,6 +564,7 @@ void Curve2D::set_point_in(int p_index, const Vector2 &p_in) { baked_cache_dirty = true; emit_signal(CoreStringNames::get_singleton()->changed); } + Vector2 Curve2D::get_point_in(int p_index) const { ERR_FAIL_INDEX_V(p_index, points.size(), Vector2()); return points[p_index].in; @@ -727,6 +730,7 @@ float Curve2D::get_baked_length() const { return baked_max_ofs; } + Vector2 Curve2D::interpolate_baked(float p_offset, bool p_cubic) const { if (baked_cache_dirty) _bake(); @@ -876,6 +880,7 @@ Dictionary Curve2D::_get_data() const { return dc; } + void Curve2D::_set_data(const Dictionary &p_data) { ERR_FAIL_COND(!p_data.has("points")); @@ -979,6 +984,7 @@ Curve2D::Curve2D() { int Curve3D::get_point_count() const { return points.size(); } + void Curve3D::add_point(const Vector3 &p_pos, const Vector3 &p_in, const Vector3 &p_out, int p_atpos) { Point n; n.pos = p_pos; @@ -992,6 +998,7 @@ void Curve3D::add_point(const Vector3 &p_pos, const Vector3 &p_in, const Vector3 baked_cache_dirty = true; emit_signal(CoreStringNames::get_singleton()->changed); } + void Curve3D::set_point_position(int p_index, const Vector3 &p_pos) { ERR_FAIL_INDEX(p_index, points.size()); @@ -999,6 +1006,7 @@ void Curve3D::set_point_position(int p_index, const Vector3 &p_pos) { baked_cache_dirty = true; emit_signal(CoreStringNames::get_singleton()->changed); } + Vector3 Curve3D::get_point_position(int p_index) const { ERR_FAIL_INDEX_V(p_index, points.size(), Vector3()); return points[p_index].pos; @@ -1011,6 +1019,7 @@ void Curve3D::set_point_tilt(int p_index, float p_tilt) { baked_cache_dirty = true; emit_signal(CoreStringNames::get_singleton()->changed); } + float Curve3D::get_point_tilt(int p_index) const { ERR_FAIL_INDEX_V(p_index, points.size(), 0); return points[p_index].tilt; @@ -1023,6 +1032,7 @@ void Curve3D::set_point_in(int p_index, const Vector3 &p_in) { baked_cache_dirty = true; emit_signal(CoreStringNames::get_singleton()->changed); } + Vector3 Curve3D::get_point_in(int p_index) const { ERR_FAIL_INDEX_V(p_index, points.size(), Vector3()); return points[p_index].in; @@ -1246,6 +1256,7 @@ float Curve3D::get_baked_length() const { return baked_max_ofs; } + Vector3 Curve3D::interpolate_baked(float p_offset, bool p_cubic) const { if (baked_cache_dirty) _bake(); @@ -1501,6 +1512,7 @@ Dictionary Curve3D::_get_data() const { return dc; } + void Curve3D::_set_data(const Dictionary &p_data) { ERR_FAIL_COND(!p_data.has("points")); ERR_FAIL_COND(!p_data.has("tilts")); diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index 5d2d690084..3581fffdba 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -226,6 +226,7 @@ float DynamicFontAtSize::get_height() const { float DynamicFontAtSize::get_ascent() const { return ascent; } + float DynamicFontAtSize::get_descent() const { return descent; } @@ -348,6 +349,7 @@ unsigned long DynamicFontAtSize::_ft_stream_io(FT_Stream stream, unsigned long o return f->get_buffer(buffer, count); } + void DynamicFontAtSize::_ft_stream_close(FT_Stream stream) { FileAccess *f = (FileAccess *)stream->descriptor.pointer; f->close(); @@ -859,11 +861,13 @@ void DynamicFont::add_fallback(const Ref<DynamicFontData> &p_data) { int DynamicFont::get_fallback_count() const { return fallbacks.size(); } + Ref<DynamicFontData> DynamicFont::get_fallback(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, fallbacks.size(), Ref<DynamicFontData>()); return fallbacks[p_idx]; } + void DynamicFont::remove_fallback(int p_idx) { ERR_FAIL_INDEX(p_idx, fallbacks.size()); fallbacks.remove(p_idx); @@ -913,6 +917,7 @@ bool DynamicFont::_get(const StringName &p_name, Variant &r_ret) const { return false; } + void DynamicFont::_get_property_list(List<PropertyInfo> *p_list) const { for (int i = 0; i < fallbacks.size(); i++) { p_list->push_back(PropertyInfo(Variant::OBJECT, "fallback/" + itos(i), PROPERTY_HINT_RESOURCE_TYPE, "DynamicFontData")); diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 87d070db6f..5356b5bea2 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -57,26 +57,32 @@ void Environment::set_sky_custom_fov(float p_scale) { bg_sky_custom_fov = p_scale; RS::get_singleton()->environment_set_sky_custom_fov(environment, p_scale); } + void Environment::set_bg_color(const Color &p_color) { bg_color = p_color; RS::get_singleton()->environment_set_bg_color(environment, p_color); } + void Environment::set_bg_energy(float p_energy) { bg_energy = p_energy; RS::get_singleton()->environment_set_bg_energy(environment, p_energy); } + void Environment::set_canvas_max_layer(int p_max_layer) { bg_canvas_max_layer = p_max_layer; RS::get_singleton()->environment_set_canvas_max_layer(environment, p_max_layer); } + void Environment::set_ambient_light_color(const Color &p_color) { ambient_color = p_color; RS::get_singleton()->environment_set_ambient_light(environment, ambient_color, RS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source), ao_color); } + void Environment::set_ambient_light_energy(float p_energy) { ambient_energy = p_energy; RS::get_singleton()->environment_set_ambient_light(environment, ambient_color, RS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source), ao_color); } + void Environment::set_ambient_light_sky_contribution(float p_energy) { ambient_sky_contribution = p_energy; RS::get_singleton()->environment_set_ambient_light(environment, ambient_color, RS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source), ao_color); @@ -98,10 +104,12 @@ void Environment::set_ambient_source(AmbientSource p_source) { Environment::AmbientSource Environment::get_ambient_source() const { return ambient_source; } + void Environment::set_reflection_source(ReflectionSource p_source) { reflection_source = p_source; RS::get_singleton()->environment_set_ambient_light(environment, ambient_color, RS::EnvironmentAmbientSource(ambient_source), ambient_energy, ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source), ao_color); } + Environment::ReflectionSource Environment::get_reflection_source() const { return reflection_source; } @@ -109,6 +117,7 @@ Environment::ReflectionSource Environment::get_reflection_source() const { Environment::BGMode Environment::get_background() const { return bg_mode; } + Ref<Sky> Environment::get_sky() const { return bg_sky; } @@ -129,21 +138,27 @@ Vector3 Environment::get_sky_rotation() const { Color Environment::get_bg_color() const { return bg_color; } + float Environment::get_bg_energy() const { return bg_energy; } + int Environment::get_canvas_max_layer() const { return bg_canvas_max_layer; } + Color Environment::get_ambient_light_color() const { return ambient_color; } + float Environment::get_ambient_light_energy() const { return ambient_energy; } + float Environment::get_ambient_light_sky_contribution() const { return ambient_sky_contribution; } + int Environment::get_camera_feed_id() const { return camera_feed_id; } @@ -170,6 +185,7 @@ void Environment::set_tonemap_white(float p_white) { tonemap_white = p_white; RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey); } + float Environment::get_tonemap_white() const { return tonemap_white; } @@ -179,6 +195,7 @@ void Environment::set_tonemap_auto_exposure(bool p_enabled) { RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey); _change_notify(); } + bool Environment::get_tonemap_auto_exposure() const { return tonemap_auto_exposure; } @@ -187,6 +204,7 @@ void Environment::set_tonemap_auto_exposure_max(float p_auto_exposure_max) { tonemap_auto_exposure_max = p_auto_exposure_max; RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey); } + float Environment::get_tonemap_auto_exposure_max() const { return tonemap_auto_exposure_max; } @@ -195,6 +213,7 @@ void Environment::set_tonemap_auto_exposure_min(float p_auto_exposure_min) { tonemap_auto_exposure_min = p_auto_exposure_min; RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey); } + float Environment::get_tonemap_auto_exposure_min() const { return tonemap_auto_exposure_min; } @@ -203,6 +222,7 @@ void Environment::set_tonemap_auto_exposure_speed(float p_auto_exposure_speed) { tonemap_auto_exposure_speed = p_auto_exposure_speed; RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey); } + float Environment::get_tonemap_auto_exposure_speed() const { return tonemap_auto_exposure_speed; } @@ -211,6 +231,7 @@ void Environment::set_tonemap_auto_exposure_grey(float p_auto_exposure_grey) { tonemap_auto_exposure_grey = p_auto_exposure_grey; RS::get_singleton()->environment_set_tonemap(environment, RS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey); } + float Environment::get_tonemap_auto_exposure_grey() const { return tonemap_auto_exposure_grey; } @@ -229,6 +250,7 @@ void Environment::set_adjustment_brightness(float p_brightness) { adjustment_brightness = p_brightness; RS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID()); } + float Environment::get_adjustment_brightness() const { return adjustment_brightness; } @@ -237,6 +259,7 @@ void Environment::set_adjustment_contrast(float p_contrast) { adjustment_contrast = p_contrast; RS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID()); } + float Environment::get_adjustment_contrast() const { return adjustment_contrast; } @@ -245,6 +268,7 @@ void Environment::set_adjustment_saturation(float p_saturation) { adjustment_saturation = p_saturation; RS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID()); } + float Environment::get_adjustment_saturation() const { return adjustment_saturation; } @@ -253,6 +277,7 @@ void Environment::set_adjustment_color_correction(const Ref<Texture2D> &p_ramp) adjustment_color_correction = p_ramp; RS::get_singleton()->environment_set_adjustment(environment, adjustment_enabled, adjustment_brightness, adjustment_contrast, adjustment_saturation, adjustment_color_correction.is_valid() ? adjustment_color_correction->get_rid() : RID()); } + Ref<Texture2D> Environment::get_adjustment_color_correction() const { return adjustment_color_correction; } @@ -352,6 +377,7 @@ void Environment::set_ssr_max_steps(int p_steps) { ssr_max_steps = p_steps; RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance); } + int Environment::get_ssr_max_steps() const { return ssr_max_steps; } @@ -360,6 +386,7 @@ void Environment::set_ssr_fade_in(float p_fade_in) { ssr_fade_in = p_fade_in; RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance); } + float Environment::get_ssr_fade_in() const { return ssr_fade_in; } @@ -368,6 +395,7 @@ void Environment::set_ssr_fade_out(float p_fade_out) { ssr_fade_out = p_fade_out; RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance); } + float Environment::get_ssr_fade_out() const { return ssr_fade_out; } @@ -376,6 +404,7 @@ void Environment::set_ssr_depth_tolerance(float p_depth_tolerance) { ssr_depth_tolerance = p_depth_tolerance; RS::get_singleton()->environment_set_ssr(environment, ssr_enabled, ssr_max_steps, ssr_fade_in, ssr_fade_out, ssr_depth_tolerance); } + float Environment::get_ssr_depth_tolerance() const { return ssr_depth_tolerance; } @@ -394,6 +423,7 @@ void Environment::set_ssao_radius(float p_radius) { ssao_radius = p_radius; RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness); } + float Environment::get_ssao_radius() const { return ssao_radius; } @@ -411,6 +441,7 @@ void Environment::set_ssao_bias(float p_bias) { ssao_bias = p_bias; RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness); } + float Environment::get_ssao_bias() const { return ssao_bias; } @@ -419,6 +450,7 @@ void Environment::set_ssao_direct_light_affect(float p_direct_light_affect) { ssao_direct_light_affect = p_direct_light_affect; RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness); } + float Environment::get_ssao_direct_light_affect() const { return ssao_direct_light_affect; } @@ -427,6 +459,7 @@ void Environment::set_ssao_ao_channel_affect(float p_ao_channel_affect) { ssao_ao_channel_affect = p_ao_channel_affect; RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness); } + float Environment::get_ssao_ao_channel_affect() const { return ssao_ao_channel_affect; } @@ -444,6 +477,7 @@ void Environment::set_ssao_blur(SSAOBlur p_blur) { ssao_blur = p_blur; RS::get_singleton()->environment_set_ssao(environment, ssao_enabled, ssao_radius, ssao_intensity, ssao_bias, ssao_direct_light_affect, ssao_ao_channel_affect, RS::EnvironmentSSAOBlur(ssao_blur), ssao_edge_sharpness); } + Environment::SSAOBlur Environment::get_ssao_blur() const { return ssao_blur; } @@ -477,6 +511,7 @@ void Environment::set_glow_level(int p_level, bool p_enabled) { RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap); } + bool Environment::is_glow_level_enabled(int p_level) const { ERR_FAIL_INDEX_V(p_level, RS::MAX_GLOW_LEVELS, false); @@ -488,6 +523,7 @@ void Environment::set_glow_intensity(float p_intensity) { RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap); } + float Environment::get_glow_intensity() const { return glow_intensity; } @@ -496,6 +532,7 @@ void Environment::set_glow_strength(float p_strength) { glow_strength = p_strength; RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap); } + float Environment::get_glow_strength() const { return glow_strength; } @@ -504,6 +541,7 @@ void Environment::set_glow_mix(float p_mix) { glow_mix = p_mix; RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap); } + float Environment::get_glow_mix() const { return glow_mix; } @@ -513,6 +551,7 @@ void Environment::set_glow_bloom(float p_threshold) { RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap); } + float Environment::get_glow_bloom() const { return glow_bloom; } @@ -523,6 +562,7 @@ void Environment::set_glow_blend_mode(GlowBlendMode p_mode) { RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap); _change_notify(); } + Environment::GlowBlendMode Environment::get_glow_blend_mode() const { return glow_blend_mode; } @@ -532,6 +572,7 @@ void Environment::set_glow_hdr_bleed_threshold(float p_threshold) { RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap); } + float Environment::get_glow_hdr_bleed_threshold() const { return glow_hdr_bleed_threshold; } @@ -541,6 +582,7 @@ void Environment::set_glow_hdr_luminance_cap(float p_amount) { RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap); } + float Environment::get_glow_hdr_luminance_cap() const { return glow_hdr_luminance_cap; } @@ -550,6 +592,7 @@ void Environment::set_glow_hdr_bleed_scale(float p_scale) { RS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, RS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap); } + float Environment::get_glow_hdr_bleed_scale() const { return glow_hdr_bleed_scale; } @@ -568,6 +611,7 @@ void Environment::set_fog_color(const Color &p_color) { fog_color = p_color; RS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount); } + Color Environment::get_fog_color() const { return fog_color; } @@ -576,6 +620,7 @@ void Environment::set_fog_sun_color(const Color &p_color) { fog_sun_color = p_color; RS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount); } + Color Environment::get_fog_sun_color() const { return fog_sun_color; } @@ -584,6 +629,7 @@ void Environment::set_fog_sun_amount(float p_amount) { fog_sun_amount = p_amount; RS::get_singleton()->environment_set_fog(environment, fog_enabled, fog_color, fog_sun_color, fog_sun_amount); } + float Environment::get_fog_sun_amount() const { return fog_sun_amount; } @@ -592,6 +638,7 @@ void Environment::set_fog_depth_enabled(bool p_enabled) { fog_depth_enabled = p_enabled; RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve); } + bool Environment::is_fog_depth_enabled() const { return fog_depth_enabled; } @@ -600,6 +647,7 @@ void Environment::set_fog_depth_begin(float p_distance) { fog_depth_begin = p_distance; RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve); } + float Environment::get_fog_depth_begin() const { return fog_depth_begin; } @@ -617,6 +665,7 @@ void Environment::set_fog_depth_curve(float p_curve) { fog_depth_curve = p_curve; RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve); } + float Environment::get_fog_depth_curve() const { return fog_depth_curve; } @@ -625,6 +674,7 @@ void Environment::set_fog_transmit_enabled(bool p_enabled) { fog_transmit_enabled = p_enabled; RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve); } + bool Environment::is_fog_transmit_enabled() const { return fog_transmit_enabled; } @@ -633,6 +683,7 @@ void Environment::set_fog_transmit_curve(float p_curve) { fog_transmit_curve = p_curve; RS::get_singleton()->environment_set_fog_depth(environment, fog_depth_enabled, fog_depth_begin, fog_depth_end, fog_depth_curve, fog_transmit_enabled, fog_transmit_curve); } + float Environment::get_fog_transmit_curve() const { return fog_transmit_curve; } @@ -641,6 +692,7 @@ void Environment::set_fog_height_enabled(bool p_enabled) { fog_height_enabled = p_enabled; RS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve); } + bool Environment::is_fog_height_enabled() const { return fog_height_enabled; } @@ -649,6 +701,7 @@ void Environment::set_fog_height_min(float p_distance) { fog_height_min = p_distance; RS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve); } + float Environment::get_fog_height_min() const { return fog_height_min; } @@ -657,6 +710,7 @@ void Environment::set_fog_height_max(float p_distance) { fog_height_max = p_distance; RS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve); } + float Environment::get_fog_height_max() const { return fog_height_max; } @@ -665,6 +719,7 @@ void Environment::set_fog_height_curve(float p_distance) { fog_height_curve = p_distance; RS::get_singleton()->environment_set_fog_height(environment, fog_height_enabled, fog_height_min, fog_height_max, fog_height_curve); } + float Environment::get_fog_height_curve() const { return fog_height_curve; } @@ -1092,6 +1147,7 @@ void CameraEffects::set_dof_blur_far_distance(float p_distance) { dof_blur_far_distance = p_distance; RS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount); } + float CameraEffects::get_dof_blur_far_distance() const { return dof_blur_far_distance; } @@ -1100,6 +1156,7 @@ void CameraEffects::set_dof_blur_far_transition(float p_distance) { dof_blur_far_transition = p_distance; RS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount); } + float CameraEffects::get_dof_blur_far_transition() const { return dof_blur_far_transition; } @@ -1136,6 +1193,7 @@ void CameraEffects::set_dof_blur_amount(float p_amount) { dof_blur_amount = p_amount; RS::get_singleton()->camera_effects_set_dof_blur(camera_effects, dof_blur_far_enabled, dof_blur_far_distance, dof_blur_far_transition, dof_blur_near_enabled, dof_blur_near_distance, dof_blur_near_transition, dof_blur_amount); } + float CameraEffects::get_dof_blur_amount() const { return dof_blur_amount; } diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index c67a300580..e0cd1be456 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -316,6 +316,7 @@ Error BitmapFont::create_from_fnt(const String &p_file) { void BitmapFont::set_height(float p_height) { height = p_height; } + float BitmapFont::get_height() const { return height; } @@ -323,9 +324,11 @@ float BitmapFont::get_height() const { void BitmapFont::set_ascent(float p_ascent) { ascent = p_ascent; } + float BitmapFont::get_ascent() const { return ascent; } + float BitmapFont::get_descent() const { return height - ascent; } diff --git a/scene/resources/line_shape_2d.cpp b/scene/resources/line_shape_2d.cpp index cc7108e92e..22dd426295 100644 --- a/scene/resources/line_shape_2d.cpp +++ b/scene/resources/line_shape_2d.cpp @@ -67,6 +67,7 @@ void LineShape2D::set_distance(real_t p_distance) { Vector2 LineShape2D::get_normal() const { return normal; } + real_t LineShape2D::get_distance() const { return distance; } @@ -79,6 +80,7 @@ void LineShape2D::draw(const RID &p_to_rid, const Color &p_color) { Vector2 l2[2] = { point, point + get_normal() * 30 }; RS::get_singleton()->canvas_item_add_line(p_to_rid, l2[0], l2[1], p_color, 3); } + Rect2 LineShape2D::get_rect() const { Vector2 point = get_distance() * get_normal(); diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index aa5f7677c7..3a3fb77f02 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -71,6 +71,7 @@ int Material::get_render_priority() const { RID Material::get_rid() const { return material; } + void Material::_validate_property(PropertyInfo &property) const { if (!_can_do_next_pass() && property.name == "next_pass") { property.usage = 0; @@ -1179,6 +1180,7 @@ bool BaseMaterial3D::_is_shader_dirty() const { return element.in_list(); } + void BaseMaterial3D::set_albedo(const Color &p_albedo) { albedo = p_albedo; @@ -1220,6 +1222,7 @@ void BaseMaterial3D::set_emission(const Color &p_emission) { emission = p_emission; RS::get_singleton()->material_set_param(_get_material(), shader_names->emission, p_emission); } + Color BaseMaterial3D::get_emission() const { return emission; } @@ -1228,6 +1231,7 @@ void BaseMaterial3D::set_emission_energy(float p_emission_energy) { emission_energy = p_emission_energy; RS::get_singleton()->material_set_param(_get_material(), shader_names->emission_energy, p_emission_energy); } + float BaseMaterial3D::get_emission_energy() const { return emission_energy; } @@ -1236,6 +1240,7 @@ void BaseMaterial3D::set_normal_scale(float p_normal_scale) { normal_scale = p_normal_scale; RS::get_singleton()->material_set_param(_get_material(), shader_names->normal_scale, p_normal_scale); } + float BaseMaterial3D::get_normal_scale() const { return normal_scale; } @@ -1244,6 +1249,7 @@ void BaseMaterial3D::set_rim(float p_rim) { rim = p_rim; RS::get_singleton()->material_set_param(_get_material(), shader_names->rim, p_rim); } + float BaseMaterial3D::get_rim() const { return rim; } @@ -1252,6 +1258,7 @@ void BaseMaterial3D::set_rim_tint(float p_rim_tint) { rim_tint = p_rim_tint; RS::get_singleton()->material_set_param(_get_material(), shader_names->rim_tint, p_rim_tint); } + float BaseMaterial3D::get_rim_tint() const { return rim_tint; } @@ -1260,6 +1267,7 @@ void BaseMaterial3D::set_ao_light_affect(float p_ao_light_affect) { ao_light_affect = p_ao_light_affect; RS::get_singleton()->material_set_param(_get_material(), shader_names->ao_light_affect, p_ao_light_affect); } + float BaseMaterial3D::get_ao_light_affect() const { return ao_light_affect; } @@ -1286,6 +1294,7 @@ void BaseMaterial3D::set_anisotropy(float p_anisotropy) { anisotropy = p_anisotropy; RS::get_singleton()->material_set_param(_get_material(), shader_names->anisotropy, p_anisotropy); } + float BaseMaterial3D::get_anisotropy() const { return anisotropy; } @@ -1321,6 +1330,7 @@ void BaseMaterial3D::set_transmittance_depth(float p_depth) { transmittance_depth = p_depth; RS::get_singleton()->material_set_param(_get_material(), shader_names->transmittance_depth, p_depth); } + float BaseMaterial3D::get_transmittance_depth() const { return transmittance_depth; } @@ -1329,6 +1339,7 @@ void BaseMaterial3D::set_transmittance_curve(float p_curve) { transmittance_curve = p_curve; RS::get_singleton()->material_set_param(_get_material(), shader_names->transmittance_curve, p_curve); } + float BaseMaterial3D::get_transmittance_curve() const { return transmittance_curve; } @@ -1337,6 +1348,7 @@ void BaseMaterial3D::set_transmittance_boost(float p_boost) { transmittance_boost = p_boost; RS::get_singleton()->material_set_param(_get_material(), shader_names->transmittance_boost, p_boost); } + float BaseMaterial3D::get_transmittance_boost() const { return transmittance_boost; } @@ -1366,6 +1378,7 @@ void BaseMaterial3D::set_detail_uv(DetailUV p_detail_uv) { detail_uv = p_detail_uv; _queue_shader_change(); } + BaseMaterial3D::DetailUV BaseMaterial3D::get_detail_uv() const { return detail_uv; } @@ -1377,6 +1390,7 @@ void BaseMaterial3D::set_blend_mode(BlendMode p_mode) { blend_mode = p_mode; _queue_shader_change(); } + BaseMaterial3D::BlendMode BaseMaterial3D::get_blend_mode() const { return blend_mode; } @@ -1385,6 +1399,7 @@ void BaseMaterial3D::set_detail_blend_mode(BlendMode p_mode) { detail_blend_mode = p_mode; _queue_shader_change(); } + BaseMaterial3D::BlendMode BaseMaterial3D::get_detail_blend_mode() const { return detail_blend_mode; } @@ -1424,6 +1439,7 @@ void BaseMaterial3D::set_depth_draw_mode(DepthDrawMode p_mode) { depth_draw_mode = p_mode; _queue_shader_change(); } + BaseMaterial3D::DepthDrawMode BaseMaterial3D::get_depth_draw_mode() const { return depth_draw_mode; } @@ -1435,6 +1451,7 @@ void BaseMaterial3D::set_cull_mode(CullMode p_mode) { cull_mode = p_mode; _queue_shader_change(); } + BaseMaterial3D::CullMode BaseMaterial3D::get_cull_mode() const { return cull_mode; } @@ -1446,6 +1463,7 @@ void BaseMaterial3D::set_diffuse_mode(DiffuseMode p_mode) { diffuse_mode = p_mode; _queue_shader_change(); } + BaseMaterial3D::DiffuseMode BaseMaterial3D::get_diffuse_mode() const { return diffuse_mode; } @@ -1457,6 +1475,7 @@ void BaseMaterial3D::set_specular_mode(SpecularMode p_mode) { specular_mode = p_mode; _queue_shader_change(); } + BaseMaterial3D::SpecularMode BaseMaterial3D::get_specular_mode() const { return specular_mode; } @@ -1670,6 +1689,7 @@ void BaseMaterial3D::set_uv1_offset(const Vector3 &p_offset) { uv1_offset = p_offset; RS::get_singleton()->material_set_param(_get_material(), shader_names->uv1_offset, p_offset); } + Vector3 BaseMaterial3D::get_uv1_offset() const { return uv1_offset; } @@ -1728,6 +1748,7 @@ void BaseMaterial3D::set_particles_anim_h_frames(int p_frames) { int BaseMaterial3D::get_particles_anim_h_frames() const { return particles_anim_h_frames; } + void BaseMaterial3D::set_particles_anim_v_frames(int p_frames) { particles_anim_v_frames = p_frames; RS::get_singleton()->material_set_param(_get_material(), shader_names->particles_anim_v_frames, p_frames); @@ -1760,6 +1781,7 @@ void BaseMaterial3D::set_heightmap_deep_parallax_min_layers(int p_layer) { deep_parallax_min_layers = p_layer; RS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_min_layers, p_layer); } + int BaseMaterial3D::get_heightmap_deep_parallax_min_layers() const { return deep_parallax_min_layers; } @@ -1768,6 +1790,7 @@ void BaseMaterial3D::set_heightmap_deep_parallax_max_layers(int p_layer) { deep_parallax_max_layers = p_layer; RS::get_singleton()->material_set_param(_get_material(), shader_names->heightmap_max_layers, p_layer); } + int BaseMaterial3D::get_heightmap_deep_parallax_max_layers() const { return deep_parallax_max_layers; } @@ -1929,6 +1952,7 @@ void BaseMaterial3D::set_proximity_fade_distance(float p_distance) { proximity_fade_distance = p_distance; RS::get_singleton()->material_set_param(_get_material(), shader_names->proximity_fade_distance, p_distance); } + float BaseMaterial3D::get_proximity_fade_distance() const { return proximity_fade_distance; } @@ -1938,6 +1962,7 @@ void BaseMaterial3D::set_distance_fade(DistanceFadeMode p_mode) { _queue_shader_change(); _change_notify(); } + BaseMaterial3D::DistanceFadeMode BaseMaterial3D::get_distance_fade() const { return distance_fade; } @@ -1946,6 +1971,7 @@ void BaseMaterial3D::set_distance_fade_max_distance(float p_distance) { distance_fade_max_distance = p_distance; RS::get_singleton()->material_set_param(_get_material(), shader_names->distance_fade_max, distance_fade_max_distance); } + float BaseMaterial3D::get_distance_fade_max_distance() const { return distance_fade_max_distance; } diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 9c641cf6d8..e293a421b9 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -133,6 +133,7 @@ void Mesh::generate_debug_mesh_lines(Vector<Vector3> &r_lines) { r_lines = debug_lines; } + void Mesh::generate_debug_mesh_indices(Vector<Vector3> &r_points) { Ref<TriangleMesh> tm = generate_triangle_mesh(); if (tm.is_null()) @@ -1107,10 +1108,12 @@ Array ArrayMesh::surface_get_arrays(int p_surface) const { ERR_FAIL_INDEX_V(p_surface, surfaces.size(), Array()); return RenderingServer::get_singleton()->mesh_surface_get_arrays(mesh, p_surface); } + Array ArrayMesh::surface_get_blend_shape_arrays(int p_surface) const { ERR_FAIL_INDEX_V(p_surface, surfaces.size(), Array()); return RenderingServer::get_singleton()->mesh_surface_get_blend_shape_arrays(mesh, p_surface); } + Dictionary ArrayMesh::surface_get_lods(int p_surface) const { ERR_FAIL_INDEX_V(p_surface, surfaces.size(), Dictionary()); return RenderingServer::get_singleton()->mesh_surface_get_lods(mesh, p_surface); @@ -1140,10 +1143,12 @@ void ArrayMesh::add_blend_shape(const StringName &p_name) { int ArrayMesh::get_blend_shape_count() const { return blend_shapes.size(); } + StringName ArrayMesh::get_blend_shape_name(int p_index) const { ERR_FAIL_INDEX_V(p_index, blend_shapes.size(), StringName()); return blend_shapes[p_index]; } + void ArrayMesh::clear_blend_shapes() { ERR_FAIL_COND_MSG(surfaces.size(), "Can't set shape key count if surfaces are already created."); @@ -1235,6 +1240,7 @@ RID ArrayMesh::get_rid() const { _create_if_empty(); return mesh; } + AABB ArrayMesh::get_aabb() const { return aabb; } diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp index d428191f96..3176b83bb8 100644 --- a/scene/resources/mesh_data_tool.cpp +++ b/scene/resources/mesh_data_tool.cpp @@ -310,9 +310,11 @@ int MeshDataTool::get_format() const { int MeshDataTool::get_vertex_count() const { return vertices.size(); } + int MeshDataTool::get_edge_count() const { return edges.size(); } + int MeshDataTool::get_face_count() const { return faces.size(); } @@ -321,6 +323,7 @@ Vector3 MeshDataTool::get_vertex(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, vertices.size(), Vector3()); return vertices[p_idx].vertex; } + void MeshDataTool::set_vertex(int p_idx, const Vector3 &p_vertex) { ERR_FAIL_INDEX(p_idx, vertices.size()); vertices.write[p_idx].vertex = p_vertex; @@ -330,6 +333,7 @@ Vector3 MeshDataTool::get_vertex_normal(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, vertices.size(), Vector3()); return vertices[p_idx].normal; } + void MeshDataTool::set_vertex_normal(int p_idx, const Vector3 &p_normal) { ERR_FAIL_INDEX(p_idx, vertices.size()); vertices.write[p_idx].normal = p_normal; @@ -340,6 +344,7 @@ Plane MeshDataTool::get_vertex_tangent(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, vertices.size(), Plane()); return vertices[p_idx].tangent; } + void MeshDataTool::set_vertex_tangent(int p_idx, const Plane &p_tangent) { ERR_FAIL_INDEX(p_idx, vertices.size()); vertices.write[p_idx].tangent = p_tangent; @@ -350,6 +355,7 @@ Vector2 MeshDataTool::get_vertex_uv(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, vertices.size(), Vector2()); return vertices[p_idx].uv; } + void MeshDataTool::set_vertex_uv(int p_idx, const Vector2 &p_uv) { ERR_FAIL_INDEX(p_idx, vertices.size()); vertices.write[p_idx].uv = p_uv; @@ -360,6 +366,7 @@ Vector2 MeshDataTool::get_vertex_uv2(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, vertices.size(), Vector2()); return vertices[p_idx].uv2; } + void MeshDataTool::set_vertex_uv2(int p_idx, const Vector2 &p_uv2) { ERR_FAIL_INDEX(p_idx, vertices.size()); vertices.write[p_idx].uv2 = p_uv2; @@ -370,6 +377,7 @@ Color MeshDataTool::get_vertex_color(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, vertices.size(), Color()); return vertices[p_idx].color; } + void MeshDataTool::set_vertex_color(int p_idx, const Color &p_color) { ERR_FAIL_INDEX(p_idx, vertices.size()); vertices.write[p_idx].color = p_color; @@ -380,6 +388,7 @@ Vector<int> MeshDataTool::get_vertex_bones(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, vertices.size(), Vector<int>()); return vertices[p_idx].bones; } + void MeshDataTool::set_vertex_bones(int p_idx, const Vector<int> &p_bones) { ERR_FAIL_INDEX(p_idx, vertices.size()); vertices.write[p_idx].bones = p_bones; @@ -390,6 +399,7 @@ Vector<float> MeshDataTool::get_vertex_weights(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, vertices.size(), Vector<float>()); return vertices[p_idx].weights; } + void MeshDataTool::set_vertex_weights(int p_idx, const Vector<float> &p_weights) { ERR_FAIL_INDEX(p_idx, vertices.size()); vertices.write[p_idx].weights = p_weights; @@ -410,6 +420,7 @@ Vector<int> MeshDataTool::get_vertex_edges(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, vertices.size(), Vector<int>()); return vertices[p_idx].edges; } + Vector<int> MeshDataTool::get_vertex_faces(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, vertices.size(), Vector<int>()); return vertices[p_idx].faces; @@ -420,14 +431,17 @@ int MeshDataTool::get_edge_vertex(int p_edge, int p_vertex) const { ERR_FAIL_INDEX_V(p_vertex, 2, -1); return edges[p_edge].vertex[p_vertex]; } + Vector<int> MeshDataTool::get_edge_faces(int p_edge) const { ERR_FAIL_INDEX_V(p_edge, edges.size(), Vector<int>()); return edges[p_edge].faces; } + Variant MeshDataTool::get_edge_meta(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, edges.size(), Variant()); return edges[p_idx].meta; } + void MeshDataTool::set_edge_meta(int p_idx, const Variant &p_meta) { ERR_FAIL_INDEX(p_idx, edges.size()); edges.write[p_idx].meta = p_meta; @@ -438,15 +452,18 @@ int MeshDataTool::get_face_vertex(int p_face, int p_vertex) const { ERR_FAIL_INDEX_V(p_vertex, 3, -1); return faces[p_face].v[p_vertex]; } + int MeshDataTool::get_face_edge(int p_face, int p_vertex) const { ERR_FAIL_INDEX_V(p_face, faces.size(), -1); ERR_FAIL_INDEX_V(p_vertex, 3, -1); return faces[p_face].edges[p_vertex]; } + Variant MeshDataTool::get_face_meta(int p_face) const { ERR_FAIL_INDEX_V(p_face, faces.size(), Variant()); return faces[p_face].meta; } + void MeshDataTool::set_face_meta(int p_face, const Variant &p_meta) { ERR_FAIL_INDEX(p_face, faces.size()); faces.write[p_face].meta = p_meta; diff --git a/scene/resources/mesh_library.cpp b/scene/resources/mesh_library.cpp index c0615d9b29..0f2fd939ec 100644 --- a/scene/resources/mesh_library.cpp +++ b/scene/resources/mesh_library.cpp @@ -190,6 +190,7 @@ Ref<Texture2D> MeshLibrary::get_item_preview(int p_item) const { bool MeshLibrary::has_item(int p_item) const { return item_map.has(p_item); } + void MeshLibrary::remove_item(int p_item) { ERR_FAIL_COND_MSG(!item_map.has(p_item), "Requested for nonexistent MeshLibrary item '" + itos(p_item) + "'."); item_map.erase(p_item); @@ -282,5 +283,6 @@ void MeshLibrary::_bind_methods() { MeshLibrary::MeshLibrary() { } + MeshLibrary::~MeshLibrary() { } diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp index 795ec0df4b..10b9e24fbd 100644 --- a/scene/resources/multimesh.cpp +++ b/scene/resources/multimesh.cpp @@ -207,6 +207,7 @@ void MultiMesh::set_instance_count(int p_count) { RenderingServer::get_singleton()->multimesh_allocate(multimesh, p_count, RS::MultimeshTransformFormat(transform_format), use_colors, use_custom_data); instance_count = p_count; } + int MultiMesh::get_instance_count() const { return instance_count; } @@ -217,6 +218,7 @@ void MultiMesh::set_visible_instance_count(int p_count) { RenderingServer::get_singleton()->multimesh_set_visible_instances(multimesh, p_count); visible_instance_count = p_count; } + int MultiMesh::get_visible_instance_count() const { return visible_instance_count; } @@ -240,6 +242,7 @@ Transform2D MultiMesh::get_instance_transform_2d(int p_instance) const { void MultiMesh::set_instance_color(int p_instance, const Color &p_color) { RenderingServer::get_singleton()->multimesh_instance_set_color(multimesh, p_instance, p_color); } + Color MultiMesh::get_instance_color(int p_instance) const { return RenderingServer::get_singleton()->multimesh_instance_get_color(multimesh, p_instance); } @@ -247,6 +250,7 @@ Color MultiMesh::get_instance_color(int p_instance) const { void MultiMesh::set_instance_custom_data(int p_instance, const Color &p_custom_data) { RenderingServer::get_singleton()->multimesh_instance_set_custom_data(multimesh, p_instance, p_custom_data); } + Color MultiMesh::get_instance_custom_data(int p_instance) const { return RenderingServer::get_singleton()->multimesh_instance_get_custom_data(multimesh, p_instance); } @@ -281,6 +285,7 @@ void MultiMesh::set_transform_format(TransformFormat p_transform_format) { ERR_FAIL_COND(instance_count > 0); transform_format = p_transform_format; } + MultiMesh::TransformFormat MultiMesh::get_transform_format() const { return transform_format; } diff --git a/scene/resources/navigation_mesh.cpp b/scene/resources/navigation_mesh.cpp index f5d3c7a3fb..13d818188d 100644 --- a/scene/resources/navigation_mesh.cpp +++ b/scene/resources/navigation_mesh.cpp @@ -279,13 +279,16 @@ void NavigationMesh::add_polygon(const Vector<int> &p_polygon) { polygons.push_back(polygon); _change_notify(); } + int NavigationMesh::get_polygon_count() const { return polygons.size(); } + Vector<int> NavigationMesh::get_polygon(int p_idx) { ERR_FAIL_INDEX_V(p_idx, polygons.size(), Vector<int>()); return polygons[p_idx].indices; } + void NavigationMesh::clear_polygons() { polygons.clear(); } diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 199f0e3989..ba2cdf75e4 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -1331,11 +1331,13 @@ int SceneState::get_node_property_count(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, nodes.size(), -1); return nodes[p_idx].properties.size(); } + StringName SceneState::get_node_property_name(int p_idx, int p_prop) const { ERR_FAIL_INDEX_V(p_idx, nodes.size(), StringName()); ERR_FAIL_INDEX_V(p_prop, nodes[p_idx].properties.size(), StringName()); return names[nodes[p_idx].properties[p_prop].name]; } + Variant SceneState::get_node_property_value(int p_idx, int p_prop) const { ERR_FAIL_INDEX_V(p_idx, nodes.size(), Variant()); ERR_FAIL_INDEX_V(p_prop, nodes[p_idx].properties.size(), Variant()); @@ -1357,6 +1359,7 @@ NodePath SceneState::get_node_owner_path(int p_idx) const { int SceneState::get_connection_count() const { return connections.size(); } + NodePath SceneState::get_connection_source(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, connections.size(), NodePath()); if (connections[p_idx].from & FLAG_ID_IS_PATH) { @@ -1370,6 +1373,7 @@ StringName SceneState::get_connection_signal(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, connections.size(), StringName()); return names[connections[p_idx].signal]; } + NodePath SceneState::get_connection_target(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, connections.size(), NodePath()); if (connections[p_idx].to & FLAG_ID_IS_PATH) { @@ -1378,6 +1382,7 @@ NodePath SceneState::get_connection_target(int p_idx) const { return get_node_path(connections[p_idx].to & FLAG_MASK); } } + StringName SceneState::get_connection_method(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, connections.size(), StringName()); return names[connections[p_idx].method]; @@ -1438,6 +1443,7 @@ bool SceneState::has_connection(const NodePath &p_node_from, const StringName &p Vector<NodePath> SceneState::get_editable_instances() const { return editable_instances; } + //add int SceneState::add_name(const StringName &p_name) { @@ -1463,6 +1469,7 @@ int SceneState::add_node_path(const NodePath &p_path) { node_paths.push_back(p_path); return (node_paths.size() - 1) | FLAG_ID_IS_PATH; } + int SceneState::add_node(int p_parent, int p_owner, int p_type, int p_name, int p_instance, int p_index) { NodeData nd; nd.parent = p_parent; @@ -1476,6 +1483,7 @@ int SceneState::add_node(int p_parent, int p_owner, int p_type, int p_name, int return nodes.size() - 1; } + void SceneState::add_node_property(int p_node, int p_name, int p_value) { ERR_FAIL_INDEX(p_node, nodes.size()); ERR_FAIL_INDEX(p_name, names.size()); @@ -1486,15 +1494,18 @@ void SceneState::add_node_property(int p_node, int p_name, int p_value) { prop.value = p_value; nodes.write[p_node].properties.push_back(prop); } + void SceneState::add_node_group(int p_node, int p_group) { ERR_FAIL_INDEX(p_node, nodes.size()); ERR_FAIL_INDEX(p_group, names.size()); nodes.write[p_node].groups.push_back(p_group); } + void SceneState::set_base_scene(int p_idx) { ERR_FAIL_INDEX(p_idx, variants.size()); base_scene_idx = p_idx; } + void SceneState::add_connection(int p_from, int p_to, int p_signal, int p_method, int p_flags, const Vector<int> &p_binds) { ERR_FAIL_INDEX(p_signal, names.size()); ERR_FAIL_INDEX(p_method, names.size()); @@ -1511,6 +1522,7 @@ void SceneState::add_connection(int p_from, int p_to, int p_signal, int p_method c.binds = p_binds; connections.push_back(c); } + void SceneState::add_editable_instance(const NodePath &p_path) { editable_instances.push_back(p_path); } diff --git a/scene/resources/particles_material.cpp b/scene/resources/particles_material.cpp index e24cddd013..2f65c92181 100644 --- a/scene/resources/particles_material.cpp +++ b/scene/resources/particles_material.cpp @@ -637,6 +637,7 @@ void ParticlesMaterial::set_flatness(float p_flatness) { flatness = p_flatness; RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->flatness, p_flatness); } + float ParticlesMaterial::get_flatness() const { return flatness; } @@ -687,6 +688,7 @@ void ParticlesMaterial::set_param(Parameter p_param, float p_value) { break; // Can't happen, but silences warning } } + float ParticlesMaterial::get_param(Parameter p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); @@ -739,6 +741,7 @@ void ParticlesMaterial::set_param_randomness(Parameter p_param, float p_value) { break; // Can't happen, but silences warning } } + float ParticlesMaterial::get_param_randomness(Parameter p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0); @@ -811,6 +814,7 @@ void ParticlesMaterial::set_param_texture(Parameter p_param, const Ref<Texture2D _queue_shader_change(); } + Ref<Texture2D> ParticlesMaterial::get_param_texture(Parameter p_param) const { ERR_FAIL_INDEX_V(p_param, PARAM_MAX, Ref<Texture2D>()); @@ -896,12 +900,15 @@ ParticlesMaterial::EmissionShape ParticlesMaterial::get_emission_shape() const { float ParticlesMaterial::get_emission_sphere_radius() const { return emission_sphere_radius; } + Vector3 ParticlesMaterial::get_emission_box_extents() const { return emission_box_extents; } + Ref<Texture2D> ParticlesMaterial::get_emission_point_texture() const { return emission_point_texture; } + Ref<Texture2D> ParticlesMaterial::get_emission_normal_texture() const { return emission_normal_texture; } diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index 30d884a5ac..6e662b1085 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -138,6 +138,7 @@ Array PrimitiveMesh::surface_get_arrays(int p_surface) const { Dictionary PrimitiveMesh::surface_get_lods(int p_surface) const { return Dictionary(); //not really supported } + Array PrimitiveMesh::surface_get_blend_shape_arrays(int p_surface) const { return Array(); //not really supported } diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 01af96b1e0..f758427bd6 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -687,6 +687,7 @@ Error ResourceLoaderText::load() { int ResourceLoaderText::get_stage() const { return resource_current; } + int ResourceLoaderText::get_stage_count() const { return resources_total; //+ext_resources; } @@ -1287,6 +1288,7 @@ void ResourceFormatLoaderText::get_recognized_extensions(List<String> *p_extensi bool ResourceFormatLoaderText::handles_type(const String &p_type) const { return true; } + String ResourceFormatLoaderText::get_resource_type(const String &p_path) const { String ext = p_path.get_extension().to_lower(); if (ext == "tscn") @@ -1788,6 +1790,7 @@ Error ResourceFormatSaverText::save(const String &p_path, const RES &p_resource, bool ResourceFormatSaverText::recognize(const RES &p_resource) const { return true; // all recognized! } + void ResourceFormatSaverText::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const { if (p_resource->get_class() == "PackedScene") p_extensions->push_back("tscn"); //text scene diff --git a/scene/resources/segment_shape_2d.cpp b/scene/resources/segment_shape_2d.cpp index 6fce80b0df..2f7fbfb311 100644 --- a/scene/resources/segment_shape_2d.cpp +++ b/scene/resources/segment_shape_2d.cpp @@ -51,6 +51,7 @@ void SegmentShape2D::set_a(const Vector2 &p_a) { a = p_a; _update_shape(); } + Vector2 SegmentShape2D::get_a() const { return a; } @@ -59,6 +60,7 @@ void SegmentShape2D::set_b(const Vector2 &p_b) { b = p_b; _update_shape(); } + Vector2 SegmentShape2D::get_b() const { return b; } @@ -148,6 +150,7 @@ void RayShape2D::set_length(real_t p_length) { length = p_length; _update_shape(); } + real_t RayShape2D::get_length() const { return length; } diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index 188fc70ed3..341139e1c4 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -159,6 +159,7 @@ Shader::Shader() { Shader::~Shader() { RenderingServer::get_singleton()->free(shader); } + //////////// RES ResourceFormatLoaderShader::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { @@ -225,6 +226,7 @@ void ResourceFormatSaverShader::get_recognized_extensions(const RES &p_resource, } } } + bool ResourceFormatSaverShader::recognize(const RES &p_resource) const { return p_resource->get_class_name() == "Shader"; //only shader, not inherited } diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index b48de1aeb3..60c796f9f9 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -72,6 +72,7 @@ Array Shape2D::collide_with_motion_and_get_contacts(const Transform2D &p_local_x return results; } + Array Shape2D::collide_and_get_contacts(const Transform2D &p_local_xform, const Ref<Shape2D> &p_shape, const Transform2D &p_shape_xform) { ERR_FAIL_COND_V(p_shape.is_null(), Array()); const int max_contacts = 16; diff --git a/scene/resources/skin.cpp b/scene/resources/skin.cpp index 86b65925f5..e88841a531 100644 --- a/scene/resources/skin.cpp +++ b/scene/resources/skin.cpp @@ -124,6 +124,7 @@ bool Skin::_get(const StringName &p_name, Variant &r_ret) const { } return false; } + void Skin::_get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(Variant::INT, "bind_count", PROPERTY_HINT_RANGE, "0,16384,1,or_greater")); for (int i = 0; i < get_bind_count(); i++) { diff --git a/scene/resources/sky_material.cpp b/scene/resources/sky_material.cpp index 860673bee6..92c5151d7a 100644 --- a/scene/resources/sky_material.cpp +++ b/scene/resources/sky_material.cpp @@ -43,6 +43,7 @@ void ProceduralSkyMaterial::set_sky_horizon_color(const Color &p_sky_horizon) { sky_horizon_color = p_sky_horizon; RS::get_singleton()->material_set_param(_get_material(), "sky_horizon_color", sky_horizon_color.to_linear()); } + Color ProceduralSkyMaterial::get_sky_horizon_color() const { return sky_horizon_color; } @@ -51,6 +52,7 @@ void ProceduralSkyMaterial::set_sky_curve(float p_curve) { sky_curve = p_curve; RS::get_singleton()->material_set_param(_get_material(), "sky_curve", sky_curve); } + float ProceduralSkyMaterial::get_sky_curve() const { return sky_curve; } @@ -59,6 +61,7 @@ void ProceduralSkyMaterial::set_sky_energy(float p_energy) { sky_energy = p_energy; RS::get_singleton()->material_set_param(_get_material(), "sky_energy", sky_energy); } + float ProceduralSkyMaterial::get_sky_energy() const { return sky_energy; } @@ -67,6 +70,7 @@ void ProceduralSkyMaterial::set_ground_bottom_color(const Color &p_ground_bottom ground_bottom_color = p_ground_bottom; RS::get_singleton()->material_set_param(_get_material(), "ground_bottom_color", ground_bottom_color.to_linear()); } + Color ProceduralSkyMaterial::get_ground_bottom_color() const { return ground_bottom_color; } @@ -75,6 +79,7 @@ void ProceduralSkyMaterial::set_ground_horizon_color(const Color &p_ground_horiz ground_horizon_color = p_ground_horizon; RS::get_singleton()->material_set_param(_get_material(), "ground_horizon_color", ground_horizon_color.to_linear()); } + Color ProceduralSkyMaterial::get_ground_horizon_color() const { return ground_horizon_color; } @@ -83,6 +88,7 @@ void ProceduralSkyMaterial::set_ground_curve(float p_curve) { ground_curve = p_curve; RS::get_singleton()->material_set_param(_get_material(), "ground_curve", ground_curve); } + float ProceduralSkyMaterial::get_ground_curve() const { return ground_curve; } @@ -91,6 +97,7 @@ void ProceduralSkyMaterial::set_ground_energy(float p_energy) { ground_energy = p_energy; RS::get_singleton()->material_set_param(_get_material(), "ground_energy", ground_energy); } + float ProceduralSkyMaterial::get_ground_energy() const { return ground_energy; } @@ -99,6 +106,7 @@ void ProceduralSkyMaterial::set_sun_angle_max(float p_angle) { sun_angle_max = p_angle; RS::get_singleton()->material_set_param(_get_material(), "sun_angle_max", Math::deg2rad(sun_angle_max)); } + float ProceduralSkyMaterial::get_sun_angle_max() const { return sun_angle_max; } @@ -107,6 +115,7 @@ void ProceduralSkyMaterial::set_sun_curve(float p_curve) { sun_curve = p_curve; RS::get_singleton()->material_set_param(_get_material(), "sun_curve", sun_curve); } + float ProceduralSkyMaterial::get_sun_curve() const { return sun_curve; } @@ -307,6 +316,7 @@ PanoramaSkyMaterial::~PanoramaSkyMaterial() { RS::get_singleton()->free(shader); RS::get_singleton()->material_set_shader(_get_material(), RID()); } + ////////////////////////////////// /* PhysicalSkyMaterial */ @@ -314,6 +324,7 @@ void PhysicalSkyMaterial::set_rayleigh_coefficient(float p_rayleigh) { rayleigh = p_rayleigh; RS::get_singleton()->material_set_param(_get_material(), "rayleigh", rayleigh); } + float PhysicalSkyMaterial::get_rayleigh_coefficient() const { return rayleigh; } @@ -322,6 +333,7 @@ void PhysicalSkyMaterial::set_rayleigh_color(Color p_rayleigh_color) { rayleigh_color = p_rayleigh_color; RS::get_singleton()->material_set_param(_get_material(), "rayleigh_color", rayleigh_color); } + Color PhysicalSkyMaterial::get_rayleigh_color() const { return rayleigh_color; } @@ -330,6 +342,7 @@ void PhysicalSkyMaterial::set_mie_coefficient(float p_mie) { mie = p_mie; RS::get_singleton()->material_set_param(_get_material(), "mie", mie); } + float PhysicalSkyMaterial::get_mie_coefficient() const { return mie; } @@ -338,6 +351,7 @@ void PhysicalSkyMaterial::set_mie_eccentricity(float p_eccentricity) { mie_eccentricity = p_eccentricity; RS::get_singleton()->material_set_param(_get_material(), "mie_eccentricity", mie_eccentricity); } + float PhysicalSkyMaterial::get_mie_eccentricity() const { return mie_eccentricity; } @@ -346,6 +360,7 @@ void PhysicalSkyMaterial::set_mie_color(Color p_mie_color) { mie_color = p_mie_color; RS::get_singleton()->material_set_param(_get_material(), "mie_color", mie_color); } + Color PhysicalSkyMaterial::get_mie_color() const { return mie_color; } @@ -354,6 +369,7 @@ void PhysicalSkyMaterial::set_turbidity(float p_turbidity) { turbidity = p_turbidity; RS::get_singleton()->material_set_param(_get_material(), "turbidity", turbidity); } + float PhysicalSkyMaterial::get_turbidity() const { return turbidity; } @@ -362,6 +378,7 @@ void PhysicalSkyMaterial::set_sun_disk_scale(float p_sun_disk_scale) { sun_disk_scale = p_sun_disk_scale; RS::get_singleton()->material_set_param(_get_material(), "sun_disk_scale", sun_disk_scale); } + float PhysicalSkyMaterial::get_sun_disk_scale() const { return sun_disk_scale; } @@ -370,6 +387,7 @@ void PhysicalSkyMaterial::set_ground_color(Color p_ground_color) { ground_color = p_ground_color; RS::get_singleton()->material_set_param(_get_material(), "ground_color", ground_color); } + Color PhysicalSkyMaterial::get_ground_color() const { return ground_color; } @@ -378,6 +396,7 @@ void PhysicalSkyMaterial::set_exposure(float p_exposure) { exposure = p_exposure; RS::get_singleton()->material_set_param(_get_material(), "exposure", exposure); } + float PhysicalSkyMaterial::get_exposure() const { return exposure; } @@ -386,6 +405,7 @@ void PhysicalSkyMaterial::set_dither_strength(float p_dither_strength) { dither_strength = p_dither_strength; RS::get_singleton()->material_set_param(_get_material(), "dither_strength", dither_strength); } + float PhysicalSkyMaterial::get_dither_strength() const { return dither_strength; } diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index 550abd29af..b7c26dd3c3 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -44,6 +44,7 @@ void StyleBox::set_default_margin(Margin p_margin, float p_value) { margin[p_margin] = p_value; emit_changed(); } + float StyleBox::get_default_margin(Margin p_margin) const { ERR_FAIL_INDEX_V((int)p_margin, 4, 0.0); @@ -151,6 +152,7 @@ void StyleBoxTexture::set_margin_size(Margin p_margin, float p_size) { }; _change_notify(margin_prop[p_margin]); } + float StyleBoxTexture::get_margin_size(Margin p_margin) const { ERR_FAIL_INDEX_V((int)p_margin, 4, 0.0); @@ -341,6 +343,7 @@ StyleBoxTexture::StyleBoxTexture() { axis_h = AXIS_STRETCH_MODE_STRETCH; axis_v = AXIS_STRETCH_MODE_STRETCH; } + StyleBoxTexture::~StyleBoxTexture() { } @@ -359,6 +362,7 @@ void StyleBoxFlat::set_border_color(const Color &p_color) { border_color = p_color; emit_changed(); } + Color StyleBoxFlat::get_border_color() const { return border_color; } @@ -370,6 +374,7 @@ void StyleBoxFlat::set_border_width_all(int p_size) { border_width[3] = p_size; emit_changed(); } + int StyleBoxFlat::get_border_width_min() const { return MIN(MIN(border_width[0], border_width[1]), MIN(border_width[2], border_width[3])); } @@ -389,6 +394,7 @@ void StyleBoxFlat::set_border_blend(bool p_blend) { blend_border = p_blend; emit_changed(); } + bool StyleBoxFlat::get_border_blend() const { return blend_border; } @@ -400,6 +406,7 @@ void StyleBoxFlat::set_corner_radius_all(int radius) { emit_changed(); } + void StyleBoxFlat::set_corner_radius_individual(const int radius_top_left, const int radius_top_right, const int radius_botton_right, const int radius_bottom_left) { corner_radius[0] = radius_top_left; corner_radius[1] = radius_top_right; @@ -408,6 +415,7 @@ void StyleBoxFlat::set_corner_radius_individual(const int radius_top_left, const emit_changed(); } + int StyleBoxFlat::get_corner_radius_min() const { int smallest = corner_radius[0]; for (int i = 1; i < 4; i++) { @@ -423,6 +431,7 @@ void StyleBoxFlat::set_corner_radius(const Corner p_corner, const int radius) { corner_radius[p_corner] = radius; emit_changed(); } + int StyleBoxFlat::get_corner_radius(const Corner p_corner) const { ERR_FAIL_INDEX_V((int)p_corner, 4, 0); return corner_radius[p_corner]; @@ -453,10 +462,12 @@ float StyleBoxFlat::get_expand_margin_size(Margin p_expand_margin) const { ERR_FAIL_INDEX_V((int)p_expand_margin, 4, 0.0); return expand_margin[p_expand_margin]; } + void StyleBoxFlat::set_draw_center(bool p_enabled) { draw_center = p_enabled; emit_changed(); } + bool StyleBoxFlat::is_draw_center_enabled() const { return draw_center; } @@ -465,6 +476,7 @@ void StyleBoxFlat::set_shadow_color(const Color &p_color) { shadow_color = p_color; emit_changed(); } + Color StyleBoxFlat::get_shadow_color() const { return shadow_color; } @@ -473,6 +485,7 @@ void StyleBoxFlat::set_shadow_size(const int &p_size) { shadow_size = p_size; emit_changed(); } + int StyleBoxFlat::get_shadow_size() const { return shadow_size; } @@ -481,6 +494,7 @@ void StyleBoxFlat::set_shadow_offset(const Point2 &p_offset) { shadow_offset = p_offset; emit_changed(); } + Point2 StyleBoxFlat::get_shadow_offset() const { return shadow_offset; } @@ -489,6 +503,7 @@ void StyleBoxFlat::set_anti_aliased(const bool &p_anti_aliased) { anti_aliased = p_anti_aliased; emit_changed(); } + bool StyleBoxFlat::is_anti_aliased() const { return anti_aliased; } @@ -497,6 +512,7 @@ void StyleBoxFlat::set_aa_size(const int &p_aa_size) { aa_size = CLAMP(p_aa_size, 1, 5); emit_changed(); } + int StyleBoxFlat::get_aa_size() const { return aa_size; } @@ -505,6 +521,7 @@ void StyleBoxFlat::set_corner_detail(const int &p_corner_detail) { corner_detail = CLAMP(p_corner_detail, 1, 20); emit_changed(); } + int StyleBoxFlat::get_corner_detail() const { return corner_detail; } @@ -805,6 +822,7 @@ float StyleBoxFlat::get_style_margin(Margin p_margin) const { ERR_FAIL_INDEX_V((int)p_margin, 4, 0.0); return border_width[p_margin]; } + void StyleBoxFlat::_bind_methods() { ClassDB::bind_method(D_METHOD("set_bg_color", "color"), &StyleBoxFlat::set_bg_color); ClassDB::bind_method(D_METHOD("get_bg_color"), &StyleBoxFlat::get_bg_color); @@ -921,6 +939,7 @@ StyleBoxFlat::StyleBoxFlat() { corner_radius[2] = 0; corner_radius[3] = 0; } + StyleBoxFlat::~StyleBoxFlat() { } @@ -928,6 +947,7 @@ void StyleBoxLine::set_color(const Color &p_color) { color = p_color; emit_changed(); } + Color StyleBoxLine::get_color() const { return color; } @@ -936,6 +956,7 @@ void StyleBoxLine::set_thickness(int p_thickness) { thickness = p_thickness; emit_changed(); } + int StyleBoxLine::get_thickness() const { return thickness; } @@ -944,6 +965,7 @@ void StyleBoxLine::set_vertical(bool p_vertical) { vertical = p_vertical; emit_changed(); } + bool StyleBoxLine::is_vertical() const { return vertical; } @@ -952,6 +974,7 @@ void StyleBoxLine::set_grow_end(float p_grow_end) { grow_end = p_grow_end; emit_changed(); } + float StyleBoxLine::get_grow_end() const { return grow_end; } @@ -960,6 +983,7 @@ void StyleBoxLine::set_grow_begin(float p_grow_begin) { grow_begin = p_grow_begin; emit_changed(); } + float StyleBoxLine::get_grow_begin() const { return grow_begin; } @@ -982,10 +1006,12 @@ void StyleBoxLine::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "thickness", PROPERTY_HINT_RANGE, "0,10"), "set_thickness", "get_thickness"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "vertical"), "set_vertical", "is_vertical"); } + float StyleBoxLine::get_style_margin(Margin p_margin) const { ERR_FAIL_INDEX_V((int)p_margin, 4, thickness); return thickness; } + Size2 StyleBoxLine::get_center_size() const { return Size2(); } @@ -1014,4 +1040,5 @@ StyleBoxLine::StyleBoxLine() { color = Color(0.0, 0.0, 0.0); vertical = false; } + StyleBoxLine::~StyleBoxLine() {} diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp index 95eaf461e1..feba8c6c70 100644 --- a/scene/resources/surface_tool.cpp +++ b/scene/resources/surface_tool.cpp @@ -155,6 +155,7 @@ void SurfaceTool::add_vertex(const Vector3 &p_vertex) { format |= Mesh::ARRAY_FORMAT_VERTEX; } + void SurfaceTool::add_color(Color p_color) { ERR_FAIL_COND(!begun); @@ -163,6 +164,7 @@ void SurfaceTool::add_color(Color p_color) { format |= Mesh::ARRAY_FORMAT_COLOR; last_color = p_color; } + void SurfaceTool::add_normal(const Vector3 &p_normal) { ERR_FAIL_COND(!begun); @@ -745,9 +747,11 @@ int SurfaceTool::mikktGetNumFaces(const SMikkTSpaceContext *pContext) { return triangle_data.vertices.size() / 3; } } + int SurfaceTool::mikktGetNumVerticesOfFace(const SMikkTSpaceContext *pContext, const int iFace) { return 3; //always 3 } + void SurfaceTool::mikktGetPosition(const SMikkTSpaceContext *pContext, float fvPosOut[], const int iFace, const int iVert) { TangentGenerationContextUserData &triangle_data = *reinterpret_cast<TangentGenerationContextUserData *>(pContext->m_pUserData); Vector3 v; @@ -781,6 +785,7 @@ void SurfaceTool::mikktGetNormal(const SMikkTSpaceContext *pContext, float fvNor fvNormOut[1] = v.y; fvNormOut[2] = v.z; } + void SurfaceTool::mikktGetTexCoord(const SMikkTSpaceContext *pContext, float fvTexcOut[], const int iFace, const int iVert) { TangentGenerationContextUserData &triangle_data = *reinterpret_cast<TangentGenerationContextUserData *>(pContext->m_pUserData); Vector2 v; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 78b8e4d9ff..b549bea4f4 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -236,6 +236,7 @@ void ImageTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_m RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID(); RenderingServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, Size2(w, h)), texture, false, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat); } + void ImageTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const { if ((w | h) == 0) return; @@ -243,6 +244,7 @@ void ImageTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID(); RenderingServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, texture, p_tile, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat); } + void ImageTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const { if ((w | h) == 0) return; @@ -620,6 +622,7 @@ Error StreamTexture2D::load(const String &p_path) { emit_changed(); return OK; } + String StreamTexture2D::get_load_path() const { return path_to_file; } @@ -627,9 +630,11 @@ String StreamTexture2D::get_load_path() const { int StreamTexture2D::get_width() const { return w; } + int StreamTexture2D::get_height() const { return h; } + RID StreamTexture2D::get_rid() const { if (!texture.is_valid()) { texture = RS::get_singleton()->texture_2d_placeholder_create(); @@ -644,6 +649,7 @@ void StreamTexture2D::draw(RID p_canvas_item, const Point2 &p_pos, const Color & RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID(); RenderingServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, Rect2(p_pos, Size2(w, h)), texture, false, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat); } + void StreamTexture2D::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const { if ((w | h) == 0) return; @@ -651,6 +657,7 @@ void StreamTexture2D::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_t RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID(); RenderingServer::get_singleton()->canvas_item_add_texture_rect(p_canvas_item, p_rect, texture, p_tile, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat); } + void StreamTexture2D::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const { if ((w | h) == 0) return; @@ -755,9 +762,11 @@ RES ResourceFormatLoaderStreamTexture2D::load(const String &p_path, const String void ResourceFormatLoaderStreamTexture2D::get_recognized_extensions(List<String> *p_extensions) const { p_extensions->push_back("stex"); } + bool ResourceFormatLoaderStreamTexture2D::handles_type(const String &p_type) const { return p_type == "StreamTexture2D"; } + String ResourceFormatLoaderStreamTexture2D::get_resource_type(const String &p_path) const { if (p_path.get_extension().to_lower() == "stex") return "StreamTexture2D"; @@ -775,6 +784,7 @@ int AtlasTexture::get_width() const { return region.size.width + margin.size.width; } } + int AtlasTexture::get_height() const { if (region.size.height == 0) { if (atlas.is_valid()) @@ -784,6 +794,7 @@ int AtlasTexture::get_height() const { return region.size.height + margin.size.height; } } + RID AtlasTexture::get_rid() const { if (atlas.is_valid()) return atlas->get_rid(); @@ -806,6 +817,7 @@ void AtlasTexture::set_atlas(const Ref<Texture2D> &p_atlas) { emit_changed(); _change_notify("atlas"); } + Ref<Texture2D> AtlasTexture::get_atlas() const { return atlas; } @@ -903,6 +915,7 @@ void AtlasTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID(); RS::get_singleton()->canvas_item_add_texture_rect_region(p_canvas_item, dr, atlas->get_rid(), rc, p_modulate, p_transpose, normal_rid, specular_rid, p_specular_color_shininess, filter_clip, p_texture_filter, p_texture_repeat); } + void AtlasTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const { //this might not necessarily work well if using a rect, needs to be fixed properly if (!atlas.is_valid()) @@ -977,9 +990,11 @@ AtlasTexture::AtlasTexture() { int MeshTexture::get_width() const { return size.width; } + int MeshTexture::get_height() const { return size.height; } + RID MeshTexture::get_rid() const { return RID(); } @@ -991,6 +1006,7 @@ bool MeshTexture::has_alpha() const { void MeshTexture::set_mesh(const Ref<Mesh> &p_mesh) { mesh = p_mesh; } + Ref<Mesh> MeshTexture::get_mesh() const { return mesh; } @@ -1025,6 +1041,7 @@ void MeshTexture::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_mo RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID(); RenderingServer::get_singleton()->canvas_item_add_mesh(p_canvas_item, mesh->get_rid(), xform, p_modulate, base_texture->get_rid(), normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat); } + void MeshTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat) const { if (mesh.is_null() || base_texture.is_null()) { return; @@ -1048,6 +1065,7 @@ void MeshTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile, RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID(); RenderingServer::get_singleton()->canvas_item_add_mesh(p_canvas_item, mesh->get_rid(), xform, p_modulate, base_texture->get_rid(), normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat); } + void MeshTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const { if (mesh.is_null() || base_texture.is_null()) { return; @@ -1071,6 +1089,7 @@ void MeshTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const RID specular_rid = p_specular_map.is_valid() ? p_specular_map->get_rid() : RID(); RenderingServer::get_singleton()->canvas_item_add_mesh(p_canvas_item, mesh->get_rid(), xform, p_modulate, base_texture->get_rid(), normal_rid, specular_rid, p_specular_color_shininess, p_texture_filter, p_texture_repeat); } + bool MeshTexture::get_rect_region(const Rect2 &p_rect, const Rect2 &p_src_rect, Rect2 &r_rect, Rect2 &r_src_rect) const { r_rect = p_rect; r_src_rect = p_src_rect; @@ -1102,9 +1121,11 @@ MeshTexture::MeshTexture() { int LargeTexture::get_width() const { return size.width; } + int LargeTexture::get_height() const { return size.height; } + RID LargeTexture::get_rid() const { return RID(); } @@ -1143,6 +1164,7 @@ void LargeTexture::set_piece_texture(int p_idx, const Ref<Texture2D> &p_texture) void LargeTexture::set_size(const Size2 &p_size) { size = p_size; } + void LargeTexture::clear() { pieces.clear(); size = Size2i(); @@ -1157,6 +1179,7 @@ Array LargeTexture::_get_data() const { arr.push_back(Size2(size)); return arr; } + void LargeTexture::_set_data(const Array &p_array) { ERR_FAIL_COND(p_array.size() < 1); ERR_FAIL_COND(!(p_array.size() & 1)); @@ -1170,14 +1193,17 @@ void LargeTexture::_set_data(const Array &p_array) { int LargeTexture::get_piece_count() const { return pieces.size(); } + Vector2 LargeTexture::get_piece_offset(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, pieces.size(), Vector2()); return pieces[p_idx].offset; } + Ref<Texture2D> LargeTexture::get_piece_texture(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, pieces.size(), Ref<Texture2D>()); return pieces[p_idx].texture; } + Ref<Image> LargeTexture::to_image() const { Ref<Image> img = memnew(Image(this->get_width(), this->get_height(), false, Image::FORMAT_RGBA8)); for (int i = 0; i < pieces.size(); i++) { @@ -1224,6 +1250,7 @@ void LargeTexture::draw_rect(RID p_canvas_item, const Rect2 &p_rect, bool p_tile pieces[i].texture->draw_rect(p_canvas_item, Rect2(pieces[i].offset * scale + p_rect.position, pieces[i].texture->get_size() * scale), false, p_modulate, p_transpose, p_normal_map, p_specular_map, p_specular_color_shininess, p_texture_filter, p_texture_repeat); } } + void LargeTexture::draw_rect_region(RID p_canvas_item, const Rect2 &p_rect, const Rect2 &p_src_rect, const Color &p_modulate, bool p_transpose, const Ref<Texture2D> &p_normal_map, const Ref<Texture2D> &p_specular_map, const Color &p_specular_color_shininess, RS::CanvasItemTextureFilter p_texture_filter, RS::CanvasItemTextureRepeat p_texture_repeat, bool p_clip_uv) const { //tiling not supported for this if (p_src_rect.size.x == 0 || p_src_rect.size.y == 0) @@ -1361,11 +1388,13 @@ RID CurveTexture::get_rid() const { CurveTexture::CurveTexture() { _width = 2048; } + CurveTexture::~CurveTexture() { if (_texture.is_valid()) { RS::get_singleton()->free(_texture); } } + ////////////////// //setter and getter names for property serialization @@ -1464,6 +1493,7 @@ void GradientTexture::set_width(int p_width) { width = p_width; _queue_update(); } + int GradientTexture::get_width() const { return width; } @@ -1510,11 +1540,13 @@ int ProxyTexture::get_width() const { return base->get_width(); return 1; } + int ProxyTexture::get_height() const { if (base.is_valid()) return base->get_height(); return 1; } + RID ProxyTexture::get_rid() const { if (proxy.is_null()) { proxy_ph = RS::get_singleton()->texture_2d_placeholder_create(); @@ -1541,6 +1573,7 @@ ProxyTexture::~ProxyTexture() { RS::get_singleton()->free(proxy); } } + ////////////////////////////////////////////// void AnimatedTexture::_update_proxy() { @@ -1599,6 +1632,7 @@ void AnimatedTexture::set_frames(int p_frames) { frame_count = p_frames; } + int AnimatedTexture::get_frames() const { return frame_count; } @@ -1610,6 +1644,7 @@ void AnimatedTexture::set_current_frame(int p_frame) { current_frame = p_frame; } + int AnimatedTexture::get_current_frame() const { return current_frame; } @@ -1618,6 +1653,7 @@ void AnimatedTexture::set_pause(bool p_pause) { RWLockWrite r(rw_lock); pause = p_pause; } + bool AnimatedTexture::get_pause() const { return pause; } @@ -1626,6 +1662,7 @@ void AnimatedTexture::set_oneshot(bool p_oneshot) { RWLockWrite r(rw_lock); oneshot = p_oneshot; } + bool AnimatedTexture::get_oneshot() const { return oneshot; } @@ -1638,6 +1675,7 @@ void AnimatedTexture::set_frame_texture(int p_frame, const Ref<Texture2D> &p_tex frames[p_frame].texture = p_texture; } + Ref<Texture2D> AnimatedTexture::get_frame_texture(int p_frame) const { ERR_FAIL_INDEX_V(p_frame, MAX_FRAMES, Ref<Texture2D>()); @@ -1653,6 +1691,7 @@ void AnimatedTexture::set_frame_delay(int p_frame, float p_delay_sec) { frames[p_frame].delay_sec = p_delay_sec; } + float AnimatedTexture::get_frame_delay(int p_frame) const { ERR_FAIL_INDEX_V(p_frame, MAX_FRAMES, 0); @@ -1666,6 +1705,7 @@ void AnimatedTexture::set_fps(float p_fps) { fps = p_fps; } + float AnimatedTexture::get_fps() const { return fps; } @@ -1679,6 +1719,7 @@ int AnimatedTexture::get_width() const { return frames[current_frame].texture->get_width(); } + int AnimatedTexture::get_height() const { RWLockRead r(rw_lock); @@ -1688,6 +1729,7 @@ int AnimatedTexture::get_height() const { return frames[current_frame].texture->get_height(); } + RID AnimatedTexture::get_rid() const { return proxy; } @@ -1796,6 +1838,7 @@ AnimatedTexture::~AnimatedTexture() { memdelete(rw_lock); } } + /////////////////////////////// void TextureLayered::_bind_methods() { @@ -2045,6 +2088,7 @@ Error StreamTextureLayered::load(const String &p_path) { emit_changed(); return OK; } + String StreamTextureLayered::get_load_path() const { return path_to_file; } @@ -2052,12 +2096,15 @@ String StreamTextureLayered::get_load_path() const { int StreamTextureLayered::get_width() const { return w; } + int StreamTextureLayered::get_height() const { return h; } + int StreamTextureLayered::get_layers() const { return layers; } + bool StreamTextureLayered::has_mipmaps() const { return mipmaps; } @@ -2155,9 +2202,11 @@ void ResourceFormatLoaderStreamTextureLayered::get_recognized_extensions(List<St p_extensions->push_back("scube"); p_extensions->push_back("scubearray"); } + bool ResourceFormatLoaderStreamTextureLayered::handles_type(const String &p_type) const { return p_type == "StreamTexture2DArray" || p_type == "StreamCubemap" || p_type == "StreamCubemapArray"; } + String ResourceFormatLoaderStreamTextureLayered::get_resource_type(const String &p_path) const { if (p_path.get_extension().to_lower() == "stexarray") return "StreamTexture2DArray"; diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp index 7a28927583..7a2abffed0 100644 --- a/scene/resources/theme.cpp +++ b/scene/resources/theme.cpp @@ -310,9 +310,11 @@ void Theme::set_project_default(const Ref<Theme> &p_project_default) { void Theme::set_default_icon(const Ref<Texture2D> &p_icon) { default_icon = p_icon; } + void Theme::set_default_style(const Ref<StyleBox> &p_style) { default_style = p_style; } + void Theme::set_default_font(const Ref<Font> &p_font) { default_font = p_font; } @@ -337,6 +339,7 @@ void Theme::set_icon(const StringName &p_name, const StringName &p_type, const R emit_changed(); } } + Ref<Texture2D> Theme::get_icon(const StringName &p_name, const StringName &p_type) const { if (icon_map.has(p_type) && icon_map[p_type].has(p_name) && icon_map[p_type][p_name].is_valid()) { return icon_map[p_type][p_name]; @@ -509,6 +512,7 @@ void Theme::set_font(const StringName &p_name, const StringName &p_type, const R emit_changed(); } } + Ref<Font> Theme::get_font(const StringName &p_name, const StringName &p_type) const { if (font_map.has(p_type) && font_map[p_type].has(p_name) && font_map[p_type][p_name].is_valid()) return font_map[p_type][p_name]; diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 31d0fc2c9d..5faa256abd 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -66,6 +66,7 @@ bool VisualShaderNode::is_port_separator(int p_index) const { Vector<VisualShader::DefaultTextureParam> VisualShaderNode::get_default_texture_parameters(VisualShader::Type p_type, int p_id) const { return Vector<VisualShader::DefaultTextureParam>(); } + String VisualShaderNode::generate_global(Shader::Mode p_mode, VisualShader::Type p_type, int p_id) const { return String(); } @@ -90,6 +91,7 @@ Array VisualShaderNode::get_default_input_values() const { } return ret; } + void VisualShaderNode::set_default_input_values(const Array &p_values) { if (p_values.size() % 2 == 0) { for (int i = 0; i < p_values.size(); i += 2) { @@ -389,6 +391,7 @@ Vector<int> VisualShader::get_node_list(Type p_type) const { return ret; } + int VisualShader::get_valid_node_id(Type p_type) const { ERR_FAIL_INDEX_V(p_type, TYPE_MAX, NODE_ID_INVALID); const Graph *g = &graph[p_type]; @@ -1724,9 +1727,11 @@ const VisualShaderNodeInput::Port VisualShaderNodeInput::preview_ports[] = { int VisualShaderNodeInput::get_input_port_count() const { return 0; } + VisualShaderNodeInput::PortType VisualShaderNodeInput::get_input_port_type(int p_port) const { return PORT_TYPE_SCALAR; } + String VisualShaderNodeInput::get_input_port_name(int p_port) const { return ""; } @@ -1734,9 +1739,11 @@ String VisualShaderNodeInput::get_input_port_name(int p_port) const { int VisualShaderNodeInput::get_output_port_count() const { return 1; } + VisualShaderNodeInput::PortType VisualShaderNodeInput::get_output_port_type(int p_port) const { return get_input_type_by_name(input_name); } + String VisualShaderNodeInput::get_output_port_name(int p_port) const { return ""; } @@ -1932,6 +1939,7 @@ void VisualShaderNodeInput::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::STRING_NAME, "input_name", PROPERTY_HINT_ENUM, ""), "set_input_name", "get_input_name"); ADD_SIGNAL(MethodInfo("input_type_changed")); } + VisualShaderNodeInput::VisualShaderNodeInput() { input_name = "[None]"; // changed when set @@ -2064,9 +2072,11 @@ Variant VisualShaderNodeOutput::get_input_port_default_value(int p_port) const { int VisualShaderNodeOutput::get_output_port_count() const { return 0; } + VisualShaderNodeOutput::PortType VisualShaderNodeOutput::get_output_port_type(int p_port) const { return PORT_TYPE_SCALAR; } + String VisualShaderNodeOutput::get_output_port_name(int p_port) const { return String(); } diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp index 99b9c7803e..368a9d351d 100644 --- a/scene/resources/world_2d.cpp +++ b/scene/resources/world_2d.cpp @@ -293,6 +293,7 @@ void World2D::_register_viewport(Viewport *p_viewport, const Rect2 &p_rect) { void World2D::_update_viewport(Viewport *p_viewport, const Rect2 &p_rect) { indexer->_update_viewport(p_viewport, p_rect); } + void World2D::_remove_viewport(Viewport *p_viewport) { indexer->_remove_viewport(p_viewport); } @@ -300,9 +301,11 @@ void World2D::_remove_viewport(Viewport *p_viewport) { void World2D::_register_notifier(VisibilityNotifier2D *p_notifier, const Rect2 &p_rect) { indexer->_notifier_add(p_notifier, p_rect); } + void World2D::_update_notifier(VisibilityNotifier2D *p_notifier, const Rect2 &p_rect) { indexer->_notifier_update(p_notifier, p_rect); } + void World2D::_remove_notifier(VisibilityNotifier2D *p_notifier) { indexer->_notifier_remove(p_notifier); } diff --git a/scene/resources/world_3d.cpp b/scene/resources/world_3d.cpp index d8ec7f507c..f53a24596a 100644 --- a/scene/resources/world_3d.cpp +++ b/scene/resources/world_3d.cpp @@ -204,6 +204,7 @@ void World3D::_update_camera(Camera3D *p_camera) { indexer->_update_camera(p_camera); #endif } + void World3D::_remove_camera(Camera3D *p_camera) { #ifndef _3D_DISABLED indexer->_remove_camera(p_camera); |