2019-12-01 15:32:22 +00:00
|
|
|
typedef enum {
|
2020-01-29 07:57:06 +00:00
|
|
|
PLAYCHAR_REIMU = 0,
|
|
|
|
PLAYCHAR_MIMA = 1,
|
|
|
|
PLAYCHAR_MARISA = 2,
|
|
|
|
PLAYCHAR_ELLEN = 3,
|
|
|
|
PLAYCHAR_KOTOHIME = 4,
|
|
|
|
PLAYCHAR_KANA = 5,
|
|
|
|
PLAYCHAR_RIKAKO = 6,
|
|
|
|
PLAYCHAR_CHIYURI = 7,
|
|
|
|
PLAYCHAR_YUMEMI = 8,
|
|
|
|
PLAYCHAR_COUNT = 9,
|
2021-12-18 15:48:20 +00:00
|
|
|
} playchar_t;
|
2019-12-01 17:13:28 +00:00
|
|
|
|
2021-12-18 15:48:20 +00:00
|
|
|
// Encodes a playchar_t together with its alternate palette flag.
|
2020-02-19 14:53:51 +00:00
|
|
|
struct playchar_paletted_t {
|
|
|
|
unsigned char v;
|
|
|
|
|
|
|
|
int filename_id() const {
|
|
|
|
return (v - 1);
|
|
|
|
}
|
|
|
|
|
2021-12-18 15:48:20 +00:00
|
|
|
playchar_t char_id() const {
|
|
|
|
return static_cast<playchar_t>(filename_id() / 2);
|
2020-02-19 14:53:51 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-12-21 13:14:28 +00:00
|
|
|
// Uses 0 to indicate "no character" and shifts all IDs up by 1.
|
|
|
|
struct playchar_optional_t {
|
|
|
|
unsigned char v;
|
|
|
|
|
|
|
|
playchar_t char_id() const {
|
|
|
|
return static_cast<playchar_t>(v - 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void set_none() {
|
|
|
|
v = 0;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-02-19 14:53:51 +00:00
|
|
|
#define TO_PALETTED(playchar) ((playchar << 1) + 1)
|