[nostalgia/core] Add basic color selection and basic tilesheet editing

This commit is contained in:
2019-12-01 00:52:00 -06:00
parent 2e5263764c
commit e407ad7246
9 changed files with 171 additions and 26 deletions
+26
View File
@@ -149,6 +149,32 @@ Color32 toColor32(Color16 nc) {
return a | (b << 8) | (g << 16) | (r << 24);
}
uint8_t red32(Color32 c) {
return (c & 0x000000ff) >> 0;
}
uint8_t green32(Color32 c) {
return (c & 0x0000ff00) >> 8;
}
uint8_t blue32(Color32 c) {
return (c & 0x00ff0000) >> 16;
}
uint8_t red32(Color16 c) {
return ((c & 0b0000000000011111) >> 0) * 8;
}
uint8_t green32(Color16 c) {
return ((c & 0b0000001111100000) >> 5) * 8;
}
uint8_t blue32(Color16 c) {
return ((c & 0b0111110000000000) >> 10) * 8;
}
void puts(Context *ctx, int column, int row, const char *str) {
for (int i = 0; str[i]; i++) {
setTile(ctx, 0, column + i, row, charMap[static_cast<int>(str[i])]);