#include "entity_sprite.h"

/* Initializes a sprite entity. */
void
entity_sprite_init(ECS* ecs, u32 id, Texture texture, vec2 size, vec3 position)
{
	ComponentSprite* sprite;
	
	sprite = ecs_component_add(ecs, ECS_COMPONENT_SPRITE, id);

	component_sprite_init
	(
		sprite,
		texture,
		size,
		position
	);
}

/* Initializes a sprite entity with an atlas. */
void
entity_sprite_atlas_init(ECS* ecs, u32 id, Texture texture, ivec2 frameSize, ivec2 atlasSize, vec2 size, vec3 position)
{
	ComponentSprite* sprite;
	
	sprite = ecs_component_add(ecs, ECS_COMPONENT_SPRITE, id);

	component_sprite_atlas_init
	(
		sprite,
		texture,
		frameSize,
		atlasSize,
		size,
		position
	);
}
