233 Commits

Author SHA1 Message Date
Marc Gilleron
19f94e9912 Merge branch 'master' into modifiers 2022-06-19 21:41:38 +01:00
Marc Gilleron
c1f3997e54 Missing format 2022-06-19 18:10:59 +01:00
Marc Gilleron
1464286660 Add experimental key caching in VoxelStreamSQlite.
Not enabled by default, will test this in the future because it might
optimize multithreaded query speed in worlds with sparse saves.
2022-06-18 23:28:30 +01:00
Marc Gilleron
86ba74ce3a Some changes and fixes related modifiers
- VoxelLodTerrain no longer caches generated voxels by default, so
  generating on the fly is no longer exclusive to full load mode.
  Might add an option later, but not for now (VoxelTerrain is still
  unaffected and keeps caching them)
- The "Cached" state is represented with blocks having no voxel data,
  so it needs extra checks in some areas to avoid null access
- Fix generate task was not including modifiers after the base generator
- The "save_generator_output" option on streams now means such blocks are
  considered edited
- Modifying modifiers now clears cached generated blocks
  intersecting with them.
- Fix "re-generate" was erasing the internal stack of modifiers
- Added docs
2022-06-18 23:14:18 +01:00
Marc Gilleron
58185147e3 Fix unused variables 2022-06-08 20:29:18 +01:00
Marc Gilleron
177d7a99c9 Added basic stack tracking for memory pool allocations 2022-06-06 21:54:20 +01:00
Ryan Roden-Corrent
26dbd13f3a
Avoid unused variable warning.
gcc warns:

```
modules/voxel/streams/region/region_file.cpp: In function 'bool save_header(FileAccess*, uint8_t, const VoxelRegionFormat&, const std::vector<VoxelRegionBlockInfo>&)':
832
modules/voxel/streams/region/region_file.cpp:101:9: error: unused variable 'blocks_begin_offset' [-Werror=unused-variable]
833
  101 |  size_t blocks_begin_offset = f->get_position();

	const size_t blocks_begin_offset = f.get_position();
```

I noticed this while trying to build export templates using github
actions, as the godot actions treat warnings as errors by default:

https://github.com/rcorre/godot/runs/6617207436
2022-05-26 18:29:44 -04:00
Marc Gilleron
09d0be21e2 Remove remaining usages of HashMap 2022-05-14 19:38:39 +01:00
Marc Gilleron
ae8a6c041f Merge branch 'master' of https://github.com/Zylann/godot_voxel 2022-05-07 22:06:54 +01:00
Marc Gilleron
a5e429de6f Moved some Vector3i function specializations to math:: namespace 2022-04-29 23:25:37 +01:00
Raphaël Duchaîne
f188e1f191 Replace size_t read_size with uint64_t instead 2022-04-27 11:07:27 -04:00
Marc Gilleron
ac73904df7 Fix wrong version when saving blocks 2022-04-22 22:20:48 +01:00
Marc Gilleron
f60c506e75 CompressedData doesn't depend on Godot 2022-04-19 01:04:53 +01:00
Marc Gilleron
5965bcf98f FileLocker doesn't depend on Godot 2022-04-19 00:58:29 +01:00
Marc Gilleron
4e3d4d4ed8 Threading classes wrappers 2022-04-19 00:32:37 +01:00
Marc Gilleron
f48ebe8557 Moved StreamPeer stuff to Godot-specific wrapper 2022-04-18 20:40:25 +01:00
Marc Gilleron
d7e0af161a Abstracted voxel metadata so internals no longer depends on Variant 2022-04-18 19:59:38 +01:00
Marc Gilleron
8aec9cf777 VoxelBufferInternal doesnt depend on Image 2022-04-16 16:07:45 +01:00
Marc Gilleron
f3be787f69 Remove usage of FileAccessMemory 2022-04-16 02:27:18 +01:00
Marc Gilleron
75d8343700 Fix ambiguous assignment 2022-04-16 00:39:13 +01:00
Marc Gilleron
87f3aeb5e2 Fix missing header for GCC (3) 2022-04-16 00:15:50 +01:00
Marc Gilleron
f50024fd10 Fix missing header for GCC 2022-04-16 00:07:23 +01:00
Marc Gilleron
a5c3f8b824 Fix code to work with Godot's new FileAccess RefCounted object 2022-04-15 23:13:31 +01:00
Marc Gilleron
87d98e9162 Engine-agnostic error macros 2022-04-11 02:10:44 +01:00
Marc Gilleron
0cc3801655 Define smart pointers default allocator in a single place 2022-04-10 20:10:33 +01:00
Marc Gilleron
219c7bfda3 Changed prefix of profiling macros 2022-04-09 15:33:08 +01:00
Marc Gilleron
ab5d3a22d3 Abstract logging for verbose print 2022-04-09 15:00:34 +01:00
Marc Gilleron
5519054c01 Unify macro prefixes 2022-04-06 23:26:54 +01:00
Marc Gilleron
090d3485e5 Use unique pointers in ExpressionParser 2022-04-06 22:00:32 +01:00
Marc Gilleron
83dfd271a6 Fixed inverted variables in debug message 2022-03-30 23:17:48 +01:00
Marc Gilleron
2c99dd9d85 Merge branch 'master' of https://github.com/Zylann/godot_voxel 2022-03-06 01:11:48 +00:00
Nona
eaac42cfb1 Included header file for the Dynamic memory management lib to define unique_ptr and shared_ptr. 2022-03-02 12:16:27 -05:00
Marc Gilleron
55deafd0ec Removed pedantic assertion.
It can happen if the file contains just one block, and if it gets
written over a second time with data spanning more sectors.
2022-02-28 22:17:10 +00:00
Marc Gilleron
0fd25ce52a Added missing position checks to RegionFile 2022-02-28 22:15:59 +00:00
Marc Gilleron
a8f5c4f0b9 Fix unused variables 2022-02-27 17:01:10 +00:00
Marc Gilleron
4e8f9bf2e9 Fix missing return value 2022-02-27 01:58:58 +00:00
Marc Gilleron
a75de1eee2 Instances are now serialized with little-endian 2022-02-26 23:05:55 +00:00
Marc Gilleron
d9c2d227ac Don't use sizeof(int) for portability 2022-02-26 22:53:19 +00:00
Marc Gilleron
008f6d83a1 Compressed data now uses a little-endian header instead of big endian 2022-02-26 22:52:31 +00:00
Marc Gilleron
493b93a051 SDF is now encoded with inorm8 and inorm16 2022-02-26 22:51:29 +00:00
Marc Gilleron
0137ca3036 Namespaced VoxelBuffer in gd:: because it is actually a wrapper 2022-02-15 21:49:20 +00:00
Marc Gilleron
36e8ddc79f Fix missing include 2022-02-13 18:18:51 +00:00
Marc Gilleron
92474f8322 Use a FlatMap instead of Godot's Map to store voxel metadata.
Reasons:
- when switching to GDExtension, Map won't be available anymore
- FlatMap may be more efficient for small amounts of sparse items
2022-02-13 16:19:17 +00:00
Marc Gilleron
4c36b96ef2 Moved Godot-facing block serializer API to its own file 2022-02-12 23:52:44 +00:00
Marc Gilleron
b3faec2bef Removed voxel_block_request.h, use specialized structs 2022-02-12 23:37:02 +00:00
Marc Gilleron
98eed9adba Remove some usages of Vector<T>. Also fixed some indexing issues in streams.
Reason: in a future port to GDExtension, that class won't be available.
This may also apply to Map and HashMap.

Note: the issues in streams were not hit so far because they are in
multi-block load/save functions. We've been loading and saving blocks
one by one at the moment.
2022-02-06 21:26:48 +00:00
Marc Gilleron
f1694b08ec Remove a few unnecessary usages of the wrapper version of VoxelBuffer 2022-02-03 00:02:10 +00:00
Marc Gilleron
b7e56c6bec Moved other tasks out of VoxelServer 2022-02-02 21:03:09 +00:00
Marc Gilleron
8031800785 Fix VoxelStreamScript not retrieving voxel data 2022-01-16 15:28:10 +00:00
Marc Gilleron
f838adf26a Renamed emerge/imerge_block => load_voxel_block/save_voxel_block 2022-01-16 04:21:02 +00:00