#include <engine.h>

Assets	LoadAssets(void) {
	Assets assets = { 0 };
	//Font
	assets.fonts.count = 4;
	assets.fonts.font = calloc(4, sizeof(Font));
	assert(assets.fonts.font);
	assets.fonts.font[DENDRITIC_VOLTAGE] = LoadFont("assets/font/Dendritic_Voltage.ttf");
	assets.fonts.font[LAZENBYCOMP_LIQUID] = LoadFont("assets/font/LazenbyCompLiquid.ttf");
	assets.fonts.font[LAZENBYCOMP_SMOOTH] = LoadFont("assets/font/LazenbyCompSmooth.ttf");
	assets.fonts.font[POTRA] = LoadFont("assets/font/Potra.ttf");
	SetTextureFilter(assets.fonts.font[DENDRITIC_VOLTAGE].texture, TEXTURE_FILTER_BILINEAR);
	SetTextureFilter(assets.fonts.font[LAZENBYCOMP_LIQUID].texture, TEXTURE_FILTER_BILINEAR);
	SetTextureFilter(assets.fonts.font[LAZENBYCOMP_SMOOTH].texture, TEXTURE_FILTER_BILINEAR);
	SetTextureFilter(assets.fonts.font[POTRA].texture, TEXTURE_FILTER_BILINEAR);
	//asset.textures.count = 4;
	//asset.textures.textures = calloc(4, sizeof(Font));
	//assert(asset.fonts.font);
	//Textures
	//Models
	//Sound
	//Animation
	TraceLog(LOG_INFO, "Assets Loaded");
	return (assets);
}

void	UnloadAssets(const Assets *assets) {
	for (int i = 0; i < assets->fonts.count; i++) {
		UnloadFont(assets->fonts.font[i]);
	}
	UnloadFont(assets->fonts.font[DENDRITIC_VOLTAGE]);
	UnloadFont(assets->fonts.font[LAZENBYCOMP_LIQUID]);
	UnloadFont(assets->fonts.font[LAZENBYCOMP_SMOOTH]);
	UnloadFont(assets->fonts.font[POTRA]);
	free(assets->fonts.font);
}
