1#ifndef YAZE_APP_EDITOR_GRAPHICS_GFX_GROUP_EDITOR_INTERNAL_H_
2#define YAZE_APP_EDITOR_GRAPHICS_GFX_GROUP_EDITOR_INTERNAL_H_
33 if (sheet.
surface() ==
nullptr) {
39 if (sheet.
texture() ==
nullptr) {
63 if (binding.palette_group_name.empty())
66 palette_groups.
get_group(std::string(binding.palette_group_name));
67 if (group ==
nullptr || group->size() == 0)
70 binding.default_sub_index < group->
size() ? binding.default_sub_index : 0;
71 const auto* palette = group->mutable_palette(index);
72 return palette && !palette->empty() ? palette :
nullptr;
90 const bool pixels_changed =
94 const bool palette_changed = !(preview.
palette() == palette);
99 if (pixels_changed || palette_changed)
102 if (preview.
texture() && (pixels_changed || palette_changed)) {
void QueueTextureCommand(TextureCommandType type, Bitmap *bitmap)
Represents a bitmap image optimized for SNES ROM hacking.
const SnesPalette & palette() const
void Create(int width, int height, int depth, std::span< uint8_t > data)
Create a bitmap with the given dimensions and data.
TextureHandle texture() const
const std::vector< uint8_t > & vector() const
BitmapMetadata & metadata()
void set_active(bool active)
void SetPalette(const SnesPalette &palette)
Set the palette for the bitmap using SNES palette format.
SDL_Surface * surface() const
void UpdateTexture()
Updates the underlying SDL_Texture when it already exists.
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
void EnsureSheetTextureQueued(gfx::Bitmap &sheet)
const gfx::SnesPalette * ResolveRoleDefaultPalette(gfx::SheetRole role, gfx::PaletteGroupMap &palette_groups)
void SyncSheetPreview(const gfx::Bitmap &source, const gfx::SnesPalette &palette, gfx::Bitmap &preview)
bool ApplyRoleDefaultPalette(gfx::Bitmap &sheet, gfx::SheetRole role, gfx::PaletteGroupMap &palette_groups)
SheetRolePaletteBinding DefaultBindingFor(SheetRole role)
Represents a mapping of palette groups.
PaletteGroup * get_group(const std::string &group_name)