2019-05-28 00:40:09 +01:00
|
|
|
#include "voxel_stream_file.h"
|
2021-01-16 13:34:45 +00:00
|
|
|
#include "../server/voxel_server.h"
|
2020-08-29 23:20:51 +01:00
|
|
|
#include "../util/profiling.h"
|
2019-08-14 20:34:06 +01:00
|
|
|
#include <core/os/file_access.h>
|
2019-08-18 16:10:40 +01:00
|
|
|
#include <core/os/os.h>
|
2019-08-14 20:34:06 +01:00
|
|
|
|
2021-01-17 17:18:05 +00:00
|
|
|
thread_local VoxelBlockSerializerInternal VoxelStreamFile::_block_serializer;
|
2020-07-26 18:42:17 +01:00
|
|
|
|
2019-08-18 16:10:40 +01:00
|
|
|
FileAccess *VoxelStreamFile::open_file(const String &fpath, int mode_flags, Error *err) {
|
2020-08-29 23:20:51 +01:00
|
|
|
VOXEL_PROFILE_SCOPE();
|
2021-01-16 13:34:45 +00:00
|
|
|
//uint64_t time_before = OS::get_singleton()->get_ticks_usec();
|
2019-08-18 16:10:40 +01:00
|
|
|
FileAccess *f = FileAccess::open(fpath, mode_flags, err);
|
2021-01-16 13:34:45 +00:00
|
|
|
//uint64_t time_spent = OS::get_singleton()->get_ticks_usec() - time_before;
|
|
|
|
//_stats.time_spent_opening_files += time_spent;
|
|
|
|
//++_stats.file_openings;
|
2019-08-18 16:10:40 +01:00
|
|
|
return f;
|
|
|
|
}
|
|
|
|
|
2020-08-14 20:33:09 +01:00
|
|
|
void VoxelStreamFile::_bind_methods() {
|
2019-08-14 20:34:06 +01:00
|
|
|
}
|