Removed build_deferred, and build_prioritized methods from the default chunk.

This commit is contained in:
Relintai 2020-04-17 20:24:50 +02:00
parent bee499d951
commit 2d5b9ed029
2 changed files with 16 additions and 44 deletions

View File

@ -193,44 +193,6 @@ void VoxelChunkDefault::generate_ao() {
}
}
void VoxelChunkDefault::build_deferred() {
if (_current_build_phase == BUILD_PHASE_DONE) {
_build_prioritized = true;
wait_and_finish_thread();
set_process(true);
_is_generating = true;
next_phase();
if (!_voxel_world->can_chunk_do_build_step())
return;
build_step();
}
}
void VoxelChunkDefault::build_prioritized() {
if (_current_build_phase == BUILD_PHASE_DONE) {
_build_prioritized = true;
wait_and_finish_thread();
set_process(true);
_is_generating = true;
next_phase();
if (!_voxel_world->can_chunk_do_build_step())
return;
build_step();
}
}
void VoxelChunkDefault::build_step() {
ERR_FAIL_COND(!has_next_phase());
ERR_FAIL_COND(_build_step_in_progress);
@ -1372,7 +1334,22 @@ void VoxelChunkDefault::_create_meshers() {
}
void VoxelChunkDefault::_build(bool immediate) {
build_deferred();
if (_current_build_phase == BUILD_PHASE_DONE) {
_build_prioritized = true;
wait_and_finish_thread();
set_process(true);
_is_generating = true;
next_phase();
if (!_voxel_world->can_chunk_do_build_step())
return;
build_step();
}
}
void VoxelChunkDefault::wait_and_finish_thread() {
@ -1428,9 +1405,6 @@ void VoxelChunkDefault::_bind_methods() {
BIND_VMETHOD(MethodInfo("_build_phase_process", PropertyInfo(Variant::INT, "phase")));
BIND_VMETHOD(MethodInfo("_build_phase_physics_process", PropertyInfo(Variant::INT, "phase")));
ClassDB::bind_method(D_METHOD("build_deferred"), &VoxelChunkDefault::build_deferred);
ClassDB::bind_method(D_METHOD("build_prioritized"), &VoxelChunkDefault::build_prioritized);
ClassDB::bind_method(D_METHOD("build_phase"), &VoxelChunkDefault::build_phase);
ClassDB::bind_method(D_METHOD("build_phase_process"), &VoxelChunkDefault::build_phase_process);
ClassDB::bind_method(D_METHOD("build_phase_physics_process"), &VoxelChunkDefault::build_phase_physics_process);

View File

@ -170,8 +170,6 @@ public:
void generate_ao();
//Meshing
void build_deferred();
void build_prioritized();
static void _build_step_threaded(void *_userdata);
void build_step();