Add PNG support for clipboard operations

- Implemented conditional compilation for image copy and retrieval functions in clipboard.cc, clipboard.h, and clipboard.mm, enabling PNG support when YAZE_LIB_PNG is defined.
- Updated graphics_editor.cc and overworld_editor.cc to handle PNG data copying to the clipboard, including error handling for cases when PNG support is disabled.
- Enhanced user feedback by providing alternative actions when PNG export is unavailable, improving overall user experience.
This commit is contained in:
scawful
2025-09-25 10:03:54 -04:00
parent d26f58be2f
commit 350d26ceb8
5 changed files with 17 additions and 3 deletions

View File

@@ -121,9 +121,14 @@ void GraphicsEditor::DrawGfxEditToolset() {
TableNextColumn();
if (Button(ICON_MD_CONTENT_COPY)) {
#if YAZE_LIB_PNG == 1
std::vector<uint8_t> png_data =
gfx::Arena::Get().gfx_sheets().at(current_sheet_).GetPngData();
core::CopyImageToClipboard(png_data);
#else
// PNG support disabled - show message or alternative action
status_ = absl::UnimplementedError("PNG export not available in this build");
#endif
}
HOVER_HINT("Copy to Clipboard");