#ifndef _fencer_spritesheet_h
#define _fencer_spritesheet_h

#include "asset.h"
#include "vmath.h"
#include <SDL2/SDL_render.h>

typedef struct Spritesheet Spritesheet;

extern Spritesheet* spritesheet_load(const char* texture_name, IVector tile_size);
extern Spritesheet* spritesheet_from_texture(SDL_Texture* texture, IVector tile_size);
extern void spritesheet_destroy(Spritesheet* self);

extern SDL_Texture* spritesheet_get_texture(const Spritesheet* self);
extern SDL_Rect spritesheet_get_tile_rect(const Spritesheet* self, size_t index);
extern IVector spritesheet_get_resolution(const Spritesheet* self);
extern size_t spritesheet_get_tile_count(const Spritesheet* self);

extern asset_id spritesheet_get_asset_id(Spritesheet* self);
extern void spritesheet_set_asset_id(Spritesheet* self, asset_id id);

extern void _internal_spritesheet_destroy(Spritesheet* self_void);

impl_Drop_for(Spritesheet,
    _internal_spritesheet_destroy
)

impl_Asset_for(Spritesheet,
    spritesheet_get_asset_id,
    spritesheet_set_asset_id
)

#endif // !_fencer_spritesheet_h
