mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Simplify GDVIRTUAL_REQUIRED_CALL calls
This commit is contained in:
		
							parent
							
								
									cd491c6e47
								
							
						
					
					
						commit
						9a3960daa5
					
				
					 8 changed files with 124 additions and 233 deletions
				
			
		|  | @ -148,10 +148,8 @@ bool EditorExportPlugin::_begin_customize_resources(const Ref<EditorExportPlatfo | ||||||
| 
 | 
 | ||||||
| Ref<Resource> EditorExportPlugin::_customize_resource(const Ref<Resource> &p_resource, const String &p_path) { | Ref<Resource> EditorExportPlugin::_customize_resource(const Ref<Resource> &p_resource, const String &p_path) { | ||||||
| 	Ref<Resource> ret; | 	Ref<Resource> ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_customize_resource, p_resource, p_path, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_customize_resource, p_resource, p_path, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return Ref<Resource>(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool EditorExportPlugin::_begin_customize_scenes(const Ref<EditorExportPlatform> &p_platform, const Vector<String> &p_features) const { | bool EditorExportPlugin::_begin_customize_scenes(const Ref<EditorExportPlatform> &p_platform, const Vector<String> &p_features) const { | ||||||
|  | @ -162,18 +160,14 @@ bool EditorExportPlugin::_begin_customize_scenes(const Ref<EditorExportPlatform> | ||||||
| 
 | 
 | ||||||
| Node *EditorExportPlugin::_customize_scene(Node *p_root, const String &p_path) { | Node *EditorExportPlugin::_customize_scene(Node *p_root, const String &p_path) { | ||||||
| 	Node *ret = nullptr; | 	Node *ret = nullptr; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_customize_scene, p_root, p_path, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_customize_scene, p_root, p_path, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return nullptr; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| uint64_t EditorExportPlugin::_get_customization_configuration_hash() const { | uint64_t EditorExportPlugin::_get_customization_configuration_hash() const { | ||||||
| 	uint64_t ret = 0; | 	uint64_t ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_customization_configuration_hash, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_customization_configuration_hash, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void EditorExportPlugin::_end_customize_scenes() { | void EditorExportPlugin::_end_customize_scenes() { | ||||||
|  | @ -186,10 +180,8 @@ void EditorExportPlugin::_end_customize_resources() { | ||||||
| 
 | 
 | ||||||
| String EditorExportPlugin::_get_name() const { | String EditorExportPlugin::_get_name() const { | ||||||
| 	String ret; | 	String ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_name, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_name, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return ""; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void EditorExportPlugin::_export_file(const String &p_path, const String &p_type, const HashSet<String> &p_features) { | void EditorExportPlugin::_export_file(const String &p_path, const String &p_type, const HashSet<String> &p_features) { | ||||||
|  |  | ||||||
|  | @ -92,18 +92,13 @@ void Material::inspect_native_shader_code() { | ||||||
| 
 | 
 | ||||||
| RID Material::get_shader_rid() const { | RID Material::get_shader_rid() const { | ||||||
| 	RID ret; | 	RID ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_shader_rid, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_shader_rid, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return RID(); |  | ||||||
| } | } | ||||||
| Shader::Mode Material::get_shader_mode() const { | Shader::Mode Material::get_shader_mode() const { | ||||||
| 	Shader::Mode ret; | 	Shader::Mode ret = Shader::MODE_MAX; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_shader_mode, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_shader_mode, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return Shader::MODE_MAX; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool Material::_can_do_next_pass() const { | bool Material::_can_do_next_pass() const { | ||||||
|  |  | ||||||
|  | @ -40,119 +40,83 @@ | ||||||
| Mesh::ConvexDecompositionFunc Mesh::convex_decomposition_function = nullptr; | Mesh::ConvexDecompositionFunc Mesh::convex_decomposition_function = nullptr; | ||||||
| 
 | 
 | ||||||
| int Mesh::get_surface_count() const { | int Mesh::get_surface_count() const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_surface_count, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_surface_count, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int Mesh::surface_get_array_len(int p_idx) const { | int Mesh::surface_get_array_len(int p_idx) const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_surface_get_array_len, p_idx, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_surface_get_array_len, p_idx, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int Mesh::surface_get_array_index_len(int p_idx) const { | int Mesh::surface_get_array_index_len(int p_idx) const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_surface_get_array_index_len, p_idx, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_surface_get_array_index_len, p_idx, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Array Mesh::surface_get_arrays(int p_surface) const { | Array Mesh::surface_get_arrays(int p_surface) const { | ||||||
| 	Array ret; | 	Array ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_surface_get_arrays, p_surface, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_surface_get_arrays, p_surface, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return Array(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| TypedArray<Array> Mesh::surface_get_blend_shape_arrays(int p_surface) const { | TypedArray<Array> Mesh::surface_get_blend_shape_arrays(int p_surface) const { | ||||||
| 	TypedArray<Array> ret; | 	TypedArray<Array> ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_surface_get_blend_shape_arrays, p_surface, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_surface_get_blend_shape_arrays, p_surface, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return TypedArray<Array>(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Dictionary Mesh::surface_get_lods(int p_surface) const { | Dictionary Mesh::surface_get_lods(int p_surface) const { | ||||||
| 	Dictionary ret; | 	Dictionary ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_surface_get_lods, p_surface, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_surface_get_lods, p_surface, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return Dictionary(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| uint32_t Mesh::surface_get_format(int p_idx) const { | uint32_t Mesh::surface_get_format(int p_idx) const { | ||||||
| 	uint32_t ret; | 	uint32_t ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_surface_get_format, p_idx, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_surface_get_format, p_idx, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Mesh::PrimitiveType Mesh::surface_get_primitive_type(int p_idx) const { | Mesh::PrimitiveType Mesh::surface_get_primitive_type(int p_idx) const { | ||||||
| 	uint32_t ret; | 	uint32_t ret = PRIMITIVE_MAX; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_surface_get_primitive_type, p_idx, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_surface_get_primitive_type, p_idx, ret); | ||||||
| 		return (Mesh::PrimitiveType)ret; | 	return (Mesh::PrimitiveType)ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return PRIMITIVE_MAX; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Mesh::surface_set_material(int p_idx, const Ref<Material> &p_material) { | void Mesh::surface_set_material(int p_idx, const Ref<Material> &p_material) { | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_surface_set_material, p_idx, p_material)) { | 	GDVIRTUAL_REQUIRED_CALL(_surface_set_material, p_idx, p_material); | ||||||
| 		return; |  | ||||||
| 	} |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Ref<Material> Mesh::surface_get_material(int p_idx) const { | Ref<Material> Mesh::surface_get_material(int p_idx) const { | ||||||
| 	Ref<Material> ret; | 	Ref<Material> ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_surface_get_material, p_idx, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_surface_get_material, p_idx, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return Ref<Material>(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int Mesh::get_blend_shape_count() const { | int Mesh::get_blend_shape_count() const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_blend_shape_count, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_blend_shape_count, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| StringName Mesh::get_blend_shape_name(int p_index) const { | StringName Mesh::get_blend_shape_name(int p_index) const { | ||||||
| 	StringName ret; | 	StringName ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_blend_shape_name, p_index, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_blend_shape_name, p_index, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return StringName(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Mesh::set_blend_shape_name(int p_index, const StringName &p_name) { | void Mesh::set_blend_shape_name(int p_index, const StringName &p_name) { | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_set_blend_shape_name, p_index, p_name)) { | 	GDVIRTUAL_REQUIRED_CALL(_set_blend_shape_name, p_index, p_name); | ||||||
| 		return; |  | ||||||
| 	} |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| AABB Mesh::get_aabb() const { | AABB Mesh::get_aabb() const { | ||||||
| 	AABB ret; | 	AABB ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_aabb, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_aabb, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return AABB(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Ref<TriangleMesh> Mesh::generate_triangle_mesh() const { | Ref<TriangleMesh> Mesh::generate_triangle_mesh() const { | ||||||
|  |  | ||||||
|  | @ -35,11 +35,9 @@ | ||||||
| #include <limits.h> | #include <limits.h> | ||||||
| 
 | 
 | ||||||
| float StyleBox::get_style_margin(Side p_side) const { | float StyleBox::get_style_margin(Side p_side) const { | ||||||
| 	float ret; | 	float ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_style_margin, p_side, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_style_margin, p_side, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool StyleBox::test_mask(const Point2 &p_point, const Rect2 &p_rect) const { | bool StyleBox::test_mask(const Point2 &p_point, const Rect2 &p_rect) const { | ||||||
|  | @ -49,9 +47,7 @@ bool StyleBox::test_mask(const Point2 &p_point, const Rect2 &p_rect) const { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void StyleBox::draw(RID p_canvas_item, const Rect2 &p_rect) const { | void StyleBox::draw(RID p_canvas_item, const Rect2 &p_rect) const { | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_draw, p_canvas_item, p_rect)) { | 	GDVIRTUAL_REQUIRED_CALL(_draw, p_canvas_item, p_rect); | ||||||
| 		return; |  | ||||||
| 	} |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void StyleBox::set_default_margin(Side p_side, float p_value) { | void StyleBox::set_default_margin(Side p_side, float p_value) { | ||||||
|  |  | ||||||
|  | @ -40,19 +40,15 @@ | ||||||
| #include "servers/camera/camera_feed.h" | #include "servers/camera/camera_feed.h" | ||||||
| 
 | 
 | ||||||
| int Texture2D::get_width() const { | int Texture2D::get_width() const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_width, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_width, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int Texture2D::get_height() const { | int Texture2D::get_height() const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_height, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_height, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Size2 Texture2D::get_size() const { | Size2 Texture2D::get_size() const { | ||||||
|  | @ -1092,57 +1088,44 @@ TypedArray<Image> Texture3D::_get_datai() const { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Image::Format Texture3D::get_format() const { | Image::Format Texture3D::get_format() const { | ||||||
| 	Image::Format ret; | 	Image::Format ret = Image::FORMAT_MAX; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_format, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_format, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return Image::FORMAT_MAX; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int Texture3D::get_width() const { | int Texture3D::get_width() const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_width, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_width, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int Texture3D::get_height() const { | int Texture3D::get_height() const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_height, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_height, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int Texture3D::get_depth() const { | int Texture3D::get_depth() const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_depth, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_depth, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool Texture3D::has_mipmaps() const { | bool Texture3D::has_mipmaps() const { | ||||||
| 	bool ret; | 	bool ret = false; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_has_mipmaps, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_has_mipmaps, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return false; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Vector<Ref<Image>> Texture3D::get_data() const { | Vector<Ref<Image>> Texture3D::get_data() const { | ||||||
| 	TypedArray<Image> ret; | 	TypedArray<Image> ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_data, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_data, ret); | ||||||
| 		Vector<Ref<Image>> data; | 	Vector<Ref<Image>> data; | ||||||
| 		data.resize(ret.size()); | 	data.resize(ret.size()); | ||||||
| 		for (int i = 0; i < data.size(); i++) { | 	for (int i = 0; i < data.size(); i++) { | ||||||
| 			data.write[i] = ret[i]; | 		data.write[i] = ret[i]; | ||||||
| 		} |  | ||||||
| 		return data; |  | ||||||
| 	} | 	} | ||||||
| 	return Vector<Ref<Image>>(); | 	return data; | ||||||
| } | } | ||||||
| void Texture3D::_bind_methods() { | void Texture3D::_bind_methods() { | ||||||
| 	ClassDB::bind_method(D_METHOD("get_format"), &Texture3D::get_format); | 	ClassDB::bind_method(D_METHOD("get_format"), &Texture3D::get_format); | ||||||
|  | @ -2859,60 +2842,45 @@ AnimatedTexture::~AnimatedTexture() { | ||||||
| ///////////////////////////////
 | ///////////////////////////////
 | ||||||
| 
 | 
 | ||||||
| Image::Format TextureLayered::get_format() const { | Image::Format TextureLayered::get_format() const { | ||||||
| 	Image::Format ret; | 	Image::Format ret = Image::FORMAT_MAX; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_format, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_format, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return Image::FORMAT_MAX; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| TextureLayered::LayeredType TextureLayered::get_layered_type() const { | TextureLayered::LayeredType TextureLayered::get_layered_type() const { | ||||||
| 	uint32_t ret; | 	uint32_t ret = LAYERED_TYPE_2D_ARRAY; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_layered_type, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_layered_type, ret); | ||||||
| 		return (LayeredType)ret; | 	return (LayeredType)ret; | ||||||
| 	} |  | ||||||
| 	return LAYERED_TYPE_2D_ARRAY; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int TextureLayered::get_width() const { | int TextureLayered::get_width() const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_width, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_width, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int TextureLayered::get_height() const { | int TextureLayered::get_height() const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_height, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_height, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int TextureLayered::get_layers() const { | int TextureLayered::get_layers() const { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_layers, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_layers, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| bool TextureLayered::has_mipmaps() const { | bool TextureLayered::has_mipmaps() const { | ||||||
| 	bool ret; | 	bool ret = false; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_has_mipmaps, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_has_mipmaps, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return false; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Ref<Image> TextureLayered::get_layer_data(int p_layer) const { | Ref<Image> TextureLayered::get_layer_data(int p_layer) const { | ||||||
| 	Ref<Image> ret; | 	Ref<Image> ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_layer_data, p_layer, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_layer_data, p_layer, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return Ref<Image>(); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void TextureLayered::_bind_methods() { | void TextureLayered::_bind_methods() { | ||||||
|  |  | ||||||
|  | @ -31,9 +31,7 @@ | ||||||
| #include "audio_effect.h" | #include "audio_effect.h" | ||||||
| 
 | 
 | ||||||
| void AudioEffectInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) { | void AudioEffectInstance::process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count) { | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_process, p_src_frames, p_dst_frames, p_frame_count)) { | 	GDVIRTUAL_REQUIRED_CALL(_process, p_src_frames, p_dst_frames, p_frame_count); | ||||||
| 		return; |  | ||||||
| 	} |  | ||||||
| } | } | ||||||
| bool AudioEffectInstance::process_silence() const { | bool AudioEffectInstance::process_silence() const { | ||||||
| 	bool ret = false; | 	bool ret = false; | ||||||
|  | @ -50,10 +48,8 @@ void AudioEffectInstance::_bind_methods() { | ||||||
| 
 | 
 | ||||||
| Ref<AudioEffectInstance> AudioEffect::instantiate() { | Ref<AudioEffectInstance> AudioEffect::instantiate() { | ||||||
| 	Ref<AudioEffectInstance> ret; | 	Ref<AudioEffectInstance> ret; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_instantiate, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_instantiate, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return Ref<AudioEffectInstance>(); |  | ||||||
| } | } | ||||||
| void AudioEffect::_bind_methods() { | void AudioEffect::_bind_methods() { | ||||||
| 	GDVIRTUAL_BIND(_instantiate); | 	GDVIRTUAL_BIND(_instantiate); | ||||||
|  |  | ||||||
|  | @ -71,12 +71,9 @@ void AudioStreamPlayback::seek(double p_time) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int AudioStreamPlayback::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) { | int AudioStreamPlayback::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_mix, p_buffer, p_rate_scale, p_frames, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_mix, p_buffer, p_rate_scale, p_frames, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void AudioStreamPlayback::tag_used_streams() { | void AudioStreamPlayback::tag_used_streams() { | ||||||
|  | @ -107,20 +104,14 @@ void AudioStreamPlaybackResampled::begin_resample() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int AudioStreamPlaybackResampled::_mix_internal(AudioFrame *p_buffer, int p_frames) { | int AudioStreamPlaybackResampled::_mix_internal(AudioFrame *p_buffer, int p_frames) { | ||||||
| 	int ret; | 	int ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_mix_resampled, p_buffer, p_frames, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_mix_resampled, p_buffer, p_frames, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| float AudioStreamPlaybackResampled::get_stream_sampling_rate() { | float AudioStreamPlaybackResampled::get_stream_sampling_rate() { | ||||||
| 	float ret; | 	float ret = 0; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_stream_sampling_rate, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_stream_sampling_rate, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return 0; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void AudioStreamPlaybackResampled::_bind_methods() { | void AudioStreamPlaybackResampled::_bind_methods() { | ||||||
|  |  | ||||||
|  | @ -52,34 +52,26 @@ MovieWriter *MovieWriter::find_writer_for_file(const String &p_file) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| uint32_t MovieWriter::get_audio_mix_rate() const { | uint32_t MovieWriter::get_audio_mix_rate() const { | ||||||
| 	uint32_t ret = 0; | 	uint32_t ret = 48000; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_audio_mix_rate, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_audio_mix_rate, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return 48000; |  | ||||||
| } | } | ||||||
| AudioServer::SpeakerMode MovieWriter::get_audio_speaker_mode() const { | AudioServer::SpeakerMode MovieWriter::get_audio_speaker_mode() const { | ||||||
| 	AudioServer::SpeakerMode ret = AudioServer::SPEAKER_MODE_STEREO; | 	AudioServer::SpeakerMode ret = AudioServer::SPEAKER_MODE_STEREO; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_audio_speaker_mode, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_audio_speaker_mode, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return AudioServer::SPEAKER_MODE_STEREO; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Error MovieWriter::write_begin(const Size2i &p_movie_size, uint32_t p_fps, const String &p_base_path) { | Error MovieWriter::write_begin(const Size2i &p_movie_size, uint32_t p_fps, const String &p_base_path) { | ||||||
| 	Error ret = OK; | 	Error ret = ERR_UNCONFIGURED; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_write_begin, p_movie_size, p_fps, p_base_path, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_write_begin, p_movie_size, p_fps, p_base_path, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return ERR_UNCONFIGURED; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| Error MovieWriter::write_frame(const Ref<Image> &p_image, const int32_t *p_audio_data) { | Error MovieWriter::write_frame(const Ref<Image> &p_image, const int32_t *p_audio_data) { | ||||||
| 	Error ret = OK; | 	Error ret = ERR_UNCONFIGURED; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_write_frame, p_image, p_audio_data, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_write_frame, p_image, p_audio_data, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return ERR_UNCONFIGURED; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MovieWriter::write_end() { | void MovieWriter::write_end() { | ||||||
|  | @ -88,18 +80,15 @@ void MovieWriter::write_end() { | ||||||
| 
 | 
 | ||||||
| bool MovieWriter::handles_file(const String &p_path) const { | bool MovieWriter::handles_file(const String &p_path) const { | ||||||
| 	bool ret = false; | 	bool ret = false; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_handles_file, p_path, ret)) { | 	GDVIRTUAL_REQUIRED_CALL(_handles_file, p_path, ret); | ||||||
| 		return ret; | 	return ret; | ||||||
| 	} |  | ||||||
| 	return false; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void MovieWriter::get_supported_extensions(List<String> *r_extensions) const { | void MovieWriter::get_supported_extensions(List<String> *r_extensions) const { | ||||||
| 	Vector<String> exts; | 	Vector<String> exts; | ||||||
| 	if (GDVIRTUAL_REQUIRED_CALL(_get_supported_extensions, exts)) { | 	GDVIRTUAL_REQUIRED_CALL(_get_supported_extensions, exts); | ||||||
| 		for (int i = 0; i < exts.size(); i++) { | 	for (int i = 0; i < exts.size(); i++) { | ||||||
| 			r_extensions->push_back(exts[i]); | 		r_extensions->push_back(exts[i]); | ||||||
| 		} |  | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 kobewi
						kobewi