yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
overworld_render_commands.h
Go to the documentation of this file.
1#ifndef YAZE_SRC_CLI_HANDLERS_GAME_OVERWORLD_RENDER_COMMANDS_H_
2#define YAZE_SRC_CLI_HANDLERS_GAME_OVERWORLD_RENDER_COMMANDS_H_
3
4#include <optional>
5#include <string>
6
7#include "absl/status/statusor.h"
10
11namespace yaze {
12namespace cli {
13namespace handlers {
14
15// Raw runtime graphics an overworld render applies before drawing.
17 std::string mode; // project, file, off, none
18 std::string manifest; // manifest path; empty for off and none
20};
21
22// Resolves --graphics-preview. Unset or "on" loads the project's
23// [files] overworld_graphics_preview ("on" fails without one), "off" renders
24// the ROM's graphics only, and any other value is a manifest path.
25absl::StatusOr<OverworldRenderGraphicsPreview>
27 const std::optional<std::string>& flag);
28
29// Render the overworld area containing a screen to a PNG file from current
30// ROM data. A child screen of a large/wide/tall area resolves to its parent
31// and the whole area is rendered.
32//
33// Usage:
34// overworld-render --screen=<hex> --out=<path.png>
35// [--overlays=sprites,entrances,exits,holes,items,grid,all]
36// [--phase=0|1|2] [--scale=<float>] [--area-overlay=on|off]
37// [--graphics-preview=on|off|<manifest.json>]
38//
39// The area's subscreen overlay (sky, fog, lava, canopy, rain, ...) is
40// composited by default the way the game layers it; --area-overlay=off
41// renders the bare area.
42//
43// With --project-context, graphics a hack DMAs at runtime (the project's
44// [files] overworld_graphics_preview manifest) replace the area's tiles the
45// way the editor canvas shows them; --graphics-preview=off draws the ROM's
46// sheets only.
48 public:
49 std::string GetName() const override { return "overworld-render"; }
50 std::string GetDescription() const {
51 return "Render an overworld area (with overlays) to PNG";
52 }
53 std::string GetUsage() const override {
54 return "overworld-render --screen=<hex> --out=<path.png> "
55 "[--overlays=sprites,entrances,exits,holes,items,grid,all] "
56 "[--phase=0|1|2] [--scale=<float>] [--area-overlay=on|off] "
57 "[--graphics-preview=on|off|<manifest.json>]";
58 }
59
60 absl::Status ValidateArgs(const resources::ArgumentParser& parser) override;
61 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
62 resources::OutputFormatter& formatter) override;
63 absl::Status ExecuteWithContext(
64 Rom* rom, const resources::ArgumentParser& parser,
66 const resources::CommandInvocationContext& invocation_context) override;
67
68 private:
69 std::string GetDefaultFormat() const override { return "json"; }
70 std::string GetOutputTitle() const override { return "Overworld Render"; }
71};
72
73// Build-time validation of a project's managed terrain against native ROM data.
74// Emits verified inputs for the Oracle compiler without rendering or writing.
76 public:
77 std::string GetName() const override { return "lyra-verify-project"; }
78 std::string GetUsage() const override {
79 return "lyra-verify-project --project-context=<project.yaze> "
80 "--rom=<source>";
81 }
82 absl::Status ValidateArgs(const resources::ArgumentParser&) override {
83 return absl::OkStatus();
84 }
85 absl::Status Execute(Rom* rom, const resources::ArgumentParser& parser,
86 resources::OutputFormatter& formatter) override;
87
88 protected:
89 virtual bool InspectAssets() const { return false; }
90
91 private:
92 std::string GetDefaultFormat() const override { return "json"; }
93 std::string GetOutputTitle() const override { return "Lyra Project Inputs"; }
94};
95
96// Read-only migration evidence; never rebinds a document or verifies stale data.
99 public:
100 std::string GetName() const override { return "lyra-inspect-project"; }
101 std::string GetUsage() const override {
102 return "lyra-inspect-project --project-context=<project.yaze> "
103 "--rom=<source>";
104 }
105
106 protected:
107 bool InspectAssets() const override { return true; }
108
109 private:
110 std::string GetOutputTitle() const override {
111 return "Lyra Asset Inspection";
112 }
113};
114
115} // namespace handlers
116} // namespace cli
117} // namespace yaze
118
119#endif // YAZE_SRC_CLI_HANDLERS_GAME_OVERWORLD_RENDER_COMMANDS_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:52
std::string GetOutputTitle() const override
Get the output title for formatting.
std::string GetUsage() const override
Get the command usage string.
std::string GetName() const override
Get the command name.
std::string GetUsage() const override
Get the command usage string.
absl::Status ValidateArgs(const resources::ArgumentParser &) override
Validate command arguments.
std::string GetOutputTitle() const override
Get the output title for formatting.
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
std::string GetName() const override
Get the command name.
std::string GetDefaultFormat() const override
Get the default output format ("json" or "text")
std::string GetName() const override
Get the command name.
absl::Status ValidateArgs(const resources::ArgumentParser &parser) override
Validate command arguments.
std::string GetUsage() const override
Get the command usage string.
absl::Status ExecuteWithContext(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter, const resources::CommandInvocationContext &invocation_context) override
Execute with immutable, invocation-scoped ROM path identity.
std::string GetOutputTitle() const override
Get the output title for formatting.
std::string GetDefaultFormat() const override
Get the default output format ("json" or "text")
absl::Status Execute(Rom *rom, const resources::ArgumentParser &parser, resources::OutputFormatter &formatter) override
Execute the command business logic.
Utility for parsing common CLI argument patterns.
Base class for CLI command handlers.
Utility for consistent output formatting across commands.
absl::StatusOr< OverworldRenderGraphicsPreview > ResolveOverworldRenderGraphicsPreview(const project::YazeProject *project, const std::optional< std::string > &flag)
std::map< int, AreaGraphicsPreview > OverworldGraphicsPreview
Modern project structure with comprehensive settings consolidation.
Definition project.h:290