Add SelectablePalettePipeline for updating palette

This commit is contained in:
Justin Scofield
2023-08-03 21:09:27 -04:00
parent d2789ff7b6
commit 7d0b09a589
11 changed files with 116 additions and 37 deletions

View File

@@ -214,6 +214,20 @@ SDL_Palette* SNESPalette::GetSDL_Palette() {
PaletteGroup::PaletteGroup(uint8_t mSize) : size_(mSize) {}
PaletteGroup CreatePaletteGroupFromColFile(
std::vector<SNESColor>& palette_rows) {
PaletteGroup toret;
for (int i = 0; i < palette_rows.size(); i += 8) {
SNESPalette palette;
for (int j = 0; j < 8; j++) {
palette.AddColor(palette_rows[i + j]);
}
toret.AddPalette(palette);
}
return toret;
}
} // namespace gfx
} // namespace app
} // namespace yaze