yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
area_graphics_panel.cc
Go to the documentation of this file.
2
3#include <string>
4
7
8#include "util/log.h"
9
10namespace yaze::editor {
11
12void AreaGraphicsPanel::Draw(bool* p_open) {
13 (void)p_open;
14 auto* ow_editor = CurrentOverworldEditor();
15 if (!ow_editor)
16 return;
17
18 // Log a failure once per distinct message; this runs every frame.
19 static std::string last_error;
20 if (auto status = ow_editor->DrawAreaGraphics(); !status.ok()) {
21 if (status.ToString() != last_error) {
22 last_error = status.ToString();
23 LOG_ERROR("AreaGraphicsPanel", "Failed to draw: %s", last_error.c_str());
24 }
25 } else {
26 last_error.clear();
27 }
28}
29
31
32} // namespace yaze::editor
Displays the current area's GFX sheet for preview.
void Draw(bool *p_open) override
Draw the panel content.
#define LOG_ERROR(category, format,...)
Definition log.h:140
Editors are the view controllers for the application.
OverworldEditor * CurrentOverworldEditor()
#define REGISTER_PANEL(PanelClass)
Auto-registration macro for panels with default constructors.