#ifndef SPRITE_H
#define SPRITE_H

#include "HandmadeMath.h"
#include "cell.h"

struct sprite{
  HMM_Vec2 pos; // x,y coordinates of the sprite
  HMM_Vec2 center;
  HMM_Vec2 skew;
  HMM_Vec2 scale;
  float rotation;
  HMM_Mat2 affine;
  JSValue image; // the JS image
  int layer; // layer this sprite draws onto
  HMM_Vec4 color; // color in 0-1f
};

typedef struct sprite sprite;

sprite *make_sprite(void);
void sprite_free(JSRuntime *rt, sprite *sprite);
void sprite_apply(sprite *sprite);

#endif
