#pragma once

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

#if __linux__
# define _GNU_SOURCE
#elif _WIN32

#endif

#define STG_NO_RENDERER

#define STB_IMAGE_IMPLEMENTATION

#define M3D_IMPLEMENTATION

#define STG_IMPLEMENTATION

#include "stglib.h"

#include "assets.h"

// ::ThirdParty::Include::Header::
#include "stb/stb_image.h"
#include "fastlz/fastlz.h"
#include "m3d/m3d.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);
