header include cleanup
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
#include "absl/status/status.h"
|
#include "absl/status/status.h"
|
||||||
#include "absl/strings/match.h"
|
#include "absl/strings/match.h"
|
||||||
#include "app/core/common.h"
|
#include "app/core/common.h"
|
||||||
|
#include "app/core/constants.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
#include "assembly_editor.h"
|
#include "assembly_editor.h"
|
||||||
|
|
||||||
|
#include "ImGuiFileDialog/ImGuiFileDialog.h"
|
||||||
#include "ImGuiColorTextEdit/TextEditor.h"
|
#include "ImGuiColorTextEdit/TextEditor.h"
|
||||||
#include "app/core/platform/file_dialog.h"
|
#include "app/core/platform/file_dialog.h"
|
||||||
#include "app/gui/icons.h"
|
#include "app/gui/icons.h"
|
||||||
#include "app/gui/input.h"
|
|
||||||
#include "core/constants.h"
|
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
#ifndef YAZE_APP_EDITOR_ASSEMBLY_EDITOR_H
|
#ifndef YAZE_APP_EDITOR_ASSEMBLY_EDITOR_H
|
||||||
#define YAZE_APP_EDITOR_ASSEMBLY_EDITOR_H
|
#define YAZE_APP_EDITOR_ASSEMBLY_EDITOR_H
|
||||||
|
|
||||||
#include <fstream>
|
|
||||||
#include <istream>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "ImGuiColorTextEdit/TextEditor.h"
|
#include "ImGuiColorTextEdit/TextEditor.h"
|
||||||
#include "ImGuiFileDialog/ImGuiFileDialog.h"
|
|
||||||
#include "app/core/common.h"
|
#include "app/core/common.h"
|
||||||
#include "app/editor/utils/editor.h"
|
#include "app/editor/utils/editor.h"
|
||||||
#include "app/gui/style.h"
|
#include "app/gui/style.h"
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
#include "editor_manager.h"
|
#include "editor_manager.h"
|
||||||
|
|
||||||
#include "ImGuiColorTextEdit/TextEditor.h"
|
|
||||||
#include "ImGuiFileDialog/ImGuiFileDialog.h"
|
|
||||||
#include "absl/status/status.h"
|
#include "absl/status/status.h"
|
||||||
#include "absl/strings/match.h"
|
#include "absl/strings/match.h"
|
||||||
#include "app/core/constants.h"
|
#include "app/core/constants.h"
|
||||||
#include "app/core/platform/file_dialog.h"
|
#include "app/core/platform/file_dialog.h"
|
||||||
#include "app/core/platform/renderer.h"
|
|
||||||
#include "app/editor/code/assembly_editor.h"
|
#include "app/editor/code/assembly_editor.h"
|
||||||
#include "app/editor/dungeon/dungeon_editor.h"
|
#include "app/editor/dungeon/dungeon_editor.h"
|
||||||
#include "app/editor/graphics/graphics_editor.h"
|
#include "app/editor/graphics/graphics_editor.h"
|
||||||
@@ -18,20 +15,12 @@
|
|||||||
#include "app/editor/utils/flags.h"
|
#include "app/editor/utils/flags.h"
|
||||||
#include "app/editor/utils/recent_files.h"
|
#include "app/editor/utils/recent_files.h"
|
||||||
#include "app/emu/emulator.h"
|
#include "app/emu/emulator.h"
|
||||||
#include "app/gfx/snes_palette.h"
|
|
||||||
#include "app/gfx/snes_tile.h"
|
|
||||||
#include "app/gui/canvas.h"
|
|
||||||
#include "app/gui/icons.h"
|
#include "app/gui/icons.h"
|
||||||
#include "app/gui/input.h"
|
#include "app/gui/input.h"
|
||||||
#include "app/gui/style.h"
|
#include "app/gui/style.h"
|
||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
#include "incl/extension.h"
|
|
||||||
#include "imgui/backends/imgui_impl_sdl2.h"
|
|
||||||
#include "imgui/backends/imgui_impl_sdlrenderer2.h"
|
|
||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
#include "imgui/misc/cpp/imgui_stdlib.h"
|
#include "imgui/misc/cpp/imgui_stdlib.h"
|
||||||
#include "imgui_internal.h"
|
|
||||||
#include "imgui_memory_editor.h"
|
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
namespace app {
|
namespace app {
|
||||||
|
|||||||
@@ -3,10 +3,7 @@
|
|||||||
|
|
||||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||||
|
|
||||||
#include "ImGuiColorTextEdit/TextEditor.h"
|
|
||||||
#include "ImGuiFileDialog/ImGuiFileDialog.h"
|
|
||||||
#include "absl/status/status.h"
|
#include "absl/status/status.h"
|
||||||
#include "app/core/constants.h"
|
|
||||||
#include "app/core/message.h"
|
#include "app/core/message.h"
|
||||||
#include "app/core/project.h"
|
#include "app/core/project.h"
|
||||||
#include "app/editor/code/assembly_editor.h"
|
#include "app/editor/code/assembly_editor.h"
|
||||||
@@ -22,18 +19,10 @@
|
|||||||
#include "app/editor/system/constant_manager.h"
|
#include "app/editor/system/constant_manager.h"
|
||||||
#include "app/editor/system/extension_manager.h"
|
#include "app/editor/system/extension_manager.h"
|
||||||
#include "app/editor/system/settings_editor.h"
|
#include "app/editor/system/settings_editor.h"
|
||||||
#include "app/editor/utils/gfx_context.h"
|
|
||||||
#include "app/emu/emulator.h"
|
#include "app/emu/emulator.h"
|
||||||
#include "app/gfx/snes_palette.h"
|
|
||||||
#include "app/gfx/snes_tile.h"
|
|
||||||
#include "app/gui/canvas.h"
|
|
||||||
#include "app/gui/icons.h"
|
|
||||||
#include "app/gui/input.h"
|
#include "app/gui/input.h"
|
||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
#include "incl/extension.h"
|
|
||||||
#include "imgui/imgui.h"
|
#include "imgui/imgui.h"
|
||||||
#include "imgui/misc/cpp/imgui_stdlib.h"
|
|
||||||
#include "imgui_memory_editor.h"
|
|
||||||
#include "yaze.h"
|
#include "yaze.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
#ifndef YAZE_APP_EDITOR_MESSAGE_MESSAGE_DATA_H
|
#ifndef YAZE_APP_EDITOR_MESSAGE_MESSAGE_DATA_H
|
||||||
#define YAZE_APP_EDITOR_MESSAGE_MESSAGE_DATA_H
|
#define YAZE_APP_EDITOR_MESSAGE_MESSAGE_DATA_H
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@@ -28,11 +28,9 @@ namespace editor {
|
|||||||
|
|
||||||
using core::Renderer;
|
using core::Renderer;
|
||||||
|
|
||||||
using ImGui::Begin;
|
|
||||||
using ImGui::BeginChild;
|
using ImGui::BeginChild;
|
||||||
using ImGui::BeginTable;
|
using ImGui::BeginTable;
|
||||||
using ImGui::Button;
|
using ImGui::Button;
|
||||||
using ImGui::End;
|
|
||||||
using ImGui::EndChild;
|
using ImGui::EndChild;
|
||||||
using ImGui::EndTable;
|
using ImGui::EndTable;
|
||||||
using ImGui::InputText;
|
using ImGui::InputText;
|
||||||
@@ -41,14 +39,12 @@ using ImGui::SameLine;
|
|||||||
using ImGui::Separator;
|
using ImGui::Separator;
|
||||||
using ImGui::TableHeadersRow;
|
using ImGui::TableHeadersRow;
|
||||||
using ImGui::TableNextColumn;
|
using ImGui::TableNextColumn;
|
||||||
using ImGui::TableNextRow;
|
|
||||||
using ImGui::TableSetupColumn;
|
using ImGui::TableSetupColumn;
|
||||||
using ImGui::Text;
|
using ImGui::Text;
|
||||||
using ImGui::TextWrapped;
|
using ImGui::TextWrapped;
|
||||||
using ImGui::TreeNode;
|
|
||||||
|
|
||||||
absl::Status MessageEditor::Initialize() {
|
absl::Status MessageEditor::Initialize() {
|
||||||
for (int i = 0; i < 100; i++) {
|
for (int i = 0; i < kWidthArraySize; i++) {
|
||||||
width_array[i] = rom()->data()[kCharactersWidth + i];
|
width_array[i] = rom()->data()[kCharactersWidth + i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,15 +66,15 @@ absl::Status MessageEditor::Initialize() {
|
|||||||
RETURN_IF_ERROR(Renderer::GetInstance().CreateAndRenderBitmap(
|
RETURN_IF_ERROR(Renderer::GetInstance().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_))
|
||||||
|
|
||||||
current_font_gfx16_data_.reserve(172 * 4096);
|
current_font_gfx16_data_.reserve(kCurrentMessageWidth * kCurrentMessageHeight);
|
||||||
for (int i = 0; i < 172 * 4096; i++) {
|
for (int i = 0; i < kCurrentMessageWidth * kCurrentMessageHeight; i++) {
|
||||||
current_font_gfx16_data_.push_back(0);
|
current_font_gfx16_data_.push_back(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 8bpp
|
// 8bpp
|
||||||
RETURN_IF_ERROR(Renderer::GetInstance().CreateAndRenderBitmap(
|
RETURN_IF_ERROR(Renderer::GetInstance().CreateAndRenderBitmap(
|
||||||
172, 4096, 64, current_font_gfx16_data_, current_font_gfx16_bitmap_,
|
kCurrentMessageWidth, kCurrentMessageHeight, 64, current_font_gfx16_data_,
|
||||||
font_preview_colors_))
|
current_font_gfx16_bitmap_, font_preview_colors_))
|
||||||
|
|
||||||
gfx::SnesPalette color_palette = font_gfx_bitmap_.palette();
|
gfx::SnesPalette color_palette = font_gfx_bitmap_.palette();
|
||||||
for (int i = 0; i < font_preview_colors_.size(); i++) {
|
for (int i = 0; i < font_preview_colors_.size(); i++) {
|
||||||
|
|||||||
@@ -1,22 +1,15 @@
|
|||||||
#ifndef YAZE_APP_EDITOR_MESSAGE_EDITOR_H
|
#ifndef YAZE_APP_EDITOR_MESSAGE_EDITOR_H
|
||||||
#define YAZE_APP_EDITOR_MESSAGE_EDITOR_H
|
#define YAZE_APP_EDITOR_MESSAGE_EDITOR_H
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <regex>
|
|
||||||
#include <sstream>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "absl/status/status.h"
|
#include "absl/status/status.h"
|
||||||
#include "absl/strings/str_format.h"
|
#include "absl/strings/str_format.h"
|
||||||
#include "absl/strings/str_replace.h"
|
|
||||||
#include "absl/strings/str_split.h"
|
|
||||||
#include "app/editor/message/message_data.h"
|
#include "app/editor/message/message_data.h"
|
||||||
#include "app/editor/utils/editor.h"
|
#include "app/editor/utils/editor.h"
|
||||||
#include "app/gfx/bitmap.h"
|
#include "app/gfx/bitmap.h"
|
||||||
#include "app/gui/canvas.h"
|
#include "app/gui/canvas.h"
|
||||||
#include "app/gui/icons.h"
|
|
||||||
#include "app/rom.h"
|
#include "app/rom.h"
|
||||||
|
|
||||||
namespace yaze {
|
namespace yaze {
|
||||||
@@ -32,9 +25,12 @@ constexpr int kPointersDictionaries = 0x74703;
|
|||||||
constexpr int kCharactersWidth = 0x74ADF;
|
constexpr int kCharactersWidth = 0x74ADF;
|
||||||
constexpr int kNumDictionaryEntries = 97;
|
constexpr int kNumDictionaryEntries = 97;
|
||||||
constexpr int kNumMessages = 396;
|
constexpr int kNumMessages = 396;
|
||||||
|
constexpr int kCurrentMessageWidth = 172;
|
||||||
|
constexpr int kCurrentMessageHeight = 4096;
|
||||||
|
|
||||||
|
constexpr uint8_t kWidthArraySize = 100;
|
||||||
constexpr uint8_t kBlockTerminator = 0x80;
|
constexpr uint8_t kBlockTerminator = 0x80;
|
||||||
constexpr uint8_t BANKID = 0x80;
|
constexpr uint8_t kMessageBankChangeId = 0x80;
|
||||||
constexpr uint8_t kScrollVertical = 0x73;
|
constexpr uint8_t kScrollVertical = 0x73;
|
||||||
constexpr uint8_t kLine1 = 0x74;
|
constexpr uint8_t kLine1 = 0x74;
|
||||||
constexpr uint8_t kLine2 = 0x75;
|
constexpr uint8_t kLine2 = 0x75;
|
||||||
@@ -117,27 +113,26 @@ class MessageEditor : public Editor, public SharedRom {
|
|||||||
int text_position_ = 0;
|
int text_position_ = 0;
|
||||||
int shown_lines_ = 0;
|
int shown_lines_ = 0;
|
||||||
|
|
||||||
uint8_t width_array[100];
|
uint8_t width_array[kWidthArraySize];
|
||||||
|
|
||||||
std::string search_text_ = "";
|
std::string search_text_ = "";
|
||||||
|
|
||||||
std::vector<MessageData> list_of_texts_;
|
std::vector<uint8_t> font_gfx16_data_;
|
||||||
|
std::vector<uint8_t> current_font_gfx16_data_;
|
||||||
std::vector<std::string> parsed_messages_;
|
std::vector<std::string> parsed_messages_;
|
||||||
|
|
||||||
|
std::vector<MessageData> list_of_texts_;
|
||||||
|
|
||||||
MessageData current_message_;
|
MessageData current_message_;
|
||||||
|
|
||||||
std::vector<uint8_t> font_gfx16_data_;
|
|
||||||
std::vector<uint8_t> current_font_gfx16_data_;
|
|
||||||
|
|
||||||
gfx::Bitmap font_gfx_bitmap_;
|
gfx::Bitmap font_gfx_bitmap_;
|
||||||
gfx::Bitmap current_font_gfx16_bitmap_;
|
gfx::Bitmap current_font_gfx16_bitmap_;
|
||||||
|
gfx::SnesPalette font_preview_colors_;
|
||||||
|
|
||||||
gui::Canvas font_gfx_canvas_{"##FontGfxCanvas", ImVec2(128, 128)};
|
gui::Canvas font_gfx_canvas_{"##FontGfxCanvas", ImVec2(128, 128)};
|
||||||
gui::Canvas current_font_gfx16_canvas_{"##CurrentMessageGfx",
|
gui::Canvas current_font_gfx16_canvas_{"##CurrentMessageGfx",
|
||||||
ImVec2(172, 4096)};
|
ImVec2(172, 4096)};
|
||||||
|
|
||||||
gfx::SnesPalette font_preview_colors_;
|
|
||||||
|
|
||||||
struct TextBox {
|
struct TextBox {
|
||||||
std::string text;
|
std::string text;
|
||||||
std::string buffer;
|
std::string buffer;
|
||||||
|
|||||||
@@ -2,11 +2,9 @@
|
|||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "ImGuiFileDialog/ImGuiFileDialog.h"
|
|
||||||
#include "absl/container/flat_hash_map.h"
|
|
||||||
#include "absl/status/status.h"
|
#include "absl/status/status.h"
|
||||||
#include "absl/status/statusor.h"
|
|
||||||
#include "absl/strings/str_format.h"
|
#include "absl/strings/str_format.h"
|
||||||
#include "app/core/constants.h"
|
#include "app/core/constants.h"
|
||||||
#include "app/core/platform/clipboard.h"
|
#include "app/core/platform/clipboard.h"
|
||||||
@@ -15,7 +13,6 @@
|
|||||||
#include "app/editor/overworld/entity.h"
|
#include "app/editor/overworld/entity.h"
|
||||||
#include "app/gfx/bitmap.h"
|
#include "app/gfx/bitmap.h"
|
||||||
#include "app/gfx/snes_palette.h"
|
#include "app/gfx/snes_palette.h"
|
||||||
#include "app/gfx/snes_tile.h"
|
|
||||||
#include "app/gui/canvas.h"
|
#include "app/gui/canvas.h"
|
||||||
#include "app/gui/icons.h"
|
#include "app/gui/icons.h"
|
||||||
#include "app/gui/input.h"
|
#include "app/gui/input.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user