#pragma once

// ::Packer::Includes::Header::

#include "os.h"

#include "assets.h"

#include <stdio.h>

// ::Packer::Macros::Header::

#define FWrite(buf, size, count, file) ((size) * (fwrite(buf, size, count, file)))
#define FRead(buf, size, count, file) ((size) * (fread(buf, size, count, file)))

// ::Packer::Types::Header::

typedef struct FileMapping
{
	c8  *file_name;
	u32 ix;
} FileMapping;

// ::Packer::Packing::Functions::Header::

void SetArrayLookups();
void InitHeader(FileHeader *header);
i32 WriteHeader(pFile file, FileHeader *header);
void PackFiles(Arena *arena, FileHeader *header);
void MoveToTextureDir(c8 **return_dir);
void MoveToShaderDir(c8 **return_dir);
void MoveToModelDir(c8 **return_dir);

// ::Packer::Tests::Functions::Header::

void TestAssetPack(Arena *arena);
static inline void TestAssetIsCorrect(Arena *arena, c8 *file_name, AssetFile *file_info, pFile file);

// ::Packer::Main::Functions::Header::

int main(int argc, char **argv);
