godot_voxel/streams/voxel_stream_file.cpp
Marc Gilleron 4ec60074bb Refactor generators and streams
- VoxelGenerator no longer inherit VoxelStream
- VoxelStream is now more focused on files
- Nodes have separate stream and generator properties
- Generators use 2 dedicated threads instead of sharing a single one with streams
- TODO Image.lock() is problematic for multithreading
- TODO Voxel graph can cause RWLock contention if edited while it runs
- TODO Saving generator output no longer works, need to put it back
2021-01-17 17:18:05 +00:00

21 lines
684 B
C++

#include "voxel_stream_file.h"
#include "../server/voxel_server.h"
#include "../util/profiling.h"
#include <core/os/file_access.h>
#include <core/os/os.h>
thread_local VoxelBlockSerializerInternal VoxelStreamFile::_block_serializer;
FileAccess *VoxelStreamFile::open_file(const String &fpath, int mode_flags, Error *err) {
VOXEL_PROFILE_SCOPE();
//uint64_t time_before = OS::get_singleton()->get_ticks_usec();
FileAccess *f = FileAccess::open(fpath, mode_flags, err);
//uint64_t time_spent = OS::get_singleton()->get_ticks_usec() - time_before;
//_stats.time_spent_opening_files += time_spent;
//++_stats.file_openings;
return f;
}
void VoxelStreamFile::_bind_methods() {
}