mirror of
https://github.com/Relintai/voxelman.git
synced 2025-02-14 16:40:06 +01:00
Removed build_deferred, and build_prioritized methods from the default chunk.
This commit is contained in:
parent
bee499d951
commit
2d5b9ed029
@ -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() {
|
void VoxelChunkDefault::build_step() {
|
||||||
ERR_FAIL_COND(!has_next_phase());
|
ERR_FAIL_COND(!has_next_phase());
|
||||||
ERR_FAIL_COND(_build_step_in_progress);
|
ERR_FAIL_COND(_build_step_in_progress);
|
||||||
@ -1372,7 +1334,22 @@ void VoxelChunkDefault::_create_meshers() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void VoxelChunkDefault::_build(bool immediate) {
|
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() {
|
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_process", PropertyInfo(Variant::INT, "phase")));
|
||||||
BIND_VMETHOD(MethodInfo("_build_phase_physics_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"), &VoxelChunkDefault::build_phase);
|
||||||
ClassDB::bind_method(D_METHOD("build_phase_process"), &VoxelChunkDefault::build_phase_process);
|
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);
|
ClassDB::bind_method(D_METHOD("build_phase_physics_process"), &VoxelChunkDefault::build_phase_physics_process);
|
||||||
|
@ -170,8 +170,6 @@ public:
|
|||||||
void generate_ao();
|
void generate_ao();
|
||||||
|
|
||||||
//Meshing
|
//Meshing
|
||||||
void build_deferred();
|
|
||||||
void build_prioritized();
|
|
||||||
static void _build_step_threaded(void *_userdata);
|
static void _build_step_threaded(void *_userdata);
|
||||||
|
|
||||||
void build_step();
|
void build_step();
|
||||||
|
Loading…
Reference in New Issue
Block a user