#ifndef TEXTURE_VOXELIZER_HPP_
#define TEXTURE_VOXELIZER_HPP_

#include <array>
#include <string>
#include <vector>
#include <Bitmap/Bitmap.hpp>
#include <BlockSprite/BlockSprite.hpp>
#include <BoundingBox/BoundingBox.hpp>

/**
 * @brief Reads PNGs of side textures and places boxes inside a block sprite.
 */
class TextureVoxelizer
{
private:
    struct Texture
    {
        Bitmap colorMap;
        std::optional<Bitmap> lightMap;
        std::optional<Bitmap> biasMap;
        std::optional<Bitmap> specularMap;
        std::optional<Bitmap> refractMap;

        Texture(const std::string &name);
    };

    std::array<Texture, 6> sideTextures;

    void makeVoxel(BlockSprite &sprite, size_t frameNum, glm::ivec3 offset, Texture &tex, glm::uvec2 texPos);

public:
    TextureVoxelizer(std::array<std::string, 6> sideTextureNames);

    void makeBox(BlockSprite &sprite, BoundingBox<int> box);
};

#endif