frillrun/src/game/ecs/component/visual/component_atlas.h
2024-08-24 00:47:58 -04:00

33 lines
663 B
C

#pragma once
#include "component_texture_quad.h"
typedef struct ComponentAtlas
{
Component component;
ivec2 frameSize;
ivec2 size;
u32 index;
} ComponentAtlas;
void component_atlas_init(ComponentAtlas* self, ECS* ecs, const ivec2 frameSize, const ivec2 size, u32 index);
void component_atlas_tick(ComponentAtlas* self, ECS* ecs);
void component_atlas_uv_get(ComponentAtlas* self, Texture* texture, vec2 uvMin, vec2 uvMax);
static const ComponentInfo COMPONENT_ATLAS_INFO =
{
.system =
{
.functions =
{
NULL,
NULL,
(ECSFunction)component_atlas_tick,
NULL,
NULL,
}
},
.type = COMPONENT_ATLAS,
.size = sizeof(ComponentAtlas)
};