Refactor graphics loading and decompression for consistency

- Updated various graphics loading functions to ensure consistent use of semicolons in ASSIGN_OR_RETURN statements.
- Changed set_filename method in Rom class to accept std::string_view for improved efficiency.
- Enhanced code readability and maintainability across multiple files by standardizing syntax.
This commit is contained in:
scawful
2025-05-19 17:15:15 -04:00
parent 30f0ae37a3
commit 095b3df27e
7 changed files with 17 additions and 16 deletions

View File

@@ -80,7 +80,7 @@ absl::Status DungeonEditor::Load() {
// Load the palette group and palette for the dungeon
full_palette_ = dungeon_man_pal_group[current_palette_group_id_];
ASSIGN_OR_RETURN(current_palette_group_,
gfx::CreatePaletteGroupFromLargePalette(full_palette_))
gfx::CreatePaletteGroupFromLargePalette(full_palette_));
CalculateUsageStats();
is_loaded_ = true;

View File

@@ -756,7 +756,7 @@ absl::Status GraphicsEditor::DrawMemoryEditor() {
absl::Status GraphicsEditor::DecompressImportData(int size) {
ASSIGN_OR_RETURN(import_data_, gfx::lc_lz2::DecompressV2(
temp_rom_.data(), current_offset_, size))
temp_rom_.data(), current_offset_, size));
auto converted_sheet = gfx::SnesTo8bppSheet(import_data_, 3);
bin_bitmap_.Create(gfx::kTilesheetWidth, 0x2000, gfx::kTilesheetDepth,
@@ -785,7 +785,7 @@ absl::Status GraphicsEditor::DecompressSuperDonkey() {
std::stoi(offset, nullptr, 16); // convert hex string to int
ASSIGN_OR_RETURN(
auto decompressed_data,
gfx::lc_lz2::DecompressV2(temp_rom_.data(), offset_value, 0x1000))
gfx::lc_lz2::DecompressV2(temp_rom_.data(), offset_value, 0x1000));
auto converted_sheet = gfx::SnesTo8bppSheet(decompressed_data, 3);
gfx_sheets_[i] = gfx::Bitmap(gfx::kTilesheetWidth, gfx::kTilesheetHeight,
gfx::kTilesheetDepth, converted_sheet);
@@ -810,7 +810,7 @@ absl::Status GraphicsEditor::DecompressSuperDonkey() {
std::stoi(offset, nullptr, 16); // convert hex string to int
ASSIGN_OR_RETURN(
auto decompressed_data,
gfx::lc_lz2::DecompressV2(temp_rom_.data(), offset_value, 0x1000))
gfx::lc_lz2::DecompressV2(temp_rom_.data(), offset_value, 0x1000));
auto converted_sheet = gfx::SnesTo8bppSheet(decompressed_data, 3);
gfx_sheets_[i] = gfx::Bitmap(gfx::kTilesheetWidth, gfx::kTilesheetHeight,
gfx::kTilesheetDepth, converted_sheet);