yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
prototype_research_view.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_GRAPHICS_PROTOTYPE_RESEARCH_VIEW_H_
2#define YAZE_APP_EDITOR_GRAPHICS_PROTOTYPE_RESEARCH_VIEW_H_
3
4#include <array>
5#include <string>
6#include <vector>
7
8#include "absl/status/status.h"
10#include "app/gfx/core/bitmap.h"
13#include "app/gui/core/icons.h"
14#include "rom/rom.h"
15#include "zelda3/game_data.h"
16
17namespace yaze {
18namespace editor {
19
21 public:
22 explicit PrototypeResearchView(Rom* rom = nullptr,
23 zelda3::GameData* game_data = nullptr)
24 : rom_(rom), game_data_(game_data) {}
25
26 void Initialize();
27 void SetGameData(zelda3::GameData* game_data) { game_data_ = game_data; }
28 std::string GetId() const override { return "graphics.prototype_viewer"; }
29 std::string GetDisplayName() const override { return "Prototype Research"; }
30 std::string GetIcon() const override { return ICON_MD_CONSTRUCTION; }
31 std::string GetEditorCategory() const override { return "Graphics"; }
32 int GetPriority() const override { return 50; }
33 float GetPreferredWidth() const override { return 800.0f; }
34 void Draw(bool* p_open) override;
35
36 absl::Status Update();
37
38 private:
39 void DrawSummaryBar();
42 void DrawPreviewColumn();
44 void DrawScreenPreview();
46 void DrawEmptyState(const char* title, const char* detail);
48
49 bool DrawPathEditor(const char* id, const char* hint, std::string* path,
50 const char* browse_label, const char* browse_spec);
51
52 absl::Status DrawCgxImportSection();
53 absl::Status DrawScrImportSection();
54 absl::Status DrawPaletteSection();
55 absl::Status DrawBinImportSection();
56 absl::Status DrawClipboardSection();
57 absl::Status DrawObjImportSection();
58 absl::Status DrawTilemapImportSection();
59 absl::Status DrawExperimentalSection();
60
61 absl::Status LoadCgxData();
62 absl::Status LoadScrData();
63 absl::Status LoadColData();
64 absl::Status LoadBinPreview();
65 absl::Status LoadObjData();
66 absl::Status LoadTilemapData();
67 absl::Status ImportClipboard();
68 absl::Status RebuildScreenPreview();
69 absl::Status DecompressImportData(int size);
70 absl::Status DecompressSuperDonkey();
71
73 void ApplyPreviewPalette(gfx::Bitmap& bitmap);
74 bool UsingExternalPalette() const;
75 bool HasGraphicsPreview() const;
76 bool HasScreenPreview() const;
77 bool HasPrototypeSheetPreview() const;
78
79 int current_bpp_ = 3;
82 uint64_t rom_palette_index_ = 0;
84 uint64_t current_offset_ = 0;
85 uint64_t bin_size_ = 0x4000;
86 uint64_t clipboard_offset_ = 0;
87 uint64_t clipboard_size_ = 0x40000;
88 uint64_t num_sheets_to_load_ = 1;
89
93
95 bool open_memory_editor_ = false;
96 bool gfx_loaded_ = false;
97 bool super_donkey_ = false;
98 bool col_file_ = false;
99 bool cgx_loaded_ = false;
100 bool scr_loaded_ = false;
101 bool obj_loaded_ = false;
102 bool tilemap_loaded_ = false;
103
104 std::string bin_path_;
105 std::string col_path_;
106 std::string cgx_path_;
107 std::string scr_path_;
108 std::string obj_path_;
109 std::string tilemap_path_;
110
114 std::vector<uint8_t> import_data_;
115 std::vector<uint8_t> decoded_cgx_;
116 std::vector<uint8_t> cgx_data_;
117 std::vector<uint8_t> extra_cgx_data_;
118 std::vector<SDL_Color> decoded_col_;
119 std::vector<uint8_t> scr_data_;
120 std::vector<uint8_t> decoded_scr_data_;
124 std::array<gfx::Bitmap, zelda3::kNumGfxSheets> gfx_sheets_;
129
130 absl::Status status_;
131
132 Rom* rom_ = nullptr;
134};
135
136} // namespace editor
137} // namespace yaze
138
139#endif // YAZE_APP_EDITOR_GRAPHICS_PROTOTYPE_RESEARCH_VIEW_H_
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Definition rom.h:28
void DrawEmptyState(const char *title, const char *detail)
std::string GetDisplayName() const override
Human-readable name shown in menus and title bars.
void SetGameData(zelda3::GameData *game_data)
float GetPreferredWidth() const override
Get preferred width for this panel (optional)
std::array< gfx::Bitmap, zelda3::kNumGfxSheets > gfx_sheets_
bool DrawPathEditor(const char *id, const char *hint, std::string *path, const char *browse_label, const char *browse_spec)
PrototypeResearchView(Rom *rom=nullptr, zelda3::GameData *game_data=nullptr)
std::string GetEditorCategory() const override
Editor category this panel belongs to.
std::string GetId() const override
Unique identifier for this panel.
void Draw(bool *p_open) override
Draw the panel content.
int GetPriority() const override
Get display priority for menu ordering.
std::string GetIcon() const override
Material Design icon for this panel.
Base interface for all logical window content components.
Represents a bitmap image optimized for SNES ROM hacking.
Definition bitmap.h:67
Represents a palette of colors for the Super Nintendo Entertainment System (SNES).
Modern, robust canvas for drawing and manipulating graphics.
Definition canvas.h:150
#define ICON_MD_CONSTRUCTION
Definition icons.h:458
Represents a group of palettes.