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

@@ -497,7 +497,11 @@ class ROM : public core::ExperimentFlags {
return core::SnesToPc(snes_addr);
}
gfx::PaletteGroup palette_group(const std::string& group) {
absl::StatusOr<gfx::PaletteGroup> palette_group(const std::string& group) {
if (palette_groups_.find(group) == palette_groups_.end()) {
return absl::InvalidArgumentError(
absl::StrCat("Palette group ", group, " not found"));
}
return palette_groups_[group];
}
auto mutable_palette_group(const std::string& group) {