fix(editor): update message preview bitmap depth to 8-bit indexed format
- Changed the bitmap depth for message previews from 64 to 8 to support indexed palette mode. - Updated logging to reflect the new depth in message preview creation. - Enhanced Bitmap class with a new method to update surface pixels, ensuring proper pixel data handling in rendering. Benefits: - Improves compatibility with indexed palette formats in message rendering. - Enhances the clarity of logging for bitmap creation processes.
This commit is contained in:
@@ -419,14 +419,14 @@ void MessageEditor::DrawMessagePreview() {
|
||||
LOG_DEBUG("MessageEditor", "Updated message preview bitmap (size: %zu) and queued texture update",
|
||||
message_preview_.current_preview_data_.size());
|
||||
} else {
|
||||
// Create bitmap and queue texture creation
|
||||
// Create bitmap and queue texture creation with 8-bit indexed depth
|
||||
current_font_gfx16_bitmap_.Create(kCurrentMessageWidth, kCurrentMessageHeight,
|
||||
64, message_preview_.current_preview_data_);
|
||||
8, message_preview_.current_preview_data_);
|
||||
current_font_gfx16_bitmap_.SetPalette(font_preview_colors_);
|
||||
gfx::Arena::Get().QueueTextureCommand(
|
||||
gfx::Arena::TextureCommandType::CREATE, ¤t_font_gfx16_bitmap_);
|
||||
|
||||
LOG_INFO("MessageEditor", "Created message preview bitmap (%dx%d) and queued texture creation",
|
||||
LOG_INFO("MessageEditor", "Created message preview bitmap (%dx%d) with 8-bit depth and queued texture creation",
|
||||
kCurrentMessageWidth, kCurrentMessageHeight);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ constexpr int kGfxFont = 0x70000; // 2bpp format
|
||||
constexpr int kCharactersWidth = 0x74ADF;
|
||||
constexpr int kNumMessages = 396;
|
||||
constexpr int kFontGfxMessageSize = 128;
|
||||
constexpr int kFontGfxMessageDepth = 64;
|
||||
constexpr int kFontGfxMessageDepth = 8; // Fixed: Must be 8 for indexed palette mode
|
||||
constexpr int kFontGfx16Size = 172 * 4096;
|
||||
|
||||
constexpr uint8_t kBlockTerminator = 0x80;
|
||||
|
||||
Reference in New Issue
Block a user