//
// Created by sebastian on 30.07.26.
//

#ifndef COLORRACE_RAWASSETDATA_H
#define COLORRACE_RAWASSETDATA_H
#pragma once

#include "AssetTypes.h"

#include <string>
#include <vector>
#include <unordered_map>
#include <variant>

namespace engine {



    struct RawTextureData
    {
        std::string name;

        std::vector<unsigned char> pixels;

        int width;
        int height;
        int channels;
    };


    struct RawMaterialData
    {
        std::string name;

        std::unordered_map<TextureType, std::string> texturePaths;

        float shininess;
        float opacity;
    };


    struct RawMeshSection
    {
        std::vector<float> vertices;
        std::vector<float> normals;
        std::vector<float> textureCoords;

        std::vector<int> indices;

        std::string materialName;
        std::string name;
    };


    struct RawObjectData
    {
        std::string name;

        std::vector<RawMeshSection> subModels;
    };


    struct RawModelData
    {
        std::string name;

        std::vector<RawObjectData> objects;

        ModelSplitPolicy splitPolicy;
    };

    struct RawModelBundle {
        RawModelData model;
        std::vector<RawMaterialData> materials;
        std::vector<RawTextureData> textures;
    };

    struct RawSoundData {
        std::string name;
        std::vector<std::byte> pcmData;
        int channels;
        int sampleRate;
        int bitsPerSample;
    };


    using IntermediateAsset =
        std::variant<
            RawTextureData,
            RawModelBundle,
            RawSoundData
        >;


}
#endif //COLORRACE_RAWASSETDATA_H
