2019-11-09 18:36:17 +01:00
|
|
|
#ifndef VOXEL_SURFACE_MERGER_H
|
|
|
|
#define VOXEL_SURFACE_MERGER_H
|
|
|
|
|
|
|
|
#include "voxel_surface.h"
|
|
|
|
|
2019-11-09 21:51:40 +01:00
|
|
|
#include "scene/resources/texture.h"
|
|
|
|
|
|
|
|
#include "../../texture_packer/texture_packer.h"
|
|
|
|
|
2019-11-09 18:36:17 +01:00
|
|
|
class VoxelSurfaceMerger : public VoxelSurface {
|
|
|
|
GDCLASS(VoxelSurfaceMerger, VoxelSurface)
|
|
|
|
|
|
|
|
public:
|
2019-11-09 21:51:40 +01:00
|
|
|
Ref<AtlasTexture> get_region(const VoxelSurfaceSides side);
|
|
|
|
void set_region(const VoxelSurfaceSides side, Ref<AtlasTexture> texture);
|
2019-11-09 18:36:17 +01:00
|
|
|
|
2019-11-09 21:51:40 +01:00
|
|
|
Ref<Texture> get_texture(const VoxelSurfaceSides side);
|
|
|
|
void set_texture(const VoxelSurfaceSides side, Ref<Texture> texture);
|
2019-11-09 18:36:17 +01:00
|
|
|
|
|
|
|
void refresh_rects();
|
|
|
|
|
|
|
|
VoxelSurfaceMerger();
|
|
|
|
~VoxelSurfaceMerger();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
private:
|
2019-11-09 21:51:40 +01:00
|
|
|
Ref<AtlasTexture> _regions[VOXEL_SIDES_COUNT];
|
|
|
|
Ref<Texture> _textures[VOXEL_SIDES_COUNT];
|
2019-11-09 18:36:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|