1#ifndef YAZE_ZELDA3_DUNGEON_OBJECT_TILE_EDITOR_H_
2#define YAZE_ZELDA3_DUNGEON_OBJECT_TILE_EDITOR_H_
11#include "absl/status/status.h"
12#include "absl/status/statusor.h"
42 std::vector<ObjectTileSourceSpan>
spans;
130 const std::vector<ObjectDrawer::TileTrace>& traces);
134 const std::string& filename);
171 const std::vector<std::pair<uint32_t, uint32_t>>&
write_ranges()
const {
209 uint8_t object_size);
222 const uint8_t* room_gfx_buffer,
227 const uint8_t* room_gfx_buffer,
229 int display_palette = 2);
The Rom class is used to load, save, and modify Rom data. This is a generic SNES ROM container and do...
Represents a bitmap image optimized for SNES ROM hacking.
SNES 16-bit tile metadata container.
Captures and edits the tile8 composition of dungeon objects.
absl::Status WriteBack(const ObjectTileLayout &layout)
absl::StatusOr< ObjectTileSourceImpact > AnalyzeStandardTileSourceImpact(const ObjectTileLayout &layout) const
absl::Status ApplyStandardWritePlan(const ObjectTileWritePlan &plan)
static constexpr int kAtlasTilesPerRow
ObjectTileEditor(Rom *rom)
absl::Status RenderLayoutToBitmap(const ObjectTileLayout &layout, gfx::Bitmap &bitmap, const uint8_t *room_gfx_buffer, const gfx::PaletteGroup &palette)
static bool IsEditableStandardObject(int16_t object_id)
static constexpr int kAtlasTileRows
absl::StatusOr< ObjectTileLayout > CaptureObjectLayout(int16_t object_id, const Room &room, const gfx::PaletteGroup &palette)
static constexpr int kAtlasWidthPx
static constexpr int kAtlasTileCount
static constexpr int kAtlasHeightPx
absl::Status BuildTile8Atlas(gfx::Bitmap &atlas, const uint8_t *room_gfx_buffer, const gfx::PaletteGroup &palette, int display_palette=2)
absl::StatusOr< ObjectTileLayout > CaptureEditableObjectLayout(int16_t object_id, const Room &room, const gfx::PaletteGroup &palette)
absl::StatusOr< ObjectTileWritePlan > BuildStandardWritePlan(const ObjectTileLayout &layout) const
Fully resolved standard-object ROM writes.
ObjectTileWritePlan()=default
std::vector< std::pair< uint32_t, uint32_t > > write_ranges_
const std::vector< Write > & writes() const
std::vector< Write > writes_
const std::vector< WordPrecondition > & preconditions() const
std::vector< WordPrecondition > preconditions_
ObjectTileWritePlan(const ObjectTileWritePlan &)=default
const std::vector< std::pair< uint32_t, uint32_t > > & write_ranges() const
ObjectTileWritePlan(ObjectTileWritePlan &&) noexcept=default
ObjectTileRuntimeConsumer
Represents a group of palettes.
std::optional< ObjectTileSourceRef > source_ref
Editable tile8 layout captured from an object's draw trace.
bool HasModifications() const
std::optional< ObjectTileSourceProvenance > source_provenance
static ObjectTileLayout CreateEmpty(int width, int height, int16_t object_id, const std::string &filename)
Cell * FindCell(int rel_x, int rel_y)
std::vector< Cell > cells
std::string custom_filename
static ObjectTileLayout FromTraces(const std::vector< ObjectDrawer::TileTrace > &traces)
ObjectTileRuntimeConsumer consumer
std::vector< ObjectTileReadRange > overlapping_ranges
One standard object whose parser-visible tile sources overlap an editable layout's authorized source ...
std::vector< ObjectTileReadRange > overlapping_ranges
Fail-closed impact inventory within ObjectParser's source model plus explicitly modeled runtime consu...
size_t consumer_count() const
std::vector< ObjectTileRuntimeConsumerImpactEntry > runtime_consumers
std::vector< ObjectTileSourceImpactEntry > affected_objects
ROM descriptor and source snapshot authorizing an editable capture.
uint16_t expected_descriptor_word
uint32_t descriptor_pc_address
std::vector< ObjectTileSourceSpan > spans
A cell's exact word within an authorized source span.
One contiguous ROM-backed source span for an object's tile words.
std::vector< uint16_t > expected_words