From d7b75fd7f6b4277f0f3c60d321cf75031a2370da Mon Sep 17 00:00:00 2001 From: scawful Date: Thu, 1 Feb 2024 00:13:34 -0500 Subject: [PATCH] annoying housekeeping --- src/app/core/platform/clipboard.cc | 3 +++ src/app/gfx/bitmap.cc | 4 ++-- src/app/gfx/snes_color.h | 14 ++++++-------- src/app/gfx/snes_palette.cc | 2 +- src/app/gfx/snes_palette.h | 2 +- src/app/rom.cc | 6 +++--- src/app/zelda3/overworld_map.cc | 2 +- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/app/core/platform/clipboard.cc b/src/app/core/platform/clipboard.cc index 2c4adaf5..5c22b209 100644 --- a/src/app/core/platform/clipboard.cc +++ b/src/app/core/platform/clipboard.cc @@ -1,5 +1,8 @@ #include "app/core/platform/clipboard.h" +#include +#include + void CopyImageToClipboard(const std::vector& data) {} void GetImageFromClipboard(std::vector& data, int& width, int& height) {} \ No newline at end of file diff --git a/src/app/gfx/bitmap.cc b/src/app/gfx/bitmap.cc index 5c27738e..03252cde 100644 --- a/src/app/gfx/bitmap.cc +++ b/src/app/gfx/bitmap.cc @@ -329,7 +329,7 @@ void Bitmap::ApplyPalette(const SnesPalette &palette) { palette_ = palette; SDL_UnlockSurface(surface_.get()); for (int i = 0; i < palette.size(); ++i) { - if (palette.GetColor(i).IsTransparent()) { + if (palette.GetColor(i).is_transparent()) { surface_->format->palette->colors[i].r = 0; surface_->format->palette->colors[i].g = 0; surface_->format->palette->colors[i].b = 0; @@ -350,7 +350,7 @@ void Bitmap::ApplyPaletteFromPaletteGroup(const SnesPalette &palette, palette_ = palette.sub_palette(start_index, start_index + 8); SDL_UnlockSurface(surface_.get()); for (int i = 0; i < palette_.size(); ++i) { - if (palette_.GetColor(i).IsTransparent()) { + if (palette_.GetColor(i).is_transparent()) { surface_->format->palette->colors[i].r = 0; surface_->format->palette->colors[i].g = 0; surface_->format->palette->colors[i].b = 0; diff --git a/src/app/gfx/snes_color.h b/src/app/gfx/snes_color.h index 9228af7e..a5814889 100644 --- a/src/app/gfx/snes_color.h +++ b/src/app/gfx/snes_color.h @@ -56,10 +56,6 @@ class SnesColor { snes_ = ConvertRGBtoSNES(color); modified = true; } - - snes_color rom_color() const { return rom_color_; } - - uint16_t snes() const { return snes_; } void set_snes(uint16_t val) { snes_ = val; snes_color col = ConvertSNEStoRGB(val); @@ -67,10 +63,12 @@ class SnesColor { modified = true; } - bool IsModified() const { return modified; } - bool IsTransparent() const { return transparent; } - void SetTransparent(bool t) { transparent = t; } - void SetModified(bool m) { modified = m; } + snes_color rom_color() const { return rom_color_; } + uint16_t snes() const { return snes_; } + bool is_modified() const { return modified; } + bool is_transparent() const { return transparent; } + void set_transparent(bool t) { transparent = t; } + void set_modified(bool m) { modified = m; } private: ImVec4 rgb_; diff --git a/src/app/gfx/snes_palette.cc b/src/app/gfx/snes_palette.cc index 91c4332c..4873234a 100644 --- a/src/app/gfx/snes_palette.cc +++ b/src/app/gfx/snes_palette.cc @@ -152,7 +152,7 @@ SnesPalette ReadPaletteFromRom(int offset, int num_colors, const uchar* rom) { new_color.blue = ((color >> 10) & 0x1F) * 8; colors[color_offset].set_snes(ConvertRGBtoSNES(new_color)); if (color_offset == 0) { - colors[color_offset].SetTransparent(true); + colors[color_offset].set_transparent(true); } color_offset++; offset += 2; diff --git a/src/app/gfx/snes_palette.h b/src/app/gfx/snes_palette.h index 84fcd592..359f784d 100644 --- a/src/app/gfx/snes_palette.h +++ b/src/app/gfx/snes_palette.h @@ -104,7 +104,7 @@ class SnesPalette { throw std::out_of_range("SNESPalette: Index out of bounds"); } colors[i].set_rgb(color); - colors[i].SetModified(true); + colors[i].set_modified(true); } SnesPalette sub_palette(int start, int end) const { diff --git a/src/app/rom.cc b/src/app/rom.cc index ddd036a7..3f66ffe9 100644 --- a/src/app/rom.cc +++ b/src/app/rom.cc @@ -483,9 +483,9 @@ void ROM::SavePalette(int index, const std::string& group_name, for (size_t j = 0; j < palette.size(); ++j) { gfx::SnesColor color = palette[j]; // If the color is modified, save the color to the ROM - if (color.IsModified()) { + if (color.is_modified()) { WriteColor(gfx::GetPaletteAddress(group_name, index, j), color); - color.SetModified(false); // Reset the modified flag after saving + color.set_modified(false); // Reset the modified flag after saving } } } @@ -514,7 +514,7 @@ absl::Status ROM::UpdatePaletteColor(const std::string& groupName, if (colorIndex < palette_groups_[groupName][paletteIndex].size()) { // Update the color value in the palette palette_groups_[groupName][paletteIndex][colorIndex] = newColor; - palette_groups_[groupName][paletteIndex][colorIndex].SetModified(true); + palette_groups_[groupName][paletteIndex][colorIndex].set_modified(true); } else { return absl::AbortedError( "Error: Invalid color index in UpdatePaletteColor."); diff --git a/src/app/zelda3/overworld_map.cc b/src/app/zelda3/overworld_map.cc index 0cc2fbf6..c54ee5a5 100644 --- a/src/app/zelda3/overworld_map.cc +++ b/src/app/zelda3/overworld_map.cc @@ -341,7 +341,7 @@ void SetColorsPalette(ROM& rom, int index, gfx::SnesPalette& current, current.Create(new_palette); for (int i = 0; i < 256; i++) { - current[(i / 16) * 16].SetTransparent(true); + current[(i / 16) * 16].set_transparent(true); } } } // namespace palette_internal