fix font gfx draw initialize routine
This commit is contained in:
@@ -174,6 +174,7 @@ void MessageEditor::DrawMessageList() {
|
|||||||
TableNextColumn();
|
TableNextColumn();
|
||||||
if (Button(core::UppercaseHexWord(message.ID).c_str())) {
|
if (Button(core::UppercaseHexWord(message.ID).c_str())) {
|
||||||
CurrentMessage = message;
|
CurrentMessage = message;
|
||||||
|
DrawMessagePreview();
|
||||||
}
|
}
|
||||||
TableNextColumn();
|
TableNextColumn();
|
||||||
TextWrapped("%s", ParsedMessages[message.ID].c_str());
|
TextWrapped("%s", ParsedMessages[message.ID].c_str());
|
||||||
@@ -240,15 +241,25 @@ absl::Status MessageEditor::Initialize() {
|
|||||||
width_array[i] = rom()->data()[kCharactersWidth + i];
|
width_array[i] = rom()->data()[kCharactersWidth + i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BuildDictionaryEntries();
|
||||||
|
ReadAllTextData();
|
||||||
|
|
||||||
font_preview_colors_.AddColor(0x7FFF); // White
|
font_preview_colors_.AddColor(0x7FFF); // White
|
||||||
font_preview_colors_.AddColor(0x7C00); // Red
|
font_preview_colors_.AddColor(0x7C00); // Red
|
||||||
font_preview_colors_.AddColor(0x03E0); // Green
|
font_preview_colors_.AddColor(0x03E0); // Green
|
||||||
font_preview_colors_.AddColor(0x001F); // Blue
|
font_preview_colors_.AddColor(0x001F); // Blue
|
||||||
|
|
||||||
RETURN_IF_ERROR(rom()->LoadFontGraphicsData())
|
std::vector<uint8_t> data(0x2000, 0);
|
||||||
font_gfx16_data = rom()->font_gfx_data();
|
for (int i = 0; i < 0x2000; i++) {
|
||||||
|
data[i] = rom()->data()[core::gfx_font + i];
|
||||||
|
}
|
||||||
|
|
||||||
|
font_gfx16_data = gfx::SnesTo8bppSheet(data, 2);
|
||||||
|
|
||||||
// 4bpp
|
// 4bpp
|
||||||
|
// font_gfx_bitmap_.Create(128, 128, 64, gfx::kFormat8bppIndexed,
|
||||||
|
// font_gfx16_data);
|
||||||
|
// rom()->RenderBitmap(&font_gfx_bitmap_);
|
||||||
RETURN_IF_ERROR(rom()->CreateAndRenderBitmap(
|
RETURN_IF_ERROR(rom()->CreateAndRenderBitmap(
|
||||||
128, 128, 8, font_gfx16_data, font_gfx_bitmap_, font_preview_colors_))
|
128, 128, 8, font_gfx16_data, font_gfx_bitmap_, font_preview_colors_))
|
||||||
|
|
||||||
@@ -269,9 +280,6 @@ absl::Status MessageEditor::Initialize() {
|
|||||||
|
|
||||||
*font_gfx_bitmap_.mutable_palette() = color_palette;
|
*font_gfx_bitmap_.mutable_palette() = color_palette;
|
||||||
|
|
||||||
BuildDictionaryEntries();
|
|
||||||
ReadAllTextData();
|
|
||||||
|
|
||||||
for (const auto& message : ListOfTexts) {
|
for (const auto& message : ListOfTexts) {
|
||||||
DisplayedMessages.push_back(message);
|
DisplayedMessages.push_back(message);
|
||||||
}
|
}
|
||||||
@@ -308,6 +316,8 @@ absl::Status MessageEditor::Initialize() {
|
|||||||
ParsedMessages.push_back(parsed_message);
|
ParsedMessages.push_back(parsed_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DrawMessagePreview();
|
||||||
|
|
||||||
return absl::OkStatus();
|
return absl::OkStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user