#include "entity_icon.h"

/* Initializes an icon entity. */
void
entity_icon_init(ECS* ecs, u32 id, vec3 position, vec2 size, IconType index)
{
	ComponentSprite* sprite;

	sprite = ecs_component_add(ecs, ECS_COMPONENT_SPRITE, id);

	component_sprite_atlas_init
	(
		sprite,
		ecs->game->resources.textures[TEXTURE_ICONS],
		(s32*)ICON_FRAME_SIZE,
		(s32*)ICON_ATLAS_SIZE,
		size,
		position
	);

	sprite->atlas.index = index;
}
