Add error handling to SnesPalette and SnesColor member fns

This commit is contained in:
scawful
2024-04-07 12:07:47 -04:00
parent f28e33b5d0
commit 03a38fc712
19 changed files with 188 additions and 117 deletions

View File

@@ -47,11 +47,11 @@ class Bitmap {
void LoadFromPngData(const std::vector<uint8_t> &png_data, int width,
int height);
void ApplyPalette(const SnesPalette &palette);
void ApplyPaletteWithTransparent(const SnesPalette &palette, int index,
absl::Status ApplyPalette(const SnesPalette &palette);
absl::Status ApplyPaletteWithTransparent(const SnesPalette &palette, int index,
int length = 7);
void ApplyPalette(const std::vector<SDL_Color> &palette);
void ApplyPaletteFromPaletteGroup(const SnesPalette &palette, int palette_id);
absl::Status ApplyPaletteFromPaletteGroup(const SnesPalette &palette, int palette_id);
void WriteToPixel(int position, uchar value) {
if (pixel_data_ == nullptr) {