#pragma once
#include "../../../../internal-include/GPU/gpu_internal.hpp"
#include <PSX/File/file_processor_helper.hpp>
#include <PSX/GPU/gpu_types.hpp>

namespace JabyEngine {
    namespace TIMFileProcessor {
        using namespace FileProcessor;
        using namespace GPU;

        struct GenericTIM {
            AreaU16 clut_area;
            AreaU16 tex_area;
            size_t  words_left; //32bit values

            bool has_clut() const {
                return this->clut_area.size.width > 0;
            }

            virtual Progress parse_header(State::CDDataProcessor& data_proc)     = 0;
            virtual Progress pre_data_parsing(State::CDDataProcessor& data_proc) = 0;
        };

        Progress parse_header(State::CDDataProcessor& data_proc, GenericTIM& generic_tim);
    }
}