2020-09-12 21:10:05 +01:00
|
|
|
#ifndef VOX_LOADER_H
|
|
|
|
#define VOX_LOADER_H
|
|
|
|
|
2021-12-13 21:38:10 +00:00
|
|
|
#include <core/object/ref_counted.h>
|
2020-09-14 19:33:02 +01:00
|
|
|
|
2022-01-09 22:13:10 +00:00
|
|
|
namespace zylann::voxel {
|
|
|
|
|
2021-07-31 18:48:47 +01:00
|
|
|
class VoxelColorPalette;
|
2020-09-12 21:10:05 +01:00
|
|
|
|
2022-02-15 21:49:20 +00:00
|
|
|
namespace gd {
|
|
|
|
class VoxelBuffer;
|
|
|
|
}
|
|
|
|
|
2020-09-12 21:10:05 +01:00
|
|
|
// Simple loader for MagicaVoxel
|
2021-12-13 21:38:10 +00:00
|
|
|
class VoxelVoxLoader : public RefCounted {
|
|
|
|
GDCLASS(VoxelVoxLoader, RefCounted);
|
2020-09-12 21:10:05 +01:00
|
|
|
|
|
|
|
public:
|
2022-02-15 21:49:20 +00:00
|
|
|
Error load_from_file(String fpath, Ref<gd::VoxelBuffer> p_voxels, Ref<VoxelColorPalette> palette);
|
2020-12-18 21:20:00 +00:00
|
|
|
// TODO Have chunked loading for better memory usage
|
2021-01-28 22:02:49 +00:00
|
|
|
// TODO Saving
|
2020-09-12 21:10:05 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void _bind_methods();
|
|
|
|
};
|
|
|
|
|
2022-01-09 22:13:10 +00:00
|
|
|
} // namespace zylann::voxel
|
|
|
|
|
2020-09-12 21:10:05 +01:00
|
|
|
#endif // VOX_LOADER_H
|