Fix type hints in method registration

This commit is contained in:
Marc Gilleron 2017-08-13 00:08:53 +02:00
parent dd64868c2e
commit 05dfddfa20
8 changed files with 27 additions and 29 deletions

View File

@ -178,24 +178,24 @@ Ref<Voxel> Voxel::set_cube_uv_tbs_sides(Vector2 top_atlas_pos, Vector2 side_atla
void Voxel::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_name:Voxel", "name"), &Voxel::set_name);
ClassDB::bind_method(D_METHOD("set_name", "name"), &Voxel::set_name);
ClassDB::bind_method(D_METHOD("get_name"), &Voxel::get_name);
ClassDB::bind_method(D_METHOD("set_id:Voxel", "id"), &Voxel::set_id);
ClassDB::bind_method(D_METHOD("set_id", "id"), &Voxel::set_id);
ClassDB::bind_method(D_METHOD("get_id"), &Voxel::get_id);
ClassDB::bind_method(D_METHOD("set_color:Voxel", "color"), &Voxel::set_color);
ClassDB::bind_method(D_METHOD("set_color", "color"), &Voxel::set_color);
ClassDB::bind_method(D_METHOD("get_color"), &Voxel::get_color);
ClassDB::bind_method(D_METHOD("set_transparent:Voxel", "color"), &Voxel::set_transparent, DEFVAL(true));
ClassDB::bind_method(D_METHOD("set_transparent", "color"), &Voxel::set_transparent, DEFVAL(true));
ClassDB::bind_method(D_METHOD("is_transparent"), &Voxel::is_transparent);
ClassDB::bind_method(D_METHOD("set_material_id", "id"), &Voxel::set_material_id);
ClassDB::bind_method(D_METHOD("get_material_id"), &Voxel::get_material_id);
ClassDB::bind_method(D_METHOD("set_cube_geometry:Voxel", "height"), &Voxel::set_cube_geometry, DEFVAL(1.f));
ClassDB::bind_method(D_METHOD("set_cube_uv_all_sides:Voxel", "atlas_pos"), &Voxel::set_cube_uv_all_sides);
ClassDB::bind_method(D_METHOD("set_cube_uv_tbs_sides:Voxel", "top_atlas_pos", "side_atlas_pos", "bottom_atlas_pos"), &Voxel::set_cube_uv_tbs_sides);
ClassDB::bind_method(D_METHOD("set_cube_geometry", "height"), &Voxel::set_cube_geometry, DEFVAL(1.f));
ClassDB::bind_method(D_METHOD("set_cube_uv_all_sides", "atlas_pos"), &Voxel::set_cube_uv_all_sides);
ClassDB::bind_method(D_METHOD("set_cube_uv_tbs_sides", "top_atlas_pos", "side_atlas_pos", "bottom_atlas_pos"), &Voxel::set_cube_uv_tbs_sides);
BIND_CONSTANT( CHANNEL_TYPE )
BIND_CONSTANT( CHANNEL_ISOLEVEL )

View File

@ -256,8 +256,8 @@ void VoxelBuffer::_bind_methods() {
ClassDB::bind_method(D_METHOD("fill", "value", "channel"), &VoxelBuffer::fill, DEFVAL(0));
ClassDB::bind_method(D_METHOD("fill_area", "value", "min", "max", "channel"), &VoxelBuffer::_fill_area_binding, DEFVAL(0));
ClassDB::bind_method(D_METHOD("copy_from", "other:VoxelBuffer", "channel"), &VoxelBuffer::_copy_from_binding, DEFVAL(0));
ClassDB::bind_method(D_METHOD("copy_from_area", "other:VoxelBuffer", "src_min", "src_max", "dst_min", "channel"), &VoxelBuffer::_copy_from_area_binding, DEFVAL(0));
ClassDB::bind_method(D_METHOD("copy_from", "other", "channel"), &VoxelBuffer::_copy_from_binding, DEFVAL(0));
ClassDB::bind_method(D_METHOD("copy_from_area", "other", "src_min", "src_max", "dst_min", "channel"), &VoxelBuffer::_copy_from_area_binding, DEFVAL(0));
ClassDB::bind_method(D_METHOD("is_uniform", "channel"), &VoxelBuffer::is_uniform, DEFVAL(0));
ClassDB::bind_method(D_METHOD("optimize"), &VoxelBuffer::optimize);

View File

@ -36,7 +36,7 @@ Ref<Voxel> VoxelLibrary::_get_voxel_bind(int id) {
void VoxelLibrary::_bind_methods() {
ClassDB::bind_method(D_METHOD("create_voxel:Voxel", "id", "name"), &VoxelLibrary::create_voxel);
ClassDB::bind_method(D_METHOD("create_voxel", "id", "name"), &VoxelLibrary::create_voxel);
ClassDB::bind_method(D_METHOD("get_voxel", "id"), &VoxelLibrary::_get_voxel_bind);
ClassDB::bind_method(D_METHOD("set_atlas_size", "square_size"), &VoxelLibrary::set_atlas_size);

View File

@ -265,8 +265,8 @@ void VoxelMap::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_default_voxel", "channel"), &VoxelMap::get_default_voxel, DEFVAL(0));
ClassDB::bind_method(D_METHOD("set_default_voxel", "value", "channel"), &VoxelMap::set_default_voxel, DEFVAL(0));
ClassDB::bind_method(D_METHOD("has_block", "x", "y", "z"), &VoxelMap::_has_block_binding);
ClassDB::bind_method(D_METHOD("get_buffer_copy", "min_pos", "out_buffer:VoxelBuffer", "channel"), &VoxelMap::_get_buffer_copy_binding, DEFVAL(0));
ClassDB::bind_method(D_METHOD("set_block_buffer", "block_pos", "buffer:VoxelBuffer"), &VoxelMap::_set_block_buffer_binding);
ClassDB::bind_method(D_METHOD("get_buffer_copy", "min_pos", "out_buffer", "channel"), &VoxelMap::_get_buffer_copy_binding, DEFVAL(0));
ClassDB::bind_method(D_METHOD("set_block_buffer", "block_pos", "buffer"), &VoxelMap::_set_block_buffer_binding);
ClassDB::bind_method(D_METHOD("voxel_to_block", "voxel_pos"), &VoxelMap::_voxel_to_block_binding);
ClassDB::bind_method(D_METHOD("block_to_voxel", "block_pos"), &VoxelMap::_block_to_voxel_binding);
ClassDB::bind_method(D_METHOD("get_block_size"), &VoxelMap::get_block_size);

View File

@ -347,9 +347,9 @@ Ref<ArrayMesh> VoxelMesher::build(const VoxelBuffer & buffer, unsigned int chann
// Index mesh to reduce memory usage and make upload to VRAM faster
// TODO actually, we could make it indexed from the ground up without using SurfaceTool, so we also save time!
//VOXEL_PROFILE_BEGIN("mesher_surfacetool_index")
//st.index();
//VOXEL_PROFILE_END("mesher_surfacetool_index")
// VOXEL_PROFILE_BEGIN("mesher_surfacetool_index")
// st.index();
// VOXEL_PROFILE_END("mesher_surfacetool_index")
VOXEL_PROFILE_BEGIN("mesher_surfacetool_commit")
mesh_ref = st.commit(mesh_ref);
@ -365,10 +365,10 @@ Ref<ArrayMesh> VoxelMesher::build(const VoxelBuffer & buffer, unsigned int chann
void VoxelMesher::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_material", "material", "id"), &VoxelMesher::set_material);
ClassDB::bind_method(D_METHOD("get_material:Material", "id"), &VoxelMesher::get_material);
ClassDB::bind_method(D_METHOD("get_material", "id"), &VoxelMesher::get_material);
ClassDB::bind_method(D_METHOD("set_library", "voxel_library:VoxelLibrary"), &VoxelMesher::set_library);
ClassDB::bind_method(D_METHOD("get_library:VoxelLibrary"), &VoxelMesher::get_library);
ClassDB::bind_method(D_METHOD("set_library", "voxel_library"), &VoxelMesher::set_library);
ClassDB::bind_method(D_METHOD("get_library"), &VoxelMesher::get_library);
ClassDB::bind_method(D_METHOD("set_occlusion_enabled", "enable"), &VoxelMesher::set_occlusion_enabled);
ClassDB::bind_method(D_METHOD("get_occlusion_enabled"), &VoxelMesher::get_occlusion_enabled);
@ -376,7 +376,7 @@ void VoxelMesher::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_occlusion_darkness", "value"), &VoxelMesher::set_occlusion_darkness);
ClassDB::bind_method(D_METHOD("get_occlusion_darkness"), &VoxelMesher::get_occlusion_darkness);
ClassDB::bind_method(D_METHOD("build:Mesh", "voxel_buffer:VoxelBuffer", "channel", "existing_mesh:Mesh"), &VoxelMesher::build_ref);
ClassDB::bind_method(D_METHOD("build", "voxel_buffer", "channel", "existing_mesh"), &VoxelMesher::build_ref);
#ifdef VOXEL_PROFILING
ClassDB::bind_method(D_METHOD("get_profiling_info"), &VoxelMesher::get_profiling_info);

View File

@ -393,9 +393,7 @@ void VoxelMesherSmooth::emit_vertex(Vector3 primary, Vector3 normal) {
void VoxelMesherSmooth::_bind_methods() {
ClassDB::bind_method(
D_METHOD("build:Mesh", "voxels:VoxelBuffer", "channel", "existing_mesh:Mesh"),
&VoxelMesherSmooth::build_ref, DEFVAL(Variant()));
ClassDB::bind_method(D_METHOD("build", "voxels", "channel", "existing_mesh"), &VoxelMesherSmooth::build_ref, DEFVAL(Variant()));
}

View File

@ -38,8 +38,8 @@ void VoxelProvider::_immerge_block(Ref<VoxelBuffer> buffer, Vector3 block_pos) {
void VoxelProvider::_bind_methods() {
ClassDB::bind_method(D_METHOD("emerge_block", "out_buffer:VoxelBuffer", "block_pos:Vector3"), &VoxelProvider::_emerge_block);
ClassDB::bind_method(D_METHOD("immerge_block", "buffer:VoxelBuffer", "block_pos:Vector3"), &VoxelProvider::_immerge_block);
ClassDB::bind_method(D_METHOD("emerge_block", "out_buffer", "block_pos"), &VoxelProvider::_emerge_block);
ClassDB::bind_method(D_METHOD("immerge_block", "buffer", "block_pos"), &VoxelProvider::_immerge_block);
}

View File

@ -478,11 +478,11 @@ Variant VoxelTerrain::_raycast_binding(Vector3 origin, Vector3 direction, real_t
void VoxelTerrain::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_provider", "provider:VoxelProvider"), &VoxelTerrain::set_provider);
ClassDB::bind_method(D_METHOD("get_provider:VoxelProvider"), &VoxelTerrain::get_provider);
ClassDB::bind_method(D_METHOD("set_provider", "provider"), &VoxelTerrain::set_provider);
ClassDB::bind_method(D_METHOD("get_provider"), &VoxelTerrain::get_provider);
ClassDB::bind_method(D_METHOD("get_block_update_count"), &VoxelTerrain::get_block_update_count);
ClassDB::bind_method(D_METHOD("get_mesher:VoxelMesher"), &VoxelTerrain::get_mesher);
ClassDB::bind_method(D_METHOD("get_mesher"), &VoxelTerrain::get_mesher);
ClassDB::bind_method(D_METHOD("get_generate_collisions"), &VoxelTerrain::get_generate_collisions);
ClassDB::bind_method(D_METHOD("set_generate_collisions", "enabled"), &VoxelTerrain::set_generate_collisions);
@ -490,7 +490,7 @@ void VoxelTerrain::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_viewer"), &VoxelTerrain::get_viewer_path);
ClassDB::bind_method(D_METHOD("set_viewer", "path"), &VoxelTerrain::set_viewer_path);
ClassDB::bind_method(D_METHOD("get_storage:VoxelMap"), &VoxelTerrain::get_map);
ClassDB::bind_method(D_METHOD("get_storage"), &VoxelTerrain::get_map);
// TODO Make those two static in VoxelMap?
ClassDB::bind_method(D_METHOD("voxel_to_block", "voxel_pos"), &VoxelTerrain::_voxel_to_block_binding);
@ -500,7 +500,7 @@ void VoxelTerrain::_bind_methods() {
ClassDB::bind_method(D_METHOD("make_blocks_dirty", "min", "size"), &VoxelTerrain::_make_blocks_dirty_binding);
ClassDB::bind_method(D_METHOD("make_voxel_dirty", "pos"), &VoxelTerrain::_make_voxel_dirty_binding);
ClassDB::bind_method(D_METHOD("raycast:Dictionary", "origin", "direction", "max_distance"), &VoxelTerrain::_raycast_binding, DEFVAL(100));
ClassDB::bind_method(D_METHOD("raycast", "origin", "direction", "max_distance"), &VoxelTerrain::_raycast_binding, DEFVAL(100));
#ifdef VOXEL_PROFILING
ClassDB::bind_method(D_METHOD("get_profiling_info"), &VoxelTerrain::get_profiling_info);