engine-psx/include/chara.h

42 lines
795 B
C
Raw Normal View History

2024-07-15 03:37:57 -03:00
#ifndef CHARA_H
#define CHARA_H
#include <psxgpu.h>
typedef struct {
2024-07-15 17:53:40 -03:00
uint8_t x;
uint8_t y;
uint8_t cols;
uint8_t rows;
2024-07-16 18:25:18 -03:00
uint16_t width;
uint16_t height;
2024-07-15 17:53:40 -03:00
uint16_t *tiles;
2024-07-15 03:37:57 -03:00
} CharaFrame;
typedef struct {
char name[16];
2024-07-15 17:53:40 -03:00
uint8_t start;
uint8_t end;
2024-07-21 19:43:49 -03:00
uint32_t hname;
2024-07-15 03:37:57 -03:00
} CharaAnim;
typedef struct {
2024-07-15 17:53:40 -03:00
uint16_t width;
uint16_t height;
uint16_t numframes;
uint16_t numanims;
2024-07-15 03:37:57 -03:00
CharaFrame *frames;
CharaAnim *anims;
2024-07-15 17:53:40 -03:00
uint16_t crectx, crecty;
uint16_t prectx, precty;
2024-07-15 03:37:57 -03:00
} Chara;
void load_chara(Chara *chara, const char *filename, TIM_IMAGE *tim);
2024-07-21 19:43:49 -03:00
void free_chara(Chara *chara);
2025-01-10 17:06:07 -03:00
void chara_draw_gte(Chara *chara, int16_t framenum,
int16_t vx, int16_t vy,
uint8_t flipx, int32_t angle);
2024-07-16 19:51:29 -03:00
2024-07-15 03:37:57 -03:00
#endif