Add BPP format management and optimization features

- Introduced BPPFormatManager for handling various bitmap formats (2BPP, 3BPP, 4BPP, 8BPP) with conversion capabilities.
- Enhanced AtlasRenderer to support bitmap addition with BPP format optimization and added methods for optimized rendering.
- Implemented GraphicsOptimizer for analyzing and optimizing graphics sheets based on BPP formats, including memory and performance considerations.
- Developed BppFormatUI for user interface interactions related to BPP format selection and conversion previews.
- Integrated BPP format management into the canvas system, allowing for format selection and conversion within the GUI.
- Updated CMake configuration to include new source files related to BPP management and optimization.
This commit is contained in:
scawful
2025-09-29 21:21:49 -04:00
parent 100fc23a2e
commit 9e0f614ce8
12 changed files with 2469 additions and 5 deletions

View File

@@ -13,6 +13,8 @@
#include "app/rom.h"
#include "app/gui/canvas_utils.h"
#include "app/gui/enhanced_palette_editor.h"
#include "app/gfx/bpp_format_manager.h"
#include "app/gui/bpp_format_ui.h"
#include "imgui/imgui.h"
namespace yaze {
@@ -118,6 +120,11 @@ class Canvas {
std::vector<ContextMenuItem> subitems;
};
// BPP format UI components
std::unique_ptr<gui::BppFormatUI> bpp_format_ui_;
std::unique_ptr<gui::BppConversionDialog> bpp_conversion_dialog_;
std::unique_ptr<gui::BppComparisonTool> bpp_comparison_tool_;
void AddContextMenuItem(const ContextMenuItem& item);
void ClearContextMenuItems();
void SetContextMenuEnabled(bool enabled) { context_menu_enabled_ = enabled; }
@@ -140,6 +147,13 @@ class Canvas {
void ShowColorAnalysis();
bool ApplyROMPalette(int group_index, int palette_index);
// BPP format management
void ShowBppFormatSelector();
void ShowBppAnalysis();
void ShowBppConversionDialog();
bool ConvertBitmapFormat(gfx::BppFormat target_format);
gfx::BppFormat GetCurrentBppFormat() const;
// Initialization and cleanup
void InitializeDefaults();
void Cleanup();